History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

No conflicts.

Jakub Kicinski committed 5 years ago

Commit 9fe11552 parents c514fbb 1da3854265 files · +2787 −1902Browse files

Unified · Split

265 files
  1. CREDITS +1 −0
  2. Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml +0 −2
  3. Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml +1 −1
  4. Documentation/devicetree/bindings/interconnect/qcom,sdm660.yaml +42 −4
  5. Documentation/devicetree/bindings/media/i2c/ovti,ov5647.yaml +1 −1
  6. Documentation/devicetree/bindings/media/i2c/ovti,ov9282.yaml +1 −1
  7. Documentation/devicetree/bindings/media/i2c/sony,imx335.yaml +1 −1
  8. Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml +1 −1
  9. Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml +1 −3
  10. Documentation/devicetree/bindings/net/dsa/marvell.txt +1 −1
  11. Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml +0 −1
  12. Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml +0 −1
  13. Documentation/hwmon/k10temp.rst +0 −17
  14. MAINTAINERS +13 −9
  15. Makefile +1 −1
  16. arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +0 −1
  17. arch/arm/boot/dts/at91-sama7g5ek.dts +39 −6
  18. arch/arm/boot/dts/imx53-m53menlo.dts +2 −2
  19. arch/arm/boot/dts/imx6dl-yapp4-common.dtsi +5 −0
  20. arch/arm/boot/dts/imx6qdl-pico.dtsi +11 −0
  21. arch/arm/boot/dts/imx6sx-sdb.dts +2 −2
  22. arch/arm/boot/dts/imx6ul-14x14-evk.dtsi +1 −1
  23. arch/arm/boot/dts/omap3430-sdp.dts +1 −1
  24. arch/arm/boot/dts/qcom-apq8064.dtsi +7 −8
  25. arch/arm/boot/dts/sama7g5.dtsi +39 −0
  26. arch/arm/boot/dts/vexpress-v2m-rs1.dtsi +60 −7
  27. arch/arm/boot/dts/vexpress-v2m.dtsi +60 −5
  28. arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts +1 −56
  29. arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts +1 −56
  30. arch/arm/boot/dts/vexpress-v2p-ca5s.dts +1 −56
  31. arch/arm/boot/dts/vexpress-v2p-ca9.dts +0 −58
  32. arch/arm/common/sharpsl_param.c +3 −1
  33. arch/arm/configs/gemini_defconfig +1 −0
  34. arch/arm/configs/imx_v6_v7_defconfig +1 −0
  35. arch/arm/configs/multi_v7_defconfig +3 −0
  36. arch/arm/mach-at91/pm.c +114 −16
  37. arch/arm/mach-at91/pm_suspend.S +33 −9
  38. arch/arm/mach-dove/include/mach/uncompress.h +2 −2
  39. arch/arm/mach-imx/mach-imx6q.c +3 −0
  40. arch/arm/mach-imx/pm-imx6.c +2 −0
  41. arch/arm/mach-omap1/include/mach/memory.h +0 −12
  42. arch/arm/mach-omap1/usb.c +82 −34
  43. arch/arm/mach-omap2/omap_hwmod.c +2 −0
  44. arch/arm/net/bpf_jit_32.c +19 −0
  45. arch/arm64/boot/dts/arm/foundation-v8.dtsi +0 −1
  46. arch/arm64/boot/dts/arm/fvp-base-revc.dts +0 −23
  47. arch/arm64/boot/dts/arm/juno-base.dtsi +0 −12
  48. arch/arm64/boot/dts/arm/juno-motherboard.dtsi +14 −7
  49. arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts +0 −11
  50. arch/arm64/boot/dts/arm/rtsm_ve-motherboard-rs2.dtsi +1 −1
  51. arch/arm64/boot/dts/arm/rtsm_ve-motherboard.dtsi +14 −6
  52. arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts +1 −56
  53. arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +2 −2
  54. arch/arm64/boot/dts/freescale/imx8mm-beacon-som.dtsi +1 −1
  55. arch/arm64/boot/dts/freescale/imx8mm-evk.dts +1 −1
  56. arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi +1 −0
  57. arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dts +1 −1
  58. arch/arm64/boot/dts/freescale/imx8mn-beacon-som.dtsi +1 −1
  59. arch/arm64/boot/dts/freescale/imx8mn-venice-gw7902.dts +1 −1
  60. arch/arm64/boot/dts/freescale/imx8mp-phycore-som.dtsi +1 −1
  61. arch/arm64/boot/dts/freescale/imx8mq-evk.dts +2 −0
  62. arch/arm64/boot/dts/freescale/imx8mq-kontron-pitx-imx8m.dts +1 −1
  63. arch/arm64/boot/dts/qcom/pm8150.dtsi +3 −1
  64. arch/arm64/boot/dts/qcom/qrb5165-rb5.dts +10 −0
  65. arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi +4 −5
  66. arch/arm64/boot/dts/qcom/sc7280.dtsi +3 −3
  67. arch/arm64/boot/dts/qcom/sdm630.dtsi +13 −2
  68. arch/arm64/boot/dts/qcom/sdm845.dtsi +13 −8
  69. arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts +34 −0
  70. arch/mips/include/asm/mips-cps.h +1 −22
  71. arch/powerpc/boot/dts/fsl/t1023rdb.dts +1 −1
  72. arch/x86/events/core.c +1 −0
  73. arch/x86/events/intel/core.c +1 −0
  74. arch/x86/hyperv/hv_apic.c +15 −5
  75. arch/x86/include/asm/kvmclock.h +14 −0
  76. arch/x86/kernel/kvmclock.c +2 −11
  77. arch/x86/kvm/cpuid.c +2 −2
  78. arch/x86/kvm/emulate.c +0 −1
  79. arch/x86/kvm/vmx/vmx.c +1 −1
  80. block/bfq-iosched.c +3 −13
  81. drivers/acpi/nfit/core.c +12 −0
  82. drivers/base/core.c +63 −27
  83. drivers/block/nbd.c +17 −12
  84. drivers/bus/ti-sysc.c +4 −0
  85. drivers/firmware/Kconfig +1 −1
  86. drivers/firmware/arm_scmi/Kconfig +1 −1
  87. drivers/firmware/arm_scmi/virtio.c +31 −13
  88. drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +31 −0
  89. drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 −1
  90. drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +2 −1
  91. drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 −1
  92. drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +8 −0
  93. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 −0
  94. drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +7 −8
  95. drivers/gpu/drm/exynos/exynos5433_drm_decon.c +1 −3
  96. drivers/gpu/drm/exynos/exynos_drm_dsi.c +1 −3
  97. drivers/gpu/drm/exynos/exynos_drm_fimc.c +1 −4
  98. drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 −3
  99. drivers/gpu/drm/exynos/exynos_drm_g2d.c +1 −4
  100. drivers/gpu/drm/exynos/exynos_drm_gsc.c +1 −5
  101. drivers/gpu/drm/exynos/exynos_drm_rotator.c +1 −3
  102. drivers/gpu/drm/exynos/exynos_drm_scaler.c +1 −3
  103. drivers/gpu/drm/exynos/exynos_hdmi.c +1 −3
  104. drivers/gpu/drm/i915/gt/intel_context.c +3 −2
  105. drivers/gpu/drm/i915/gt/intel_rps.c +0 −2
  106. drivers/gpu/drm/i915/gt/uc/abi/guc_communication_ctb_abi.h +5 −5
  107. drivers/gpu/drm/i915/gt/uc/abi/guc_communication_mmio_abi.h +5 −5
  108. drivers/gpu/drm/i915/gvt/scheduler.c +2 −2
  109. drivers/gpu/drm/i915/i915_request.c +2 −9
  110. drivers/gpu/drm/tegra/dc.c +0 −3
  111. drivers/gpu/drm/tegra/dc.h +0 −6
  112. drivers/gpu/drm/tegra/uapi.c +1 −1
  113. drivers/gpu/host1x/fence.c +4 −2
  114. drivers/hwmon/k10temp.c +0 −6
  115. drivers/hwmon/ltc2947-core.c +6 −2
  116. drivers/hwmon/mlxreg-fan.c +9 −3
  117. drivers/hwmon/occ/common.c +5 −12
  118. drivers/hwmon/pmbus/ibm-cffps.c +8 −2
  119. drivers/hwmon/pmbus/mp2975.c +1 −1
  120. drivers/hwmon/tmp421.c +39 −32
  121. drivers/hwmon/w83791d.c +11 −18
  122. drivers/hwmon/w83792d.c +11 −17
  123. drivers/hwmon/w83793.c +11 −15
  124. drivers/interconnect/qcom/sdm660.c +19 −6
  125. drivers/iommu/apple-dart.c +35 −21
  126. drivers/iommu/intel/dmar.c +3 −3
  127. drivers/ipack/devices/ipoctal.c +47 −16
  128. drivers/net/ethernet/google/gve/gve.h +1 −1
  129. drivers/net/ethernet/google/gve/gve_main.c +29 −16
  130. drivers/net/ethernet/google/gve/gve_rx.c +7 −1
  131. drivers/net/ethernet/intel/i40e/i40e_main.c +3 −2
  132. drivers/net/ethernet/intel/iavf/iavf_main.c +0 −1
  133. drivers/net/ethernet/mscc/ocelot_vcap.c +2 −2
  134. drivers/net/ethernet/pensando/ionic/ionic_lif.c +3 −1
  135. drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c +0 −3
  136. drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +5 −0
  137. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +5 −1
  138. drivers/net/pcs/pcs-xpcs.c +36 −9
  139. drivers/net/phy/mdio_bus.c +11 −1
  140. drivers/net/phy/sfp.c +1 −1
  141. drivers/net/usb/r8152.c +15 −1
  142. drivers/net/wireless/ath/ath5k/Kconfig +1 −3
  143. drivers/net/wireless/ath/ath5k/led.c +6 −4
  144. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +6 −11
  145. drivers/net/wireless/intel/iwlwifi/mvm/d3.c +3 −2
  146. drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +2 −1
  147. drivers/net/wireless/intel/iwlwifi/pcie/drv.c +2 −0
  148. drivers/net/wireless/marvell/mwifiex/sta_tx.c +2 −2
  149. drivers/net/wireless/marvell/mwifiex/uap_txrx.c +2 −2
  150. drivers/nvdimm/pmem.c +1 −4
  151. drivers/nvme/host/core.c +3 −1
  152. drivers/nvme/host/nvme.h +6 −0
  153. drivers/nvme/host/pci.c +2 −1
  154. drivers/pci/controller/pci-hyperv.c +10 −3
  155. drivers/ptp/ptp_kvm_x86.c +2 −7
  156. drivers/ptp/ptp_pch.c +1 −0
  157. drivers/s390/cio/blacklist.c +5 −3
  158. drivers/s390/cio/css.c +31 −9
  159. drivers/s390/cio/css.h +9 −1
  160. drivers/scsi/csiostor/csio_init.c +1 −0
  161. drivers/scsi/qla2xxx/qla_isr.c +2 −2
  162. drivers/scsi/ses.c +1 −1
  163. drivers/scsi/ufs/ufshcd.c +1 −2
  164. drivers/scsi/virtio_scsi.c +2 −2
  165. drivers/soc/qcom/mdt_loader.c +1 −1
  166. drivers/soc/qcom/socinfo.c +1 −1
  167. drivers/soc/ti/omap_prm.c +15 −12
  168. drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c +2 −0
  169. drivers/tee/optee/shm_pool.c +1 −1
  170. drivers/usb/host/ohci-omap.c +2 −70
  171. fs/9p/cache.c +4 −4
  172. fs/9p/fid.c +7 −7
  173. fs/9p/v9fs.c +3 −5
  174. fs/9p/vfs_addr.c +9 −5
  175. fs/9p/vfs_file.c +12 −21
  176. fs/9p/vfs_inode.c +16 −8
  177. fs/9p/vfs_inode_dotl.c +9 −2
  178. fs/afs/dir_silly.c +2 −2
  179. fs/afs/write.c +1 −2
  180. fs/binfmt_elf.c +1 −1
  181. fs/debugfs/inode.c +1 −1
  182. fs/ext4/dir.c +3 −3
  183. fs/ext4/ext4.h +0 −3
  184. fs/ext4/extents.c +14 −5
  185. fs/ext4/fast_commit.c +6 −0
  186. fs/ext4/inline.c +85 −65
  187. fs/ext4/inode.c +59 −117
  188. fs/ext4/super.c +15 −6
  189. fs/fscache/object.c +1 −1
  190. fs/fscache/operation.c +3 −0
  191. fs/io-wq.c +1 −4
  192. fs/io_uring.c +2 −15
  193. fs/kernfs/dir.c +7 −2
  194. fs/ksmbd/auth.c +0 −205
  195. fs/ksmbd/crypto_ctx.c +0 −16
  196. fs/ksmbd/crypto_ctx.h +0 −8
  197. fs/ksmbd/misc.c +7 −10
  198. fs/ksmbd/oplock.c +31 −10
  199. fs/ksmbd/smb2pdu.c +196 −60
  200. fs/ksmbd/smb2pdu.h +9 −0
  201. fs/ksmbd/smb_common.c +28 −19
  202. fs/ksmbd/smb_common.h +0 −8
  203. fs/ksmbd/smbacl.c +19 −2
  204. fs/ksmbd/transport_tcp.c +2 −2
  205. fs/netfs/read_helper.c +1 −1
  206. fs/nfs_common/grace.c +0 −1
  207. fs/nfsd/filecache.c +1 −1
  208. fs/nfsd/nfs4xdr.c +11 −8
  209. fs/nfsd/nfsctl.c +5 −2
  210. fs/overlayfs/dir.c +7 −3
  211. fs/overlayfs/file.c +14 −1
  212. include/linux/cpumask.h +4 −3
  213. include/linux/etherdevice.h +1 −1
  214. include/linux/fwnode.h +8 −3
  215. include/linux/perf_event.h +3 −1
  216. include/linux/platform_data/usb-omap1.h +2 −0
  217. include/linux/sched.h +1 −1
  218. include/net/netfilter/ipv6/nf_defrag_ipv6.h +0 −1
  219. include/net/netfilter/nf_tables.h +1 −1
  220. include/net/netns/netfilter.h +6 −0
  221. include/net/sock.h +1 −0
  222. include/soc/mscc/ocelot_vcap.h +2 −2
  223. include/trace/events/cachefiles.h +3 −3
  224. include/uapi/linux/hyperv.h +1 −1
  225. include/uapi/linux/xfrm.h +9 −6
  226. kernel/bpf/stackmap.c +2 −1
  227. kernel/events/core.c +30 −4
  228. kernel/sched/debug.c +7 −1
  229. kernel/sched/fair.c +5 −1
  230. net/bridge/br_netlink.c +2 −1
  231. net/core/rtnetlink.c +1 −1
  232. net/dsa/tag_dsa.c +1 −1
  233. net/ipv4/inet_hashtables.c +3 −1
  234. net/ipv4/netfilter/nf_defrag_ipv4.c +9 −21
  235. net/ipv4/udp.c +2 −1
  236. net/ipv6/inet6_hashtables.c +1 −1
  237. net/ipv6/netfilter/nf_conntrack_reasm.c +1 −1
  238. net/ipv6/netfilter/nf_defrag_ipv6_hooks.c +9 −16
  239. net/ipv6/udp.c +2 −1
  240. net/netfilter/nf_tables_api.c +64 −27
  241. net/netfilter/nft_quota.c +1 −1
  242. net/netlink/af_netlink.c +10 −4
  243. net/sched/sch_fifo.c +3 −0
  244. net/sched/sch_taprio.c +4 −0
  245. net/sunrpc/auth_gss/svcauth_gss.c +1 −1
  246. net/unix/af_unix.c +5 −4
  247. net/xfrm/xfrm_user.c +55 −12
  248. samples/bpf/Makefile +8 −9
  249. samples/bpf/bpf_insn.h +1 −1
  250. samples/bpf/xdp_redirect_map_multi.bpf.c +0 −5
  251. security/selinux/nlmsgtab.c +3 −1
  252. tools/include/uapi/sound/asound.h +1 −0
  253. tools/lib/bpf/libbpf.c +2 −1
  254. tools/lib/bpf/strset.c +1 −0
  255. tools/objtool/special.c +30 −8
  256. tools/perf/Makefile.config +1 −1
  257. tools/perf/Makefile.perf +1 −1
  258. tools/perf/pmu-events/jevents.c +2 −0
  259. tools/perf/tests/attr/test-stat-default +97 −0
  260. tools/perf/tests/attr/test-stat-detailed-1 +105 −8
  261. tools/perf/tests/attr/test-stat-detailed-2 +117 −20
  262. tools/perf/tests/attr/test-stat-detailed-3 +121 −24
  263. tools/testing/selftests/drivers/dma-buf/udmabuf.c +4 −1
  264. tools/testing/selftests/kvm/include/x86_64/processor.h +1 −1
  265. tools/testing/selftests/kvm/rseq_test.c +59 −10
CREDITS+1−0
@@ -971,6 +971,7 @@ D: PowerPC · 970 unmodified lines
971971 N: Daniel Drake
972972 E: dsd@gentoo.org
973973 D: USBAT02 CompactFlash support in usb-storage
974+D: ZD1211RW wireless driver
974975 S: UK
975976
976977 N: Oleg Drokin
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml+0−2
@@ -50,7 +50,6 @@ properties: · 49 unmodified lines
5050 data-lanes:
5151 description: array of physical DSI data lane indexes.
5252 minItems: 1
53− maxItems: 4
5453 items:
5554 - const: 1
5655 - const: 2
@@ -71,7 +70,6 @@ properties: · 14 unmodified lines
7170 data-lanes:
7271 description: array of physical DSI data lane indexes.
7372 minItems: 1
74− maxItems: 4
7573 items:
7674 - const: 1
7775 - const: 2
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml+1−1
@@ -18,7 +18,7 @@ properties: · 17 unmodified lines
1818 const: ti,sn65dsi86
1919
2020 reg:
21− const: 0x2d
21+ enum: [ 0x2c, 0x2d ]
2222
2323 enable-gpios:
2424 maxItems: 1
Documentation/devicetree/bindings/interconnect/qcom,sdm660.yaml+42−4
@@ -31,11 +31,11 @@ properties: · 30 unmodified lines
3131
3232 clocks:
3333 minItems: 1
34− maxItems: 3
34+ maxItems: 7
3535
3636 clock-names:
3737 minItems: 1
38− maxItems: 3
38+ maxItems: 7
3939
4040 required:
4141 - compatible
@@ -72,6 +72,32 @@ allOf: · 30 unmodified lines
7272 contains:
7373 enum:
7474 - qcom,sdm660-a2noc
75+ then:
76+ properties:
77+ clocks:
78+ items:
79+ - description: Bus Clock.
80+ - description: Bus A Clock.
81+ - description: IPA Clock.
82+ - description: UFS AXI Clock.
83+ - description: Aggregate2 UFS AXI Clock.
84+ - description: Aggregate2 USB3 AXI Clock.
85+ - description: Config NoC USB2 AXI Clock.
86+ clock-names:
87+ items:
88+ - const: bus
89+ - const: bus_a
90+ - const: ipa
91+ - const: ufs_axi
92+ - const: aggre2_ufs_axi
93+ - const: aggre2_usb3_axi
94+ - const: cfg_noc_usb2_axi
95+
96+ - if:
97+ properties:
98+ compatible:
99+ contains:
100+ enum:
75101 - qcom,sdm660-bimc
76102 - qcom,sdm660-cnoc
77103 - qcom,sdm660-gnoc
@@ -91,6 +117,7 @@ examples: · 13 unmodified lines
91117 - |
92118 #include <dt-bindings/clock/qcom,rpmcc.h>
93119 #include <dt-bindings/clock/qcom,mmcc-sdm660.h>
120+ #include <dt-bindings/clock/qcom,gcc-sdm660.h>
94121
95122 bimc: interconnect@1008000 {
96123 compatible = "qcom,sdm660-bimc";
@@ -123,9 +150,20 @@ examples: · 26 unmodified lines
123150 compatible = "qcom,sdm660-a2noc";
124151 reg = <0x01704000 0xc100>;
125152 #interconnect-cells = <1>;
126− clock-names = "bus", "bus_a";
153+ clock-names = "bus",
154+ "bus_a",
155+ "ipa",
156+ "ufs_axi",
157+ "aggre2_ufs_axi",
158+ "aggre2_usb3_axi",
159+ "cfg_noc_usb2_axi";
127160 clocks = <&rpmcc RPM_SMD_AGGR2_NOC_CLK>,
128− <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>;
161+ <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>,
162+ <&rpmcc RPM_SMD_IPA_CLK>,
163+ <&gcc GCC_UFS_AXI_CLK>,
164+ <&gcc GCC_AGGRE2_UFS_AXI_CLK>,
165+ <&gcc GCC_AGGRE2_USB3_AXI_CLK>,
166+ <&gcc GCC_CFG_NOC_USB2_AXI_CLK>;
129167 };
130168
131169 mnoc: interconnect@1745000 {
Documentation/devicetree/bindings/media/i2c/ovti,ov5647.yaml+1−1
@@ -31,7 +31,7 @@ properties: · 30 unmodified lines
3131 maxItems: 1
3232
3333 port:
34− $ref: /schemas/graph.yaml#/properties/port
34+ $ref: /schemas/graph.yaml#/$defs/port-base
3535 additionalProperties: false
3636
3737 properties:
Documentation/devicetree/bindings/media/i2c/ovti,ov9282.yaml+1−1
@@ -38,7 +38,7 @@ properties: · 37 unmodified lines
3838
3939 port:
4040 additionalProperties: false
41− $ref: /schemas/graph.yaml#/properties/port
41+ $ref: /schemas/graph.yaml#/$defs/port-base
4242
4343 properties:
4444 endpoint:
Documentation/devicetree/bindings/media/i2c/sony,imx335.yaml+1−1
@@ -38,7 +38,7 @@ properties: · 37 unmodified lines
3838
3939 port:
4040 additionalProperties: false
41− $ref: /schemas/graph.yaml#/properties/port
41+ $ref: /schemas/graph.yaml#/$defs/port-base
4242
4343 properties:
4444 endpoint:
Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml+1−1
@@ -38,7 +38,7 @@ properties: · 37 unmodified lines
3838
3939 port:
4040 additionalProperties: false
41− $ref: /schemas/graph.yaml#/properties/port
41+ $ref: /schemas/graph.yaml#/$defs/port-base
4242
4343 properties:
4444 endpoint:
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml+1−3
@@ -20,9 +20,7 @@ properties: · 19 unmodified lines
2020 - snps,dwcmshc-sdhci
2121
2222 reg:
23− minItems: 1
24− items:
25− - description: Offset and length of the register set for the device
23+ maxItems: 1
2624
2725 interrupts:
2826 maxItems: 1
Documentation/devicetree/bindings/net/dsa/marvell.txt+1−1
@@ -83,7 +83,7 @@ Example: · 82 unmodified lines
8383 #interrupt-cells = <2>;
8484
8585 switch0: switch@0 {
86− compatible = "marvell,mv88e6390";
86+ compatible = "marvell,mv88e6190";
8787 reg = <0>;
8888 reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
8989
Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml+0−1
@@ -34,7 +34,6 @@ properties: · 33 unmodified lines
3434
3535 clocks:
3636 minItems: 3
37− maxItems: 5
3837 items:
3938 - description: MAC host clock
4039 - description: MAC apb clock
Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml+0−1
@@ -41,7 +41,6 @@ properties: · 40 unmodified lines
4141 - description: builtin MSI controller.
4242
4343 interrupt-names:
44− minItems: 1
4544 items:
4645 - const: msi
4746
Documentation/hwmon/k10temp.rst+0−17
@@ -132,20 +132,3 @@ On Family 17h and Family 18h CPUs, additional temperature sensors may report · 131 unmodified lines
132132 Core Complex Die (CCD) temperatures. Up to 8 such temperatures are reported
133133 as temp{3..10}_input, labeled Tccd{1..8}. Actual support depends on the CPU
134134 variant.
135−
136−Various Family 17h and 18h CPUs report voltage and current telemetry
137−information. The following attributes may be reported.
138−
139−Attribute Label Description
140−=============== ======= ================
141−in0_input Vcore Core voltage
142−in1_input Vsoc SoC voltage
143−curr1_input Icore Core current
144−curr2_input Isoc SoC current
145−=============== ======= ================
146−
147−Current values are raw (unscaled) as reported by the CPU. Core current is
148−reported as multiples of 1A / LSB. SoC is reported as multiples of 0.25A
149−/ LSB. The real current is board specific. Reported currents should be seen
150−as rough guidance, and should be scaled using sensors3.conf as appropriate
151−for a given board.
MAINTAINERS+13−9
@@ -414,7 +414,8 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 413 unmodified lines
414414 F: drivers/acpi/pmic/
415415
416416 ACPI THERMAL DRIVER
417−M: Zhang Rui <rui.zhang@intel.com>
417+M: Rafael J. Wysocki <rafael@kernel.org>
418+R: Zhang Rui <rui.zhang@intel.com>
418419 L: linux-acpi@vger.kernel.org
419420 S: Supported
420421 W: https://01.org/linux-acpi
@@ -1275,6 +1276,7 @@ F: drivers/input/mouse/bcm5974.c · 854 unmodified lines
12751276
12761277 APPLE DART IOMMU DRIVER
12771278 M: Sven Peter <sven@svenpeter.dev>
1279+R: Alyssa Rosenzweig <alyssa@rosenzweig.io>
12781280 L: iommu@lists.linux-foundation.org
12791281 S: Maintained
12801282 F: Documentation/devicetree/bindings/iommu/apple,dart.yaml
@@ -1711,6 +1713,8 @@ F: drivers/*/*alpine* · 430 unmodified lines
17111713
17121714 ARM/APPLE MACHINE SUPPORT
17131715 M: Hector Martin <marcan@marcan.st>
1716+M: Sven Peter <sven@svenpeter.dev>
1717+R: Alyssa Rosenzweig <alyssa@rosenzweig.io>
17141718 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
17151719 S: Maintained
17161720 W: https://asahilinux.org
@@ -2236,6 +2240,7 @@ F: arch/arm/mach-pxa/mioa701.c · 519 unmodified lines
22362240
22372241 ARM/MStar/Sigmastar Armv7 SoC support
22382242 M: Daniel Palmer <daniel@thingy.jp>
2243+M: Romain Perier <romain.perier@gmail.com>
22392244 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
22402245 S: Maintained
22412246 W: http://linux-chenxing.org/
@@ -2712,6 +2717,7 @@ F: drivers/power/reset/keystone-reset.c · 470 unmodified lines
27122717
27132718 ARM/TEXAS INSTRUMENTS K3 ARCHITECTURE
27142719 M: Nishanth Menon <nm@ti.com>
2720+M: Vignesh Raghavendra <vigneshr@ti.com>
27152721 M: Tero Kristo <kristo@kernel.org>
27162722 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
27172723 S: Supported
@@ -4656,7 +4662,7 @@ W: http://linux-cifs.samba.org/ · 1938 unmodified lines
46564662 T: git git://git.samba.org/sfrench/cifs-2.6.git
46574663 F: Documentation/admin-guide/cifs/
46584664 F: fs/cifs/
4659−F: fs/cifs_common/
4665+F: fs/smbfs_common/
46604666
46614667 COMPACTPCI HOTPLUG CORE
46624668 M: Scott Murray <scott@spiteful.org>
@@ -8608,9 +8614,8 @@ F: Documentation/devicetree/bindings/iio/humidity/st,hts221.yaml · 3945 unmodified lines
86088614 F: drivers/iio/humidity/hts221*
86098615
86108616 HUAWEI ETHERNET DRIVER
8611−M: Bin Luo <luobin9@huawei.com>
86128617 L: netdev@vger.kernel.org
8613−S: Supported
8618+S: Orphan
86148619 F: Documentation/networking/device_drivers/ethernet/huawei/hinic.rst
86158620 F: drivers/net/ethernet/huawei/hinic/
86168621
@@ -10194,8 +10199,8 @@ M: Hyunchul Lee <hyc.lee@gmail.com> · 1577 unmodified lines
1019410199 L: linux-cifs@vger.kernel.org
1019510200 S: Maintained
1019610201 T: git git://git.samba.org/ksmbd.git
10197−F: fs/cifs_common/
1019810202 F: fs/ksmbd/
10203+F: fs/smbfs_common/
1019910204
1020010205 KERNEL UNIT TESTING FRAMEWORK (KUnit)
1020110206 M: Brendan Higgins <brendanhiggins@google.com>
@@ -17793,7 +17798,6 @@ F: drivers/staging/nvec/ · 7591 unmodified lines
1779317798
1779417799 STAGING - OLPC SECONDARY DISPLAY CONTROLLER (DCON)
1779517800 M: Jens Frederich <jfrederich@gmail.com>
17796−M: Daniel Drake <dsd@laptop.org>
1779717801 M: Jon Nettleton <jon.nettleton@gmail.com>
1779817802 S: Maintained
1779917803 W: http://wiki.laptop.org/go/DCON
@@ -18549,13 +18553,14 @@ T: git git://linuxtv.org/media_tree.git · 749 unmodified lines
1854918553 F: drivers/media/radio/radio-raremono.c
1855018554
1855118555 THERMAL
18552−M: Zhang Rui <rui.zhang@intel.com>
18556+M: Rafael J. Wysocki <rafael@kernel.org>
1855318557 M: Daniel Lezcano <daniel.lezcano@linaro.org>
1855418558 R: Amit Kucheria <amitk@kernel.org>
18559+R: Zhang Rui <rui.zhang@intel.com>
1855518560 L: linux-pm@vger.kernel.org
1855618561 S: Supported
1855718562 Q: https://patchwork.kernel.org/project/linux-pm/list/
18558−T: git git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git
18563+T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
1855918564 F: Documentation/devicetree/bindings/thermal/
1856018565 F: drivers/thermal/
1856118566 F: include/linux/cpu_cooling.h
@@ -20698,7 +20703,6 @@ S: Maintained · 2136 unmodified lines
2069820703 F: mm/zbud.c
2069920704
2070020705 ZD1211RW WIRELESS DRIVER
20701−M: Daniel Drake <dsd@gentoo.org>
2070220706 M: Ulrich Kunitz <kune@deine-taler.de>
2070320707 L: linux-wireless@vger.kernel.org
2070420708 L: zd1211-devs@lists.sourceforge.net (subscribers-only)
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 15
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc3
5+EXTRAVERSION = -rc4
66 NAME = Opossums on Parade
77
88 # *DOCUMENTATION*
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts+0−1
@@ -71,7 +71,6 @@ · 70 unmodified lines
7171 isc: isc@f0008000 {
7272 pinctrl-names = "default";
7373 pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>;
74− status = "okay";
7574 };
7675
7776 qspi1: spi@f0024000 {
arch/arm/boot/dts/at91-sama7g5ek.dts+39−6
@@ -196,11 +196,13 @@ · 195 unmodified lines
196196
197197 regulator-state-standby {
198198 regulator-on-in-suspend;
199+ regulator-suspend-microvolt = <1350000>;
199200 regulator-mode = <4>;
200201 };
201202
202203 regulator-state-mem {
203204 regulator-on-in-suspend;
205+ regulator-suspend-microvolt = <1350000>;
204206 regulator-mode = <4>;
205207 };
206208 };
@@ -353,7 +355,10 @@ · 146 unmodified lines
353355 #address-cells = <1>;
354356 #size-cells = <0>;
355357 pinctrl-names = "default";
356− pinctrl-0 = <&pinctrl_gmac0_default &pinctrl_gmac0_txck_default &pinctrl_gmac0_phy_irq>;
358+ pinctrl-0 = <&pinctrl_gmac0_default
359+ &pinctrl_gmac0_mdio_default
360+ &pinctrl_gmac0_txck_default
361+ &pinctrl_gmac0_phy_irq>;
357362 phy-mode = "rgmii-id";
358363 status = "okay";
359364
@@ -368,7 +373,9 @@ · 8 unmodified lines
368373 #address-cells = <1>;
369374 #size-cells = <0>;
370375 pinctrl-names = "default";
371− pinctrl-0 = <&pinctrl_gmac1_default &pinctrl_gmac1_phy_irq>;
376+ pinctrl-0 = <&pinctrl_gmac1_default
377+ &pinctrl_gmac1_mdio_default
378+ &pinctrl_gmac1_phy_irq>;
372379 phy-mode = "rmii";
373380 status = "okay";
374381
@@ -423,14 +430,20 @@ · 48 unmodified lines
423430 <PIN_PA15__G0_TXEN>,
424431 <PIN_PA30__G0_RXCK>,
425432 <PIN_PA18__G0_RXDV>,
426− <PIN_PA22__G0_MDC>,
427− <PIN_PA23__G0_MDIO>,
428433 <PIN_PA25__G0_125CK>;
434+ slew-rate = <0>;
435+ bias-disable;
436+ };
437+
438+ pinctrl_gmac0_mdio_default: gmac0_mdio_default {
439+ pinmux = <PIN_PA22__G0_MDC>,
440+ <PIN_PA23__G0_MDIO>;
429441 bias-disable;
430442 };
431443
432444 pinctrl_gmac0_txck_default: gmac0_txck_default {
433445 pinmux = <PIN_PA24__G0_TXCK>;
446+ slew-rate = <0>;
434447 bias-pull-up;
435448 };
436449
@@ -447,8 +460,13 @@ · 10 unmodified lines
447460 <PIN_PD25__G1_RX0>,
448461 <PIN_PD26__G1_RX1>,
449462 <PIN_PD27__G1_RXER>,
450− <PIN_PD24__G1_RXDV>,
451− <PIN_PD28__G1_MDC>,
463+ <PIN_PD24__G1_RXDV>;
464+ slew-rate = <0>;
465+ bias-disable;
466+ };
467+
468+ pinctrl_gmac1_mdio_default: gmac1_mdio_default {
469+ pinmux = <PIN_PD28__G1_MDC>,
452470 <PIN_PD29__G1_MDIO>;
453471 bias-disable;
454472 };
@@ -540,6 +558,7 @@ · 85 unmodified lines
540558 <PIN_PA8__SDMMC0_DAT5>,
541559 <PIN_PA9__SDMMC0_DAT6>,
542560 <PIN_PA10__SDMMC0_DAT7>;
561+ slew-rate = <0>;
543562 bias-pull-up;
544563 };
545564
@@ -547,6 +566,7 @@ · 1 unmodified line
547566 pinmux = <PIN_PA0__SDMMC0_CK>,
548567 <PIN_PA2__SDMMC0_RSTN>,
549568 <PIN_PA11__SDMMC0_DS>;
569+ slew-rate = <0>;
550570 bias-pull-up;
551571 };
552572 };
@@ -558,6 +578,7 @@ · 5 unmodified lines
558578 <PIN_PC0__SDMMC1_DAT1>,
559579 <PIN_PC1__SDMMC1_DAT2>,
560580 <PIN_PC2__SDMMC1_DAT3>;
581+ slew-rate = <0>;
561582 bias-pull-up;
562583 };
563584
@@ -566,6 +587,7 @@ · 2 unmodified lines
566587 <PIN_PB28__SDMMC1_RSTN>,
567588 <PIN_PC5__SDMMC1_1V8SEL>,
568589 <PIN_PC4__SDMMC1_CD>;
590+ slew-rate = <0>;
569591 bias-pull-up;
570592 };
571593 };
@@ -577,11 +599,13 @@ · 5 unmodified lines
577599 <PIN_PD6__SDMMC2_DAT1>,
578600 <PIN_PD7__SDMMC2_DAT2>,
579601 <PIN_PD8__SDMMC2_DAT3>;
602+ slew-rate = <0>;
580603 bias-pull-up;
581604 };
582605
583606 ck {
584607 pinmux = <PIN_PD4__SDMMC2_CK>;
608+ slew-rate = <0>;
585609 bias-pull-up;
586610 };
587611 };
@@ -634,6 +658,15 @@ · 46 unmodified lines
634658 pinctrl-0 = <&pinctrl_sdmmc2_default>;
635659 };
636660
661+&shdwc {
662+ atmel,shdwc-debouncer = <976>;
663+ status = "okay";
664+
665+ input@0 {
666+ reg = <0>;
667+ };
668+};
669+
637670 &spdifrx {
638671 pinctrl-names = "default";
639672 pinctrl-0 = <&pinctrl_spdifrx_default>;
arch/arm/boot/dts/imx53-m53menlo.dts+2−2
@@ -56,6 +56,7 @@ · 55 unmodified lines
5656 panel {
5757 compatible = "edt,etm0700g0dh6";
5858 pinctrl-0 = <&pinctrl_display_gpio>;
59+ pinctrl-names = "default";
5960 enable-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>;
6061
6162 port {
@@ -76,8 +77,7 @@ · 14 unmodified lines
7677 regulator-name = "vbus";
7778 regulator-min-microvolt = <5000000>;
7879 regulator-max-microvolt = <5000000>;
79− gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
80− enable-active-high;
80+ gpio = <&gpio1 2 0>;
8181 };
8282 };
8383
arch/arm/boot/dts/imx6dl-yapp4-common.dtsi+5−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 #include <dt-bindings/gpio/gpio.h>
66 #include <dt-bindings/interrupt-controller/irq.h>
77 #include <dt-bindings/input/input.h>
8+#include <dt-bindings/leds/common.h>
89 #include <dt-bindings/pwm/pwm.h>
910
1011 / {
@@ -277,6 +278,7 @@ · 266 unmodified lines
277278 led-cur = /bits/ 8 <0x20>;
278279 max-cur = /bits/ 8 <0x60>;
279280 reg = <0>;
281+ color = <LED_COLOR_ID_RED>;
280282 };
281283
282284 chan@1 {
@@ -284,6 +286,7 @@ · 1 unmodified line
284286 led-cur = /bits/ 8 <0x20>;
285287 max-cur = /bits/ 8 <0x60>;
286288 reg = <1>;
289+ color = <LED_COLOR_ID_GREEN>;
287290 };
288291
289292 chan@2 {
@@ -291,6 +294,7 @@ · 1 unmodified line
291294 led-cur = /bits/ 8 <0x20>;
292295 max-cur = /bits/ 8 <0x60>;
293296 reg = <2>;
297+ color = <LED_COLOR_ID_BLUE>;
294298 };
295299
296300 chan@3 {
@@ -298,6 +302,7 @@ · 1 unmodified line
298302 led-cur = /bits/ 8 <0x0>;
299303 max-cur = /bits/ 8 <0x0>;
300304 reg = <3>;
305+ color = <LED_COLOR_ID_WHITE>;
301306 };
302307 };
303308
arch/arm/boot/dts/imx6qdl-pico.dtsi+11−0
@@ -176,7 +176,18 @@ · 175 unmodified lines
176176 pinctrl-0 = <&pinctrl_enet>;
177177 phy-mode = "rgmii-id";
178178 phy-reset-gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;
179+ phy-handle = <&phy>;
179180 status = "okay";
181+
182+ mdio {
183+ #address-cells = <1>;
184+ #size-cells = <0>;
185+
186+ phy: ethernet-phy@1 {
187+ reg = <1>;
188+ qca,clk-out-frequency = <125000000>;
189+ };
190+ };
180191 };
181192
182193 &hdmi {
arch/arm/boot/dts/imx6sx-sdb.dts+2−2
@@ -114,7 +114,7 @@ · 113 unmodified lines
114114 compatible = "micron,n25q256a", "jedec,spi-nor";
115115 spi-max-frequency = <29000000>;
116116 spi-rx-bus-width = <4>;
117− spi-tx-bus-width = <4>;
117+ spi-tx-bus-width = <1>;
118118 reg = <0>;
119119 };
120120
@@ -124,7 +124,7 @@ · 3 unmodified lines
124124 compatible = "micron,n25q256a", "jedec,spi-nor";
125125 spi-max-frequency = <29000000>;
126126 spi-rx-bus-width = <4>;
127− spi-tx-bus-width = <4>;
127+ spi-tx-bus-width = <1>;
128128 reg = <2>;
129129 };
130130 };
arch/arm/boot/dts/imx6ul-14x14-evk.dtsi+1−1
@@ -292,7 +292,7 @@ · 291 unmodified lines
292292 compatible = "micron,n25q256a", "jedec,spi-nor";
293293 spi-max-frequency = <29000000>;
294294 spi-rx-bus-width = <4>;
295− spi-tx-bus-width = <4>;
295+ spi-tx-bus-width = <1>;
296296 reg = <0>;
297297 };
298298 };
arch/arm/boot/dts/omap3430-sdp.dts+1−1
@@ -101,7 +101,7 @@ · 100 unmodified lines
101101
102102 nand@1,0 {
103103 compatible = "ti,omap2-nand";
104− reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
104+ reg = <1 0 4>; /* CS1, offset 0, IO size 4 */
105105 interrupt-parent = <&gpmc>;
106106 interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
107107 <1 IRQ_TYPE_NONE>; /* termcount */
arch/arm/boot/dts/qcom-apq8064.dtsi+7−8
@@ -198,7 +198,7 @@ · 197 unmodified lines
198198 clock-frequency = <19200000>;
199199 };
200200
201− pxo_board {
201+ pxo_board: pxo_board {
202202 compatible = "fixed-clock";
203203 #clock-cells = <0>;
204204 clock-frequency = <27000000>;
@@ -1148,22 +1148,21 @@ · 943 unmodified lines
11481148 };
11491149
11501150 gpu: adreno-3xx@4300000 {
1151− compatible = "qcom,adreno-3xx";
1151+ compatible = "qcom,adreno-320.2", "qcom,adreno";
11521152 reg = <0x04300000 0x20000>;
11531153 reg-names = "kgsl_3d0_reg_memory";
11541154 interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
11551155 interrupt-names = "kgsl_3d0_irq";
11561156 clock-names =
1157− "core_clk",
1158− "iface_clk",
1159− "mem_clk",
1160− "mem_iface_clk";
1157+ "core",
1158+ "iface",
1159+ "mem",
1160+ "mem_iface";
11611161 clocks =
11621162 <&mmcc GFX3D_CLK>,
11631163 <&mmcc GFX3D_AHB_CLK>,
11641164 <&mmcc GFX3D_AXI_CLK>,
11651165 <&mmcc MMSS_IMEM_AHB_CLK>;
1166− qcom,chipid = <0x03020002>;
11671166
11681167 iommus = <&gfx3d 0
11691168 &gfx3d 1
@@ -1306,7 +1305,7 @@ · 136 unmodified lines
13061305 reg-names = "dsi_pll", "dsi_phy", "dsi_phy_regulator";
13071306 clock-names = "iface_clk", "ref";
13081307 clocks = <&mmcc DSI_M_AHB_CLK>,
1309− <&cxo_board>;
1308+ <&pxo_board>;
13101309 };
13111310
13121311
arch/arm/boot/dts/sama7g5.dtsi+39−0
@@ -75,6 +75,17 @@ · 74 unmodified lines
7575 #size-cells = <1>;
7676 ranges;
7777
78+ securam: securam@e0000000 {
79+ compatible = "microchip,sama7g5-securam", "atmel,sama5d2-securam", "mmio-sram";
80+ reg = <0xe0000000 0x4000>;
81+ clocks = <&pmc PMC_TYPE_PERIPHERAL 18>;
82+ #address-cells = <1>;
83+ #size-cells = <1>;
84+ ranges = <0 0xe0000000 0x4000>;
85+ no-memory-wc;
86+ status = "okay";
87+ };
88+
7889 secumod: secumod@e0004000 {
7990 compatible = "microchip,sama7g5-secumod", "atmel,sama5d2-secumod", "syscon";
8091 reg = <0xe0004000 0x4000>;
@@ -111,6 +122,17 @@ · 30 unmodified lines
111122 clock-names = "td_slck", "md_slck", "main_xtal";
112123 };
113124
125+ shdwc: shdwc@e001d010 {
126+ compatible = "microchip,sama7g5-shdwc", "syscon";
127+ reg = <0xe001d010 0x10>;
128+ clocks = <&clk32k 0>;
129+ #address-cells = <1>;
130+ #size-cells = <0>;
131+ atmel,wakeup-rtc-timer;
132+ atmel,wakeup-rtt-timer;
133+ status = "disabled";
134+ };
135+
114136 rtt: rtt@e001d020 {
115137 compatible = "microchip,sama7g5-rtt", "microchip,sam9x60-rtt", "atmel,at91sam9260-rtt";
116138 reg = <0xe001d020 0x30>;
@@ -137,6 +159,11 @@ · 20 unmodified lines
137159 clocks = <&clk32k 0>;
138160 };
139161
162+ chipid@e0020000 {
163+ compatible = "microchip,sama7g5-chipid";
164+ reg = <0xe0020000 0x8>;
165+ };
166+
140167 sdmmc0: mmc@e1204000 {
141168 compatible = "microchip,sama7g5-sdhci", "microchip,sam9x60-sdhci";
142169 reg = <0xe1204000 0x4000>;
@@ -515,6 +542,18 @@ · 372 unmodified lines
515542 };
516543 };
517544
545+ uddrc: uddrc@e3800000 {
546+ compatible = "microchip,sama7g5-uddrc";
547+ reg = <0xe3800000 0x4000>;
548+ status = "okay";
549+ };
550+
551+ ddr3phy: ddr3phy@e3804000 {
552+ compatible = "microchip,sama7g5-ddr3phy";
553+ reg = <0xe3804000 0x1000>;
554+ status = "okay";
555+ };
556+
518557 gic: interrupt-controller@e8c11000 {
519558 compatible = "arm,cortex-a7-gic";
520559 #interrupt-cells = <3>;
arch/arm/boot/dts/vexpress-v2m-rs1.dtsi+60−7
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT
1818 * CHANGES TO vexpress-v2m.dtsi!
1919 */
20+#include <dt-bindings/interrupt-controller/arm-gic.h>
2021
2122 / {
2223 v2m_fixed_3v3: fixed-regulator-0 {
@@ -101,16 +102,68 @@ · 78 unmodified lines
101102 };
102103
103104 bus@8000000 {
104− motherboard-bus {
105− model = "V2M-P1";
105+ compatible = "simple-bus";
106+ #address-cells = <1>;
107+ #size-cells = <1>;
108+
109+ #interrupt-cells = <1>;
110+ interrupt-map-mask = <0 63>;
111+ interrupt-map = <0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
112+ <0 1 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
113+ <0 2 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
114+ <0 3 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
115+ <0 4 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
116+ <0 5 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
117+ <0 6 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
118+ <0 7 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
119+ <0 8 &gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
120+ <0 9 &gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
121+ <0 10 &gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
122+ <0 11 &gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
123+ <0 12 &gic GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
124+ <0 13 &gic GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
125+ <0 14 &gic GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
126+ <0 15 &gic GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
127+ <0 16 &gic GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
128+ <0 17 &gic GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
129+ <0 18 &gic GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
130+ <0 19 &gic GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
131+ <0 20 &gic GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
132+ <0 21 &gic GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
133+ <0 22 &gic GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
134+ <0 23 &gic GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>,
135+ <0 24 &gic GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
136+ <0 25 &gic GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
137+ <0 26 &gic GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
138+ <0 27 &gic GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>,
139+ <0 28 &gic GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>,
140+ <0 29 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
141+ <0 30 &gic GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>,
142+ <0 31 &gic GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>,
143+ <0 32 &gic GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>,
144+ <0 33 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>,
145+ <0 34 &gic GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
146+ <0 35 &gic GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>,
147+ <0 36 &gic GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>,
148+ <0 37 &gic GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>,
149+ <0 38 &gic GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>,
150+ <0 39 &gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
151+ <0 40 &gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
152+ <0 41 &gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
153+ <0 42 &gic GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
154+
155+ motherboard-bus@8000000 {
106156 arm,hbi = <0x190>;
107157 arm,vexpress,site = <0>;
108− arm,v2m-memory-map = "rs1";
109158 compatible = "arm,vexpress,v2m-p1", "simple-bus";
110159 #address-cells = <2>; /* SMB chipselect number and offset */
111160 #size-cells = <1>;
112− #interrupt-cells = <1>;
113− ranges;
161+ ranges = <0 0 0x08000000 0x04000000>,
162+ <1 0 0x14000000 0x04000000>,
163+ <2 0 0x18000000 0x04000000>,
164+ <3 0 0x1c000000 0x04000000>,
165+ <4 0 0x0c000000 0x04000000>,
166+ <5 0 0x10000000 0x04000000>;
114167
115168 nor_flash: flash@0 {
116169 compatible = "arm,vexpress-flash", "cfi-flash";
@@ -215,7 +268,7 @@ · 98 unmodified lines
215268 clock-names = "apb_pclk";
216269 };
217270
218− mmci@50000 {
271+ mmc@50000 {
219272 compatible = "arm,pl180", "arm,primecell";
220273 reg = <0x050000 0x1000>;
221274 interrupts = <9>, <10>;
@@ -275,7 +328,7 @@ · 53 unmodified lines
275328 clock-names = "uartclk", "apb_pclk";
276329 };
277330
278− wdt@f0000 {
331+ watchdog@f0000 {
279332 compatible = "arm,sp805", "arm,primecell";
280333 reg = <0x0f0000 0x1000>;
281334 interrupts = <0>;
arch/arm/boot/dts/vexpress-v2m.dtsi+60−5
@@ -17,18 +17,73 @@ · 16 unmodified lines
1717 * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT
1818 * CHANGES TO vexpress-v2m-rs1.dtsi!
1919 */
20+#include <dt-bindings/interrupt-controller/arm-gic.h>
2021
2122 / {
22− bus@4000000 {
23− motherboard {
24− model = "V2M-P1";
23+ bus@40000000 {
24+ compatible = "simple-bus";
25+ #address-cells = <1>;
26+ #size-cells = <1>;
27+ ranges = <0x40000000 0x40000000 0x10000000>,
28+ <0x10000000 0x10000000 0x00020000>;
29+
30+ #interrupt-cells = <1>;
31+ interrupt-map-mask = <0 63>;
32+ interrupt-map = <0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
33+ <0 1 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
34+ <0 2 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
35+ <0 3 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
36+ <0 4 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
37+ <0 5 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
38+ <0 6 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
39+ <0 7 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
40+ <0 8 &gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
41+ <0 9 &gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
42+ <0 10 &gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
43+ <0 11 &gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
44+ <0 12 &gic GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
45+ <0 13 &gic GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
46+ <0 14 &gic GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
47+ <0 15 &gic GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
48+ <0 16 &gic GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
49+ <0 17 &gic GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
50+ <0 18 &gic GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
51+ <0 19 &gic GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
52+ <0 20 &gic GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
53+ <0 21 &gic GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
54+ <0 22 &gic GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
55+ <0 23 &gic GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>,
56+ <0 24 &gic GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
57+ <0 25 &gic GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
58+ <0 26 &gic GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
59+ <0 27 &gic GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>,
60+ <0 28 &gic GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>,
61+ <0 29 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
62+ <0 30 &gic GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>,
63+ <0 31 &gic GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>,
64+ <0 32 &gic GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>,
65+ <0 33 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>,
66+ <0 34 &gic GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
67+ <0 35 &gic GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>,
68+ <0 36 &gic GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>,
69+ <0 37 &gic GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>,
70+ <0 38 &gic GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>,
71+ <0 39 &gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
72+ <0 40 &gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
73+ <0 41 &gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
74+ <0 42 &gic GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
75+
76+ motherboard-bus@40000000 {
2577 arm,hbi = <0x190>;
2678 arm,vexpress,site = <0>;
2779 compatible = "arm,vexpress,v2m-p1", "simple-bus";
2880 #address-cells = <2>; /* SMB chipselect number and offset */
2981 #size-cells = <1>;
30− #interrupt-cells = <1>;
31− ranges;
82+ ranges = <0 0 0x40000000 0x04000000>,
83+ <1 0 0x44000000 0x04000000>,
84+ <2 0 0x48000000 0x04000000>,
85+ <3 0 0x4c000000 0x04000000>,
86+ <7 0 0x10000000 0x00020000>;
3287
3388 flash@0,00000000 {
3489 compatible = "arm,vexpress-flash", "cfi-flash";
arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts+1−56
@@ -237,62 +237,7 @@ · 236 unmodified lines
237237 };
238238
239239 bus@8000000 {
240− compatible = "simple-bus";
241−
242− #address-cells = <2>;
243− #size-cells = <1>;
244− ranges = <0 0 0 0x08000000 0x04000000>,
245− <1 0 0 0x14000000 0x04000000>,
246− <2 0 0 0x18000000 0x04000000>,
247− <3 0 0 0x1c000000 0x04000000>,
248− <4 0 0 0x0c000000 0x04000000>,
249− <5 0 0 0x10000000 0x04000000>;
250−
251− #interrupt-cells = <1>;
252− interrupt-map-mask = <0 0 63>;
253− interrupt-map = <0 0 0 &gic 0 0 4>,
254− <0 0 1 &gic 0 1 4>,
255− <0 0 2 &gic 0 2 4>,
256− <0 0 3 &gic 0 3 4>,
257− <0 0 4 &gic 0 4 4>,
258− <0 0 5 &gic 0 5 4>,
259− <0 0 6 &gic 0 6 4>,
260− <0 0 7 &gic 0 7 4>,
261− <0 0 8 &gic 0 8 4>,
262− <0 0 9 &gic 0 9 4>,
263− <0 0 10 &gic 0 10 4>,
264− <0 0 11 &gic 0 11 4>,
265− <0 0 12 &gic 0 12 4>,
266− <0 0 13 &gic 0 13 4>,
267− <0 0 14 &gic 0 14 4>,
268− <0 0 15 &gic 0 15 4>,
269− <0 0 16 &gic 0 16 4>,
270− <0 0 17 &gic 0 17 4>,
271− <0 0 18 &gic 0 18 4>,
272− <0 0 19 &gic 0 19 4>,
273− <0 0 20 &gic 0 20 4>,
274− <0 0 21 &gic 0 21 4>,
275− <0 0 22 &gic 0 22 4>,
276− <0 0 23 &gic 0 23 4>,
277− <0 0 24 &gic 0 24 4>,
278− <0 0 25 &gic 0 25 4>,
279− <0 0 26 &gic 0 26 4>,
280− <0 0 27 &gic 0 27 4>,
281− <0 0 28 &gic 0 28 4>,
282− <0 0 29 &gic 0 29 4>,
283− <0 0 30 &gic 0 30 4>,
284− <0 0 31 &gic 0 31 4>,
285− <0 0 32 &gic 0 32 4>,
286− <0 0 33 &gic 0 33 4>,
287− <0 0 34 &gic 0 34 4>,
288− <0 0 35 &gic 0 35 4>,
289− <0 0 36 &gic 0 36 4>,
290− <0 0 37 &gic 0 37 4>,
291− <0 0 38 &gic 0 38 4>,
292− <0 0 39 &gic 0 39 4>,
293− <0 0 40 &gic 0 40 4>,
294− <0 0 41 &gic 0 41 4>,
295− <0 0 42 &gic 0 42 4>;
240+ ranges = <0x8000000 0 0x8000000 0x18000000>;
296241 };
297242
298243 site2: hsb@40000000 {
arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts+1−56
@@ -609,62 +609,7 @@ · 608 unmodified lines
609609 };
610610
611611 smb: bus@8000000 {
612− compatible = "simple-bus";
613−
614− #address-cells = <2>;
615− #size-cells = <1>;
616− ranges = <0 0 0 0x08000000 0x04000000>,
617− <1 0 0 0x14000000 0x04000000>,
618− <2 0 0 0x18000000 0x04000000>,
619− <3 0 0 0x1c000000 0x04000000>,
620− <4 0 0 0x0c000000 0x04000000>,
621− <5 0 0 0x10000000 0x04000000>;
622−
623− #interrupt-cells = <1>;
624− interrupt-map-mask = <0 0 63>;
625− interrupt-map = <0 0 0 &gic 0 0 4>,
626− <0 0 1 &gic 0 1 4>,
627− <0 0 2 &gic 0 2 4>,
628− <0 0 3 &gic 0 3 4>,
629− <0 0 4 &gic 0 4 4>,
630− <0 0 5 &gic 0 5 4>,
631− <0 0 6 &gic 0 6 4>,
632− <0 0 7 &gic 0 7 4>,
633− <0 0 8 &gic 0 8 4>,
634− <0 0 9 &gic 0 9 4>,
635− <0 0 10 &gic 0 10 4>,
636− <0 0 11 &gic 0 11 4>,
637− <0 0 12 &gic 0 12 4>,
638− <0 0 13 &gic 0 13 4>,
639− <0 0 14 &gic 0 14 4>,
640− <0 0 15 &gic 0 15 4>,
641− <0 0 16 &gic 0 16 4>,
642− <0 0 17 &gic 0 17 4>,
643− <0 0 18 &gic 0 18 4>,
644− <0 0 19 &gic 0 19 4>,
645− <0 0 20 &gic 0 20 4>,
646− <0 0 21 &gic 0 21 4>,
647− <0 0 22 &gic 0 22 4>,
648− <0 0 23 &gic 0 23 4>,
649− <0 0 24 &gic 0 24 4>,
650− <0 0 25 &gic 0 25 4>,
651− <0 0 26 &gic 0 26 4>,
652− <0 0 27 &gic 0 27 4>,
653− <0 0 28 &gic 0 28 4>,
654− <0 0 29 &gic 0 29 4>,
655− <0 0 30 &gic 0 30 4>,
656− <0 0 31 &gic 0 31 4>,
657− <0 0 32 &gic 0 32 4>,
658− <0 0 33 &gic 0 33 4>,
659− <0 0 34 &gic 0 34 4>,
660− <0 0 35 &gic 0 35 4>,
661− <0 0 36 &gic 0 36 4>,
662− <0 0 37 &gic 0 37 4>,
663− <0 0 38 &gic 0 38 4>,
664− <0 0 39 &gic 0 39 4>,
665− <0 0 40 &gic 0 40 4>,
666− <0 0 41 &gic 0 41 4>,
667− <0 0 42 &gic 0 42 4>;
612+ ranges = <0x8000000 0 0x8000000 0x18000000>;
668613 };
669614
670615 site2: hsb@40000000 {
arch/arm/boot/dts/vexpress-v2p-ca5s.dts+1−56
@@ -207,62 +207,7 @@ · 206 unmodified lines
207207 };
208208
209209 smb: bus@8000000 {
210− compatible = "simple-bus";
211−
212− #address-cells = <2>;
213− #size-cells = <1>;
214− ranges = <0 0 0x08000000 0x04000000>,
215− <1 0 0x14000000 0x04000000>,
216− <2 0 0x18000000 0x04000000>,
217− <3 0 0x1c000000 0x04000000>,
218− <4 0 0x0c000000 0x04000000>,
219− <5 0 0x10000000 0x04000000>;
220−
221− #interrupt-cells = <1>;
222− interrupt-map-mask = <0 0 63>;
223− interrupt-map = <0 0 0 &gic 0 0 4>,
224− <0 0 1 &gic 0 1 4>,
225− <0 0 2 &gic 0 2 4>,
226− <0 0 3 &gic 0 3 4>,
227− <0 0 4 &gic 0 4 4>,
228− <0 0 5 &gic 0 5 4>,
229− <0 0 6 &gic 0 6 4>,
230− <0 0 7 &gic 0 7 4>,
231− <0 0 8 &gic 0 8 4>,
232− <0 0 9 &gic 0 9 4>,
233− <0 0 10 &gic 0 10 4>,
234− <0 0 11 &gic 0 11 4>,
235− <0 0 12 &gic 0 12 4>,
236− <0 0 13 &gic 0 13 4>,
237− <0 0 14 &gic 0 14 4>,
238− <0 0 15 &gic 0 15 4>,
239− <0 0 16 &gic 0 16 4>,
240− <0 0 17 &gic 0 17 4>,
241− <0 0 18 &gic 0 18 4>,
242− <0 0 19 &gic 0 19 4>,
243− <0 0 20 &gic 0 20 4>,
244− <0 0 21 &gic 0 21 4>,
245− <0 0 22 &gic 0 22 4>,
246− <0 0 23 &gic 0 23 4>,
247− <0 0 24 &gic 0 24 4>,
248− <0 0 25 &gic 0 25 4>,
249− <0 0 26 &gic 0 26 4>,
250− <0 0 27 &gic 0 27 4>,
251− <0 0 28 &gic 0 28 4>,
252− <0 0 29 &gic 0 29 4>,
253− <0 0 30 &gic 0 30 4>,
254− <0 0 31 &gic 0 31 4>,
255− <0 0 32 &gic 0 32 4>,
256− <0 0 33 &gic 0 33 4>,
257− <0 0 34 &gic 0 34 4>,
258− <0 0 35 &gic 0 35 4>,
259− <0 0 36 &gic 0 36 4>,
260− <0 0 37 &gic 0 37 4>,
261− <0 0 38 &gic 0 38 4>,
262− <0 0 39 &gic 0 39 4>,
263− <0 0 40 &gic 0 40 4>,
264− <0 0 41 &gic 0 41 4>,
265− <0 0 42 &gic 0 42 4>;
210+ ranges = <0 0x8000000 0x18000000>;
266211 };
267212
268213 site2: hsb@40000000 {
arch/arm/boot/dts/vexpress-v2p-ca9.dts+0−58
@@ -295,64 +295,6 @@ · 294 unmodified lines
295295 };
296296 };
297297
298− smb: bus@4000000 {
299− compatible = "simple-bus";
300−
301− #address-cells = <2>;
302− #size-cells = <1>;
303− ranges = <0 0 0x40000000 0x04000000>,
304− <1 0 0x44000000 0x04000000>,
305− <2 0 0x48000000 0x04000000>,
306− <3 0 0x4c000000 0x04000000>,
307− <7 0 0x10000000 0x00020000>;
308−
309− #interrupt-cells = <1>;
310− interrupt-map-mask = <0 0 63>;
311− interrupt-map = <0 0 0 &gic 0 0 4>,
312− <0 0 1 &gic 0 1 4>,
313− <0 0 2 &gic 0 2 4>,
314− <0 0 3 &gic 0 3 4>,
315− <0 0 4 &gic 0 4 4>,
316− <0 0 5 &gic 0 5 4>,
317− <0 0 6 &gic 0 6 4>,
318− <0 0 7 &gic 0 7 4>,
319− <0 0 8 &gic 0 8 4>,
320− <0 0 9 &gic 0 9 4>,
321− <0 0 10 &gic 0 10 4>,
322− <0 0 11 &gic 0 11 4>,
323− <0 0 12 &gic 0 12 4>,
324− <0 0 13 &gic 0 13 4>,
325− <0 0 14 &gic 0 14 4>,
326− <0 0 15 &gic 0 15 4>,
327− <0 0 16 &gic 0 16 4>,
328− <0 0 17 &gic 0 17 4>,
329− <0 0 18 &gic 0 18 4>,
330− <0 0 19 &gic 0 19 4>,
331− <0 0 20 &gic 0 20 4>,
332− <0 0 21 &gic 0 21 4>,
333− <0 0 22 &gic 0 22 4>,
334− <0 0 23 &gic 0 23 4>,
335− <0 0 24 &gic 0 24 4>,
336− <0 0 25 &gic 0 25 4>,
337− <0 0 26 &gic 0 26 4>,
338− <0 0 27 &gic 0 27 4>,
339− <0 0 28 &gic 0 28 4>,
340− <0 0 29 &gic 0 29 4>,
341− <0 0 30 &gic 0 30 4>,
342− <0 0 31 &gic 0 31 4>,
343− <0 0 32 &gic 0 32 4>,
344− <0 0 33 &gic 0 33 4>,
345− <0 0 34 &gic 0 34 4>,
346− <0 0 35 &gic 0 35 4>,
347− <0 0 36 &gic 0 36 4>,
348− <0 0 37 &gic 0 37 4>,
349− <0 0 38 &gic 0 38 4>,
350− <0 0 39 &gic 0 39 4>,
351− <0 0 40 &gic 0 40 4>,
352− <0 0 41 &gic 0 41 4>,
353− <0 0 42 &gic 0 42 4>;
354− };
355−
356298 site2: hsb@e0000000 {
357299 compatible = "simple-bus";
358300 #address-cells = <1>;
arch/arm/common/sharpsl_param.c+3−1
@@ -40,7 +40,9 @@ EXPORT_SYMBOL(sharpsl_param); · 39 unmodified lines
4040
4141 void sharpsl_save_param(void)
4242 {
43− memcpy(&sharpsl_param, param_start(PARAM_BASE), sizeof(struct sharpsl_param_info));
43+ struct sharpsl_param_info *params = param_start(PARAM_BASE);
44+
45+ memcpy(&sharpsl_param, params, sizeof(*params));
4446
4547 if (sharpsl_param.comadj_keyword != COMADJ_MAGIC)
4648 sharpsl_param.comadj=-1;
arch/arm/configs/gemini_defconfig+1−0
@@ -76,6 +76,7 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y · 75 unmodified lines
7676 CONFIG_DRM=y
7777 CONFIG_DRM_PANEL_ILITEK_IL9322=y
7878 CONFIG_DRM_TVE200=y
79+CONFIG_FB=y
7980 CONFIG_LOGO=y
8081 CONFIG_USB=y
8182 CONFIG_USB_MON=y
arch/arm/configs/imx_v6_v7_defconfig+1−0
@@ -292,6 +292,7 @@ CONFIG_DRM_IMX_LDB=y · 291 unmodified lines
292292 CONFIG_DRM_IMX_HDMI=y
293293 CONFIG_DRM_ETNAVIV=y
294294 CONFIG_DRM_MXSFB=y
295+CONFIG_FB=y
295296 CONFIG_FB_MODE_HELPERS=y
296297 CONFIG_LCD_CLASS_DEVICE=y
297298 CONFIG_LCD_L4F00242T03=y
arch/arm/configs/multi_v7_defconfig+3−0
@@ -456,6 +456,7 @@ CONFIG_PINCTRL_STMFX=y · 455 unmodified lines
456456 CONFIG_PINCTRL_PALMAS=y
457457 CONFIG_PINCTRL_OWL=y
458458 CONFIG_PINCTRL_S500=y
459+CONFIG_PINCTRL_MSM=y
459460 CONFIG_PINCTRL_APQ8064=y
460461 CONFIG_PINCTRL_APQ8084=y
461462 CONFIG_PINCTRL_IPQ8064=y
@@ -725,6 +726,7 @@ CONFIG_DRM_PL111=m · 263 unmodified lines
725726 CONFIG_DRM_LIMA=m
726727 CONFIG_DRM_PANFROST=m
727728 CONFIG_DRM_ASPEED_GFX=m
729+CONFIG_FB=y
728730 CONFIG_FB_EFI=y
729731 CONFIG_FB_WM8505=y
730732 CONFIG_FB_SH_MOBILE_LCDC=y
@@ -1122,6 +1124,7 @@ CONFIG_PHY_DM816X_USB=m · 391 unmodified lines
11221124 CONFIG_OMAP_USB2=y
11231125 CONFIG_TI_PIPE3=y
11241126 CONFIG_TWL4030_USB=m
1127+CONFIG_RAS=y
11251128 CONFIG_NVMEM_IMX_OCOTP=y
11261129 CONFIG_ROCKCHIP_EFUSE=m
11271130 CONFIG_NVMEM_SUNXI_SID=y
arch/arm/mach-at91/pm.c+114−16
@@ -47,12 +47,26 @@ struct at91_pm_bu { · 46 unmodified lines
4747 unsigned long ddr_phy_calibration[BACKUP_DDR_PHY_CALIBRATION];
4848 };
4949
50+/*
51+ * struct at91_pm_sfrbu_offsets: registers mapping for SFRBU
52+ * @pswbu: power switch BU control registers
53+ */
54+struct at91_pm_sfrbu_regs {
55+ struct {
56+ u32 key;
57+ u32 ctrl;
58+ u32 state;
59+ u32 softsw;
60+ } pswbu;
61+};
62+
5063 /**
5164 * struct at91_soc_pm - AT91 SoC power management data structure
5265 * @config_shdwc_ws: wakeup sources configuration function for SHDWC
5366 * @config_pmc_ws: wakeup srouces configuration function for PMC
5467 * @ws_ids: wakup sources of_device_id array
5568 * @data: PM data to be used on last phase of suspend
69+ * @sfrbu_regs: SFRBU registers mapping
5670 * @bu: backup unit mapped data (for backup mode)
5771 * @memcs: memory chip select
5872 */
@@ -62,6 +76,7 @@ struct at91_soc_pm { · 3 unmodified lines
6276 const struct of_device_id *ws_ids;
6377 struct at91_pm_bu *bu;
6478 struct at91_pm_data data;
79+ struct at91_pm_sfrbu_regs sfrbu_regs;
6580 void *memcs;
6681 };
6782
@@ -356,9 +371,36 @@ static int at91_suspend_finish(unsigned long val) · 288 unmodified lines
356371 return 0;
357372 }
358373
374+static void at91_pm_switch_ba_to_vbat(void)
375+{
376+ unsigned int offset = offsetof(struct at91_pm_sfrbu_regs, pswbu);
377+ unsigned int val;
378+
379+ /* Just for safety. */
380+ if (!soc_pm.data.sfrbu)
381+ return;
382+
383+ val = readl(soc_pm.data.sfrbu + offset);
384+
385+ /* Already on VBAT. */
386+ if (!(val & soc_pm.sfrbu_regs.pswbu.state))
387+ return;
388+
389+ val &= ~soc_pm.sfrbu_regs.pswbu.softsw;
390+ val |= soc_pm.sfrbu_regs.pswbu.key | soc_pm.sfrbu_regs.pswbu.ctrl;
391+ writel(val, soc_pm.data.sfrbu + offset);
392+
393+ /* Wait for update. */
394+ val = readl(soc_pm.data.sfrbu + offset);
395+ while (val & soc_pm.sfrbu_regs.pswbu.state)
396+ val = readl(soc_pm.data.sfrbu + offset);
397+}
398+
359399 static void at91_pm_suspend(suspend_state_t state)
360400 {
361401 if (soc_pm.data.mode == AT91_PM_BACKUP) {
402+ at91_pm_switch_ba_to_vbat();
403+
362404 cpu_suspend(0, at91_suspend_finish);
363405
364406 /* The SRAM is lost between suspend cycles */
@@ -589,18 +631,22 @@ static const struct of_device_id ramc_phy_ids[] __initconst = { · 224 unmodified lines
589631 { /* Sentinel. */ },
590632 };
591633
592−static __init void at91_dt_ramc(bool phy_mandatory)
634+static __init int at91_dt_ramc(bool phy_mandatory)
593635 {
594636 struct device_node *np;
595637 const struct of_device_id *of_id;
596638 int idx = 0;
597639 void *standby = NULL;
598640 const struct ramc_info *ramc;
641+ int ret;
599642
600643 for_each_matching_node_and_match(np, ramc_ids, &of_id) {
601644 soc_pm.data.ramc[idx] = of_iomap(np, 0);
602− if (!soc_pm.data.ramc[idx])
603− panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx);
645+ if (!soc_pm.data.ramc[idx]) {
646+ pr_err("unable to map ramc[%d] cpu registers\n", idx);
647+ ret = -ENOMEM;
648+ goto unmap_ramc;
649+ }
604650
605651 ramc = of_id->data;
606652 if (ramc) {
@@ -612,25 +658,42 @@ static __init void at91_dt_ramc(bool phy_mandatory) · 5 unmodified lines
612658 idx++;
613659 }
614660
615− if (!idx)
616− panic(pr_fmt("unable to find compatible ram controller node in dtb\n"));
661+ if (!idx) {
662+ pr_err("unable to find compatible ram controller node in dtb\n");
663+ ret = -ENODEV;
664+ goto unmap_ramc;
665+ }
617666
618667 /* Lookup for DDR PHY node, if any. */
619668 for_each_matching_node_and_match(np, ramc_phy_ids, &of_id) {
620669 soc_pm.data.ramc_phy = of_iomap(np, 0);
621− if (!soc_pm.data.ramc_phy)
622− panic(pr_fmt("unable to map ramc phy cpu registers\n"));
670+ if (!soc_pm.data.ramc_phy) {
671+ pr_err("unable to map ramc phy cpu registers\n");
672+ ret = -ENOMEM;
673+ goto unmap_ramc;
674+ }
623675 }
624676
625− if (phy_mandatory && !soc_pm.data.ramc_phy)
626− panic(pr_fmt("DDR PHY is mandatory!\n"));
677+ if (phy_mandatory && !soc_pm.data.ramc_phy) {
678+ pr_err("DDR PHY is mandatory!\n");
679+ ret = -ENODEV;
680+ goto unmap_ramc;
681+ }
627682
628683 if (!standby) {
629684 pr_warn("ramc no standby function available\n");
630− return;
685+ return 0;
631686 }
632687
633688 at91_cpuidle_device.dev.platform_data = standby;
689+
690+ return 0;
691+
692+unmap_ramc:
693+ while (idx)
694+ iounmap(soc_pm.data.ramc[--idx]);
695+
696+ return ret;
634697 }
635698
636699 static void at91rm9200_idle(void)
@@ -1017,6 +1080,8 @@ static void __init at91_pm_init(void (*pm_idle)(void)) · 380 unmodified lines
10171080
10181081 void __init at91rm9200_pm_init(void)
10191082 {
1083+ int ret;
1084+
10201085 if (!IS_ENABLED(CONFIG_SOC_AT91RM9200))
10211086 return;
10221087
@@ -1028,7 +1093,9 @@ void __init at91rm9200_pm_init(void) · 5 unmodified lines
10281093 soc_pm.data.standby_mode = AT91_PM_STANDBY;
10291094 soc_pm.data.suspend_mode = AT91_PM_ULP0;
10301095
1031− at91_dt_ramc(false);
1096+ ret = at91_dt_ramc(false);
1097+ if (ret)
1098+ return;
10321099
10331100 /*
10341101 * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh.
@@ -1046,13 +1113,17 @@ void __init sam9x60_pm_init(void) · 11 unmodified lines
10461113 static const int iomaps[] __initconst = {
10471114 [AT91_PM_ULP1] = AT91_PM_IOMAP(SHDWC),
10481115 };
1116+ int ret;
10491117
10501118 if (!IS_ENABLED(CONFIG_SOC_SAM9X60))
10511119 return;
10521120
10531121 at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
10541122 at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps));
1055− at91_dt_ramc(false);
1123+ ret = at91_dt_ramc(false);
1124+ if (ret)
1125+ return;
1126+
10561127 at91_pm_init(NULL);
10571128
10581129 soc_pm.ws_ids = sam9x60_ws_ids;
@@ -1061,6 +1132,8 @@ void __init sam9x60_pm_init(void) · 2 unmodified lines
10611132
10621133 void __init at91sam9_pm_init(void)
10631134 {
1135+ int ret;
1136+
10641137 if (!IS_ENABLED(CONFIG_SOC_AT91SAM9))
10651138 return;
10661139
@@ -1072,7 +1145,10 @@ void __init at91sam9_pm_init(void) · 5 unmodified lines
10721145 soc_pm.data.standby_mode = AT91_PM_STANDBY;
10731146 soc_pm.data.suspend_mode = AT91_PM_ULP0;
10741147
1075− at91_dt_ramc(false);
1148+ ret = at91_dt_ramc(false);
1149+ if (ret)
1150+ return;
1151+
10761152 at91_pm_init(at91sam9_idle);
10771153 }
10781154
@@ -1081,12 +1157,16 @@ void __init sama5_pm_init(void) · 2 unmodified lines
10811157 static const int modes[] __initconst = {
10821158 AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP0_FAST,
10831159 };
1160+ int ret;
10841161
10851162 if (!IS_ENABLED(CONFIG_SOC_SAMA5))
10861163 return;
10871164
10881165 at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
1089− at91_dt_ramc(false);
1166+ ret = at91_dt_ramc(false);
1167+ if (ret)
1168+ return;
1169+
10901170 at91_pm_init(NULL);
10911171 }
10921172
@@ -1101,18 +1181,27 @@ void __init sama5d2_pm_init(void) · 8 unmodified lines
11011181 [AT91_PM_BACKUP] = AT91_PM_IOMAP(SHDWC) |
11021182 AT91_PM_IOMAP(SFRBU),
11031183 };
1184+ int ret;
11041185
11051186 if (!IS_ENABLED(CONFIG_SOC_SAMA5D2))
11061187 return;
11071188
11081189 at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
11091190 at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps));
1110− at91_dt_ramc(false);
1191+ ret = at91_dt_ramc(false);
1192+ if (ret)
1193+ return;
1194+
11111195 at91_pm_init(NULL);
11121196
11131197 soc_pm.ws_ids = sama5d2_ws_ids;
11141198 soc_pm.config_shdwc_ws = at91_sama5d2_config_shdwc_ws;
11151199 soc_pm.config_pmc_ws = at91_sama5d2_config_pmc_ws;
1200+
1201+ soc_pm.sfrbu_regs.pswbu.key = (0x4BD20C << 8);
1202+ soc_pm.sfrbu_regs.pswbu.ctrl = BIT(0);
1203+ soc_pm.sfrbu_regs.pswbu.softsw = BIT(1);
1204+ soc_pm.sfrbu_regs.pswbu.state = BIT(3);
11161205 }
11171206
11181207 void __init sama7_pm_init(void)
@@ -1127,18 +1216,27 @@ void __init sama7_pm_init(void) · 8 unmodified lines
11271216 [AT91_PM_BACKUP] = AT91_PM_IOMAP(SFRBU) |
11281217 AT91_PM_IOMAP(SHDWC),
11291218 };
1219+ int ret;
11301220
11311221 if (!IS_ENABLED(CONFIG_SOC_SAMA7))
11321222 return;
11331223
11341224 at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
11351225
1136− at91_dt_ramc(true);
1226+ ret = at91_dt_ramc(true);
1227+ if (ret)
1228+ return;
1229+
11371230 at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps));
11381231 at91_pm_init(NULL);
11391232
11401233 soc_pm.ws_ids = sama7g5_ws_ids;
11411234 soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;
1235+
1236+ soc_pm.sfrbu_regs.pswbu.key = (0x4BD20C << 8);
1237+ soc_pm.sfrbu_regs.pswbu.ctrl = BIT(0);
1238+ soc_pm.sfrbu_regs.pswbu.softsw = BIT(1);
1239+ soc_pm.sfrbu_regs.pswbu.state = BIT(2);
11421240 }
11431241
11441242 static int __init at91_pm_modes_select(char *str)
arch/arm/mach-at91/pm_suspend.S+33−9
@@ -1014,31 +1014,55 @@ ENTRY(at91_pm_suspend_in_sram) · 1013 unmodified lines
10141014 mov tmp1, #0
10151015 mcr p15, 0, tmp1, c7, c10, 4
10161016
1017+ /* Flush tlb. */
1018+ mov r4, #0
1019+ mcr p15, 0, r4, c8, c7, 0
1020+
1021+ ldr tmp1, [r0, #PM_DATA_PMC_MCKR_OFFSET]
1022+ str tmp1, .mckr_offset
1023+ ldr tmp1, [r0, #PM_DATA_PMC_VERSION]
1024+ str tmp1, .pmc_version
1025+ ldr tmp1, [r0, #PM_DATA_MEMCTRL]
1026+ str tmp1, .memtype
1027+ ldr tmp1, [r0, #PM_DATA_MODE]
1028+ str tmp1, .pm_mode
1029+
1030+ /*
1031+ * ldrne below are here to preload their address in the TLB as access
1032+ * to RAM may be limited while in self-refresh.
1033+ */
10171034 ldr tmp1, [r0, #PM_DATA_PMC]
10181035 str tmp1, .pmc_base
1036+ cmp tmp1, #0
1037+ ldrne tmp2, [tmp1, #0]
1038+
10191039 ldr tmp1, [r0, #PM_DATA_RAMC0]
10201040 str tmp1, .sramc_base
1041+ cmp tmp1, #0
1042+ ldrne tmp2, [tmp1, #0]
1043+
10211044 ldr tmp1, [r0, #PM_DATA_RAMC1]
10221045 str tmp1, .sramc1_base
1046+ cmp tmp1, #0
1047+ ldrne tmp2, [tmp1, #0]
1048+
1049+#ifndef CONFIG_SOC_SAM_V4_V5
1050+ /* ldrne below are here to preload their address in the TLB */
10231051 ldr tmp1, [r0, #PM_DATA_RAMC_PHY]
10241052 str tmp1, .sramc_phy_base
1025− ldr tmp1, [r0, #PM_DATA_MEMCTRL]
1026− str tmp1, .memtype
1027− ldr tmp1, [r0, #PM_DATA_MODE]
1028− str tmp1, .pm_mode
1029− ldr tmp1, [r0, #PM_DATA_PMC_MCKR_OFFSET]
1030− str tmp1, .mckr_offset
1031− ldr tmp1, [r0, #PM_DATA_PMC_VERSION]
1032− str tmp1, .pmc_version
1033− /* Both ldrne below are here to preload their address in the TLB */
1053+ cmp tmp1, #0
1054+ ldrne tmp2, [tmp1, #0]
1055+
10341056 ldr tmp1, [r0, #PM_DATA_SHDWC]
10351057 str tmp1, .shdwc
10361058 cmp tmp1, #0
10371059 ldrne tmp2, [tmp1, #0]
1060+
10381061 ldr tmp1, [r0, #PM_DATA_SFRBU]
10391062 str tmp1, .sfrbu
10401063 cmp tmp1, #0
10411064 ldrne tmp2, [tmp1, #0x10]
1065+#endif
10421066
10431067 /* Active the self-refresh mode */
10441068 at91_sramc_self_refresh_ena
arch/arm/mach-dove/include/mach/uncompress.h+2−2
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111
1212 #define LSR_THRE 0x20
1313
14−static void putc(const char c)
14+static inline void putc(const char c)
1515 {
1616 int i;
1717
@@ -24,7 +24,7 @@ static void putc(const char c) · 6 unmodified lines
2424 *UART_THR = c;
2525 }
2626
27−static void flush(void)
27+static inline void flush(void)
2828 {
2929 }
3030
arch/arm/mach-imx/mach-imx6q.c+3−0
@@ -172,6 +172,9 @@ static void __init imx6q_init_machine(void) · 171 unmodified lines
172172 imx_get_soc_revision());
173173
174174 imx6q_enet_phy_init();
175+
176+ of_platform_default_populate(NULL, NULL, NULL);
177+
175178 imx_anatop_init();
176179 cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init();
177180 imx6q_1588_init();
arch/arm/mach-imx/pm-imx6.c+2−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/io.h>
1111 #include <linux/irq.h>
1212 #include <linux/genalloc.h>
13+#include <linux/irqchip/arm-gic.h>
1314 #include <linux/mfd/syscon.h>
1415 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
1516 #include <linux/of.h>
@@ -619,6 +620,7 @@ static void __init imx6_pm_common_init(const struct imx6_pm_socdata · 603 unmodified lines
619620
620621 static void imx6_pm_stby_poweroff(void)
621622 {
623+ gic_cpu_if_down(0);
622624 imx6_set_lpm(STOP_POWER_OFF);
623625 imx6q_suspend_finish(0);
624626
arch/arm/mach-omap1/include/mach/memory.h+0−12
@@ -9,16 +9,4 @@ · 8 unmodified lines
99 /* REVISIT: omap1 legacy drivers still rely on this */
1010 #include <mach/soc.h>
1111
12−/*
13− * Bus address is physical address, except for OMAP-1510 Local Bus.
14− * OMAP-1510 bus address is translated into a Local Bus address if the
15− * OMAP bus type is lbus. We do the address translation based on the
16− * device overriding the defaults used in the dma-mapping API.
17− */
18−
19−/*
20− * OMAP-1510 Local Bus address offset
21− */
22−#define OMAP1510_LB_OFFSET UL(0x30000000)
23−
2412 #endif
arch/arm/mach-omap1/usb.c+82−34
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/platform_device.h>
1212 #include <linux/dma-map-ops.h>
1313 #include <linux/io.h>
14+#include <linux/delay.h>
1415
1516 #include <asm/irq.h>
1617
@@ -206,8 +207,6 @@ static inline void udc_device_init(struct omap_usb_config *pdata) · 189 unmodified lines
206207
207208 #endif
208209
209−#if IS_ENABLED(CONFIG_USB_OHCI_HCD)
210−
211210 /* The dmamask must be set for OHCI to work */
212211 static u64 ohci_dmamask = ~(u32)0;
213212
@@ -236,20 +235,15 @@ static struct platform_device ohci_device = { · 22 unmodified lines
236235
237236 static inline void ohci_device_init(struct omap_usb_config *pdata)
238237 {
238+ if (!IS_ENABLED(CONFIG_USB_OHCI_HCD))
239+ return;
240+
239241 if (cpu_is_omap7xx())
240242 ohci_resources[1].start = INT_7XX_USB_HHC_1;
241243 pdata->ohci_device = &ohci_device;
242244 pdata->ocpi_enable = &ocpi_enable;
243245 }
244246
245−#else
246−
247−static inline void ohci_device_init(struct omap_usb_config *pdata)
248−{
249−}
250−
251−#endif
252−
253247 #if defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG)
254248
255249 static struct resource otg_resources[] = {
@@ -534,33 +528,87 @@ bad: · 278 unmodified lines
534528 }
535529
536530 #ifdef CONFIG_ARCH_OMAP15XX
531+/* OMAP-1510 OHCI has its own MMU for DMA */
532+#define OMAP1510_LB_MEMSIZE 32 /* Should be same as SDRAM size */
533+#define OMAP1510_LB_CLOCK_DIV 0xfffec10c
534+#define OMAP1510_LB_MMU_CTL 0xfffec208
535+#define OMAP1510_LB_MMU_LCK 0xfffec224
536+#define OMAP1510_LB_MMU_LD_TLB 0xfffec228
537+#define OMAP1510_LB_MMU_CAM_H 0xfffec22c
538+#define OMAP1510_LB_MMU_CAM_L 0xfffec230
539+#define OMAP1510_LB_MMU_RAM_H 0xfffec234
540+#define OMAP1510_LB_MMU_RAM_L 0xfffec238
537541
538−/* ULPD_DPLL_CTRL */
539−#define DPLL_IOB (1 << 13)
540−#define DPLL_PLL_ENABLE (1 << 4)
541−#define DPLL_LOCK (1 << 0)
542+/*
543+ * Bus address is physical address, except for OMAP-1510 Local Bus.
544+ * OMAP-1510 bus address is translated into a Local Bus address if the
545+ * OMAP bus type is lbus.
546+ */
547+#define OMAP1510_LB_OFFSET UL(0x30000000)
542548
543−/* ULPD_APLL_CTRL */
544−#define APLL_NDPLL_SWITCH (1 << 0)
549+/*
550+ * OMAP-1510 specific Local Bus clock on/off
551+ */
552+static int omap_1510_local_bus_power(int on)
553+{
554+ if (on) {
555+ omap_writel((1 << 1) | (1 << 0), OMAP1510_LB_MMU_CTL);
556+ udelay(200);
557+ } else {
558+ omap_writel(0, OMAP1510_LB_MMU_CTL);
559+ }
545560
546−static int omap_1510_usb_ohci_notifier(struct notifier_block *nb,
547− unsigned long event, void *data)
561+ return 0;
562+}
563+
564+/*
565+ * OMAP-1510 specific Local Bus initialization
566+ * NOTE: This assumes 32MB memory size in OMAP1510LB_MEMSIZE.
567+ * See also arch/mach-omap/memory.h for __virt_to_dma() and
568+ * __dma_to_virt() which need to match with the physical
569+ * Local Bus address below.
570+ */
571+static int omap_1510_local_bus_init(void)
548572 {
549− struct device *dev = data;
573+ unsigned int tlb;
574+ unsigned long lbaddr, physaddr;
575+
576+ omap_writel((omap_readl(OMAP1510_LB_CLOCK_DIV) & 0xfffffff8) | 0x4,
577+ OMAP1510_LB_CLOCK_DIV);
578+
579+ /* Configure the Local Bus MMU table */
580+ for (tlb = 0; tlb < OMAP1510_LB_MEMSIZE; tlb++) {
581+ lbaddr = tlb * 0x00100000 + OMAP1510_LB_OFFSET;
582+ physaddr = tlb * 0x00100000 + PHYS_OFFSET;
583+ omap_writel((lbaddr & 0x0fffffff) >> 22, OMAP1510_LB_MMU_CAM_H);
584+ omap_writel(((lbaddr & 0x003ffc00) >> 6) | 0xc,
585+ OMAP1510_LB_MMU_CAM_L);
586+ omap_writel(physaddr >> 16, OMAP1510_LB_MMU_RAM_H);
587+ omap_writel((physaddr & 0x0000fc00) | 0x300, OMAP1510_LB_MMU_RAM_L);
588+ omap_writel(tlb << 4, OMAP1510_LB_MMU_LCK);
589+ omap_writel(0x1, OMAP1510_LB_MMU_LD_TLB);
590+ }
550591
551− if (event != BUS_NOTIFY_ADD_DEVICE)
552− return NOTIFY_DONE;
592+ /* Enable the walking table */
593+ omap_writel(omap_readl(OMAP1510_LB_MMU_CTL) | (1 << 3), OMAP1510_LB_MMU_CTL);
594+ udelay(200);
553595
554− if (strncmp(dev_name(dev), "ohci", 4) == 0 &&
555− dma_direct_set_offset(dev, PHYS_OFFSET, OMAP1510_LB_OFFSET,
556− (u64)-1))
557− WARN_ONCE(1, "failed to set DMA offset\n");
558− return NOTIFY_OK;
596+ return 0;
559597 }
560598
561−static struct notifier_block omap_1510_usb_ohci_nb = {
562− .notifier_call = omap_1510_usb_ohci_notifier,
563−};
599+static void omap_1510_local_bus_reset(void)
600+{
601+ omap_1510_local_bus_power(1);
602+ omap_1510_local_bus_init();
603+}
604+
605+/* ULPD_DPLL_CTRL */
606+#define DPLL_IOB (1 << 13)
607+#define DPLL_PLL_ENABLE (1 << 4)
608+#define DPLL_LOCK (1 << 0)
609+
610+/* ULPD_APLL_CTRL */
611+#define APLL_NDPLL_SWITCH (1 << 0)
564612
565613 static void __init omap_1510_usb_init(struct omap_usb_config *config)
566614 {
@@ -616,19 +664,19 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config) · 49 unmodified lines
616664 }
617665 #endif
618666
619−#if IS_ENABLED(CONFIG_USB_OHCI_HCD)
620− if (config->register_host) {
667+ if (IS_ENABLED(CONFIG_USB_OHCI_HCD) && config->register_host) {
621668 int status;
622669
623− bus_register_notifier(&platform_bus_type,
624− &omap_1510_usb_ohci_nb);
625670 ohci_device.dev.platform_data = config;
671+ dma_direct_set_offset(&ohci_device.dev, PHYS_OFFSET,
672+ OMAP1510_LB_OFFSET, (u64)-1);
626673 status = platform_device_register(&ohci_device);
627674 if (status)
628675 pr_debug("can't register OHCI device, %d\n", status);
629676 /* hcd explicitly gates 48MHz */
677+
678+ config->lb_reset = omap_1510_local_bus_reset;
630679 }
631−#endif
632680 }
633681
634682 #else
arch/arm/mach-omap2/omap_hwmod.c+2−0
@@ -3614,6 +3614,8 @@ int omap_hwmod_init_module(struct device *dev, · 3613 unmodified lines
36143614 oh->flags |= HWMOD_SWSUP_SIDLE_ACT;
36153615 if (data->cfg->quirks & SYSC_QUIRK_SWSUP_MSTANDBY)
36163616 oh->flags |= HWMOD_SWSUP_MSTANDBY;
3617+ if (data->cfg->quirks & SYSC_QUIRK_CLKDM_NOAUTO)
3618+ oh->flags |= HWMOD_CLKDM_NOAUTO;
36173619
36183620 error = omap_hwmod_check_module(dev, oh, data, sysc_fields,
36193621 rev_offs, sysc_offs, syss_offs,
arch/arm/net/bpf_jit_32.c+19−0
@@ -36,6 +36,10 @@ · 35 unmodified lines
3636 * +-----+
3737 * |RSVD | JIT scratchpad
3838 * current ARM_SP => +-----+ <= (BPF_FP - STACK_SIZE + SCRATCH_SIZE)
39+ * | ... | caller-saved registers
40+ * +-----+
41+ * | ... | arguments passed on stack
42+ * ARM_SP during call => +-----|
3943 * | |
4044 * | ... | Function call stack
4145 * | |
@@ -63,6 +67,12 @@ · 21 unmodified lines
6367 *
6468 * When popping registers off the stack at the end of a BPF function, we
6569 * reference them via the current ARM_FP register.
70+ *
71+ * Some eBPF operations are implemented via a call to a helper function.
72+ * Such calls are "invisible" in the eBPF code, so it is up to the calling
73+ * program to preserve any caller-saved ARM registers during the call. The
74+ * JIT emits code to push and pop those registers onto the stack, immediately
75+ * above the callee stack frame.
6676 */
6777 #define CALLEE_MASK (1 << ARM_R4 | 1 << ARM_R5 | 1 << ARM_R6 | \
6878 1 << ARM_R7 | 1 << ARM_R8 | 1 << ARM_R9 | \
@@ -70,6 +80,8 @@ · 1 unmodified line
7080 #define CALLEE_PUSH_MASK (CALLEE_MASK | 1 << ARM_LR)
7181 #define CALLEE_POP_MASK (CALLEE_MASK | 1 << ARM_PC)
7282
83+#define CALLER_MASK (1 << ARM_R0 | 1 << ARM_R1 | 1 << ARM_R2 | 1 << ARM_R3)
84+
7385 enum {
7486 /* Stack layout - these are offsets from (top of stack - 4) */
7587 BPF_R2_HI,
@@ -464,6 +476,7 @@ static inline int epilogue_offset(const struct jit_ctx *ctx) · 388 unmodified lines
464476
465477 static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op)
466478 {
479+ const int exclude_mask = BIT(ARM_R0) | BIT(ARM_R1);
467480 const s8 *tmp = bpf2a32[TMP_REG_1];
468481
469482 #if __LINUX_ARM_ARCH__ == 7
@@ -495,11 +508,17 @@ static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op) · 25 unmodified lines
495508 emit(ARM_MOV_R(ARM_R0, rm), ctx);
496509 }
497510
511+ /* Push caller-saved registers on stack */
512+ emit(ARM_PUSH(CALLER_MASK & ~exclude_mask), ctx);
513+
498514 /* Call appropriate function */
499515 emit_mov_i(ARM_IP, op == BPF_DIV ?
500516 (u32)jit_udiv32 : (u32)jit_mod32, ctx);
501517 emit_blx_r(ARM_IP, ctx);
502518
519+ /* Restore caller-saved registers from stack */
520+ emit(ARM_POP(CALLER_MASK & ~exclude_mask), ctx);
521+
503522 /* Save return value */
504523 if (rd != ARM_R0)
505524 emit(ARM_MOV_R(rd, ARM_R0), ctx);
arch/arm64/boot/dts/arm/foundation-v8.dtsi+0−1
@@ -115,7 +115,6 @@ · 114 unmodified lines
115115
116116 bus@8000000 {
117117 compatible = "arm,vexpress,v2m-p1", "simple-bus";
118− arm,v2m-memory-map = "rs1";
119118 #address-cells = <2>; /* SMB chipselect number and offset */
120119 #size-cells = <1>;
121120
arch/arm64/boot/dts/arm/fvp-base-revc.dts+0−23
@@ -192,32 +192,9 @@ · 191 unmodified lines
192192 remote-endpoint = <&clcd_pads>;
193193 };
194194 };
195−
196− panel-timing {
197− clock-frequency = <63500127>;
198− hactive = <1024>;
199− hback-porch = <152>;
200− hfront-porch = <48>;
201− hsync-len = <104>;
202− vactive = <768>;
203− vback-porch = <23>;
204− vfront-porch = <3>;
205− vsync-len = <4>;
206− };
207195 };
208196
209197 bus@8000000 {
210− compatible = "simple-bus";
211−
212− #address-cells = <2>;
213− #size-cells = <1>;
214− ranges = <0 0 0 0x08000000 0x04000000>,
215− <1 0 0 0x14000000 0x04000000>,
216− <2 0 0 0x18000000 0x04000000>,
217− <3 0 0 0x1c000000 0x04000000>,
218− <4 0 0 0x0c000000 0x04000000>,
219− <5 0 0 0x10000000 0x04000000>;
220−
221198 #interrupt-cells = <1>;
222199 interrupt-map-mask = <0 0 63>;
223200 interrupt-map = <0 0 0 &gic 0 0 GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
arch/arm64/boot/dts/arm/juno-base.dtsi+0−12
@@ -27,8 +27,6 @@ · 26 unmodified lines
2727 reg = <0x0 0x2b1f0000 0x0 0x1000>;
2828 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>,
2929 <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
30− interrupt-names = "mhu_lpri_rx",
31− "mhu_hpri_rx";
3230 #mbox-cells = <1>;
3331 clocks = <&soc_refclk100mhz>;
3432 clock-names = "apb_pclk";
@@ -804,16 +802,6 @@ · 769 unmodified lines
804802 };
805803
806804 bus@8000000 {
807− compatible = "simple-bus";
808− #address-cells = <2>;
809− #size-cells = <1>;
810− ranges = <0 0 0 0x08000000 0x04000000>,
811− <1 0 0 0x14000000 0x04000000>,
812− <2 0 0 0x18000000 0x04000000>,
813− <3 0 0 0x1c000000 0x04000000>,
814− <4 0 0 0x0c000000 0x04000000>,
815− <5 0 0 0x10000000 0x04000000>;
816−
817805 #interrupt-cells = <1>;
818806 interrupt-map-mask = <0 0 15>;
819807 interrupt-map = <0 0 0 &gic 0 GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
arch/arm64/boot/dts/arm/juno-motherboard.dtsi+14−7
@@ -92,16 +92,23 @@ · 91 unmodified lines
9292 };
9393
9494 bus@8000000 {
95− motherboard-bus {
95+ compatible = "simple-bus";
96+ #address-cells = <2>;
97+ #size-cells = <1>;
98+ ranges = <0 0x8000000 0 0x8000000 0x18000000>;
99+
100+ motherboard-bus@8000000 {
96101 compatible = "arm,vexpress,v2p-p1", "simple-bus";
97102 #address-cells = <2>; /* SMB chipselect number and offset */
98103 #size-cells = <1>;
99− #interrupt-cells = <1>;
100− ranges;
101− model = "V2M-Juno";
104+ ranges = <0 0 0 0x08000000 0x04000000>,
105+ <1 0 0 0x14000000 0x04000000>,
106+ <2 0 0 0x18000000 0x04000000>,
107+ <3 0 0 0x1c000000 0x04000000>,
108+ <4 0 0 0x0c000000 0x04000000>,
109+ <5 0 0 0x10000000 0x04000000>;
102110 arm,hbi = <0x252>;
103111 arm,vexpress,site = <0>;
104− arm,v2m-memory-map = "rs1";
105112
106113 flash@0 {
107114 /* 2 * 32MiB NOR Flash memory mounted on CS0 */
@@ -218,7 +225,7 @@ · 110 unmodified lines
218225 };
219226 };
220227
221− mmci@50000 {
228+ mmc@50000 {
222229 compatible = "arm,pl180", "arm,primecell";
223230 reg = <0x050000 0x1000>;
224231 interrupts = <5>;
@@ -246,7 +253,7 @@ · 21 unmodified lines
246253 clock-names = "KMIREFCLK", "apb_pclk";
247254 };
248255
249− wdt@f0000 {
256+ watchdog@f0000 {
250257 compatible = "arm,sp805", "arm,primecell";
251258 reg = <0x0f0000 0x10000>;
252259 interrupts = <7>;
arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts+0−11
@@ -133,17 +133,6 @@ · 132 unmodified lines
133133 };
134134
135135 bus@8000000 {
136− compatible = "simple-bus";
137−
138− #address-cells = <2>;
139− #size-cells = <1>;
140− ranges = <0 0 0 0x08000000 0x04000000>,
141− <1 0 0 0x14000000 0x04000000>,
142− <2 0 0 0x18000000 0x04000000>,
143− <3 0 0 0x1c000000 0x04000000>,
144− <4 0 0 0x0c000000 0x04000000>,
145− <5 0 0 0x10000000 0x04000000>;
146−
147136 #interrupt-cells = <1>;
148137 interrupt-map-mask = <0 0 63>;
149138 interrupt-map = <0 0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
arch/arm64/boot/dts/arm/rtsm_ve-motherboard-rs2.dtsi+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 */
77 / {
88 bus@8000000 {
9− motherboard-bus {
9+ motherboard-bus@8000000 {
1010 arm,v2m-memory-map = "rs2";
1111
1212 iofpga-bus@300000000 {
arch/arm64/boot/dts/arm/rtsm_ve-motherboard.dtsi+14−6
@@ -77,13 +77,21 @@ · 76 unmodified lines
7777 };
7878
7979 bus@8000000 {
80− motherboard-bus {
81− arm,v2m-memory-map = "rs1";
80+ compatible = "simple-bus";
81+ #address-cells = <2>;
82+ #size-cells = <1>;
83+ ranges = <0 0x8000000 0 0x8000000 0x18000000>;
84+
85+ motherboard-bus@8000000 {
8286 compatible = "arm,vexpress,v2m-p1", "simple-bus";
8387 #address-cells = <2>; /* SMB chipselect number and offset */
8488 #size-cells = <1>;
85− #interrupt-cells = <1>;
86− ranges;
89+ ranges = <0 0 0 0x08000000 0x04000000>,
90+ <1 0 0 0x14000000 0x04000000>,
91+ <2 0 0 0x18000000 0x04000000>,
92+ <3 0 0 0x1c000000 0x04000000>,
93+ <4 0 0 0x0c000000 0x04000000>,
94+ <5 0 0 0x10000000 0x04000000>;
8795
8896 flash@0 {
8997 compatible = "arm,vexpress-flash", "cfi-flash";
@@ -130,7 +138,7 @@ · 40 unmodified lines
130138 clock-names = "apb_pclk";
131139 };
132140
133− mmci@50000 {
141+ mmc@50000 {
134142 compatible = "arm,pl180", "arm,primecell";
135143 reg = <0x050000 0x1000>;
136144 interrupts = <9>, <10>;
@@ -190,7 +198,7 @@ · 53 unmodified lines
190198 clock-names = "uartclk", "apb_pclk";
191199 };
192200
193− wdt@f0000 {
201+ watchdog@f0000 {
194202 compatible = "arm,sp805", "arm,primecell";
195203 reg = <0x0f0000 0x1000>;
196204 interrupts = <0>;
arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts+1−56
@@ -145,61 +145,6 @@ · 144 unmodified lines
145145 };
146146
147147 smb: bus@8000000 {
148− compatible = "simple-bus";
149−
150− #address-cells = <2>;
151− #size-cells = <1>;
152− ranges = <0 0 0 0x08000000 0x04000000>,
153− <1 0 0 0x14000000 0x04000000>,
154− <2 0 0 0x18000000 0x04000000>,
155− <3 0 0 0x1c000000 0x04000000>,
156− <4 0 0 0x0c000000 0x04000000>,
157− <5 0 0 0x10000000 0x04000000>;
158−
159− #interrupt-cells = <1>;
160− interrupt-map-mask = <0 0 63>;
161− interrupt-map = <0 0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
162− <0 0 1 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
163− <0 0 2 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
164− <0 0 3 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
165− <0 0 4 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
166− <0 0 5 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
167− <0 0 6 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
168− <0 0 7 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
169− <0 0 8 &gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
170− <0 0 9 &gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
171− <0 0 10 &gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
172− <0 0 11 &gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
173− <0 0 12 &gic GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
174− <0 0 13 &gic GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>,
175− <0 0 14 &gic GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>,
176− <0 0 15 &gic GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
177− <0 0 16 &gic GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
178− <0 0 17 &gic GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
179− <0 0 18 &gic GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
180− <0 0 19 &gic GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>,
181− <0 0 20 &gic GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
182− <0 0 21 &gic GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
183− <0 0 22 &gic GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
184− <0 0 23 &gic GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>,
185− <0 0 24 &gic GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
186− <0 0 25 &gic GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
187− <0 0 26 &gic GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>,
188− <0 0 27 &gic GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>,
189− <0 0 28 &gic GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>,
190− <0 0 29 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
191− <0 0 30 &gic GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>,
192− <0 0 31 &gic GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>,
193− <0 0 32 &gic GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>,
194− <0 0 33 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>,
195− <0 0 34 &gic GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
196− <0 0 35 &gic GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>,
197− <0 0 36 &gic GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>,
198− <0 0 37 &gic GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>,
199− <0 0 38 &gic GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>,
200− <0 0 39 &gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
201− <0 0 40 &gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
202− <0 0 41 &gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
203− <0 0 42 &gic GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
148+ ranges = <0x8000000 0 0x8000000 0x18000000>;
204149 };
205150 };
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi+2−2
@@ -405,9 +405,9 @@ · 404 unmodified lines
405405 interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
406406 clock-frequency = <0>; /* fixed up by bootloader */
407407 clocks = <&clockgen QORIQ_CLK_HWACCEL 1>;
408− voltage-ranges = <1800 1800 3300 3300>;
408+ voltage-ranges = <1800 1800>;
409409 sdhci,auto-cmd12;
410− broken-cd;
410+ non-removable;
411411 little-endian;
412412 bus-width = <4>;
413413 status = "disabled";
arch/arm64/boot/dts/freescale/imx8mm-beacon-som.dtsi+1−1
@@ -91,7 +91,7 @@ · 90 unmodified lines
9191 #size-cells = <1>;
9292 compatible = "jedec,spi-nor";
9393 spi-max-frequency = <80000000>;
94− spi-tx-bus-width = <4>;
94+ spi-tx-bus-width = <1>;
9595 spi-rx-bus-width = <4>;
9696 };
9797 };
arch/arm64/boot/dts/freescale/imx8mm-evk.dts+1−1
@@ -48,7 +48,7 @@ · 47 unmodified lines
4848 #size-cells = <1>;
4949 compatible = "jedec,spi-nor";
5050 spi-max-frequency = <80000000>;
51− spi-tx-bus-width = <4>;
51+ spi-tx-bus-width = <1>;
5252 spi-rx-bus-width = <4>;
5353 };
5454 };
arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi+1−0
@@ -102,6 +102,7 @@ · 101 unmodified lines
102102 regulator-min-microvolt = <850000>;
103103 regulator-max-microvolt = <950000>;
104104 regulator-boot-on;
105+ regulator-always-on;
105106 regulator-ramp-delay = <3125>;
106107 nxp,dvs-run-voltage = <950000>;
107108 nxp,dvs-standby-voltage = <850000>;
arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dts+1−1
@@ -647,7 +647,7 @@ · 646 unmodified lines
647647 pinctrl_hog: hoggrp {
648648 fsl,pins = <
649649 MX8MM_IOMUXC_NAND_CE0_B_GPIO3_IO1 0x40000159 /* M2_GDIS# */
650− MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x40000041 /* M2_RST# */
650+ MX8MM_IOMUXC_GPIO1_IO13_GPIO1_IO13 0x40000041 /* M2_RST# */
651651 MX8MM_IOMUXC_NAND_DATA01_GPIO3_IO7 0x40000119 /* M2_OFF# */
652652 MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x40000159 /* M2_WDIS# */
653653 MX8MM_IOMUXC_SAI1_TXD2_GPIO4_IO14 0x40000041 /* AMP GPIO1 */
arch/arm64/boot/dts/freescale/imx8mn-beacon-som.dtsi+1−1
@@ -101,7 +101,7 @@ · 100 unmodified lines
101101 #size-cells = <1>;
102102 compatible = "jedec,spi-nor";
103103 spi-max-frequency = <80000000>;
104− spi-tx-bus-width = <4>;
104+ spi-tx-bus-width = <1>;
105105 spi-rx-bus-width = <4>;
106106 };
107107 };
arch/arm64/boot/dts/freescale/imx8mn-venice-gw7902.dts+1−1
@@ -633,7 +633,7 @@ · 632 unmodified lines
633633 pinctrl_hog: hoggrp {
634634 fsl,pins = <
635635 MX8MN_IOMUXC_NAND_CE0_B_GPIO3_IO1 0x40000159 /* M2_GDIS# */
636− MX8MN_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x40000041 /* M2_RST# */
636+ MX8MN_IOMUXC_GPIO1_IO13_GPIO1_IO13 0x40000041 /* M2_RST# */
637637 MX8MN_IOMUXC_NAND_DATA01_GPIO3_IO7 0x40000119 /* M2_OFF# */
638638 MX8MN_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x40000159 /* M2_WDIS# */
639639 MX8MN_IOMUXC_SAI2_RXFS_GPIO4_IO21 0x40000041 /* APP GPIO1 */
arch/arm64/boot/dts/freescale/imx8mp-phycore-som.dtsi+1−1
@@ -74,7 +74,7 @@ · 73 unmodified lines
7474 compatible = "jedec,spi-nor";
7575 reg = <0>;
7676 spi-max-frequency = <80000000>;
77− spi-tx-bus-width = <4>;
77+ spi-tx-bus-width = <1>;
7878 spi-rx-bus-width = <4>;
7979 };
8080 };
arch/arm64/boot/dts/freescale/imx8mq-evk.dts+2−0
@@ -337,6 +337,8 @@ · 336 unmodified lines
337337 #size-cells = <1>;
338338 compatible = "micron,n25q256a", "jedec,spi-nor";
339339 spi-max-frequency = <29000000>;
340+ spi-tx-bus-width = <1>;
341+ spi-rx-bus-width = <4>;
340342 };
341343 };
342344
arch/arm64/boot/dts/freescale/imx8mq-kontron-pitx-imx8m.dts+1−1
@@ -281,7 +281,7 @@ · 280 unmodified lines
281281 #address-cells = <1>;
282282 #size-cells = <1>;
283283 reg = <0>;
284− spi-tx-bus-width = <4>;
284+ spi-tx-bus-width = <1>;
285285 spi-rx-bus-width = <4>;
286286 m25p,fast-read;
287287 spi-max-frequency = <50000000>;
arch/arm64/boot/dts/qcom/pm8150.dtsi+3−1
@@ -48,8 +48,10 @@ · 47 unmodified lines
4848 #size-cells = <0>;
4949
5050 pon: power-on@800 {
51− compatible = "qcom,pm8916-pon";
51+ compatible = "qcom,pm8998-pon";
5252 reg = <0x0800>;
53+ mode-bootloader = <0x2>;
54+ mode-recovery = <0x1>;
5355
5456 pon_pwrkey: pwrkey {
5557 compatible = "qcom,pm8941-pwrkey";
arch/arm64/boot/dts/qcom/qrb5165-rb5.dts+10−0
@@ -804,6 +804,16 @@ · 803 unmodified lines
804804 };
805805 };
806806
807+&pon_pwrkey {
808+ status = "okay";
809+};
810+
811+&pon_resin {
812+ status = "okay";
813+
814+ linux,code = <KEY_VOLUMEDOWN>;
815+};
816+
807817 &qupv3_id_0 {
808818 status = "okay";
809819 };
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi+4−5
@@ -273,7 +273,6 @@ · 272 unmodified lines
273273 "Headphone Jack", "HPOL",
274274 "Headphone Jack", "HPOR";
275275
276− #sound-dai-cells = <0>;
277276 #address-cells = <1>;
278277 #size-cells = <0>;
279278
@@ -301,11 +300,11 @@ · 21 unmodified lines
301300 };
302301 };
303302
304− dai-link@2 {
303+ dai-link@5 {
305304 link-name = "MultiMedia2";
306− reg = <2>;
305+ reg = <LPASS_DP_RX>;
307306 cpu {
308− sound-dai = <&lpass_cpu 2>;
307+ sound-dai = <&lpass_cpu LPASS_DP_RX>;
309308 };
310309
311310 codec {
@@ -782,7 +781,7 @@ hp_i2c: &i2c9 { · 470 unmodified lines
782781 qcom,playback-sd-lines = <0>;
783782 };
784783
785− hdmi-primary@0 {
784+ hdmi@5 {
786785 reg = <LPASS_DP_RX>;
787786 };
788787 };
arch/arm64/boot/dts/qcom/sc7280.dtsi+3−3
@@ -1850,9 +1850,9 @@ · 1849 unmodified lines
18501850
18511851 cpufreq_hw: cpufreq@18591000 {
18521852 compatible = "qcom,cpufreq-epss";
1853− reg = <0 0x18591100 0 0x900>,
1854− <0 0x18592100 0 0x900>,
1855− <0 0x18593100 0 0x900>;
1853+ reg = <0 0x18591000 0 0x1000>,
1854+ <0 0x18592000 0 0x1000>,
1855+ <0 0x18593000 0 0x1000>;
18561856 clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GCC_GPLL0>;
18571857 clock-names = "xo", "alternate";
18581858 #freq-domain-cells = <1>;
arch/arm64/boot/dts/qcom/sdm630.dtsi+13−2
@@ -654,9 +654,20 @@ · 653 unmodified lines
654654 compatible = "qcom,sdm660-a2noc";
655655 reg = <0x01704000 0xc100>;
656656 #interconnect-cells = <1>;
657− clock-names = "bus", "bus_a";
657+ clock-names = "bus",
658+ "bus_a",
659+ "ipa",
660+ "ufs_axi",
661+ "aggre2_ufs_axi",
662+ "aggre2_usb3_axi",
663+ "cfg_noc_usb2_axi";
658664 clocks = <&rpmcc RPM_SMD_AGGR2_NOC_CLK>,
659− <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>;
665+ <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>,
666+ <&rpmcc RPM_SMD_IPA_CLK>,
667+ <&gcc GCC_UFS_AXI_CLK>,
668+ <&gcc GCC_AGGRE2_UFS_AXI_CLK>,
669+ <&gcc GCC_AGGRE2_USB3_AXI_CLK>,
670+ <&gcc GCC_CFG_NOC_USB2_AXI_CLK>;
660671 };
661672
662673 mnoc: interconnect@1745000 {
arch/arm64/boot/dts/qcom/sdm845.dtsi+13−8
@@ -128,23 +128,28 @@ · 127 unmodified lines
128128 no-map;
129129 };
130130
131− wlan_msa_mem: memory@8c400000 {
132− reg = <0 0x8c400000 0 0x100000>;
131+ ipa_fw_mem: memory@8c400000 {
132+ reg = <0 0x8c400000 0 0x10000>;
133133 no-map;
134134 };
135135
136− gpu_mem: memory@8c515000 {
137− reg = <0 0x8c515000 0 0x2000>;
136+ ipa_gsi_mem: memory@8c410000 {
137+ reg = <0 0x8c410000 0 0x5000>;
138138 no-map;
139139 };
140140
141− ipa_fw_mem: memory@8c517000 {
142− reg = <0 0x8c517000 0 0x5a000>;
141+ gpu_mem: memory@8c415000 {
142+ reg = <0 0x8c415000 0 0x2000>;
143143 no-map;
144144 };
145145
146− adsp_mem: memory@8c600000 {
147− reg = <0 0x8c600000 0 0x1a00000>;
146+ adsp_mem: memory@8c500000 {
147+ reg = <0 0x8c500000 0 0x1a00000>;
148+ no-map;
149+ };
150+
151+ wlan_msa_mem: memory@8df00000 {
152+ reg = <0 0x8df00000 0 0x100000>;
148153 no-map;
149154 };
150155
arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts+34−0
@@ -16,6 +16,17 @@ · 15 unmodified lines
1616 #include "sdm850.dtsi"
1717 #include "pm8998.dtsi"
1818
19+/*
20+ * Update following upstream (sdm845.dtsi) reserved
21+ * memory mappings for firmware loading to succeed
22+ * and enable the IPA device.
23+ */
24+/delete-node/ &ipa_fw_mem;
25+/delete-node/ &ipa_gsi_mem;
26+/delete-node/ &gpu_mem;
27+/delete-node/ &adsp_mem;
28+/delete-node/ &wlan_msa_mem;
29+
1930 / {
2031 model = "Lenovo Yoga C630";
2132 compatible = "lenovo,yoga-c630", "qcom,sdm845";
@@ -58,6 +69,29 @@ · 36 unmodified lines
5869 };
5970 };
6071
72+ /* Reserved memory changes for IPA */
73+ reserved-memory {
74+ wlan_msa_mem: memory@8c400000 {
75+ reg = <0 0x8c400000 0 0x100000>;
76+ no-map;
77+ };
78+
79+ gpu_mem: memory@8c515000 {
80+ reg = <0 0x8c515000 0 0x2000>;
81+ no-map;
82+ };
83+
84+ ipa_fw_mem: memory@8c517000 {
85+ reg = <0 0x8c517000 0 0x5a000>;
86+ no-map;
87+ };
88+
89+ adsp_mem: memory@8c600000 {
90+ reg = <0 0x8c600000 0 0x1a00000>;
91+ no-map;
92+ };
93+ };
94+
6195 sn65dsi86_refclk: sn65dsi86-refclk {
6296 compatible = "fixed-clock";
6397 #clock-cells = <0>;
arch/mips/include/asm/mips-cps.h+1−22
@@ -10,8 +10,6 @@ · 9 unmodified lines
1010 #include <linux/io.h>
1111 #include <linux/types.h>
1212
13−#include <asm/mips-boards/launch.h>
14−
1513 extern unsigned long __cps_access_bad_size(void)
1614 __compiletime_error("Bad size for CPS accessor");
1715
@@ -167,30 +165,11 @@ static inline uint64_t mips_cps_cluster_config(unsigned int cluster) · 149 unmodified lines
167165 */
168166 static inline unsigned int mips_cps_numcores(unsigned int cluster)
169167 {
170− unsigned int ncores;
171−
172168 if (!mips_cm_present())
173169 return 0;
174170
175171 /* Add one before masking to handle 0xff indicating no cores */
176− ncores = (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES;
177−
178− if (IS_ENABLED(CONFIG_SOC_MT7621)) {
179− struct cpulaunch *launch;
180−
181− /*
182− * Ralink MT7621S SoC is single core, but the GCR_CONFIG method
183− * always reports 2 cores. Check the second core's LAUNCH_FREADY
184− * flag to detect if the second core is missing. This method
185− * only works before the core has been started.
186− */
187− launch = (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH);
188− launch += 2; /* MT7621 has 2 VPEs per core */
189− if (!(launch->flags & LAUNCH_FREADY))
190− ncores = 1;
191− }
192−
193− return ncores;
172+ return (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES;
194173 }
195174
196175 /**
arch/powerpc/boot/dts/fsl/t1023rdb.dts+1−1
@@ -154,7 +154,7 @@ · 153 unmodified lines
154154
155155 fm1mac3: ethernet@e4000 {
156156 phy-handle = <&sgmii_aqr_phy3>;
157− phy-connection-type = "sgmii-2500";
157+ phy-connection-type = "2500base-x";
158158 sleep = <&rcpm 0x20000000>;
159159 };
160160
arch/x86/events/core.c+1−0
@@ -2465,6 +2465,7 @@ static int x86_pmu_event_init(struct perf_event *event) · 2464 unmodified lines
24652465 if (err) {
24662466 if (event->destroy)
24672467 event->destroy(event);
2468+ event->destroy = NULL;
24682469 }
24692470
24702471 if (READ_ONCE(x86_pmu.attr_rdpmc) &&
arch/x86/events/intel/core.c+1−0
@@ -263,6 +263,7 @@ static struct event_constraint intel_icl_event_constraints[] = { · 262 unmodified lines
263263 INTEL_EVENT_CONSTRAINT_RANGE(0xa8, 0xb0, 0xf),
264264 INTEL_EVENT_CONSTRAINT_RANGE(0xb7, 0xbd, 0xf),
265265 INTEL_EVENT_CONSTRAINT_RANGE(0xd0, 0xe6, 0xf),
266+ INTEL_EVENT_CONSTRAINT(0xef, 0xf),
266267 INTEL_EVENT_CONSTRAINT_RANGE(0xf0, 0xf4, 0xf),
267268 EVENT_CONSTRAINT_END
268269 };
arch/x86/hyperv/hv_apic.c+15−5
@@ -122,17 +122,27 @@ static bool __send_ipi_mask_ex(const struct cpumask *mask, int vector, · 121 unmodified lines
122122 ipi_arg->reserved = 0;
123123 ipi_arg->vp_set.valid_bank_mask = 0;
124124
125− if (!cpumask_equal(mask, cpu_present_mask)) {
125+ /*
126+ * Use HV_GENERIC_SET_ALL and avoid converting cpumask to VP_SET
127+ * when the IPI is sent to all currently present CPUs.
128+ */
129+ if (!cpumask_equal(mask, cpu_present_mask) || exclude_self) {
126130 ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K;
127131 if (exclude_self)
128132 nr_bank = cpumask_to_vpset_noself(&(ipi_arg->vp_set), mask);
129133 else
130134 nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask);
131− }
132− if (nr_bank < 0)
133− goto ipi_mask_ex_done;
134− if (!nr_bank)
135+
136+ /*
137+ * 'nr_bank <= 0' means some CPUs in cpumask can't be
138+ * represented in VP_SET. Return an error and fall back to
139+ * native (architectural) method of sending IPIs.
140+ */
141+ if (nr_bank <= 0)
142+ goto ipi_mask_ex_done;
143+ } else {
135144 ipi_arg->vp_set.format = HV_GENERIC_SET_ALL;
145+ }
136146
137147 status = hv_do_rep_hypercall(HVCALL_SEND_IPI_EX, 0, nr_bank,
138148 ipi_arg, NULL);
arch/x86/include/asm/kvmclock.h+14−0
@@ -2,6 +2,20 @@ · 1 unmodified line
22 #ifndef _ASM_X86_KVM_CLOCK_H
33 #define _ASM_X86_KVM_CLOCK_H
44
5+#include <linux/percpu.h>
6+
57 extern struct clocksource kvm_clock;
68
9+DECLARE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu);
10+
11+static inline struct pvclock_vcpu_time_info *this_cpu_pvti(void)
12+{
13+ return &this_cpu_read(hv_clock_per_cpu)->pvti;
14+}
15+
16+static inline struct pvclock_vsyscall_time_info *this_cpu_hvclock(void)
17+{
18+ return this_cpu_read(hv_clock_per_cpu);
19+}
20+
721 #endif /* _ASM_X86_KVM_CLOCK_H */
arch/x86/kernel/kvmclock.c+2−11
@@ -49,18 +49,9 @@ early_param("no-kvmclock-vsyscall", parse_no_kvmclock_vsyscall); · 48 unmodified lines
4949 static struct pvclock_vsyscall_time_info
5050 hv_clock_boot[HVC_BOOT_ARRAY_SIZE] __bss_decrypted __aligned(PAGE_SIZE);
5151 static struct pvclock_wall_clock wall_clock __bss_decrypted;
52−static DEFINE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu);
5352 static struct pvclock_vsyscall_time_info *hvclock_mem;
54−
55−static inline struct pvclock_vcpu_time_info *this_cpu_pvti(void)
56−{
57− return &this_cpu_read(hv_clock_per_cpu)->pvti;
58−}
59−
60−static inline struct pvclock_vsyscall_time_info *this_cpu_hvclock(void)
61−{
62− return this_cpu_read(hv_clock_per_cpu);
63−}
53+DEFINE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu);
54+EXPORT_PER_CPU_SYMBOL_GPL(hv_clock_per_cpu);
6455
6556 /*
6657 * The wallclock is the time of day when we booted. Since then, some time may
arch/x86/kvm/cpuid.c+2−2
@@ -65,8 +65,8 @@ static inline struct kvm_cpuid_entry2 *cpuid_entry2_find( · 64 unmodified lines
6565 for (i = 0; i < nent; i++) {
6666 e = &entries[i];
6767
68− if (e->function == function && (e->index == index ||
69− !(e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX)))
68+ if (e->function == function &&
69+ (!(e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX) || e->index == index))
7070 return e;
7171 }
7272
arch/x86/kvm/emulate.c+0−1
@@ -435,7 +435,6 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop); · 434 unmodified lines
435435 __FOP_RET(#op)
436436
437437 asm(".pushsection .fixup, \"ax\"\n"
438− ".global kvm_fastop_exception \n"
439438 "kvm_fastop_exception: xor %esi, %esi; ret\n"
440439 ".popsection");
441440
arch/x86/kvm/vmx/vmx.c+1−1
@@ -6848,7 +6848,7 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu) · 6847 unmodified lines
68486848 */
68496849 tsx_ctrl = vmx_find_uret_msr(vmx, MSR_IA32_TSX_CTRL);
68506850 if (tsx_ctrl)
6851− vmx->guest_uret_msrs[i].mask = ~(u64)TSX_CTRL_CPUID_CLEAR;
6851+ tsx_ctrl->mask = ~(u64)TSX_CTRL_CPUID_CLEAR;
68526852 }
68536853
68546854 err = alloc_loaded_vmcs(&vmx->vmcs01);
block/bfq-iosched.c+3−13
@@ -2662,15 +2662,6 @@ bfq_setup_merge(struct bfq_queue *bfqq, struct bfq_queue *new_bfqq) · 2661 unmodified lines
26622662 * are likely to increase the throughput.
26632663 */
26642664 bfqq->new_bfqq = new_bfqq;
2665− /*
2666− * The above assignment schedules the following redirections:
2667− * each time some I/O for bfqq arrives, the process that
2668− * generated that I/O is disassociated from bfqq and
2669− * associated with new_bfqq. Here we increases new_bfqq->ref
2670− * in advance, adding the number of processes that are
2671− * expected to be associated with new_bfqq as they happen to
2672− * issue I/O.
2673− */
26742665 new_bfqq->ref += process_refs;
26752666 return new_bfqq;
26762667 }
@@ -2733,10 +2724,6 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, · 56 unmodified lines
27332724 {
27342725 struct bfq_queue *in_service_bfqq, *new_bfqq;
27352726
2736− /* if a merge has already been setup, then proceed with that first */
2737− if (bfqq->new_bfqq)
2738− return bfqq->new_bfqq;
2739−
27402727 /*
27412728 * Check delayed stable merge for rotational or non-queueing
27422729 * devs. For this branch to be executed, bfqq must not be
@@ -2838,6 +2825,9 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, · 95 unmodified lines
28382825 if (bfq_too_late_for_merging(bfqq))
28392826 return NULL;
28402827
2828+ if (bfqq->new_bfqq)
2829+ return bfqq->new_bfqq;
2830+
28412831 if (!io_struct || unlikely(bfqq == &bfqd->oom_bfqq))
28422832 return NULL;
28432833
drivers/acpi/nfit/core.c+12−0
@@ -3007,6 +3007,18 @@ static int acpi_nfit_register_region(struct acpi_nfit_desc *acpi_desc, · 3006 unmodified lines
30073007 ndr_desc->target_node = NUMA_NO_NODE;
30083008 }
30093009
3010+ /* Fallback to address based numa information if node lookup failed */
3011+ if (ndr_desc->numa_node == NUMA_NO_NODE) {
3012+ ndr_desc->numa_node = memory_add_physaddr_to_nid(spa->address);
3013+ dev_info(acpi_desc->dev, "changing numa node from %d to %d for nfit region [%pa-%pa]",
3014+ NUMA_NO_NODE, ndr_desc->numa_node, &res.start, &res.end);
3015+ }
3016+ if (ndr_desc->target_node == NUMA_NO_NODE) {
3017+ ndr_desc->target_node = phys_to_target_node(spa->address);
3018+ dev_info(acpi_desc->dev, "changing target node from %d to %d for nfit region [%pa-%pa]",
3019+ NUMA_NO_NODE, ndr_desc->numa_node, &res.start, &res.end);
3020+ }
3021+
30103022 /*
30113023 * Persistence domain bits are hierarchical, if
30123024 * ACPI_NFIT_CAPABILITY_CACHE_FLUSH is set then
drivers/base/core.c+63−27
@@ -95,12 +95,29 @@ int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup) · 94 unmodified lines
9595
9696 list_add(&link->s_hook, &sup->consumers);
9797 list_add(&link->c_hook, &con->suppliers);
98+ pr_debug("%pfwP Linked as a fwnode consumer to %pfwP\n",
99+ con, sup);
98100 out:
99101 mutex_unlock(&fwnode_link_lock);
100102
101103 return ret;
102104 }
103105
106+/**
107+ * __fwnode_link_del - Delete a link between two fwnode_handles.
108+ * @link: the fwnode_link to be deleted
109+ *
110+ * The fwnode_link_lock needs to be held when this function is called.
111+ */
112+static void __fwnode_link_del(struct fwnode_link *link)
113+{
114+ pr_debug("%pfwP Dropping the fwnode link to %pfwP\n",
115+ link->consumer, link->supplier);
116+ list_del(&link->s_hook);
117+ list_del(&link->c_hook);
118+ kfree(link);
119+}
120+
104121 /**
105122 * fwnode_links_purge_suppliers - Delete all supplier links of fwnode_handle.
106123 * @fwnode: fwnode whose supplier links need to be deleted
@@ -112,11 +129,8 @@ static void fwnode_links_purge_suppliers(struct fwnode_handle *fwnode) · 5 unmodified lines
112129 struct fwnode_link *link, *tmp;
113130
114131 mutex_lock(&fwnode_link_lock);
115− list_for_each_entry_safe(link, tmp, &fwnode->suppliers, c_hook) {
116− list_del(&link->s_hook);
117− list_del(&link->c_hook);
118− kfree(link);
119− }
132+ list_for_each_entry_safe(link, tmp, &fwnode->suppliers, c_hook)
133+ __fwnode_link_del(link);
120134 mutex_unlock(&fwnode_link_lock);
121135 }
122136
@@ -131,11 +145,8 @@ static void fwnode_links_purge_consumers(struct fwnode_handle *fwnode) · 8 unmodified lines
131145 struct fwnode_link *link, *tmp;
132146
133147 mutex_lock(&fwnode_link_lock);
134− list_for_each_entry_safe(link, tmp, &fwnode->consumers, s_hook) {
135− list_del(&link->s_hook);
136− list_del(&link->c_hook);
137− kfree(link);
138− }
148+ list_for_each_entry_safe(link, tmp, &fwnode->consumers, s_hook)
149+ __fwnode_link_del(link);
139150 mutex_unlock(&fwnode_link_lock);
140151 }
141152
@@ -975,6 +986,7 @@ int device_links_check_suppliers(struct device *dev) · 833 unmodified lines
975986 {
976987 struct device_link *link;
977988 int ret = 0;
989+ struct fwnode_handle *sup_fw;
978990
979991 /*
980992 * Device waiting for supplier to become available is not allowed to
@@ -983,10 +995,11 @@ int device_links_check_suppliers(struct device *dev) · 2 unmodified lines
983995 mutex_lock(&fwnode_link_lock);
984996 if (dev->fwnode && !list_empty(&dev->fwnode->suppliers) &&
985997 !fw_devlink_is_permissive()) {
986− dev_dbg(dev, "probe deferral - wait for supplier %pfwP\n",
987− list_first_entry(&dev->fwnode->suppliers,
988− struct fwnode_link,
989− c_hook)->supplier);
998+ sup_fw = list_first_entry(&dev->fwnode->suppliers,
999+ struct fwnode_link,
1000+ c_hook)->supplier;
1001+ dev_err_probe(dev, -EPROBE_DEFER, "wait for supplier %pfwP\n",
1002+ sup_fw);
9901003 mutex_unlock(&fwnode_link_lock);
9911004 return -EPROBE_DEFER;
9921005 }
@@ -1001,8 +1014,9 @@ int device_links_check_suppliers(struct device *dev) · 8 unmodified lines
10011014 if (link->status != DL_STATE_AVAILABLE &&
10021015 !(link->flags & DL_FLAG_SYNC_STATE_ONLY)) {
10031016 device_links_missing_supplier(dev);
1004− dev_dbg(dev, "probe deferral - supplier %s not ready\n",
1005− dev_name(link->supplier));
1017+ dev_err_probe(dev, -EPROBE_DEFER,
1018+ "supplier %s not ready\n",
1019+ dev_name(link->supplier));
10061020 ret = -EPROBE_DEFER;
10071021 break;
10081022 }
@@ -1722,6 +1736,25 @@ static int fw_devlink_create_devlink(struct device *con, · 713 unmodified lines
17221736 struct device *sup_dev;
17231737 int ret = 0;
17241738
1739+ /*
1740+ * In some cases, a device P might also be a supplier to its child node
1741+ * C. However, this would defer the probe of C until the probe of P
1742+ * completes successfully. This is perfectly fine in the device driver
1743+ * model. device_add() doesn't guarantee probe completion of the device
1744+ * by the time it returns.
1745+ *
1746+ * However, there are a few drivers that assume C will finish probing
1747+ * as soon as it's added and before P finishes probing. So, we provide
1748+ * a flag to let fw_devlink know not to delay the probe of C until the
1749+ * probe of P completes successfully.
1750+ *
1751+ * When such a flag is set, we can't create device links where P is the
1752+ * supplier of C as that would delay the probe of C.
1753+ */
1754+ if (sup_handle->flags & FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD &&
1755+ fwnode_is_ancestor_of(sup_handle, con->fwnode))
1756+ return -EINVAL;
1757+
17251758 sup_dev = get_dev_from_fwnode(sup_handle);
17261759 if (sup_dev) {
17271760 /*
@@ -1772,14 +1805,21 @@ static int fw_devlink_create_devlink(struct device *con, · 44 unmodified lines
17721805 * be broken by applying logic. Check for these types of cycles and
17731806 * break them so that devices in the cycle probe properly.
17741807 *
1775− * If the supplier's parent is dependent on the consumer, then
1776− * the consumer-supplier dependency is a false dependency. So,
1777− * treat it as an invalid link.
1808+ * If the supplier's parent is dependent on the consumer, then the
1809+ * consumer and supplier have a cyclic dependency. Since fw_devlink
1810+ * can't tell which of the inferred dependencies are incorrect, don't
1811+ * enforce probe ordering between any of the devices in this cyclic
1812+ * dependency. Do this by relaxing all the fw_devlink device links in
1813+ * this cycle and by treating the fwnode link between the consumer and
1814+ * the supplier as an invalid dependency.
17781815 */
17791816 sup_dev = fwnode_get_next_parent_dev(sup_handle);
17801817 if (sup_dev && device_is_dependent(con, sup_dev)) {
1781− dev_dbg(con, "Not linking to %pfwP - False link\n",
1782− sup_handle);
1818+ dev_info(con, "Fixing up cyclic dependency with %pfwP (%s)\n",
1819+ sup_handle, dev_name(sup_dev));
1820+ device_links_write_lock();
1821+ fw_devlink_relax_cycle(con, sup_dev);
1822+ device_links_write_unlock();
17831823 ret = -EINVAL;
17841824 } else {
17851825 /*
@@ -1858,9 +1898,7 @@ static void __fw_devlink_link_to_consumers(struct device *dev) · 72 unmodified lines
18581898 if (!own_link || ret == -EAGAIN)
18591899 continue;
18601900
1861− list_del(&link->s_hook);
1862− list_del(&link->c_hook);
1863− kfree(link);
1901+ __fwnode_link_del(link);
18641902 }
18651903 }
18661904
@@ -1912,9 +1950,7 @@ static void __fw_devlink_link_to_suppliers(struct device *dev, · 45 unmodified lines
19121950 if (!own_link || ret == -EAGAIN)
19131951 continue;
19141952
1915− list_del(&link->s_hook);
1916− list_del(&link->c_hook);
1917− kfree(link);
1953+ __fwnode_link_del(link);
19181954
19191955 /* If no device link was created, nothing more to do. */
19201956 if (ret)
drivers/block/nbd.c+17−12
@@ -97,13 +97,18 @@ struct nbd_config { · 96 unmodified lines
9797
9898 atomic_t recv_threads;
9999 wait_queue_head_t recv_wq;
100− loff_t blksize;
100+ unsigned int blksize_bits;
101101 loff_t bytesize;
102102 #if IS_ENABLED(CONFIG_DEBUG_FS)
103103 struct dentry *dbg_dir;
104104 #endif
105105 };
106106
107+static inline unsigned int nbd_blksize(struct nbd_config *config)
108+{
109+ return 1u << config->blksize_bits;
110+}
111+
107112 struct nbd_device {
108113 struct blk_mq_tag_set tag_set;
109114
@@ -146,7 +151,7 @@ static struct dentry *nbd_dbg_dir; · 36 unmodified lines
146151
147152 #define NBD_MAGIC 0x68797548
148153
149−#define NBD_DEF_BLKSIZE 1024
154+#define NBD_DEF_BLKSIZE_BITS 10
150155
151156 static unsigned int nbds_max = 16;
152157 static int max_part = 16;
@@ -317,12 +322,12 @@ static int nbd_set_size(struct nbd_device *nbd, loff_t bytesize, · 164 unmodified lines
317322 loff_t blksize)
318323 {
319324 if (!blksize)
320− blksize = NBD_DEF_BLKSIZE;
325+ blksize = 1u << NBD_DEF_BLKSIZE_BITS;
321326 if (blksize < 512 || blksize > PAGE_SIZE || !is_power_of_2(blksize))
322327 return -EINVAL;
323328
324329 nbd->config->bytesize = bytesize;
325− nbd->config->blksize = blksize;
330+ nbd->config->blksize_bits = __ffs(blksize);
326331
327332 if (!nbd->task_recv)
328333 return 0;
@@ -1337,7 +1342,7 @@ static int nbd_start_device(struct nbd_device *nbd) · 1008 unmodified lines
13371342 args->index = i;
13381343 queue_work(nbd->recv_workq, &args->work);
13391344 }
1340− return nbd_set_size(nbd, config->bytesize, config->blksize);
1345+ return nbd_set_size(nbd, config->bytesize, nbd_blksize(config));
13411346 }
13421347
13431348 static int nbd_start_device_ioctl(struct nbd_device *nbd, struct block_device *bdev)
@@ -1406,11 +1411,11 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, · 62 unmodified lines
14061411 case NBD_SET_BLKSIZE:
14071412 return nbd_set_size(nbd, config->bytesize, arg);
14081413 case NBD_SET_SIZE:
1409− return nbd_set_size(nbd, arg, config->blksize);
1414+ return nbd_set_size(nbd, arg, nbd_blksize(config));
14101415 case NBD_SET_SIZE_BLOCKS:
1411− if (check_mul_overflow((loff_t)arg, config->blksize, &bytesize))
1416+ if (check_shl_overflow(arg, config->blksize_bits, &bytesize))
14121417 return -EINVAL;
1413− return nbd_set_size(nbd, bytesize, config->blksize);
1418+ return nbd_set_size(nbd, bytesize, nbd_blksize(config));
14141419 case NBD_SET_TIMEOUT:
14151420 nbd_set_cmd_timeout(nbd, arg);
14161421 return 0;
@@ -1476,7 +1481,7 @@ static struct nbd_config *nbd_alloc_config(void) · 59 unmodified lines
14761481 atomic_set(&config->recv_threads, 0);
14771482 init_waitqueue_head(&config->recv_wq);
14781483 init_waitqueue_head(&config->conn_wait);
1479− config->blksize = NBD_DEF_BLKSIZE;
1484+ config->blksize_bits = NBD_DEF_BLKSIZE_BITS;
14801485 atomic_set(&config->live_connections, 0);
14811486 try_module_get(THIS_MODULE);
14821487 return config;
@@ -1604,7 +1609,7 @@ static int nbd_dev_dbg_init(struct nbd_device *nbd) · 121 unmodified lines
16041609 debugfs_create_file("tasks", 0444, dir, nbd, &nbd_dbg_tasks_fops);
16051610 debugfs_create_u64("size_bytes", 0444, dir, &config->bytesize);
16061611 debugfs_create_u32("timeout", 0444, dir, &nbd->tag_set.timeout);
1607− debugfs_create_u64("blocksize", 0444, dir, &config->blksize);
1612+ debugfs_create_u32("blocksize_bits", 0444, dir, &config->blksize_bits);
16081613 debugfs_create_file("flags", 0444, dir, nbd, &nbd_dbg_flags_fops);
16091614
16101615 return 0;
@@ -1826,7 +1831,7 @@ nbd_device_policy[NBD_DEVICE_ATTR_MAX + 1] = { · 215 unmodified lines
18261831 static int nbd_genl_size_set(struct genl_info *info, struct nbd_device *nbd)
18271832 {
18281833 struct nbd_config *config = nbd->config;
1829− u64 bsize = config->blksize;
1834+ u64 bsize = nbd_blksize(config);
18301835 u64 bytes = config->bytesize;
18311836
18321837 if (info->attrs[NBD_ATTR_SIZE_BYTES])
@@ -1835,7 +1840,7 @@ static int nbd_genl_size_set(struct genl_info *info, struct nbd_device *nbd) · 2 unmodified lines
18351840 if (info->attrs[NBD_ATTR_BLOCK_SIZE_BYTES])
18361841 bsize = nla_get_u64(info->attrs[NBD_ATTR_BLOCK_SIZE_BYTES]);
18371842
1838− if (bytes != config->bytesize || bsize != config->blksize)
1843+ if (bytes != config->bytesize || bsize != nbd_blksize(config))
18391844 return nbd_set_size(nbd, bytes, bsize);
18401845 return 0;
18411846 }
drivers/bus/ti-sysc.c+4−0
@@ -1464,6 +1464,9 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { · 1463 unmodified lines
14641464 /* Quirks that need to be set based on detected module */
14651465 SYSC_QUIRK("aess", 0, 0, 0x10, -ENODEV, 0x40000000, 0xffffffff,
14661466 SYSC_MODULE_QUIRK_AESS),
1467+ /* Errata i893 handling for dra7 dcan1 and 2 */
1468+ SYSC_QUIRK("dcan", 0x4ae3c000, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff,
1469+ SYSC_QUIRK_CLKDM_NOAUTO),
14671470 SYSC_QUIRK("dcan", 0x48480000, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff,
14681471 SYSC_QUIRK_CLKDM_NOAUTO),
14691472 SYSC_QUIRK("dss", 0x4832a000, 0, 0x10, 0x14, 0x00000020, 0xffffffff,
@@ -2954,6 +2957,7 @@ static int sysc_init_soc(struct sysc *ddata) · 1484 unmodified lines
29542957 break;
29552958 case SOC_AM3:
29562959 sysc_add_disabled(0x48310000); /* rng */
2960+ break;
29572961 default:
29582962 break;
29592963 }
drivers/firmware/Kconfig+1−1
@@ -204,7 +204,7 @@ config INTEL_STRATIX10_RSU · 203 unmodified lines
204204
205205 config QCOM_SCM
206206 tristate "Qcom SCM driver"
207− depends on ARM || ARM64
207+ depends on ARCH_QCOM || COMPILE_TEST
208208 depends on HAVE_ARM_SMCCC
209209 select RESET_CONTROLLER
210210
drivers/firmware/arm_scmi/Kconfig+1−1
@@ -68,7 +68,7 @@ config ARM_SCMI_TRANSPORT_SMC · 67 unmodified lines
6868
6969 config ARM_SCMI_TRANSPORT_VIRTIO
7070 bool "SCMI transport based on VirtIO"
71− depends on VIRTIO
71+ depends on VIRTIO=y || VIRTIO=ARM_SCMI_PROTOCOL
7272 select ARM_SCMI_HAVE_TRANSPORT
7373 select ARM_SCMI_HAVE_MSG
7474 help
drivers/firmware/arm_scmi/virtio.c+31−13
@@ -110,18 +110,16 @@ static void scmi_finalize_message(struct scmi_vio_channel *vioch, · 109 unmodified lines
110110 if (vioch->is_rx) {
111111 scmi_vio_feed_vq_rx(vioch, msg);
112112 } else {
113− unsigned long flags;
114−
115− spin_lock_irqsave(&vioch->lock, flags);
113+ /* Here IRQs are assumed to be already disabled by the caller */
114+ spin_lock(&vioch->lock);
116115 list_add(&msg->list, &vioch->free_list);
117− spin_unlock_irqrestore(&vioch->lock, flags);
116+ spin_unlock(&vioch->lock);
118117 }
119118 }
120119
121120 static void scmi_vio_complete_cb(struct virtqueue *vqueue)
122121 {
123122 unsigned long ready_flags;
124− unsigned long flags;
125123 unsigned int length;
126124 struct scmi_vio_channel *vioch;
127125 struct scmi_vio_msg *msg;
@@ -140,7 +138,8 @@ static void scmi_vio_complete_cb(struct virtqueue *vqueue) · 12 unmodified lines
140138 goto unlock_ready_out;
141139 }
142140
143− spin_lock_irqsave(&vioch->lock, flags);
141+ /* IRQs already disabled here no need to irqsave */
142+ spin_lock(&vioch->lock);
144143 if (cb_enabled) {
145144 virtqueue_disable_cb(vqueue);
146145 cb_enabled = false;
@@ -151,7 +150,7 @@ static void scmi_vio_complete_cb(struct virtqueue *vqueue) · 4 unmodified lines
151150 goto unlock_out;
152151 cb_enabled = true;
153152 }
154− spin_unlock_irqrestore(&vioch->lock, flags);
153+ spin_unlock(&vioch->lock);
155154
156155 if (msg) {
157156 msg->rx_len = length;
@@ -161,11 +160,18 @@ static void scmi_vio_complete_cb(struct virtqueue *vqueue) · 3 unmodified lines
161160 scmi_finalize_message(vioch, msg);
162161 }
163162
163+ /*
164+ * Release ready_lock and re-enable IRQs between loop iterations
165+ * to allow virtio_chan_free() to possibly kick in and set the
166+ * flag vioch->ready to false even in between processing of
167+ * messages, so as to force outstanding messages to be ignored
168+ * when system is shutting down.
169+ */
164170 spin_unlock_irqrestore(&vioch->ready_lock, ready_flags);
165171 }
166172
167173 unlock_out:
168− spin_unlock_irqrestore(&vioch->lock, flags);
174+ spin_unlock(&vioch->lock);
169175 unlock_ready_out:
170176 spin_unlock_irqrestore(&vioch->ready_lock, ready_flags);
171177 }
@@ -384,8 +390,11 @@ static int scmi_vio_probe(struct virtio_device *vdev) · 212 unmodified lines
384390 struct virtqueue *vqs[VIRTIO_SCMI_VQ_MAX_CNT];
385391
386392 /* Only one SCMI VirtiO device allowed */
387− if (scmi_vdev)
388− return -EINVAL;
393+ if (scmi_vdev) {
394+ dev_err(dev,
395+ "One SCMI Virtio device was already initialized: only one allowed.\n");
396+ return -EBUSY;
397+ }
389398
390399 have_vq_rx = scmi_vio_have_vq_rx(vdev);
391400 vq_cnt = have_vq_rx ? VIRTIO_SCMI_VQ_MAX_CNT : 1;
@@ -428,16 +437,25 @@ static int scmi_vio_probe(struct virtio_device *vdev) · 36 unmodified lines
428437 }
429438
430439 vdev->priv = channels;
431− scmi_vdev = vdev;
440+ /* Ensure initialized scmi_vdev is visible */
441+ smp_store_mb(scmi_vdev, vdev);
432442
433443 return 0;
434444 }
435445
436446 static void scmi_vio_remove(struct virtio_device *vdev)
437447 {
448+ /*
449+ * Once we get here, virtio_chan_free() will have already been called by
450+ * the SCMI core for any existing channel and, as a consequence, all the
451+ * virtio channels will have been already marked NOT ready, causing any
452+ * outstanding message on any vqueue to be ignored by complete_cb: now
453+ * we can just stop processing buffers and destroy the vqueues.
454+ */
438455 vdev->config->reset(vdev);
439456 vdev->config->del_vqs(vdev);
440− scmi_vdev = NULL;
457+ /* Ensure scmi_vdev is visible as NULL */
458+ smp_store_mb(scmi_vdev, NULL);
441459 }
442460
443461 static int scmi_vio_validate(struct virtio_device *vdev)
@@ -476,7 +494,7 @@ static int __init virtio_scmi_init(void) · 32 unmodified lines
476494 return register_virtio_driver(&virtio_scmi_driver);
477495 }
478496
479−static void __exit virtio_scmi_exit(void)
497+static void virtio_scmi_exit(void)
480498 {
481499 unregister_virtio_driver(&virtio_scmi_driver);
482500 }
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c+31−0
@@ -837,6 +837,28 @@ static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb) · 836 unmodified lines
837837 return 0;
838838 }
839839
840+/* Mirrors the is_displayable check in radeonsi's gfx6_compute_surface */
841+static int check_tiling_flags_gfx6(struct amdgpu_framebuffer *afb)
842+{
843+ u64 micro_tile_mode;
844+
845+ /* Zero swizzle mode means linear */
846+ if (AMDGPU_TILING_GET(afb->tiling_flags, SWIZZLE_MODE) == 0)
847+ return 0;
848+
849+ micro_tile_mode = AMDGPU_TILING_GET(afb->tiling_flags, MICRO_TILE_MODE);
850+ switch (micro_tile_mode) {
851+ case 0: /* DISPLAY */
852+ case 3: /* RENDER */
853+ return 0;
854+ default:
855+ drm_dbg_kms(afb->base.dev,
856+ "Micro tile mode %llu not supported for scanout\n",
857+ micro_tile_mode);
858+ return -EINVAL;
859+ }
860+}
861+
840862 static void get_block_dimensions(unsigned int block_log2, unsigned int cpp,
841863 unsigned int *width, unsigned int *height)
842864 {
@@ -1103,6 +1125,7 @@ int amdgpu_display_framebuffer_init(struct drm_device *dev, · 260 unmodified lines
11031125 const struct drm_mode_fb_cmd2 *mode_cmd,
11041126 struct drm_gem_object *obj)
11051127 {
1128+ struct amdgpu_device *adev = drm_to_adev(dev);
11061129 int ret, i;
11071130
11081131 /*
@@ -1122,6 +1145,14 @@ int amdgpu_display_framebuffer_init(struct drm_device *dev, · 13 unmodified lines
11221145 if (ret)
11231146 return ret;
11241147
1148+ if (!dev->mode_config.allow_fb_modifiers) {
1149+ drm_WARN_ONCE(dev, adev->family >= AMDGPU_FAMILY_AI,
1150+ "GFX9+ requires FB check based on format modifier\n");
1151+ ret = check_tiling_flags_gfx6(rfb);
1152+ if (ret)
1153+ return ret;
1154+ }
1155+
11251156 if (dev->mode_config.allow_fb_modifiers &&
11261157 !(rfb->base.flags & DRM_MODE_FB_MODIFIERS)) {
11271158 ret = convert_tiling_flags_to_modifier(rfb);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c+1−1
@@ -3599,7 +3599,7 @@ static int gfx_v9_0_mqd_init(struct amdgpu_ring *ring) · 3598 unmodified lines
35993599
36003600 /* set static priority for a queue/ring */
36013601 gfx_v9_0_mqd_set_priority(ring, mqd);
3602− mqd->cp_hqd_quantum = RREG32(mmCP_HQD_QUANTUM);
3602+ mqd->cp_hqd_quantum = RREG32_SOC15(GC, 0, mmCP_HQD_QUANTUM);
36033603
36043604 /* map_queues packet doesn't need activate the queue,
36053605 * so only kiq need set this field.
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c+2−1
@@ -1098,6 +1098,8 @@ static int gmc_v10_0_hw_fini(void *handle) · 1097 unmodified lines
10981098 {
10991099 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
11001100
1101+ gmc_v10_0_gart_disable(adev);
1102+
11011103 if (amdgpu_sriov_vf(adev)) {
11021104 /* full access mode, so don't touch any GMC register */
11031105 DRM_DEBUG("For SRIOV client, shouldn't do anything.\n");
@@ -1106,7 +1108,6 @@ static int gmc_v10_0_hw_fini(void *handle) · 2 unmodified lines
11061108
11071109 amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);
11081110 amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);
1109− gmc_v10_0_gart_disable(adev);
11101111
11111112 return 0;
11121113 }
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c+2−1
@@ -1794,6 +1794,8 @@ static int gmc_v9_0_hw_fini(void *handle) · 1793 unmodified lines
17941794 {
17951795 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
17961796
1797+ gmc_v9_0_gart_disable(adev);
1798+
17971799 if (amdgpu_sriov_vf(adev)) {
17981800 /* full access mode, so don't touch any GMC register */
17991801 DRM_DEBUG("For SRIOV client, shouldn't do anything.\n");
@@ -1802,7 +1804,6 @@ static int gmc_v9_0_hw_fini(void *handle) · 2 unmodified lines
18021804
18031805 amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);
18041806 amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);
1805− gmc_v9_0_gart_disable(adev);
18061807
18071808 return 0;
18081809 }
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c+8−0
@@ -868,6 +868,12 @@ static int sdma_v5_2_start(struct amdgpu_device *adev) · 867 unmodified lines
868868 msleep(1000);
869869 }
870870
871+ /* TODO: check whether can submit a doorbell request to raise
872+ * a doorbell fence to exit gfxoff.
873+ */
874+ if (adev->in_s0ix)
875+ amdgpu_gfx_off_ctrl(adev, false);
876+
871877 sdma_v5_2_soft_reset(adev);
872878 /* unhalt the MEs */
873879 sdma_v5_2_enable(adev, true);
@@ -876,6 +882,8 @@ static int sdma_v5_2_start(struct amdgpu_device *adev) · 2 unmodified lines
876882
877883 /* start the gfx rings and rlc compute queues */
878884 r = sdma_v5_2_gfx_resume(adev);
885+ if (adev->in_s0ix)
886+ amdgpu_gfx_off_ctrl(adev, true);
879887 if (r)
880888 return r;
881889 r = sdma_v5_2_rlc_resume(adev);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+2−0
@@ -1115,6 +1115,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 1114 unmodified lines
11151115
11161116 init_data.asic_id.pci_revision_id = adev->pdev->revision;
11171117 init_data.asic_id.hw_internal_rev = adev->external_rev_id;
1118+ init_data.asic_id.chip_id = adev->pdev->device;
11181119
11191120 init_data.asic_id.vram_width = adev->gmc.vram_width;
11201121 /* TODO: initialize init_data.asic_id.vram_type here!!!! */
@@ -1719,6 +1720,7 @@ static int dm_late_init(void *handle) · 598 unmodified lines
17191720 linear_lut[i] = 0xFFFF * i / 15;
17201721
17211722 params.set = 0;
1723+ params.backlight_ramping_override = false;
17221724 params.backlight_ramping_start = 0xCCCC;
17231725 params.backlight_ramping_reduction = 0xCCCCCCCC;
17241726 params.backlight_lut_array_size = 16;
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c+7−8
@@ -1826,14 +1826,13 @@ bool perform_link_training_with_retries( · 1825 unmodified lines
18261826 if (panel_mode == DP_PANEL_MODE_EDP) {
18271827 struct cp_psp *cp_psp = &stream->ctx->cp_psp;
18281828
1829− if (cp_psp && cp_psp->funcs.enable_assr) {
1830− if (!cp_psp->funcs.enable_assr(cp_psp->handle, link)) {
1831− /* since eDP implies ASSR on, change panel
1832− * mode to disable ASSR
1833− */
1834− panel_mode = DP_PANEL_MODE_DEFAULT;
1835− }
1836− }
1829+ if (cp_psp && cp_psp->funcs.enable_assr)
1830+ /* ASSR is bound to fail with unsigned PSP
1831+ * verstage used during devlopment phase.
1832+ * Report and continue with eDP panel mode to
1833+ * perform eDP link training with right settings
1834+ */
1835+ cp_psp->funcs.enable_assr(cp_psp->handle, link);
18371836 }
18381837 #endif
18391838
drivers/gpu/drm/exynos/exynos5433_drm_decon.c+1−3
@@ -793,7 +793,6 @@ static int exynos5433_decon_probe(struct platform_device *pdev) · 792 unmodified lines
793793 {
794794 struct device *dev = &pdev->dev;
795795 struct decon_context *ctx;
796− struct resource *res;
797796 int ret;
798797 int i;
799798
@@ -818,8 +817,7 @@ static int exynos5433_decon_probe(struct platform_device *pdev) · 18 unmodified lines
818817 ctx->clks[i] = clk;
819818 }
820819
821− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
822− ctx->addr = devm_ioremap_resource(dev, res);
820+ ctx->addr = devm_platform_ioremap_resource(pdev, 0);
823821 if (IS_ERR(ctx->addr))
824822 return PTR_ERR(ctx->addr);
825823
drivers/gpu/drm/exynos/exynos_drm_dsi.c+1−3
@@ -1738,7 +1738,6 @@ static const struct component_ops exynos_dsi_component_ops = { · 1737 unmodified lines
17381738 static int exynos_dsi_probe(struct platform_device *pdev)
17391739 {
17401740 struct device *dev = &pdev->dev;
1741− struct resource *res;
17421741 struct exynos_dsi *dsi;
17431742 int ret, i;
17441743
@@ -1789,8 +1788,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) · 44 unmodified lines
17891788 }
17901789 }
17911790
1792− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1793− dsi->reg_base = devm_ioremap_resource(dev, res);
1791+ dsi->reg_base = devm_platform_ioremap_resource(pdev, 0);
17941792 if (IS_ERR(dsi->reg_base))
17951793 return PTR_ERR(dsi->reg_base);
17961794
drivers/gpu/drm/exynos/exynos_drm_fimc.c+1−4
@@ -85,7 +85,6 @@ struct fimc_scaler { · 84 unmodified lines
8585 /*
8686 * A structure of fimc context.
8787 *
88− * @regs_res: register resources.
8988 * @regs: memory mapped io registers.
9089 * @lock: locking of operations.
9190 * @clocks: fimc clocks.
@@ -103,7 +102,6 @@ struct fimc_context { · 11 unmodified lines
103102 struct exynos_drm_ipp_formats *formats;
104103 unsigned int num_formats;
105104
106− struct resource *regs_res;
107105 void __iomem *regs;
108106 spinlock_t lock;
109107 struct clk *clocks[FIMC_CLKS_MAX];
@@ -1327,8 +1325,7 @@ static int fimc_probe(struct platform_device *pdev) · 1217 unmodified lines
13271325 ctx->num_formats = num_formats;
13281326
13291327 /* resource memory */
1330− ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1331− ctx->regs = devm_ioremap_resource(dev, ctx->regs_res);
1328+ ctx->regs = devm_platform_ioremap_resource(pdev, 0);
13321329 if (IS_ERR(ctx->regs))
13331330 return PTR_ERR(ctx->regs);
13341331
drivers/gpu/drm/exynos/exynos_drm_fimd.c+1−3
@@ -1202,9 +1202,7 @@ static int fimd_probe(struct platform_device *pdev) · 1201 unmodified lines
12021202 return PTR_ERR(ctx->lcd_clk);
12031203 }
12041204
1205− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1206−
1207− ctx->regs = devm_ioremap_resource(dev, res);
1205+ ctx->regs = devm_platform_ioremap_resource(pdev, 0);
12081206 if (IS_ERR(ctx->regs))
12091207 return PTR_ERR(ctx->regs);
12101208
drivers/gpu/drm/exynos/exynos_drm_g2d.c+1−4
@@ -1449,7 +1449,6 @@ static const struct component_ops g2d_component_ops = { · 1448 unmodified lines
14491449 static int g2d_probe(struct platform_device *pdev)
14501450 {
14511451 struct device *dev = &pdev->dev;
1452− struct resource *res;
14531452 struct g2d_data *g2d;
14541453 int ret;
14551454
@@ -1491,9 +1490,7 @@ static int g2d_probe(struct platform_device *pdev) · 35 unmodified lines
14911490 clear_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags);
14921491 clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags);
14931492
1494− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1495−
1496− g2d->regs = devm_ioremap_resource(dev, res);
1493+ g2d->regs = devm_platform_ioremap_resource(pdev, 0);
14971494 if (IS_ERR(g2d->regs)) {
14981495 ret = PTR_ERR(g2d->regs);
14991496 goto err_put_clk;
drivers/gpu/drm/exynos/exynos_drm_gsc.c+1−5
@@ -86,7 +86,6 @@ struct gsc_scaler { · 85 unmodified lines
8686 /*
8787 * A structure of gsc context.
8888 *
89− * @regs_res: register resources.
9089 * @regs: memory mapped io registers.
9190 * @gsc_clk: gsc gate clock.
9291 * @sc: scaler infomations.
@@ -103,7 +102,6 @@ struct gsc_context { · 10 unmodified lines
103102 struct exynos_drm_ipp_formats *formats;
104103 unsigned int num_formats;
105104
106− struct resource *regs_res;
107105 void __iomem *regs;
108106 const char **clk_names;
109107 struct clk *clocks[GSC_MAX_CLOCKS];
@@ -1272,9 +1270,7 @@ static int gsc_probe(struct platform_device *pdev) · 1162 unmodified lines
12721270 }
12731271 }
12741272
1275− /* resource memory */
1276− ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1277− ctx->regs = devm_ioremap_resource(dev, ctx->regs_res);
1273+ ctx->regs = devm_platform_ioremap_resource(pdev, 0);
12781274 if (IS_ERR(ctx->regs))
12791275 return PTR_ERR(ctx->regs);
12801276
drivers/gpu/drm/exynos/exynos_drm_rotator.c+1−3
@@ -278,7 +278,6 @@ static const struct component_ops rotator_component_ops = { · 277 unmodified lines
278278 static int rotator_probe(struct platform_device *pdev)
279279 {
280280 struct device *dev = &pdev->dev;
281− struct resource *regs_res;
282281 struct rot_context *rot;
283282 const struct rot_variant *variant;
284283 int irq;
@@ -292,8 +291,7 @@ static int rotator_probe(struct platform_device *pdev) · 7 unmodified lines
292291 rot->formats = variant->formats;
293292 rot->num_formats = variant->num_formats;
294293 rot->dev = dev;
295− regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
296− rot->regs = devm_ioremap_resource(dev, regs_res);
294+ rot->regs = devm_platform_ioremap_resource(pdev, 0);
297295 if (IS_ERR(rot->regs))
298296 return PTR_ERR(rot->regs);
299297
drivers/gpu/drm/exynos/exynos_drm_scaler.c+1−3
@@ -485,7 +485,6 @@ static const struct component_ops scaler_component_ops = { · 484 unmodified lines
485485 static int scaler_probe(struct platform_device *pdev)
486486 {
487487 struct device *dev = &pdev->dev;
488− struct resource *regs_res;
489488 struct scaler_context *scaler;
490489 int irq;
491490 int ret, i;
@@ -498,8 +497,7 @@ static int scaler_probe(struct platform_device *pdev) · 6 unmodified lines
498497 (struct scaler_data *)of_device_get_match_data(dev);
499498
500499 scaler->dev = dev;
501− regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
502− scaler->regs = devm_ioremap_resource(dev, regs_res);
500+ scaler->regs = devm_platform_ioremap_resource(pdev, 0);
503501 if (IS_ERR(scaler->regs))
504502 return PTR_ERR(scaler->regs);
505503
drivers/gpu/drm/exynos/exynos_hdmi.c+1−3
@@ -1957,7 +1957,6 @@ static int hdmi_probe(struct platform_device *pdev) · 1956 unmodified lines
19571957 struct hdmi_audio_infoframe *audio_infoframe;
19581958 struct device *dev = &pdev->dev;
19591959 struct hdmi_context *hdata;
1960− struct resource *res;
19611960 int ret;
19621961
19631962 hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL);
@@ -1979,8 +1978,7 @@ static int hdmi_probe(struct platform_device *pdev) · 15 unmodified lines
19791978 return ret;
19801979 }
19811980
1982− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1983− hdata->regs = devm_ioremap_resource(dev, res);
1981+ hdata->regs = devm_platform_ioremap_resource(pdev, 0);
19841982 if (IS_ERR(hdata->regs)) {
19851983 ret = PTR_ERR(hdata->regs);
19861984 return ret;
drivers/gpu/drm/i915/gt/intel_context.c+3−2
@@ -362,8 +362,9 @@ static int __intel_context_active(struct i915_active *active) · 361 unmodified lines
362362 return 0;
363363 }
364364
365−static int sw_fence_dummy_notify(struct i915_sw_fence *sf,
366− enum i915_sw_fence_notify state)
365+static int __i915_sw_fence_call
366+sw_fence_dummy_notify(struct i915_sw_fence *sf,
367+ enum i915_sw_fence_notify state)
367368 {
368369 return NOTIFY_DONE;
369370 }
drivers/gpu/drm/i915/gt/intel_rps.c+0−2
@@ -882,8 +882,6 @@ void intel_rps_park(struct intel_rps *rps) · 881 unmodified lines
882882 if (!intel_rps_is_enabled(rps))
883883 return;
884884
885− GEM_BUG_ON(atomic_read(&rps->num_waiters));
886−
887885 if (!intel_rps_clear_active(rps))
888886 return;
889887
drivers/gpu/drm/i915/gt/uc/abi/guc_communication_ctb_abi.h+5−5
@@ -102,11 +102,11 @@ static_assert(sizeof(struct guc_ct_buffer_desc) == 64); · 101 unmodified lines
102102 * | +-------+--------------------------------------------------------------+
103103 * | | 7:0 | NUM_DWORDS = length (in dwords) of the embedded HXG message |
104104 * +---+-------+--------------------------------------------------------------+
105− * | 1 | 31:0 | +--------------------------------------------------------+ |
106− * +---+-------+ | | |
107− * |...| | | Embedded `HXG Message`_ | |
108− * +---+-------+ | | |
109− * | n | 31:0 | +--------------------------------------------------------+ |
105+ * | 1 | 31:0 | |
106+ * +---+-------+ |
107+ * |...| | [Embedded `HXG Message`_] |
108+ * +---+-------+ |
109+ * | n | 31:0 | |
110110 * +---+-------+--------------------------------------------------------------+
111111 */
112112
drivers/gpu/drm/i915/gt/uc/abi/guc_communication_mmio_abi.h+5−5
@@ -38,11 +38,11 @@ · 37 unmodified lines
3838 * +---+-------+--------------------------------------------------------------+
3939 * | | Bits | Description |
4040 * +===+=======+==============================================================+
41− * | 0 | 31:0 | +--------------------------------------------------------+ |
42− * +---+-------+ | | |
43− * |...| | | Embedded `HXG Message`_ | |
44− * +---+-------+ | | |
45− * | n | 31:0 | +--------------------------------------------------------+ |
41+ * | 0 | 31:0 | |
42+ * +---+-------+ |
43+ * |...| | [Embedded `HXG Message`_] |
44+ * +---+-------+ |
45+ * | n | 31:0 | |
4646 * +---+-------+--------------------------------------------------------------+
4747 */
4848
drivers/gpu/drm/i915/gvt/scheduler.c+2−2
@@ -576,7 +576,7 @@ retry: · 575 unmodified lines
576576
577577 /* No one is going to touch shadow bb from now on. */
578578 i915_gem_object_flush_map(bb->obj);
579− i915_gem_object_unlock(bb->obj);
579+ i915_gem_ww_ctx_fini(&ww);
580580 }
581581 }
582582 return 0;
@@ -630,7 +630,7 @@ retry: · 47 unmodified lines
630630 return ret;
631631 }
632632
633− i915_gem_object_unlock(wa_ctx->indirect_ctx.obj);
633+ i915_gem_ww_ctx_fini(&ww);
634634
635635 /* FIXME: we are not tracking our pinned VMA leaving it
636636 * up to the core to fix up the stray pin_count upon
drivers/gpu/drm/i915/i915_request.c+2−9
@@ -829,8 +829,6 @@ static void __i915_request_ctor(void *arg) · 828 unmodified lines
829829 i915_sw_fence_init(&rq->submit, submit_notify);
830830 i915_sw_fence_init(&rq->semaphore, semaphore_notify);
831831
832− dma_fence_init(&rq->fence, &i915_fence_ops, &rq->lock, 0, 0);
833−
834832 rq->capture_list = NULL;
835833
836834 init_llist_head(&rq->execute_cb);
@@ -905,17 +903,12 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) · 68 unmodified lines
905903 rq->ring = ce->ring;
906904 rq->execution_mask = ce->engine->mask;
907905
908− kref_init(&rq->fence.refcount);
909− rq->fence.flags = 0;
910− rq->fence.error = 0;
911− INIT_LIST_HEAD(&rq->fence.cb_list);
912−
913906 ret = intel_timeline_get_seqno(tl, rq, &seqno);
914907 if (ret)
915908 goto err_free;
916909
917− rq->fence.context = tl->fence_context;
918− rq->fence.seqno = seqno;
910+ dma_fence_init(&rq->fence, &i915_fence_ops, &rq->lock,
911+ tl->fence_context, seqno);
919912
920913 RCU_INIT_POINTER(rq->timeline, tl);
921914 rq->hwsp_seqno = tl->hwsp_seqno;
drivers/gpu/drm/tegra/dc.c+0−3
@@ -1845,7 +1845,6 @@ tegra_crtc_update_memory_bandwidth(struct drm_crtc *crtc, · 1844 unmodified lines
18451845 bool prepare_bandwidth_transition)
18461846 {
18471847 const struct tegra_plane_state *old_tegra_state, *new_tegra_state;
1848− const struct tegra_dc_state *old_dc_state, *new_dc_state;
18491848 u32 i, new_avg_bw, old_avg_bw, new_peak_bw, old_peak_bw;
18501849 const struct drm_plane_state *old_plane_state;
18511850 const struct drm_crtc_state *old_crtc_state;
@@ -1858,8 +1857,6 @@ tegra_crtc_update_memory_bandwidth(struct drm_crtc *crtc, · 6 unmodified lines
18581857 return;
18591858
18601859 old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc);
1861− old_dc_state = to_const_dc_state(old_crtc_state);
1862− new_dc_state = to_const_dc_state(crtc->state);
18631860
18641861 if (!crtc->state->active) {
18651862 if (!old_crtc_state->active)
drivers/gpu/drm/tegra/dc.h+0−6
@@ -35,12 +35,6 @@ static inline struct tegra_dc_state *to_dc_state(struct drm_crtc_state *state) · 34 unmodified lines
3535 return NULL;
3636 }
3737
38−static inline const struct tegra_dc_state *
39−to_const_dc_state(const struct drm_crtc_state *state)
40−{
41− return to_dc_state((struct drm_crtc_state *)state);
42−}
43−
4438 struct tegra_dc_stats {
4539 unsigned long frames;
4640 unsigned long vblank;
drivers/gpu/drm/tegra/uapi.c+1−1
@@ -222,7 +222,7 @@ int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f · 221 unmodified lines
222222 mapping->iova = sg_dma_address(mapping->sgt->sgl);
223223 }
224224
225− mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->size;
225+ mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->gem.size;
226226
227227 err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX),
228228 GFP_KERNEL);
drivers/gpu/host1x/fence.c+4−2
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 #include "intr.h"
1616 #include "syncpt.h"
1717
18−DEFINE_SPINLOCK(lock);
18+static DEFINE_SPINLOCK(lock);
1919
2020 struct host1x_syncpt_fence {
2121 struct dma_fence base;
@@ -152,8 +152,10 @@ struct dma_fence *host1x_fence_create(struct host1x_syncpt *sp, u32 threshold) · 130 unmodified lines
152152 return ERR_PTR(-ENOMEM);
153153
154154 fence->waiter = kzalloc(sizeof(*fence->waiter), GFP_KERNEL);
155− if (!fence->waiter)
155+ if (!fence->waiter) {
156+ kfree(fence);
156157 return ERR_PTR(-ENOMEM);
158+ }
157159
158160 fence->sp = sp;
159161 fence->threshold = threshold;
drivers/hwmon/k10temp.c+0−6
@@ -362,12 +362,6 @@ static const struct hwmon_channel_info *k10temp_info[] = { · 361 unmodified lines
362362 HWMON_T_INPUT | HWMON_T_LABEL,
363363 HWMON_T_INPUT | HWMON_T_LABEL,
364364 HWMON_T_INPUT | HWMON_T_LABEL),
365− HWMON_CHANNEL_INFO(in,
366− HWMON_I_INPUT | HWMON_I_LABEL,
367− HWMON_I_INPUT | HWMON_I_LABEL),
368− HWMON_CHANNEL_INFO(curr,
369− HWMON_C_INPUT | HWMON_C_LABEL,
370− HWMON_C_INPUT | HWMON_C_LABEL),
371365 NULL
372366 };
373367
drivers/hwmon/ltc2947-core.c+6−2
@@ -989,8 +989,12 @@ static int ltc2947_setup(struct ltc2947_data *st) · 988 unmodified lines
989989 return ret;
990990
991991 /* check external clock presence */
992− extclk = devm_clk_get(st->dev, NULL);
993− if (!IS_ERR(extclk)) {
992+ extclk = devm_clk_get_optional(st->dev, NULL);
993+ if (IS_ERR(extclk))
994+ return dev_err_probe(st->dev, PTR_ERR(extclk),
995+ "Failed to get external clock\n");
996+
997+ if (extclk) {
994998 unsigned long rate_hz;
995999 u8 pre = 0, div, tbctl;
9961000 u64 aux;
drivers/hwmon/mlxreg-fan.c+9−3
@@ -315,8 +315,8 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, · 314 unmodified lines
315315 {
316316 struct mlxreg_fan *fan = cdev->devdata;
317317 unsigned long cur_state;
318+ int i, config = 0;
318319 u32 regval;
319− int i;
320320 int err;
321321
322322 /*
@@ -329,6 +329,12 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, · 6 unmodified lines
329329 * overwritten.
330330 */
331331 if (state >= MLXREG_FAN_SPEED_MIN && state <= MLXREG_FAN_SPEED_MAX) {
332+ /*
333+ * This is configuration change, which is only supported through sysfs.
334+ * For configuration non-zero value is to be returned to avoid thermal
335+ * statistics update.
336+ */
337+ config = 1;
332338 state -= MLXREG_FAN_MAX_STATE;
333339 for (i = 0; i < state; i++)
334340 fan->cooling_levels[i] = state;
@@ -343,7 +349,7 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, · 8 unmodified lines
343349
344350 cur_state = MLXREG_FAN_PWM_DUTY2STATE(regval);
345351 if (state < cur_state)
346− return 0;
352+ return config;
347353
348354 state = cur_state;
349355 }
@@ -359,7 +365,7 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, · 9 unmodified lines
359365 dev_err(fan->dev, "Failed to write PWM duty\n");
360366 return err;
361367 }
362− return 0;
368+ return config;
363369 }
364370
365371 static const struct thermal_cooling_device_ops mlxreg_fan_cooling_ops = {
drivers/hwmon/occ/common.c+5−12
@@ -340,18 +340,11 @@ static ssize_t occ_show_temp_10(struct device *dev, · 339 unmodified lines
340340 if (val == OCC_TEMP_SENSOR_FAULT)
341341 return -EREMOTEIO;
342342
343− /*
344− * VRM doesn't return temperature, only alarm bit. This
345− * attribute maps to tempX_alarm instead of tempX_input for
346− * VRM
347− */
348− if (temp->fru_type != OCC_FRU_TYPE_VRM) {
349− /* sensor not ready */
350− if (val == 0)
351− return -EAGAIN;
343+ /* sensor not ready */
344+ if (val == 0)
345+ return -EAGAIN;
352346
353− val *= 1000;
354− }
347+ val *= 1000;
355348 break;
356349 case 2:
357350 val = temp->fru_type;
@@ -886,7 +879,7 @@ static int occ_setup_sensor_attrs(struct occ *occ) · 528 unmodified lines
886879 0, i);
887880 attr++;
888881
889− if (sensors->temp.version > 1 &&
882+ if (sensors->temp.version == 2 &&
890883 temp->fru_type == OCC_FRU_TYPE_VRM) {
891884 snprintf(attr->name, sizeof(attr->name),
892885 "temp%d_alarm", s);
drivers/hwmon/pmbus/ibm-cffps.c+8−2
@@ -171,8 +171,14 @@ static ssize_t ibm_cffps_debugfs_read(struct file *file, char __user *buf, · 170 unmodified lines
171171 cmd = CFFPS_SN_CMD;
172172 break;
173173 case CFFPS_DEBUGFS_MAX_POWER_OUT:
174− rc = i2c_smbus_read_word_swapped(psu->client,
175− CFFPS_MAX_POWER_OUT_CMD);
174+ if (psu->version == cffps1) {
175+ rc = i2c_smbus_read_word_swapped(psu->client,
176+ CFFPS_MAX_POWER_OUT_CMD);
177+ } else {
178+ rc = i2c_smbus_read_word_data(psu->client,
179+ CFFPS_MAX_POWER_OUT_CMD);
180+ }
181+
176182 if (rc < 0)
177183 return rc;
178184
drivers/hwmon/pmbus/mp2975.c+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
5454
5555 #define MP2975_RAIL2_FUNC (PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | \
5656 PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | \
57− PMBUS_PHASE_VIRTUAL)
57+ PMBUS_HAVE_POUT | PMBUS_PHASE_VIRTUAL)
5858
5959 struct mp2975_data {
6060 struct pmbus_driver_info info;
drivers/hwmon/tmp421.c+39−32
@@ -100,71 +100,81 @@ struct tmp421_data { · 99 unmodified lines
100100 s16 temp[4];
101101 };
102102
103−static int temp_from_s16(s16 reg)
103+static int temp_from_raw(u16 reg, bool extended)
104104 {
105105 /* Mask out status bits */
106106 int temp = reg & ~0xf;
107107
108− return (temp * 1000 + 128) / 256;
109−}
110−
111−static int temp_from_u16(u16 reg)
112−{
113− /* Mask out status bits */
114− int temp = reg & ~0xf;
115−
116− /* Add offset for extended temperature range. */
117− temp -= 64 * 256;
108+ if (extended)
109+ temp = temp - 64 * 256;
110+ else
111+ temp = (s16)temp;
118112
119− return (temp * 1000 + 128) / 256;
113+ return DIV_ROUND_CLOSEST(temp * 1000, 256);
120114 }
121115
122−static struct tmp421_data *tmp421_update_device(struct device *dev)
116+static int tmp421_update_device(struct tmp421_data *data)
123117 {
124− struct tmp421_data *data = dev_get_drvdata(dev);
125118 struct i2c_client *client = data->client;
119+ int ret = 0;
126120 int i;
127121
128122 mutex_lock(&data->update_lock);
129123
130124 if (time_after(jiffies, data->last_updated + (HZ / 2)) ||
131125 !data->valid) {
132− data->config = i2c_smbus_read_byte_data(client,
133− TMP421_CONFIG_REG_1);
126+ ret = i2c_smbus_read_byte_data(client, TMP421_CONFIG_REG_1);
127+ if (ret < 0)
128+ goto exit;
129+ data->config = ret;
134130
135131 for (i = 0; i < data->channels; i++) {
136− data->temp[i] = i2c_smbus_read_byte_data(client,
137− TMP421_TEMP_MSB[i]) << 8;
138− data->temp[i] |= i2c_smbus_read_byte_data(client,
139− TMP421_TEMP_LSB[i]);
132+ ret = i2c_smbus_read_byte_data(client, TMP421_TEMP_MSB[i]);
133+ if (ret < 0)
134+ goto exit;
135+ data->temp[i] = ret << 8;
136+
137+ ret = i2c_smbus_read_byte_data(client, TMP421_TEMP_LSB[i]);
138+ if (ret < 0)
139+ goto exit;
140+ data->temp[i] |= ret;
140141 }
141142 data->last_updated = jiffies;
142143 data->valid = 1;
143144 }
144145
146+exit:
145147 mutex_unlock(&data->update_lock);
146148
147− return data;
149+ if (ret < 0) {
150+ data->valid = 0;
151+ return ret;
152+ }
153+
154+ return 0;
148155 }
149156
150157 static int tmp421_read(struct device *dev, enum hwmon_sensor_types type,
151158 u32 attr, int channel, long *val)
152159 {
153− struct tmp421_data *tmp421 = tmp421_update_device(dev);
160+ struct tmp421_data *tmp421 = dev_get_drvdata(dev);
161+ int ret = 0;
162+
163+ ret = tmp421_update_device(tmp421);
164+ if (ret)
165+ return ret;
154166
155167 switch (attr) {
156168 case hwmon_temp_input:
157− if (tmp421->config & TMP421_CONFIG_RANGE)
158− *val = temp_from_u16(tmp421->temp[channel]);
159− else
160− *val = temp_from_s16(tmp421->temp[channel]);
169+ *val = temp_from_raw(tmp421->temp[channel],
170+ tmp421->config & TMP421_CONFIG_RANGE);
161171 return 0;
162172 case hwmon_temp_fault:
163173 /*
164− * The OPEN bit signals a fault. This is bit 0 of the temperature
165− * register (low byte).
174+ * Any of OPEN or /PVLD bits indicate a hardware mulfunction
175+ * and the conversion result may be incorrect
166176 */
167− *val = tmp421->temp[channel] & 0x01;
177+ *val = !!(tmp421->temp[channel] & 0x03);
168178 return 0;
169179 default:
170180 return -EOPNOTSUPP;
@@ -177,9 +187,6 @@ static umode_t tmp421_is_visible(const void *data, enum hwmon_sensor_types type, · 6 unmodified lines
177187 {
178188 switch (attr) {
179189 case hwmon_temp_fault:
180− if (channel == 0)
181− return 0;
182− return 0444;
183190 case hwmon_temp_input:
184191 return 0444;
185192 default:
drivers/hwmon/w83791d.c+11−18
@@ -273,9 +273,6 @@ struct w83791d_data { · 272 unmodified lines
273273 char valid; /* !=0 if following fields are valid */
274274 unsigned long last_updated; /* In jiffies */
275275
276− /* array of 2 pointers to subclients */
277− struct i2c_client *lm75[2];
278−
279276 /* volts */
280277 u8 in[NUMBER_OF_VIN]; /* Register value */
281278 u8 in_max[NUMBER_OF_VIN]; /* Register value */
@@ -1257,7 +1254,6 @@ static const struct attribute_group w83791d_group_fanpwm45 = { · 975 unmodified lines
12571254 static int w83791d_detect_subclients(struct i2c_client *client)
12581255 {
12591256 struct i2c_adapter *adapter = client->adapter;
1260− struct w83791d_data *data = i2c_get_clientdata(client);
12611257 int address = client->addr;
12621258 int i, id;
12631259 u8 val;
@@ -1280,22 +1276,19 @@ static int w83791d_detect_subclients(struct i2c_client *client) · 16 unmodified lines
12801276 }
12811277
12821278 val = w83791d_read(client, W83791D_REG_I2C_SUBADDR);
1283− if (!(val & 0x08))
1284− data->lm75[0] = devm_i2c_new_dummy_device(&client->dev, adapter,
1285− 0x48 + (val & 0x7));
1286− if (!(val & 0x80)) {
1287− if (!IS_ERR(data->lm75[0]) &&
1288− ((val & 0x7) == ((val >> 4) & 0x7))) {
1289− dev_err(&client->dev,
1290− "duplicate addresses 0x%x, "
1291− "use force_subclient\n",
1292− data->lm75[0]->addr);
1293− return -ENODEV;
1294− }
1295− data->lm75[1] = devm_i2c_new_dummy_device(&client->dev, adapter,
1296− 0x48 + ((val >> 4) & 0x7));
1279+
1280+ if (!(val & 0x88) && (val & 0x7) == ((val >> 4) & 0x7)) {
1281+ dev_err(&client->dev,
1282+ "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (val & 0x7));
1283+ return -ENODEV;
12971284 }
12981285
1286+ if (!(val & 0x08))
1287+ devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + (val & 0x7));
1288+
1289+ if (!(val & 0x80))
1290+ devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + ((val >> 4) & 0x7));
1291+
12991292 return 0;
13001293 }
13011294
drivers/hwmon/w83792d.c+11−17
@@ -264,9 +264,6 @@ struct w83792d_data { · 263 unmodified lines
264264 char valid; /* !=0 if following fields are valid */
265265 unsigned long last_updated; /* In jiffies */
266266
267− /* array of 2 pointers to subclients */
268− struct i2c_client *lm75[2];
269−
270267 u8 in[9]; /* Register value */
271268 u8 in_max[9]; /* Register value */
272269 u8 in_min[9]; /* Register value */
@@ -927,7 +924,6 @@ w83792d_detect_subclients(struct i2c_client *new_client) · 654 unmodified lines
927924 int address = new_client->addr;
928925 u8 val;
929926 struct i2c_adapter *adapter = new_client->adapter;
930− struct w83792d_data *data = i2c_get_clientdata(new_client);
931927
932928 id = i2c_adapter_id(adapter);
933929 if (force_subclients[0] == id && force_subclients[1] == address) {
@@ -946,21 +942,19 @@ w83792d_detect_subclients(struct i2c_client *new_client) · 12 unmodified lines
946942 }
947943
948944 val = w83792d_read_value(new_client, W83792D_REG_I2C_SUBADDR);
949− if (!(val & 0x08))
950− data->lm75[0] = devm_i2c_new_dummy_device(&new_client->dev, adapter,
951− 0x48 + (val & 0x7));
952− if (!(val & 0x80)) {
953− if (!IS_ERR(data->lm75[0]) &&
954− ((val & 0x7) == ((val >> 4) & 0x7))) {
955− dev_err(&new_client->dev,
956− "duplicate addresses 0x%x, use force_subclient\n",
957− data->lm75[0]->addr);
958− return -ENODEV;
959− }
960− data->lm75[1] = devm_i2c_new_dummy_device(&new_client->dev, adapter,
961− 0x48 + ((val >> 4) & 0x7));
945+
946+ if (!(val & 0x88) && (val & 0x7) == ((val >> 4) & 0x7)) {
947+ dev_err(&new_client->dev,
948+ "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (val & 0x7));
949+ return -ENODEV;
962950 }
963951
952+ if (!(val & 0x08))
953+ devm_i2c_new_dummy_device(&new_client->dev, adapter, 0x48 + (val & 0x7));
954+
955+ if (!(val & 0x80))
956+ devm_i2c_new_dummy_device(&new_client->dev, adapter, 0x48 + ((val >> 4) & 0x7));
957+
964958 return 0;
965959 }
966960
drivers/hwmon/w83793.c+11−15
@@ -202,7 +202,6 @@ static inline s8 TEMP_TO_REG(long val, s8 min, s8 max) · 201 unmodified lines
202202 }
203203
204204 struct w83793_data {
205− struct i2c_client *lm75[2];
206205 struct device *hwmon_dev;
207206 struct mutex update_lock;
208207 char valid; /* !=0 if following fields are valid */
@@ -1566,7 +1565,6 @@ w83793_detect_subclients(struct i2c_client *client) · 1357 unmodified lines
15661565 int address = client->addr;
15671566 u8 tmp;
15681567 struct i2c_adapter *adapter = client->adapter;
1569− struct w83793_data *data = i2c_get_clientdata(client);
15701568
15711569 id = i2c_adapter_id(adapter);
15721570 if (force_subclients[0] == id && force_subclients[1] == address) {
@@ -1586,21 +1584,19 @@ w83793_detect_subclients(struct i2c_client *client) · 13 unmodified lines
15861584 }
15871585
15881586 tmp = w83793_read_value(client, W83793_REG_I2C_SUBADDR);
1589− if (!(tmp & 0x08))
1590− data->lm75[0] = devm_i2c_new_dummy_device(&client->dev, adapter,
1591− 0x48 + (tmp & 0x7));
1592− if (!(tmp & 0x80)) {
1593− if (!IS_ERR(data->lm75[0])
1594− && ((tmp & 0x7) == ((tmp >> 4) & 0x7))) {
1595− dev_err(&client->dev,
1596− "duplicate addresses 0x%x, "
1597− "use force_subclients\n", data->lm75[0]->addr);
1598− return -ENODEV;
1599− }
1600− data->lm75[1] = devm_i2c_new_dummy_device(&client->dev, adapter,
1601− 0x48 + ((tmp >> 4) & 0x7));
1587+
1588+ if (!(tmp & 0x88) && (tmp & 0x7) == ((tmp >> 4) & 0x7)) {
1589+ dev_err(&client->dev,
1590+ "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (tmp & 0x7));
1591+ return -ENODEV;
16021592 }
16031593
1594+ if (!(tmp & 0x08))
1595+ devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + (tmp & 0x7));
1596+
1597+ if (!(tmp & 0x80))
1598+ devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + ((tmp >> 4) & 0x7));
1599+
16041600 return 0;
16051601 }
16061602
drivers/interconnect/qcom/sdm660.c+19−6
@@ -44,9 +44,9 @@ · 43 unmodified lines
4444 #define NOC_PERM_MODE_BYPASS (1 << NOC_QOS_MODE_BYPASS)
4545
4646 #define NOC_QOS_PRIORITYn_ADDR(n) (0x8 + (n * 0x1000))
47−#define NOC_QOS_PRIORITY_MASK 0xf
47+#define NOC_QOS_PRIORITY_P1_MASK 0xc
48+#define NOC_QOS_PRIORITY_P0_MASK 0x3
4849 #define NOC_QOS_PRIORITY_P1_SHIFT 0x2
49−#define NOC_QOS_PRIORITY_P0_SHIFT 0x3
5050
5151 #define NOC_QOS_MODEn_ADDR(n) (0xc + (n * 0x1000))
5252 #define NOC_QOS_MODEn_MASK 0x3
@@ -173,6 +173,16 @@ static const struct clk_bulk_data bus_mm_clocks[] = { · 120 unmodified lines
173173 { .id = "iface" },
174174 };
175175
176+static const struct clk_bulk_data bus_a2noc_clocks[] = {
177+ { .id = "bus" },
178+ { .id = "bus_a" },
179+ { .id = "ipa" },
180+ { .id = "ufs_axi" },
181+ { .id = "aggre2_ufs_axi" },
182+ { .id = "aggre2_usb3_axi" },
183+ { .id = "cfg_noc_usb2_axi" },
184+};
185+
176186 /**
177187 * struct qcom_icc_provider - Qualcomm specific interconnect provider
178188 * @provider: generic interconnect provider
@@ -307,7 +317,7 @@ DEFINE_QNODE(slv_bimc_cfg, SDM660_SLAVE_BIMC_CFG, 4, -1, 56, true, -1, 0, -1, 0) · 128 unmodified lines
307317 DEFINE_QNODE(slv_prng, SDM660_SLAVE_PRNG, 4, -1, 44, true, -1, 0, -1, 0);
308318 DEFINE_QNODE(slv_spdm, SDM660_SLAVE_SPDM, 4, -1, 60, true, -1, 0, -1, 0);
309319 DEFINE_QNODE(slv_qdss_cfg, SDM660_SLAVE_QDSS_CFG, 4, -1, 63, true, -1, 0, -1, 0);
310−DEFINE_QNODE(slv_cnoc_mnoc_cfg, SDM660_SLAVE_BLSP_1, 4, -1, 66, true, -1, 0, -1, SDM660_MASTER_CNOC_MNOC_CFG);
320+DEFINE_QNODE(slv_cnoc_mnoc_cfg, SDM660_SLAVE_CNOC_MNOC_CFG, 4, -1, 66, true, -1, 0, -1, SDM660_MASTER_CNOC_MNOC_CFG);
311321 DEFINE_QNODE(slv_snoc_cfg, SDM660_SLAVE_SNOC_CFG, 4, -1, 70, true, -1, 0, -1, 0);
312322 DEFINE_QNODE(slv_qm_cfg, SDM660_SLAVE_QM_CFG, 4, -1, 212, true, -1, 0, -1, 0);
313323 DEFINE_QNODE(slv_clk_ctl, SDM660_SLAVE_CLK_CTL, 4, -1, 47, true, -1, 0, -1, 0);
@@ -624,13 +634,12 @@ static int qcom_icc_noc_set_qos_priority(struct regmap *rmap, · 310 unmodified lines
624634 /* Must be updated one at a time, P1 first, P0 last */
625635 val = qos->areq_prio << NOC_QOS_PRIORITY_P1_SHIFT;
626636 rc = regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port),
627− NOC_QOS_PRIORITY_MASK, val);
637+ NOC_QOS_PRIORITY_P1_MASK, val);
628638 if (rc)
629639 return rc;
630640
631− val = qos->prio_level << NOC_QOS_PRIORITY_P0_SHIFT;
632641 return regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port),
633− NOC_QOS_PRIORITY_MASK, val);
642+ NOC_QOS_PRIORITY_P0_MASK, qos->prio_level);
634643 }
635644
636645 static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw)
@@ -810,6 +819,10 @@ static int qnoc_probe(struct platform_device *pdev) · 173 unmodified lines
810819 qp->bus_clks = devm_kmemdup(dev, bus_mm_clocks,
811820 sizeof(bus_mm_clocks), GFP_KERNEL);
812821 qp->num_clks = ARRAY_SIZE(bus_mm_clocks);
822+ } else if (of_device_is_compatible(dev->of_node, "qcom,sdm660-a2noc")) {
823+ qp->bus_clks = devm_kmemdup(dev, bus_a2noc_clocks,
824+ sizeof(bus_a2noc_clocks), GFP_KERNEL);
825+ qp->num_clks = ARRAY_SIZE(bus_a2noc_clocks);
813826 } else {
814827 if (of_device_is_compatible(dev->of_node, "qcom,sdm660-bimc"))
815828 qp->is_bimc_node = true;
drivers/iommu/apple-dart.c+35−21
@@ -183,7 +183,6 @@ struct apple_dart_master_cfg { · 182 unmodified lines
183183
184184 static struct platform_driver apple_dart_driver;
185185 static const struct iommu_ops apple_dart_iommu_ops;
186−static const struct iommu_flush_ops apple_dart_tlb_ops;
187186
188187 static struct apple_dart_domain *to_dart_domain(struct iommu_domain *dom)
189188 {
@@ -338,22 +337,6 @@ static void apple_dart_iotlb_sync_map(struct iommu_domain *domain, · 148 unmodified lines
338337 apple_dart_domain_flush_tlb(to_dart_domain(domain));
339338 }
340339
341−static void apple_dart_tlb_flush_all(void *cookie)
342−{
343− apple_dart_domain_flush_tlb(cookie);
344−}
345−
346−static void apple_dart_tlb_flush_walk(unsigned long iova, size_t size,
347− size_t granule, void *cookie)
348−{
349− apple_dart_domain_flush_tlb(cookie);
350−}
351−
352−static const struct iommu_flush_ops apple_dart_tlb_ops = {
353− .tlb_flush_all = apple_dart_tlb_flush_all,
354− .tlb_flush_walk = apple_dart_tlb_flush_walk,
355−};
356−
357340 static phys_addr_t apple_dart_iova_to_phys(struct iommu_domain *domain,
358341 dma_addr_t iova)
359342 {
@@ -435,7 +418,6 @@ static int apple_dart_finalize_domain(struct iommu_domain *domain, · 75 unmodified lines
435418 .ias = 32,
436419 .oas = 36,
437420 .coherent_walk = 1,
438− .tlb = &apple_dart_tlb_ops,
439421 .iommu_dev = dart->dev,
440422 };
441423
@@ -661,16 +643,34 @@ static int apple_dart_of_xlate(struct device *dev, struct of_phandle_args *args) · 219 unmodified lines
661643 return -EINVAL;
662644 }
663645
646+static DEFINE_MUTEX(apple_dart_groups_lock);
647+
648+static void apple_dart_release_group(void *iommu_data)
649+{
650+ int i, sid;
651+ struct apple_dart_stream_map *stream_map;
652+ struct apple_dart_master_cfg *group_master_cfg = iommu_data;
653+
654+ mutex_lock(&apple_dart_groups_lock);
655+
656+ for_each_stream_map(i, group_master_cfg, stream_map)
657+ for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS)
658+ stream_map->dart->sid2group[sid] = NULL;
659+
660+ kfree(iommu_data);
661+ mutex_unlock(&apple_dart_groups_lock);
662+}
663+
664664 static struct iommu_group *apple_dart_device_group(struct device *dev)
665665 {
666− static DEFINE_MUTEX(lock);
667666 int i, sid;
668667 struct apple_dart_master_cfg *cfg = dev_iommu_priv_get(dev);
669668 struct apple_dart_stream_map *stream_map;
669+ struct apple_dart_master_cfg *group_master_cfg;
670670 struct iommu_group *group = NULL;
671671 struct iommu_group *res = ERR_PTR(-EINVAL);
672672
673− mutex_lock(&lock);
673+ mutex_lock(&apple_dart_groups_lock);
674674
675675 for_each_stream_map(i, cfg, stream_map) {
676676 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) {
@@ -698,6 +698,20 @@ static struct iommu_group *apple_dart_device_group(struct device *dev) · 21 unmodified lines
698698 #endif
699699 group = generic_device_group(dev);
700700
701+ res = ERR_PTR(-ENOMEM);
702+ if (!group)
703+ goto out;
704+
705+ group_master_cfg = kzalloc(sizeof(*group_master_cfg), GFP_KERNEL);
706+ if (!group_master_cfg) {
707+ iommu_group_put(group);
708+ goto out;
709+ }
710+
711+ memcpy(group_master_cfg, cfg, sizeof(*group_master_cfg));
712+ iommu_group_set_iommudata(group, group_master_cfg,
713+ apple_dart_release_group);
714+
701715 for_each_stream_map(i, cfg, stream_map)
702716 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS)
703717 stream_map->dart->sid2group[sid] = group;
@@ -705,7 +719,7 @@ static struct iommu_group *apple_dart_device_group(struct device *dev) · 1 unmodified line
705719 res = group;
706720
707721 out:
708− mutex_unlock(&lock);
722+ mutex_unlock(&apple_dart_groups_lock);
709723 return res;
710724 }
711725
drivers/iommu/intel/dmar.c+3−3
@@ -1942,18 +1942,18 @@ static int dmar_fault_do_one(struct intel_iommu *iommu, int type, · 1941 unmodified lines
19421942 reason = dmar_get_fault_reason(fault_reason, &fault_type);
19431943
19441944 if (fault_type == INTR_REMAP)
1945− pr_err("[INTR-REMAP] Request device [0x%02x:0x%02x.%d] fault index 0x%llx [fault reason 0x%02x] %s\n",
1945+ pr_err("[INTR-REMAP] Request device [%02x:%02x.%d] fault index 0x%llx [fault reason 0x%02x] %s\n",
19461946 source_id >> 8, PCI_SLOT(source_id & 0xFF),
19471947 PCI_FUNC(source_id & 0xFF), addr >> 48,
19481948 fault_reason, reason);
19491949 else if (pasid == INVALID_IOASID)
1950− pr_err("[%s NO_PASID] Request device [0x%02x:0x%02x.%d] fault addr 0x%llx [fault reason 0x%02x] %s\n",
1950+ pr_err("[%s NO_PASID] Request device [%02x:%02x.%d] fault addr 0x%llx [fault reason 0x%02x] %s\n",
19511951 type ? "DMA Read" : "DMA Write",
19521952 source_id >> 8, PCI_SLOT(source_id & 0xFF),
19531953 PCI_FUNC(source_id & 0xFF), addr,
19541954 fault_reason, reason);
19551955 else
1956− pr_err("[%s PASID 0x%x] Request device [0x%02x:0x%02x.%d] fault addr 0x%llx [fault reason 0x%02x] %s\n",
1956+ pr_err("[%s PASID 0x%x] Request device [%02x:%02x.%d] fault addr 0x%llx [fault reason 0x%02x] %s\n",
19571957 type ? "DMA Read" : "DMA Write", pasid,
19581958 source_id >> 8, PCI_SLOT(source_id & 0xFF),
19591959 PCI_FUNC(source_id & 0xFF), addr,
drivers/ipack/devices/ipoctal.c+47−16
@@ -33,6 +33,7 @@ struct ipoctal_channel { · 32 unmodified lines
3333 unsigned int pointer_read;
3434 unsigned int pointer_write;
3535 struct tty_port tty_port;
36+ bool tty_registered;
3637 union scc2698_channel __iomem *regs;
3738 union scc2698_block __iomem *block_regs;
3839 unsigned int board_id;
@@ -81,22 +82,34 @@ static int ipoctal_port_activate(struct tty_port *port, struct tty_struct *tty) · 42 unmodified lines
8182 return 0;
8283 }
8384
84−static int ipoctal_open(struct tty_struct *tty, struct file *file)
85+static int ipoctal_install(struct tty_driver *driver, struct tty_struct *tty)
8586 {
8687 struct ipoctal_channel *channel = dev_get_drvdata(tty->dev);
8788 struct ipoctal *ipoctal = chan_to_ipoctal(channel, tty->index);
88− int err;
89−
90− tty->driver_data = channel;
89+ int res;
9190
9291 if (!ipack_get_carrier(ipoctal->dev))
9392 return -EBUSY;
9493
95− err = tty_port_open(&channel->tty_port, tty, file);
96− if (err)
97− ipack_put_carrier(ipoctal->dev);
94+ res = tty_standard_install(driver, tty);
95+ if (res)
96+ goto err_put_carrier;
97+
98+ tty->driver_data = channel;
99+
100+ return 0;
101+
102+err_put_carrier:
103+ ipack_put_carrier(ipoctal->dev);
104+
105+ return res;
106+}
107+
108+static int ipoctal_open(struct tty_struct *tty, struct file *file)
109+{
110+ struct ipoctal_channel *channel = tty->driver_data;
98111
99− return err;
112+ return tty_port_open(&channel->tty_port, tty, file);
100113 }
101114
102115 static void ipoctal_reset_stats(struct ipoctal_stats *stats)
@@ -264,7 +277,6 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 161 unmodified lines
264277 int res;
265278 int i;
266279 struct tty_driver *tty;
267− char name[20];
268280 struct ipoctal_channel *channel;
269281 struct ipack_region *region;
270282 void __iomem *addr;
@@ -355,8 +367,11 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 84 unmodified lines
355367 /* Fill struct tty_driver with ipoctal data */
356368 tty->owner = THIS_MODULE;
357369 tty->driver_name = KBUILD_MODNAME;
358− sprintf(name, KBUILD_MODNAME ".%d.%d.", bus_nr, slot);
359− tty->name = name;
370+ tty->name = kasprintf(GFP_KERNEL, KBUILD_MODNAME ".%d.%d.", bus_nr, slot);
371+ if (!tty->name) {
372+ res = -ENOMEM;
373+ goto err_put_driver;
374+ }
360375 tty->major = 0;
361376
362377 tty->minor_start = 0;
@@ -371,8 +386,7 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 8 unmodified lines
371386 res = tty_register_driver(tty);
372387 if (res) {
373388 dev_err(&ipoctal->dev->dev, "Can't register tty driver.\n");
374− tty_driver_kref_put(tty);
375− return res;
389+ goto err_free_name;
376390 }
377391
378392 /* Save struct tty_driver for use it when uninstalling the device */
@@ -383,7 +397,9 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 4 unmodified lines
383397
384398 channel = &ipoctal->channel[i];
385399 tty_port_init(&channel->tty_port);
386− tty_port_alloc_xmit_buf(&channel->tty_port);
400+ res = tty_port_alloc_xmit_buf(&channel->tty_port);
401+ if (res)
402+ continue;
387403 channel->tty_port.ops = &ipoctal_tty_port_ops;
388404
389405 ipoctal_reset_stats(&channel->stats);
@@ -391,13 +407,15 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 1 unmodified line
391407 spin_lock_init(&channel->lock);
392408 channel->pointer_read = 0;
393409 channel->pointer_write = 0;
394− tty_dev = tty_port_register_device(&channel->tty_port, tty, i, NULL);
410+ tty_dev = tty_port_register_device_attr(&channel->tty_port, tty,
411+ i, NULL, channel, NULL);
395412 if (IS_ERR(tty_dev)) {
396413 dev_err(&ipoctal->dev->dev, "Failed to register tty device.\n");
414+ tty_port_free_xmit_buf(&channel->tty_port);
397415 tty_port_destroy(&channel->tty_port);
398416 continue;
399417 }
400− dev_set_drvdata(tty_dev, channel);
418+ channel->tty_registered = true;
401419 }
402420
403421 /*
@@ -409,6 +427,13 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 5 unmodified lines
409427 ipoctal_irq_handler, ipoctal);
410428
411429 return 0;
430+
431+err_free_name:
432+ kfree(tty->name);
433+err_put_driver:
434+ tty_driver_kref_put(tty);
435+
436+ return res;
412437 }
413438
414439 static inline int ipoctal_copy_write_buffer(struct ipoctal_channel *channel,
@@ -648,6 +673,7 @@ static void ipoctal_cleanup(struct tty_struct *tty) · 233 unmodified lines
648673
649674 static const struct tty_operations ipoctal_fops = {
650675 .ioctl = NULL,
676+ .install = ipoctal_install,
651677 .open = ipoctal_open,
652678 .close = ipoctal_close,
653679 .write = ipoctal_write_tty,
@@ -690,12 +716,17 @@ static void __ipoctal_remove(struct ipoctal *ipoctal) · 36 unmodified lines
690716
691717 for (i = 0; i < NR_CHANNELS; i++) {
692718 struct ipoctal_channel *channel = &ipoctal->channel[i];
719+
720+ if (!channel->tty_registered)
721+ continue;
722+
693723 tty_unregister_device(ipoctal->tty_drv, i);
694724 tty_port_free_xmit_buf(&channel->tty_port);
695725 tty_port_destroy(&channel->tty_port);
696726 }
697727
698728 tty_unregister_driver(ipoctal->tty_drv);
729+ kfree(ipoctal->tty_drv->name);
699730 tty_driver_kref_put(ipoctal->tty_drv);
700731 kfree(ipoctal);
701732 }
drivers/net/ethernet/google/gve/gve.h+1−1
@@ -779,7 +779,7 @@ struct gve_queue_page_list *gve_assign_rx_qpl(struct gve_priv *priv) · 778 unmodified lines
779779 gve_num_tx_qpls(priv));
780780
781781 /* we are out of rx qpls */
782− if (id == priv->qpl_cfg.qpl_map_size)
782+ if (id == gve_num_tx_qpls(priv) + gve_num_rx_qpls(priv))
783783 return NULL;
784784
785785 set_bit(id, priv->qpl_cfg.qpl_id_map);
drivers/net/ethernet/google/gve/gve_main.c+29−16
@@ -41,6 +41,7 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s) · 40 unmodified lines
4141 {
4242 struct gve_priv *priv = netdev_priv(dev);
4343 unsigned int start;
44+ u64 packets, bytes;
4445 int ring;
4546
4647 if (priv->rx) {
@@ -48,10 +49,12 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s) · 1 unmodified line
4849 do {
4950 start =
5051 u64_stats_fetch_begin(&priv->rx[ring].statss);
51− s->rx_packets += priv->rx[ring].rpackets;
52− s->rx_bytes += priv->rx[ring].rbytes;
52+ packets = priv->rx[ring].rpackets;
53+ bytes = priv->rx[ring].rbytes;
5354 } while (u64_stats_fetch_retry(&priv->rx[ring].statss,
5455 start));
56+ s->rx_packets += packets;
57+ s->rx_bytes += bytes;
5558 }
5659 }
5760 if (priv->tx) {
@@ -59,10 +62,12 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s) · 1 unmodified line
5962 do {
6063 start =
6164 u64_stats_fetch_begin(&priv->tx[ring].statss);
62− s->tx_packets += priv->tx[ring].pkt_done;
63− s->tx_bytes += priv->tx[ring].bytes_done;
65+ packets = priv->tx[ring].pkt_done;
66+ bytes = priv->tx[ring].bytes_done;
6467 } while (u64_stats_fetch_retry(&priv->tx[ring].statss,
6568 start));
69+ s->tx_packets += packets;
70+ s->tx_bytes += bytes;
6671 }
6772 }
6873 }
@@ -82,6 +87,9 @@ static int gve_alloc_counter_array(struct gve_priv *priv) · 13 unmodified lines
8287
8388 static void gve_free_counter_array(struct gve_priv *priv)
8489 {
90+ if (!priv->counter_array)
91+ return;
92+
8593 dma_free_coherent(&priv->pdev->dev,
8694 priv->num_event_counters *
8795 sizeof(*priv->counter_array),
@@ -142,6 +150,9 @@ static int gve_alloc_stats_report(struct gve_priv *priv) · 54 unmodified lines
142150
143151 static void gve_free_stats_report(struct gve_priv *priv)
144152 {
153+ if (!priv->stats_report)
154+ return;
155+
145156 del_timer_sync(&priv->stats_report_timer);
146157 dma_free_coherent(&priv->pdev->dev, priv->stats_report_len,
147158 priv->stats_report, priv->stats_report_bus);
@@ -370,18 +381,19 @@ static void gve_free_notify_blocks(struct gve_priv *priv) · 222 unmodified lines
370381 {
371382 int i;
372383
373− if (priv->msix_vectors) {
374− /* Free the irqs */
375− for (i = 0; i < priv->num_ntfy_blks; i++) {
376− struct gve_notify_block *block = &priv->ntfy_blocks[i];
377− int msix_idx = i;
384+ if (!priv->msix_vectors)
385+ return;
378386
379− irq_set_affinity_hint(priv->msix_vectors[msix_idx].vector,
380− NULL);
381− free_irq(priv->msix_vectors[msix_idx].vector, block);
382− }
383− free_irq(priv->msix_vectors[priv->mgmt_msix_idx].vector, priv);
387+ /* Free the irqs */
388+ for (i = 0; i < priv->num_ntfy_blks; i++) {
389+ struct gve_notify_block *block = &priv->ntfy_blocks[i];
390+ int msix_idx = i;
391+
392+ irq_set_affinity_hint(priv->msix_vectors[msix_idx].vector,
393+ NULL);
394+ free_irq(priv->msix_vectors[msix_idx].vector, block);
384395 }
396+ free_irq(priv->msix_vectors[priv->mgmt_msix_idx].vector, priv);
385397 dma_free_coherent(&priv->pdev->dev,
386398 priv->num_ntfy_blks * sizeof(*priv->ntfy_blocks),
387399 priv->ntfy_blocks, priv->ntfy_block_bus);
@@ -1184,9 +1196,10 @@ static void gve_handle_reset(struct gve_priv *priv) · 796 unmodified lines
11841196
11851197 void gve_handle_report_stats(struct gve_priv *priv)
11861198 {
1187− int idx, stats_idx = 0, tx_bytes;
1188− unsigned int start = 0;
11891199 struct stats *stats = priv->stats_report->stats;
1200+ int idx, stats_idx = 0;
1201+ unsigned int start = 0;
1202+ u64 tx_bytes;
11901203
11911204 if (!gve_get_report_stats(priv))
11921205 return;
drivers/net/ethernet/google/gve/gve_rx.c+7−1
@@ -104,8 +104,14 @@ static int gve_prefill_rx_pages(struct gve_rx_ring *rx) · 103 unmodified lines
104104 if (!rx->data.page_info)
105105 return -ENOMEM;
106106
107− if (!rx->data.raw_addressing)
107+ if (!rx->data.raw_addressing) {
108108 rx->data.qpl = gve_assign_rx_qpl(priv);
109+ if (!rx->data.qpl) {
110+ kvfree(rx->data.page_info);
111+ rx->data.page_info = NULL;
112+ return -ENOMEM;
113+ }
114+ }
109115 for (i = 0; i < slots; i++) {
110116 if (!rx->data.raw_addressing) {
111117 struct page *page = rx->data.qpl->pages[i];
drivers/net/ethernet/intel/i40e/i40e_main.c+3−2
@@ -4871,7 +4871,8 @@ static void i40e_clear_interrupt_scheme(struct i40e_pf *pf) · 4870 unmodified lines
48714871 {
48724872 int i;
48734873
4874− i40e_free_misc_vector(pf);
4874+ if (test_bit(__I40E_MISC_IRQ_REQUESTED, pf->state))
4875+ i40e_free_misc_vector(pf);
48754876
48764877 i40e_put_lump(pf->irq_pile, pf->iwarp_base_vector,
48774878 I40E_IWARP_IRQ_PILE_ID);
@@ -10113,7 +10114,7 @@ static int i40e_get_capabilities(struct i40e_pf *pf, · 5235 unmodified lines
1011310114 if (pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOMEM) {
1011410115 /* retry with a larger buffer */
1011510116 buf_len = data_size;
10116− } else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK) {
10117+ } else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK || err) {
1011710118 dev_info(&pf->pdev->dev,
1011810119 "capability discovery failed, err %s aq_err %s\n",
1011910120 i40e_stat_str(&pf->hw, err),
drivers/net/ethernet/intel/iavf/iavf_main.c+0−1
@@ -1965,7 +1965,6 @@ static void iavf_watchdog_task(struct work_struct *work) · 1964 unmodified lines
19651965 }
19661966 adapter->aq_required = 0;
19671967 adapter->current_op = VIRTCHNL_OP_UNKNOWN;
1968− mutex_unlock(&adapter->crit_lock);
19691968 queue_delayed_work(iavf_wq,
19701969 &adapter->watchdog_task,
19711970 msecs_to_jiffies(10));
drivers/net/ethernet/mscc/ocelot_vcap.c+2−2
@@ -998,8 +998,8 @@ ocelot_vcap_block_find_filter_by_index(struct ocelot_vcap_block *block, · 997 unmodified lines
998998 }
999999
10001000 struct ocelot_vcap_filter *
1001−ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block, int cookie,
1002− bool tc_offload)
1001+ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block,
1002+ unsigned long cookie, bool tc_offload)
10031003 {
10041004 struct ocelot_vcap_filter *filter;
10051005
drivers/net/ethernet/pensando/ionic/ionic_lif.c+3−1
@@ -1293,8 +1293,10 @@ int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr) · 1292 unmodified lines
12931293 if (err && err != -EEXIST) {
12941294 /* set the state back to NEW so we can try again later */
12951295 f = ionic_rx_filter_by_addr(lif, addr);
1296− if (f && f->state == IONIC_FILTER_STATE_SYNCED)
1296+ if (f && f->state == IONIC_FILTER_STATE_SYNCED) {
12971297 f->state = IONIC_FILTER_STATE_NEW;
1298+ set_bit(IONIC_LIF_F_FILTER_SYNC_NEEDED, lif->state);
1299+ }
12981300
12991301 spin_unlock_bh(&lif->rx_filters.lock);
13001302
drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c+0−3
@@ -349,9 +349,6 @@ loop_out: · 348 unmodified lines
349349 list_for_each_entry_safe(sync_item, spos, &sync_add_list, list) {
350350 (void)ionic_lif_addr_add(lif, sync_item->f.cmd.mac.addr);
351351
352− if (sync_item->f.state != IONIC_FILTER_STATE_SYNCED)
353− set_bit(IONIC_LIF_F_FILTER_SYNC_NEEDED, lif->state);
354−
355352 list_del(&sync_item->list);
356353 devm_kfree(dev, sync_item);
357354 }
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c+5−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/delay.h>
2222 #include <linux/mfd/syscon.h>
2323 #include <linux/regmap.h>
24+#include <linux/pm_runtime.h>
2425
2526 #include "stmmac_platform.h"
2627
@@ -1528,6 +1529,8 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv) · 1501 unmodified lines
15281529 return ret;
15291530 }
15301531
1532+ pm_runtime_get_sync(dev);
1533+
15311534 if (bsp_priv->integrated_phy)
15321535 rk_gmac_integrated_phy_powerup(bsp_priv);
15331536
@@ -1539,6 +1542,8 @@ static void rk_gmac_powerdown(struct rk_priv_data *gmac) · 5 unmodified lines
15391542 if (gmac->integrated_phy)
15401543 rk_gmac_integrated_phy_powerdown(gmac);
15411544
1545+ pm_runtime_put_sync(&gmac->pdev->dev);
1546+
15421547 phy_power_on(gmac, false);
15431548 gmac_clk_enable(gmac, false);
15441549 }
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+5−1
@@ -477,6 +477,10 @@ bool stmmac_eee_init(struct stmmac_priv *priv) · 476 unmodified lines
477477 stmmac_lpi_entry_timer_config(priv, 0);
478478 del_timer_sync(&priv->eee_ctrl_timer);
479479 stmmac_set_eee_timer(priv, priv->hw, 0, eee_tw_timer);
480+ if (priv->hw->xpcs)
481+ xpcs_config_eee(priv->hw->xpcs,
482+ priv->plat->mult_fact_100ns,
483+ false);
480484 }
481485 mutex_unlock(&priv->lock);
482486 return false;
@@ -1038,7 +1042,7 @@ static void stmmac_mac_link_down(struct phylink_config *config, · 555 unmodified lines
10381042 stmmac_mac_set(priv, priv->ioaddr, false);
10391043 priv->eee_active = false;
10401044 priv->tx_lpi_enabled = false;
1041− stmmac_eee_init(priv);
1045+ priv->eee_enabled = stmmac_eee_init(priv);
10421046 stmmac_set_eee_pls(priv, priv->hw, false);
10431047
10441048 if (priv->dma_cap.fpesel)
drivers/net/pcs/pcs-xpcs.c+36−9
@@ -666,6 +666,10 @@ int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) · 665 unmodified lines
666666 {
667667 int ret;
668668
669+ ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL0);
670+ if (ret < 0)
671+ return ret;
672+
669673 if (enable) {
670674 /* Enable EEE */
671675 ret = DW_VR_MII_EEE_LTX_EN | DW_VR_MII_EEE_LRX_EN |
@@ -673,9 +677,6 @@ int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) · 1 unmodified line
673677 DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL |
674678 mult_fact_100ns << DW_VR_MII_EEE_MULT_FACT_100NS_SHIFT;
675679 } else {
676− ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL0);
677− if (ret < 0)
678− return ret;
679680 ret &= ~(DW_VR_MII_EEE_LTX_EN | DW_VR_MII_EEE_LRX_EN |
680681 DW_VR_MII_EEE_TX_QUIET_EN | DW_VR_MII_EEE_RX_QUIET_EN |
681682 DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL |
@@ -690,21 +691,28 @@ int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) · 8 unmodified lines
690691 if (ret < 0)
691692 return ret;
692693
693− ret |= DW_VR_MII_EEE_TRN_LPI;
694+ if (enable)
695+ ret |= DW_VR_MII_EEE_TRN_LPI;
696+ else
697+ ret &= ~DW_VR_MII_EEE_TRN_LPI;
698+
694699 return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL1, ret);
695700 }
696701 EXPORT_SYMBOL_GPL(xpcs_config_eee);
697702
698703 static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, unsigned int mode)
699704 {
700− int ret;
705+ int ret, mdio_ctrl;
701706
702707 /* For AN for C37 SGMII mode, the settings are :-
703− * 1) VR_MII_AN_CTRL Bit(2:1)[PCS_MODE] = 10b (SGMII AN)
704− * 2) VR_MII_AN_CTRL Bit(3) [TX_CONFIG] = 0b (MAC side SGMII)
708+ * 1) VR_MII_MMD_CTRL Bit(12) [AN_ENABLE] = 0b (Disable SGMII AN in case
709+ it is already enabled)
710+ * 2) VR_MII_AN_CTRL Bit(2:1)[PCS_MODE] = 10b (SGMII AN)
711+ * 3) VR_MII_AN_CTRL Bit(3) [TX_CONFIG] = 0b (MAC side SGMII)
705712 * DW xPCS used with DW EQoS MAC is always MAC side SGMII.
706− * 3) VR_MII_DIG_CTRL1 Bit(9) [MAC_AUTO_SW] = 1b (Automatic
713+ * 4) VR_MII_DIG_CTRL1 Bit(9) [MAC_AUTO_SW] = 1b (Automatic
707714 * speed/duplex mode change by HW after SGMII AN complete)
715+ * 5) VR_MII_MMD_CTRL Bit(12) [AN_ENABLE] = 1b (Enable SGMII AN)
708716 *
709717 * Note: Since it is MAC side SGMII, there is no need to set
710718 * SR_MII_AN_ADV. MAC side SGMII receives AN Tx Config from
@@ -712,6 +720,17 @@ static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, unsigned int mode) · 1 unmodified line
712720 * between PHY and Link Partner. There is also no need to
713721 * trigger AN restart for MAC-side SGMII.
714722 */
723+ mdio_ctrl = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL);
724+ if (mdio_ctrl < 0)
725+ return mdio_ctrl;
726+
727+ if (mdio_ctrl & AN_CL37_EN) {
728+ ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL,
729+ mdio_ctrl & ~AN_CL37_EN);
730+ if (ret < 0)
731+ return ret;
732+ }
733+
715734 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL);
716735 if (ret < 0)
717736 return ret;
@@ -736,7 +755,15 @@ static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, unsigned int mode) · 18 unmodified lines
736755 else
737756 ret &= ~DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW;
738757
739− return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1, ret);
758+ ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1, ret);
759+ if (ret < 0)
760+ return ret;
761+
762+ if (phylink_autoneg_inband(mode))
763+ ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL,
764+ mdio_ctrl | AN_CL37_EN);
765+
766+ return ret;
740767 }
741768
742769 static int xpcs_config_2500basex(struct dw_xpcs *xpcs)
drivers/net/phy/mdio_bus.c+11−1
@@ -525,6 +525,10 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) · 524 unmodified lines
525525 NULL == bus->read || NULL == bus->write)
526526 return -EINVAL;
527527
528+ if (bus->parent && bus->parent->of_node)
529+ bus->parent->of_node->fwnode.flags |=
530+ FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD;
531+
528532 BUG_ON(bus->state != MDIOBUS_ALLOCATED &&
529533 bus->state != MDIOBUS_UNREGISTERED);
530534
@@ -534,10 +538,16 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) · 3 unmodified lines
534538 bus->dev.groups = NULL;
535539 dev_set_name(&bus->dev, "%s", bus->id);
536540
541+ /* We need to set state to MDIOBUS_UNREGISTERED to correctly release
542+ * the device in mdiobus_free()
543+ *
544+ * State will be updated later in this function in case of success
545+ */
546+ bus->state = MDIOBUS_UNREGISTERED;
547+
537548 err = device_register(&bus->dev);
538549 if (err) {
539550 pr_err("mii_bus %s failed to register\n", bus->id);
540− put_device(&bus->dev);
541551 return -EINVAL;
542552 }
543553
drivers/net/phy/sfp.c+1−1
@@ -134,7 +134,7 @@ static const char * const sm_state_strings[] = { · 133 unmodified lines
134134 [SFP_S_LINK_UP] = "link_up",
135135 [SFP_S_TX_FAULT] = "tx_fault",
136136 [SFP_S_REINIT] = "reinit",
137− [SFP_S_TX_DISABLE] = "rx_disable",
137+ [SFP_S_TX_DISABLE] = "tx_disable",
138138 };
139139
140140 static const char *sm_state_to_str(unsigned short sm_state)
drivers/net/usb/r8152.c+15−1
@@ -767,6 +767,7 @@ enum rtl8152_flags { · 766 unmodified lines
767767 PHY_RESET,
768768 SCHEDULE_TASKLET,
769769 GREEN_ETHERNET,
770+ RX_EPROTO,
770771 };
771772
772773 #define DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2 0x3082
@@ -1770,6 +1771,14 @@ static void read_bulk_callback(struct urb *urb) · 997 unmodified lines
17701771 rtl_set_unplug(tp);
17711772 netif_device_detach(tp->netdev);
17721773 return;
1774+ case -EPROTO:
1775+ urb->actual_length = 0;
1776+ spin_lock_irqsave(&tp->rx_lock, flags);
1777+ list_add_tail(&agg->list, &tp->rx_done);
1778+ spin_unlock_irqrestore(&tp->rx_lock, flags);
1779+ set_bit(RX_EPROTO, &tp->flags);
1780+ schedule_delayed_work(&tp->schedule, 1);
1781+ return;
17731782 case -ENOENT:
17741783 return; /* the urb is in unlink state */
17751784 case -ETIME:
@@ -2425,6 +2434,7 @@ static int rx_bottom(struct r8152 *tp, int budget) · 649 unmodified lines
24252434 if (list_empty(&tp->rx_done))
24262435 goto out1;
24272436
2437+ clear_bit(RX_EPROTO, &tp->flags);
24282438 INIT_LIST_HEAD(&rx_queue);
24292439 spin_lock_irqsave(&tp->rx_lock, flags);
24302440 list_splice_init(&tp->rx_done, &rx_queue);
@@ -2441,7 +2451,7 @@ static int rx_bottom(struct r8152 *tp, int budget) · 10 unmodified lines
24412451
24422452 agg = list_entry(cursor, struct rx_agg, list);
24432453 urb = agg->urb;
2444− if (urb->actual_length < ETH_ZLEN)
2454+ if (urb->status != 0 || urb->actual_length < ETH_ZLEN)
24452455 goto submit;
24462456
24472457 agg_free = rtl_get_free_rx(tp, GFP_ATOMIC);
@@ -6643,6 +6653,10 @@ static void rtl_work_func_t(struct work_struct *work) · 4195 unmodified lines
66436653 netif_carrier_ok(tp->netdev))
66446654 tasklet_schedule(&tp->tx_tl);
66456655
6656+ if (test_and_clear_bit(RX_EPROTO, &tp->flags) &&
6657+ !list_empty(&tp->rx_done))
6658+ napi_schedule(&tp->napi);
6659+
66466660 mutex_unlock(&tp->control);
66476661
66486662 out1:
drivers/net/wireless/ath/ath5k/Kconfig+1−3
@@ -3,9 +3,7 @@ config ATH5K · 2 unmodified lines
33 tristate "Atheros 5xxx wireless cards support"
44 depends on (PCI || ATH25) && MAC80211
55 select ATH_COMMON
6− select MAC80211_LEDS
7− select LEDS_CLASS
8− select NEW_LEDS
6+ select MAC80211_LEDS if LEDS_CLASS=y || LEDS_CLASS=MAC80211
97 select ATH5K_AHB if ATH25
108 select ATH5K_PCI if !ATH25
119 help
drivers/net/wireless/ath/ath5k/led.c+6−4
@@ -89,7 +89,8 @@ static const struct pci_device_id ath5k_led_devices[] = { · 88 unmodified lines
8989
9090 void ath5k_led_enable(struct ath5k_hw *ah)
9191 {
92− if (test_bit(ATH_STAT_LEDSOFT, ah->status)) {
92+ if (IS_ENABLED(CONFIG_MAC80211_LEDS) &&
93+ test_bit(ATH_STAT_LEDSOFT, ah->status)) {
9394 ath5k_hw_set_gpio_output(ah, ah->led_pin);
9495 ath5k_led_off(ah);
9596 }
@@ -104,7 +105,8 @@ static void ath5k_led_on(struct ath5k_hw *ah) · 8 unmodified lines
104105
105106 void ath5k_led_off(struct ath5k_hw *ah)
106107 {
107− if (!test_bit(ATH_STAT_LEDSOFT, ah->status))
108+ if (!IS_ENABLED(CONFIG_MAC80211_LEDS) ||
109+ !test_bit(ATH_STAT_LEDSOFT, ah->status))
108110 return;
109111 ath5k_hw_set_gpio(ah, ah->led_pin, !ah->led_on);
110112 }
@@ -146,7 +148,7 @@ ath5k_register_led(struct ath5k_hw *ah, struct ath5k_led *led, · 35 unmodified lines
146148 static void
147149 ath5k_unregister_led(struct ath5k_led *led)
148150 {
149− if (!led->ah)
151+ if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !led->ah)
150152 return;
151153 led_classdev_unregister(&led->led_dev);
152154 ath5k_led_off(led->ah);
@@ -169,7 +171,7 @@ int ath5k_init_leds(struct ath5k_hw *ah) · 16 unmodified lines
169171 char name[ATH5K_LED_MAX_NAME_LEN + 1];
170172 const struct pci_device_id *match;
171173
172− if (!ah->pdev)
174+ if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !ah->pdev)
173175 return 0;
174176
175177 #ifdef CONFIG_ATH5K_AHB
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c+6−11
@@ -7463,23 +7463,18 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], · 7462 unmodified lines
74637463 s32 found_index;
74647464 int i;
74657465
7466+ country_codes = drvr->settings->country_codes;
7467+ if (!country_codes) {
7468+ brcmf_dbg(TRACE, "No country codes configured for device\n");
7469+ return -EINVAL;
7470+ }
7471+
74667472 if ((alpha2[0] == ccreq->country_abbrev[0]) &&
74677473 (alpha2[1] == ccreq->country_abbrev[1])) {
74687474 brcmf_dbg(TRACE, "Country code already set\n");
74697475 return -EAGAIN;
74707476 }
74717477
7472− country_codes = drvr->settings->country_codes;
7473− if (!country_codes) {
7474− brcmf_dbg(TRACE, "No country codes configured for device, using ISO3166 code and 0 rev\n");
7475− memset(ccreq, 0, sizeof(*ccreq));
7476− ccreq->country_abbrev[0] = alpha2[0];
7477− ccreq->country_abbrev[1] = alpha2[1];
7478− ccreq->ccode[0] = alpha2[0];
7479− ccreq->ccode[1] = alpha2[1];
7480− return 0;
7481− }
7482−
74837478 found_index = -1;
74847479 for (i = 0; i < country_codes->table_size; i++) {
74857480 cc = &country_codes->table[i];
drivers/net/wireless/intel/iwlwifi/mvm/d3.c+3−2
@@ -160,6 +160,7 @@ static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw, · 159 unmodified lines
160160 mvm->ptk_icvlen = key->icv_len;
161161 mvm->gtk_ivlen = key->iv_len;
162162 mvm->gtk_icvlen = key->icv_len;
163+ mutex_unlock(&mvm->mutex);
163164
164165 /* don't upload key again */
165166 return;
@@ -360,11 +361,11 @@ static void iwl_mvm_wowlan_get_rsc_v5_data(struct ieee80211_hw *hw, · 194 unmodified lines
360361 if (sta) {
361362 rsc = data->rsc->ucast_rsc;
362363 } else {
363− if (WARN_ON(data->gtks > ARRAY_SIZE(data->gtk_ids)))
364+ if (WARN_ON(data->gtks >= ARRAY_SIZE(data->gtk_ids)))
364365 return;
365366 data->gtk_ids[data->gtks] = key->keyidx;
366367 rsc = data->rsc->mcast_rsc[data->gtks % 2];
367− if (WARN_ON(key->keyidx >
368+ if (WARN_ON(key->keyidx >=
368369 ARRAY_SIZE(data->rsc->mcast_key_id_map)))
369370 return;
370371 data->rsc->mcast_key_id_map[key->keyidx] = data->gtks % 2;
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c+2−1
@@ -662,12 +662,13 @@ static bool __iwl_mvm_remove_time_event(struct iwl_mvm *mvm, · 661 unmodified lines
662662 u32 *uid)
663663 {
664664 u32 id;
665− struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
665+ struct iwl_mvm_vif *mvmvif;
666666 enum nl80211_iftype iftype;
667667
668668 if (!te_data->vif)
669669 return false;
670670
671+ mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
671672 iftype = te_data->vif->type;
672673
673674 /*
drivers/net/wireless/intel/iwlwifi/pcie/drv.c+2−0
@@ -547,6 +547,8 @@ static const struct iwl_dev_info iwl_dev_info_table[] = { · 546 unmodified lines
547547 IWL_DEV_INFO(0x43F0, 0x0074, iwl_ax201_cfg_qu_hr, NULL),
548548 IWL_DEV_INFO(0x43F0, 0x0078, iwl_ax201_cfg_qu_hr, NULL),
549549 IWL_DEV_INFO(0x43F0, 0x007C, iwl_ax201_cfg_qu_hr, NULL),
550+ IWL_DEV_INFO(0x43F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0, iwl_ax201_killer_1650s_name),
551+ IWL_DEV_INFO(0x43F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, iwl_ax201_killer_1650i_name),
550552 IWL_DEV_INFO(0x43F0, 0x2074, iwl_ax201_cfg_qu_hr, NULL),
551553 IWL_DEV_INFO(0x43F0, 0x4070, iwl_ax201_cfg_qu_hr, NULL),
552554 IWL_DEV_INFO(0xA0F0, 0x0070, iwl_ax201_cfg_qu_hr, NULL),
drivers/net/wireless/marvell/mwifiex/sta_tx.c+2−2
@@ -62,8 +62,8 @@ void *mwifiex_process_sta_txpd(struct mwifiex_private *priv, · 61 unmodified lines
6262
6363 pkt_type = mwifiex_is_skb_mgmt_frame(skb) ? PKT_TYPE_MGMT : 0;
6464
65− pad = ((void *)skb->data - (sizeof(*local_tx_pd) + hroom)-
66− NULL) & (MWIFIEX_DMA_ALIGN_SZ - 1);
65+ pad = ((uintptr_t)skb->data - (sizeof(*local_tx_pd) + hroom)) &
66+ (MWIFIEX_DMA_ALIGN_SZ - 1);
6767 skb_push(skb, sizeof(*local_tx_pd) + pad);
6868
6969 local_tx_pd = (struct txpd *) skb->data;
drivers/net/wireless/marvell/mwifiex/uap_txrx.c+2−2
@@ -475,8 +475,8 @@ void *mwifiex_process_uap_txpd(struct mwifiex_private *priv, · 474 unmodified lines
475475
476476 pkt_type = mwifiex_is_skb_mgmt_frame(skb) ? PKT_TYPE_MGMT : 0;
477477
478− pad = ((void *)skb->data - (sizeof(*txpd) + hroom) - NULL) &
479− (MWIFIEX_DMA_ALIGN_SZ - 1);
478+ pad = ((uintptr_t)skb->data - (sizeof(*txpd) + hroom)) &
479+ (MWIFIEX_DMA_ALIGN_SZ - 1);
480480
481481 skb_push(skb, sizeof(*txpd) + pad);
482482
drivers/nvdimm/pmem.c+1−4
@@ -380,7 +380,6 @@ static int pmem_attach_disk(struct device *dev, · 379 unmodified lines
380380 struct nd_pfn_sb *pfn_sb;
381381 struct pmem_device *pmem;
382382 struct request_queue *q;
383− struct device *gendev;
384383 struct gendisk *disk;
385384 void *addr;
386385 int rc;
@@ -489,10 +488,8 @@ static int pmem_attach_disk(struct device *dev, · 102 unmodified lines
489488 }
490489 dax_write_cache(dax_dev, nvdimm_has_cache(nd_region));
491490 pmem->dax_dev = dax_dev;
492− gendev = disk_to_dev(disk);
493− gendev->groups = pmem_attribute_groups;
494491
495− device_add_disk(dev, disk, NULL);
492+ device_add_disk(dev, disk, pmem_attribute_groups);
496493 if (devm_add_action_or_reset(dev, pmem_release_disk, pmem))
497494 return -ENOMEM;
498495
drivers/nvme/host/core.c+3−1
@@ -978,6 +978,7 @@ EXPORT_SYMBOL_GPL(nvme_cleanup_cmd); · 977 unmodified lines
978978 blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req)
979979 {
980980 struct nvme_command *cmd = nvme_req(req)->cmd;
981+ struct nvme_ctrl *ctrl = nvme_req(req)->ctrl;
981982 blk_status_t ret = BLK_STS_OK;
982983
983984 if (!(req->rq_flags & RQF_DONTPREP)) {
@@ -1026,7 +1027,8 @@ blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req) · 42 unmodified lines
10261027 return BLK_STS_IOERR;
10271028 }
10281029
1029− nvme_req(req)->genctr++;
1030+ if (!(ctrl->quirks & NVME_QUIRK_SKIP_CID_GEN))
1031+ nvme_req(req)->genctr++;
10301032 cmd->common.command_id = nvme_cid(req);
10311033 trace_nvme_setup_cmd(req, cmd);
10321034 return ret;
drivers/nvme/host/nvme.h+6−0
@@ -138,6 +138,12 @@ enum nvme_quirks { · 137 unmodified lines
138138 * 48 bits.
139139 */
140140 NVME_QUIRK_DMA_ADDRESS_BITS_48 = (1 << 16),
141+
142+ /*
143+ * The controller requires the command_id value be be limited, so skip
144+ * encoding the generation sequence number.
145+ */
146+ NVME_QUIRK_SKIP_CID_GEN = (1 << 17),
141147 };
142148
143149 /*
drivers/nvme/host/pci.c+2−1
@@ -3369,7 +3369,8 @@ static const struct pci_device_id nvme_id_table[] = { · 3368 unmodified lines
33693369 { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2005),
33703370 .driver_data = NVME_QUIRK_SINGLE_VECTOR |
33713371 NVME_QUIRK_128_BYTES_SQES |
3372− NVME_QUIRK_SHARED_TAGS },
3372+ NVME_QUIRK_SHARED_TAGS |
3373+ NVME_QUIRK_SKIP_CID_GEN },
33733374
33743375 { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
33753376 { 0, }
drivers/pci/controller/pci-hyperv.c+10−3
@@ -3301,9 +3301,17 @@ static int hv_pci_bus_exit(struct hv_device *hdev, bool keep_devs) · 3300 unmodified lines
33013301 return 0;
33023302
33033303 if (!keep_devs) {
3304− /* Delete any children which might still exist. */
3304+ struct list_head removed;
3305+
3306+ /* Move all present children to the list on stack */
3307+ INIT_LIST_HEAD(&removed);
33053308 spin_lock_irqsave(&hbus->device_list_lock, flags);
3306− list_for_each_entry_safe(hpdev, tmp, &hbus->children, list_entry) {
3309+ list_for_each_entry_safe(hpdev, tmp, &hbus->children, list_entry)
3310+ list_move_tail(&hpdev->list_entry, &removed);
3311+ spin_unlock_irqrestore(&hbus->device_list_lock, flags);
3312+
3313+ /* Remove all children in the list */
3314+ list_for_each_entry_safe(hpdev, tmp, &removed, list_entry) {
33073315 list_del(&hpdev->list_entry);
33083316 if (hpdev->pci_slot)
33093317 pci_destroy_slot(hpdev->pci_slot);
@@ -3311,7 +3319,6 @@ static int hv_pci_bus_exit(struct hv_device *hdev, bool keep_devs) · 1 unmodified line
33113319 put_pcichild(hpdev);
33123320 put_pcichild(hpdev);
33133321 }
3314− spin_unlock_irqrestore(&hbus->device_list_lock, flags);
33153322 }
33163323
33173324 ret = hv_send_resources_released(hdev);
drivers/ptp/ptp_kvm_x86.c+2−7
@@ -15,8 +15,6 @@ · 14 unmodified lines
1515 #include <linux/ptp_clock_kernel.h>
1616 #include <linux/ptp_kvm.h>
1717
18−struct pvclock_vsyscall_time_info *hv_clock;
19−
2018 static phys_addr_t clock_pair_gpa;
2119 static struct kvm_clock_pairing clock_pair;
2220
@@ -28,8 +26,7 @@ int kvm_arch_ptp_init(void) · 5 unmodified lines
2826 return -ENODEV;
2927
3028 clock_pair_gpa = slow_virt_to_phys(&clock_pair);
31− hv_clock = pvclock_get_pvti_cpu0_va();
32− if (!hv_clock)
29+ if (!pvclock_get_pvti_cpu0_va())
3330 return -ENODEV;
3431
3532 ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, clock_pair_gpa,
@@ -64,10 +61,8 @@ int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *tspec, · 28 unmodified lines
6461 struct pvclock_vcpu_time_info *src;
6562 unsigned int version;
6663 long ret;
67− int cpu;
6864
69− cpu = smp_processor_id();
70− src = &hv_clock[cpu].pvti;
65+ src = this_cpu_pvti();
7166
7267 do {
7368 /*
drivers/ptp/ptp_pch.c+1−0
@@ -644,6 +644,7 @@ static const struct pci_device_id pch_ieee1588_pcidev_id[] = { · 643 unmodified lines
644644 },
645645 {0}
646646 };
647+MODULE_DEVICE_TABLE(pci, pch_ieee1588_pcidev_id);
647648
648649 static SIMPLE_DEV_PM_OPS(pch_pm_ops, pch_suspend, pch_resume);
649650
drivers/s390/cio/blacklist.c+5−3
@@ -262,10 +262,12 @@ static int blacklist_parse_proc_parameters(char *buf) · 261 unmodified lines
262262
263263 if (strcmp("free", parm) == 0) {
264264 rc = blacklist_parse_parameters(buf, free, 0);
265− /* There could be subchannels without proper devices connected.
266− * evaluate all the entries
265+ /*
266+ * Evaluate the subchannels without an online device. This way,
267+ * no path-verification will be triggered on those subchannels
268+ * and it avoids unnecessary delays.
267269 */
268− css_schedule_eval_all();
270+ css_schedule_eval_cond(CSS_EVAL_NOT_ONLINE, 0);
269271 } else if (strcmp("add", parm) == 0)
270272 rc = blacklist_parse_parameters(buf, add, 0);
271273 else if (strcmp("purge", parm) == 0)
drivers/s390/cio/css.c+31−9
@@ -788,27 +788,49 @@ static int __unset_registered(struct device *dev, void *data) · 787 unmodified lines
788788 return 0;
789789 }
790790
791−void css_schedule_eval_all_unreg(unsigned long delay)
791+static int __unset_online(struct device *dev, void *data)
792+{
793+ struct idset *set = data;
794+ struct subchannel *sch = to_subchannel(dev);
795+ struct ccw_device *cdev = sch_get_cdev(sch);
796+
797+ if (cdev && cdev->online)
798+ idset_sch_del(set, sch->schid);
799+
800+ return 0;
801+}
802+
803+void css_schedule_eval_cond(enum css_eval_cond cond, unsigned long delay)
792804 {
793805 unsigned long flags;
794− struct idset *unreg_set;
806+ struct idset *set;
795807
796808 /* Find unregistered subchannels. */
797− unreg_set = idset_sch_new();
798− if (!unreg_set) {
809+ set = idset_sch_new();
810+ if (!set) {
799811 /* Fallback. */
800812 css_schedule_eval_all();
801813 return;
802814 }
803− idset_fill(unreg_set);
804− bus_for_each_dev(&css_bus_type, NULL, unreg_set, __unset_registered);
815+ idset_fill(set);
816+ switch (cond) {
817+ case CSS_EVAL_UNREG:
818+ bus_for_each_dev(&css_bus_type, NULL, set, __unset_registered);
819+ break;
820+ case CSS_EVAL_NOT_ONLINE:
821+ bus_for_each_dev(&css_bus_type, NULL, set, __unset_online);
822+ break;
823+ default:
824+ break;
825+ }
826+
805827 /* Apply to slow_subchannel_set. */
806828 spin_lock_irqsave(&slow_subchannel_lock, flags);
807− idset_add_set(slow_subchannel_set, unreg_set);
829+ idset_add_set(slow_subchannel_set, set);
808830 atomic_set(&css_eval_scheduled, 1);
809831 queue_delayed_work(cio_work_q, &slow_path_work, delay);
810832 spin_unlock_irqrestore(&slow_subchannel_lock, flags);
811− idset_free(unreg_set);
833+ idset_free(set);
812834 }
813835
814836 void css_wait_for_slow_path(void)
@@ -820,7 +842,7 @@ void css_wait_for_slow_path(void) · 5 unmodified lines
820842 void css_schedule_reprobe(void)
821843 {
822844 /* Schedule with a delay to allow merging of subsequent calls. */
823− css_schedule_eval_all_unreg(1 * HZ);
845+ css_schedule_eval_cond(CSS_EVAL_UNREG, 1 * HZ);
824846 }
825847 EXPORT_SYMBOL_GPL(css_schedule_reprobe);
826848
drivers/s390/cio/css.h+9−1
@@ -34,6 +34,14 @@ · 33 unmodified lines
3434 #define SNID_STATE3_MULTI_PATH 1
3535 #define SNID_STATE3_SINGLE_PATH 0
3636
37+/*
38+ * Conditions used to specify which subchannels need evaluation
39+ */
40+enum css_eval_cond {
41+ CSS_EVAL_UNREG, /* unregistered subchannels */
42+ CSS_EVAL_NOT_ONLINE /* sch without an online-device */
43+};
44+
3745 struct path_state {
3846 __u8 state1 : 2; /* path state value 1 */
3947 __u8 state2 : 2; /* path state value 2 */
@@ -136,7 +144,7 @@ static inline struct channel_subsystem *css_by_id(u8 cssid) · 96 unmodified lines
136144 /* Helper functions to build lists for the slow path. */
137145 void css_schedule_eval(struct subchannel_id schid);
138146 void css_schedule_eval_all(void);
139−void css_schedule_eval_all_unreg(unsigned long delay);
147+void css_schedule_eval_cond(enum css_eval_cond, unsigned long delay);
140148 int css_complete_work(void);
141149
142150 int sch_is_pseudo_sch(struct subchannel *);
drivers/scsi/csiostor/csio_init.c+1−0
@@ -1254,3 +1254,4 @@ MODULE_DEVICE_TABLE(pci, csio_pci_tbl); · 1253 unmodified lines
12541254 MODULE_VERSION(CSIO_DRV_VERSION);
12551255 MODULE_FIRMWARE(FW_FNAME_T5);
12561256 MODULE_FIRMWARE(FW_FNAME_T6);
1257+MODULE_SOFTDEP("pre: cxgb4");
drivers/scsi/qla2xxx/qla_isr.c+2−2
@@ -2634,7 +2634,7 @@ static void qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, · 2633 unmodified lines
26342634 }
26352635
26362636 if (unlikely(logit))
2637− ql_log(ql_log_warn, fcport->vha, 0x5060,
2637+ ql_log(ql_dbg_io, fcport->vha, 0x5060,
26382638 "NVME-%s ERR Handling - hdl=%x status(%x) tr_len:%x resid=%x ox_id=%x\n",
26392639 sp->name, sp->handle, comp_status,
26402640 fd->transferred_length, le32_to_cpu(sts->residual_len),
@@ -3491,7 +3491,7 @@ check_scsi_status: · 850 unmodified lines
34913491
34923492 out:
34933493 if (logit)
3494− ql_log(ql_log_warn, fcport->vha, 0x3022,
3494+ ql_log(ql_dbg_io, fcport->vha, 0x3022,
34953495 "FCP command status: 0x%x-0x%x (0x%x) nexus=%ld:%d:%llu portid=%02x%02x%02x oxid=0x%x cdb=%10phN len=0x%x rsp_info=0x%x resid=0x%x fw_resid=0x%x sp=%p cp=%p.\n",
34963496 comp_status, scsi_status, res, vha->host_no,
34973497 cp->device->id, cp->device->lun, fcport->d_id.b.domain,
drivers/scsi/ses.c+1−1
@@ -118,7 +118,7 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code, · 117 unmodified lines
118118 static int ses_send_diag(struct scsi_device *sdev, int page_code,
119119 void *buf, int bufflen)
120120 {
121− u32 result;
121+ int result;
122122
123123 unsigned char cmd[] = {
124124 SEND_DIAGNOSTIC,
drivers/scsi/ufs/ufshcd.c+1−2
@@ -318,8 +318,7 @@ static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba, · 317 unmodified lines
318318 static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int tag,
319319 enum ufs_trace_str_t str_t)
320320 {
321− int off = (int)tag - hba->nutrs;
322− struct utp_task_req_desc *descp = &hba->utmrdl_base_addr[off];
321+ struct utp_task_req_desc *descp = &hba->utmrdl_base_addr[tag];
323322
324323 if (!trace_ufshcd_upiu_enabled())
325324 return;
drivers/scsi/virtio_scsi.c+2−2
@@ -300,7 +300,7 @@ static void virtscsi_handle_transport_reset(struct virtio_scsi *vscsi, · 299 unmodified lines
300300 }
301301 break;
302302 default:
303− pr_info("Unsupport virtio scsi event reason %x\n", event->reason);
303+ pr_info("Unsupported virtio scsi event reason %x\n", event->reason);
304304 }
305305 }
306306
@@ -392,7 +392,7 @@ static void virtscsi_handle_event(struct work_struct *work) · 85 unmodified lines
392392 virtscsi_handle_param_change(vscsi, event);
393393 break;
394394 default:
395− pr_err("Unsupport virtio scsi event %x\n", event->event);
395+ pr_err("Unsupported virtio scsi event %x\n", event->event);
396396 }
397397 virtscsi_kick_event(vscsi, event_node);
398398 }
drivers/soc/qcom/mdt_loader.c+1−1
@@ -98,7 +98,7 @@ void *qcom_mdt_read_metadata(const struct firmware *fw, size_t *data_len) · 97 unmodified lines
9898 if (ehdr->e_phnum < 2)
9999 return ERR_PTR(-EINVAL);
100100
101− if (phdrs[0].p_type == PT_LOAD || phdrs[1].p_type == PT_LOAD)
101+ if (phdrs[0].p_type == PT_LOAD)
102102 return ERR_PTR(-EINVAL);
103103
104104 if ((phdrs[1].p_flags & QCOM_MDT_TYPE_MASK) != QCOM_MDT_TYPE_HASH)
drivers/soc/qcom/socinfo.c+1−1
@@ -628,7 +628,7 @@ static int qcom_socinfo_probe(struct platform_device *pdev) · 627 unmodified lines
628628 /* Feed the soc specific unique data into entropy pool */
629629 add_device_randomness(info, item_size);
630630
631− platform_set_drvdata(pdev, qs->soc_dev);
631+ platform_set_drvdata(pdev, qs);
632632
633633 return 0;
634634 }
drivers/soc/ti/omap_prm.c+15−12
@@ -825,25 +825,28 @@ static int omap_reset_deassert(struct reset_controller_dev *rcdev, · 824 unmodified lines
825825 writel_relaxed(v, reset->prm->base + reset->prm->data->rstctrl);
826826 spin_unlock_irqrestore(&reset->lock, flags);
827827
828− if (!has_rstst)
829− goto exit;
828+ /* wait for the reset bit to clear */
829+ ret = readl_relaxed_poll_timeout_atomic(reset->prm->base +
830+ reset->prm->data->rstctrl,
831+ v, !(v & BIT(id)), 1,
832+ OMAP_RESET_MAX_WAIT);
833+ if (ret)
834+ pr_err("%s: timedout waiting for %s:%lu\n", __func__,
835+ reset->prm->data->name, id);
830836
831837 /* wait for the status to be set */
832− ret = readl_relaxed_poll_timeout_atomic(reset->prm->base +
838+ if (has_rstst) {
839+ ret = readl_relaxed_poll_timeout_atomic(reset->prm->base +
833840 reset->prm->data->rstst,
834841 v, v & BIT(st_bit), 1,
835842 OMAP_RESET_MAX_WAIT);
836− if (ret)
837− pr_err("%s: timedout waiting for %s:%lu\n", __func__,
838− reset->prm->data->name, id);
843+ if (ret)
844+ pr_err("%s: timedout waiting for %s:%lu\n", __func__,
845+ reset->prm->data->name, id);
846+ }
839847
840−exit:
841− if (reset->clkdm) {
842− /* At least dra7 iva needs a delay before clkdm idle */
843− if (has_rstst)
844− udelay(1);
848+ if (reset->clkdm)
845849 pdata->clkdm_allow_idle(reset->clkdm);
846− }
847850
848851 return ret;
849852 }
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c+2−0
@@ -1646,6 +1646,8 @@ static input_system_err_t input_system_configure_channel_sensor( · 1645 unmodified lines
16461646 default:
16471647 return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
16481648 }
1649+
1650+ return INPUT_SYSTEM_ERR_NO_ERROR;
16491651 }
16501652
16511653 // Test flags and set structure.
drivers/tee/optee/shm_pool.c+1−1
@@ -35,7 +35,7 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, · 34 unmodified lines
3535 unsigned int nr_pages = 1 << order, i;
3636 struct page **pages;
3737
38− pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL);
38+ pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL);
3939 if (!pages) {
4040 rc = -ENOMEM;
4141 goto err;
drivers/usb/host/ohci-omap.c+2−70
@@ -40,17 +40,6 @@ · 39 unmodified lines
4040 #include <mach/usb.h>
4141
4242
43−/* OMAP-1510 OHCI has its own MMU for DMA */
44−#define OMAP1510_LB_MEMSIZE 32 /* Should be same as SDRAM size */
45−#define OMAP1510_LB_CLOCK_DIV 0xfffec10c
46−#define OMAP1510_LB_MMU_CTL 0xfffec208
47−#define OMAP1510_LB_MMU_LCK 0xfffec224
48−#define OMAP1510_LB_MMU_LD_TLB 0xfffec228
49−#define OMAP1510_LB_MMU_CAM_H 0xfffec22c
50−#define OMAP1510_LB_MMU_CAM_L 0xfffec230
51−#define OMAP1510_LB_MMU_RAM_H 0xfffec234
52−#define OMAP1510_LB_MMU_RAM_L 0xfffec238
53−
5443 #define DRIVER_DESC "OHCI OMAP driver"
5544
5645 struct ohci_omap_priv {
@@ -104,61 +93,6 @@ static int omap_ohci_transceiver_power(struct ohci_omap_priv *priv, int on) · 47 unmodified lines
10493 return 0;
10594 }
10695
107−#ifdef CONFIG_ARCH_OMAP15XX
108−/*
109− * OMAP-1510 specific Local Bus clock on/off
110− */
111−static int omap_1510_local_bus_power(int on)
112−{
113− if (on) {
114− omap_writel((1 << 1) | (1 << 0), OMAP1510_LB_MMU_CTL);
115− udelay(200);
116− } else {
117− omap_writel(0, OMAP1510_LB_MMU_CTL);
118− }
119−
120− return 0;
121−}
122−
123−/*
124− * OMAP-1510 specific Local Bus initialization
125− * NOTE: This assumes 32MB memory size in OMAP1510LB_MEMSIZE.
126− * See also arch/mach-omap/memory.h for __virt_to_dma() and
127− * __dma_to_virt() which need to match with the physical
128− * Local Bus address below.
129− */
130−static int omap_1510_local_bus_init(void)
131−{
132− unsigned int tlb;
133− unsigned long lbaddr, physaddr;
134−
135− omap_writel((omap_readl(OMAP1510_LB_CLOCK_DIV) & 0xfffffff8) | 0x4,
136− OMAP1510_LB_CLOCK_DIV);
137−
138− /* Configure the Local Bus MMU table */
139− for (tlb = 0; tlb < OMAP1510_LB_MEMSIZE; tlb++) {
140− lbaddr = tlb * 0x00100000 + OMAP1510_LB_OFFSET;
141− physaddr = tlb * 0x00100000 + PHYS_OFFSET;
142− omap_writel((lbaddr & 0x0fffffff) >> 22, OMAP1510_LB_MMU_CAM_H);
143− omap_writel(((lbaddr & 0x003ffc00) >> 6) | 0xc,
144− OMAP1510_LB_MMU_CAM_L);
145− omap_writel(physaddr >> 16, OMAP1510_LB_MMU_RAM_H);
146− omap_writel((physaddr & 0x0000fc00) | 0x300, OMAP1510_LB_MMU_RAM_L);
147− omap_writel(tlb << 4, OMAP1510_LB_MMU_LCK);
148− omap_writel(0x1, OMAP1510_LB_MMU_LD_TLB);
149− }
150−
151− /* Enable the walking table */
152− omap_writel(omap_readl(OMAP1510_LB_MMU_CTL) | (1 << 3), OMAP1510_LB_MMU_CTL);
153− udelay(200);
154−
155− return 0;
156−}
157−#else
158−#define omap_1510_local_bus_power(x) {}
159−#define omap_1510_local_bus_init() {}
160−#endif
161−
16296 #ifdef CONFIG_USB_OTG
16397
16498 static void start_hnp(struct ohci_hcd *ohci)
@@ -229,10 +163,8 @@ static int ohci_omap_reset(struct usb_hcd *hcd) · 64 unmodified lines
229163
230164 omap_ohci_clock_power(priv, 1);
231165
232− if (cpu_is_omap15xx()) {
233− omap_1510_local_bus_power(1);
234− omap_1510_local_bus_init();
235− }
166+ if (config->lb_reset)
167+ config->lb_reset();
236168
237169 ret = ohci_setup(hcd);
238170 if (ret < 0)
fs/9p/cache.c+4−4
@@ -23,7 +23,7 @@ struct fscache_netfs v9fs_cache_netfs = { · 22 unmodified lines
2323 .version = 0,
2424 };
2525
26−/**
26+/*
2727 * v9fs_random_cachetag - Generate a random tag to be associated
2828 * with a new cache session.
2929 *
@@ -233,7 +233,7 @@ static void v9fs_vfs_readpage_complete(struct page *page, void *data, · 203 unmodified lines
233233 unlock_page(page);
234234 }
235235
236−/**
236+/*
237237 * __v9fs_readpage_from_fscache - read a page from cache
238238 *
239239 * Returns 0 if the pages are in cache and a BIO is submitted,
@@ -268,7 +268,7 @@ int __v9fs_readpage_from_fscache(struct inode *inode, struct page *page) · 28 unmodified lines
268268 }
269269 }
270270
271−/**
271+/*
272272 * __v9fs_readpages_from_fscache - read multiple pages from cache
273273 *
274274 * Returns 0 if the pages are in cache and a BIO is submitted,
@@ -308,7 +308,7 @@ int __v9fs_readpages_from_fscache(struct inode *inode, · 33 unmodified lines
308308 }
309309 }
310310
311−/**
311+/*
312312 * __v9fs_readpage_to_fscache - write a page to the cache
313313 *
314314 */
fs/9p/fid.c+7−7
@@ -19,18 +19,18 @@ · 18 unmodified lines
1919 #include "v9fs_vfs.h"
2020 #include "fid.h"
2121
22+static inline void __add_fid(struct dentry *dentry, struct p9_fid *fid)
23+{
24+ hlist_add_head(&fid->dlist, (struct hlist_head *)&dentry->d_fsdata);
25+}
26+
27+
2228 /**
2329 * v9fs_fid_add - add a fid to a dentry
2430 * @dentry: dentry that the fid is being added to
2531 * @fid: fid to add
2632 *
2733 */
28−
29−static inline void __add_fid(struct dentry *dentry, struct p9_fid *fid)
30−{
31− hlist_add_head(&fid->dlist, (struct hlist_head *)&dentry->d_fsdata);
32−}
33−
3434 void v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
3535 {
3636 spin_lock(&dentry->d_lock);
@@ -67,7 +67,7 @@ static struct p9_fid *v9fs_fid_find_inode(struct inode *inode, kuid_t uid) · 30 unmodified lines
6767
6868 /**
6969 * v9fs_open_fid_add - add an open fid to an inode
70− * @dentry: inode that the fid is being added to
70+ * @inode: inode that the fid is being added to
7171 * @fid: fid to add
7272 *
7373 */
fs/9p/v9fs.c+3−5
@@ -155,6 +155,7 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root) · 154 unmodified lines
155155 /**
156156 * v9fs_parse_options - parse mount options into session structure
157157 * @v9ses: existing v9fs session information
158+ * @opts: The mount option string
158159 *
159160 * Return 0 upon success, -ERRNO upon failure.
160161 */
@@ -542,12 +543,9 @@ extern int v9fs_error_init(void); · 381 unmodified lines
542543 static struct kobject *v9fs_kobj;
543544
544545 #ifdef CONFIG_9P_FSCACHE
545−/**
546− * caches_show - list caches associated with a session
547− *
548− * Returns the size of buffer written.
546+/*
547+ * List caches associated with a session
549548 */
550−
551549 static ssize_t caches_show(struct kobject *kobj,
552550 struct kobj_attribute *attr,
553551 char *buf)
fs/9p/vfs_addr.c+9−5
@@ -30,8 +30,7 @@ · 29 unmodified lines
3030
3131 /**
3232 * v9fs_fid_readpage - read an entire page in from 9P
33− *
34− * @fid: fid being read
33+ * @data: Opaque pointer to the fid being read
3534 * @page: structure to page
3635 *
3736 */
@@ -116,6 +115,8 @@ static int v9fs_vfs_readpages(struct file *filp, struct address_space *mapping, · 78 unmodified lines
116115
117116 /**
118117 * v9fs_release_page - release the private state associated with a page
118+ * @page: The page to be released
119+ * @gfp: The caller's allocation restrictions
119120 *
120121 * Returns 1 if the page can be released, false otherwise.
121122 */
@@ -129,9 +130,9 @@ static int v9fs_release_page(struct page *page, gfp_t gfp) · 7 unmodified lines
129130
130131 /**
131132 * v9fs_invalidate_page - Invalidate a page completely or partially
132− *
133− * @page: structure to page
134− * @offset: offset in the page
133+ * @page: The page to be invalidated
134+ * @offset: offset of the invalidated region
135+ * @length: length of the invalidated region
135136 */
136137
137138 static void v9fs_invalidate_page(struct page *page, unsigned int offset,
@@ -199,6 +200,8 @@ static int v9fs_vfs_writepage(struct page *page, struct writeback_control *wbc) · 61 unmodified lines
199200
200201 /**
201202 * v9fs_launder_page - Writeback a dirty page
203+ * @page: The page to be cleaned up
204+ *
202205 * Returns 0 on success.
203206 */
204207
@@ -219,6 +222,7 @@ static int v9fs_launder_page(struct page *page) · 14 unmodified lines
219222 /**
220223 * v9fs_direct_IO - 9P address space operation for direct I/O
221224 * @iocb: target I/O control block
225+ * @iter: The data/buffer to use
222226 *
223227 * The presence of v9fs_direct_IO() in the address space ops vector
224228 * allowes open() O_DIRECT flags which would have failed otherwise.
fs/9p/vfs_file.c+12−21
@@ -359,14 +359,11 @@ out_err: · 358 unmodified lines
359359 }
360360
361361 /**
362− * v9fs_file_read - read from a file
363− * @filp: file pointer to read
364− * @udata: user data buffer to read data into
365− * @count: size of buffer
366− * @offset: offset at which to read data
362+ * v9fs_file_read_iter - read from a file
363+ * @iocb: The operation parameters
364+ * @to: The buffer to read into
367365 *
368366 */
369−
370367 static ssize_t
371368 v9fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
372369 {
@@ -388,11 +385,9 @@ v9fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) · 15 unmodified lines
388385 }
389386
390387 /**
391− * v9fs_file_write - write to a file
392− * @filp: file pointer to write
393− * @data: data buffer to write data from
394− * @count: size of buffer
395− * @offset: offset at which to write data
388+ * v9fs_file_write_iter - write to a file
389+ * @iocb: The operation parameters
390+ * @from: The data to write
396391 *
397392 */
398393 static ssize_t
@@ -561,11 +556,9 @@ out_unlock: · 162 unmodified lines
561556 }
562557
563558 /**
564− * v9fs_mmap_file_read - read from a file
565− * @filp: file pointer to read
566− * @data: user data buffer to read data into
567− * @count: size of buffer
568− * @offset: offset at which to read data
559+ * v9fs_mmap_file_read_iter - read from a file
560+ * @iocb: The operation parameters
561+ * @to: The buffer to read into
569562 *
570563 */
571564 static ssize_t
@@ -576,11 +569,9 @@ v9fs_mmap_file_read_iter(struct kiocb *iocb, struct iov_iter *to) · 4 unmodified lines
576569 }
577570
578571 /**
579− * v9fs_mmap_file_write - write to a file
580− * @filp: file pointer to write
581− * @data: data buffer to write data from
582− * @count: size of buffer
583− * @offset: offset at which to write data
572+ * v9fs_mmap_file_write_iter - write to a file
573+ * @iocb: The operation parameters
574+ * @from: The data to write
584575 *
585576 */
586577 static ssize_t
fs/9p/vfs_inode.c+16−8
@@ -218,7 +218,7 @@ v9fs_blank_wstat(struct p9_wstat *wstat) · 217 unmodified lines
218218
219219 /**
220220 * v9fs_alloc_inode - helper function to allocate an inode
221− *
221+ * @sb: The superblock to allocate the inode from
222222 */
223223 struct inode *v9fs_alloc_inode(struct super_block *sb)
224224 {
@@ -238,7 +238,7 @@ struct inode *v9fs_alloc_inode(struct super_block *sb) · 13 unmodified lines
238238
239239 /**
240240 * v9fs_free_inode - destroy an inode
241− *
241+ * @inode: The inode to be freed
242242 */
243243
244244 void v9fs_free_inode(struct inode *inode)
@@ -343,7 +343,7 @@ error: · 98 unmodified lines
343343 * v9fs_get_inode - helper function to setup an inode
344344 * @sb: superblock
345345 * @mode: mode to setup inode with
346− *
346+ * @rdev: The device numbers to set
347347 */
348348
349349 struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t rdev)
@@ -369,7 +369,7 @@ struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t rdev) · 19 unmodified lines
369369 }
370370
371371 /**
372− * v9fs_clear_inode - release an inode
372+ * v9fs_evict_inode - Remove an inode from the inode cache
373373 * @inode: inode to release
374374 *
375375 */
@@ -665,14 +665,15 @@ error: · 289 unmodified lines
665665
666666 /**
667667 * v9fs_vfs_create - VFS hook to create a regular file
668+ * @mnt_userns: The user namespace of the mount
669+ * @dir: The parent directory
670+ * @dentry: The name of file to be created
671+ * @mode: The UNIX file mode to set
672+ * @excl: True if the file must not yet exist
668673 *
669674 * open(.., O_CREAT) is handled in v9fs_vfs_atomic_open(). This is only called
670675 * for mknod(2).
671676 *
672− * @dir: directory inode that is being created
673− * @dentry: dentry that is being deleted
674− * @mode: create permissions
675− *
676677 */
677678
678679 static int
@@ -696,6 +697,7 @@ v9fs_vfs_create(struct user_namespace *mnt_userns, struct inode *dir, · 17 unmodified lines
696697
697698 /**
698699 * v9fs_vfs_mkdir - VFS mkdir hook to create a directory
700+ * @mnt_userns: The user namespace of the mount
699701 * @dir: inode that is being unlinked
700702 * @dentry: dentry that is being unlinked
701703 * @mode: mode for new directory
@@ -900,10 +902,12 @@ int v9fs_vfs_rmdir(struct inode *i, struct dentry *d) · 198 unmodified lines
900902
901903 /**
902904 * v9fs_vfs_rename - VFS hook to rename an inode
905+ * @mnt_userns: The user namespace of the mount
903906 * @old_dir: old dir inode
904907 * @old_dentry: old dentry
905908 * @new_dir: new dir inode
906909 * @new_dentry: new dentry
910+ * @flags: RENAME_* flags
907911 *
908912 */
909913
@@ -1009,6 +1013,7 @@ done: · 99 unmodified lines
10091013
10101014 /**
10111015 * v9fs_vfs_getattr - retrieve file metadata
1016+ * @mnt_userns: The user namespace of the mount
10121017 * @path: Object to query
10131018 * @stat: metadata structure to populate
10141019 * @request_mask: Mask of STATX_xxx flags indicating the caller's interests
@@ -1050,6 +1055,7 @@ v9fs_vfs_getattr(struct user_namespace *mnt_userns, const struct path *path, · 35 unmodified lines
10501055
10511056 /**
10521057 * v9fs_vfs_setattr - set file metadata
1058+ * @mnt_userns: The user namespace of the mount
10531059 * @dentry: file whose metadata to set
10541060 * @iattr: metadata assignment structure
10551061 *
@@ -1285,6 +1291,7 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry, · 229 unmodified lines
12851291
12861292 /**
12871293 * v9fs_vfs_symlink - helper function to create symlinks
1294+ * @mnt_userns: The user namespace of the mount
12881295 * @dir: directory inode containing symlink
12891296 * @dentry: dentry for symlink
12901297 * @symname: symlink data
@@ -1340,6 +1347,7 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir, · 49 unmodified lines
13401347
13411348 /**
13421349 * v9fs_vfs_mknod - create a special file
1350+ * @mnt_userns: The user namespace of the mount
13431351 * @dir: inode destination for new link
13441352 * @dentry: dentry for file
13451353 * @mode: mode for creation
fs/9p/vfs_inode_dotl.c+9−2
@@ -37,7 +37,10 @@ v9fs_vfs_mknod_dotl(struct user_namespace *mnt_userns, struct inode *dir, · 36 unmodified lines
3737 struct dentry *dentry, umode_t omode, dev_t rdev);
3838
3939 /**
40− * v9fs_get_fsgid_for_create - Helper function to get the gid for creating a
40+ * v9fs_get_fsgid_for_create - Helper function to get the gid for a new object
41+ * @dir_inode: The directory inode
42+ *
43+ * Helper function to get the gid for creating a
4144 * new file system object. This checks the S_ISGID to determine the owning
4245 * group of the new file system object.
4346 */
@@ -211,12 +214,13 @@ int v9fs_open_to_dotl_flags(int flags) · 167 unmodified lines
211214
212215 /**
213216 * v9fs_vfs_create_dotl - VFS hook to create files for 9P2000.L protocol.
217+ * @mnt_userns: The user namespace of the mount
214218 * @dir: directory inode that is being created
215219 * @dentry: dentry that is being deleted
216220 * @omode: create permissions
221+ * @excl: True if the file must not yet exist
217222 *
218223 */
219−
220224 static int
221225 v9fs_vfs_create_dotl(struct user_namespace *mnt_userns, struct inode *dir,
222226 struct dentry *dentry, umode_t omode, bool excl)
@@ -361,6 +365,7 @@ err_clunk_old_fid: · 138 unmodified lines
361365
362366 /**
363367 * v9fs_vfs_mkdir_dotl - VFS mkdir hook to create a directory
368+ * @mnt_userns: The user namespace of the mount
364369 * @dir: inode that is being unlinked
365370 * @dentry: dentry that is being unlinked
366371 * @omode: mode for new directory
@@ -537,6 +542,7 @@ static int v9fs_mapped_iattr_valid(int iattr_valid) · 170 unmodified lines
537542
538543 /**
539544 * v9fs_vfs_setattr_dotl - set file metadata
545+ * @mnt_userns: The user namespace of the mount
540546 * @dentry: file whose metadata to set
541547 * @iattr: metadata assignment structure
542548 *
@@ -816,6 +822,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir, · 273 unmodified lines
816822
817823 /**
818824 * v9fs_vfs_mknod_dotl - create a special file
825+ * @mnt_userns: The user namespace of the mount
819826 * @dir: inode destination for new link
820827 * @dentry: dentry for file
821828 * @omode: mode for creation
fs/afs/dir_silly.c+2−2
@@ -86,8 +86,8 @@ static int afs_do_silly_rename(struct afs_vnode *dvnode, struct afs_vnode *vnode · 85 unmodified lines
8686 return afs_do_sync_operation(op);
8787 }
8888
89−/**
90− * afs_sillyrename - Perform a silly-rename of a dentry
89+/*
90+ * Perform silly-rename of a dentry.
9191 *
9292 * AFS is stateless and the server doesn't know when the client is holding a
9393 * file open. To prevent application problems when a file is unlinked while
fs/afs/write.c+1−2
@@ -974,8 +974,7 @@ int afs_launder_page(struct page *page) · 973 unmodified lines
974974 iov_iter_bvec(&iter, WRITE, bv, 1, bv[0].bv_len);
975975
976976 trace_afs_page_dirty(vnode, tracepoint_string("launder"), page);
977− ret = afs_store_data(vnode, &iter, (loff_t)page->index * PAGE_SIZE,
978− true);
977+ ret = afs_store_data(vnode, &iter, page_offset(page) + f, true);
979978 }
980979
981980 trace_afs_page_dirty(vnode, tracepoint_string("laundered"), page);
fs/binfmt_elf.c+1−1
@@ -630,7 +630,7 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex, · 629 unmodified lines
630630
631631 vaddr = eppnt->p_vaddr;
632632 if (interp_elf_ex->e_type == ET_EXEC || load_addr_set)
633− elf_type |= MAP_FIXED_NOREPLACE;
633+ elf_type |= MAP_FIXED;
634634 else if (no_base && interp_elf_ex->e_type == ET_DYN)
635635 load_addr = -vaddr;
636636
fs/debugfs/inode.c+1−1
@@ -528,7 +528,7 @@ void debugfs_create_file_size(const char *name, umode_t mode, · 527 unmodified lines
528528 {
529529 struct dentry *de = debugfs_create_file(name, mode, parent, data, fops);
530530
531− if (de)
531+ if (!IS_ERR(de))
532532 d_inode(de)->i_size = file_size;
533533 }
534534 EXPORT_SYMBOL_GPL(debugfs_create_file_size);
fs/ext4/dir.c+3−3
@@ -551,7 +551,7 @@ static int ext4_dx_readdir(struct file *file, struct dir_context *ctx) · 550 unmodified lines
551551 struct dir_private_info *info = file->private_data;
552552 struct inode *inode = file_inode(file);
553553 struct fname *fname;
554− int ret;
554+ int ret = 0;
555555
556556 if (!info) {
557557 info = ext4_htree_create_dir_info(file, ctx->pos);
@@ -599,7 +599,7 @@ static int ext4_dx_readdir(struct file *file, struct dir_context *ctx) · 41 unmodified lines
599599 info->curr_minor_hash,
600600 &info->next_hash);
601601 if (ret < 0)
602− return ret;
602+ goto finished;
603603 if (ret == 0) {
604604 ctx->pos = ext4_get_htree_eof(file);
605605 break;
@@ -630,7 +630,7 @@ static int ext4_dx_readdir(struct file *file, struct dir_context *ctx) · 24 unmodified lines
630630 }
631631 finished:
632632 info->last_pos = ctx->pos;
633− return 0;
633+ return ret < 0 ? ret : 0;
634634 }
635635
636636 static int ext4_release_dir(struct inode *inode, struct file *filp)
fs/ext4/ext4.h+0−3
@@ -3593,9 +3593,6 @@ extern int ext4_da_write_inline_data_begin(struct address_space *mapping, · 3592 unmodified lines
35933593 unsigned flags,
35943594 struct page **pagep,
35953595 void **fsdata);
3596−extern int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos,
3597− unsigned len, unsigned copied,
3598− struct page *page);
35993596 extern int ext4_try_add_inline_entry(handle_t *handle,
36003597 struct ext4_filename *fname,
36013598 struct inode *dir, struct inode *inode);
fs/ext4/extents.c+14−5
@@ -5916,7 +5916,7 @@ void ext4_ext_replay_shrink_inode(struct inode *inode, ext4_lblk_t end) · 5915 unmodified lines
59165916 }
59175917
59185918 /* Check if *cur is a hole and if it is, skip it */
5919−static void skip_hole(struct inode *inode, ext4_lblk_t *cur)
5919+static int skip_hole(struct inode *inode, ext4_lblk_t *cur)
59205920 {
59215921 int ret;
59225922 struct ext4_map_blocks map;
@@ -5925,9 +5925,12 @@ static void skip_hole(struct inode *inode, ext4_lblk_t *cur) · 2 unmodified lines
59255925 map.m_len = ((inode->i_size) >> inode->i_sb->s_blocksize_bits) - *cur;
59265926
59275927 ret = ext4_map_blocks(NULL, inode, &map, 0);
5928+ if (ret < 0)
5929+ return ret;
59285930 if (ret != 0)
5929− return;
5931+ return 0;
59305932 *cur = *cur + map.m_len;
5933+ return 0;
59315934 }
59325935
59335936 /* Count number of blocks used by this inode and update i_blocks */
@@ -5976,7 +5979,9 @@ int ext4_ext_replay_set_iblocks(struct inode *inode) · 42 unmodified lines
59765979 * iblocks by total number of differences found.
59775980 */
59785981 cur = 0;
5979− skip_hole(inode, &cur);
5982+ ret = skip_hole(inode, &cur);
5983+ if (ret < 0)
5984+ goto out;
59805985 path = ext4_find_extent(inode, cur, NULL, 0);
59815986 if (IS_ERR(path))
59825987 goto out;
@@ -5995,8 +6000,12 @@ int ext4_ext_replay_set_iblocks(struct inode *inode) · 12 unmodified lines
59956000 }
59966001 cur = max(cur + 1, le32_to_cpu(ex->ee_block) +
59976002 ext4_ext_get_actual_len(ex));
5998− skip_hole(inode, &cur);
5999−
6003+ ret = skip_hole(inode, &cur);
6004+ if (ret < 0) {
6005+ ext4_ext_drop_refs(path);
6006+ kfree(path);
6007+ break;
6008+ }
60006009 path2 = ext4_find_extent(inode, cur, NULL, 0);
60016010 if (IS_ERR(path2)) {
60026011 ext4_ext_drop_refs(path);
fs/ext4/fast_commit.c+6−0
@@ -892,6 +892,12 @@ static int ext4_fc_write_inode_data(struct inode *inode, u32 *crc) · 891 unmodified lines
892892 sizeof(lrange), (u8 *)&lrange, crc))
893893 return -ENOSPC;
894894 } else {
895+ unsigned int max = (map.m_flags & EXT4_MAP_UNWRITTEN) ?
896+ EXT_UNWRITTEN_MAX_LEN : EXT_INIT_MAX_LEN;
897+
898+ /* Limit the number of blocks in one extent */
899+ map.m_len = min(max, map.m_len);
900+
895901 fc_ext.fc_ino = cpu_to_le32(inode->i_ino);
896902 ex = (struct ext4_extent *)&fc_ext.fc_ex;
897903 ex->ee_block = cpu_to_le32(map.m_lblk);
fs/ext4/inline.c+85−65
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <linux/iomap.h>
88 #include <linux/fiemap.h>
99 #include <linux/iversion.h>
10+#include <linux/backing-dev.h>
1011
1112 #include "ext4_jbd2.h"
1213 #include "ext4.h"
@@ -733,45 +734,83 @@ convert: · 720 unmodified lines
733734 int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
734735 unsigned copied, struct page *page)
735736 {
736− int ret, no_expand;
737+ handle_t *handle = ext4_journal_current_handle();
738+ int no_expand;
737739 void *kaddr;
738740 struct ext4_iloc iloc;
741+ int ret = 0, ret2;
742+
743+ if (unlikely(copied < len) && !PageUptodate(page))
744+ copied = 0;
739745
740− if (unlikely(copied < len)) {
741− if (!PageUptodate(page)) {
742− copied = 0;
746+ if (likely(copied)) {
747+ ret = ext4_get_inode_loc(inode, &iloc);
748+ if (ret) {
749+ unlock_page(page);
750+ put_page(page);
751+ ext4_std_error(inode->i_sb, ret);
743752 goto out;
744753 }
745− }
754+ ext4_write_lock_xattr(inode, &no_expand);
755+ BUG_ON(!ext4_has_inline_data(inode));
746756
747− ret = ext4_get_inode_loc(inode, &iloc);
748− if (ret) {
749− ext4_std_error(inode->i_sb, ret);
750− copied = 0;
751− goto out;
752− }
757+ /*
758+ * ei->i_inline_off may have changed since
759+ * ext4_write_begin() called
760+ * ext4_try_to_write_inline_data()
761+ */
762+ (void) ext4_find_inline_data_nolock(inode);
753763
754− ext4_write_lock_xattr(inode, &no_expand);
755− BUG_ON(!ext4_has_inline_data(inode));
764+ kaddr = kmap_atomic(page);
765+ ext4_write_inline_data(inode, &iloc, kaddr, pos, copied);
766+ kunmap_atomic(kaddr);
767+ SetPageUptodate(page);
768+ /* clear page dirty so that writepages wouldn't work for us. */
769+ ClearPageDirty(page);
756770
757− /*
758− * ei->i_inline_off may have changed since ext4_write_begin()
759− * called ext4_try_to_write_inline_data()
760− */
761− (void) ext4_find_inline_data_nolock(inode);
771+ ext4_write_unlock_xattr(inode, &no_expand);
772+ brelse(iloc.bh);
762773
763− kaddr = kmap_atomic(page);
764− ext4_write_inline_data(inode, &iloc, kaddr, pos, len);
765− kunmap_atomic(kaddr);
766− SetPageUptodate(page);
767− /* clear page dirty so that writepages wouldn't work for us. */
768− ClearPageDirty(page);
774+ /*
775+ * It's important to update i_size while still holding page
776+ * lock: page writeout could otherwise come in and zero
777+ * beyond i_size.
778+ */
779+ ext4_update_inode_size(inode, pos + copied);
780+ }
781+ unlock_page(page);
782+ put_page(page);
769783
770− ext4_write_unlock_xattr(inode, &no_expand);
771− brelse(iloc.bh);
772− mark_inode_dirty(inode);
784+ /*
785+ * Don't mark the inode dirty under page lock. First, it unnecessarily
786+ * makes the holding time of page lock longer. Second, it forces lock
787+ * ordering of page lock and transaction start for journaling
788+ * filesystems.
789+ */
790+ if (likely(copied))
791+ mark_inode_dirty(inode);
773792 out:
774− return copied;
793+ /*
794+ * If we didn't copy as much data as expected, we need to trim back
795+ * size of xattr containing inline data.
796+ */
797+ if (pos + len > inode->i_size && ext4_can_truncate(inode))
798+ ext4_orphan_add(handle, inode);
799+
800+ ret2 = ext4_journal_stop(handle);
801+ if (!ret)
802+ ret = ret2;
803+ if (pos + len > inode->i_size) {
804+ ext4_truncate_failed_write(inode);
805+ /*
806+ * If truncate failed early the inode might still be
807+ * on the orphan list; we need to make sure the inode
808+ * is removed from the orphan list in that case.
809+ */
810+ if (inode->i_nlink)
811+ ext4_orphan_del(NULL, inode);
812+ }
813+ return ret ? ret : copied;
775814 }
776815
777816 struct buffer_head *
@@ -953,43 +992,6 @@ out: · 175 unmodified lines
953992 return ret;
954993 }
955994
956−int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos,
957− unsigned len, unsigned copied,
958− struct page *page)
959−{
960− int ret;
961−
962− ret = ext4_write_inline_data_end(inode, pos, len, copied, page);
963− if (ret < 0) {
964− unlock_page(page);
965− put_page(page);
966− return ret;
967− }
968− copied = ret;
969−
970− /*
971− * No need to use i_size_read() here, the i_size
972− * cannot change under us because we hold i_mutex.
973− *
974− * But it's important to update i_size while still holding page lock:
975− * page writeout could otherwise come in and zero beyond i_size.
976− */
977− if (pos+copied > inode->i_size)
978− i_size_write(inode, pos+copied);
979− unlock_page(page);
980− put_page(page);
981−
982− /*
983− * Don't mark the inode dirty under page lock. First, it unnecessarily
984− * makes the holding time of page lock longer. Second, it forces lock
985− * ordering of page lock and transaction start for journaling
986− * filesystems.
987− */
988− mark_inode_dirty(inode);
989−
990− return copied;
991−}
992−
993995 #ifdef INLINE_DIR_DEBUG
994996 void ext4_show_inline_dir(struct inode *dir, struct buffer_head *bh,
995997 void *inline_start, int inline_size)
@@ -1917,6 +1919,24 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline) · 921 unmodified lines
19171919 EXT4_I(inode)->i_disksize = i_size;
19181920
19191921 if (i_size < inline_size) {
1922+ /*
1923+ * if there's inline data to truncate and this file was
1924+ * converted to extents after that inline data was written,
1925+ * the extent status cache must be cleared to avoid leaving
1926+ * behind stale delayed allocated extent entries
1927+ */
1928+ if (!ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) {
1929+retry:
1930+ err = ext4_es_remove_extent(inode, 0, EXT_MAX_BLOCKS);
1931+ if (err == -ENOMEM) {
1932+ cond_resched();
1933+ congestion_wait(BLK_RW_ASYNC, HZ/50);
1934+ goto retry;
1935+ }
1936+ if (err)
1937+ goto out_error;
1938+ }
1939+
19201940 /* Clear the content in the xattr space. */
19211941 if (inline_size > EXT4_MIN_INLINE_DATA_SIZE) {
19221942 if ((err = ext4_xattr_ibody_find(inode, &i, &is)) != 0)
fs/ext4/inode.c+59−117
@@ -1284,22 +1284,14 @@ static int ext4_write_end(struct file *file, · 1283 unmodified lines
12841284 loff_t old_size = inode->i_size;
12851285 int ret = 0, ret2;
12861286 int i_size_changed = 0;
1287− int inline_data = ext4_has_inline_data(inode);
12881287 bool verity = ext4_verity_in_progress(inode);
12891288
12901289 trace_ext4_write_end(inode, pos, len, copied);
1291− if (inline_data) {
1292− ret = ext4_write_inline_data_end(inode, pos, len,
1293− copied, page);
1294− if (ret < 0) {
1295− unlock_page(page);
1296− put_page(page);
1297− goto errout;
1298− }
1299− copied = ret;
1300− } else
1301− copied = block_write_end(file, mapping, pos,
1302− len, copied, page, fsdata);
1290+
1291+ if (ext4_has_inline_data(inode))
1292+ return ext4_write_inline_data_end(inode, pos, len, copied, page);
1293+
1294+ copied = block_write_end(file, mapping, pos, len, copied, page, fsdata);
13031295 /*
13041296 * it's important to update i_size while still holding page lock:
13051297 * page writeout could otherwise come in and zero beyond i_size.
@@ -1320,7 +1312,7 @@ static int ext4_write_end(struct file *file, · 14 unmodified lines
13201312 * ordering of page lock and transaction start for journaling
13211313 * filesystems.
13221314 */
1323− if (i_size_changed || inline_data)
1315+ if (i_size_changed)
13241316 ret = ext4_mark_inode_dirty(handle, inode);
13251317
13261318 if (pos + len > inode->i_size && !verity && ext4_can_truncate(inode))
@@ -1329,7 +1321,7 @@ static int ext4_write_end(struct file *file, · 2 unmodified lines
13291321 * inode->i_size. So truncate them
13301322 */
13311323 ext4_orphan_add(handle, inode);
1332−errout:
1324+
13331325 ret2 = ext4_journal_stop(handle);
13341326 if (!ret)
13351327 ret = ret2;
@@ -1395,7 +1387,6 @@ static int ext4_journalled_write_end(struct file *file, · 59 unmodified lines
13951387 int partial = 0;
13961388 unsigned from, to;
13971389 int size_changed = 0;
1398− int inline_data = ext4_has_inline_data(inode);
13991390 bool verity = ext4_verity_in_progress(inode);
14001391
14011392 trace_ext4_journalled_write_end(inode, pos, len, copied);
@@ -1404,16 +1395,10 @@ static int ext4_journalled_write_end(struct file *file, · 2 unmodified lines
14041395
14051396 BUG_ON(!ext4_handle_valid(handle));
14061397
1407− if (inline_data) {
1408− ret = ext4_write_inline_data_end(inode, pos, len,
1409− copied, page);
1410− if (ret < 0) {
1411− unlock_page(page);
1412− put_page(page);
1413− goto errout;
1414− }
1415− copied = ret;
1416− } else if (unlikely(copied < len) && !PageUptodate(page)) {
1398+ if (ext4_has_inline_data(inode))
1399+ return ext4_write_inline_data_end(inode, pos, len, copied, page);
1400+
1401+ if (unlikely(copied < len) && !PageUptodate(page)) {
14171402 copied = 0;
14181403 ext4_journalled_zero_new_buffers(handle, inode, page, from, to);
14191404 } else {
@@ -1436,7 +1421,7 @@ static int ext4_journalled_write_end(struct file *file, · 16 unmodified lines
14361421 if (old_size < pos && !verity)
14371422 pagecache_isize_extended(inode, old_size, pos);
14381423
1439− if (size_changed || inline_data) {
1424+ if (size_changed) {
14401425 ret2 = ext4_mark_inode_dirty(handle, inode);
14411426 if (!ret)
14421427 ret = ret2;
@@ -1449,7 +1434,6 @@ static int ext4_journalled_write_end(struct file *file, · 6 unmodified lines
14491434 */
14501435 ext4_orphan_add(handle, inode);
14511436
1452−errout:
14531437 ret2 = ext4_journal_stop(handle);
14541438 if (!ret)
14551439 ret = ret2;
@@ -1644,6 +1628,7 @@ static int ext4_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk) · 188 unmodified lines
16441628 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
16451629 int ret;
16461630 bool allocated = false;
1631+ bool reserved = false;
16471632
16481633 /*
16491634 * If the cluster containing lblk is shared with a delayed,
@@ -1660,6 +1645,7 @@ static int ext4_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk) · 10 unmodified lines
16601645 ret = ext4_da_reserve_space(inode);
16611646 if (ret != 0) /* ENOSPC */
16621647 goto errout;
1648+ reserved = true;
16631649 } else { /* bigalloc */
16641650 if (!ext4_es_scan_clu(inode, &ext4_es_is_delonly, lblk)) {
16651651 if (!ext4_es_scan_clu(inode,
@@ -1672,6 +1658,7 @@ static int ext4_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk) · 6 unmodified lines
16721658 ret = ext4_da_reserve_space(inode);
16731659 if (ret != 0) /* ENOSPC */
16741660 goto errout;
1661+ reserved = true;
16751662 } else {
16761663 allocated = true;
16771664 }
@@ -1682,6 +1669,8 @@ static int ext4_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk) · 4 unmodified lines
16821669 }
16831670
16841671 ret = ext4_es_insert_delayed_block(inode, lblk, allocated);
1672+ if (ret && reserved)
1673+ ext4_da_release_space(inode, 1);
16851674
16861675 errout:
16871676 return ret;
@@ -1722,13 +1711,16 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock, · 34 unmodified lines
17221711 }
17231712
17241713 /*
1725− * Delayed extent could be allocated by fallocate.
1726− * So we need to check it.
1714+ * the buffer head associated with a delayed and not unwritten
1715+ * block found in the extent status cache must contain an
1716+ * invalid block number and have its BH_New and BH_Delay bits
1717+ * set, reflecting the state assigned when the block was
1718+ * initially delayed allocated
17271719 */
1728− if (ext4_es_is_delayed(&es) && !ext4_es_is_unwritten(&es)) {
1729− map_bh(bh, inode->i_sb, invalid_block);
1730− set_buffer_new(bh);
1731− set_buffer_delay(bh);
1720+ if (ext4_es_is_delonly(&es)) {
1721+ BUG_ON(bh->b_blocknr != invalid_block);
1722+ BUG_ON(!buffer_new(bh));
1723+ BUG_ON(!buffer_delay(bh));
17321724 return 0;
17331725 }
17341726
@@ -2932,19 +2924,6 @@ static int ext4_nonda_switch(struct super_block *sb) · 1197 unmodified lines
29322924 return 0;
29332925 }
29342926
2935−/* We always reserve for an inode update; the superblock could be there too */
2936−static int ext4_da_write_credits(struct inode *inode, loff_t pos, unsigned len)
2937−{
2938− if (likely(ext4_has_feature_large_file(inode->i_sb)))
2939− return 1;
2940−
2941− if (pos + len <= 0x7fffffffULL)
2942− return 1;
2943−
2944− /* We might need to update the superblock to set LARGE_FILE */
2945− return 2;
2946−}
2947−
29482927 static int ext4_da_write_begin(struct file *file, struct address_space *mapping,
29492928 loff_t pos, unsigned len, unsigned flags,
29502929 struct page **pagep, void **fsdata)
@@ -2953,7 +2932,6 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping, · 2 unmodified lines
29532932 struct page *page;
29542933 pgoff_t index;
29552934 struct inode *inode = mapping->host;
2956− handle_t *handle;
29572935
29582936 if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb))))
29592937 return -EIO;
@@ -2979,41 +2957,11 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping, · 19 unmodified lines
29792957 return 0;
29802958 }
29812959
2982− /*
2983− * grab_cache_page_write_begin() can take a long time if the
2984− * system is thrashing due to memory pressure, or if the page
2985− * is being written back. So grab it first before we start
2986− * the transaction handle. This also allows us to allocate
2987− * the page (if needed) without using GFP_NOFS.
2988− */
2989−retry_grab:
2960+retry:
29902961 page = grab_cache_page_write_begin(mapping, index, flags);
29912962 if (!page)
29922963 return -ENOMEM;
2993− unlock_page(page);
29942964
2995− /*
2996− * With delayed allocation, we don't log the i_disksize update
2997− * if there is delayed block allocation. But we still need
2998− * to journalling the i_disksize update if writes to the end
2999− * of file which has an already mapped buffer.
3000− */
3001−retry_journal:
3002− handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE,
3003− ext4_da_write_credits(inode, pos, len));
3004− if (IS_ERR(handle)) {
3005− put_page(page);
3006− return PTR_ERR(handle);
3007− }
3008−
3009− lock_page(page);
3010− if (page->mapping != mapping) {
3011− /* The page got truncated from under us */
3012− unlock_page(page);
3013− put_page(page);
3014− ext4_journal_stop(handle);
3015− goto retry_grab;
3016− }
30172965 /* In case writeback began while the page was unlocked */
30182966 wait_for_stable_page(page);
30192967
@@ -3025,20 +2973,18 @@ retry_journal: · 5 unmodified lines
30252973 #endif
30262974 if (ret < 0) {
30272975 unlock_page(page);
3028− ext4_journal_stop(handle);
2976+ put_page(page);
30292977 /*
30302978 * block_write_begin may have instantiated a few blocks
30312979 * outside i_size. Trim these off again. Don't need
3032− * i_size_read because we hold i_mutex.
2980+ * i_size_read because we hold inode lock.
30332981 */
30342982 if (pos + len > inode->i_size)
30352983 ext4_truncate_failed_write(inode);
30362984
30372985 if (ret == -ENOSPC &&
30382986 ext4_should_retry_alloc(inode->i_sb, &retries))
3039− goto retry_journal;
3040−
3041− put_page(page);
2987+ goto retry;
30422988 return ret;
30432989 }
30442990
@@ -3075,8 +3021,6 @@ static int ext4_da_write_end(struct file *file, · 30 unmodified lines
30753021 struct page *page, void *fsdata)
30763022 {
30773023 struct inode *inode = mapping->host;
3078− int ret = 0, ret2;
3079− handle_t *handle = ext4_journal_current_handle();
30803024 loff_t new_i_size;
30813025 unsigned long start, end;
30823026 int write_mode = (int)(unsigned long)fsdata;
@@ -3086,44 +3030,36 @@ static int ext4_da_write_end(struct file *file, · 3 unmodified lines
30863030 len, copied, page, fsdata);
30873031
30883032 trace_ext4_da_write_end(inode, pos, len, copied);
3033+
3034+ if (write_mode != CONVERT_INLINE_DATA &&
3035+ ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA) &&
3036+ ext4_has_inline_data(inode))
3037+ return ext4_write_inline_data_end(inode, pos, len, copied, page);
3038+
30893039 start = pos & (PAGE_SIZE - 1);
30903040 end = start + copied - 1;
30913041
30923042 /*
3093− * generic_write_end() will run mark_inode_dirty() if i_size
3094− * changes. So let's piggyback the i_disksize mark_inode_dirty
3095− * into that.
3043+ * Since we are holding inode lock, we are sure i_disksize <=
3044+ * i_size. We also know that if i_disksize < i_size, there are
3045+ * delalloc writes pending in the range upto i_size. If the end of
3046+ * the current write is <= i_size, there's no need to touch
3047+ * i_disksize since writeback will push i_disksize upto i_size
3048+ * eventually. If the end of the current write is > i_size and
3049+ * inside an allocated block (ext4_da_should_update_i_disksize()
3050+ * check), we need to update i_disksize here as neither
3051+ * ext4_writepage() nor certain ext4_writepages() paths not
3052+ * allocating blocks update i_disksize.
3053+ *
3054+ * Note that we defer inode dirtying to generic_write_end() /
3055+ * ext4_da_write_inline_data_end().
30963056 */
30973057 new_i_size = pos + copied;
3098− if (copied && new_i_size > EXT4_I(inode)->i_disksize) {
3099− if (ext4_has_inline_data(inode) ||
3100− ext4_da_should_update_i_disksize(page, end)) {
3101− ext4_update_i_disksize(inode, new_i_size);
3102− /* We need to mark inode dirty even if
3103− * new_i_size is less that inode->i_size
3104− * bu greater than i_disksize.(hint delalloc)
3105− */
3106− ret = ext4_mark_inode_dirty(handle, inode);
3107− }
3108− }
3058+ if (copied && new_i_size > inode->i_size &&
3059+ ext4_da_should_update_i_disksize(page, end))
3060+ ext4_update_i_disksize(inode, new_i_size);
31093061
3110− if (write_mode != CONVERT_INLINE_DATA &&
3111− ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA) &&
3112− ext4_has_inline_data(inode))
3113− ret2 = ext4_da_write_inline_data_end(inode, pos, len, copied,
3114− page);
3115− else
3116− ret2 = generic_write_end(file, mapping, pos, len, copied,
3117− page, fsdata);
3118−
3119− copied = ret2;
3120− if (ret2 < 0)
3121− ret = ret2;
3122− ret2 = ext4_journal_stop(handle);
3123− if (unlikely(ret2 && !ret))
3124− ret = ret2;
3125−
3126− return ret ? ret : copied;
3062+ return generic_write_end(file, mapping, pos, len, copied, page, fsdata);
31273063 }
31283064
31293065 /*
@@ -4340,6 +4276,12 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino, · 1210 unmodified lines
43404276 goto has_buffer;
43414277
43424278 lock_buffer(bh);
4279+ if (ext4_buffer_uptodate(bh)) {
4280+ /* Someone brought it uptodate while we waited */
4281+ unlock_buffer(bh);
4282+ goto has_buffer;
4283+ }
4284+
43434285 /*
43444286 * If we have all information of the inode in memory and this
43454287 * is the only valid inode in the block, we need not read the
fs/ext4/super.c+15−6
@@ -658,7 +658,7 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error, · 657 unmodified lines
658658 * constraints, it may not be safe to do it right here so we
659659 * defer superblock flushing to a workqueue.
660660 */
661− if (continue_fs)
661+ if (continue_fs && journal)
662662 schedule_work(&EXT4_SB(sb)->s_error_work);
663663 else
664664 ext4_commit_super(sb);
@@ -1350,6 +1350,12 @@ static void ext4_destroy_inode(struct inode *inode) · 685 unmodified lines
13501350 true);
13511351 dump_stack();
13521352 }
1353+
1354+ if (EXT4_I(inode)->i_reserved_data_blocks)
1355+ ext4_msg(inode->i_sb, KERN_ERR,
1356+ "Inode %lu (%p): i_reserved_data_blocks (%u) not cleared!",
1357+ inode->i_ino, EXT4_I(inode),
1358+ EXT4_I(inode)->i_reserved_data_blocks);
13531359 }
13541360
13551361 static void init_once(void *foo)
@@ -3021,17 +3027,17 @@ static loff_t ext4_max_size(int blkbits, int has_huge_files) · 1665 unmodified lines
30213027 */
30223028 static loff_t ext4_max_bitmap_size(int bits, int has_huge_files)
30233029 {
3024− loff_t res = EXT4_NDIR_BLOCKS;
3030+ unsigned long long upper_limit, res = EXT4_NDIR_BLOCKS;
30253031 int meta_blocks;
3026− loff_t upper_limit;
3027− /* This is calculated to be the largest file size for a dense, block
3032+
3033+ /*
3034+ * This is calculated to be the largest file size for a dense, block
30283035 * mapped file such that the file's total number of 512-byte sectors,
30293036 * including data and all indirect blocks, does not exceed (2^48 - 1).
30303037 *
30313038 * __u32 i_blocks_lo and _u16 i_blocks_high represent the total
30323039 * number of 512-byte sectors of the file.
30333040 */
3034−
30353041 if (!has_huge_files) {
30363042 /*
30373043 * !has_huge_files or implies that the inode i_block field
@@ -3074,7 +3080,7 @@ static loff_t ext4_max_bitmap_size(int bits, int has_huge_files) · 36 unmodified lines
30743080 if (res > MAX_LFS_FILESIZE)
30753081 res = MAX_LFS_FILESIZE;
30763082
3077− return res;
3083+ return (loff_t)res;
30783084 }
30793085
30803086 static ext4_fsblk_t descriptor_loc(struct super_block *sb,
@@ -5042,12 +5048,15 @@ failed_mount_wq: · 1961 unmodified lines
50425048 sbi->s_ea_block_cache = NULL;
50435049
50445050 if (sbi->s_journal) {
5051+ /* flush s_error_work before journal destroy. */
5052+ flush_work(&sbi->s_error_work);
50455053 jbd2_journal_destroy(sbi->s_journal);
50465054 sbi->s_journal = NULL;
50475055 }
50485056 failed_mount3a:
50495057 ext4_es_unregister_shrinker(sbi);
50505058 failed_mount3:
5059+ /* flush s_error_work before sbi destroy */
50515060 flush_work(&sbi->s_error_work);
50525061 del_timer_sync(&sbi->s_err_report);
50535062 ext4_stop_mmpd(sbi);
fs/fscache/object.c+1−1
@@ -77,7 +77,6 @@ static WORK_STATE(INIT_OBJECT, "INIT", fscache_initialise_object); · 76 unmodified lines
7777 static WORK_STATE(PARENT_READY, "PRDY", fscache_parent_ready);
7878 static WORK_STATE(ABORT_INIT, "ABRT", fscache_abort_initialisation);
7979 static WORK_STATE(LOOK_UP_OBJECT, "LOOK", fscache_look_up_object);
80−static WORK_STATE(CREATE_OBJECT, "CRTO", fscache_look_up_object);
8180 static WORK_STATE(OBJECT_AVAILABLE, "AVBL", fscache_object_available);
8281 static WORK_STATE(JUMPSTART_DEPS, "JUMP", fscache_jumpstart_dependents);
8382
@@ -907,6 +906,7 @@ static void fscache_dequeue_object(struct fscache_object *object) · 823 unmodified lines
907906 * @object: The object to ask about
908907 * @data: The auxiliary data for the object
909908 * @datalen: The size of the auxiliary data
909+ * @object_size: The size of the object according to the server.
910910 *
911911 * This function consults the netfs about the coherency state of an object.
912912 * The caller must be holding a ref on cookie->n_active (held by
fs/fscache/operation.c+3−0
@@ -22,7 +22,10 @@ static void fscache_operation_dummy_cancel(struct fscache_operation *op) · 21 unmodified lines
2222
2323 /**
2424 * fscache_operation_init - Do basic initialisation of an operation
25+ * @cookie: The cookie to operate on
2526 * @op: The operation to initialise
27+ * @processor: The function to perform the operation
28+ * @cancel: A function to handle operation cancellation
2629 * @release: The release function to assign
2730 *
2831 * Do basic initialisation of an operation. The caller must still set flags,
fs/io-wq.c+1−4
@@ -584,10 +584,7 @@ loop: · 583 unmodified lines
584584
585585 if (!get_signal(&ksig))
586586 continue;
587− if (fatal_signal_pending(current) ||
588− signal_group_exit(current->signal))
589− break;
590− continue;
587+ break;
591588 }
592589 last_timeout = !ret;
593590 }
fs/io_uring.c+2−15
@@ -403,7 +403,6 @@ struct io_ring_ctx { · 402 unmodified lines
403403 struct wait_queue_head cq_wait;
404404 unsigned cq_extra;
405405 atomic_t cq_timeouts;
406− struct fasync_struct *cq_fasync;
407406 unsigned cq_last_tm_flush;
408407 } ____cacheline_aligned_in_smp;
409408
@@ -1614,10 +1613,8 @@ static void io_cqring_ev_posted(struct io_ring_ctx *ctx) · 1204 unmodified lines
16141613 wake_up(&ctx->sq_data->wait);
16151614 if (io_should_trigger_evfd(ctx))
16161615 eventfd_signal(ctx->cq_ev_fd, 1);
1617− if (waitqueue_active(&ctx->poll_wait)) {
1616+ if (waitqueue_active(&ctx->poll_wait))
16181617 wake_up_interruptible(&ctx->poll_wait);
1619− kill_fasync(&ctx->cq_fasync, SIGIO, POLL_IN);
1620− }
16211618 }
16221619
16231620 static void io_cqring_ev_posted_iopoll(struct io_ring_ctx *ctx)
@@ -1631,10 +1628,8 @@ static void io_cqring_ev_posted_iopoll(struct io_ring_ctx *ctx) · 7 unmodified lines
16311628 }
16321629 if (io_should_trigger_evfd(ctx))
16331630 eventfd_signal(ctx->cq_ev_fd, 1);
1634− if (waitqueue_active(&ctx->poll_wait)) {
1631+ if (waitqueue_active(&ctx->poll_wait))
16351632 wake_up_interruptible(&ctx->poll_wait);
1636− kill_fasync(&ctx->cq_fasync, SIGIO, POLL_IN);
1637− }
16381633 }
16391634
16401635 /* Returns true if there are no backlogged entries after the flush */
@@ -9345,13 +9340,6 @@ static __poll_t io_uring_poll(struct file *file, poll_table *wait) · 7704 unmodified lines
93459340 return mask;
93469341 }
93479342
9348−static int io_uring_fasync(int fd, struct file *file, int on)
9349−{
9350− struct io_ring_ctx *ctx = file->private_data;
9351−
9352− return fasync_helper(fd, file, on, &ctx->cq_fasync);
9353−}
9354−
93559343 static int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id)
93569344 {
93579345 const struct cred *creds;
@@ -10145,7 +10133,6 @@ static const struct file_operations io_uring_fops = { · 787 unmodified lines
1014510133 .mmap_capabilities = io_uring_nommu_mmap_capabilities,
1014610134 #endif
1014710135 .poll = io_uring_poll,
10148− .fasync = io_uring_fasync,
1014910136 #ifdef CONFIG_PROC_FS
1015010137 .show_fdinfo = io_uring_show_fdinfo,
1015110138 #endif
fs/kernfs/dir.c+7−2
@@ -1116,8 +1116,13 @@ static struct dentry *kernfs_iop_lookup(struct inode *dir, · 1115 unmodified lines
11161116 if (!inode)
11171117 inode = ERR_PTR(-ENOMEM);
11181118 }
1119− /* Needed only for negative dentry validation */
1120− if (!inode)
1119+ /*
1120+ * Needed for negative dentry validation.
1121+ * The negative dentry can be created in kernfs_iop_lookup()
1122+ * or transforms from positive dentry in dentry_unlink_inode()
1123+ * called from vfs_rmdir().
1124+ */
1125+ if (!IS_ERR(inode))
11211126 kernfs_set_rev(parent, dentry);
11221127 up_read(&kernfs_rwsem);
11231128
fs/ksmbd/auth.c+0−205
@@ -68,125 +68,6 @@ void ksmbd_copy_gss_neg_header(void *buf) · 67 unmodified lines
6868 memcpy(buf, NEGOTIATE_GSS_HEADER, AUTH_GSS_LENGTH);
6969 }
7070
71−static void
72−str_to_key(unsigned char *str, unsigned char *key)
73−{
74− int i;
75−
76− key[0] = str[0] >> 1;
77− key[1] = ((str[0] & 0x01) << 6) | (str[1] >> 2);
78− key[2] = ((str[1] & 0x03) << 5) | (str[2] >> 3);
79− key[3] = ((str[2] & 0x07) << 4) | (str[3] >> 4);
80− key[4] = ((str[3] & 0x0F) << 3) | (str[4] >> 5);
81− key[5] = ((str[4] & 0x1F) << 2) | (str[5] >> 6);
82− key[6] = ((str[5] & 0x3F) << 1) | (str[6] >> 7);
83− key[7] = str[6] & 0x7F;
84− for (i = 0; i < 8; i++)
85− key[i] = (key[i] << 1);
86−}
87−
88−static int
89−smbhash(unsigned char *out, const unsigned char *in, unsigned char *key)
90−{
91− unsigned char key2[8];
92− struct des_ctx ctx;
93−
94− if (fips_enabled) {
95− ksmbd_debug(AUTH, "FIPS compliance enabled: DES not permitted\n");
96− return -ENOENT;
97− }
98−
99− str_to_key(key, key2);
100− des_expand_key(&ctx, key2, DES_KEY_SIZE);
101− des_encrypt(&ctx, out, in);
102− memzero_explicit(&ctx, sizeof(ctx));
103− return 0;
104−}
105−
106−static int ksmbd_enc_p24(unsigned char *p21, const unsigned char *c8, unsigned char *p24)
107−{
108− int rc;
109−
110− rc = smbhash(p24, c8, p21);
111− if (rc)
112− return rc;
113− rc = smbhash(p24 + 8, c8, p21 + 7);
114− if (rc)
115− return rc;
116− return smbhash(p24 + 16, c8, p21 + 14);
117−}
118−
119−/* produce a md4 message digest from data of length n bytes */
120−static int ksmbd_enc_md4(unsigned char *md4_hash, unsigned char *link_str,
121− int link_len)
122−{
123− int rc;
124− struct ksmbd_crypto_ctx *ctx;
125−
126− ctx = ksmbd_crypto_ctx_find_md4();
127− if (!ctx) {
128− ksmbd_debug(AUTH, "Crypto md4 allocation error\n");
129− return -ENOMEM;
130− }
131−
132− rc = crypto_shash_init(CRYPTO_MD4(ctx));
133− if (rc) {
134− ksmbd_debug(AUTH, "Could not init md4 shash\n");
135− goto out;
136− }
137−
138− rc = crypto_shash_update(CRYPTO_MD4(ctx), link_str, link_len);
139− if (rc) {
140− ksmbd_debug(AUTH, "Could not update with link_str\n");
141− goto out;
142− }
143−
144− rc = crypto_shash_final(CRYPTO_MD4(ctx), md4_hash);
145− if (rc)
146− ksmbd_debug(AUTH, "Could not generate md4 hash\n");
147−out:
148− ksmbd_release_crypto_ctx(ctx);
149− return rc;
150−}
151−
152−static int ksmbd_enc_update_sess_key(unsigned char *md5_hash, char *nonce,
153− char *server_challenge, int len)
154−{
155− int rc;
156− struct ksmbd_crypto_ctx *ctx;
157−
158− ctx = ksmbd_crypto_ctx_find_md5();
159− if (!ctx) {
160− ksmbd_debug(AUTH, "Crypto md5 allocation error\n");
161− return -ENOMEM;
162− }
163−
164− rc = crypto_shash_init(CRYPTO_MD5(ctx));
165− if (rc) {
166− ksmbd_debug(AUTH, "Could not init md5 shash\n");
167− goto out;
168− }
169−
170− rc = crypto_shash_update(CRYPTO_MD5(ctx), server_challenge, len);
171− if (rc) {
172− ksmbd_debug(AUTH, "Could not update with challenge\n");
173− goto out;
174− }
175−
176− rc = crypto_shash_update(CRYPTO_MD5(ctx), nonce, len);
177− if (rc) {
178− ksmbd_debug(AUTH, "Could not update with nonce\n");
179− goto out;
180− }
181−
182− rc = crypto_shash_final(CRYPTO_MD5(ctx), md5_hash);
183− if (rc)
184− ksmbd_debug(AUTH, "Could not generate md5 hash\n");
185−out:
186− ksmbd_release_crypto_ctx(ctx);
187− return rc;
188−}
189−
19071 /**
19172 * ksmbd_gen_sess_key() - function to generate session key
19273 * @sess: session of connection
@@ -324,43 +205,6 @@ out: · 131 unmodified lines
324205 return ret;
325206 }
326207
327−/**
328− * ksmbd_auth_ntlm() - NTLM authentication handler
329− * @sess: session of connection
330− * @pw_buf: NTLM challenge response
331− * @passkey: user password
332− *
333− * Return: 0 on success, error number on error
334− */
335−int ksmbd_auth_ntlm(struct ksmbd_session *sess, char *pw_buf)
336−{
337− int rc;
338− unsigned char p21[21];
339− char key[CIFS_AUTH_RESP_SIZE];
340−
341− memset(p21, '\0', 21);
342− memcpy(p21, user_passkey(sess->user), CIFS_NTHASH_SIZE);
343− rc = ksmbd_enc_p24(p21, sess->ntlmssp.cryptkey, key);
344− if (rc) {
345− pr_err("password processing failed\n");
346− return rc;
347− }
348−
349− ksmbd_enc_md4(sess->sess_key, user_passkey(sess->user),
350− CIFS_SMB1_SESSKEY_SIZE);
351− memcpy(sess->sess_key + CIFS_SMB1_SESSKEY_SIZE, key,
352− CIFS_AUTH_RESP_SIZE);
353− sess->sequence_number = 1;
354−
355− if (strncmp(pw_buf, key, CIFS_AUTH_RESP_SIZE) != 0) {
356− ksmbd_debug(AUTH, "ntlmv1 authentication failed\n");
357− return -EINVAL;
358− }
359−
360− ksmbd_debug(AUTH, "ntlmv1 authentication pass\n");
361− return 0;
362−}
363−
364208 /**
365209 * ksmbd_auth_ntlmv2() - NTLMv2 authentication handler
366210 * @sess: session of connection
@@ -441,44 +285,6 @@ out: · 74 unmodified lines
441285 return rc;
442286 }
443287
444−/**
445− * __ksmbd_auth_ntlmv2() - NTLM2(extended security) authentication handler
446− * @sess: session of connection
447− * @client_nonce: client nonce from LM response.
448− * @ntlm_resp: ntlm response data from client.
449− *
450− * Return: 0 on success, error number on error
451− */
452−static int __ksmbd_auth_ntlmv2(struct ksmbd_session *sess, char *client_nonce,
453− char *ntlm_resp)
454−{
455− char sess_key[CIFS_SMB1_SESSKEY_SIZE] = {0};
456− int rc;
457− unsigned char p21[21];
458− char key[CIFS_AUTH_RESP_SIZE];
459−
460− rc = ksmbd_enc_update_sess_key(sess_key,
461− client_nonce,
462− (char *)sess->ntlmssp.cryptkey, 8);
463− if (rc) {
464− pr_err("password processing failed\n");
465− goto out;
466− }
467−
468− memset(p21, '\0', 21);
469− memcpy(p21, user_passkey(sess->user), CIFS_NTHASH_SIZE);
470− rc = ksmbd_enc_p24(p21, sess_key, key);
471− if (rc) {
472− pr_err("password processing failed\n");
473− goto out;
474− }
475−
476− if (memcmp(ntlm_resp, key, CIFS_AUTH_RESP_SIZE) != 0)
477− rc = -EINVAL;
478−out:
479− return rc;
480−}
481−
482288 /**
483289 * ksmbd_decode_ntlmssp_auth_blob() - helper function to construct
484290 * authenticate blob
@@ -512,17 +318,6 @@ int ksmbd_decode_ntlmssp_auth_blob(struct authenticate_message *authblob, · 27 unmodified lines
512318 nt_off = le32_to_cpu(authblob->NtChallengeResponse.BufferOffset);
513319 nt_len = le16_to_cpu(authblob->NtChallengeResponse.Length);
514320
515− /* process NTLM authentication */
516− if (nt_len == CIFS_AUTH_RESP_SIZE) {
517− if (le32_to_cpu(authblob->NegotiateFlags) &
518− NTLMSSP_NEGOTIATE_EXTENDED_SEC)
519− return __ksmbd_auth_ntlmv2(sess, (char *)authblob +
520− lm_off, (char *)authblob + nt_off);
521− else
522− return ksmbd_auth_ntlm(sess, (char *)authblob +
523− nt_off);
524− }
525−
526321 /* TODO : use domain name that imported from configuration file */
527322 domain_name = smb_strndup_from_utf16((const char *)authblob +
528323 le32_to_cpu(authblob->DomainName.BufferOffset),
fs/ksmbd/crypto_ctx.c+0−16
@@ -81,12 +81,6 @@ static struct shash_desc *alloc_shash_desc(int id) · 80 unmodified lines
8181 case CRYPTO_SHASH_SHA512:
8282 tfm = crypto_alloc_shash("sha512", 0, 0);
8383 break;
84− case CRYPTO_SHASH_MD4:
85− tfm = crypto_alloc_shash("md4", 0, 0);
86− break;
87− case CRYPTO_SHASH_MD5:
88− tfm = crypto_alloc_shash("md5", 0, 0);
89− break;
9084 default:
9185 return NULL;
9286 }
@@ -214,16 +208,6 @@ struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha512(void) · 121 unmodified lines
214208 return ____crypto_shash_ctx_find(CRYPTO_SHASH_SHA512);
215209 }
216210
217−struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md4(void)
218−{
219− return ____crypto_shash_ctx_find(CRYPTO_SHASH_MD4);
220−}
221−
222−struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md5(void)
223−{
224− return ____crypto_shash_ctx_find(CRYPTO_SHASH_MD5);
225−}
226−
227211 static struct ksmbd_crypto_ctx *____crypto_aead_ctx_find(int id)
228212 {
229213 struct ksmbd_crypto_ctx *ctx;
fs/ksmbd/crypto_ctx.h+0−8
@@ -15,8 +15,6 @@ enum { · 14 unmodified lines
1515 CRYPTO_SHASH_CMACAES,
1616 CRYPTO_SHASH_SHA256,
1717 CRYPTO_SHASH_SHA512,
18− CRYPTO_SHASH_MD4,
19− CRYPTO_SHASH_MD5,
2018 CRYPTO_SHASH_MAX,
2119 };
2220
@@ -43,8 +41,6 @@ struct ksmbd_crypto_ctx { · 20 unmodified lines
4341 #define CRYPTO_CMACAES(c) ((c)->desc[CRYPTO_SHASH_CMACAES])
4442 #define CRYPTO_SHA256(c) ((c)->desc[CRYPTO_SHASH_SHA256])
4543 #define CRYPTO_SHA512(c) ((c)->desc[CRYPTO_SHASH_SHA512])
46−#define CRYPTO_MD4(c) ((c)->desc[CRYPTO_SHASH_MD4])
47−#define CRYPTO_MD5(c) ((c)->desc[CRYPTO_SHASH_MD5])
4844
4945 #define CRYPTO_HMACMD5_TFM(c) ((c)->desc[CRYPTO_SHASH_HMACMD5]->tfm)
5046 #define CRYPTO_HMACSHA256_TFM(c)\
@@ -52,8 +48,6 @@ struct ksmbd_crypto_ctx { · 1 unmodified line
5248 #define CRYPTO_CMACAES_TFM(c) ((c)->desc[CRYPTO_SHASH_CMACAES]->tfm)
5349 #define CRYPTO_SHA256_TFM(c) ((c)->desc[CRYPTO_SHASH_SHA256]->tfm)
5450 #define CRYPTO_SHA512_TFM(c) ((c)->desc[CRYPTO_SHASH_SHA512]->tfm)
55−#define CRYPTO_MD4_TFM(c) ((c)->desc[CRYPTO_SHASH_MD4]->tfm)
56−#define CRYPTO_MD5_TFM(c) ((c)->desc[CRYPTO_SHASH_MD5]->tfm)
5751
5852 #define CRYPTO_GCM(c) ((c)->ccmaes[CRYPTO_AEAD_AES_GCM])
5953 #define CRYPTO_CCM(c) ((c)->ccmaes[CRYPTO_AEAD_AES_CCM])
@@ -64,8 +58,6 @@ struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_hmacsha256(void); · 4 unmodified lines
6458 struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_cmacaes(void);
6559 struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha512(void);
6660 struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha256(void);
67−struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md4(void);
68−struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md5(void);
6961 struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_gcm(void);
7062 struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_ccm(void);
7163 void ksmbd_crypto_destroy(void);
fs/ksmbd/misc.c+7−10
@@ -162,17 +162,14 @@ char *convert_to_nt_pathname(char *filename) · 161 unmodified lines
162162 {
163163 char *ab_pathname;
164164
165− if (strlen(filename) == 0) {
166− ab_pathname = kmalloc(2, GFP_KERNEL);
167− ab_pathname[0] = '\\';
168− ab_pathname[1] = '\0';
169− } else {
170− ab_pathname = kstrdup(filename, GFP_KERNEL);
171− if (!ab_pathname)
172− return NULL;
165+ if (strlen(filename) == 0)
166+ filename = "\\";
173167
174− ksmbd_conv_path_to_windows(ab_pathname);
175− }
168+ ab_pathname = kstrdup(filename, GFP_KERNEL);
169+ if (!ab_pathname)
170+ return NULL;
171+
172+ ksmbd_conv_path_to_windows(ab_pathname);
176173 return ab_pathname;
177174 }
178175
fs/ksmbd/oplock.c+31−10
@@ -1451,26 +1451,47 @@ struct lease_ctx_info *parse_lease_state(void *open_req) · 1450 unmodified lines
14511451 */
14521452 struct create_context *smb2_find_context_vals(void *open_req, const char *tag)
14531453 {
1454− char *data_offset;
14551454 struct create_context *cc;
14561455 unsigned int next = 0;
14571456 char *name;
14581457 struct smb2_create_req *req = (struct smb2_create_req *)open_req;
1458+ unsigned int remain_len, name_off, name_len, value_off, value_len,
1459+ cc_len;
14591460
1460− data_offset = (char *)req + 4 + le32_to_cpu(req->CreateContextsOffset);
1461− cc = (struct create_context *)data_offset;
1461+ /*
1462+ * CreateContextsOffset and CreateContextsLength are guaranteed to
1463+ * be valid because of ksmbd_smb2_check_message().
1464+ */
1465+ cc = (struct create_context *)((char *)req + 4 +
1466+ le32_to_cpu(req->CreateContextsOffset));
1467+ remain_len = le32_to_cpu(req->CreateContextsLength);
14621468 do {
1463− int val;
1464−
14651469 cc = (struct create_context *)((char *)cc + next);
1466− name = le16_to_cpu(cc->NameOffset) + (char *)cc;
1467− val = le16_to_cpu(cc->NameLength);
1468− if (val < 4)
1470+ if (remain_len < offsetof(struct create_context, Buffer))
14691471 return ERR_PTR(-EINVAL);
14701472
1471− if (memcmp(name, tag, val) == 0)
1472− return cc;
14731473 next = le32_to_cpu(cc->Next);
1474+ name_off = le16_to_cpu(cc->NameOffset);
1475+ name_len = le16_to_cpu(cc->NameLength);
1476+ value_off = le16_to_cpu(cc->DataOffset);
1477+ value_len = le32_to_cpu(cc->DataLength);
1478+ cc_len = next ? next : remain_len;
1479+
1480+ if ((next & 0x7) != 0 ||
1481+ next > remain_len ||
1482+ name_off != offsetof(struct create_context, Buffer) ||
1483+ name_len < 4 ||
1484+ name_off + name_len > cc_len ||
1485+ (value_off & 0x7) != 0 ||
1486+ (value_off && (value_off < name_off + name_len)) ||
1487+ ((u64)value_off + value_len > cc_len))
1488+ return ERR_PTR(-EINVAL);
1489+
1490+ name = (char *)cc + name_off;
1491+ if (memcmp(name, tag, name_len) == 0)
1492+ return cc;
1493+
1494+ remain_len -= next;
14741495 } while (next != 0);
14751496
14761497 return NULL;
fs/ksmbd/smb2pdu.c+196−60
@@ -459,13 +459,22 @@ static void init_chained_smb2_rsp(struct ksmbd_work *work) · 458 unmodified lines
459459 bool is_chained_smb2_message(struct ksmbd_work *work)
460460 {
461461 struct smb2_hdr *hdr = work->request_buf;
462− unsigned int len;
462+ unsigned int len, next_cmd;
463463
464464 if (hdr->ProtocolId != SMB2_PROTO_NUMBER)
465465 return false;
466466
467467 hdr = ksmbd_req_buf_next(work);
468− if (le32_to_cpu(hdr->NextCommand) > 0) {
468+ next_cmd = le32_to_cpu(hdr->NextCommand);
469+ if (next_cmd > 0) {
470+ if ((u64)work->next_smb2_rcv_hdr_off + next_cmd +
471+ __SMB2_HEADER_STRUCTURE_SIZE >
472+ get_rfc1002_len(work->request_buf)) {
473+ pr_err("next command(%u) offset exceeds smb msg size\n",
474+ next_cmd);
475+ return false;
476+ }
477+
469478 ksmbd_debug(SMB, "got SMB2 chained command\n");
470479 init_chained_smb2_rsp(work);
471480 return true;
@@ -1058,6 +1067,7 @@ int smb2_handle_negotiate(struct ksmbd_work *work) · 586 unmodified lines
10581067 struct smb2_negotiate_req *req = work->request_buf;
10591068 struct smb2_negotiate_rsp *rsp = work->response_buf;
10601069 int rc = 0;
1070+ unsigned int smb2_buf_len, smb2_neg_size;
10611071 __le32 status;
10621072
10631073 ksmbd_debug(SMB, "Received negotiate request\n");
@@ -1075,6 +1085,44 @@ int smb2_handle_negotiate(struct ksmbd_work *work) · 11 unmodified lines
10751085 goto err_out;
10761086 }
10771087
1088+ smb2_buf_len = get_rfc1002_len(work->request_buf);
1089+ smb2_neg_size = offsetof(struct smb2_negotiate_req, Dialects) - 4;
1090+ if (smb2_neg_size > smb2_buf_len) {
1091+ rsp->hdr.Status = STATUS_INVALID_PARAMETER;
1092+ rc = -EINVAL;
1093+ goto err_out;
1094+ }
1095+
1096+ if (conn->dialect == SMB311_PROT_ID) {
1097+ unsigned int nego_ctxt_off = le32_to_cpu(req->NegotiateContextOffset);
1098+
1099+ if (smb2_buf_len < nego_ctxt_off) {
1100+ rsp->hdr.Status = STATUS_INVALID_PARAMETER;
1101+ rc = -EINVAL;
1102+ goto err_out;
1103+ }
1104+
1105+ if (smb2_neg_size > nego_ctxt_off) {
1106+ rsp->hdr.Status = STATUS_INVALID_PARAMETER;
1107+ rc = -EINVAL;
1108+ goto err_out;
1109+ }
1110+
1111+ if (smb2_neg_size + le16_to_cpu(req->DialectCount) * sizeof(__le16) >
1112+ nego_ctxt_off) {
1113+ rsp->hdr.Status = STATUS_INVALID_PARAMETER;
1114+ rc = -EINVAL;
1115+ goto err_out;
1116+ }
1117+ } else {
1118+ if (smb2_neg_size + le16_to_cpu(req->DialectCount) * sizeof(__le16) >
1119+ smb2_buf_len) {
1120+ rsp->hdr.Status = STATUS_INVALID_PARAMETER;
1121+ rc = -EINVAL;
1122+ goto err_out;
1123+ }
1124+ }
1125+
10781126 conn->cli_cap = le32_to_cpu(req->Capabilities);
10791127 switch (conn->dialect) {
10801128 case SMB311_PROT_ID:
@@ -2093,16 +2141,22 @@ out: · 1012 unmodified lines
20932141 * smb2_set_ea() - handler for setting extended attributes using set
20942142 * info command
20952143 * @eabuf: set info command buffer
2144+ * @buf_len: set info command buffer length
20962145 * @path: dentry path for get ea
20972146 *
20982147 * Return: 0 on success, otherwise error
20992148 */
2100−static int smb2_set_ea(struct smb2_ea_info *eabuf, struct path *path)
2149+static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len,
2150+ struct path *path)
21012151 {
21022152 struct user_namespace *user_ns = mnt_user_ns(path->mnt);
21032153 char *attr_name = NULL, *value;
21042154 int rc = 0;
2105− int next = 0;
2155+ unsigned int next = 0;
2156+
2157+ if (buf_len < sizeof(struct smb2_ea_info) + eabuf->EaNameLength +
2158+ le16_to_cpu(eabuf->EaValueLength))
2159+ return -EINVAL;
21062160
21072161 attr_name = kmalloc(XATTR_NAME_MAX + 1, GFP_KERNEL);
21082162 if (!attr_name)
@@ -2167,7 +2221,13 @@ static int smb2_set_ea(struct smb2_ea_info *eabuf, struct path *path) · 58 unmodified lines
21672221
21682222 next:
21692223 next = le32_to_cpu(eabuf->NextEntryOffset);
2224+ if (next == 0 || buf_len < next)
2225+ break;
2226+ buf_len -= next;
21702227 eabuf = (struct smb2_ea_info *)((char *)eabuf + next);
2228+ if (next < (u32)eabuf->EaNameLength + le16_to_cpu(eabuf->EaValueLength))
2229+ break;
2230+
21712231 } while (next != 0);
21722232
21732233 kfree(attr_name);
@@ -2367,6 +2427,10 @@ static int smb2_create_sd_buffer(struct ksmbd_work *work, · 193 unmodified lines
23672427 ksmbd_debug(SMB,
23682428 "Set ACLs using SMB2_CREATE_SD_BUFFER context\n");
23692429 sd_buf = (struct create_sd_buf_req *)context;
2430+ if (le16_to_cpu(context->DataOffset) +
2431+ le32_to_cpu(context->DataLength) <
2432+ sizeof(struct create_sd_buf_req))
2433+ return -EINVAL;
23702434 return set_info_sec(work->conn, work->tcon, path, &sd_buf->ntsd,
23712435 le32_to_cpu(sd_buf->ccontext.DataLength), true);
23722436 }
@@ -2561,6 +2625,12 @@ int smb2_open(struct ksmbd_work *work) · 188 unmodified lines
25612625 goto err_out1;
25622626 } else if (context) {
25632627 ea_buf = (struct create_ea_buf_req *)context;
2628+ if (le16_to_cpu(context->DataOffset) +
2629+ le32_to_cpu(context->DataLength) <
2630+ sizeof(struct create_ea_buf_req)) {
2631+ rc = -EINVAL;
2632+ goto err_out1;
2633+ }
25642634 if (req->CreateOptions & FILE_NO_EA_KNOWLEDGE_LE) {
25652635 rsp->hdr.Status = STATUS_ACCESS_DENIED;
25662636 rc = -EACCES;
@@ -2599,6 +2669,12 @@ int smb2_open(struct ksmbd_work *work) · 32 unmodified lines
25992669 } else if (context) {
26002670 struct create_posix *posix =
26012671 (struct create_posix *)context;
2672+ if (le16_to_cpu(context->DataOffset) +
2673+ le32_to_cpu(context->DataLength) <
2674+ sizeof(struct create_posix)) {
2675+ rc = -EINVAL;
2676+ goto err_out1;
2677+ }
26022678 ksmbd_debug(SMB, "get posix context\n");
26032679
26042680 posix_mode = le32_to_cpu(posix->Mode);
@@ -2748,7 +2824,15 @@ int smb2_open(struct ksmbd_work *work) · 143 unmodified lines
27482824 created = true;
27492825 user_ns = mnt_user_ns(path.mnt);
27502826 if (ea_buf) {
2751− rc = smb2_set_ea(&ea_buf->ea, &path);
2827+ if (le32_to_cpu(ea_buf->ccontext.DataLength) <
2828+ sizeof(struct smb2_ea_info)) {
2829+ rc = -EINVAL;
2830+ goto err_out;
2831+ }
2832+
2833+ rc = smb2_set_ea(&ea_buf->ea,
2834+ le32_to_cpu(ea_buf->ccontext.DataLength),
2835+ &path);
27522836 if (rc == -EOPNOTSUPP)
27532837 rc = 0;
27542838 else if (rc)
@@ -2981,9 +3065,16 @@ int smb2_open(struct ksmbd_work *work) · 226 unmodified lines
29813065 rc = PTR_ERR(az_req);
29823066 goto err_out;
29833067 } else if (az_req) {
2984− loff_t alloc_size = le64_to_cpu(az_req->AllocationSize);
3068+ loff_t alloc_size;
29853069 int err;
29863070
3071+ if (le16_to_cpu(az_req->ccontext.DataOffset) +
3072+ le32_to_cpu(az_req->ccontext.DataLength) <
3073+ sizeof(struct create_alloc_size_req)) {
3074+ rc = -EINVAL;
3075+ goto err_out;
3076+ }
3077+ alloc_size = le64_to_cpu(az_req->AllocationSize);
29873078 ksmbd_debug(SMB,
29883079 "request smb2 create allocate size : %llu\n",
29893080 alloc_size);
@@ -4152,7 +4243,7 @@ static void get_file_access_info(struct smb2_query_info_rsp *rsp, · 1162 unmodified lines
41524243 static int get_file_basic_info(struct smb2_query_info_rsp *rsp,
41534244 struct ksmbd_file *fp, void *rsp_org)
41544245 {
4155− struct smb2_file_all_info *basic_info;
4246+ struct smb2_file_basic_info *basic_info;
41564247 struct kstat stat;
41574248 u64 time;
41584249
@@ -4162,7 +4253,7 @@ static int get_file_basic_info(struct smb2_query_info_rsp *rsp, · 3 unmodified lines
41624253 return -EACCES;
41634254 }
41644255
4165− basic_info = (struct smb2_file_all_info *)rsp->Buffer;
4256+ basic_info = (struct smb2_file_basic_info *)rsp->Buffer;
41664257 generic_fillattr(file_mnt_user_ns(fp->filp), file_inode(fp->filp),
41674258 &stat);
41684259 basic_info->CreationTime = cpu_to_le64(fp->create_time);
@@ -4175,9 +4266,8 @@ static int get_file_basic_info(struct smb2_query_info_rsp *rsp, · 6 unmodified lines
41754266 basic_info->Attributes = fp->f_ci->m_fattr;
41764267 basic_info->Pad1 = 0;
41774268 rsp->OutputBufferLength =
4178− cpu_to_le32(offsetof(struct smb2_file_all_info, AllocationSize));
4179− inc_rfc1001_len(rsp_org, offsetof(struct smb2_file_all_info,
4180− AllocationSize));
4269+ cpu_to_le32(sizeof(struct smb2_file_basic_info));
4270+ inc_rfc1001_len(rsp_org, sizeof(struct smb2_file_basic_info));
41814271 return 0;
41824272 }
41834273
@@ -5333,7 +5423,7 @@ out: · 1149 unmodified lines
53335423 static int smb2_create_link(struct ksmbd_work *work,
53345424 struct ksmbd_share_config *share,
53355425 struct smb2_file_link_info *file_info,
5336− struct file *filp,
5426+ unsigned int buf_len, struct file *filp,
53375427 struct nls_table *local_nls)
53385428 {
53395429 char *link_name = NULL, *target_name = NULL, *pathname = NULL;
@@ -5341,6 +5431,10 @@ static int smb2_create_link(struct ksmbd_work *work, · 1 unmodified line
53415431 bool file_present = true;
53425432 int rc;
53435433
5434+ if (buf_len < (u64)sizeof(struct smb2_file_link_info) +
5435+ le32_to_cpu(file_info->FileNameLength))
5436+ return -EINVAL;
5437+
53445438 ksmbd_debug(SMB, "setting FILE_LINK_INFORMATION\n");
53455439 pathname = kmalloc(PATH_MAX, GFP_KERNEL);
53465440 if (!pathname)
@@ -5400,10 +5494,10 @@ out: · 53 unmodified lines
54005494 return rc;
54015495 }
54025496
5403−static int set_file_basic_info(struct ksmbd_file *fp, char *buf,
5497+static int set_file_basic_info(struct ksmbd_file *fp,
5498+ struct smb2_file_basic_info *file_info,
54045499 struct ksmbd_share_config *share)
54055500 {
5406− struct smb2_file_all_info *file_info;
54075501 struct iattr attrs;
54085502 struct timespec64 ctime;
54095503 struct file *filp;
@@ -5414,7 +5508,6 @@ static int set_file_basic_info(struct ksmbd_file *fp, char *buf, · 4 unmodified lines
54145508 if (!(fp->daccess & FILE_WRITE_ATTRIBUTES_LE))
54155509 return -EACCES;
54165510
5417− file_info = (struct smb2_file_all_info *)buf;
54185511 attrs.ia_valid = 0;
54195512 filp = fp->filp;
54205513 inode = file_inode(filp);
@@ -5491,7 +5584,8 @@ static int set_file_basic_info(struct ksmbd_file *fp, char *buf, · 70 unmodified lines
54915584 }
54925585
54935586 static int set_file_allocation_info(struct ksmbd_work *work,
5494− struct ksmbd_file *fp, char *buf)
5587+ struct ksmbd_file *fp,
5588+ struct smb2_file_alloc_info *file_alloc_info)
54955589 {
54965590 /*
54975591 * TODO : It's working fine only when store dos attributes
@@ -5499,7 +5593,6 @@ static int set_file_allocation_info(struct ksmbd_work *work, · 1 unmodified line
54995593 * properly with any smb.conf option
55005594 */
55015595
5502− struct smb2_file_alloc_info *file_alloc_info;
55035596 loff_t alloc_blks;
55045597 struct inode *inode;
55055598 int rc;
@@ -5507,7 +5600,6 @@ static int set_file_allocation_info(struct ksmbd_work *work, · 1 unmodified line
55075600 if (!(fp->daccess & FILE_WRITE_DATA_LE))
55085601 return -EACCES;
55095602
5510− file_alloc_info = (struct smb2_file_alloc_info *)buf;
55115603 alloc_blks = (le64_to_cpu(file_alloc_info->AllocationSize) + 511) >> 9;
55125604 inode = file_inode(fp->filp);
55135605
@@ -5543,9 +5635,8 @@ static int set_file_allocation_info(struct ksmbd_work *work, · 29 unmodified lines
55435635 }
55445636
55455637 static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp,
5546− char *buf)
5638+ struct smb2_file_eof_info *file_eof_info)
55475639 {
5548− struct smb2_file_eof_info *file_eof_info;
55495640 loff_t newsize;
55505641 struct inode *inode;
55515642 int rc;
@@ -5553,7 +5644,6 @@ static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp, · 1 unmodified line
55535644 if (!(fp->daccess & FILE_WRITE_DATA_LE))
55545645 return -EACCES;
55555646
5556− file_eof_info = (struct smb2_file_eof_info *)buf;
55575647 newsize = le64_to_cpu(file_eof_info->EndOfFile);
55585648 inode = file_inode(fp->filp);
55595649
@@ -5580,7 +5670,8 @@ static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp, · 20 unmodified lines
55805670 }
55815671
55825672 static int set_rename_info(struct ksmbd_work *work, struct ksmbd_file *fp,
5583− char *buf)
5673+ struct smb2_file_rename_info *rename_info,
5674+ unsigned int buf_len)
55845675 {
55855676 struct user_namespace *user_ns;
55865677 struct ksmbd_file *parent_fp;
@@ -5593,6 +5684,10 @@ static int set_rename_info(struct ksmbd_work *work, struct ksmbd_file *fp, · 6 unmodified lines
55935684 return -EACCES;
55945685 }
55955686
5687+ if (buf_len < (u64)sizeof(struct smb2_file_rename_info) +
5688+ le32_to_cpu(rename_info->FileNameLength))
5689+ return -EINVAL;
5690+
55965691 user_ns = file_mnt_user_ns(fp->filp);
55975692 if (ksmbd_stream_fd(fp))
55985693 goto next;
@@ -5615,14 +5710,13 @@ static int set_rename_info(struct ksmbd_work *work, struct ksmbd_file *fp, · 16 unmodified lines
56155710 }
56165711 }
56175712 next:
5618− return smb2_rename(work, fp, user_ns,
5619− (struct smb2_file_rename_info *)buf,
5713+ return smb2_rename(work, fp, user_ns, rename_info,
56205714 work->sess->conn->local_nls);
56215715 }
56225716
5623−static int set_file_disposition_info(struct ksmbd_file *fp, char *buf)
5717+static int set_file_disposition_info(struct ksmbd_file *fp,
5718+ struct smb2_file_disposition_info *file_info)
56245719 {
5625− struct smb2_file_disposition_info *file_info;
56265720 struct inode *inode;
56275721
56285722 if (!(fp->daccess & FILE_DELETE_LE)) {
@@ -5631,7 +5725,6 @@ static int set_file_disposition_info(struct ksmbd_file *fp, char *buf) · 2 unmodified lines
56315725 }
56325726
56335727 inode = file_inode(fp->filp);
5634− file_info = (struct smb2_file_disposition_info *)buf;
56355728 if (file_info->DeletePending) {
56365729 if (S_ISDIR(inode->i_mode) &&
56375730 ksmbd_vfs_empty_dir(fp) == -ENOTEMPTY)
@@ -5643,15 +5736,14 @@ static int set_file_disposition_info(struct ksmbd_file *fp, char *buf) · 5 unmodified lines
56435736 return 0;
56445737 }
56455738
5646−static int set_file_position_info(struct ksmbd_file *fp, char *buf)
5739+static int set_file_position_info(struct ksmbd_file *fp,
5740+ struct smb2_file_pos_info *file_info)
56475741 {
5648− struct smb2_file_pos_info *file_info;
56495742 loff_t current_byte_offset;
56505743 unsigned long sector_size;
56515744 struct inode *inode;
56525745
56535746 inode = file_inode(fp->filp);
5654− file_info = (struct smb2_file_pos_info *)buf;
56555747 current_byte_offset = le64_to_cpu(file_info->CurrentByteOffset);
56565748 sector_size = inode->i_sb->s_blocksize;
56575749
@@ -5667,12 +5759,11 @@ static int set_file_position_info(struct ksmbd_file *fp, char *buf) · 9 unmodified lines
56675759 return 0;
56685760 }
56695761
5670−static int set_file_mode_info(struct ksmbd_file *fp, char *buf)
5762+static int set_file_mode_info(struct ksmbd_file *fp,
5763+ struct smb2_file_mode_info *file_info)
56715764 {
5672− struct smb2_file_mode_info *file_info;
56735765 __le32 mode;
56745766
5675− file_info = (struct smb2_file_mode_info *)buf;
56765767 mode = file_info->Mode;
56775768
56785769 if ((mode & ~FILE_MODE_INFO_MASK) ||
@@ -5702,40 +5793,74 @@ static int set_file_mode_info(struct ksmbd_file *fp, char *buf) · 23 unmodified lines
57025793 * TODO: need to implement an error handling for STATUS_INFO_LENGTH_MISMATCH
57035794 */
57045795 static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
5705− int info_class, char *buf,
5796+ struct smb2_set_info_req *req,
57065797 struct ksmbd_share_config *share)
57075798 {
5708− switch (info_class) {
5799+ unsigned int buf_len = le32_to_cpu(req->BufferLength);
5800+
5801+ switch (req->FileInfoClass) {
57095802 case FILE_BASIC_INFORMATION:
5710− return set_file_basic_info(fp, buf, share);
5803+ {
5804+ if (buf_len < sizeof(struct smb2_file_basic_info))
5805+ return -EINVAL;
57115806
5807+ return set_file_basic_info(fp, (struct smb2_file_basic_info *)req->Buffer, share);
5808+ }
57125809 case FILE_ALLOCATION_INFORMATION:
5713− return set_file_allocation_info(work, fp, buf);
5810+ {
5811+ if (buf_len < sizeof(struct smb2_file_alloc_info))
5812+ return -EINVAL;
57145813
5814+ return set_file_allocation_info(work, fp,
5815+ (struct smb2_file_alloc_info *)req->Buffer);
5816+ }
57155817 case FILE_END_OF_FILE_INFORMATION:
5716− return set_end_of_file_info(work, fp, buf);
5818+ {
5819+ if (buf_len < sizeof(struct smb2_file_eof_info))
5820+ return -EINVAL;
57175821
5822+ return set_end_of_file_info(work, fp,
5823+ (struct smb2_file_eof_info *)req->Buffer);
5824+ }
57185825 case FILE_RENAME_INFORMATION:
5826+ {
57195827 if (!test_tree_conn_flag(work->tcon, KSMBD_TREE_CONN_FLAG_WRITABLE)) {
57205828 ksmbd_debug(SMB,
57215829 "User does not have write permission\n");
57225830 return -EACCES;
57235831 }
5724− return set_rename_info(work, fp, buf);
57255832
5833+ if (buf_len < sizeof(struct smb2_file_rename_info))
5834+ return -EINVAL;
5835+
5836+ return set_rename_info(work, fp,
5837+ (struct smb2_file_rename_info *)req->Buffer,
5838+ buf_len);
5839+ }
57265840 case FILE_LINK_INFORMATION:
5841+ {
5842+ if (buf_len < sizeof(struct smb2_file_link_info))
5843+ return -EINVAL;
5844+
57275845 return smb2_create_link(work, work->tcon->share_conf,
5728− (struct smb2_file_link_info *)buf, fp->filp,
5846+ (struct smb2_file_link_info *)req->Buffer,
5847+ buf_len, fp->filp,
57295848 work->sess->conn->local_nls);
5730−
5849+ }
57315850 case FILE_DISPOSITION_INFORMATION:
5851+ {
57325852 if (!test_tree_conn_flag(work->tcon, KSMBD_TREE_CONN_FLAG_WRITABLE)) {
57335853 ksmbd_debug(SMB,
57345854 "User does not have write permission\n");
57355855 return -EACCES;
57365856 }
5737− return set_file_disposition_info(fp, buf);
57385857
5858+ if (buf_len < sizeof(struct smb2_file_disposition_info))
5859+ return -EINVAL;
5860+
5861+ return set_file_disposition_info(fp,
5862+ (struct smb2_file_disposition_info *)req->Buffer);
5863+ }
57395864 case FILE_FULL_EA_INFORMATION:
57405865 {
57415866 if (!(fp->daccess & FILE_WRITE_EA_LE)) {
@@ -5744,18 +5869,29 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp, · 2 unmodified lines
57445869 return -EACCES;
57455870 }
57465871
5747− return smb2_set_ea((struct smb2_ea_info *)buf,
5748− &fp->filp->f_path);
5749− }
5872+ if (buf_len < sizeof(struct smb2_ea_info))
5873+ return -EINVAL;
57505874
5875+ return smb2_set_ea((struct smb2_ea_info *)req->Buffer,
5876+ buf_len, &fp->filp->f_path);
5877+ }
57515878 case FILE_POSITION_INFORMATION:
5752− return set_file_position_info(fp, buf);
5879+ {
5880+ if (buf_len < sizeof(struct smb2_file_pos_info))
5881+ return -EINVAL;
57535882
5883+ return set_file_position_info(fp, (struct smb2_file_pos_info *)req->Buffer);
5884+ }
57545885 case FILE_MODE_INFORMATION:
5755− return set_file_mode_info(fp, buf);
5886+ {
5887+ if (buf_len < sizeof(struct smb2_file_mode_info))
5888+ return -EINVAL;
5889+
5890+ return set_file_mode_info(fp, (struct smb2_file_mode_info *)req->Buffer);
5891+ }
57565892 }
57575893
5758− pr_err("Unimplemented Fileinfoclass :%d\n", info_class);
5894+ pr_err("Unimplemented Fileinfoclass :%d\n", req->FileInfoClass);
57595895 return -EOPNOTSUPP;
57605896 }
57615897
@@ -5816,8 +5952,7 @@ int smb2_set_info(struct ksmbd_work *work) · 54 unmodified lines
58165952 switch (req->InfoType) {
58175953 case SMB2_O_INFO_FILE:
58185954 ksmbd_debug(SMB, "GOT SMB2_O_INFO_FILE\n");
5819− rc = smb2_set_info_file(work, fp, req->FileInfoClass,
5820− req->Buffer, work->tcon->share_conf);
5955+ rc = smb2_set_info_file(work, fp, req, work->tcon->share_conf);
58215956 break;
58225957 case SMB2_O_INFO_SECURITY:
58235958 ksmbd_debug(SMB, "GOT SMB2_O_INFO_SECURITY\n");
@@ -8171,7 +8306,8 @@ void smb3_preauth_hash_rsp(struct ksmbd_work *work) · 2347 unmodified lines
81718306
81728307 WORK_BUFFERS(work, req, rsp);
81738308
8174− if (le16_to_cpu(req->Command) == SMB2_NEGOTIATE_HE)
8309+ if (le16_to_cpu(req->Command) == SMB2_NEGOTIATE_HE &&
8310+ conn->preauth_info)
81758311 ksmbd_gen_preauth_integrity_hash(conn, (char *)rsp,
81768312 conn->preauth_info->Preauth_HashValue);
81778313
@@ -8278,16 +8414,8 @@ int smb3_decrypt_req(struct ksmbd_work *work) · 100 unmodified lines
82788414 unsigned int buf_data_size = pdu_length + 4 -
82798415 sizeof(struct smb2_transform_hdr);
82808416 struct smb2_transform_hdr *tr_hdr = (struct smb2_transform_hdr *)buf;
8281− unsigned int orig_len = le32_to_cpu(tr_hdr->OriginalMessageSize);
82828417 int rc = 0;
82838418
8284− sess = ksmbd_session_lookup_all(conn, le64_to_cpu(tr_hdr->SessionId));
8285− if (!sess) {
8286− pr_err("invalid session id(%llx) in transform header\n",
8287− le64_to_cpu(tr_hdr->SessionId));
8288− return -ECONNABORTED;
8289− }
8290−
82918419 if (pdu_length + 4 <
82928420 sizeof(struct smb2_transform_hdr) + sizeof(struct smb2_hdr)) {
82938421 pr_err("Transform message is too small (%u)\n",
@@ -8295,11 +8423,19 @@ int smb3_decrypt_req(struct ksmbd_work *work) · 1 unmodified line
82958423 return -ECONNABORTED;
82968424 }
82978425
8298− if (pdu_length + 4 < orig_len + sizeof(struct smb2_transform_hdr)) {
8426+ if (pdu_length + 4 <
8427+ le32_to_cpu(tr_hdr->OriginalMessageSize) + sizeof(struct smb2_transform_hdr)) {
82998428 pr_err("Transform message is broken\n");
83008429 return -ECONNABORTED;
83018430 }
83028431
8432+ sess = ksmbd_session_lookup_all(conn, le64_to_cpu(tr_hdr->SessionId));
8433+ if (!sess) {
8434+ pr_err("invalid session id(%llx) in transform header\n",
8435+ le64_to_cpu(tr_hdr->SessionId));
8436+ return -ECONNABORTED;
8437+ }
8438+
83038439 iov[0].iov_base = buf;
83048440 iov[0].iov_len = sizeof(struct smb2_transform_hdr);
83058441 iov[1].iov_base = buf + sizeof(struct smb2_transform_hdr);
fs/ksmbd/smb2pdu.h+9−0
@@ -1464,6 +1464,15 @@ struct smb2_file_all_info { /* data block encoding of response to level 18 */ · 1463 unmodified lines
14641464 char FileName[1];
14651465 } __packed; /* level 18 Query */
14661466
1467+struct smb2_file_basic_info { /* data block encoding of response to level 18 */
1468+ __le64 CreationTime; /* Beginning of FILE_BASIC_INFO equivalent */
1469+ __le64 LastAccessTime;
1470+ __le64 LastWriteTime;
1471+ __le64 ChangeTime;
1472+ __le32 Attributes;
1473+ __u32 Pad1; /* End of FILE_BASIC_INFO_INFO equivalent */
1474+} __packed;
1475+
14671476 struct smb2_file_alt_name_info {
14681477 __le32 FileNameLength;
14691478 char FileName[0];
fs/ksmbd/smb_common.c+28−19
@@ -155,20 +155,7 @@ int ksmbd_verify_smb_message(struct ksmbd_work *work) · 154 unmodified lines
155155 */
156156 bool ksmbd_smb_request(struct ksmbd_conn *conn)
157157 {
158− int type = *(char *)conn->request_buf;
159−
160− switch (type) {
161− case RFC1002_SESSION_MESSAGE:
162− /* Regular SMB request */
163− return true;
164− case RFC1002_SESSION_KEEP_ALIVE:
165− ksmbd_debug(SMB, "RFC 1002 session keep alive\n");
166− break;
167− default:
168− ksmbd_debug(SMB, "RFC 1002 unknown request type 0x%x\n", type);
169− }
170−
171− return false;
158+ return conn->request_buf[0] == 0;
172159 }
173160
174161 static bool supported_protocol(int idx)
@@ -182,10 +169,12 @@ static bool supported_protocol(int idx) · 7 unmodified lines
182169 idx <= server_conf.max_protocol);
183170 }
184171
185−static char *next_dialect(char *dialect, int *next_off)
172+static char *next_dialect(char *dialect, int *next_off, int bcount)
186173 {
187174 dialect = dialect + *next_off;
188− *next_off = strlen(dialect);
175+ *next_off = strnlen(dialect, bcount);
176+ if (dialect[*next_off] != '\0')
177+ return NULL;
189178 return dialect;
190179 }
191180
@@ -200,7 +189,9 @@ static int ksmbd_lookup_dialect_by_name(char *cli_dialects, __le16 byte_count) · 8 unmodified lines
200189 dialect = cli_dialects;
201190 bcount = le16_to_cpu(byte_count);
202191 do {
203− dialect = next_dialect(dialect, &next);
192+ dialect = next_dialect(dialect, &next, bcount);
193+ if (!dialect)
194+ break;
204195 ksmbd_debug(SMB, "client requested dialect %s\n",
205196 dialect);
206197 if (!strcmp(dialect, smb1_protos[i].name)) {
@@ -248,13 +239,22 @@ int ksmbd_lookup_dialect_by_id(__le16 *cli_dialects, __le16 dialects_count) · 41 unmodified lines
248239
249240 static int ksmbd_negotiate_smb_dialect(void *buf)
250241 {
251− __le32 proto;
242+ int smb_buf_length = get_rfc1002_len(buf);
243+ __le32 proto = ((struct smb2_hdr *)buf)->ProtocolId;
252244
253− proto = ((struct smb2_hdr *)buf)->ProtocolId;
254245 if (proto == SMB2_PROTO_NUMBER) {
255246 struct smb2_negotiate_req *req;
247+ int smb2_neg_size =
248+ offsetof(struct smb2_negotiate_req, Dialects) - 4;
256249
257250 req = (struct smb2_negotiate_req *)buf;
251+ if (smb2_neg_size > smb_buf_length)
252+ goto err_out;
253+
254+ if (smb2_neg_size + le16_to_cpu(req->DialectCount) * sizeof(__le16) >
255+ smb_buf_length)
256+ goto err_out;
257+
258258 return ksmbd_lookup_dialect_by_id(req->Dialects,
259259 req->DialectCount);
260260 }
@@ -264,10 +264,19 @@ static int ksmbd_negotiate_smb_dialect(void *buf) · 3 unmodified lines
264264 struct smb_negotiate_req *req;
265265
266266 req = (struct smb_negotiate_req *)buf;
267+ if (le16_to_cpu(req->ByteCount) < 2)
268+ goto err_out;
269+
270+ if (offsetof(struct smb_negotiate_req, DialectsArray) - 4 +
271+ le16_to_cpu(req->ByteCount) > smb_buf_length) {
272+ goto err_out;
273+ }
274+
267275 return ksmbd_lookup_dialect_by_name(req->DialectsArray,
268276 req->ByteCount);
269277 }
270278
279+err_out:
271280 return BAD_PROT_ID;
272281 }
273282
fs/ksmbd/smb_common.h+0−8
@@ -48,14 +48,6 @@ · 47 unmodified lines
4848 #define CIFS_DEFAULT_IOSIZE (64 * 1024)
4949 #define MAX_CIFS_SMALL_BUFFER_SIZE 448 /* big enough for most */
5050
51−/* RFC 1002 session packet types */
52−#define RFC1002_SESSION_MESSAGE 0x00
53−#define RFC1002_SESSION_REQUEST 0x81
54−#define RFC1002_POSITIVE_SESSION_RESPONSE 0x82
55−#define RFC1002_NEGATIVE_SESSION_RESPONSE 0x83
56−#define RFC1002_RETARGET_SESSION_RESPONSE 0x84
57−#define RFC1002_SESSION_KEEP_ALIVE 0x85
58−
5951 /* Responses when opening a file. */
6052 #define F_SUPERSEDED 0
6153 #define F_OPENED 1
fs/ksmbd/smbacl.c+19−2
@@ -380,7 +380,7 @@ static void parse_dacl(struct user_namespace *user_ns, · 379 unmodified lines
380380 {
381381 int i, ret;
382382 int num_aces = 0;
383− int acl_size;
383+ unsigned int acl_size;
384384 char *acl_base;
385385 struct smb_ace **ppace;
386386 struct posix_acl_entry *cf_pace, *cf_pdace;
@@ -392,7 +392,7 @@ static void parse_dacl(struct user_namespace *user_ns, · 5 unmodified lines
392392 return;
393393
394394 /* validate that we do not go past end of acl */
395− if (end_of_acl <= (char *)pdacl ||
395+ if (end_of_acl < (char *)pdacl + sizeof(struct smb_acl) ||
396396 end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) {
397397 pr_err("ACL too small to parse DACL\n");
398398 return;
@@ -431,8 +431,22 @@ static void parse_dacl(struct user_namespace *user_ns, · 32 unmodified lines
431431 * user/group/other have no permissions
432432 */
433433 for (i = 0; i < num_aces; ++i) {
434+ if (end_of_acl - acl_base < acl_size)
435+ break;
436+
434437 ppace[i] = (struct smb_ace *)(acl_base + acl_size);
435438 acl_base = (char *)ppace[i];
439+ acl_size = offsetof(struct smb_ace, sid) +
440+ offsetof(struct smb_sid, sub_auth);
441+
442+ if (end_of_acl - acl_base < acl_size ||
443+ ppace[i]->sid.num_subauth > SID_MAX_SUB_AUTHORITIES ||
444+ (end_of_acl - acl_base <
445+ acl_size + sizeof(__le32) * ppace[i]->sid.num_subauth) ||
446+ (le16_to_cpu(ppace[i]->size) <
447+ acl_size + sizeof(__le32) * ppace[i]->sid.num_subauth))
448+ break;
449+
436450 acl_size = le16_to_cpu(ppace[i]->size);
437451 ppace[i]->access_req =
438452 smb_map_generic_desired_access(ppace[i]->access_req);
@@ -807,6 +821,9 @@ int parse_sec_desc(struct user_namespace *user_ns, struct smb_ntsd *pntsd, · 368 unmodified lines
807821 if (!pntsd)
808822 return -EIO;
809823
824+ if (acl_len < sizeof(struct smb_ntsd))
825+ return -EINVAL;
826+
810827 owner_sid_ptr = (struct smb_sid *)((char *)pntsd +
811828 le32_to_cpu(pntsd->osidoffset));
812829 group_sid_ptr = (struct smb_sid *)((char *)pntsd +
fs/ksmbd/transport_tcp.c+2−2
@@ -215,7 +215,7 @@ out_error: · 214 unmodified lines
215215 * ksmbd_kthread_fn() - listen to new SMB connections and callback server
216216 * @p: arguments to forker thread
217217 *
218− * Return: Returns a task_struct or ERR_PTR
218+ * Return: 0 on success, error number otherwise
219219 */
220220 static int ksmbd_kthread_fn(void *p)
221221 {
@@ -387,7 +387,7 @@ static void tcp_destroy_socket(struct socket *ksmbd_socket) · 165 unmodified lines
387387 /**
388388 * create_socket - create socket for ksmbd/0
389389 *
390− * Return: Returns a task_struct or ERR_PTR
390+ * Return: 0 on success, error number otherwise
391391 */
392392 static int create_socket(struct interface *iface)
393393 {
fs/netfs/read_helper.c+1−1
@@ -150,7 +150,7 @@ static void netfs_clear_unread(struct netfs_read_subrequest *subreq) · 149 unmodified lines
150150 {
151151 struct iov_iter iter;
152152
153− iov_iter_xarray(&iter, WRITE, &subreq->rreq->mapping->i_pages,
153+ iov_iter_xarray(&iter, READ, &subreq->rreq->mapping->i_pages,
154154 subreq->start + subreq->transferred,
155155 subreq->len - subreq->transferred);
156156 iov_iter_zero(iov_iter_count(&iter), &iter);
fs/nfs_common/grace.c+0−1
@@ -42,7 +42,6 @@ EXPORT_SYMBOL_GPL(locks_start_grace); · 41 unmodified lines
4242
4343 /**
4444 * locks_end_grace
45− * @net: net namespace that this lock manager belongs to
4645 * @lm: who this grace period is for
4746 *
4847 * Call this function to state that the given lock manager is ready to
fs/nfsd/filecache.c+1−1
@@ -542,7 +542,7 @@ nfsd_file_close_inode_sync(struct inode *inode) · 541 unmodified lines
542542 }
543543
544544 /**
545− * nfsd_file_close_inode_sync - attempt to forcibly close a nfsd_file
545+ * nfsd_file_close_inode - attempt a delayed close of a nfsd_file
546546 * @inode: inode of the file to attempt to remove
547547 *
548548 * Walk the whole hash bucket, looking for any files that correspond to "inode".
fs/nfsd/nfs4xdr.c+11−8
@@ -3544,15 +3544,18 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen, · 3543 unmodified lines
35443544 goto fail;
35453545 cd->rd_maxcount -= entry_bytes;
35463546 /*
3547− * RFC 3530 14.2.24 describes rd_dircount as only a "hint", so
3548− * let's always let through the first entry, at least:
3547+ * RFC 3530 14.2.24 describes rd_dircount as only a "hint", and
3548+ * notes that it could be zero. If it is zero, then the server
3549+ * should enforce only the rd_maxcount value.
35493550 */
3550− if (!cd->rd_dircount)
3551− goto fail;
3552− name_and_cookie = 4 + 4 * XDR_QUADLEN(namlen) + 8;
3553− if (name_and_cookie > cd->rd_dircount && cd->cookie_offset)
3554− goto fail;
3555− cd->rd_dircount -= min(cd->rd_dircount, name_and_cookie);
3551+ if (cd->rd_dircount) {
3552+ name_and_cookie = 4 + 4 * XDR_QUADLEN(namlen) + 8;
3553+ if (name_and_cookie > cd->rd_dircount && cd->cookie_offset)
3554+ goto fail;
3555+ cd->rd_dircount -= min(cd->rd_dircount, name_and_cookie);
3556+ if (!cd->rd_dircount)
3557+ cd->rd_maxcount = 0;
3558+ }
35563559
35573560 cd->cookie_offset = cookie_offset;
35583561 skip_entry:
fs/nfsd/nfsctl.c+5−2
@@ -793,7 +793,10 @@ out_close: · 792 unmodified lines
793793 svc_xprt_put(xprt);
794794 }
795795 out_err:
796− nfsd_destroy(net);
796+ if (!list_empty(&nn->nfsd_serv->sv_permsocks))
797+ nn->nfsd_serv->sv_nrthreads--;
798+ else
799+ nfsd_destroy(net);
797800 return err;
798801 }
799802
@@ -1545,7 +1548,7 @@ static int __init init_nfsd(void) · 745 unmodified lines
15451548 goto out_free_all;
15461549 return 0;
15471550 out_free_all:
1548− unregister_pernet_subsys(&nfsd_net_ops);
1551+ unregister_filesystem(&nfsd_fs_type);
15491552 out_free_exports:
15501553 remove_proc_entry("fs/nfs/exports", NULL);
15511554 remove_proc_entry("fs/nfs", NULL);
fs/overlayfs/dir.c+7−3
@@ -1219,9 +1219,13 @@ static int ovl_rename(struct user_namespace *mnt_userns, struct inode *olddir, · 1218 unmodified lines
12191219 goto out_dput;
12201220 }
12211221 } else {
1222− if (!d_is_negative(newdentry) &&
1223− (!new_opaque || !ovl_is_whiteout(newdentry)))
1224− goto out_dput;
1222+ if (!d_is_negative(newdentry)) {
1223+ if (!new_opaque || !ovl_is_whiteout(newdentry))
1224+ goto out_dput;
1225+ } else {
1226+ if (flags & RENAME_EXCHANGE)
1227+ goto out_dput;
1228+ }
12251229 }
12261230
12271231 if (olddentry == trap)
fs/overlayfs/file.c+14−1
@@ -296,6 +296,12 @@ static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *iter) · 295 unmodified lines
296296 if (ret)
297297 return ret;
298298
299+ ret = -EINVAL;
300+ if (iocb->ki_flags & IOCB_DIRECT &&
301+ (!real.file->f_mapping->a_ops ||
302+ !real.file->f_mapping->a_ops->direct_IO))
303+ goto out_fdput;
304+
299305 old_cred = ovl_override_creds(file_inode(file)->i_sb);
300306 if (is_sync_kiocb(iocb)) {
301307 ret = vfs_iter_read(real.file, iter, &iocb->ki_pos,
@@ -320,7 +326,7 @@ static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *iter) · 18 unmodified lines
320326 out:
321327 revert_creds(old_cred);
322328 ovl_file_accessed(file);
323−
329+out_fdput:
324330 fdput(real);
325331
326332 return ret;
@@ -349,6 +355,12 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter) · 22 unmodified lines
349355 if (ret)
350356 goto out_unlock;
351357
358+ ret = -EINVAL;
359+ if (iocb->ki_flags & IOCB_DIRECT &&
360+ (!real.file->f_mapping->a_ops ||
361+ !real.file->f_mapping->a_ops->direct_IO))
362+ goto out_fdput;
363+
352364 if (!ovl_should_sync(OVL_FS(inode->i_sb)))
353365 ifl &= ~(IOCB_DSYNC | IOCB_SYNC);
354366
@@ -384,6 +396,7 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter) · 29 unmodified lines
384396 }
385397 out:
386398 revert_creds(old_cred);
399+out_fdput:
387400 fdput(real);
388401
389402 out_unlock:
include/linux/cpumask.h+4−3
@@ -996,14 +996,15 @@ cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask) · 995 unmodified lines
996996 * cpumask; Typically used by bin_attribute to export cpumask bitmask
997997 * ABI.
998998 *
999− * Returns the length of how many bytes have been copied.
999+ * Returns the length of how many bytes have been copied, excluding
1000+ * terminating '\0'.
10001001 */
10011002 static inline ssize_t
10021003 cpumap_print_bitmask_to_buf(char *buf, const struct cpumask *mask,
10031004 loff_t off, size_t count)
10041005 {
10051006 return bitmap_print_bitmask_to_buf(buf, cpumask_bits(mask),
1006− nr_cpu_ids, off, count);
1007+ nr_cpu_ids, off, count) - 1;
10071008 }
10081009
10091010 /**
@@ -1018,7 +1019,7 @@ cpumap_print_list_to_buf(char *buf, const struct cpumask *mask, · 8 unmodified lines
10181019 loff_t off, size_t count)
10191020 {
10201021 return bitmap_print_list_to_buf(buf, cpumask_bits(mask),
1021− nr_cpu_ids, off, count);
1022+ nr_cpu_ids, off, count) - 1;
10221023 }
10231024
10241025 #if NR_CPUS <= BITS_PER_LONG
include/linux/etherdevice.h+1−1
@@ -314,7 +314,7 @@ static inline void ether_addr_copy(u8 *dst, const u8 *src) · 313 unmodified lines
314314 */
315315 static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
316316 {
317− ether_addr_copy(dev->dev_addr, addr);
317+ __dev_addr_set(dev, addr, ETH_ALEN);
318318 }
319319
320320 /**
include/linux/fwnode.h+8−3
@@ -22,10 +22,15 @@ struct device; · 21 unmodified lines
2222 * LINKS_ADDED: The fwnode has already be parsed to add fwnode links.
2323 * NOT_DEVICE: The fwnode will never be populated as a struct device.
2424 * INITIALIZED: The hardware corresponding to fwnode has been initialized.
25+ * NEEDS_CHILD_BOUND_ON_ADD: For this fwnode/device to probe successfully, its
26+ * driver needs its child devices to be bound with
27+ * their respective drivers as soon as they are
28+ * added.
2529 */
26−#define FWNODE_FLAG_LINKS_ADDED BIT(0)
27−#define FWNODE_FLAG_NOT_DEVICE BIT(1)
28−#define FWNODE_FLAG_INITIALIZED BIT(2)
30+#define FWNODE_FLAG_LINKS_ADDED BIT(0)
31+#define FWNODE_FLAG_NOT_DEVICE BIT(1)
32+#define FWNODE_FLAG_INITIALIZED BIT(2)
33+#define FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD BIT(3)
2934
3035 struct fwnode_handle {
3136 struct fwnode_handle *secondary;
include/linux/perf_event.h+3−1
@@ -684,7 +684,9 @@ struct perf_event { · 683 unmodified lines
684684 /*
685685 * timestamp shadows the actual context timing but it can
686686 * be safely used in NMI interrupt context. It reflects the
687− * context time as it was when the event was last scheduled in.
687+ * context time as it was when the event was last scheduled in,
688+ * or when ctx_sched_in failed to schedule the event because we
689+ * run out of PMC.
688690 *
689691 * ctx_time already accounts for ctx->timestamp. Therefore to
690692 * compute ctx_time for a sample, simply add perf_clock().
include/linux/platform_data/usb-omap1.h+2−0
@@ -48,6 +48,8 @@ struct omap_usb_config { · 47 unmodified lines
4848 u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
4949
5050 int (*ocpi_enable)(void);
51+
52+ void (*lb_reset)(void);
5153 };
5254
5355 #endif /* __LINUX_USB_OMAP1_H */
include/linux/sched.h+1−1
@@ -1720,7 +1720,7 @@ extern struct pid *cad_pid; · 1719 unmodified lines
17201720 #define tsk_used_math(p) ((p)->flags & PF_USED_MATH)
17211721 #define used_math() tsk_used_math(current)
17221722
1723−static inline bool is_percpu_thread(void)
1723+static __always_inline bool is_percpu_thread(void)
17241724 {
17251725 #ifdef CONFIG_SMP
17261726 return (current->flags & PF_NO_SETAFFINITY) &&
include/net/netfilter/ipv6/nf_defrag_ipv6.h+0−1
@@ -17,7 +17,6 @@ struct inet_frags_ctl; · 16 unmodified lines
1717 struct nft_ct_frag6_pernet {
1818 struct ctl_table_header *nf_frag_frags_hdr;
1919 struct fqdir *fqdir;
20− unsigned int users;
2120 };
2221
2322 #endif /* _NF_DEFRAG_IPV6_H */
include/net/netfilter/nf_tables.h+1−1
@@ -1202,7 +1202,7 @@ struct nft_object *nft_obj_lookup(const struct net *net, · 1201 unmodified lines
12021202
12031203 void nft_obj_notify(struct net *net, const struct nft_table *table,
12041204 struct nft_object *obj, u32 portid, u32 seq,
1205− int event, int family, int report, gfp_t gfp);
1205+ int event, u16 flags, int family, int report, gfp_t gfp);
12061206
12071207 /**
12081208 * struct nft_object_type - stateful object type
include/net/netns/netfilter.h+6−0
@@ -27,5 +27,11 @@ struct netns_nf { · 26 unmodified lines
2727 #if IS_ENABLED(CONFIG_DECNET)
2828 struct nf_hook_entries __rcu *hooks_decnet[NF_DN_NUMHOOKS];
2929 #endif
30+#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV4)
31+ unsigned int defrag_ipv4_users;
32+#endif
33+#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
34+ unsigned int defrag_ipv6_users;
35+#endif
3036 };
3137 #endif
include/net/sock.h+1−0
@@ -307,6 +307,7 @@ struct bpf_local_storage; · 306 unmodified lines
307307 * @sk_priority: %SO_PRIORITY setting
308308 * @sk_type: socket type (%SOCK_STREAM, etc)
309309 * @sk_protocol: which protocol this socket belongs in this network family
310+ * @sk_peer_lock: lock protecting @sk_peer_pid and @sk_peer_cred
310311 * @sk_peer_pid: &struct pid for this socket's peer
311312 * @sk_peer_cred: %SO_PEERCRED setting
312313 * @sk_rcvlowat: %SO_RCVLOWAT setting
include/soc/mscc/ocelot_vcap.h+2−2
@@ -704,7 +704,7 @@ int ocelot_vcap_filter_add(struct ocelot *ocelot, · 703 unmodified lines
704704 int ocelot_vcap_filter_del(struct ocelot *ocelot,
705705 struct ocelot_vcap_filter *rule);
706706 struct ocelot_vcap_filter *
707−ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block, int id,
708− bool tc_offload);
707+ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block,
708+ unsigned long cookie, bool tc_offload);
709709
710710 #endif /* _OCELOT_VCAP_H_ */
include/trace/events/cachefiles.h+3−3
@@ -178,7 +178,7 @@ TRACE_EVENT(cachefiles_unlink, · 177 unmodified lines
178178 ),
179179
180180 TP_fast_assign(
181− __entry->obj = obj->fscache.debug_id;
181+ __entry->obj = obj ? obj->fscache.debug_id : UINT_MAX;
182182 __entry->de = de;
183183 __entry->why = why;
184184 ),
@@ -205,7 +205,7 @@ TRACE_EVENT(cachefiles_rename, · 20 unmodified lines
205205 ),
206206
207207 TP_fast_assign(
208− __entry->obj = obj->fscache.debug_id;
208+ __entry->obj = obj ? obj->fscache.debug_id : UINT_MAX;
209209 __entry->de = de;
210210 __entry->to = to;
211211 __entry->why = why;
@@ -305,7 +305,7 @@ TRACE_EVENT(cachefiles_mark_buried, · 93 unmodified lines
305305 ),
306306
307307 TP_fast_assign(
308− __entry->obj = obj->fscache.debug_id;
308+ __entry->obj = obj ? obj->fscache.debug_id : UINT_MAX;
309309 __entry->de = de;
310310 __entry->why = why;
311311 ),
include/uapi/linux/hyperv.h+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626 #ifndef _UAPI_HYPERV_H
2727 #define _UAPI_HYPERV_H
2828
29−#include <linux/uuid.h>
29+#include <linux/types.h>
3030
3131 /*
3232 * Framework version for util services.
include/uapi/linux/xfrm.h+9−6
@@ -213,13 +213,13 @@ enum { · 212 unmodified lines
213213 XFRM_MSG_GETSPDINFO,
214214 #define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO
215215
216+ XFRM_MSG_MAPPING,
217+#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING
218+
216219 XFRM_MSG_SETDEFAULT,
217220 #define XFRM_MSG_SETDEFAULT XFRM_MSG_SETDEFAULT
218221 XFRM_MSG_GETDEFAULT,
219222 #define XFRM_MSG_GETDEFAULT XFRM_MSG_GETDEFAULT
220−
221− XFRM_MSG_MAPPING,
222−#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING
223223 __XFRM_MSG_MAX
224224 };
225225 #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -514,9 +514,12 @@ struct xfrm_user_offload { · 288 unmodified lines
514514 #define XFRM_OFFLOAD_INBOUND 2
515515
516516 struct xfrm_userpolicy_default {
517−#define XFRM_USERPOLICY_DIRMASK_MAX (sizeof(__u8) * 8)
518− __u8 dirmask;
519− __u8 action;
517+#define XFRM_USERPOLICY_UNSPEC 0
518+#define XFRM_USERPOLICY_BLOCK 1
519+#define XFRM_USERPOLICY_ACCEPT 2
520+ __u8 in;
521+ __u8 fwd;
522+ __u8 out;
520523 };
521524
522525 #ifndef __KERNEL__
kernel/bpf/stackmap.c+2−1
@@ -63,7 +63,8 @@ static inline int stack_map_data_size(struct bpf_map *map) · 62 unmodified lines
6363
6464 static int prealloc_elems_and_freelist(struct bpf_stack_map *smap)
6565 {
66− u32 elem_size = sizeof(struct stack_map_bucket) + smap->map.value_size;
66+ u64 elem_size = sizeof(struct stack_map_bucket) +
67+ (u64)smap->map.value_size;
6768 int err;
6869
6970 smap->elems = bpf_map_area_alloc(elem_size * smap->map.max_entries,
kernel/events/core.c+30−4
@@ -3707,6 +3707,29 @@ static noinline int visit_groups_merge(struct perf_cpu_context *cpuctx, · 3706 unmodified lines
37073707 return 0;
37083708 }
37093709
3710+static inline bool event_update_userpage(struct perf_event *event)
3711+{
3712+ if (likely(!atomic_read(&event->mmap_count)))
3713+ return false;
3714+
3715+ perf_event_update_time(event);
3716+ perf_set_shadow_time(event, event->ctx);
3717+ perf_event_update_userpage(event);
3718+
3719+ return true;
3720+}
3721+
3722+static inline void group_update_userpage(struct perf_event *group_event)
3723+{
3724+ struct perf_event *event;
3725+
3726+ if (!event_update_userpage(group_event))
3727+ return;
3728+
3729+ for_each_sibling_event(event, group_event)
3730+ event_update_userpage(event);
3731+}
3732+
37103733 static int merge_sched_in(struct perf_event *event, void *data)
37113734 {
37123735 struct perf_event_context *ctx = event->ctx;
@@ -3725,14 +3748,15 @@ static int merge_sched_in(struct perf_event *event, void *data) · 12 unmodified lines
37253748 }
37263749
37273750 if (event->state == PERF_EVENT_STATE_INACTIVE) {
3751+ *can_add_hw = 0;
37283752 if (event->attr.pinned) {
37293753 perf_cgroup_event_disable(event, ctx);
37303754 perf_event_set_state(event, PERF_EVENT_STATE_ERROR);
3755+ } else {
3756+ ctx->rotate_necessary = 1;
3757+ perf_mux_hrtimer_restart(cpuctx);
3758+ group_update_userpage(event);
37313759 }
3732−
3733− *can_add_hw = 0;
3734− ctx->rotate_necessary = 1;
3735− perf_mux_hrtimer_restart(cpuctx);
37363760 }
37373761
37383762 return 0;
@@ -6324,6 +6348,8 @@ accounting: · 2585 unmodified lines
63246348
63256349 ring_buffer_attach(event, rb);
63266350
6351+ perf_event_update_time(event);
6352+ perf_set_shadow_time(event, event->ctx);
63276353 perf_event_init_userpage(event);
63286354 perf_event_update_userpage(event);
63296355 } else {
kernel/sched/debug.c+7−1
@@ -173,16 +173,22 @@ static ssize_t sched_scaling_write(struct file *filp, const char __user *ubuf, · 172 unmodified lines
173173 size_t cnt, loff_t *ppos)
174174 {
175175 char buf[16];
176+ unsigned int scaling;
176177
177178 if (cnt > 15)
178179 cnt = 15;
179180
180181 if (copy_from_user(&buf, ubuf, cnt))
181182 return -EFAULT;
183+ buf[cnt] = '\0';
182184
183− if (kstrtouint(buf, 10, &sysctl_sched_tunable_scaling))
185+ if (kstrtouint(buf, 10, &scaling))
184186 return -EINVAL;
185187
188+ if (scaling >= SCHED_TUNABLESCALING_END)
189+ return -EINVAL;
190+
191+ sysctl_sched_tunable_scaling = scaling;
186192 if (sched_update_scaling())
187193 return -EINVAL;
188194
kernel/sched/fair.c+5−1
@@ -4936,8 +4936,12 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq) · 4935 unmodified lines
49364936 /* update hierarchical throttle state */
49374937 walk_tg_tree_from(cfs_rq->tg, tg_nop, tg_unthrottle_up, (void *)rq);
49384938
4939− if (!cfs_rq->load.weight)
4939+ /* Nothing to run but something to decay (on_list)? Complete the branch */
4940+ if (!cfs_rq->load.weight) {
4941+ if (cfs_rq->on_list)
4942+ goto unthrottle_throttle;
49404943 return;
4944+ }
49414945
49424946 task_delta = cfs_rq->h_nr_running;
49434947 idle_task_delta = cfs_rq->idle_h_nr_running;
net/bridge/br_netlink.c+2−1
@@ -1666,7 +1666,8 @@ static size_t br_get_linkxstats_size(const struct net_device *dev, int attr) · 1665 unmodified lines
16661666 }
16671667
16681668 return numvls * nla_total_size(sizeof(struct bridge_vlan_xstats)) +
1669− nla_total_size(sizeof(struct br_mcast_stats)) +
1669+ nla_total_size_64bit(sizeof(struct br_mcast_stats)) +
1670+ (p ? nla_total_size_64bit(sizeof(p->stp_xstats)) : 0) +
16701671 nla_total_size(0);
16711672 }
16721673
net/core/rtnetlink.c+1−1
@@ -5262,7 +5262,7 @@ nla_put_failure: · 5261 unmodified lines
52625262 static size_t if_nlmsg_stats_size(const struct net_device *dev,
52635263 u32 filter_mask)
52645264 {
5265− size_t size = 0;
5265+ size_t size = NLMSG_ALIGN(sizeof(struct if_stats_msg));
52665266
52675267 if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_64, 0))
52685268 size += nla_total_size_64bit(sizeof(struct rtnl_link_stats64));
net/dsa/tag_dsa.c+1−1
@@ -210,7 +210,7 @@ static struct sk_buff *dsa_rcv_ll(struct sk_buff *skb, struct net_device *dev, · 209 unmodified lines
210210 cmd = dsa_header[0] >> 6;
211211 switch (cmd) {
212212 case DSA_CMD_FORWARD:
213− trunk = !!(dsa_header[1] & 7);
213+ trunk = !!(dsa_header[1] & 4);
214214 break;
215215
216216 case DSA_CMD_TO_CPU:
net/ipv4/inet_hashtables.c+3−1
@@ -242,8 +242,10 @@ static inline int compute_score(struct sock *sk, struct net *net, · 241 unmodified lines
242242
243243 if (!inet_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif))
244244 return -1;
245+ score = sk->sk_bound_dev_if ? 2 : 1;
245246
246− score = sk->sk_family == PF_INET ? 2 : 1;
247+ if (sk->sk_family == PF_INET)
248+ score++;
247249 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())
248250 score++;
249251 }
net/ipv4/netfilter/nf_defrag_ipv4.c+9−21
@@ -20,13 +20,8 @@ · 19 unmodified lines
2020 #endif
2121 #include <net/netfilter/nf_conntrack_zones.h>
2222
23−static unsigned int defrag4_pernet_id __read_mostly;
2423 static DEFINE_MUTEX(defrag4_mutex);
2524
26−struct defrag4_pernet {
27− unsigned int users;
28−};
29−
3025 static int nf_ct_ipv4_gather_frags(struct net *net, struct sk_buff *skb,
3126 u_int32_t user)
3227 {
@@ -111,19 +106,15 @@ static const struct nf_hook_ops ipv4_defrag_ops[] = { · 78 unmodified lines
111106
112107 static void __net_exit defrag4_net_exit(struct net *net)
113108 {
114− struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id);
115−
116− if (nf_defrag->users) {
109+ if (net->nf.defrag_ipv4_users) {
117110 nf_unregister_net_hooks(net, ipv4_defrag_ops,
118111 ARRAY_SIZE(ipv4_defrag_ops));
119− nf_defrag->users = 0;
112+ net->nf.defrag_ipv4_users = 0;
120113 }
121114 }
122115
123116 static struct pernet_operations defrag4_net_ops = {
124117 .exit = defrag4_net_exit,
125− .id = &defrag4_pernet_id,
126− .size = sizeof(struct defrag4_pernet),
127118 };
128119
129120 static int __init nf_defrag_init(void)
@@ -138,24 +129,23 @@ static void __exit nf_defrag_fini(void) · 8 unmodified lines
138129
139130 int nf_defrag_ipv4_enable(struct net *net)
140131 {
141− struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id);
142132 int err = 0;
143133
144134 mutex_lock(&defrag4_mutex);
145− if (nf_defrag->users == UINT_MAX) {
135+ if (net->nf.defrag_ipv4_users == UINT_MAX) {
146136 err = -EOVERFLOW;
147137 goto out_unlock;
148138 }
149139
150− if (nf_defrag->users) {
151− nf_defrag->users++;
140+ if (net->nf.defrag_ipv4_users) {
141+ net->nf.defrag_ipv4_users++;
152142 goto out_unlock;
153143 }
154144
155145 err = nf_register_net_hooks(net, ipv4_defrag_ops,
156146 ARRAY_SIZE(ipv4_defrag_ops));
157147 if (err == 0)
158− nf_defrag->users = 1;
148+ net->nf.defrag_ipv4_users = 1;
159149
160150 out_unlock:
161151 mutex_unlock(&defrag4_mutex);
@@ -165,12 +155,10 @@ EXPORT_SYMBOL_GPL(nf_defrag_ipv4_enable); · 3 unmodified lines
165155
166156 void nf_defrag_ipv4_disable(struct net *net)
167157 {
168− struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id);
169−
170158 mutex_lock(&defrag4_mutex);
171− if (nf_defrag->users) {
172− nf_defrag->users--;
173− if (nf_defrag->users == 0)
159+ if (net->nf.defrag_ipv4_users) {
160+ net->nf.defrag_ipv4_users--;
161+ if (net->nf.defrag_ipv4_users == 0)
174162 nf_unregister_net_hooks(net, ipv4_defrag_ops,
175163 ARRAY_SIZE(ipv4_defrag_ops));
176164 }
net/ipv4/udp.c+2−1
@@ -390,7 +390,8 @@ static int compute_score(struct sock *sk, struct net *net, · 389 unmodified lines
390390 dif, sdif);
391391 if (!dev_match)
392392 return -1;
393− score += 4;
393+ if (sk->sk_bound_dev_if)
394+ score += 4;
394395
395396 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())
396397 score++;
net/ipv6/inet6_hashtables.c+1−1
@@ -106,7 +106,7 @@ static inline int compute_score(struct sock *sk, struct net *net, · 105 unmodified lines
106106 if (!inet_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif))
107107 return -1;
108108
109− score = 1;
109+ score = sk->sk_bound_dev_if ? 2 : 1;
110110 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())
111111 score++;
112112 }
net/ipv6/netfilter/nf_conntrack_reasm.c+1−1
@@ -33,7 +33,7 @@ · 32 unmodified lines
3333
3434 static const char nf_frags_cache_name[] = "nf-frags";
3535
36−unsigned int nf_frag_pernet_id __read_mostly;
36+static unsigned int nf_frag_pernet_id __read_mostly;
3737 static struct inet_frags nf_frags;
3838
3939 static struct nft_ct_frag6_pernet *nf_frag_pernet(struct net *net)
net/ipv6/netfilter/nf_defrag_ipv6_hooks.c+9−16
@@ -25,8 +25,6 @@ · 24 unmodified lines
2525 #include <net/netfilter/nf_conntrack_zones.h>
2626 #include <net/netfilter/ipv6/nf_defrag_ipv6.h>
2727
28−extern unsigned int nf_frag_pernet_id;
29−
3028 static DEFINE_MUTEX(defrag6_mutex);
3129
3230 static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum,
@@ -91,12 +89,10 @@ static const struct nf_hook_ops ipv6_defrag_ops[] = { · 58 unmodified lines
9189
9290 static void __net_exit defrag6_net_exit(struct net *net)
9391 {
94− struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id);
95−
96− if (nf_frag->users) {
92+ if (net->nf.defrag_ipv6_users) {
9793 nf_unregister_net_hooks(net, ipv6_defrag_ops,
9894 ARRAY_SIZE(ipv6_defrag_ops));
99− nf_frag->users = 0;
95+ net->nf.defrag_ipv6_users = 0;
10096 }
10197 }
10298
@@ -134,24 +130,23 @@ static void __exit nf_defrag_fini(void) · 31 unmodified lines
134130
135131 int nf_defrag_ipv6_enable(struct net *net)
136132 {
137− struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id);
138133 int err = 0;
139134
140135 mutex_lock(&defrag6_mutex);
141− if (nf_frag->users == UINT_MAX) {
136+ if (net->nf.defrag_ipv6_users == UINT_MAX) {
142137 err = -EOVERFLOW;
143138 goto out_unlock;
144139 }
145140
146− if (nf_frag->users) {
147− nf_frag->users++;
141+ if (net->nf.defrag_ipv6_users) {
142+ net->nf.defrag_ipv6_users++;
148143 goto out_unlock;
149144 }
150145
151146 err = nf_register_net_hooks(net, ipv6_defrag_ops,
152147 ARRAY_SIZE(ipv6_defrag_ops));
153148 if (err == 0)
154− nf_frag->users = 1;
149+ net->nf.defrag_ipv6_users = 1;
155150
156151 out_unlock:
157152 mutex_unlock(&defrag6_mutex);
@@ -161,12 +156,10 @@ EXPORT_SYMBOL_GPL(nf_defrag_ipv6_enable); · 3 unmodified lines
161156
162157 void nf_defrag_ipv6_disable(struct net *net)
163158 {
164− struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id);
165−
166159 mutex_lock(&defrag6_mutex);
167− if (nf_frag->users) {
168− nf_frag->users--;
169− if (nf_frag->users == 0)
160+ if (net->nf.defrag_ipv6_users) {
161+ net->nf.defrag_ipv6_users--;
162+ if (net->nf.defrag_ipv6_users == 0)
170163 nf_unregister_net_hooks(net, ipv6_defrag_ops,
171164 ARRAY_SIZE(ipv6_defrag_ops));
172165 }
net/ipv6/udp.c+2−1
@@ -133,7 +133,8 @@ static int compute_score(struct sock *sk, struct net *net, · 132 unmodified lines
133133 dev_match = udp_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif);
134134 if (!dev_match)
135135 return -1;
136− score++;
136+ if (sk->sk_bound_dev_if)
137+ score++;
137138
138139 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())
139140 score++;
net/netfilter/nf_tables_api.c+64−27
@@ -780,6 +780,7 @@ static void nf_tables_table_notify(const struct nft_ctx *ctx, int event) · 779 unmodified lines
780780 {
781781 struct nftables_pernet *nft_net;
782782 struct sk_buff *skb;
783+ u16 flags = 0;
783784 int err;
784785
785786 if (!ctx->report &&
@@ -790,8 +791,11 @@ static void nf_tables_table_notify(const struct nft_ctx *ctx, int event) · 4 unmodified lines
790791 if (skb == NULL)
791792 goto err;
792793
794+ if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL))
795+ flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL);
796+
793797 err = nf_tables_fill_table_info(skb, ctx->net, ctx->portid, ctx->seq,
794− event, 0, ctx->family, ctx->table);
798+ event, flags, ctx->family, ctx->table);
795799 if (err < 0) {
796800 kfree_skb(skb);
797801 goto err;
@@ -1563,6 +1567,7 @@ static void nf_tables_chain_notify(const struct nft_ctx *ctx, int event) · 765 unmodified lines
15631567 {
15641568 struct nftables_pernet *nft_net;
15651569 struct sk_buff *skb;
1570+ u16 flags = 0;
15661571 int err;
15671572
15681573 if (!ctx->report &&
@@ -1573,8 +1578,11 @@ static void nf_tables_chain_notify(const struct nft_ctx *ctx, int event) · 4 unmodified lines
15731578 if (skb == NULL)
15741579 goto err;
15751580
1581+ if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL))
1582+ flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL);
1583+
15761584 err = nf_tables_fill_chain_info(skb, ctx->net, ctx->portid, ctx->seq,
1577− event, 0, ctx->family, ctx->table,
1585+ event, flags, ctx->family, ctx->table,
15781586 ctx->chain);
15791587 if (err < 0) {
15801588 kfree_skb(skb);
@@ -2866,8 +2874,7 @@ static int nf_tables_fill_rule_info(struct sk_buff *skb, struct net *net, · 1285 unmodified lines
28662874 u32 flags, int family,
28672875 const struct nft_table *table,
28682876 const struct nft_chain *chain,
2869− const struct nft_rule *rule,
2870− const struct nft_rule *prule)
2877+ const struct nft_rule *rule, u64 handle)
28712878 {
28722879 struct nlmsghdr *nlh;
28732880 const struct nft_expr *expr, *next;
@@ -2887,9 +2894,8 @@ static int nf_tables_fill_rule_info(struct sk_buff *skb, struct net *net, · 13 unmodified lines
28872894 NFTA_RULE_PAD))
28882895 goto nla_put_failure;
28892896
2890− if (event != NFT_MSG_DELRULE && prule) {
2891− if (nla_put_be64(skb, NFTA_RULE_POSITION,
2892− cpu_to_be64(prule->handle),
2897+ if (event != NFT_MSG_DELRULE && handle) {
2898+ if (nla_put_be64(skb, NFTA_RULE_POSITION, cpu_to_be64(handle),
28932899 NFTA_RULE_PAD))
28942900 goto nla_put_failure;
28952901 }
@@ -2925,7 +2931,10 @@ static void nf_tables_rule_notify(const struct nft_ctx *ctx, · 29 unmodified lines
29252931 const struct nft_rule *rule, int event)
29262932 {
29272933 struct nftables_pernet *nft_net = nft_pernet(ctx->net);
2934+ const struct nft_rule *prule;
29282935 struct sk_buff *skb;
2936+ u64 handle = 0;
2937+ u16 flags = 0;
29292938 int err;
29302939
29312940 if (!ctx->report &&
@@ -2936,9 +2945,20 @@ static void nf_tables_rule_notify(const struct nft_ctx *ctx, · 4 unmodified lines
29362945 if (skb == NULL)
29372946 goto err;
29382947
2948+ if (event == NFT_MSG_NEWRULE &&
2949+ !list_is_first(&rule->list, &ctx->chain->rules) &&
2950+ !list_is_last(&rule->list, &ctx->chain->rules)) {
2951+ prule = list_prev_entry(rule, list);
2952+ handle = prule->handle;
2953+ }
2954+ if (ctx->flags & (NLM_F_APPEND | NLM_F_REPLACE))
2955+ flags |= NLM_F_APPEND;
2956+ if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL))
2957+ flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL);
2958+
29392959 err = nf_tables_fill_rule_info(skb, ctx->net, ctx->portid, ctx->seq,
2940− event, 0, ctx->family, ctx->table,
2941− ctx->chain, rule, NULL);
2960+ event, flags, ctx->family, ctx->table,
2961+ ctx->chain, rule, handle);
29422962 if (err < 0) {
29432963 kfree_skb(skb);
29442964 goto err;
@@ -2964,6 +2984,7 @@ static int __nf_tables_dump_rules(struct sk_buff *skb, · 19 unmodified lines
29642984 struct net *net = sock_net(skb->sk);
29652985 const struct nft_rule *rule, *prule;
29662986 unsigned int s_idx = cb->args[0];
2987+ u64 handle;
29672988
29682989 prule = NULL;
29692990 list_for_each_entry_rcu(rule, &chain->rules, list) {
@@ -2975,12 +2996,17 @@ static int __nf_tables_dump_rules(struct sk_buff *skb, · 5 unmodified lines
29752996 memset(&cb->args[1], 0,
29762997 sizeof(cb->args) - sizeof(cb->args[0]));
29772998 }
2999+ if (prule)
3000+ handle = prule->handle;
3001+ else
3002+ handle = 0;
3003+
29783004 if (nf_tables_fill_rule_info(skb, net, NETLINK_CB(cb->skb).portid,
29793005 cb->nlh->nlmsg_seq,
29803006 NFT_MSG_NEWRULE,
29813007 NLM_F_MULTI | NLM_F_APPEND,
29823008 table->family,
2983− table, chain, rule, prule) < 0)
3009+ table, chain, rule, handle) < 0)
29843010 return 1;
29853011
29863012 nl_dump_check_consistent(cb, nlmsg_hdr(skb));
@@ -3143,7 +3169,7 @@ static int nf_tables_getrule(struct sk_buff *skb, const struct nfnl_info *info, · 156 unmodified lines
31433169
31443170 err = nf_tables_fill_rule_info(skb2, net, NETLINK_CB(skb).portid,
31453171 info->nlh->nlmsg_seq, NFT_MSG_NEWRULE, 0,
3146− family, table, chain, rule, NULL);
3172+ family, table, chain, rule, 0);
31473173 if (err < 0)
31483174 goto err_fill_rule_info;
31493175
@@ -3403,17 +3429,15 @@ static int nf_tables_newrule(struct sk_buff *skb, const struct nfnl_info *info, · 253 unmodified lines
34033429 }
34043430
34053431 if (info->nlh->nlmsg_flags & NLM_F_REPLACE) {
3432+ err = nft_delrule(&ctx, old_rule);
3433+ if (err < 0)
3434+ goto err_destroy_flow_rule;
3435+
34063436 trans = nft_trans_rule_add(&ctx, NFT_MSG_NEWRULE, rule);
34073437 if (trans == NULL) {
34083438 err = -ENOMEM;
34093439 goto err_destroy_flow_rule;
34103440 }
3411− err = nft_delrule(&ctx, old_rule);
3412− if (err < 0) {
3413− nft_trans_destroy(trans);
3414− goto err_destroy_flow_rule;
3415− }
3416−
34173441 list_add_tail_rcu(&rule->list, &old_rule->list);
34183442 } else {
34193443 trans = nft_trans_rule_add(&ctx, NFT_MSG_NEWRULE, rule);
@@ -3943,8 +3967,9 @@ static void nf_tables_set_notify(const struct nft_ctx *ctx, · 523 unmodified lines
39433967 gfp_t gfp_flags)
39443968 {
39453969 struct nftables_pernet *nft_net = nft_pernet(ctx->net);
3946− struct sk_buff *skb;
39473970 u32 portid = ctx->portid;
3971+ struct sk_buff *skb;
3972+ u16 flags = 0;
39483973 int err;
39493974
39503975 if (!ctx->report &&
@@ -3955,7 +3980,10 @@ static void nf_tables_set_notify(const struct nft_ctx *ctx, · 4 unmodified lines
39553980 if (skb == NULL)
39563981 goto err;
39573982
3958− err = nf_tables_fill_set(skb, ctx, set, event, 0);
3983+ if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL))
3984+ flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL);
3985+
3986+ err = nf_tables_fill_set(skb, ctx, set, event, flags);
39593987 if (err < 0) {
39603988 kfree_skb(skb);
39613989 goto err;
@@ -5231,12 +5259,13 @@ static int nf_tables_getsetelem(struct sk_buff *skb, · 1269 unmodified lines
52315259 static void nf_tables_setelem_notify(const struct nft_ctx *ctx,
52325260 const struct nft_set *set,
52335261 const struct nft_set_elem *elem,
5234− int event, u16 flags)
5262+ int event)
52355263 {
52365264 struct nftables_pernet *nft_net;
52375265 struct net *net = ctx->net;
52385266 u32 portid = ctx->portid;
52395267 struct sk_buff *skb;
5268+ u16 flags = 0;
52405269 int err;
52415270
52425271 if (!ctx->report && !nfnetlink_has_listeners(net, NFNLGRP_NFTABLES))
@@ -5246,6 +5275,9 @@ static void nf_tables_setelem_notify(const struct nft_ctx *ctx, · 3 unmodified lines
52465275 if (skb == NULL)
52475276 goto err;
52485277
5278+ if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL))
5279+ flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL);
5280+
52495281 err = nf_tables_fill_setelem_info(skb, ctx, 0, portid, event, flags,
52505282 set, elem);
52515283 if (err < 0) {
@@ -6921,7 +6953,7 @@ static int nf_tables_delobj(struct sk_buff *skb, const struct nfnl_info *info, · 1669 unmodified lines
69216953
69226954 void nft_obj_notify(struct net *net, const struct nft_table *table,
69236955 struct nft_object *obj, u32 portid, u32 seq, int event,
6924− int family, int report, gfp_t gfp)
6956+ u16 flags, int family, int report, gfp_t gfp)
69256957 {
69266958 struct nftables_pernet *nft_net = nft_pernet(net);
69276959 struct sk_buff *skb;
@@ -6946,8 +6978,9 @@ void nft_obj_notify(struct net *net, const struct nft_table *table, · 18 unmodified lines
69466978 if (skb == NULL)
69476979 goto err;
69486980
6949− err = nf_tables_fill_obj_info(skb, net, portid, seq, event, 0, family,
6950− table, obj, false);
6981+ err = nf_tables_fill_obj_info(skb, net, portid, seq, event,
6982+ flags & (NLM_F_CREATE | NLM_F_EXCL),
6983+ family, table, obj, false);
69516984 if (err < 0) {
69526985 kfree_skb(skb);
69536986 goto err;
@@ -6964,7 +6997,7 @@ static void nf_tables_obj_notify(const struct nft_ctx *ctx, · 10 unmodified lines
69646997 struct nft_object *obj, int event)
69656998 {
69666999 nft_obj_notify(ctx->net, ctx->table, obj, ctx->portid, ctx->seq, event,
6967− ctx->family, ctx->report, GFP_KERNEL);
7000+ ctx->flags, ctx->family, ctx->report, GFP_KERNEL);
69687001 }
69697002
69707003 /*
@@ -7745,6 +7778,7 @@ static void nf_tables_flowtable_notify(struct nft_ctx *ctx, · 774 unmodified lines
77457778 {
77467779 struct nftables_pernet *nft_net = nft_pernet(ctx->net);
77477780 struct sk_buff *skb;
7781+ u16 flags = 0;
77487782 int err;
77497783
77507784 if (!ctx->report &&
@@ -7755,8 +7789,11 @@ static void nf_tables_flowtable_notify(struct nft_ctx *ctx, · 4 unmodified lines
77557789 if (skb == NULL)
77567790 goto err;
77577791
7792+ if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL))
7793+ flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL);
7794+
77587795 err = nf_tables_fill_flowtable_info(skb, ctx->net, ctx->portid,
7759− ctx->seq, event, 0,
7796+ ctx->seq, event, flags,
77607797 ctx->family, flowtable, hook_list);
77617798 if (err < 0) {
77627799 kfree_skb(skb);
@@ -8634,7 +8671,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) · 871 unmodified lines
86348671 nft_setelem_activate(net, te->set, &te->elem);
86358672 nf_tables_setelem_notify(&trans->ctx, te->set,
86368673 &te->elem,
8637− NFT_MSG_NEWSETELEM, 0);
8674+ NFT_MSG_NEWSETELEM);
86388675 nft_trans_destroy(trans);
86398676 break;
86408677 case NFT_MSG_DELSETELEM:
@@ -8642,7 +8679,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) · 1 unmodified line
86428679
86438680 nf_tables_setelem_notify(&trans->ctx, te->set,
86448681 &te->elem,
8645− NFT_MSG_DELSETELEM, 0);
8682+ NFT_MSG_DELSETELEM);
86468683 nft_setelem_remove(net, te->set, &te->elem);
86478684 if (!nft_setelem_is_catchall(te->set, &te->elem)) {
86488685 atomic_dec(&te->set->nelems);
net/netfilter/nft_quota.c+1−1
@@ -60,7 +60,7 @@ static void nft_quota_obj_eval(struct nft_object *obj, · 59 unmodified lines
6060 if (overquota &&
6161 !test_and_set_bit(NFT_QUOTA_DEPLETED_BIT, &priv->flags))
6262 nft_obj_notify(nft_net(pkt), obj->key.table, obj, 0, 0,
63− NFT_MSG_NEWOBJ, nft_pf(pkt), 0, GFP_ATOMIC);
63+ NFT_MSG_NEWOBJ, 0, nft_pf(pkt), 0, GFP_ATOMIC);
6464 }
6565
6666 static int nft_quota_do_init(const struct nlattr * const tb[],
net/netlink/af_netlink.c+10−4
@@ -594,7 +594,10 @@ static int netlink_insert(struct sock *sk, u32 portid) · 593 unmodified lines
594594
595595 /* We need to ensure that the socket is hashed and visible. */
596596 smp_wmb();
597− nlk_sk(sk)->bound = portid;
597+ /* Paired with lockless reads from netlink_bind(),
598+ * netlink_connect() and netlink_sendmsg().
599+ */
600+ WRITE_ONCE(nlk_sk(sk)->bound, portid);
598601
599602 err:
600603 release_sock(sk);
@@ -1012,7 +1015,8 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr, · 411 unmodified lines
10121015 if (nlk->ngroups < BITS_PER_LONG)
10131016 groups &= (1UL << nlk->ngroups) - 1;
10141017
1015− bound = nlk->bound;
1018+ /* Paired with WRITE_ONCE() in netlink_insert() */
1019+ bound = READ_ONCE(nlk->bound);
10161020 if (bound) {
10171021 /* Ensure nlk->portid is up-to-date. */
10181022 smp_rmb();
@@ -1098,8 +1102,9 @@ static int netlink_connect(struct socket *sock, struct sockaddr *addr, · 79 unmodified lines
10981102
10991103 /* No need for barriers here as we return to user-space without
11001104 * using any of the bound attributes.
1105+ * Paired with WRITE_ONCE() in netlink_insert().
11011106 */
1102− if (!nlk->bound)
1107+ if (!READ_ONCE(nlk->bound))
11031108 err = netlink_autobind(sock);
11041109
11051110 if (err == 0) {
@@ -1869,7 +1874,8 @@ static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) · 763 unmodified lines
18691874 dst_group = nlk->dst_group;
18701875 }
18711876
1872− if (!nlk->bound) {
1877+ /* Paired with WRITE_ONCE() in netlink_insert() */
1878+ if (!READ_ONCE(nlk->bound)) {
18731879 err = netlink_autobind(sock);
18741880 if (err)
18751881 goto out;
net/sched/sch_fifo.c+3−0
@@ -233,6 +233,9 @@ int fifo_set_limit(struct Qdisc *q, unsigned int limit) · 232 unmodified lines
233233 if (strncmp(q->ops->id + 1, "fifo", 4) != 0)
234234 return 0;
235235
236+ if (!q->ops->change)
237+ return 0;
238+
236239 nla = kmalloc(nla_attr_size(sizeof(struct tc_fifo_qopt)), GFP_KERNEL);
237240 if (nla) {
238241 nla->nla_type = RTM_NEWQDISC;
net/sched/sch_taprio.c+4−0
@@ -1641,6 +1641,10 @@ static void taprio_destroy(struct Qdisc *sch) · 1640 unmodified lines
16411641 list_del(&q->taprio_list);
16421642 spin_unlock(&taprio_list_lock);
16431643
1644+ /* Note that taprio_reset() might not be called if an error
1645+ * happens in qdisc_create(), after taprio_init() has been called.
1646+ */
1647+ hrtimer_cancel(&q->advance_timer);
16441648
16451649 taprio_disable_offload(dev, q, NULL);
16461650
net/sunrpc/auth_gss/svcauth_gss.c+1−1
@@ -645,7 +645,7 @@ static bool gss_check_seq_num(const struct svc_rqst *rqstp, struct rsc *rsci, · 644 unmodified lines
645645 }
646646 __set_bit(seq_num % GSS_SEQ_WIN, sd->sd_win);
647647 goto ok;
648− } else if (seq_num <= sd->sd_max - GSS_SEQ_WIN) {
648+ } else if (seq_num + GSS_SEQ_WIN <= sd->sd_max) {
649649 goto toolow;
650650 }
651651 if (__test_and_set_bit(seq_num % GSS_SEQ_WIN, sd->sd_win))
net/unix/af_unix.c+5−4
@@ -2882,6 +2882,9 @@ static int unix_shutdown(struct socket *sock, int mode) · 2881 unmodified lines
28822882
28832883 unix_state_lock(sk);
28842884 sk->sk_shutdown |= mode;
2885+ if ((sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) &&
2886+ mode == SHUTDOWN_MASK)
2887+ sk->sk_state = TCP_CLOSE;
28852888 other = unix_peer(sk);
28862889 if (other)
28872890 sock_hold(other);
@@ -2904,12 +2907,10 @@ static int unix_shutdown(struct socket *sock, int mode) · 16 unmodified lines
29042907 other->sk_shutdown |= peer_mode;
29052908 unix_state_unlock(other);
29062909 other->sk_state_change(other);
2907− if (peer_mode == SHUTDOWN_MASK) {
2910+ if (peer_mode == SHUTDOWN_MASK)
29082911 sk_wake_async(other, SOCK_WAKE_WAITD, POLL_HUP);
2909− other->sk_state = TCP_CLOSE;
2910− } else if (peer_mode & RCV_SHUTDOWN) {
2912+ else if (peer_mode & RCV_SHUTDOWN)
29112913 sk_wake_async(other, SOCK_WAKE_WAITD, POLL_IN);
2912− }
29132914 }
29142915 if (other)
29152916 sock_put(other);
net/xfrm/xfrm_user.c+55−12
@@ -1961,24 +1961,65 @@ static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb, · 1960 unmodified lines
19611961 return skb;
19621962 }
19631963
1964+static int xfrm_notify_userpolicy(struct net *net)
1965+{
1966+ struct xfrm_userpolicy_default *up;
1967+ int len = NLMSG_ALIGN(sizeof(*up));
1968+ struct nlmsghdr *nlh;
1969+ struct sk_buff *skb;
1970+ int err;
1971+
1972+ skb = nlmsg_new(len, GFP_ATOMIC);
1973+ if (skb == NULL)
1974+ return -ENOMEM;
1975+
1976+ nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_GETDEFAULT, sizeof(*up), 0);
1977+ if (nlh == NULL) {
1978+ kfree_skb(skb);
1979+ return -EMSGSIZE;
1980+ }
1981+
1982+ up = nlmsg_data(nlh);
1983+ up->in = net->xfrm.policy_default & XFRM_POL_DEFAULT_IN ?
1984+ XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT;
1985+ up->fwd = net->xfrm.policy_default & XFRM_POL_DEFAULT_FWD ?
1986+ XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT;
1987+ up->out = net->xfrm.policy_default & XFRM_POL_DEFAULT_OUT ?
1988+ XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT;
1989+
1990+ nlmsg_end(skb, nlh);
1991+
1992+ rcu_read_lock();
1993+ err = xfrm_nlmsg_multicast(net, skb, 0, XFRMNLGRP_POLICY);
1994+ rcu_read_unlock();
1995+
1996+ return err;
1997+}
1998+
19641999 static int xfrm_set_default(struct sk_buff *skb, struct nlmsghdr *nlh,
19652000 struct nlattr **attrs)
19662001 {
19672002 struct net *net = sock_net(skb->sk);
19682003 struct xfrm_userpolicy_default *up = nlmsg_data(nlh);
1969− u8 dirmask;
1970− u8 old_default = net->xfrm.policy_default;
19712004
1972− if (up->dirmask >= XFRM_USERPOLICY_DIRMASK_MAX)
1973− return -EINVAL;
2005+ if (up->in == XFRM_USERPOLICY_BLOCK)
2006+ net->xfrm.policy_default |= XFRM_POL_DEFAULT_IN;
2007+ else if (up->in == XFRM_USERPOLICY_ACCEPT)
2008+ net->xfrm.policy_default &= ~XFRM_POL_DEFAULT_IN;
19742009
1975− dirmask = (1 << up->dirmask) & XFRM_POL_DEFAULT_MASK;
2010+ if (up->fwd == XFRM_USERPOLICY_BLOCK)
2011+ net->xfrm.policy_default |= XFRM_POL_DEFAULT_FWD;
2012+ else if (up->fwd == XFRM_USERPOLICY_ACCEPT)
2013+ net->xfrm.policy_default &= ~XFRM_POL_DEFAULT_FWD;
19762014
1977− net->xfrm.policy_default = (old_default & (0xff ^ dirmask))
1978− | (up->action << up->dirmask);
2015+ if (up->out == XFRM_USERPOLICY_BLOCK)
2016+ net->xfrm.policy_default |= XFRM_POL_DEFAULT_OUT;
2017+ else if (up->out == XFRM_USERPOLICY_ACCEPT)
2018+ net->xfrm.policy_default &= ~XFRM_POL_DEFAULT_OUT;
19792019
19802020 rt_genid_bump_all(net);
19812021
2022+ xfrm_notify_userpolicy(net);
19822023 return 0;
19832024 }
19842025
@@ -1988,13 +2029,11 @@ static int xfrm_get_default(struct sk_buff *skb, struct nlmsghdr *nlh, · 3 unmodified lines
19882029 struct sk_buff *r_skb;
19892030 struct nlmsghdr *r_nlh;
19902031 struct net *net = sock_net(skb->sk);
1991− struct xfrm_userpolicy_default *r_up, *up;
2032+ struct xfrm_userpolicy_default *r_up;
19922033 int len = NLMSG_ALIGN(sizeof(struct xfrm_userpolicy_default));
19932034 u32 portid = NETLINK_CB(skb).portid;
19942035 u32 seq = nlh->nlmsg_seq;
19952036
1996− up = nlmsg_data(nlh);
1997−
19982037 r_skb = nlmsg_new(len, GFP_ATOMIC);
19992038 if (!r_skb)
20002039 return -ENOMEM;
@@ -2007,8 +2046,12 @@ static int xfrm_get_default(struct sk_buff *skb, struct nlmsghdr *nlh, · 6 unmodified lines
20072046
20082047 r_up = nlmsg_data(r_nlh);
20092048
2010− r_up->action = ((net->xfrm.policy_default & (1 << up->dirmask)) >> up->dirmask);
2011− r_up->dirmask = up->dirmask;
2049+ r_up->in = net->xfrm.policy_default & XFRM_POL_DEFAULT_IN ?
2050+ XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT;
2051+ r_up->fwd = net->xfrm.policy_default & XFRM_POL_DEFAULT_FWD ?
2052+ XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT;
2053+ r_up->out = net->xfrm.policy_default & XFRM_POL_DEFAULT_OUT ?
2054+ XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT;
20122055 nlmsg_end(r_skb, r_nlh);
20132056
20142057 return nlmsg_unicast(net->xfrm.nlsk, r_skb, portid);
samples/bpf/Makefile+8−9
@@ -322,17 +322,11 @@ $(obj)/hbm_edt_kern.o: $(src)/hbm.h $(src)/hbm_kern.h · 321 unmodified lines
322322
323323 -include $(BPF_SAMPLES_PATH)/Makefile.target
324324
325−VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux) \
326− $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux) \
327− ../../../../vmlinux \
328− /sys/kernel/btf/vmlinux \
329− /boot/vmlinux-$(shell uname -r)
325+VMLINUX_BTF_PATHS ?= $(abspath $(if $(O),$(O)/vmlinux)) \
326+ $(abspath $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux)) \
327+ $(abspath ./vmlinux)
330328 VMLINUX_BTF ?= $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS))))
331329
332−ifeq ($(VMLINUX_BTF),)
333−$(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)")
334−endif
335−
336330 $(obj)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)
337331 ifeq ($(VMLINUX_H),)
338332 $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@
@@ -340,6 +334,11 @@ else · 1 unmodified line
340334 $(Q)cp "$(VMLINUX_H)" $@
341335 endif
342336
337+ifeq ($(VMLINUX_BTF),)
338+ $(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)",\
339+ build the kernel or set VMLINUX_BTF variable)
340+endif
341+
343342 clean-files += vmlinux.h
344343
345344 # Get Clang's default includes on this system, as opposed to those seen by
samples/bpf/bpf_insn.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
22 /* eBPF instruction mini library */
33 #ifndef __BPF_INSN_H
44 #define __BPF_INSN_H
samples/bpf/xdp_redirect_map_multi.bpf.c+0−5
@@ -5,11 +5,6 @@ · 4 unmodified lines
55 #include "xdp_sample.bpf.h"
66 #include "xdp_sample_shared.h"
77
8−enum {
9− BPF_F_BROADCAST = (1ULL << 3),
10− BPF_F_EXCLUDE_INGRESS = (1ULL << 4),
11−};
12−
138 struct {
149 __uint(type, BPF_MAP_TYPE_DEVMAP_HASH);
1510 __uint(key_size, sizeof(int));
security/selinux/nlmsgtab.c+3−1
@@ -126,6 +126,8 @@ static const struct nlmsg_perm nlmsg_xfrm_perms[] = · 125 unmodified lines
126126 { XFRM_MSG_NEWSPDINFO, NETLINK_XFRM_SOCKET__NLMSG_WRITE },
127127 { XFRM_MSG_GETSPDINFO, NETLINK_XFRM_SOCKET__NLMSG_READ },
128128 { XFRM_MSG_MAPPING, NETLINK_XFRM_SOCKET__NLMSG_READ },
129+ { XFRM_MSG_SETDEFAULT, NETLINK_XFRM_SOCKET__NLMSG_WRITE },
130+ { XFRM_MSG_GETDEFAULT, NETLINK_XFRM_SOCKET__NLMSG_READ },
129131 };
130132
131133 static const struct nlmsg_perm nlmsg_audit_perms[] =
@@ -189,7 +191,7 @@ int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm) · 57 unmodified lines
189191 * structures at the top of this file with the new mappings
190192 * before updating the BUILD_BUG_ON() macro!
191193 */
192− BUILD_BUG_ON(XFRM_MSG_MAX != XFRM_MSG_MAPPING);
194+ BUILD_BUG_ON(XFRM_MSG_MAX != XFRM_MSG_GETDEFAULT);
193195 err = nlmsg_perm(nlmsg_type, perm, nlmsg_xfrm_perms,
194196 sizeof(nlmsg_xfrm_perms));
195197 break;
tools/include/uapi/sound/asound.h+1−0
@@ -784,6 +784,7 @@ struct snd_rawmidi_status { · 783 unmodified lines
784784
785785 #define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
786786 #define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
787+#define SNDRV_RAWMIDI_IOCTL_USER_PVERSION _IOW('W', 0x02, int)
787788 #define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
788789 #define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
789790 #define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
tools/lib/bpf/libbpf.c+2−1
@@ -7024,7 +7024,8 @@ int bpf_object__load_xattr(struct bpf_object_load_attr *attr) · 7023 unmodified lines
70247024
70257025 if (obj->gen_loader) {
70267026 /* reset FDs */
7027− btf__set_fd(obj->btf, -1);
7027+ if (obj->btf)
7028+ btf__set_fd(obj->btf, -1);
70287029 for (i = 0; i < obj->nr_maps; i++)
70297030 obj->maps[i].fd = -1;
70307031 if (!err)
tools/lib/bpf/strset.c+1−0
@@ -88,6 +88,7 @@ void strset__free(struct strset *set) · 87 unmodified lines
8888
8989 hashmap__free(set->strs_hash);
9090 free(set->strs_data);
91+ free(set);
9192 }
9293
9394 size_t strset__data_size(const struct strset *set)
tools/objtool/special.c+30−8
@@ -58,6 +58,24 @@ void __weak arch_handle_alternative(unsigned short feature, struct special_alt * · 57 unmodified lines
5858 {
5959 }
6060
61+static bool reloc2sec_off(struct reloc *reloc, struct section **sec, unsigned long *off)
62+{
63+ switch (reloc->sym->type) {
64+ case STT_FUNC:
65+ *sec = reloc->sym->sec;
66+ *off = reloc->sym->offset + reloc->addend;
67+ return true;
68+
69+ case STT_SECTION:
70+ *sec = reloc->sym->sec;
71+ *off = reloc->addend;
72+ return true;
73+
74+ default:
75+ return false;
76+ }
77+}
78+
6179 static int get_alt_entry(struct elf *elf, struct special_entry *entry,
6280 struct section *sec, int idx,
6381 struct special_alt *alt)
@@ -91,15 +109,14 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry, · 27 unmodified lines
91109 WARN_FUNC("can't find orig reloc", sec, offset + entry->orig);
92110 return -1;
93111 }
94− if (orig_reloc->sym->type != STT_SECTION) {
95− WARN_FUNC("don't know how to handle non-section reloc symbol %s",
96− sec, offset + entry->orig, orig_reloc->sym->name);
112+ if (!reloc2sec_off(orig_reloc, &alt->orig_sec, &alt->orig_off)) {
113+ WARN_FUNC("don't know how to handle reloc symbol type %d: %s",
114+ sec, offset + entry->orig,
115+ orig_reloc->sym->type,
116+ orig_reloc->sym->name);
97117 return -1;
98118 }
99119
100− alt->orig_sec = orig_reloc->sym->sec;
101− alt->orig_off = orig_reloc->addend;
102−
103120 if (!entry->group || alt->new_len) {
104121 new_reloc = find_reloc_by_dest(elf, sec, offset + entry->new);
105122 if (!new_reloc) {
@@ -116,8 +133,13 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry, · 10 unmodified lines
116133 if (arch_is_retpoline(new_reloc->sym))
117134 return 1;
118135
119− alt->new_sec = new_reloc->sym->sec;
120− alt->new_off = (unsigned int)new_reloc->addend;
136+ if (!reloc2sec_off(new_reloc, &alt->new_sec, &alt->new_off)) {
137+ WARN_FUNC("don't know how to handle reloc symbol type %d: %s",
138+ sec, offset + entry->new,
139+ new_reloc->sym->type,
140+ new_reloc->sym->name);
141+ return -1;
142+ }
121143
122144 /* _ASM_EXTABLE_EX hack */
123145 if (alt->new_off >= 0x7ffffff0)
tools/perf/Makefile.config+1−1
@@ -143,7 +143,7 @@ FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto · 142 unmodified lines
143143 ifdef CSINCLUDES
144144 LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
145145 endif
146−OPENCSDLIBS := -lopencsd_c_api -lopencsd
146+OPENCSDLIBS := -lopencsd_c_api -lopencsd -lstdc++
147147 ifdef CSLIBS
148148 LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
149149 endif
tools/perf/Makefile.perf+1−1
@@ -802,7 +802,7 @@ endif · 801 unmodified lines
802802
803803 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
804804
805−LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
805+LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(filter-out -static,$(LDFLAGS))'
806806
807807 $(LIBTRACEEVENT): FORCE
808808 $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a
tools/perf/pmu-events/jevents.c+2−0
@@ -1285,6 +1285,7 @@ int main(int argc, char *argv[]) · 1284 unmodified lines
12851285 }
12861286
12871287 free_arch_std_events();
1288+ free_sys_event_tables();
12881289 free(mapfile);
12891290 return 0;
12901291
@@ -1306,6 +1307,7 @@ err_close_eventsfp: · 15 unmodified lines
13061307 create_empty_mapping(output_file);
13071308 err_out:
13081309 free_arch_std_events();
1310+ free_sys_event_tables();
13091311 free(mapfile);
13101312 return ret;
13111313 }
tools/perf/tests/attr/test-stat-default+97−0
@@ -68,3 +68,100 @@ fd=10 · 67 unmodified lines
6868 type=0
6969 config=5
7070 optional=1
71+
72+# PERF_TYPE_RAW / slots (0x400)
73+[event11:base-stat]
74+fd=11
75+group_fd=-1
76+type=4
77+config=1024
78+read_format=15
79+optional=1
80+
81+# PERF_TYPE_RAW / topdown-retiring (0x8000)
82+[event12:base-stat]
83+fd=12
84+group_fd=11
85+type=4
86+config=32768
87+disabled=0
88+enable_on_exec=0
89+read_format=15
90+optional=1
91+
92+# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
93+[event13:base-stat]
94+fd=13
95+group_fd=11
96+type=4
97+config=33024
98+disabled=0
99+enable_on_exec=0
100+read_format=15
101+optional=1
102+
103+# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
104+[event14:base-stat]
105+fd=14
106+group_fd=11
107+type=4
108+config=33280
109+disabled=0
110+enable_on_exec=0
111+read_format=15
112+optional=1
113+
114+# PERF_TYPE_RAW / topdown-be-bound (0x8300)
115+[event15:base-stat]
116+fd=15
117+group_fd=11
118+type=4
119+config=33536
120+disabled=0
121+enable_on_exec=0
122+read_format=15
123+optional=1
124+
125+# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
126+[event16:base-stat]
127+fd=16
128+group_fd=11
129+type=4
130+config=33792
131+disabled=0
132+enable_on_exec=0
133+read_format=15
134+optional=1
135+
136+# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
137+[event17:base-stat]
138+fd=17
139+group_fd=11
140+type=4
141+config=34048
142+disabled=0
143+enable_on_exec=0
144+read_format=15
145+optional=1
146+
147+# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
148+[event18:base-stat]
149+fd=18
150+group_fd=11
151+type=4
152+config=34304
153+disabled=0
154+enable_on_exec=0
155+read_format=15
156+optional=1
157+
158+# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
159+[event19:base-stat]
160+fd=19
161+group_fd=11
162+type=4
163+config=34560
164+disabled=0
165+enable_on_exec=0
166+read_format=15
167+optional=1
tools/perf/tests/attr/test-stat-detailed-1+105−8
@@ -70,12 +70,109 @@ type=0 · 69 unmodified lines
7070 config=5
7171 optional=1
7272
73+# PERF_TYPE_RAW / slots (0x400)
74+[event11:base-stat]
75+fd=11
76+group_fd=-1
77+type=4
78+config=1024
79+read_format=15
80+optional=1
81+
82+# PERF_TYPE_RAW / topdown-retiring (0x8000)
83+[event12:base-stat]
84+fd=12
85+group_fd=11
86+type=4
87+config=32768
88+disabled=0
89+enable_on_exec=0
90+read_format=15
91+optional=1
92+
93+# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
94+[event13:base-stat]
95+fd=13
96+group_fd=11
97+type=4
98+config=33024
99+disabled=0
100+enable_on_exec=0
101+read_format=15
102+optional=1
103+
104+# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
105+[event14:base-stat]
106+fd=14
107+group_fd=11
108+type=4
109+config=33280
110+disabled=0
111+enable_on_exec=0
112+read_format=15
113+optional=1
114+
115+# PERF_TYPE_RAW / topdown-be-bound (0x8300)
116+[event15:base-stat]
117+fd=15
118+group_fd=11
119+type=4
120+config=33536
121+disabled=0
122+enable_on_exec=0
123+read_format=15
124+optional=1
125+
126+# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
127+[event16:base-stat]
128+fd=16
129+group_fd=11
130+type=4
131+config=33792
132+disabled=0
133+enable_on_exec=0
134+read_format=15
135+optional=1
136+
137+# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
138+[event17:base-stat]
139+fd=17
140+group_fd=11
141+type=4
142+config=34048
143+disabled=0
144+enable_on_exec=0
145+read_format=15
146+optional=1
147+
148+# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
149+[event18:base-stat]
150+fd=18
151+group_fd=11
152+type=4
153+config=34304
154+disabled=0
155+enable_on_exec=0
156+read_format=15
157+optional=1
158+
159+# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
160+[event19:base-stat]
161+fd=19
162+group_fd=11
163+type=4
164+config=34560
165+disabled=0
166+enable_on_exec=0
167+read_format=15
168+optional=1
169+
73170 # PERF_TYPE_HW_CACHE /
74171 # PERF_COUNT_HW_CACHE_L1D << 0 |
75172 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
76173 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
77−[event11:base-stat]
78−fd=11
174+[event20:base-stat]
175+fd=20
79176 type=3
80177 config=0
81178 optional=1
@@ -84,8 +181,8 @@ optional=1 · 2 unmodified lines
84181 # PERF_COUNT_HW_CACHE_L1D << 0 |
85182 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
86183 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
87−[event12:base-stat]
88−fd=12
184+[event21:base-stat]
185+fd=21
89186 type=3
90187 config=65536
91188 optional=1
@@ -94,8 +191,8 @@ optional=1 · 2 unmodified lines
94191 # PERF_COUNT_HW_CACHE_LL << 0 |
95192 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
96193 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
97−[event13:base-stat]
98−fd=13
194+[event22:base-stat]
195+fd=22
99196 type=3
100197 config=2
101198 optional=1
@@ -104,8 +201,8 @@ optional=1 · 2 unmodified lines
104201 # PERF_COUNT_HW_CACHE_LL << 0 |
105202 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
106203 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
107−[event14:base-stat]
108−fd=14
204+[event23:base-stat]
205+fd=23
109206 type=3
110207 config=65538
111208 optional=1
tools/perf/tests/attr/test-stat-detailed-2+117−20
@@ -70,12 +70,109 @@ type=0 · 69 unmodified lines
7070 config=5
7171 optional=1
7272
73+# PERF_TYPE_RAW / slots (0x400)
74+[event11:base-stat]
75+fd=11
76+group_fd=-1
77+type=4
78+config=1024
79+read_format=15
80+optional=1
81+
82+# PERF_TYPE_RAW / topdown-retiring (0x8000)
83+[event12:base-stat]
84+fd=12
85+group_fd=11
86+type=4
87+config=32768
88+disabled=0
89+enable_on_exec=0
90+read_format=15
91+optional=1
92+
93+# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
94+[event13:base-stat]
95+fd=13
96+group_fd=11
97+type=4
98+config=33024
99+disabled=0
100+enable_on_exec=0
101+read_format=15
102+optional=1
103+
104+# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
105+[event14:base-stat]
106+fd=14
107+group_fd=11
108+type=4
109+config=33280
110+disabled=0
111+enable_on_exec=0
112+read_format=15
113+optional=1
114+
115+# PERF_TYPE_RAW / topdown-be-bound (0x8300)
116+[event15:base-stat]
117+fd=15
118+group_fd=11
119+type=4
120+config=33536
121+disabled=0
122+enable_on_exec=0
123+read_format=15
124+optional=1
125+
126+# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
127+[event16:base-stat]
128+fd=16
129+group_fd=11
130+type=4
131+config=33792
132+disabled=0
133+enable_on_exec=0
134+read_format=15
135+optional=1
136+
137+# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
138+[event17:base-stat]
139+fd=17
140+group_fd=11
141+type=4
142+config=34048
143+disabled=0
144+enable_on_exec=0
145+read_format=15
146+optional=1
147+
148+# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
149+[event18:base-stat]
150+fd=18
151+group_fd=11
152+type=4
153+config=34304
154+disabled=0
155+enable_on_exec=0
156+read_format=15
157+optional=1
158+
159+# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
160+[event19:base-stat]
161+fd=19
162+group_fd=11
163+type=4
164+config=34560
165+disabled=0
166+enable_on_exec=0
167+read_format=15
168+optional=1
169+
73170 # PERF_TYPE_HW_CACHE /
74171 # PERF_COUNT_HW_CACHE_L1D << 0 |
75172 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
76173 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
77−[event11:base-stat]
78−fd=11
174+[event20:base-stat]
175+fd=20
79176 type=3
80177 config=0
81178 optional=1
@@ -84,8 +181,8 @@ optional=1 · 2 unmodified lines
84181 # PERF_COUNT_HW_CACHE_L1D << 0 |
85182 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
86183 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
87−[event12:base-stat]
88−fd=12
184+[event21:base-stat]
185+fd=21
89186 type=3
90187 config=65536
91188 optional=1
@@ -94,8 +191,8 @@ optional=1 · 2 unmodified lines
94191 # PERF_COUNT_HW_CACHE_LL << 0 |
95192 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
96193 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
97−[event13:base-stat]
98−fd=13
194+[event22:base-stat]
195+fd=22
99196 type=3
100197 config=2
101198 optional=1
@@ -104,8 +201,8 @@ optional=1 · 2 unmodified lines
104201 # PERF_COUNT_HW_CACHE_LL << 0 |
105202 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
106203 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
107−[event14:base-stat]
108−fd=14
204+[event23:base-stat]
205+fd=23
109206 type=3
110207 config=65538
111208 optional=1
@@ -114,8 +211,8 @@ optional=1 · 2 unmodified lines
114211 # PERF_COUNT_HW_CACHE_L1I << 0 |
115212 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
116213 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
117−[event15:base-stat]
118−fd=15
214+[event24:base-stat]
215+fd=24
119216 type=3
120217 config=1
121218 optional=1
@@ -124,8 +221,8 @@ optional=1 · 2 unmodified lines
124221 # PERF_COUNT_HW_CACHE_L1I << 0 |
125222 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
126223 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
127−[event16:base-stat]
128−fd=16
224+[event25:base-stat]
225+fd=25
129226 type=3
130227 config=65537
131228 optional=1
@@ -134,8 +231,8 @@ optional=1 · 2 unmodified lines
134231 # PERF_COUNT_HW_CACHE_DTLB << 0 |
135232 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
136233 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
137−[event17:base-stat]
138−fd=17
234+[event26:base-stat]
235+fd=26
139236 type=3
140237 config=3
141238 optional=1
@@ -144,8 +241,8 @@ optional=1 · 2 unmodified lines
144241 # PERF_COUNT_HW_CACHE_DTLB << 0 |
145242 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
146243 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
147−[event18:base-stat]
148−fd=18
244+[event27:base-stat]
245+fd=27
149246 type=3
150247 config=65539
151248 optional=1
@@ -154,8 +251,8 @@ optional=1 · 2 unmodified lines
154251 # PERF_COUNT_HW_CACHE_ITLB << 0 |
155252 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
156253 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
157−[event19:base-stat]
158−fd=19
254+[event28:base-stat]
255+fd=28
159256 type=3
160257 config=4
161258 optional=1
@@ -164,8 +261,8 @@ optional=1 · 2 unmodified lines
164261 # PERF_COUNT_HW_CACHE_ITLB << 0 |
165262 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
166263 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
167−[event20:base-stat]
168−fd=20
264+[event29:base-stat]
265+fd=29
169266 type=3
170267 config=65540
171268 optional=1
tools/perf/tests/attr/test-stat-detailed-3+121−24
@@ -70,12 +70,109 @@ type=0 · 69 unmodified lines
7070 config=5
7171 optional=1
7272
73+# PERF_TYPE_RAW / slots (0x400)
74+[event11:base-stat]
75+fd=11
76+group_fd=-1
77+type=4
78+config=1024
79+read_format=15
80+optional=1
81+
82+# PERF_TYPE_RAW / topdown-retiring (0x8000)
83+[event12:base-stat]
84+fd=12
85+group_fd=11
86+type=4
87+config=32768
88+disabled=0
89+enable_on_exec=0
90+read_format=15
91+optional=1
92+
93+# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
94+[event13:base-stat]
95+fd=13
96+group_fd=11
97+type=4
98+config=33024
99+disabled=0
100+enable_on_exec=0
101+read_format=15
102+optional=1
103+
104+# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
105+[event14:base-stat]
106+fd=14
107+group_fd=11
108+type=4
109+config=33280
110+disabled=0
111+enable_on_exec=0
112+read_format=15
113+optional=1
114+
115+# PERF_TYPE_RAW / topdown-be-bound (0x8300)
116+[event15:base-stat]
117+fd=15
118+group_fd=11
119+type=4
120+config=33536
121+disabled=0
122+enable_on_exec=0
123+read_format=15
124+optional=1
125+
126+# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
127+[event16:base-stat]
128+fd=16
129+group_fd=11
130+type=4
131+config=33792
132+disabled=0
133+enable_on_exec=0
134+read_format=15
135+optional=1
136+
137+# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
138+[event17:base-stat]
139+fd=17
140+group_fd=11
141+type=4
142+config=34048
143+disabled=0
144+enable_on_exec=0
145+read_format=15
146+optional=1
147+
148+# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
149+[event18:base-stat]
150+fd=18
151+group_fd=11
152+type=4
153+config=34304
154+disabled=0
155+enable_on_exec=0
156+read_format=15
157+optional=1
158+
159+# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
160+[event19:base-stat]
161+fd=19
162+group_fd=11
163+type=4
164+config=34560
165+disabled=0
166+enable_on_exec=0
167+read_format=15
168+optional=1
169+
73170 # PERF_TYPE_HW_CACHE /
74171 # PERF_COUNT_HW_CACHE_L1D << 0 |
75172 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
76173 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
77−[event11:base-stat]
78−fd=11
174+[event20:base-stat]
175+fd=20
79176 type=3
80177 config=0
81178 optional=1
@@ -84,8 +181,8 @@ optional=1 · 2 unmodified lines
84181 # PERF_COUNT_HW_CACHE_L1D << 0 |
85182 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
86183 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
87−[event12:base-stat]
88−fd=12
184+[event21:base-stat]
185+fd=21
89186 type=3
90187 config=65536
91188 optional=1
@@ -94,8 +191,8 @@ optional=1 · 2 unmodified lines
94191 # PERF_COUNT_HW_CACHE_LL << 0 |
95192 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
96193 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
97−[event13:base-stat]
98−fd=13
194+[event22:base-stat]
195+fd=22
99196 type=3
100197 config=2
101198 optional=1
@@ -104,8 +201,8 @@ optional=1 · 2 unmodified lines
104201 # PERF_COUNT_HW_CACHE_LL << 0 |
105202 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
106203 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
107−[event14:base-stat]
108−fd=14
204+[event23:base-stat]
205+fd=23
109206 type=3
110207 config=65538
111208 optional=1
@@ -114,8 +211,8 @@ optional=1 · 2 unmodified lines
114211 # PERF_COUNT_HW_CACHE_L1I << 0 |
115212 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
116213 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
117−[event15:base-stat]
118−fd=15
214+[event24:base-stat]
215+fd=24
119216 type=3
120217 config=1
121218 optional=1
@@ -124,8 +221,8 @@ optional=1 · 2 unmodified lines
124221 # PERF_COUNT_HW_CACHE_L1I << 0 |
125222 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
126223 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
127−[event16:base-stat]
128−fd=16
224+[event25:base-stat]
225+fd=25
129226 type=3
130227 config=65537
131228 optional=1
@@ -134,8 +231,8 @@ optional=1 · 2 unmodified lines
134231 # PERF_COUNT_HW_CACHE_DTLB << 0 |
135232 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
136233 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
137−[event17:base-stat]
138−fd=17
234+[event26:base-stat]
235+fd=26
139236 type=3
140237 config=3
141238 optional=1
@@ -144,8 +241,8 @@ optional=1 · 2 unmodified lines
144241 # PERF_COUNT_HW_CACHE_DTLB << 0 |
145242 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
146243 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
147−[event18:base-stat]
148−fd=18
244+[event27:base-stat]
245+fd=27
149246 type=3
150247 config=65539
151248 optional=1
@@ -154,8 +251,8 @@ optional=1 · 2 unmodified lines
154251 # PERF_COUNT_HW_CACHE_ITLB << 0 |
155252 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
156253 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
157−[event19:base-stat]
158−fd=19
254+[event28:base-stat]
255+fd=28
159256 type=3
160257 config=4
161258 optional=1
@@ -164,8 +261,8 @@ optional=1 · 2 unmodified lines
164261 # PERF_COUNT_HW_CACHE_ITLB << 0 |
165262 # (PERF_COUNT_HW_CACHE_OP_READ << 8) |
166263 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
167−[event20:base-stat]
168−fd=20
264+[event29:base-stat]
265+fd=29
169266 type=3
170267 config=65540
171268 optional=1
@@ -174,8 +271,8 @@ optional=1 · 2 unmodified lines
174271 # PERF_COUNT_HW_CACHE_L1D << 0 |
175272 # (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) |
176273 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
177−[event21:base-stat]
178−fd=21
274+[event30:base-stat]
275+fd=30
179276 type=3
180277 config=512
181278 optional=1
@@ -184,8 +281,8 @@ optional=1 · 2 unmodified lines
184281 # PERF_COUNT_HW_CACHE_L1D << 0 |
185282 # (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) |
186283 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
187−[event22:base-stat]
188−fd=22
284+[event31:base-stat]
285+fd=31
189286 type=3
190287 config=66048
191288 optional=1
tools/testing/selftests/drivers/dma-buf/udmabuf.c+4−1
@@ -1,10 +1,13 @@
11 // SPDX-License-Identifier: GPL-2.0
2+#define _GNU_SOURCE
3+#define __EXPORTED_HEADERS__
4+
25 #include <stdio.h>
36 #include <stdlib.h>
47 #include <unistd.h>
58 #include <string.h>
69 #include <errno.h>
7−#include <linux/fcntl.h>
10+#include <fcntl.h>
811 #include <malloc.h>
912
1013 #include <sys/ioctl.h>
tools/testing/selftests/kvm/include/x86_64/processor.h+1−1
@@ -315,7 +315,7 @@ static inline void set_xmm(int n, unsigned long val) · 314 unmodified lines
315315 #define GET_XMM(__xmm) \
316316 ({ \
317317 unsigned long __val; \
318− asm volatile("movq %%"#__xmm", %0" : "=r"(__val) : : #__xmm); \
318+ asm volatile("movq %%"#__xmm", %0" : "=r"(__val)); \
319319 __val; \
320320 })
321321
tools/testing/selftests/kvm/rseq_test.c+59−10
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <signal.h>
1111 #include <syscall.h>
1212 #include <sys/ioctl.h>
13+#include <sys/sysinfo.h>
1314 #include <asm/barrier.h>
1415 #include <linux/atomic.h>
1516 #include <linux/rseq.h>
@@ -39,6 +40,7 @@ static __thread volatile struct rseq __rseq = { · 23 unmodified lines
3940
4041 static pthread_t migration_thread;
4142 static cpu_set_t possible_mask;
43+static int min_cpu, max_cpu;
4244 static bool done;
4345
4446 static atomic_t seq_cnt;
@@ -57,20 +59,37 @@ static void sys_rseq(int flags) · 12 unmodified lines
5759 TEST_ASSERT(!r, "rseq failed, errno = %d (%s)", errno, strerror(errno));
5860 }
5961
62+static int next_cpu(int cpu)
63+{
64+ /*
65+ * Advance to the next CPU, skipping those that weren't in the original
66+ * affinity set. Sadly, there is no CPU_SET_FOR_EACH, and cpu_set_t's
67+ * data storage is considered as opaque. Note, if this task is pinned
68+ * to a small set of discontigous CPUs, e.g. 2 and 1023, this loop will
69+ * burn a lot cycles and the test will take longer than normal to
70+ * complete.
71+ */
72+ do {
73+ cpu++;
74+ if (cpu > max_cpu) {
75+ cpu = min_cpu;
76+ TEST_ASSERT(CPU_ISSET(cpu, &possible_mask),
77+ "Min CPU = %d must always be usable", cpu);
78+ break;
79+ }
80+ } while (!CPU_ISSET(cpu, &possible_mask));
81+
82+ return cpu;
83+}
84+
6085 static void *migration_worker(void *ign)
6186 {
6287 cpu_set_t allowed_mask;
63− int r, i, nr_cpus, cpu;
88+ int r, i, cpu;
6489
6590 CPU_ZERO(&allowed_mask);
6691
67− nr_cpus = CPU_COUNT(&possible_mask);
68−
69− for (i = 0; i < NR_TASK_MIGRATIONS; i++) {
70− cpu = i % nr_cpus;
71− if (!CPU_ISSET(cpu, &possible_mask))
72− continue;
73−
92+ for (i = 0, cpu = min_cpu; i < NR_TASK_MIGRATIONS; i++, cpu = next_cpu(cpu)) {
7493 CPU_SET(cpu, &allowed_mask);
7594
7695 /*
@@ -154,6 +173,36 @@ static void *migration_worker(void *ign) · 77 unmodified lines
154173 return NULL;
155174 }
156175
176+static int calc_min_max_cpu(void)
177+{
178+ int i, cnt, nproc;
179+
180+ if (CPU_COUNT(&possible_mask) < 2)
181+ return -EINVAL;
182+
183+ /*
184+ * CPU_SET doesn't provide a FOR_EACH helper, get the min/max CPU that
185+ * this task is affined to in order to reduce the time spent querying
186+ * unusable CPUs, e.g. if this task is pinned to a small percentage of
187+ * total CPUs.
188+ */
189+ nproc = get_nprocs_conf();
190+ min_cpu = -1;
191+ max_cpu = -1;
192+ cnt = 0;
193+
194+ for (i = 0; i < nproc; i++) {
195+ if (!CPU_ISSET(i, &possible_mask))
196+ continue;
197+ if (min_cpu == -1)
198+ min_cpu = i;
199+ max_cpu = i;
200+ cnt++;
201+ }
202+
203+ return (cnt < 2) ? -EINVAL : 0;
204+}
205+
157206 int main(int argc, char *argv[])
158207 {
159208 int r, i, snapshot;
@@ -167,8 +216,8 @@ int main(int argc, char *argv[]) · 7 unmodified lines
167216 TEST_ASSERT(!r, "sched_getaffinity failed, errno = %d (%s)", errno,
168217 strerror(errno));
169218
170− if (CPU_COUNT(&possible_mask) < 2) {
171− print_skip("Only one CPU, task migration not possible\n");
219+ if (calc_min_max_cpu()) {
220+ print_skip("Only one usable CPU, task migration not possible");
172221 exit(KSFT_SKIP);
173222 }
174223