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
971N: Daniel Drake971N: Daniel Drake
972E: dsd@gentoo.org972E: dsd@gentoo.org
973D: USBAT02 CompactFlash support in usb-storage973D: USBAT02 CompactFlash support in usb-storage
974D: ZD1211RW wireless driver
974S: UK975S: UK
975 976
976N: Oleg Drokin977N: Oleg Drokin
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml+0−2
@@ -50,7 +50,6 @@ properties: · 49 unmodified lines
50 data-lanes:50 data-lanes:
51 description: array of physical DSI data lane indexes.51 description: array of physical DSI data lane indexes.
52 minItems: 152 minItems: 1
53 maxItems: 4
54 items:53 items:
55 - const: 154 - const: 1
56 - const: 255 - const: 2
@@ -71,7 +70,6 @@ properties: · 14 unmodified lines
71 data-lanes:70 data-lanes:
72 description: array of physical DSI data lane indexes.71 description: array of physical DSI data lane indexes.
73 minItems: 172 minItems: 1
74 maxItems: 4
75 items:73 items:
76 - const: 174 - const: 1
77 - const: 275 - const: 2
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml+1−1
@@ -18,7 +18,7 @@ properties: · 17 unmodified lines
18 const: ti,sn65dsi8618 const: ti,sn65dsi86
19 19
20 reg:20 reg:
21 const: 0x2d21 enum: [ 0x2c, 0x2d ]
22 22
23 enable-gpios:23 enable-gpios:
24 maxItems: 124 maxItems: 1
Documentation/devicetree/bindings/interconnect/qcom,sdm660.yaml+42−4
@@ -31,11 +31,11 @@ properties: · 30 unmodified lines
31 31
32 clocks:32 clocks:
33 minItems: 133 minItems: 1
34 maxItems: 334 maxItems: 7
35 35
36 clock-names:36 clock-names:
37 minItems: 137 minItems: 1
38 maxItems: 338 maxItems: 7
39 39
40required:40required:
41 - compatible41 - compatible
@@ -72,6 +72,32 @@ allOf: · 30 unmodified lines
72 contains:72 contains:
73 enum:73 enum:
74 - qcom,sdm660-a2noc74 - 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:
75 - qcom,sdm660-bimc101 - qcom,sdm660-bimc
76 - qcom,sdm660-cnoc102 - qcom,sdm660-cnoc
77 - qcom,sdm660-gnoc103 - qcom,sdm660-gnoc
@@ -91,6 +117,7 @@ examples: · 13 unmodified lines
91 - |117 - |
92 #include <dt-bindings/clock/qcom,rpmcc.h>118 #include <dt-bindings/clock/qcom,rpmcc.h>
93 #include <dt-bindings/clock/qcom,mmcc-sdm660.h>119 #include <dt-bindings/clock/qcom,mmcc-sdm660.h>
120 #include <dt-bindings/clock/qcom,gcc-sdm660.h>
94 121
95 bimc: interconnect@1008000 {122 bimc: interconnect@1008000 {
96 compatible = "qcom,sdm660-bimc";123 compatible = "qcom,sdm660-bimc";
@@ -123,9 +150,20 @@ examples: · 26 unmodified lines
123 compatible = "qcom,sdm660-a2noc";150 compatible = "qcom,sdm660-a2noc";
124 reg = <0x01704000 0xc100>;151 reg = <0x01704000 0xc100>;
125 #interconnect-cells = <1>;152 #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";
127 clocks = <&rpmcc RPM_SMD_AGGR2_NOC_CLK>,160 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>;
129 };167 };
130 168
131 mnoc: interconnect@1745000 {169 mnoc: interconnect@1745000 {
Documentation/devicetree/bindings/media/i2c/ovti,ov5647.yaml+1−1
@@ -31,7 +31,7 @@ properties: · 30 unmodified lines
31 maxItems: 131 maxItems: 1
32 32
33 port:33 port:
34 $ref: /schemas/graph.yaml#/properties/port34 $ref: /schemas/graph.yaml#/$defs/port-base
35 additionalProperties: false35 additionalProperties: false
36 36
37 properties:37 properties:
Documentation/devicetree/bindings/media/i2c/ovti,ov9282.yaml+1−1
@@ -38,7 +38,7 @@ properties: · 37 unmodified lines
38 38
39 port:39 port:
40 additionalProperties: false40 additionalProperties: false
41 $ref: /schemas/graph.yaml#/properties/port41 $ref: /schemas/graph.yaml#/$defs/port-base
42 42
43 properties:43 properties:
44 endpoint:44 endpoint:
Documentation/devicetree/bindings/media/i2c/sony,imx335.yaml+1−1
@@ -38,7 +38,7 @@ properties: · 37 unmodified lines
38 38
39 port:39 port:
40 additionalProperties: false40 additionalProperties: false
41 $ref: /schemas/graph.yaml#/properties/port41 $ref: /schemas/graph.yaml#/$defs/port-base
42 42
43 properties:43 properties:
44 endpoint:44 endpoint:
Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml+1−1
@@ -38,7 +38,7 @@ properties: · 37 unmodified lines
38 38
39 port:39 port:
40 additionalProperties: false40 additionalProperties: false
41 $ref: /schemas/graph.yaml#/properties/port41 $ref: /schemas/graph.yaml#/$defs/port-base
42 42
43 properties:43 properties:
44 endpoint:44 endpoint:
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml+1−3
@@ -20,9 +20,7 @@ properties: · 19 unmodified lines
20 - snps,dwcmshc-sdhci20 - snps,dwcmshc-sdhci
21 21
22 reg:22 reg:
23 minItems: 123 maxItems: 1
24 items:
25 - description: Offset and length of the register set for the device
26 24
27 interrupts:25 interrupts:
28 maxItems: 126 maxItems: 1
Documentation/devicetree/bindings/net/dsa/marvell.txt+1−1
@@ -83,7 +83,7 @@ Example: · 82 unmodified lines
83 #interrupt-cells = <2>;83 #interrupt-cells = <2>;
84 84
85 switch0: switch@0 {85 switch0: switch@0 {
86 compatible = "marvell,mv88e6390";86 compatible = "marvell,mv88e6190";
87 reg = <0>;87 reg = <0>;
88 reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;88 reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
89 89
Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml+0−1
@@ -34,7 +34,6 @@ properties: · 33 unmodified lines
34 34
35 clocks:35 clocks:
36 minItems: 336 minItems: 3
37 maxItems: 5
38 items:37 items:
39 - description: MAC host clock38 - description: MAC host clock
40 - description: MAC apb clock39 - description: MAC apb clock
Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml+0−1
@@ -41,7 +41,6 @@ properties: · 40 unmodified lines
41 - description: builtin MSI controller.41 - description: builtin MSI controller.
42 42
43 interrupt-names:43 interrupt-names:
44 minItems: 1
45 items:44 items:
46 - const: msi45 - const: msi
47 46
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
132Core Complex Die (CCD) temperatures. Up to 8 such temperatures are reported132Core Complex Die (CCD) temperatures. Up to 8 such temperatures are reported
133as temp{3..10}_input, labeled Tccd{1..8}. Actual support depends on the CPU133as temp{3..10}_input, labeled Tccd{1..8}. Actual support depends on the CPU
134variant.134variant.
135
136Various Family 17h and 18h CPUs report voltage and current telemetry
137information. The following attributes may be reported.
138
139Attribute Label Description
140=============== ======= ================
141in0_input Vcore Core voltage
142in1_input Vsoc SoC voltage
143curr1_input Icore Core current
144curr2_input Isoc SoC current
145=============== ======= ================
146
147Current values are raw (unscaled) as reported by the CPU. Core current is
148reported 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
150as rough guidance, and should be scaled using sensors3.conf as appropriate
151for 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
414F: drivers/acpi/pmic/414F: drivers/acpi/pmic/
415 415
416ACPI THERMAL DRIVER416ACPI THERMAL DRIVER
417M: Zhang Rui <rui.zhang@intel.com>417M: Rafael J. Wysocki <rafael@kernel.org>
418R: Zhang Rui <rui.zhang@intel.com>
418L: linux-acpi@vger.kernel.org419L: linux-acpi@vger.kernel.org
419S: Supported420S: Supported
420W: https://01.org/linux-acpi421W: https://01.org/linux-acpi
@@ -1275,6 +1276,7 @@ F: drivers/input/mouse/bcm5974.c · 854 unmodified lines
1275 1276
1276APPLE DART IOMMU DRIVER1277APPLE DART IOMMU DRIVER
1277M: Sven Peter <sven@svenpeter.dev>1278M: Sven Peter <sven@svenpeter.dev>
1279R: Alyssa Rosenzweig <alyssa@rosenzweig.io>
1278L: iommu@lists.linux-foundation.org1280L: iommu@lists.linux-foundation.org
1279S: Maintained1281S: Maintained
1280F: Documentation/devicetree/bindings/iommu/apple,dart.yaml1282F: Documentation/devicetree/bindings/iommu/apple,dart.yaml
@@ -1711,6 +1713,8 @@ F: drivers/*/*alpine* · 430 unmodified lines
1711 1713
1712ARM/APPLE MACHINE SUPPORT1714ARM/APPLE MACHINE SUPPORT
1713M: Hector Martin <marcan@marcan.st>1715M: Hector Martin <marcan@marcan.st>
1716M: Sven Peter <sven@svenpeter.dev>
1717R: Alyssa Rosenzweig <alyssa@rosenzweig.io>
1714L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)1718L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1715S: Maintained1719S: Maintained
1716W: https://asahilinux.org1720W: https://asahilinux.org
@@ -2236,6 +2240,7 @@ F: arch/arm/mach-pxa/mioa701.c · 519 unmodified lines
2236 2240
2237ARM/MStar/Sigmastar Armv7 SoC support2241ARM/MStar/Sigmastar Armv7 SoC support
2238M: Daniel Palmer <daniel@thingy.jp>2242M: Daniel Palmer <daniel@thingy.jp>
2243M: Romain Perier <romain.perier@gmail.com>
2239L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)2244L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
2240S: Maintained2245S: Maintained
2241W: http://linux-chenxing.org/2246W: http://linux-chenxing.org/
@@ -2712,6 +2717,7 @@ F: drivers/power/reset/keystone-reset.c · 470 unmodified lines
2712 2717
2713ARM/TEXAS INSTRUMENTS K3 ARCHITECTURE2718ARM/TEXAS INSTRUMENTS K3 ARCHITECTURE
2714M: Nishanth Menon <nm@ti.com>2719M: Nishanth Menon <nm@ti.com>
2720M: Vignesh Raghavendra <vigneshr@ti.com>
2715M: Tero Kristo <kristo@kernel.org>2721M: Tero Kristo <kristo@kernel.org>
2716L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)2722L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
2717S: Supported2723S: Supported
@@ -4656,7 +4662,7 @@ W: http://linux-cifs.samba.org/ · 1938 unmodified lines
4656T: git git://git.samba.org/sfrench/cifs-2.6.git4662T: git git://git.samba.org/sfrench/cifs-2.6.git
4657F: Documentation/admin-guide/cifs/4663F: Documentation/admin-guide/cifs/
4658F: fs/cifs/4664F: fs/cifs/
4659F: fs/cifs_common/4665F: fs/smbfs_common/
4660 4666
4661COMPACTPCI HOTPLUG CORE4667COMPACTPCI HOTPLUG CORE
4662M: Scott Murray <scott@spiteful.org>4668M: Scott Murray <scott@spiteful.org>
@@ -8608,9 +8614,8 @@ F: Documentation/devicetree/bindings/iio/humidity/st,hts221.yaml · 3945 unmodified lines
8608F: drivers/iio/humidity/hts221*8614F: drivers/iio/humidity/hts221*
8609 8615
8610HUAWEI ETHERNET DRIVER8616HUAWEI ETHERNET DRIVER
8611M: Bin Luo <luobin9@huawei.com>
8612L: netdev@vger.kernel.org8617L: netdev@vger.kernel.org
8613S: Supported8618S: Orphan
8614F: Documentation/networking/device_drivers/ethernet/huawei/hinic.rst8619F: Documentation/networking/device_drivers/ethernet/huawei/hinic.rst
8615F: drivers/net/ethernet/huawei/hinic/8620F: drivers/net/ethernet/huawei/hinic/
8616 8621
@@ -10194,8 +10199,8 @@ M: Hyunchul Lee <hyc.lee@gmail.com> · 1577 unmodified lines
10194L: linux-cifs@vger.kernel.org10199L: linux-cifs@vger.kernel.org
10195S: Maintained10200S: Maintained
10196T: git git://git.samba.org/ksmbd.git10201T: git git://git.samba.org/ksmbd.git
10197F: fs/cifs_common/
10198F: fs/ksmbd/10202F: fs/ksmbd/
10203F: fs/smbfs_common/
10199 10204
10200KERNEL UNIT TESTING FRAMEWORK (KUnit)10205KERNEL UNIT TESTING FRAMEWORK (KUnit)
10201M: Brendan Higgins <brendanhiggins@google.com>10206M: Brendan Higgins <brendanhiggins@google.com>
@@ -17793,7 +17798,6 @@ F: drivers/staging/nvec/ · 7591 unmodified lines
17793 17798
17794STAGING - OLPC SECONDARY DISPLAY CONTROLLER (DCON)17799STAGING - OLPC SECONDARY DISPLAY CONTROLLER (DCON)
17795M: Jens Frederich <jfrederich@gmail.com>17800M: Jens Frederich <jfrederich@gmail.com>
17796M: Daniel Drake <dsd@laptop.org>
17797M: Jon Nettleton <jon.nettleton@gmail.com>17801M: Jon Nettleton <jon.nettleton@gmail.com>
17798S: Maintained17802S: Maintained
17799W: http://wiki.laptop.org/go/DCON17803W: http://wiki.laptop.org/go/DCON
@@ -18549,13 +18553,14 @@ T: git git://linuxtv.org/media_tree.git · 749 unmodified lines
18549F: drivers/media/radio/radio-raremono.c18553F: drivers/media/radio/radio-raremono.c
18550 18554
18551THERMAL18555THERMAL
18552M: Zhang Rui <rui.zhang@intel.com>18556M: Rafael J. Wysocki <rafael@kernel.org>
18553M: Daniel Lezcano <daniel.lezcano@linaro.org>18557M: Daniel Lezcano <daniel.lezcano@linaro.org>
18554R: Amit Kucheria <amitk@kernel.org>18558R: Amit Kucheria <amitk@kernel.org>
18559R: Zhang Rui <rui.zhang@intel.com>
18555L: linux-pm@vger.kernel.org18560L: linux-pm@vger.kernel.org
18556S: Supported18561S: Supported
18557Q: https://patchwork.kernel.org/project/linux-pm/list/18562Q: https://patchwork.kernel.org/project/linux-pm/list/
18558T: git git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git18563T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
18559F: Documentation/devicetree/bindings/thermal/18564F: Documentation/devicetree/bindings/thermal/
18560F: drivers/thermal/18565F: drivers/thermal/
18561F: include/linux/cpu_cooling.h18566F: include/linux/cpu_cooling.h
@@ -20698,7 +20703,6 @@ S: Maintained · 2136 unmodified lines
20698F: mm/zbud.c20703F: mm/zbud.c
20699 20704
20700ZD1211RW WIRELESS DRIVER20705ZD1211RW WIRELESS DRIVER
20701M: Daniel Drake <dsd@gentoo.org>
20702M: Ulrich Kunitz <kune@deine-taler.de>20706M: Ulrich Kunitz <kune@deine-taler.de>
20703L: linux-wireless@vger.kernel.org20707L: linux-wireless@vger.kernel.org
20704L: zd1211-devs@lists.sourceforge.net (subscribers-only)20708L: zd1211-devs@lists.sourceforge.net (subscribers-only)
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
2VERSION = 52VERSION = 5
3PATCHLEVEL = 153PATCHLEVEL = 15
4SUBLEVEL = 04SUBLEVEL = 0
5EXTRAVERSION = -rc35EXTRAVERSION = -rc4
6NAME = Opossums on Parade6NAME = Opossums on Parade
7 7
8# *DOCUMENTATION*8# *DOCUMENTATION*
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts+0−1
@@ -71,7 +71,6 @@ · 70 unmodified lines
71 isc: isc@f0008000 {71 isc: isc@f0008000 {
72 pinctrl-names = "default";72 pinctrl-names = "default";
73 pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>;73 pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>;
74 status = "okay";
75 };74 };
76 75
77 qspi1: spi@f0024000 {76 qspi1: spi@f0024000 {
arch/arm/boot/dts/at91-sama7g5ek.dts+39−6
@@ -196,11 +196,13 @@ · 195 unmodified lines
196 196
197 regulator-state-standby {197 regulator-state-standby {
198 regulator-on-in-suspend;198 regulator-on-in-suspend;
199 regulator-suspend-microvolt = <1350000>;
199 regulator-mode = <4>;200 regulator-mode = <4>;
200 };201 };
201 202
202 regulator-state-mem {203 regulator-state-mem {
203 regulator-on-in-suspend;204 regulator-on-in-suspend;
205 regulator-suspend-microvolt = <1350000>;
204 regulator-mode = <4>;206 regulator-mode = <4>;
205 };207 };
206 };208 };
@@ -353,7 +355,10 @@ · 146 unmodified lines
353 #address-cells = <1>;355 #address-cells = <1>;
354 #size-cells = <0>;356 #size-cells = <0>;
355 pinctrl-names = "default";357 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>;
357 phy-mode = "rgmii-id";362 phy-mode = "rgmii-id";
358 status = "okay";363 status = "okay";
359 364
@@ -368,7 +373,9 @@ · 8 unmodified lines
368 #address-cells = <1>;373 #address-cells = <1>;
369 #size-cells = <0>;374 #size-cells = <0>;
370 pinctrl-names = "default";375 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>;
372 phy-mode = "rmii";379 phy-mode = "rmii";
373 status = "okay";380 status = "okay";
374 381
@@ -423,14 +430,20 @@ · 48 unmodified lines
423 <PIN_PA15__G0_TXEN>,430 <PIN_PA15__G0_TXEN>,
424 <PIN_PA30__G0_RXCK>,431 <PIN_PA30__G0_RXCK>,
425 <PIN_PA18__G0_RXDV>,432 <PIN_PA18__G0_RXDV>,
426 <PIN_PA22__G0_MDC>,
427 <PIN_PA23__G0_MDIO>,
428 <PIN_PA25__G0_125CK>;433 <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>;
429 bias-disable;441 bias-disable;
430 };442 };
431 443
432 pinctrl_gmac0_txck_default: gmac0_txck_default {444 pinctrl_gmac0_txck_default: gmac0_txck_default {
433 pinmux = <PIN_PA24__G0_TXCK>;445 pinmux = <PIN_PA24__G0_TXCK>;
446 slew-rate = <0>;
434 bias-pull-up;447 bias-pull-up;
435 };448 };
436 449
@@ -447,8 +460,13 @@ · 10 unmodified lines
447 <PIN_PD25__G1_RX0>,460 <PIN_PD25__G1_RX0>,
448 <PIN_PD26__G1_RX1>,461 <PIN_PD26__G1_RX1>,
449 <PIN_PD27__G1_RXER>,462 <PIN_PD27__G1_RXER>,
450 <PIN_PD24__G1_RXDV>,463 <PIN_PD24__G1_RXDV>;
451 <PIN_PD28__G1_MDC>,464 slew-rate = <0>;
465 bias-disable;
466 };
467
468 pinctrl_gmac1_mdio_default: gmac1_mdio_default {
469 pinmux = <PIN_PD28__G1_MDC>,
452 <PIN_PD29__G1_MDIO>;470 <PIN_PD29__G1_MDIO>;
453 bias-disable;471 bias-disable;
454 };472 };
@@ -540,6 +558,7 @@ · 85 unmodified lines
540 <PIN_PA8__SDMMC0_DAT5>,558 <PIN_PA8__SDMMC0_DAT5>,
541 <PIN_PA9__SDMMC0_DAT6>,559 <PIN_PA9__SDMMC0_DAT6>,
542 <PIN_PA10__SDMMC0_DAT7>;560 <PIN_PA10__SDMMC0_DAT7>;
561 slew-rate = <0>;
543 bias-pull-up;562 bias-pull-up;
544 };563 };
545 564
@@ -547,6 +566,7 @@ · 1 unmodified line
547 pinmux = <PIN_PA0__SDMMC0_CK>,566 pinmux = <PIN_PA0__SDMMC0_CK>,
548 <PIN_PA2__SDMMC0_RSTN>,567 <PIN_PA2__SDMMC0_RSTN>,
549 <PIN_PA11__SDMMC0_DS>;568 <PIN_PA11__SDMMC0_DS>;
569 slew-rate = <0>;
550 bias-pull-up;570 bias-pull-up;
551 };571 };
552 };572 };
@@ -558,6 +578,7 @@ · 5 unmodified lines
558 <PIN_PC0__SDMMC1_DAT1>,578 <PIN_PC0__SDMMC1_DAT1>,
559 <PIN_PC1__SDMMC1_DAT2>,579 <PIN_PC1__SDMMC1_DAT2>,
560 <PIN_PC2__SDMMC1_DAT3>;580 <PIN_PC2__SDMMC1_DAT3>;
581 slew-rate = <0>;
561 bias-pull-up;582 bias-pull-up;
562 };583 };
563 584
@@ -566,6 +587,7 @@ · 2 unmodified lines
566 <PIN_PB28__SDMMC1_RSTN>,587 <PIN_PB28__SDMMC1_RSTN>,
567 <PIN_PC5__SDMMC1_1V8SEL>,588 <PIN_PC5__SDMMC1_1V8SEL>,
568 <PIN_PC4__SDMMC1_CD>;589 <PIN_PC4__SDMMC1_CD>;
590 slew-rate = <0>;
569 bias-pull-up;591 bias-pull-up;
570 };592 };
571 };593 };
@@ -577,11 +599,13 @@ · 5 unmodified lines
577 <PIN_PD6__SDMMC2_DAT1>,599 <PIN_PD6__SDMMC2_DAT1>,
578 <PIN_PD7__SDMMC2_DAT2>,600 <PIN_PD7__SDMMC2_DAT2>,
579 <PIN_PD8__SDMMC2_DAT3>;601 <PIN_PD8__SDMMC2_DAT3>;
602 slew-rate = <0>;
580 bias-pull-up;603 bias-pull-up;
581 };604 };
582 605
583 ck {606 ck {
584 pinmux = <PIN_PD4__SDMMC2_CK>;607 pinmux = <PIN_PD4__SDMMC2_CK>;
608 slew-rate = <0>;
585 bias-pull-up;609 bias-pull-up;
586 };610 };
587 };611 };
@@ -634,6 +658,15 @@ · 46 unmodified lines
634 pinctrl-0 = <&pinctrl_sdmmc2_default>;658 pinctrl-0 = <&pinctrl_sdmmc2_default>;
635};659};
636 660
661&shdwc {
662 atmel,shdwc-debouncer = <976>;
663 status = "okay";
664
665 input@0 {
666 reg = <0>;
667 };
668};
669
637&spdifrx {670&spdifrx {
638 pinctrl-names = "default";671 pinctrl-names = "default";
639 pinctrl-0 = <&pinctrl_spdifrx_default>;672 pinctrl-0 = <&pinctrl_spdifrx_default>;
arch/arm/boot/dts/imx53-m53menlo.dts+2−2
@@ -56,6 +56,7 @@ · 55 unmodified lines
56 panel {56 panel {
57 compatible = "edt,etm0700g0dh6";57 compatible = "edt,etm0700g0dh6";
58 pinctrl-0 = <&pinctrl_display_gpio>;58 pinctrl-0 = <&pinctrl_display_gpio>;
59 pinctrl-names = "default";
59 enable-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>;60 enable-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>;
60 61
61 port {62 port {
@@ -76,8 +77,7 @@ · 14 unmodified lines
76 regulator-name = "vbus";77 regulator-name = "vbus";
77 regulator-min-microvolt = <5000000>;78 regulator-min-microvolt = <5000000>;
78 regulator-max-microvolt = <5000000>;79 regulator-max-microvolt = <5000000>;
79 gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;80 gpio = <&gpio1 2 0>;
80 enable-active-high;
81 };81 };
82};82};
83 83
arch/arm/boot/dts/imx6dl-yapp4-common.dtsi+5−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
5#include <dt-bindings/gpio/gpio.h>5#include <dt-bindings/gpio/gpio.h>
6#include <dt-bindings/interrupt-controller/irq.h>6#include <dt-bindings/interrupt-controller/irq.h>
7#include <dt-bindings/input/input.h>7#include <dt-bindings/input/input.h>
8#include <dt-bindings/leds/common.h>
8#include <dt-bindings/pwm/pwm.h>9#include <dt-bindings/pwm/pwm.h>
9 10
10/ {11/ {
@@ -277,6 +278,7 @@ · 266 unmodified lines
277 led-cur = /bits/ 8 <0x20>;278 led-cur = /bits/ 8 <0x20>;
278 max-cur = /bits/ 8 <0x60>;279 max-cur = /bits/ 8 <0x60>;
279 reg = <0>;280 reg = <0>;
281 color = <LED_COLOR_ID_RED>;
280 };282 };
281 283
282 chan@1 {284 chan@1 {
@@ -284,6 +286,7 @@ · 1 unmodified line
284 led-cur = /bits/ 8 <0x20>;286 led-cur = /bits/ 8 <0x20>;
285 max-cur = /bits/ 8 <0x60>;287 max-cur = /bits/ 8 <0x60>;
286 reg = <1>;288 reg = <1>;
289 color = <LED_COLOR_ID_GREEN>;
287 };290 };
288 291
289 chan@2 {292 chan@2 {
@@ -291,6 +294,7 @@ · 1 unmodified line
291 led-cur = /bits/ 8 <0x20>;294 led-cur = /bits/ 8 <0x20>;
292 max-cur = /bits/ 8 <0x60>;295 max-cur = /bits/ 8 <0x60>;
293 reg = <2>;296 reg = <2>;
297 color = <LED_COLOR_ID_BLUE>;
294 };298 };
295 299
296 chan@3 {300 chan@3 {
@@ -298,6 +302,7 @@ · 1 unmodified line
298 led-cur = /bits/ 8 <0x0>;302 led-cur = /bits/ 8 <0x0>;
299 max-cur = /bits/ 8 <0x0>;303 max-cur = /bits/ 8 <0x0>;
300 reg = <3>;304 reg = <3>;
305 color = <LED_COLOR_ID_WHITE>;
301 };306 };
302 };307 };
303 308
arch/arm/boot/dts/imx6qdl-pico.dtsi+11−0
@@ -176,7 +176,18 @@ · 175 unmodified lines
176 pinctrl-0 = <&pinctrl_enet>;176 pinctrl-0 = <&pinctrl_enet>;
177 phy-mode = "rgmii-id";177 phy-mode = "rgmii-id";
178 phy-reset-gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;178 phy-reset-gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;
179 phy-handle = <&phy>;
179 status = "okay";180 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 };
180};191};
181 192
182&hdmi {193&hdmi {
arch/arm/boot/dts/imx6sx-sdb.dts+2−2
@@ -114,7 +114,7 @@ · 113 unmodified lines
114 compatible = "micron,n25q256a", "jedec,spi-nor";114 compatible = "micron,n25q256a", "jedec,spi-nor";
115 spi-max-frequency = <29000000>;115 spi-max-frequency = <29000000>;
116 spi-rx-bus-width = <4>;116 spi-rx-bus-width = <4>;
117 spi-tx-bus-width = <4>;117 spi-tx-bus-width = <1>;
118 reg = <0>;118 reg = <0>;
119 };119 };
120 120
@@ -124,7 +124,7 @@ · 3 unmodified lines
124 compatible = "micron,n25q256a", "jedec,spi-nor";124 compatible = "micron,n25q256a", "jedec,spi-nor";
125 spi-max-frequency = <29000000>;125 spi-max-frequency = <29000000>;
126 spi-rx-bus-width = <4>;126 spi-rx-bus-width = <4>;
127 spi-tx-bus-width = <4>;127 spi-tx-bus-width = <1>;
128 reg = <2>;128 reg = <2>;
129 };129 };
130};130};
arch/arm/boot/dts/imx6ul-14x14-evk.dtsi+1−1
@@ -292,7 +292,7 @@ · 291 unmodified lines
292 compatible = "micron,n25q256a", "jedec,spi-nor";292 compatible = "micron,n25q256a", "jedec,spi-nor";
293 spi-max-frequency = <29000000>;293 spi-max-frequency = <29000000>;
294 spi-rx-bus-width = <4>;294 spi-rx-bus-width = <4>;
295 spi-tx-bus-width = <4>;295 spi-tx-bus-width = <1>;
296 reg = <0>;296 reg = <0>;
297 };297 };
298};298};
arch/arm/boot/dts/omap3430-sdp.dts+1−1
@@ -101,7 +101,7 @@ · 100 unmodified lines
101 101
102 nand@1,0 {102 nand@1,0 {
103 compatible = "ti,omap2-nand";103 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 */
105 interrupt-parent = <&gpmc>;105 interrupt-parent = <&gpmc>;
106 interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */106 interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
107 <1 IRQ_TYPE_NONE>; /* termcount */107 <1 IRQ_TYPE_NONE>; /* termcount */
arch/arm/boot/dts/qcom-apq8064.dtsi+7−8
@@ -198,7 +198,7 @@ · 197 unmodified lines
198 clock-frequency = <19200000>;198 clock-frequency = <19200000>;
199 };199 };
200 200
201 pxo_board {201 pxo_board: pxo_board {
202 compatible = "fixed-clock";202 compatible = "fixed-clock";
203 #clock-cells = <0>;203 #clock-cells = <0>;
204 clock-frequency = <27000000>;204 clock-frequency = <27000000>;
@@ -1148,22 +1148,21 @@ · 943 unmodified lines
1148 };1148 };
1149 1149
1150 gpu: adreno-3xx@4300000 {1150 gpu: adreno-3xx@4300000 {
1151 compatible = "qcom,adreno-3xx";1151 compatible = "qcom,adreno-320.2", "qcom,adreno";
1152 reg = <0x04300000 0x20000>;1152 reg = <0x04300000 0x20000>;
1153 reg-names = "kgsl_3d0_reg_memory";1153 reg-names = "kgsl_3d0_reg_memory";
1154 interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;1154 interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
1155 interrupt-names = "kgsl_3d0_irq";1155 interrupt-names = "kgsl_3d0_irq";
1156 clock-names =1156 clock-names =
1157 "core_clk",1157 "core",
1158 "iface_clk",1158 "iface",
1159 "mem_clk",1159 "mem",
1160 "mem_iface_clk";1160 "mem_iface";
1161 clocks =1161 clocks =
1162 <&mmcc GFX3D_CLK>,1162 <&mmcc GFX3D_CLK>,
1163 <&mmcc GFX3D_AHB_CLK>,1163 <&mmcc GFX3D_AHB_CLK>,
1164 <&mmcc GFX3D_AXI_CLK>,1164 <&mmcc GFX3D_AXI_CLK>,
1165 <&mmcc MMSS_IMEM_AHB_CLK>;1165 <&mmcc MMSS_IMEM_AHB_CLK>;
1166 qcom,chipid = <0x03020002>;
1167 1166
1168 iommus = <&gfx3d 01167 iommus = <&gfx3d 0
1169 &gfx3d 11168 &gfx3d 1
@@ -1306,7 +1305,7 @@ · 136 unmodified lines
1306 reg-names = "dsi_pll", "dsi_phy", "dsi_phy_regulator";1305 reg-names = "dsi_pll", "dsi_phy", "dsi_phy_regulator";
1307 clock-names = "iface_clk", "ref";1306 clock-names = "iface_clk", "ref";
1308 clocks = <&mmcc DSI_M_AHB_CLK>,1307 clocks = <&mmcc DSI_M_AHB_CLK>,
1309 <&cxo_board>;1308 <&pxo_board>;
1310 };1309 };
1311 1310
1312 1311
arch/arm/boot/dts/sama7g5.dtsi+39−0
@@ -75,6 +75,17 @@ · 74 unmodified lines
75 #size-cells = <1>;75 #size-cells = <1>;
76 ranges;76 ranges;
77 77
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
78 secumod: secumod@e0004000 {89 secumod: secumod@e0004000 {
79 compatible = "microchip,sama7g5-secumod", "atmel,sama5d2-secumod", "syscon";90 compatible = "microchip,sama7g5-secumod", "atmel,sama5d2-secumod", "syscon";
80 reg = <0xe0004000 0x4000>;91 reg = <0xe0004000 0x4000>;
@@ -111,6 +122,17 @@ · 30 unmodified lines
111 clock-names = "td_slck", "md_slck", "main_xtal";122 clock-names = "td_slck", "md_slck", "main_xtal";
112 };123 };
113 124
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
114 rtt: rtt@e001d020 {136 rtt: rtt@e001d020 {
115 compatible = "microchip,sama7g5-rtt", "microchip,sam9x60-rtt", "atmel,at91sam9260-rtt";137 compatible = "microchip,sama7g5-rtt", "microchip,sam9x60-rtt", "atmel,at91sam9260-rtt";
116 reg = <0xe001d020 0x30>;138 reg = <0xe001d020 0x30>;
@@ -137,6 +159,11 @@ · 20 unmodified lines
137 clocks = <&clk32k 0>;159 clocks = <&clk32k 0>;
138 };160 };
139 161
162 chipid@e0020000 {
163 compatible = "microchip,sama7g5-chipid";
164 reg = <0xe0020000 0x8>;
165 };
166
140 sdmmc0: mmc@e1204000 {167 sdmmc0: mmc@e1204000 {
141 compatible = "microchip,sama7g5-sdhci", "microchip,sam9x60-sdhci";168 compatible = "microchip,sama7g5-sdhci", "microchip,sam9x60-sdhci";
142 reg = <0xe1204000 0x4000>;169 reg = <0xe1204000 0x4000>;
@@ -515,6 +542,18 @@ · 372 unmodified lines
515 };542 };
516 };543 };
517 544
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
518 gic: interrupt-controller@e8c11000 {557 gic: interrupt-controller@e8c11000 {
519 compatible = "arm,cortex-a7-gic";558 compatible = "arm,cortex-a7-gic";
520 #interrupt-cells = <3>;559 #interrupt-cells = <3>;
arch/arm/boot/dts/vexpress-v2m-rs1.dtsi+60−7
@@ -17,6 +17,7 @@ · 16 unmodified lines
17 * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT17 * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT
18 * CHANGES TO vexpress-v2m.dtsi!18 * CHANGES TO vexpress-v2m.dtsi!
19 */19 */
20#include <dt-bindings/interrupt-controller/arm-gic.h>
20 21
21/ {22/ {
22 v2m_fixed_3v3: fixed-regulator-0 {23 v2m_fixed_3v3: fixed-regulator-0 {
@@ -101,16 +102,68 @@ · 78 unmodified lines
101 };102 };
102 103
103 bus@8000000 {104 bus@8000000 {
104 motherboard-bus {105 compatible = "simple-bus";
105 model = "V2M-P1";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 {
106 arm,hbi = <0x190>;156 arm,hbi = <0x190>;
107 arm,vexpress,site = <0>;157 arm,vexpress,site = <0>;
108 arm,v2m-memory-map = "rs1";
109 compatible = "arm,vexpress,v2m-p1", "simple-bus";158 compatible = "arm,vexpress,v2m-p1", "simple-bus";
110 #address-cells = <2>; /* SMB chipselect number and offset */159 #address-cells = <2>; /* SMB chipselect number and offset */
111 #size-cells = <1>;160 #size-cells = <1>;
112 #interrupt-cells = <1>;161 ranges = <0 0 0x08000000 0x04000000>,
113 ranges;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>;
114 167
115 nor_flash: flash@0 {168 nor_flash: flash@0 {
116 compatible = "arm,vexpress-flash", "cfi-flash";169 compatible = "arm,vexpress-flash", "cfi-flash";
@@ -215,7 +268,7 @@ · 98 unmodified lines
215 clock-names = "apb_pclk";268 clock-names = "apb_pclk";
216 };269 };
217 270
218 mmci@50000 {271 mmc@50000 {
219 compatible = "arm,pl180", "arm,primecell";272 compatible = "arm,pl180", "arm,primecell";
220 reg = <0x050000 0x1000>;273 reg = <0x050000 0x1000>;
221 interrupts = <9>, <10>;274 interrupts = <9>, <10>;
@@ -275,7 +328,7 @@ · 53 unmodified lines
275 clock-names = "uartclk", "apb_pclk";328 clock-names = "uartclk", "apb_pclk";
276 };329 };
277 330
278 wdt@f0000 {331 watchdog@f0000 {
279 compatible = "arm,sp805", "arm,primecell";332 compatible = "arm,sp805", "arm,primecell";
280 reg = <0x0f0000 0x1000>;333 reg = <0x0f0000 0x1000>;
281 interrupts = <0>;334 interrupts = <0>;
arch/arm/boot/dts/vexpress-v2m.dtsi+60−5
@@ -17,18 +17,73 @@ · 16 unmodified lines
17 * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT17 * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT
18 * CHANGES TO vexpress-v2m-rs1.dtsi!18 * CHANGES TO vexpress-v2m-rs1.dtsi!
19 */19 */
20#include <dt-bindings/interrupt-controller/arm-gic.h>
20 21
21/ {22/ {
22 bus@4000000 {23 bus@40000000 {
23 motherboard {24 compatible = "simple-bus";
24 model = "V2M-P1";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 {
25 arm,hbi = <0x190>;77 arm,hbi = <0x190>;
26 arm,vexpress,site = <0>;78 arm,vexpress,site = <0>;
27 compatible = "arm,vexpress,v2m-p1", "simple-bus";79 compatible = "arm,vexpress,v2m-p1", "simple-bus";
28 #address-cells = <2>; /* SMB chipselect number and offset */80 #address-cells = <2>; /* SMB chipselect number and offset */
29 #size-cells = <1>;81 #size-cells = <1>;
30 #interrupt-cells = <1>;82 ranges = <0 0 0x40000000 0x04000000>,
31 ranges;83 <1 0 0x44000000 0x04000000>,
84 <2 0 0x48000000 0x04000000>,
85 <3 0 0x4c000000 0x04000000>,
86 <7 0 0x10000000 0x00020000>;
32 87
33 flash@0,00000000 {88 flash@0,00000000 {
34 compatible = "arm,vexpress-flash", "cfi-flash";89 compatible = "arm,vexpress-flash", "cfi-flash";
arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts+1−56
@@ -237,62 +237,7 @@ · 236 unmodified lines
237 };237 };
238 238
239 bus@8000000 {239 bus@8000000 {
240 compatible = "simple-bus";240 ranges = <0x8000000 0 0x8000000 0x18000000>;
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>;
296 };241 };
297 242
298 site2: hsb@40000000 {243 site2: hsb@40000000 {
arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts+1−56
@@ -609,62 +609,7 @@ · 608 unmodified lines
609 };609 };
610 610
611 smb: bus@8000000 {611 smb: bus@8000000 {
612 compatible = "simple-bus";612 ranges = <0x8000000 0 0x8000000 0x18000000>;
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>;
668 };613 };
669 614
670 site2: hsb@40000000 {615 site2: hsb@40000000 {
arch/arm/boot/dts/vexpress-v2p-ca5s.dts+1−56
@@ -207,62 +207,7 @@ · 206 unmodified lines
207 };207 };
208 208
209 smb: bus@8000000 {209 smb: bus@8000000 {
210 compatible = "simple-bus";210 ranges = <0 0x8000000 0x18000000>;
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>;
266 };211 };
267 212
268 site2: hsb@40000000 {213 site2: hsb@40000000 {
arch/arm/boot/dts/vexpress-v2p-ca9.dts+0−58
@@ -295,64 +295,6 @@ · 294 unmodified lines
295 };295 };
296 };296 };
297 297
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
356 site2: hsb@e0000000 {298 site2: hsb@e0000000 {
357 compatible = "simple-bus";299 compatible = "simple-bus";
358 #address-cells = <1>;300 #address-cells = <1>;
arch/arm/common/sharpsl_param.c+3−1
@@ -40,7 +40,9 @@ EXPORT_SYMBOL(sharpsl_param); · 39 unmodified lines
40 40
41void sharpsl_save_param(void)41void sharpsl_save_param(void)
42{42{
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));
44 46
45 if (sharpsl_param.comadj_keyword != COMADJ_MAGIC)47 if (sharpsl_param.comadj_keyword != COMADJ_MAGIC)
46 sharpsl_param.comadj=-1;48 sharpsl_param.comadj=-1;
arch/arm/configs/gemini_defconfig+1−0
@@ -76,6 +76,7 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y · 75 unmodified lines
76CONFIG_DRM=y76CONFIG_DRM=y
77CONFIG_DRM_PANEL_ILITEK_IL9322=y77CONFIG_DRM_PANEL_ILITEK_IL9322=y
78CONFIG_DRM_TVE200=y78CONFIG_DRM_TVE200=y
79CONFIG_FB=y
79CONFIG_LOGO=y80CONFIG_LOGO=y
80CONFIG_USB=y81CONFIG_USB=y
81CONFIG_USB_MON=y82CONFIG_USB_MON=y
arch/arm/configs/imx_v6_v7_defconfig+1−0
@@ -292,6 +292,7 @@ CONFIG_DRM_IMX_LDB=y · 291 unmodified lines
292CONFIG_DRM_IMX_HDMI=y292CONFIG_DRM_IMX_HDMI=y
293CONFIG_DRM_ETNAVIV=y293CONFIG_DRM_ETNAVIV=y
294CONFIG_DRM_MXSFB=y294CONFIG_DRM_MXSFB=y
295CONFIG_FB=y
295CONFIG_FB_MODE_HELPERS=y296CONFIG_FB_MODE_HELPERS=y
296CONFIG_LCD_CLASS_DEVICE=y297CONFIG_LCD_CLASS_DEVICE=y
297CONFIG_LCD_L4F00242T03=y298CONFIG_LCD_L4F00242T03=y
arch/arm/configs/multi_v7_defconfig+3−0
@@ -456,6 +456,7 @@ CONFIG_PINCTRL_STMFX=y · 455 unmodified lines
456CONFIG_PINCTRL_PALMAS=y456CONFIG_PINCTRL_PALMAS=y
457CONFIG_PINCTRL_OWL=y457CONFIG_PINCTRL_OWL=y
458CONFIG_PINCTRL_S500=y458CONFIG_PINCTRL_S500=y
459CONFIG_PINCTRL_MSM=y
459CONFIG_PINCTRL_APQ8064=y460CONFIG_PINCTRL_APQ8064=y
460CONFIG_PINCTRL_APQ8084=y461CONFIG_PINCTRL_APQ8084=y
461CONFIG_PINCTRL_IPQ8064=y462CONFIG_PINCTRL_IPQ8064=y
@@ -725,6 +726,7 @@ CONFIG_DRM_PL111=m · 263 unmodified lines
725CONFIG_DRM_LIMA=m726CONFIG_DRM_LIMA=m
726CONFIG_DRM_PANFROST=m727CONFIG_DRM_PANFROST=m
727CONFIG_DRM_ASPEED_GFX=m728CONFIG_DRM_ASPEED_GFX=m
729CONFIG_FB=y
728CONFIG_FB_EFI=y730CONFIG_FB_EFI=y
729CONFIG_FB_WM8505=y731CONFIG_FB_WM8505=y
730CONFIG_FB_SH_MOBILE_LCDC=y732CONFIG_FB_SH_MOBILE_LCDC=y
@@ -1122,6 +1124,7 @@ CONFIG_PHY_DM816X_USB=m · 391 unmodified lines
1122CONFIG_OMAP_USB2=y1124CONFIG_OMAP_USB2=y
1123CONFIG_TI_PIPE3=y1125CONFIG_TI_PIPE3=y
1124CONFIG_TWL4030_USB=m1126CONFIG_TWL4030_USB=m
1127CONFIG_RAS=y
1125CONFIG_NVMEM_IMX_OCOTP=y1128CONFIG_NVMEM_IMX_OCOTP=y
1126CONFIG_ROCKCHIP_EFUSE=m1129CONFIG_ROCKCHIP_EFUSE=m
1127CONFIG_NVMEM_SUNXI_SID=y1130CONFIG_NVMEM_SUNXI_SID=y
arch/arm/mach-at91/pm.c+114−16
@@ -47,12 +47,26 @@ struct at91_pm_bu { · 46 unmodified lines
47 unsigned long ddr_phy_calibration[BACKUP_DDR_PHY_CALIBRATION];47 unsigned long ddr_phy_calibration[BACKUP_DDR_PHY_CALIBRATION];
48};48};
49 49
50/*
51 * struct at91_pm_sfrbu_offsets: registers mapping for SFRBU
52 * @pswbu: power switch BU control registers
53 */
54struct at91_pm_sfrbu_regs {
55 struct {
56 u32 key;
57 u32 ctrl;
58 u32 state;
59 u32 softsw;
60 } pswbu;
61};
62
50/**63/**
51 * struct at91_soc_pm - AT91 SoC power management data structure64 * struct at91_soc_pm - AT91 SoC power management data structure
52 * @config_shdwc_ws: wakeup sources configuration function for SHDWC65 * @config_shdwc_ws: wakeup sources configuration function for SHDWC
53 * @config_pmc_ws: wakeup srouces configuration function for PMC66 * @config_pmc_ws: wakeup srouces configuration function for PMC
54 * @ws_ids: wakup sources of_device_id array67 * @ws_ids: wakup sources of_device_id array
55 * @data: PM data to be used on last phase of suspend68 * @data: PM data to be used on last phase of suspend
69 * @sfrbu_regs: SFRBU registers mapping
56 * @bu: backup unit mapped data (for backup mode)70 * @bu: backup unit mapped data (for backup mode)
57 * @memcs: memory chip select71 * @memcs: memory chip select
58 */72 */
@@ -62,6 +76,7 @@ struct at91_soc_pm { · 3 unmodified lines
62 const struct of_device_id *ws_ids;76 const struct of_device_id *ws_ids;
63 struct at91_pm_bu *bu;77 struct at91_pm_bu *bu;
64 struct at91_pm_data data;78 struct at91_pm_data data;
79 struct at91_pm_sfrbu_regs sfrbu_regs;
65 void *memcs;80 void *memcs;
66};81};
67 82
@@ -356,9 +371,36 @@ static int at91_suspend_finish(unsigned long val) · 288 unmodified lines
356 return 0;371 return 0;
357}372}
358 373
374static 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
359static void at91_pm_suspend(suspend_state_t state)399static void at91_pm_suspend(suspend_state_t state)
360{400{
361 if (soc_pm.data.mode == AT91_PM_BACKUP) {401 if (soc_pm.data.mode == AT91_PM_BACKUP) {
402 at91_pm_switch_ba_to_vbat();
403
362 cpu_suspend(0, at91_suspend_finish);404 cpu_suspend(0, at91_suspend_finish);
363 405
364 /* The SRAM is lost between suspend cycles */406 /* The SRAM is lost between suspend cycles */
@@ -589,18 +631,22 @@ static const struct of_device_id ramc_phy_ids[] __initconst = { · 224 unmodified lines
589 { /* Sentinel. */ },631 { /* Sentinel. */ },
590};632};
591 633
592static __init void at91_dt_ramc(bool phy_mandatory)634static __init int at91_dt_ramc(bool phy_mandatory)
593{635{
594 struct device_node *np;636 struct device_node *np;
595 const struct of_device_id *of_id;637 const struct of_device_id *of_id;
596 int idx = 0;638 int idx = 0;
597 void *standby = NULL;639 void *standby = NULL;
598 const struct ramc_info *ramc;640 const struct ramc_info *ramc;
641 int ret;
599 642
600 for_each_matching_node_and_match(np, ramc_ids, &of_id) {643 for_each_matching_node_and_match(np, ramc_ids, &of_id) {
601 soc_pm.data.ramc[idx] = of_iomap(np, 0);644 soc_pm.data.ramc[idx] = of_iomap(np, 0);
602 if (!soc_pm.data.ramc[idx])645 if (!soc_pm.data.ramc[idx]) {
603 panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx);646 pr_err("unable to map ramc[%d] cpu registers\n", idx);
647 ret = -ENOMEM;
648 goto unmap_ramc;
649 }
604 650
605 ramc = of_id->data;651 ramc = of_id->data;
606 if (ramc) {652 if (ramc) {
@@ -612,25 +658,42 @@ static __init void at91_dt_ramc(bool phy_mandatory) · 5 unmodified lines
612 idx++;658 idx++;
613 }659 }
614 660
615 if (!idx)661 if (!idx) {
616 panic(pr_fmt("unable to find compatible ram controller node in dtb\n"));662 pr_err("unable to find compatible ram controller node in dtb\n");
663 ret = -ENODEV;
664 goto unmap_ramc;
665 }
617 666
618 /* Lookup for DDR PHY node, if any. */667 /* Lookup for DDR PHY node, if any. */
619 for_each_matching_node_and_match(np, ramc_phy_ids, &of_id) {668 for_each_matching_node_and_match(np, ramc_phy_ids, &of_id) {
620 soc_pm.data.ramc_phy = of_iomap(np, 0);669 soc_pm.data.ramc_phy = of_iomap(np, 0);
621 if (!soc_pm.data.ramc_phy)670 if (!soc_pm.data.ramc_phy) {
622 panic(pr_fmt("unable to map ramc phy cpu registers\n"));671 pr_err("unable to map ramc phy cpu registers\n");
672 ret = -ENOMEM;
673 goto unmap_ramc;
674 }
623 }675 }
624 676
625 if (phy_mandatory && !soc_pm.data.ramc_phy)677 if (phy_mandatory && !soc_pm.data.ramc_phy) {
626 panic(pr_fmt("DDR PHY is mandatory!\n"));678 pr_err("DDR PHY is mandatory!\n");
679 ret = -ENODEV;
680 goto unmap_ramc;
681 }
627 682
628 if (!standby) {683 if (!standby) {
629 pr_warn("ramc no standby function available\n");684 pr_warn("ramc no standby function available\n");
630 return;685 return 0;
631 }686 }
632 687
633 at91_cpuidle_device.dev.platform_data = standby;688 at91_cpuidle_device.dev.platform_data = standby;
689
690 return 0;
691
692unmap_ramc:
693 while (idx)
694 iounmap(soc_pm.data.ramc[--idx]);
695
696 return ret;
634}697}
635 698
636static void at91rm9200_idle(void)699static void at91rm9200_idle(void)
@@ -1017,6 +1080,8 @@ static void __init at91_pm_init(void (*pm_idle)(void)) · 380 unmodified lines
1017 1080
1018void __init at91rm9200_pm_init(void)1081void __init at91rm9200_pm_init(void)
1019{1082{
1083 int ret;
1084
1020 if (!IS_ENABLED(CONFIG_SOC_AT91RM9200))1085 if (!IS_ENABLED(CONFIG_SOC_AT91RM9200))
1021 return;1086 return;
1022 1087
@@ -1028,7 +1093,9 @@ void __init at91rm9200_pm_init(void) · 5 unmodified lines
1028 soc_pm.data.standby_mode = AT91_PM_STANDBY;1093 soc_pm.data.standby_mode = AT91_PM_STANDBY;
1029 soc_pm.data.suspend_mode = AT91_PM_ULP0;1094 soc_pm.data.suspend_mode = AT91_PM_ULP0;
1030 1095
1031 at91_dt_ramc(false);1096 ret = at91_dt_ramc(false);
1097 if (ret)
1098 return;
1032 1099
1033 /*1100 /*
1034 * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh.1101 * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh.
@@ -1046,13 +1113,17 @@ void __init sam9x60_pm_init(void) · 11 unmodified lines
1046 static const int iomaps[] __initconst = {1113 static const int iomaps[] __initconst = {
1047 [AT91_PM_ULP1] = AT91_PM_IOMAP(SHDWC),1114 [AT91_PM_ULP1] = AT91_PM_IOMAP(SHDWC),
1048 };1115 };
1116 int ret;
1049 1117
1050 if (!IS_ENABLED(CONFIG_SOC_SAM9X60))1118 if (!IS_ENABLED(CONFIG_SOC_SAM9X60))
1051 return;1119 return;
1052 1120
1053 at91_pm_modes_validate(modes, ARRAY_SIZE(modes));1121 at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
1054 at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps));1122 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
1056 at91_pm_init(NULL);1127 at91_pm_init(NULL);
1057 1128
1058 soc_pm.ws_ids = sam9x60_ws_ids;1129 soc_pm.ws_ids = sam9x60_ws_ids;
@@ -1061,6 +1132,8 @@ void __init sam9x60_pm_init(void) · 2 unmodified lines
1061 1132
1062void __init at91sam9_pm_init(void)1133void __init at91sam9_pm_init(void)
1063{1134{
1135 int ret;
1136
1064 if (!IS_ENABLED(CONFIG_SOC_AT91SAM9))1137 if (!IS_ENABLED(CONFIG_SOC_AT91SAM9))
1065 return;1138 return;
1066 1139
@@ -1072,7 +1145,10 @@ void __init at91sam9_pm_init(void) · 5 unmodified lines
1072 soc_pm.data.standby_mode = AT91_PM_STANDBY;1145 soc_pm.data.standby_mode = AT91_PM_STANDBY;
1073 soc_pm.data.suspend_mode = AT91_PM_ULP0;1146 soc_pm.data.suspend_mode = AT91_PM_ULP0;
1074 1147
1075 at91_dt_ramc(false);1148 ret = at91_dt_ramc(false);
1149 if (ret)
1150 return;
1151
1076 at91_pm_init(at91sam9_idle);1152 at91_pm_init(at91sam9_idle);
1077}1153}
1078 1154
@@ -1081,12 +1157,16 @@ void __init sama5_pm_init(void) · 2 unmodified lines
1081 static const int modes[] __initconst = {1157 static const int modes[] __initconst = {
1082 AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP0_FAST,1158 AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP0_FAST,
1083 };1159 };
1160 int ret;
1084 1161
1085 if (!IS_ENABLED(CONFIG_SOC_SAMA5))1162 if (!IS_ENABLED(CONFIG_SOC_SAMA5))
1086 return;1163 return;
1087 1164
1088 at91_pm_modes_validate(modes, ARRAY_SIZE(modes));1165 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
1090 at91_pm_init(NULL);1170 at91_pm_init(NULL);
1091}1171}
1092 1172
@@ -1101,18 +1181,27 @@ void __init sama5d2_pm_init(void) · 8 unmodified lines
1101 [AT91_PM_BACKUP] = AT91_PM_IOMAP(SHDWC) |1181 [AT91_PM_BACKUP] = AT91_PM_IOMAP(SHDWC) |
1102 AT91_PM_IOMAP(SFRBU),1182 AT91_PM_IOMAP(SFRBU),
1103 };1183 };
1184 int ret;
1104 1185
1105 if (!IS_ENABLED(CONFIG_SOC_SAMA5D2))1186 if (!IS_ENABLED(CONFIG_SOC_SAMA5D2))
1106 return;1187 return;
1107 1188
1108 at91_pm_modes_validate(modes, ARRAY_SIZE(modes));1189 at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
1109 at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps));1190 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
1111 at91_pm_init(NULL);1195 at91_pm_init(NULL);
1112 1196
1113 soc_pm.ws_ids = sama5d2_ws_ids;1197 soc_pm.ws_ids = sama5d2_ws_ids;
1114 soc_pm.config_shdwc_ws = at91_sama5d2_config_shdwc_ws;1198 soc_pm.config_shdwc_ws = at91_sama5d2_config_shdwc_ws;
1115 soc_pm.config_pmc_ws = at91_sama5d2_config_pmc_ws;1199 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);
1116}1205}
1117 1206
1118void __init sama7_pm_init(void)1207void __init sama7_pm_init(void)
@@ -1127,18 +1216,27 @@ void __init sama7_pm_init(void) · 8 unmodified lines
1127 [AT91_PM_BACKUP] = AT91_PM_IOMAP(SFRBU) |1216 [AT91_PM_BACKUP] = AT91_PM_IOMAP(SFRBU) |
1128 AT91_PM_IOMAP(SHDWC),1217 AT91_PM_IOMAP(SHDWC),
1129 };1218 };
1219 int ret;
1130 1220
1131 if (!IS_ENABLED(CONFIG_SOC_SAMA7))1221 if (!IS_ENABLED(CONFIG_SOC_SAMA7))
1132 return;1222 return;
1133 1223
1134 at91_pm_modes_validate(modes, ARRAY_SIZE(modes));1224 at91_pm_modes_validate(modes, ARRAY_SIZE(modes));
1135 1225
1136 at91_dt_ramc(true);1226 ret = at91_dt_ramc(true);
1227 if (ret)
1228 return;
1229
1137 at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps));1230 at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps));
1138 at91_pm_init(NULL);1231 at91_pm_init(NULL);
1139 1232
1140 soc_pm.ws_ids = sama7g5_ws_ids;1233 soc_pm.ws_ids = sama7g5_ws_ids;
1141 soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws;1234 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);
1142}1240}
1143 1241
1144static int __init at91_pm_modes_select(char *str)1242static 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
1014 mov tmp1, #01014 mov tmp1, #0
1015 mcr p15, 0, tmp1, c7, c10, 41015 mcr p15, 0, tmp1, c7, c10, 4
1016 1016
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 */
1017 ldr tmp1, [r0, #PM_DATA_PMC]1034 ldr tmp1, [r0, #PM_DATA_PMC]
1018 str tmp1, .pmc_base1035 str tmp1, .pmc_base
1036 cmp tmp1, #0
1037 ldrne tmp2, [tmp1, #0]
1038
1019 ldr tmp1, [r0, #PM_DATA_RAMC0]1039 ldr tmp1, [r0, #PM_DATA_RAMC0]
1020 str tmp1, .sramc_base1040 str tmp1, .sramc_base
1041 cmp tmp1, #0
1042 ldrne tmp2, [tmp1, #0]
1043
1021 ldr tmp1, [r0, #PM_DATA_RAMC1]1044 ldr tmp1, [r0, #PM_DATA_RAMC1]
1022 str tmp1, .sramc1_base1045 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 */
1023 ldr tmp1, [r0, #PM_DATA_RAMC_PHY]1051 ldr tmp1, [r0, #PM_DATA_RAMC_PHY]
1024 str tmp1, .sramc_phy_base1052 str tmp1, .sramc_phy_base
1025 ldr tmp1, [r0, #PM_DATA_MEMCTRL]1053 cmp tmp1, #0
1026 str tmp1, .memtype1054 ldrne tmp2, [tmp1, #0]
1027 ldr tmp1, [r0, #PM_DATA_MODE]1055
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 */
1034 ldr tmp1, [r0, #PM_DATA_SHDWC]1056 ldr tmp1, [r0, #PM_DATA_SHDWC]
1035 str tmp1, .shdwc1057 str tmp1, .shdwc
1036 cmp tmp1, #01058 cmp tmp1, #0
1037 ldrne tmp2, [tmp1, #0]1059 ldrne tmp2, [tmp1, #0]
1060
1038 ldr tmp1, [r0, #PM_DATA_SFRBU]1061 ldr tmp1, [r0, #PM_DATA_SFRBU]
1039 str tmp1, .sfrbu1062 str tmp1, .sfrbu
1040 cmp tmp1, #01063 cmp tmp1, #0
1041 ldrne tmp2, [tmp1, #0x10]1064 ldrne tmp2, [tmp1, #0x10]
1065#endif
1042 1066
1043 /* Active the self-refresh mode */1067 /* Active the self-refresh mode */
1044 at91_sramc_self_refresh_ena1068 at91_sramc_self_refresh_ena
arch/arm/mach-dove/include/mach/uncompress.h+2−2
@@ -11,7 +11,7 @@ · 10 unmodified lines
11 11
12#define LSR_THRE 0x2012#define LSR_THRE 0x20
13 13
14static void putc(const char c)14static inline void putc(const char c)
15{15{
16 int i;16 int i;
17 17
@@ -24,7 +24,7 @@ static void putc(const char c) · 6 unmodified lines
24 *UART_THR = c;24 *UART_THR = c;
25}25}
26 26
27static void flush(void)27static inline void flush(void)
28{28{
29}29}
30 30
arch/arm/mach-imx/mach-imx6q.c+3−0
@@ -172,6 +172,9 @@ static void __init imx6q_init_machine(void) · 171 unmodified lines
172 imx_get_soc_revision());172 imx_get_soc_revision());
173 173
174 imx6q_enet_phy_init();174 imx6q_enet_phy_init();
175
176 of_platform_default_populate(NULL, NULL, NULL);
177
175 imx_anatop_init();178 imx_anatop_init();
176 cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init();179 cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init();
177 imx6q_1588_init();180 imx6q_1588_init();
arch/arm/mach-imx/pm-imx6.c+2−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
10#include <linux/io.h>10#include <linux/io.h>
11#include <linux/irq.h>11#include <linux/irq.h>
12#include <linux/genalloc.h>12#include <linux/genalloc.h>
13#include <linux/irqchip/arm-gic.h>
13#include <linux/mfd/syscon.h>14#include <linux/mfd/syscon.h>
14#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>15#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
15#include <linux/of.h>16#include <linux/of.h>
@@ -619,6 +620,7 @@ static void __init imx6_pm_common_init(const struct imx6_pm_socdata · 603 unmodified lines
619 620
620static void imx6_pm_stby_poweroff(void)621static void imx6_pm_stby_poweroff(void)
621{622{
623 gic_cpu_if_down(0);
622 imx6_set_lpm(STOP_POWER_OFF);624 imx6_set_lpm(STOP_POWER_OFF);
623 imx6q_suspend_finish(0);625 imx6q_suspend_finish(0);
624 626
arch/arm/mach-omap1/include/mach/memory.h+0−12
@@ -9,16 +9,4 @@ · 8 unmodified lines
9/* REVISIT: omap1 legacy drivers still rely on this */9/* REVISIT: omap1 legacy drivers still rely on this */
10#include <mach/soc.h>10#include <mach/soc.h>
11 11
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
24#endif12#endif
arch/arm/mach-omap1/usb.c+82−34
@@ -11,6 +11,7 @@ · 10 unmodified lines
11#include <linux/platform_device.h>11#include <linux/platform_device.h>
12#include <linux/dma-map-ops.h>12#include <linux/dma-map-ops.h>
13#include <linux/io.h>13#include <linux/io.h>
14#include <linux/delay.h>
14 15
15#include <asm/irq.h>16#include <asm/irq.h>
16 17
@@ -206,8 +207,6 @@ static inline void udc_device_init(struct omap_usb_config *pdata) · 189 unmodified lines
206 207
207#endif208#endif
208 209
209#if IS_ENABLED(CONFIG_USB_OHCI_HCD)
210
211/* The dmamask must be set for OHCI to work */210/* The dmamask must be set for OHCI to work */
212static u64 ohci_dmamask = ~(u32)0;211static u64 ohci_dmamask = ~(u32)0;
213 212
@@ -236,20 +235,15 @@ static struct platform_device ohci_device = { · 22 unmodified lines
236 235
237static inline void ohci_device_init(struct omap_usb_config *pdata)236static inline void ohci_device_init(struct omap_usb_config *pdata)
238{237{
238 if (!IS_ENABLED(CONFIG_USB_OHCI_HCD))
239 return;
240
239 if (cpu_is_omap7xx())241 if (cpu_is_omap7xx())
240 ohci_resources[1].start = INT_7XX_USB_HHC_1;242 ohci_resources[1].start = INT_7XX_USB_HHC_1;
241 pdata->ohci_device = &ohci_device;243 pdata->ohci_device = &ohci_device;
242 pdata->ocpi_enable = &ocpi_enable;244 pdata->ocpi_enable = &ocpi_enable;
243}245}
244 246
245#else
246
247static inline void ohci_device_init(struct omap_usb_config *pdata)
248{
249}
250
251#endif
252
253#if defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG)247#if defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG)
254 248
255static struct resource otg_resources[] = {249static struct resource otg_resources[] = {
@@ -534,33 +528,87 @@ bad: · 278 unmodified lines
534}528}
535 529
536#ifdef CONFIG_ARCH_OMAP15XX530#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
537 541
538/* ULPD_DPLL_CTRL */542/*
539#define DPLL_IOB (1 << 13)543 * Bus address is physical address, except for OMAP-1510 Local Bus.
540#define DPLL_PLL_ENABLE (1 << 4)544 * OMAP-1510 bus address is translated into a Local Bus address if the
541#define DPLL_LOCK (1 << 0)545 * OMAP bus type is lbus.
546 */
547#define OMAP1510_LB_OFFSET UL(0x30000000)
542 548
543/* ULPD_APLL_CTRL */549/*
544#define APLL_NDPLL_SWITCH (1 << 0)550 * OMAP-1510 specific Local Bus clock on/off
551 */
552static 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 }
545 560
546static int omap_1510_usb_ohci_notifier(struct notifier_block *nb,561 return 0;
547 unsigned long event, void *data)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 */
571static int omap_1510_local_bus_init(void)
548{572{
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 }
550 591
551 if (event != BUS_NOTIFY_ADD_DEVICE)592 /* Enable the walking table */
552 return NOTIFY_DONE;593 omap_writel(omap_readl(OMAP1510_LB_MMU_CTL) | (1 << 3), OMAP1510_LB_MMU_CTL);
594 udelay(200);
553 595
554 if (strncmp(dev_name(dev), "ohci", 4) == 0 &&596 return 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;
559}597}
560 598
561static struct notifier_block omap_1510_usb_ohci_nb = {599static void omap_1510_local_bus_reset(void)
562 .notifier_call = omap_1510_usb_ohci_notifier,600{
563};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)
564 612
565static void __init omap_1510_usb_init(struct omap_usb_config *config)613static void __init omap_1510_usb_init(struct omap_usb_config *config)
566{614{
@@ -616,19 +664,19 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config) · 49 unmodified lines
616 }664 }
617#endif665#endif
618 666
619#if IS_ENABLED(CONFIG_USB_OHCI_HCD)667 if (IS_ENABLED(CONFIG_USB_OHCI_HCD) && config->register_host) {
620 if (config->register_host) {
621 int status;668 int status;
622 669
623 bus_register_notifier(&platform_bus_type,
624 &omap_1510_usb_ohci_nb);
625 ohci_device.dev.platform_data = config;670 ohci_device.dev.platform_data = config;
671 dma_direct_set_offset(&ohci_device.dev, PHYS_OFFSET,
672 OMAP1510_LB_OFFSET, (u64)-1);
626 status = platform_device_register(&ohci_device);673 status = platform_device_register(&ohci_device);
627 if (status)674 if (status)
628 pr_debug("can't register OHCI device, %d\n", status);675 pr_debug("can't register OHCI device, %d\n", status);
629 /* hcd explicitly gates 48MHz */676 /* hcd explicitly gates 48MHz */
677
678 config->lb_reset = omap_1510_local_bus_reset;
630 }679 }
631#endif
632}680}
633 681
634#else682#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
3614 oh->flags |= HWMOD_SWSUP_SIDLE_ACT;3614 oh->flags |= HWMOD_SWSUP_SIDLE_ACT;
3615 if (data->cfg->quirks & SYSC_QUIRK_SWSUP_MSTANDBY)3615 if (data->cfg->quirks & SYSC_QUIRK_SWSUP_MSTANDBY)
3616 oh->flags |= HWMOD_SWSUP_MSTANDBY;3616 oh->flags |= HWMOD_SWSUP_MSTANDBY;
3617 if (data->cfg->quirks & SYSC_QUIRK_CLKDM_NOAUTO)
3618 oh->flags |= HWMOD_CLKDM_NOAUTO;
3617 3619
3618 error = omap_hwmod_check_module(dev, oh, data, sysc_fields,3620 error = omap_hwmod_check_module(dev, oh, data, sysc_fields,
3619 rev_offs, sysc_offs, syss_offs,3621 rev_offs, sysc_offs, syss_offs,
arch/arm/net/bpf_jit_32.c+19−0
@@ -36,6 +36,10 @@ · 35 unmodified lines
36 * +-----+36 * +-----+
37 * |RSVD | JIT scratchpad37 * |RSVD | JIT scratchpad
38 * current ARM_SP => +-----+ <= (BPF_FP - STACK_SIZE + SCRATCH_SIZE)38 * current ARM_SP => +-----+ <= (BPF_FP - STACK_SIZE + SCRATCH_SIZE)
39 * | ... | caller-saved registers
40 * +-----+
41 * | ... | arguments passed on stack
42 * ARM_SP during call => +-----|
39 * | |43 * | |
40 * | ... | Function call stack44 * | ... | Function call stack
41 * | |45 * | |
@@ -63,6 +67,12 @@ · 21 unmodified lines
63 *67 *
64 * When popping registers off the stack at the end of a BPF function, we68 * When popping registers off the stack at the end of a BPF function, we
65 * reference them via the current ARM_FP register.69 * 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.
66 */76 */
67#define CALLEE_MASK (1 << ARM_R4 | 1 << ARM_R5 | 1 << ARM_R6 | \77#define CALLEE_MASK (1 << ARM_R4 | 1 << ARM_R5 | 1 << ARM_R6 | \
68 1 << ARM_R7 | 1 << ARM_R8 | 1 << ARM_R9 | \78 1 << ARM_R7 | 1 << ARM_R8 | 1 << ARM_R9 | \
@@ -70,6 +80,8 @@ · 1 unmodified line
70#define CALLEE_PUSH_MASK (CALLEE_MASK | 1 << ARM_LR)80#define CALLEE_PUSH_MASK (CALLEE_MASK | 1 << ARM_LR)
71#define CALLEE_POP_MASK (CALLEE_MASK | 1 << ARM_PC)81#define CALLEE_POP_MASK (CALLEE_MASK | 1 << ARM_PC)
72 82
83#define CALLER_MASK (1 << ARM_R0 | 1 << ARM_R1 | 1 << ARM_R2 | 1 << ARM_R3)
84
73enum {85enum {
74 /* Stack layout - these are offsets from (top of stack - 4) */86 /* Stack layout - these are offsets from (top of stack - 4) */
75 BPF_R2_HI,87 BPF_R2_HI,
@@ -464,6 +476,7 @@ static inline int epilogue_offset(const struct jit_ctx *ctx) · 388 unmodified lines
464 476
465static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op)477static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op)
466{478{
479 const int exclude_mask = BIT(ARM_R0) | BIT(ARM_R1);
467 const s8 *tmp = bpf2a32[TMP_REG_1];480 const s8 *tmp = bpf2a32[TMP_REG_1];
468 481
469#if __LINUX_ARM_ARCH__ == 7482#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
495 emit(ARM_MOV_R(ARM_R0, rm), ctx);508 emit(ARM_MOV_R(ARM_R0, rm), ctx);
496 }509 }
497 510
511 /* Push caller-saved registers on stack */
512 emit(ARM_PUSH(CALLER_MASK & ~exclude_mask), ctx);
513
498 /* Call appropriate function */514 /* Call appropriate function */
499 emit_mov_i(ARM_IP, op == BPF_DIV ?515 emit_mov_i(ARM_IP, op == BPF_DIV ?
500 (u32)jit_udiv32 : (u32)jit_mod32, ctx);516 (u32)jit_udiv32 : (u32)jit_mod32, ctx);
501 emit_blx_r(ARM_IP, ctx);517 emit_blx_r(ARM_IP, ctx);
502 518
519 /* Restore caller-saved registers from stack */
520 emit(ARM_POP(CALLER_MASK & ~exclude_mask), ctx);
521
503 /* Save return value */522 /* Save return value */
504 if (rd != ARM_R0)523 if (rd != ARM_R0)
505 emit(ARM_MOV_R(rd, ARM_R0), ctx);524 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
115 115
116 bus@8000000 {116 bus@8000000 {
117 compatible = "arm,vexpress,v2m-p1", "simple-bus";117 compatible = "arm,vexpress,v2m-p1", "simple-bus";
118 arm,v2m-memory-map = "rs1";
119 #address-cells = <2>; /* SMB chipselect number and offset */118 #address-cells = <2>; /* SMB chipselect number and offset */
120 #size-cells = <1>;119 #size-cells = <1>;
121 120
arch/arm64/boot/dts/arm/fvp-base-revc.dts+0−23
@@ -192,32 +192,9 @@ · 191 unmodified lines
192 remote-endpoint = <&clcd_pads>;192 remote-endpoint = <&clcd_pads>;
193 };193 };
194 };194 };
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 };
207 };195 };
208 196
209 bus@8000000 {197 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
221 #interrupt-cells = <1>;198 #interrupt-cells = <1>;
222 interrupt-map-mask = <0 0 63>;199 interrupt-map-mask = <0 0 63>;
223 interrupt-map = <0 0 0 &gic 0 0 GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,200 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
27 reg = <0x0 0x2b1f0000 0x0 0x1000>;27 reg = <0x0 0x2b1f0000 0x0 0x1000>;
28 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>,28 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>,
29 <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;29 <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
30 interrupt-names = "mhu_lpri_rx",
31 "mhu_hpri_rx";
32 #mbox-cells = <1>;30 #mbox-cells = <1>;
33 clocks = <&soc_refclk100mhz>;31 clocks = <&soc_refclk100mhz>;
34 clock-names = "apb_pclk";32 clock-names = "apb_pclk";
@@ -804,16 +802,6 @@ · 769 unmodified lines
804 };802 };
805 803
806 bus@8000000 {804 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
817 #interrupt-cells = <1>;805 #interrupt-cells = <1>;
818 interrupt-map-mask = <0 0 15>;806 interrupt-map-mask = <0 0 15>;
819 interrupt-map = <0 0 0 &gic 0 GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,807 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
92 };92 };
93 93
94 bus@8000000 {94 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 {
96 compatible = "arm,vexpress,v2p-p1", "simple-bus";101 compatible = "arm,vexpress,v2p-p1", "simple-bus";
97 #address-cells = <2>; /* SMB chipselect number and offset */102 #address-cells = <2>; /* SMB chipselect number and offset */
98 #size-cells = <1>;103 #size-cells = <1>;
99 #interrupt-cells = <1>;104 ranges = <0 0 0 0x08000000 0x04000000>,
100 ranges;105 <1 0 0 0x14000000 0x04000000>,
101 model = "V2M-Juno";106 <2 0 0 0x18000000 0x04000000>,
107 <3 0 0 0x1c000000 0x04000000>,
108 <4 0 0 0x0c000000 0x04000000>,
109 <5 0 0 0x10000000 0x04000000>;
102 arm,hbi = <0x252>;110 arm,hbi = <0x252>;
103 arm,vexpress,site = <0>;111 arm,vexpress,site = <0>;
104 arm,v2m-memory-map = "rs1";
105 112
106 flash@0 {113 flash@0 {
107 /* 2 * 32MiB NOR Flash memory mounted on CS0 */114 /* 2 * 32MiB NOR Flash memory mounted on CS0 */
@@ -218,7 +225,7 @@ · 110 unmodified lines
218 };225 };
219 };226 };
220 227
221 mmci@50000 {228 mmc@50000 {
222 compatible = "arm,pl180", "arm,primecell";229 compatible = "arm,pl180", "arm,primecell";
223 reg = <0x050000 0x1000>;230 reg = <0x050000 0x1000>;
224 interrupts = <5>;231 interrupts = <5>;
@@ -246,7 +253,7 @@ · 21 unmodified lines
246 clock-names = "KMIREFCLK", "apb_pclk";253 clock-names = "KMIREFCLK", "apb_pclk";
247 };254 };
248 255
249 wdt@f0000 {256 watchdog@f0000 {
250 compatible = "arm,sp805", "arm,primecell";257 compatible = "arm,sp805", "arm,primecell";
251 reg = <0x0f0000 0x10000>;258 reg = <0x0f0000 0x10000>;
252 interrupts = <7>;259 interrupts = <7>;
arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts+0−11
@@ -133,17 +133,6 @@ · 132 unmodified lines
133 };133 };
134 134
135 bus@8000000 {135 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
147 #interrupt-cells = <1>;136 #interrupt-cells = <1>;
148 interrupt-map-mask = <0 0 63>;137 interrupt-map-mask = <0 0 63>;
149 interrupt-map = <0 0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,138 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
6 */6 */
7/ {7/ {
8 bus@8000000 {8 bus@8000000 {
9 motherboard-bus {9 motherboard-bus@8000000 {
10 arm,v2m-memory-map = "rs2";10 arm,v2m-memory-map = "rs2";
11 11
12 iofpga-bus@300000000 {12 iofpga-bus@300000000 {
arch/arm64/boot/dts/arm/rtsm_ve-motherboard.dtsi+14−6
@@ -77,13 +77,21 @@ · 76 unmodified lines
77 };77 };
78 78
79 bus@8000000 {79 bus@8000000 {
80 motherboard-bus {80 compatible = "simple-bus";
81 arm,v2m-memory-map = "rs1";81 #address-cells = <2>;
82 #size-cells = <1>;
83 ranges = <0 0x8000000 0 0x8000000 0x18000000>;
84
85 motherboard-bus@8000000 {
82 compatible = "arm,vexpress,v2m-p1", "simple-bus";86 compatible = "arm,vexpress,v2m-p1", "simple-bus";
83 #address-cells = <2>; /* SMB chipselect number and offset */87 #address-cells = <2>; /* SMB chipselect number and offset */
84 #size-cells = <1>;88 #size-cells = <1>;
85 #interrupt-cells = <1>;89 ranges = <0 0 0 0x08000000 0x04000000>,
86 ranges;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>;
87 95
88 flash@0 {96 flash@0 {
89 compatible = "arm,vexpress-flash", "cfi-flash";97 compatible = "arm,vexpress-flash", "cfi-flash";
@@ -130,7 +138,7 @@ · 40 unmodified lines
130 clock-names = "apb_pclk";138 clock-names = "apb_pclk";
131 };139 };
132 140
133 mmci@50000 {141 mmc@50000 {
134 compatible = "arm,pl180", "arm,primecell";142 compatible = "arm,pl180", "arm,primecell";
135 reg = <0x050000 0x1000>;143 reg = <0x050000 0x1000>;
136 interrupts = <9>, <10>;144 interrupts = <9>, <10>;
@@ -190,7 +198,7 @@ · 53 unmodified lines
190 clock-names = "uartclk", "apb_pclk";198 clock-names = "uartclk", "apb_pclk";
191 };199 };
192 200
193 wdt@f0000 {201 watchdog@f0000 {
194 compatible = "arm,sp805", "arm,primecell";202 compatible = "arm,sp805", "arm,primecell";
195 reg = <0x0f0000 0x1000>;203 reg = <0x0f0000 0x1000>;
196 interrupts = <0>;204 interrupts = <0>;
arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts+1−56
@@ -145,61 +145,6 @@ · 144 unmodified lines
145 };145 };
146 146
147 smb: bus@8000000 {147 smb: bus@8000000 {
148 compatible = "simple-bus";148 ranges = <0x8000000 0 0x8000000 0x18000000>;
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>;
204 };149 };
205};150};
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi+2−2
@@ -405,9 +405,9 @@ · 404 unmodified lines
405 interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;405 interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
406 clock-frequency = <0>; /* fixed up by bootloader */406 clock-frequency = <0>; /* fixed up by bootloader */
407 clocks = <&clockgen QORIQ_CLK_HWACCEL 1>;407 clocks = <&clockgen QORIQ_CLK_HWACCEL 1>;
408 voltage-ranges = <1800 1800 3300 3300>;408 voltage-ranges = <1800 1800>;
409 sdhci,auto-cmd12;409 sdhci,auto-cmd12;
410 broken-cd;410 non-removable;
411 little-endian;411 little-endian;
412 bus-width = <4>;412 bus-width = <4>;
413 status = "disabled";413 status = "disabled";
arch/arm64/boot/dts/freescale/imx8mm-beacon-som.dtsi+1−1
@@ -91,7 +91,7 @@ · 90 unmodified lines
91 #size-cells = <1>;91 #size-cells = <1>;
92 compatible = "jedec,spi-nor";92 compatible = "jedec,spi-nor";
93 spi-max-frequency = <80000000>;93 spi-max-frequency = <80000000>;
94 spi-tx-bus-width = <4>;94 spi-tx-bus-width = <1>;
95 spi-rx-bus-width = <4>;95 spi-rx-bus-width = <4>;
96 };96 };
97};97};
arch/arm64/boot/dts/freescale/imx8mm-evk.dts+1−1
@@ -48,7 +48,7 @@ · 47 unmodified lines
48 #size-cells = <1>;48 #size-cells = <1>;
49 compatible = "jedec,spi-nor";49 compatible = "jedec,spi-nor";
50 spi-max-frequency = <80000000>;50 spi-max-frequency = <80000000>;
51 spi-tx-bus-width = <4>;51 spi-tx-bus-width = <1>;
52 spi-rx-bus-width = <4>;52 spi-rx-bus-width = <4>;
53 };53 };
54};54};
arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi+1−0
@@ -102,6 +102,7 @@ · 101 unmodified lines
102 regulator-min-microvolt = <850000>;102 regulator-min-microvolt = <850000>;
103 regulator-max-microvolt = <950000>;103 regulator-max-microvolt = <950000>;
104 regulator-boot-on;104 regulator-boot-on;
105 regulator-always-on;
105 regulator-ramp-delay = <3125>;106 regulator-ramp-delay = <3125>;
106 nxp,dvs-run-voltage = <950000>;107 nxp,dvs-run-voltage = <950000>;
107 nxp,dvs-standby-voltage = <850000>;108 nxp,dvs-standby-voltage = <850000>;
arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dts+1−1
@@ -647,7 +647,7 @@ · 646 unmodified lines
647 pinctrl_hog: hoggrp {647 pinctrl_hog: hoggrp {
648 fsl,pins = <648 fsl,pins = <
649 MX8MM_IOMUXC_NAND_CE0_B_GPIO3_IO1 0x40000159 /* M2_GDIS# */649 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# */
651 MX8MM_IOMUXC_NAND_DATA01_GPIO3_IO7 0x40000119 /* M2_OFF# */651 MX8MM_IOMUXC_NAND_DATA01_GPIO3_IO7 0x40000119 /* M2_OFF# */
652 MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x40000159 /* M2_WDIS# */652 MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x40000159 /* M2_WDIS# */
653 MX8MM_IOMUXC_SAI1_TXD2_GPIO4_IO14 0x40000041 /* AMP GPIO1 */653 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
101 #size-cells = <1>;101 #size-cells = <1>;
102 compatible = "jedec,spi-nor";102 compatible = "jedec,spi-nor";
103 spi-max-frequency = <80000000>;103 spi-max-frequency = <80000000>;
104 spi-tx-bus-width = <4>;104 spi-tx-bus-width = <1>;
105 spi-rx-bus-width = <4>;105 spi-rx-bus-width = <4>;
106 };106 };
107};107};
arch/arm64/boot/dts/freescale/imx8mn-venice-gw7902.dts+1−1
@@ -633,7 +633,7 @@ · 632 unmodified lines
633 pinctrl_hog: hoggrp {633 pinctrl_hog: hoggrp {
634 fsl,pins = <634 fsl,pins = <
635 MX8MN_IOMUXC_NAND_CE0_B_GPIO3_IO1 0x40000159 /* M2_GDIS# */635 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# */
637 MX8MN_IOMUXC_NAND_DATA01_GPIO3_IO7 0x40000119 /* M2_OFF# */637 MX8MN_IOMUXC_NAND_DATA01_GPIO3_IO7 0x40000119 /* M2_OFF# */
638 MX8MN_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x40000159 /* M2_WDIS# */638 MX8MN_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x40000159 /* M2_WDIS# */
639 MX8MN_IOMUXC_SAI2_RXFS_GPIO4_IO21 0x40000041 /* APP GPIO1 */639 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
74 compatible = "jedec,spi-nor";74 compatible = "jedec,spi-nor";
75 reg = <0>;75 reg = <0>;
76 spi-max-frequency = <80000000>;76 spi-max-frequency = <80000000>;
77 spi-tx-bus-width = <4>;77 spi-tx-bus-width = <1>;
78 spi-rx-bus-width = <4>;78 spi-rx-bus-width = <4>;
79 };79 };
80};80};
arch/arm64/boot/dts/freescale/imx8mq-evk.dts+2−0
@@ -337,6 +337,8 @@ · 336 unmodified lines
337 #size-cells = <1>;337 #size-cells = <1>;
338 compatible = "micron,n25q256a", "jedec,spi-nor";338 compatible = "micron,n25q256a", "jedec,spi-nor";
339 spi-max-frequency = <29000000>;339 spi-max-frequency = <29000000>;
340 spi-tx-bus-width = <1>;
341 spi-rx-bus-width = <4>;
340 };342 };
341};343};
342 344
arch/arm64/boot/dts/freescale/imx8mq-kontron-pitx-imx8m.dts+1−1
@@ -281,7 +281,7 @@ · 280 unmodified lines
281 #address-cells = <1>;281 #address-cells = <1>;
282 #size-cells = <1>;282 #size-cells = <1>;
283 reg = <0>;283 reg = <0>;
284 spi-tx-bus-width = <4>;284 spi-tx-bus-width = <1>;
285 spi-rx-bus-width = <4>;285 spi-rx-bus-width = <4>;
286 m25p,fast-read;286 m25p,fast-read;
287 spi-max-frequency = <50000000>;287 spi-max-frequency = <50000000>;
arch/arm64/boot/dts/qcom/pm8150.dtsi+3−1
@@ -48,8 +48,10 @@ · 47 unmodified lines
48 #size-cells = <0>;48 #size-cells = <0>;
49 49
50 pon: power-on@800 {50 pon: power-on@800 {
51 compatible = "qcom,pm8916-pon";51 compatible = "qcom,pm8998-pon";
52 reg = <0x0800>;52 reg = <0x0800>;
53 mode-bootloader = <0x2>;
54 mode-recovery = <0x1>;
53 55
54 pon_pwrkey: pwrkey {56 pon_pwrkey: pwrkey {
55 compatible = "qcom,pm8941-pwrkey";57 compatible = "qcom,pm8941-pwrkey";
arch/arm64/boot/dts/qcom/qrb5165-rb5.dts+10−0
@@ -804,6 +804,16 @@ · 803 unmodified lines
804 };804 };
805};805};
806 806
807&pon_pwrkey {
808 status = "okay";
809};
810
811&pon_resin {
812 status = "okay";
813
814 linux,code = <KEY_VOLUMEDOWN>;
815};
816
807&qupv3_id_0 {817&qupv3_id_0 {
808 status = "okay";818 status = "okay";
809};819};
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi+4−5
@@ -273,7 +273,6 @@ · 272 unmodified lines
273 "Headphone Jack", "HPOL",273 "Headphone Jack", "HPOL",
274 "Headphone Jack", "HPOR";274 "Headphone Jack", "HPOR";
275 275
276 #sound-dai-cells = <0>;
277 #address-cells = <1>;276 #address-cells = <1>;
278 #size-cells = <0>;277 #size-cells = <0>;
279 278
@@ -301,11 +300,11 @@ · 21 unmodified lines
301 };300 };
302 };301 };
303 302
304 dai-link@2 {303 dai-link@5 {
305 link-name = "MultiMedia2";304 link-name = "MultiMedia2";
306 reg = <2>;305 reg = <LPASS_DP_RX>;
307 cpu {306 cpu {
308 sound-dai = <&lpass_cpu 2>;307 sound-dai = <&lpass_cpu LPASS_DP_RX>;
309 };308 };
310 309
311 codec {310 codec {
@@ -782,7 +781,7 @@ hp_i2c: &i2c9 { · 470 unmodified lines
782 qcom,playback-sd-lines = <0>;781 qcom,playback-sd-lines = <0>;
783 };782 };
784 783
785 hdmi-primary@0 {784 hdmi@5 {
786 reg = <LPASS_DP_RX>;785 reg = <LPASS_DP_RX>;
787 };786 };
788};787};
arch/arm64/boot/dts/qcom/sc7280.dtsi+3−3
@@ -1850,9 +1850,9 @@ · 1849 unmodified lines
1850 1850
1851 cpufreq_hw: cpufreq@18591000 {1851 cpufreq_hw: cpufreq@18591000 {
1852 compatible = "qcom,cpufreq-epss";1852 compatible = "qcom,cpufreq-epss";
1853 reg = <0 0x18591100 0 0x900>,1853 reg = <0 0x18591000 0 0x1000>,
1854 <0 0x18592100 0 0x900>,1854 <0 0x18592000 0 0x1000>,
1855 <0 0x18593100 0 0x900>;1855 <0 0x18593000 0 0x1000>;
1856 clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GCC_GPLL0>;1856 clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GCC_GPLL0>;
1857 clock-names = "xo", "alternate";1857 clock-names = "xo", "alternate";
1858 #freq-domain-cells = <1>;1858 #freq-domain-cells = <1>;
arch/arm64/boot/dts/qcom/sdm630.dtsi+13−2
@@ -654,9 +654,20 @@ · 653 unmodified lines
654 compatible = "qcom,sdm660-a2noc";654 compatible = "qcom,sdm660-a2noc";
655 reg = <0x01704000 0xc100>;655 reg = <0x01704000 0xc100>;
656 #interconnect-cells = <1>;656 #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";
658 clocks = <&rpmcc RPM_SMD_AGGR2_NOC_CLK>,664 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>;
660 };671 };
661 672
662 mnoc: interconnect@1745000 {673 mnoc: interconnect@1745000 {
arch/arm64/boot/dts/qcom/sdm845.dtsi+13−8
@@ -128,23 +128,28 @@ · 127 unmodified lines
128 no-map;128 no-map;
129 };129 };
130 130
131 wlan_msa_mem: memory@8c400000 {131 ipa_fw_mem: memory@8c400000 {
132 reg = <0 0x8c400000 0 0x100000>;132 reg = <0 0x8c400000 0 0x10000>;
133 no-map;133 no-map;
134 };134 };
135 135
136 gpu_mem: memory@8c515000 {136 ipa_gsi_mem: memory@8c410000 {
137 reg = <0 0x8c515000 0 0x2000>;137 reg = <0 0x8c410000 0 0x5000>;
138 no-map;138 no-map;
139 };139 };
140 140
141 ipa_fw_mem: memory@8c517000 {141 gpu_mem: memory@8c415000 {
142 reg = <0 0x8c517000 0 0x5a000>;142 reg = <0 0x8c415000 0 0x2000>;
143 no-map;143 no-map;
144 };144 };
145 145
146 adsp_mem: memory@8c600000 {146 adsp_mem: memory@8c500000 {
147 reg = <0 0x8c600000 0 0x1a00000>;147 reg = <0 0x8c500000 0 0x1a00000>;
148 no-map;
149 };
150
151 wlan_msa_mem: memory@8df00000 {
152 reg = <0 0x8df00000 0 0x100000>;
148 no-map;153 no-map;
149 };154 };
150 155
arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts+34−0
@@ -16,6 +16,17 @@ · 15 unmodified lines
16#include "sdm850.dtsi"16#include "sdm850.dtsi"
17#include "pm8998.dtsi"17#include "pm8998.dtsi"
18 18
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
19/ {30/ {
20 model = "Lenovo Yoga C630";31 model = "Lenovo Yoga C630";
21 compatible = "lenovo,yoga-c630", "qcom,sdm845";32 compatible = "lenovo,yoga-c630", "qcom,sdm845";
@@ -58,6 +69,29 @@ · 36 unmodified lines
58 };69 };
59 };70 };
60 71
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
61 sn65dsi86_refclk: sn65dsi86-refclk {95 sn65dsi86_refclk: sn65dsi86-refclk {
62 compatible = "fixed-clock";96 compatible = "fixed-clock";
63 #clock-cells = <0>;97 #clock-cells = <0>;
arch/mips/include/asm/mips-cps.h+1−22
@@ -10,8 +10,6 @@ · 9 unmodified lines
10#include <linux/io.h>10#include <linux/io.h>
11#include <linux/types.h>11#include <linux/types.h>
12 12
13#include <asm/mips-boards/launch.h>
14
15extern unsigned long __cps_access_bad_size(void)13extern unsigned long __cps_access_bad_size(void)
16 __compiletime_error("Bad size for CPS accessor");14 __compiletime_error("Bad size for CPS accessor");
17 15
@@ -167,30 +165,11 @@ static inline uint64_t mips_cps_cluster_config(unsigned int cluster) · 149 unmodified lines
167 */165 */
168static inline unsigned int mips_cps_numcores(unsigned int cluster)166static inline unsigned int mips_cps_numcores(unsigned int cluster)
169{167{
170 unsigned int ncores;
171
172 if (!mips_cm_present())168 if (!mips_cm_present())
173 return 0;169 return 0;
174 170
175 /* Add one before masking to handle 0xff indicating no cores */171 /* Add one before masking to handle 0xff indicating no cores */
176 ncores = (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES;172 return (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;
194}173}
195 174
196/**175/**
arch/powerpc/boot/dts/fsl/t1023rdb.dts+1−1
@@ -154,7 +154,7 @@ · 153 unmodified lines
154 154
155 fm1mac3: ethernet@e4000 {155 fm1mac3: ethernet@e4000 {
156 phy-handle = <&sgmii_aqr_phy3>;156 phy-handle = <&sgmii_aqr_phy3>;
157 phy-connection-type = "sgmii-2500";157 phy-connection-type = "2500base-x";
158 sleep = <&rcpm 0x20000000>;158 sleep = <&rcpm 0x20000000>;
159 };159 };
160 160
arch/x86/events/core.c+1−0
@@ -2465,6 +2465,7 @@ static int x86_pmu_event_init(struct perf_event *event) · 2464 unmodified lines
2465 if (err) {2465 if (err) {
2466 if (event->destroy)2466 if (event->destroy)
2467 event->destroy(event);2467 event->destroy(event);
2468 event->destroy = NULL;
2468 }2469 }
2469 2470
2470 if (READ_ONCE(x86_pmu.attr_rdpmc) &&2471 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
263 INTEL_EVENT_CONSTRAINT_RANGE(0xa8, 0xb0, 0xf),263 INTEL_EVENT_CONSTRAINT_RANGE(0xa8, 0xb0, 0xf),
264 INTEL_EVENT_CONSTRAINT_RANGE(0xb7, 0xbd, 0xf),264 INTEL_EVENT_CONSTRAINT_RANGE(0xb7, 0xbd, 0xf),
265 INTEL_EVENT_CONSTRAINT_RANGE(0xd0, 0xe6, 0xf),265 INTEL_EVENT_CONSTRAINT_RANGE(0xd0, 0xe6, 0xf),
266 INTEL_EVENT_CONSTRAINT(0xef, 0xf),
266 INTEL_EVENT_CONSTRAINT_RANGE(0xf0, 0xf4, 0xf),267 INTEL_EVENT_CONSTRAINT_RANGE(0xf0, 0xf4, 0xf),
267 EVENT_CONSTRAINT_END268 EVENT_CONSTRAINT_END
268};269};
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
122 ipi_arg->reserved = 0;122 ipi_arg->reserved = 0;
123 ipi_arg->vp_set.valid_bank_mask = 0;123 ipi_arg->vp_set.valid_bank_mask = 0;
124 124
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) {
126 ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K;130 ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K;
127 if (exclude_self)131 if (exclude_self)
128 nr_bank = cpumask_to_vpset_noself(&(ipi_arg->vp_set), mask);132 nr_bank = cpumask_to_vpset_noself(&(ipi_arg->vp_set), mask);
129 else133 else
130 nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask);134 nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask);
131 }135
132 if (nr_bank < 0)136 /*
133 goto ipi_mask_ex_done;137 * 'nr_bank <= 0' means some CPUs in cpumask can't be
134 if (!nr_bank)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 {
135 ipi_arg->vp_set.format = HV_GENERIC_SET_ALL;144 ipi_arg->vp_set.format = HV_GENERIC_SET_ALL;
145 }
136 146
137 status = hv_do_rep_hypercall(HVCALL_SEND_IPI_EX, 0, nr_bank,147 status = hv_do_rep_hypercall(HVCALL_SEND_IPI_EX, 0, nr_bank,
138 ipi_arg, NULL);148 ipi_arg, NULL);
arch/x86/include/asm/kvmclock.h+14−0
@@ -2,6 +2,20 @@ · 1 unmodified line
2#ifndef _ASM_X86_KVM_CLOCK_H2#ifndef _ASM_X86_KVM_CLOCK_H
3#define _ASM_X86_KVM_CLOCK_H3#define _ASM_X86_KVM_CLOCK_H
4 4
5#include <linux/percpu.h>
6
5extern struct clocksource kvm_clock;7extern struct clocksource kvm_clock;
6 8
9DECLARE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu);
10
11static inline struct pvclock_vcpu_time_info *this_cpu_pvti(void)
12{
13 return &this_cpu_read(hv_clock_per_cpu)->pvti;
14}
15
16static inline struct pvclock_vsyscall_time_info *this_cpu_hvclock(void)
17{
18 return this_cpu_read(hv_clock_per_cpu);
19}
20
7#endif /* _ASM_X86_KVM_CLOCK_H */21#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
49static struct pvclock_vsyscall_time_info49static struct pvclock_vsyscall_time_info
50 hv_clock_boot[HVC_BOOT_ARRAY_SIZE] __bss_decrypted __aligned(PAGE_SIZE);50 hv_clock_boot[HVC_BOOT_ARRAY_SIZE] __bss_decrypted __aligned(PAGE_SIZE);
51static struct pvclock_wall_clock wall_clock __bss_decrypted;51static struct pvclock_wall_clock wall_clock __bss_decrypted;
52static DEFINE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu);
53static struct pvclock_vsyscall_time_info *hvclock_mem;52static struct pvclock_vsyscall_time_info *hvclock_mem;
54 53DEFINE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu);
55static inline struct pvclock_vcpu_time_info *this_cpu_pvti(void)54EXPORT_PER_CPU_SYMBOL_GPL(hv_clock_per_cpu);
56{
57 return &this_cpu_read(hv_clock_per_cpu)->pvti;
58}
59
60static inline struct pvclock_vsyscall_time_info *this_cpu_hvclock(void)
61{
62 return this_cpu_read(hv_clock_per_cpu);
63}
64 55
65/*56/*
66 * The wallclock is the time of day when we booted. Since then, some time may57 * 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
65 for (i = 0; i < nent; i++) {65 for (i = 0; i < nent; i++) {
66 e = &entries[i];66 e = &entries[i];
67 67
68 if (e->function == function && (e->index == index ||68 if (e->function == function &&
69 !(e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX)))69 (!(e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX) || e->index == index))
70 return e;70 return e;
71 }71 }
72 72
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
435 __FOP_RET(#op)435 __FOP_RET(#op)
436 436
437asm(".pushsection .fixup, \"ax\"\n"437asm(".pushsection .fixup, \"ax\"\n"
438 ".global kvm_fastop_exception \n"
439 "kvm_fastop_exception: xor %esi, %esi; ret\n"438 "kvm_fastop_exception: xor %esi, %esi; ret\n"
440 ".popsection");439 ".popsection");
441 440
arch/x86/kvm/vmx/vmx.c+1−1
@@ -6848,7 +6848,7 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu) · 6847 unmodified lines
6848 */6848 */
6849 tsx_ctrl = vmx_find_uret_msr(vmx, MSR_IA32_TSX_CTRL);6849 tsx_ctrl = vmx_find_uret_msr(vmx, MSR_IA32_TSX_CTRL);
6850 if (tsx_ctrl)6850 if (tsx_ctrl)
6851 vmx->guest_uret_msrs[i].mask = ~(u64)TSX_CTRL_CPUID_CLEAR;6851 tsx_ctrl->mask = ~(u64)TSX_CTRL_CPUID_CLEAR;
6852 }6852 }
6853 6853
6854 err = alloc_loaded_vmcs(&vmx->vmcs01);6854 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
2662 * are likely to increase the throughput.2662 * are likely to increase the throughput.
2663 */2663 */
2664 bfqq->new_bfqq = new_bfqq;2664 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 */
2674 new_bfqq->ref += process_refs;2665 new_bfqq->ref += process_refs;
2675 return new_bfqq;2666 return new_bfqq;
2676}2667}
@@ -2733,10 +2724,6 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, · 56 unmodified lines
2733{2724{
2734 struct bfq_queue *in_service_bfqq, *new_bfqq;2725 struct bfq_queue *in_service_bfqq, *new_bfqq;
2735 2726
2736 /* if a merge has already been setup, then proceed with that first */
2737 if (bfqq->new_bfqq)
2738 return bfqq->new_bfqq;
2739
2740 /*2727 /*
2741 * Check delayed stable merge for rotational or non-queueing2728 * Check delayed stable merge for rotational or non-queueing
2742 * devs. For this branch to be executed, bfqq must not be2729 * 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
2838 if (bfq_too_late_for_merging(bfqq))2825 if (bfq_too_late_for_merging(bfqq))
2839 return NULL;2826 return NULL;
2840 2827
2828 if (bfqq->new_bfqq)
2829 return bfqq->new_bfqq;
2830
2841 if (!io_struct || unlikely(bfqq == &bfqd->oom_bfqq))2831 if (!io_struct || unlikely(bfqq == &bfqd->oom_bfqq))
2842 return NULL;2832 return NULL;
2843 2833
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
3007 ndr_desc->target_node = NUMA_NO_NODE;3007 ndr_desc->target_node = NUMA_NO_NODE;
3008 }3008 }
3009 3009
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
3010 /*3022 /*
3011 * Persistence domain bits are hierarchical, if3023 * Persistence domain bits are hierarchical, if
3012 * ACPI_NFIT_CAPABILITY_CACHE_FLUSH is set then3024 * 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
95 95
96 list_add(&link->s_hook, &sup->consumers);96 list_add(&link->s_hook, &sup->consumers);
97 list_add(&link->c_hook, &con->suppliers);97 list_add(&link->c_hook, &con->suppliers);
98 pr_debug("%pfwP Linked as a fwnode consumer to %pfwP\n",
99 con, sup);
98out:100out:
99 mutex_unlock(&fwnode_link_lock);101 mutex_unlock(&fwnode_link_lock);
100 102
101 return ret;103 return ret;
102}104}
103 105
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 */
112static 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
104/**121/**
105 * fwnode_links_purge_suppliers - Delete all supplier links of fwnode_handle.122 * fwnode_links_purge_suppliers - Delete all supplier links of fwnode_handle.
106 * @fwnode: fwnode whose supplier links need to be deleted123 * @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
112 struct fwnode_link *link, *tmp;129 struct fwnode_link *link, *tmp;
113 130
114 mutex_lock(&fwnode_link_lock);131 mutex_lock(&fwnode_link_lock);
115 list_for_each_entry_safe(link, tmp, &fwnode->suppliers, c_hook) {132 list_for_each_entry_safe(link, tmp, &fwnode->suppliers, c_hook)
116 list_del(&link->s_hook);133 __fwnode_link_del(link);
117 list_del(&link->c_hook);
118 kfree(link);
119 }
120 mutex_unlock(&fwnode_link_lock);134 mutex_unlock(&fwnode_link_lock);
121}135}
122 136
@@ -131,11 +145,8 @@ static void fwnode_links_purge_consumers(struct fwnode_handle *fwnode) · 8 unmodified lines
131 struct fwnode_link *link, *tmp;145 struct fwnode_link *link, *tmp;
132 146
133 mutex_lock(&fwnode_link_lock);147 mutex_lock(&fwnode_link_lock);
134 list_for_each_entry_safe(link, tmp, &fwnode->consumers, s_hook) {148 list_for_each_entry_safe(link, tmp, &fwnode->consumers, s_hook)
135 list_del(&link->s_hook);149 __fwnode_link_del(link);
136 list_del(&link->c_hook);
137 kfree(link);
138 }
139 mutex_unlock(&fwnode_link_lock);150 mutex_unlock(&fwnode_link_lock);
140}151}
141 152
@@ -975,6 +986,7 @@ int device_links_check_suppliers(struct device *dev) · 833 unmodified lines
975{986{
976 struct device_link *link;987 struct device_link *link;
977 int ret = 0;988 int ret = 0;
989 struct fwnode_handle *sup_fw;
978 990
979 /*991 /*
980 * Device waiting for supplier to become available is not allowed to992 * 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
983 mutex_lock(&fwnode_link_lock);995 mutex_lock(&fwnode_link_lock);
984 if (dev->fwnode && !list_empty(&dev->fwnode->suppliers) &&996 if (dev->fwnode && !list_empty(&dev->fwnode->suppliers) &&
985 !fw_devlink_is_permissive()) {997 !fw_devlink_is_permissive()) {
986 dev_dbg(dev, "probe deferral - wait for supplier %pfwP\n",998 sup_fw = list_first_entry(&dev->fwnode->suppliers,
987 list_first_entry(&dev->fwnode->suppliers,999 struct fwnode_link,
988 struct fwnode_link,1000 c_hook)->supplier;
989 c_hook)->supplier);1001 dev_err_probe(dev, -EPROBE_DEFER, "wait for supplier %pfwP\n",
1002 sup_fw);
990 mutex_unlock(&fwnode_link_lock);1003 mutex_unlock(&fwnode_link_lock);
991 return -EPROBE_DEFER;1004 return -EPROBE_DEFER;
992 }1005 }
@@ -1001,8 +1014,9 @@ int device_links_check_suppliers(struct device *dev) · 8 unmodified lines
1001 if (link->status != DL_STATE_AVAILABLE &&1014 if (link->status != DL_STATE_AVAILABLE &&
1002 !(link->flags & DL_FLAG_SYNC_STATE_ONLY)) {1015 !(link->flags & DL_FLAG_SYNC_STATE_ONLY)) {
1003 device_links_missing_supplier(dev);1016 device_links_missing_supplier(dev);
1004 dev_dbg(dev, "probe deferral - supplier %s not ready\n",1017 dev_err_probe(dev, -EPROBE_DEFER,
1005 dev_name(link->supplier));1018 "supplier %s not ready\n",
1019 dev_name(link->supplier));
1006 ret = -EPROBE_DEFER;1020 ret = -EPROBE_DEFER;
1007 break;1021 break;
1008 }1022 }
@@ -1722,6 +1736,25 @@ static int fw_devlink_create_devlink(struct device *con, · 713 unmodified lines
1722 struct device *sup_dev;1736 struct device *sup_dev;
1723 int ret = 0;1737 int ret = 0;
1724 1738
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
1725 sup_dev = get_dev_from_fwnode(sup_handle);1758 sup_dev = get_dev_from_fwnode(sup_handle);
1726 if (sup_dev) {1759 if (sup_dev) {
1727 /*1760 /*
@@ -1772,14 +1805,21 @@ static int fw_devlink_create_devlink(struct device *con, · 44 unmodified lines
1772 * be broken by applying logic. Check for these types of cycles and1805 * be broken by applying logic. Check for these types of cycles and
1773 * break them so that devices in the cycle probe properly.1806 * break them so that devices in the cycle probe properly.
1774 *1807 *
1775 * If the supplier's parent is dependent on the consumer, then1808 * If the supplier's parent is dependent on the consumer, then the
1776 * the consumer-supplier dependency is a false dependency. So,1809 * consumer and supplier have a cyclic dependency. Since fw_devlink
1777 * treat it as an invalid link.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.
1778 */1815 */
1779 sup_dev = fwnode_get_next_parent_dev(sup_handle);1816 sup_dev = fwnode_get_next_parent_dev(sup_handle);
1780 if (sup_dev && device_is_dependent(con, sup_dev)) {1817 if (sup_dev && device_is_dependent(con, sup_dev)) {
1781 dev_dbg(con, "Not linking to %pfwP - False link\n",1818 dev_info(con, "Fixing up cyclic dependency with %pfwP (%s)\n",
1782 sup_handle);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();
1783 ret = -EINVAL;1823 ret = -EINVAL;
1784 } else {1824 } else {
1785 /*1825 /*
@@ -1858,9 +1898,7 @@ static void __fw_devlink_link_to_consumers(struct device *dev) · 72 unmodified lines
1858 if (!own_link || ret == -EAGAIN)1898 if (!own_link || ret == -EAGAIN)
1859 continue;1899 continue;
1860 1900
1861 list_del(&link->s_hook);1901 __fwnode_link_del(link);
1862 list_del(&link->c_hook);
1863 kfree(link);
1864 }1902 }
1865}1903}
1866 1904
@@ -1912,9 +1950,7 @@ static void __fw_devlink_link_to_suppliers(struct device *dev, · 45 unmodified lines
1912 if (!own_link || ret == -EAGAIN)1950 if (!own_link || ret == -EAGAIN)
1913 continue;1951 continue;
1914 1952
1915 list_del(&link->s_hook);1953 __fwnode_link_del(link);
1916 list_del(&link->c_hook);
1917 kfree(link);
1918 1954
1919 /* If no device link was created, nothing more to do. */1955 /* If no device link was created, nothing more to do. */
1920 if (ret)1956 if (ret)
drivers/block/nbd.c+17−12
@@ -97,13 +97,18 @@ struct nbd_config { · 96 unmodified lines
97 97
98 atomic_t recv_threads;98 atomic_t recv_threads;
99 wait_queue_head_t recv_wq;99 wait_queue_head_t recv_wq;
100 loff_t blksize;100 unsigned int blksize_bits;
101 loff_t bytesize;101 loff_t bytesize;
102#if IS_ENABLED(CONFIG_DEBUG_FS)102#if IS_ENABLED(CONFIG_DEBUG_FS)
103 struct dentry *dbg_dir;103 struct dentry *dbg_dir;
104#endif104#endif
105};105};
106 106
107static inline unsigned int nbd_blksize(struct nbd_config *config)
108{
109 return 1u << config->blksize_bits;
110}
111
107struct nbd_device {112struct nbd_device {
108 struct blk_mq_tag_set tag_set;113 struct blk_mq_tag_set tag_set;
109 114
@@ -146,7 +151,7 @@ static struct dentry *nbd_dbg_dir; · 36 unmodified lines
146 151
147#define NBD_MAGIC 0x68797548152#define NBD_MAGIC 0x68797548
148 153
149#define NBD_DEF_BLKSIZE 1024154#define NBD_DEF_BLKSIZE_BITS 10
150 155
151static unsigned int nbds_max = 16;156static unsigned int nbds_max = 16;
152static int max_part = 16;157static int max_part = 16;
@@ -317,12 +322,12 @@ static int nbd_set_size(struct nbd_device *nbd, loff_t bytesize, · 164 unmodified lines
317 loff_t blksize)322 loff_t blksize)
318{323{
319 if (!blksize)324 if (!blksize)
320 blksize = NBD_DEF_BLKSIZE;325 blksize = 1u << NBD_DEF_BLKSIZE_BITS;
321 if (blksize < 512 || blksize > PAGE_SIZE || !is_power_of_2(blksize))326 if (blksize < 512 || blksize > PAGE_SIZE || !is_power_of_2(blksize))
322 return -EINVAL;327 return -EINVAL;
323 328
324 nbd->config->bytesize = bytesize;329 nbd->config->bytesize = bytesize;
325 nbd->config->blksize = blksize;330 nbd->config->blksize_bits = __ffs(blksize);
326 331
327 if (!nbd->task_recv)332 if (!nbd->task_recv)
328 return 0;333 return 0;
@@ -1337,7 +1342,7 @@ static int nbd_start_device(struct nbd_device *nbd) · 1008 unmodified lines
1337 args->index = i;1342 args->index = i;
1338 queue_work(nbd->recv_workq, &args->work);1343 queue_work(nbd->recv_workq, &args->work);
1339 }1344 }
1340 return nbd_set_size(nbd, config->bytesize, config->blksize);1345 return nbd_set_size(nbd, config->bytesize, nbd_blksize(config));
1341}1346}
1342 1347
1343static int nbd_start_device_ioctl(struct nbd_device *nbd, struct block_device *bdev)1348static 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
1406 case NBD_SET_BLKSIZE:1411 case NBD_SET_BLKSIZE:
1407 return nbd_set_size(nbd, config->bytesize, arg);1412 return nbd_set_size(nbd, config->bytesize, arg);
1408 case NBD_SET_SIZE:1413 case NBD_SET_SIZE:
1409 return nbd_set_size(nbd, arg, config->blksize);1414 return nbd_set_size(nbd, arg, nbd_blksize(config));
1410 case NBD_SET_SIZE_BLOCKS:1415 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))
1412 return -EINVAL;1417 return -EINVAL;
1413 return nbd_set_size(nbd, bytesize, config->blksize);1418 return nbd_set_size(nbd, bytesize, nbd_blksize(config));
1414 case NBD_SET_TIMEOUT:1419 case NBD_SET_TIMEOUT:
1415 nbd_set_cmd_timeout(nbd, arg);1420 nbd_set_cmd_timeout(nbd, arg);
1416 return 0;1421 return 0;
@@ -1476,7 +1481,7 @@ static struct nbd_config *nbd_alloc_config(void) · 59 unmodified lines
1476 atomic_set(&config->recv_threads, 0);1481 atomic_set(&config->recv_threads, 0);
1477 init_waitqueue_head(&config->recv_wq);1482 init_waitqueue_head(&config->recv_wq);
1478 init_waitqueue_head(&config->conn_wait);1483 init_waitqueue_head(&config->conn_wait);
1479 config->blksize = NBD_DEF_BLKSIZE;1484 config->blksize_bits = NBD_DEF_BLKSIZE_BITS;
1480 atomic_set(&config->live_connections, 0);1485 atomic_set(&config->live_connections, 0);
1481 try_module_get(THIS_MODULE);1486 try_module_get(THIS_MODULE);
1482 return config;1487 return config;
@@ -1604,7 +1609,7 @@ static int nbd_dev_dbg_init(struct nbd_device *nbd) · 121 unmodified lines
1604 debugfs_create_file("tasks", 0444, dir, nbd, &nbd_dbg_tasks_fops);1609 debugfs_create_file("tasks", 0444, dir, nbd, &nbd_dbg_tasks_fops);
1605 debugfs_create_u64("size_bytes", 0444, dir, &config->bytesize);1610 debugfs_create_u64("size_bytes", 0444, dir, &config->bytesize);
1606 debugfs_create_u32("timeout", 0444, dir, &nbd->tag_set.timeout);1611 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);
1608 debugfs_create_file("flags", 0444, dir, nbd, &nbd_dbg_flags_fops);1613 debugfs_create_file("flags", 0444, dir, nbd, &nbd_dbg_flags_fops);
1609 1614
1610 return 0;1615 return 0;
@@ -1826,7 +1831,7 @@ nbd_device_policy[NBD_DEVICE_ATTR_MAX + 1] = { · 215 unmodified lines
1826static int nbd_genl_size_set(struct genl_info *info, struct nbd_device *nbd)1831static int nbd_genl_size_set(struct genl_info *info, struct nbd_device *nbd)
1827{1832{
1828 struct nbd_config *config = nbd->config;1833 struct nbd_config *config = nbd->config;
1829 u64 bsize = config->blksize;1834 u64 bsize = nbd_blksize(config);
1830 u64 bytes = config->bytesize;1835 u64 bytes = config->bytesize;
1831 1836
1832 if (info->attrs[NBD_ATTR_SIZE_BYTES])1837 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
1835 if (info->attrs[NBD_ATTR_BLOCK_SIZE_BYTES])1840 if (info->attrs[NBD_ATTR_BLOCK_SIZE_BYTES])
1836 bsize = nla_get_u64(info->attrs[NBD_ATTR_BLOCK_SIZE_BYTES]);1841 bsize = nla_get_u64(info->attrs[NBD_ATTR_BLOCK_SIZE_BYTES]);
1837 1842
1838 if (bytes != config->bytesize || bsize != config->blksize)1843 if (bytes != config->bytesize || bsize != nbd_blksize(config))
1839 return nbd_set_size(nbd, bytes, bsize);1844 return nbd_set_size(nbd, bytes, bsize);
1840 return 0;1845 return 0;
1841}1846}
drivers/bus/ti-sysc.c+4−0
@@ -1464,6 +1464,9 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { · 1463 unmodified lines
1464 /* Quirks that need to be set based on detected module */1464 /* Quirks that need to be set based on detected module */
1465 SYSC_QUIRK("aess", 0, 0, 0x10, -ENODEV, 0x40000000, 0xffffffff,1465 SYSC_QUIRK("aess", 0, 0, 0x10, -ENODEV, 0x40000000, 0xffffffff,
1466 SYSC_MODULE_QUIRK_AESS),1466 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),
1467 SYSC_QUIRK("dcan", 0x48480000, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff,1470 SYSC_QUIRK("dcan", 0x48480000, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff,
1468 SYSC_QUIRK_CLKDM_NOAUTO),1471 SYSC_QUIRK_CLKDM_NOAUTO),
1469 SYSC_QUIRK("dss", 0x4832a000, 0, 0x10, 0x14, 0x00000020, 0xffffffff,1472 SYSC_QUIRK("dss", 0x4832a000, 0, 0x10, 0x14, 0x00000020, 0xffffffff,
@@ -2954,6 +2957,7 @@ static int sysc_init_soc(struct sysc *ddata) · 1484 unmodified lines
2954 break;2957 break;
2955 case SOC_AM3:2958 case SOC_AM3:
2956 sysc_add_disabled(0x48310000); /* rng */2959 sysc_add_disabled(0x48310000); /* rng */
2960 break;
2957 default:2961 default:
2958 break;2962 break;
2959 }2963 }
drivers/firmware/Kconfig+1−1
@@ -204,7 +204,7 @@ config INTEL_STRATIX10_RSU · 203 unmodified lines
204 204
205config QCOM_SCM205config QCOM_SCM
206 tristate "Qcom SCM driver"206 tristate "Qcom SCM driver"
207 depends on ARM || ARM64207 depends on ARCH_QCOM || COMPILE_TEST
208 depends on HAVE_ARM_SMCCC208 depends on HAVE_ARM_SMCCC
209 select RESET_CONTROLLER209 select RESET_CONTROLLER
210 210
drivers/firmware/arm_scmi/Kconfig+1−1
@@ -68,7 +68,7 @@ config ARM_SCMI_TRANSPORT_SMC · 67 unmodified lines
68 68
69config ARM_SCMI_TRANSPORT_VIRTIO69config ARM_SCMI_TRANSPORT_VIRTIO
70 bool "SCMI transport based on VirtIO"70 bool "SCMI transport based on VirtIO"
71 depends on VIRTIO71 depends on VIRTIO=y || VIRTIO=ARM_SCMI_PROTOCOL
72 select ARM_SCMI_HAVE_TRANSPORT72 select ARM_SCMI_HAVE_TRANSPORT
73 select ARM_SCMI_HAVE_MSG73 select ARM_SCMI_HAVE_MSG
74 help74 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
110 if (vioch->is_rx) {110 if (vioch->is_rx) {
111 scmi_vio_feed_vq_rx(vioch, msg);111 scmi_vio_feed_vq_rx(vioch, msg);
112 } else {112 } else {
113 unsigned long flags;113 /* Here IRQs are assumed to be already disabled by the caller */
114 114 spin_lock(&vioch->lock);
115 spin_lock_irqsave(&vioch->lock, flags);
116 list_add(&msg->list, &vioch->free_list);115 list_add(&msg->list, &vioch->free_list);
117 spin_unlock_irqrestore(&vioch->lock, flags);116 spin_unlock(&vioch->lock);
118 }117 }
119}118}
120 119
121static void scmi_vio_complete_cb(struct virtqueue *vqueue)120static void scmi_vio_complete_cb(struct virtqueue *vqueue)
122{121{
123 unsigned long ready_flags;122 unsigned long ready_flags;
124 unsigned long flags;
125 unsigned int length;123 unsigned int length;
126 struct scmi_vio_channel *vioch;124 struct scmi_vio_channel *vioch;
127 struct scmi_vio_msg *msg;125 struct scmi_vio_msg *msg;
@@ -140,7 +138,8 @@ static void scmi_vio_complete_cb(struct virtqueue *vqueue) · 12 unmodified lines
140 goto unlock_ready_out;138 goto unlock_ready_out;
141 }139 }
142 140
143 spin_lock_irqsave(&vioch->lock, flags);141 /* IRQs already disabled here no need to irqsave */
142 spin_lock(&vioch->lock);
144 if (cb_enabled) {143 if (cb_enabled) {
145 virtqueue_disable_cb(vqueue);144 virtqueue_disable_cb(vqueue);
146 cb_enabled = false;145 cb_enabled = false;
@@ -151,7 +150,7 @@ static void scmi_vio_complete_cb(struct virtqueue *vqueue) · 4 unmodified lines
151 goto unlock_out;150 goto unlock_out;
152 cb_enabled = true;151 cb_enabled = true;
153 }152 }
154 spin_unlock_irqrestore(&vioch->lock, flags);153 spin_unlock(&vioch->lock);
155 154
156 if (msg) {155 if (msg) {
157 msg->rx_len = length;156 msg->rx_len = length;
@@ -161,11 +160,18 @@ static void scmi_vio_complete_cb(struct virtqueue *vqueue) · 3 unmodified lines
161 scmi_finalize_message(vioch, msg);160 scmi_finalize_message(vioch, msg);
162 }161 }
163 162
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 */
164 spin_unlock_irqrestore(&vioch->ready_lock, ready_flags);170 spin_unlock_irqrestore(&vioch->ready_lock, ready_flags);
165 }171 }
166 172
167unlock_out:173unlock_out:
168 spin_unlock_irqrestore(&vioch->lock, flags);174 spin_unlock(&vioch->lock);
169unlock_ready_out:175unlock_ready_out:
170 spin_unlock_irqrestore(&vioch->ready_lock, ready_flags);176 spin_unlock_irqrestore(&vioch->ready_lock, ready_flags);
171}177}
@@ -384,8 +390,11 @@ static int scmi_vio_probe(struct virtio_device *vdev) · 212 unmodified lines
384 struct virtqueue *vqs[VIRTIO_SCMI_VQ_MAX_CNT];390 struct virtqueue *vqs[VIRTIO_SCMI_VQ_MAX_CNT];
385 391
386 /* Only one SCMI VirtiO device allowed */392 /* Only one SCMI VirtiO device allowed */
387 if (scmi_vdev)393 if (scmi_vdev) {
388 return -EINVAL;394 dev_err(dev,
395 "One SCMI Virtio device was already initialized: only one allowed.\n");
396 return -EBUSY;
397 }
389 398
390 have_vq_rx = scmi_vio_have_vq_rx(vdev);399 have_vq_rx = scmi_vio_have_vq_rx(vdev);
391 vq_cnt = have_vq_rx ? VIRTIO_SCMI_VQ_MAX_CNT : 1;400 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
428 }437 }
429 438
430 vdev->priv = channels;439 vdev->priv = channels;
431 scmi_vdev = vdev;440 /* Ensure initialized scmi_vdev is visible */
441 smp_store_mb(scmi_vdev, vdev);
432 442
433 return 0;443 return 0;
434}444}
435 445
436static void scmi_vio_remove(struct virtio_device *vdev)446static void scmi_vio_remove(struct virtio_device *vdev)
437{447{
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 */
438 vdev->config->reset(vdev);455 vdev->config->reset(vdev);
439 vdev->config->del_vqs(vdev);456 vdev->config->del_vqs(vdev);
440 scmi_vdev = NULL;457 /* Ensure scmi_vdev is visible as NULL */
458 smp_store_mb(scmi_vdev, NULL);
441}459}
442 460
443static int scmi_vio_validate(struct virtio_device *vdev)461static int scmi_vio_validate(struct virtio_device *vdev)
@@ -476,7 +494,7 @@ static int __init virtio_scmi_init(void) · 32 unmodified lines
476 return register_virtio_driver(&virtio_scmi_driver);494 return register_virtio_driver(&virtio_scmi_driver);
477}495}
478 496
479static void __exit virtio_scmi_exit(void)497static void virtio_scmi_exit(void)
480{498{
481 unregister_virtio_driver(&virtio_scmi_driver);499 unregister_virtio_driver(&virtio_scmi_driver);
482}500}
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
837 return 0;837 return 0;
838}838}
839 839
840/* Mirrors the is_displayable check in radeonsi's gfx6_compute_surface */
841static 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
840static void get_block_dimensions(unsigned int block_log2, unsigned int cpp,862static void get_block_dimensions(unsigned int block_log2, unsigned int cpp,
841 unsigned int *width, unsigned int *height)863 unsigned int *width, unsigned int *height)
842{864{
@@ -1103,6 +1125,7 @@ int amdgpu_display_framebuffer_init(struct drm_device *dev, · 260 unmodified lines
1103 const struct drm_mode_fb_cmd2 *mode_cmd,1125 const struct drm_mode_fb_cmd2 *mode_cmd,
1104 struct drm_gem_object *obj)1126 struct drm_gem_object *obj)
1105{1127{
1128 struct amdgpu_device *adev = drm_to_adev(dev);
1106 int ret, i;1129 int ret, i;
1107 1130
1108 /*1131 /*
@@ -1122,6 +1145,14 @@ int amdgpu_display_framebuffer_init(struct drm_device *dev, · 13 unmodified lines
1122 if (ret)1145 if (ret)
1123 return ret;1146 return ret;
1124 1147
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
1125 if (dev->mode_config.allow_fb_modifiers &&1156 if (dev->mode_config.allow_fb_modifiers &&
1126 !(rfb->base.flags & DRM_MODE_FB_MODIFIERS)) {1157 !(rfb->base.flags & DRM_MODE_FB_MODIFIERS)) {
1127 ret = convert_tiling_flags_to_modifier(rfb);1158 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
3599 3599
3600 /* set static priority for a queue/ring */3600 /* set static priority for a queue/ring */
3601 gfx_v9_0_mqd_set_priority(ring, mqd);3601 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);
3603 3603
3604 /* map_queues packet doesn't need activate the queue,3604 /* map_queues packet doesn't need activate the queue,
3605 * so only kiq need set this field.3605 * 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
1098{1098{
1099 struct amdgpu_device *adev = (struct amdgpu_device *)handle;1099 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
1100 1100
1101 gmc_v10_0_gart_disable(adev);
1102
1101 if (amdgpu_sriov_vf(adev)) {1103 if (amdgpu_sriov_vf(adev)) {
1102 /* full access mode, so don't touch any GMC register */1104 /* full access mode, so don't touch any GMC register */
1103 DRM_DEBUG("For SRIOV client, shouldn't do anything.\n");1105 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
1106 1108
1107 amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);1109 amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);
1108 amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);1110 amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);
1109 gmc_v10_0_gart_disable(adev);
1110 1111
1111 return 0;1112 return 0;
1112}1113}
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
1794{1794{
1795 struct amdgpu_device *adev = (struct amdgpu_device *)handle;1795 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
1796 1796
1797 gmc_v9_0_gart_disable(adev);
1798
1797 if (amdgpu_sriov_vf(adev)) {1799 if (amdgpu_sriov_vf(adev)) {
1798 /* full access mode, so don't touch any GMC register */1800 /* full access mode, so don't touch any GMC register */
1799 DRM_DEBUG("For SRIOV client, shouldn't do anything.\n");1801 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
1802 1804
1803 amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);1805 amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);
1804 amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);1806 amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);
1805 gmc_v9_0_gart_disable(adev);
1806 1807
1807 return 0;1808 return 0;
1808}1809}
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
868 msleep(1000);868 msleep(1000);
869 }869 }
870 870
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
871 sdma_v5_2_soft_reset(adev);877 sdma_v5_2_soft_reset(adev);
872 /* unhalt the MEs */878 /* unhalt the MEs */
873 sdma_v5_2_enable(adev, true);879 sdma_v5_2_enable(adev, true);
@@ -876,6 +882,8 @@ static int sdma_v5_2_start(struct amdgpu_device *adev) · 2 unmodified lines
876 882
877 /* start the gfx rings and rlc compute queues */883 /* start the gfx rings and rlc compute queues */
878 r = sdma_v5_2_gfx_resume(adev);884 r = sdma_v5_2_gfx_resume(adev);
885 if (adev->in_s0ix)
886 amdgpu_gfx_off_ctrl(adev, true);
879 if (r)887 if (r)
880 return r;888 return r;
881 r = sdma_v5_2_rlc_resume(adev);889 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
1115 1115
1116 init_data.asic_id.pci_revision_id = adev->pdev->revision;1116 init_data.asic_id.pci_revision_id = adev->pdev->revision;
1117 init_data.asic_id.hw_internal_rev = adev->external_rev_id;1117 init_data.asic_id.hw_internal_rev = adev->external_rev_id;
1118 init_data.asic_id.chip_id = adev->pdev->device;
1118 1119
1119 init_data.asic_id.vram_width = adev->gmc.vram_width;1120 init_data.asic_id.vram_width = adev->gmc.vram_width;
1120 /* TODO: initialize init_data.asic_id.vram_type here!!!! */1121 /* TODO: initialize init_data.asic_id.vram_type here!!!! */
@@ -1719,6 +1720,7 @@ static int dm_late_init(void *handle) · 598 unmodified lines
1719 linear_lut[i] = 0xFFFF * i / 15;1720 linear_lut[i] = 0xFFFF * i / 15;
1720 1721
1721 params.set = 0;1722 params.set = 0;
1723 params.backlight_ramping_override = false;
1722 params.backlight_ramping_start = 0xCCCC;1724 params.backlight_ramping_start = 0xCCCC;
1723 params.backlight_ramping_reduction = 0xCCCCCCCC;1725 params.backlight_ramping_reduction = 0xCCCCCCCC;
1724 params.backlight_lut_array_size = 16;1726 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
1826 if (panel_mode == DP_PANEL_MODE_EDP) {1826 if (panel_mode == DP_PANEL_MODE_EDP) {
1827 struct cp_psp *cp_psp = &stream->ctx->cp_psp;1827 struct cp_psp *cp_psp = &stream->ctx->cp_psp;
1828 1828
1829 if (cp_psp && cp_psp->funcs.enable_assr) {1829 if (cp_psp && cp_psp->funcs.enable_assr)
1830 if (!cp_psp->funcs.enable_assr(cp_psp->handle, link)) {1830 /* ASSR is bound to fail with unsigned PSP
1831 /* since eDP implies ASSR on, change panel1831 * verstage used during devlopment phase.
1832 * mode to disable ASSR1832 * Report and continue with eDP panel mode to
1833 */1833 * perform eDP link training with right settings
1834 panel_mode = DP_PANEL_MODE_DEFAULT;1834 */
1835 }1835 cp_psp->funcs.enable_assr(cp_psp->handle, link);
1836 }
1837 }1836 }
1838#endif1837#endif
1839 1838
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
793{793{
794 struct device *dev = &pdev->dev;794 struct device *dev = &pdev->dev;
795 struct decon_context *ctx;795 struct decon_context *ctx;
796 struct resource *res;
797 int ret;796 int ret;
798 int i;797 int i;
799 798
@@ -818,8 +817,7 @@ static int exynos5433_decon_probe(struct platform_device *pdev) · 18 unmodified lines
818 ctx->clks[i] = clk;817 ctx->clks[i] = clk;
819 }818 }
820 819
821 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);820 ctx->addr = devm_platform_ioremap_resource(pdev, 0);
822 ctx->addr = devm_ioremap_resource(dev, res);
823 if (IS_ERR(ctx->addr))821 if (IS_ERR(ctx->addr))
824 return PTR_ERR(ctx->addr);822 return PTR_ERR(ctx->addr);
825 823
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
1738static int exynos_dsi_probe(struct platform_device *pdev)1738static int exynos_dsi_probe(struct platform_device *pdev)
1739{1739{
1740 struct device *dev = &pdev->dev;1740 struct device *dev = &pdev->dev;
1741 struct resource *res;
1742 struct exynos_dsi *dsi;1741 struct exynos_dsi *dsi;
1743 int ret, i;1742 int ret, i;
1744 1743
@@ -1789,8 +1788,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) · 44 unmodified lines
1789 }1788 }
1790 }1789 }
1791 1790
1792 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);1791 dsi->reg_base = devm_platform_ioremap_resource(pdev, 0);
1793 dsi->reg_base = devm_ioremap_resource(dev, res);
1794 if (IS_ERR(dsi->reg_base))1792 if (IS_ERR(dsi->reg_base))
1795 return PTR_ERR(dsi->reg_base);1793 return PTR_ERR(dsi->reg_base);
1796 1794
drivers/gpu/drm/exynos/exynos_drm_fimc.c+1−4
@@ -85,7 +85,6 @@ struct fimc_scaler { · 84 unmodified lines
85/*85/*
86 * A structure of fimc context.86 * A structure of fimc context.
87 *87 *
88 * @regs_res: register resources.
89 * @regs: memory mapped io registers.88 * @regs: memory mapped io registers.
90 * @lock: locking of operations.89 * @lock: locking of operations.
91 * @clocks: fimc clocks.90 * @clocks: fimc clocks.
@@ -103,7 +102,6 @@ struct fimc_context { · 11 unmodified lines
103 struct exynos_drm_ipp_formats *formats;102 struct exynos_drm_ipp_formats *formats;
104 unsigned int num_formats;103 unsigned int num_formats;
105 104
106 struct resource *regs_res;
107 void __iomem *regs;105 void __iomem *regs;
108 spinlock_t lock;106 spinlock_t lock;
109 struct clk *clocks[FIMC_CLKS_MAX];107 struct clk *clocks[FIMC_CLKS_MAX];
@@ -1327,8 +1325,7 @@ static int fimc_probe(struct platform_device *pdev) · 1217 unmodified lines
1327 ctx->num_formats = num_formats;1325 ctx->num_formats = num_formats;
1328 1326
1329 /* resource memory */1327 /* resource memory */
1330 ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);1328 ctx->regs = devm_platform_ioremap_resource(pdev, 0);
1331 ctx->regs = devm_ioremap_resource(dev, ctx->regs_res);
1332 if (IS_ERR(ctx->regs))1329 if (IS_ERR(ctx->regs))
1333 return PTR_ERR(ctx->regs);1330 return PTR_ERR(ctx->regs);
1334 1331
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
1202 return PTR_ERR(ctx->lcd_clk);1202 return PTR_ERR(ctx->lcd_clk);
1203 }1203 }
1204 1204
1205 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);1205 ctx->regs = devm_platform_ioremap_resource(pdev, 0);
1206
1207 ctx->regs = devm_ioremap_resource(dev, res);
1208 if (IS_ERR(ctx->regs))1206 if (IS_ERR(ctx->regs))
1209 return PTR_ERR(ctx->regs);1207 return PTR_ERR(ctx->regs);
1210 1208
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
1449static int g2d_probe(struct platform_device *pdev)1449static int g2d_probe(struct platform_device *pdev)
1450{1450{
1451 struct device *dev = &pdev->dev;1451 struct device *dev = &pdev->dev;
1452 struct resource *res;
1453 struct g2d_data *g2d;1452 struct g2d_data *g2d;
1454 int ret;1453 int ret;
1455 1454
@@ -1491,9 +1490,7 @@ static int g2d_probe(struct platform_device *pdev) · 35 unmodified lines
1491 clear_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags);1490 clear_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags);
1492 clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags);1491 clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags);
1493 1492
1494 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);1493 g2d->regs = devm_platform_ioremap_resource(pdev, 0);
1495
1496 g2d->regs = devm_ioremap_resource(dev, res);
1497 if (IS_ERR(g2d->regs)) {1494 if (IS_ERR(g2d->regs)) {
1498 ret = PTR_ERR(g2d->regs);1495 ret = PTR_ERR(g2d->regs);
1499 goto err_put_clk;1496 goto err_put_clk;
drivers/gpu/drm/exynos/exynos_drm_gsc.c+1−5
@@ -86,7 +86,6 @@ struct gsc_scaler { · 85 unmodified lines
86/*86/*
87 * A structure of gsc context.87 * A structure of gsc context.
88 *88 *
89 * @regs_res: register resources.
90 * @regs: memory mapped io registers.89 * @regs: memory mapped io registers.
91 * @gsc_clk: gsc gate clock.90 * @gsc_clk: gsc gate clock.
92 * @sc: scaler infomations.91 * @sc: scaler infomations.
@@ -103,7 +102,6 @@ struct gsc_context { · 10 unmodified lines
103 struct exynos_drm_ipp_formats *formats;102 struct exynos_drm_ipp_formats *formats;
104 unsigned int num_formats;103 unsigned int num_formats;
105 104
106 struct resource *regs_res;
107 void __iomem *regs;105 void __iomem *regs;
108 const char **clk_names;106 const char **clk_names;
109 struct clk *clocks[GSC_MAX_CLOCKS];107 struct clk *clocks[GSC_MAX_CLOCKS];
@@ -1272,9 +1270,7 @@ static int gsc_probe(struct platform_device *pdev) · 1162 unmodified lines
1272 }1270 }
1273 }1271 }
1274 1272
1275 /* resource memory */1273 ctx->regs = devm_platform_ioremap_resource(pdev, 0);
1276 ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1277 ctx->regs = devm_ioremap_resource(dev, ctx->regs_res);
1278 if (IS_ERR(ctx->regs))1274 if (IS_ERR(ctx->regs))
1279 return PTR_ERR(ctx->regs);1275 return PTR_ERR(ctx->regs);
1280 1276
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
278static int rotator_probe(struct platform_device *pdev)278static int rotator_probe(struct platform_device *pdev)
279{279{
280 struct device *dev = &pdev->dev;280 struct device *dev = &pdev->dev;
281 struct resource *regs_res;
282 struct rot_context *rot;281 struct rot_context *rot;
283 const struct rot_variant *variant;282 const struct rot_variant *variant;
284 int irq;283 int irq;
@@ -292,8 +291,7 @@ static int rotator_probe(struct platform_device *pdev) · 7 unmodified lines
292 rot->formats = variant->formats;291 rot->formats = variant->formats;
293 rot->num_formats = variant->num_formats;292 rot->num_formats = variant->num_formats;
294 rot->dev = dev;293 rot->dev = dev;
295 regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);294 rot->regs = devm_platform_ioremap_resource(pdev, 0);
296 rot->regs = devm_ioremap_resource(dev, regs_res);
297 if (IS_ERR(rot->regs))295 if (IS_ERR(rot->regs))
298 return PTR_ERR(rot->regs);296 return PTR_ERR(rot->regs);
299 297
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
485static int scaler_probe(struct platform_device *pdev)485static int scaler_probe(struct platform_device *pdev)
486{486{
487 struct device *dev = &pdev->dev;487 struct device *dev = &pdev->dev;
488 struct resource *regs_res;
489 struct scaler_context *scaler;488 struct scaler_context *scaler;
490 int irq;489 int irq;
491 int ret, i;490 int ret, i;
@@ -498,8 +497,7 @@ static int scaler_probe(struct platform_device *pdev) · 6 unmodified lines
498 (struct scaler_data *)of_device_get_match_data(dev);497 (struct scaler_data *)of_device_get_match_data(dev);
499 498
500 scaler->dev = dev;499 scaler->dev = dev;
501 regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);500 scaler->regs = devm_platform_ioremap_resource(pdev, 0);
502 scaler->regs = devm_ioremap_resource(dev, regs_res);
503 if (IS_ERR(scaler->regs))501 if (IS_ERR(scaler->regs))
504 return PTR_ERR(scaler->regs);502 return PTR_ERR(scaler->regs);
505 503
drivers/gpu/drm/exynos/exynos_hdmi.c+1−3
@@ -1957,7 +1957,6 @@ static int hdmi_probe(struct platform_device *pdev) · 1956 unmodified lines
1957 struct hdmi_audio_infoframe *audio_infoframe;1957 struct hdmi_audio_infoframe *audio_infoframe;
1958 struct device *dev = &pdev->dev;1958 struct device *dev = &pdev->dev;
1959 struct hdmi_context *hdata;1959 struct hdmi_context *hdata;
1960 struct resource *res;
1961 int ret;1960 int ret;
1962 1961
1963 hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL);1962 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
1979 return ret;1978 return ret;
1980 }1979 }
1981 1980
1982 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);1981 hdata->regs = devm_platform_ioremap_resource(pdev, 0);
1983 hdata->regs = devm_ioremap_resource(dev, res);
1984 if (IS_ERR(hdata->regs)) {1982 if (IS_ERR(hdata->regs)) {
1985 ret = PTR_ERR(hdata->regs);1983 ret = PTR_ERR(hdata->regs);
1986 return ret;1984 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
362 return 0;362 return 0;
363}363}
364 364
365static int sw_fence_dummy_notify(struct i915_sw_fence *sf,365static int __i915_sw_fence_call
366 enum i915_sw_fence_notify state)366sw_fence_dummy_notify(struct i915_sw_fence *sf,
367 enum i915_sw_fence_notify state)
367{368{
368 return NOTIFY_DONE;369 return NOTIFY_DONE;
369}370}
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
882 if (!intel_rps_is_enabled(rps))882 if (!intel_rps_is_enabled(rps))
883 return;883 return;
884 884
885 GEM_BUG_ON(atomic_read(&rps->num_waiters));
886
887 if (!intel_rps_clear_active(rps))885 if (!intel_rps_clear_active(rps))
888 return;886 return;
889 887
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
102 * | +-------+--------------------------------------------------------------+102 * | +-------+--------------------------------------------------------------+
103 * | | 7:0 | NUM_DWORDS = length (in dwords) of the embedded HXG message |103 * | | 7:0 | NUM_DWORDS = length (in dwords) of the embedded HXG message |
104 * +---+-------+--------------------------------------------------------------+104 * +---+-------+--------------------------------------------------------------+
105 * | 1 | 31:0 | +--------------------------------------------------------+ |105 * | 1 | 31:0 | |
106 * +---+-------+ | | |106 * +---+-------+ |
107 * |...| | | Embedded `HXG Message`_ | |107 * |...| | [Embedded `HXG Message`_] |
108 * +---+-------+ | | |108 * +---+-------+ |
109 * | n | 31:0 | +--------------------------------------------------------+ |109 * | n | 31:0 | |
110 * +---+-------+--------------------------------------------------------------+110 * +---+-------+--------------------------------------------------------------+
111 */111 */
112 112
drivers/gpu/drm/i915/gt/uc/abi/guc_communication_mmio_abi.h+5−5
@@ -38,11 +38,11 @@ · 37 unmodified lines
38 * +---+-------+--------------------------------------------------------------+38 * +---+-------+--------------------------------------------------------------+
39 * | | Bits | Description |39 * | | Bits | Description |
40 * +===+=======+==============================================================+40 * +===+=======+==============================================================+
41 * | 0 | 31:0 | +--------------------------------------------------------+ |41 * | 0 | 31:0 | |
42 * +---+-------+ | | |42 * +---+-------+ |
43 * |...| | | Embedded `HXG Message`_ | |43 * |...| | [Embedded `HXG Message`_] |
44 * +---+-------+ | | |44 * +---+-------+ |
45 * | n | 31:0 | +--------------------------------------------------------+ |45 * | n | 31:0 | |
46 * +---+-------+--------------------------------------------------------------+46 * +---+-------+--------------------------------------------------------------+
47 */47 */
48 48
drivers/gpu/drm/i915/gvt/scheduler.c+2−2
@@ -576,7 +576,7 @@ retry: · 575 unmodified lines
576 576
577 /* No one is going to touch shadow bb from now on. */577 /* No one is going to touch shadow bb from now on. */
578 i915_gem_object_flush_map(bb->obj);578 i915_gem_object_flush_map(bb->obj);
579 i915_gem_object_unlock(bb->obj);579 i915_gem_ww_ctx_fini(&ww);
580 }580 }
581 }581 }
582 return 0;582 return 0;
@@ -630,7 +630,7 @@ retry: · 47 unmodified lines
630 return ret;630 return ret;
631 }631 }
632 632
633 i915_gem_object_unlock(wa_ctx->indirect_ctx.obj);633 i915_gem_ww_ctx_fini(&ww);
634 634
635 /* FIXME: we are not tracking our pinned VMA leaving it635 /* FIXME: we are not tracking our pinned VMA leaving it
636 * up to the core to fix up the stray pin_count upon636 * 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
829 i915_sw_fence_init(&rq->submit, submit_notify);829 i915_sw_fence_init(&rq->submit, submit_notify);
830 i915_sw_fence_init(&rq->semaphore, semaphore_notify);830 i915_sw_fence_init(&rq->semaphore, semaphore_notify);
831 831
832 dma_fence_init(&rq->fence, &i915_fence_ops, &rq->lock, 0, 0);
833
834 rq->capture_list = NULL;832 rq->capture_list = NULL;
835 833
836 init_llist_head(&rq->execute_cb);834 init_llist_head(&rq->execute_cb);
@@ -905,17 +903,12 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) · 68 unmodified lines
905 rq->ring = ce->ring;903 rq->ring = ce->ring;
906 rq->execution_mask = ce->engine->mask;904 rq->execution_mask = ce->engine->mask;
907 905
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
913 ret = intel_timeline_get_seqno(tl, rq, &seqno);906 ret = intel_timeline_get_seqno(tl, rq, &seqno);
914 if (ret)907 if (ret)
915 goto err_free;908 goto err_free;
916 909
917 rq->fence.context = tl->fence_context;910 dma_fence_init(&rq->fence, &i915_fence_ops, &rq->lock,
918 rq->fence.seqno = seqno;911 tl->fence_context, seqno);
919 912
920 RCU_INIT_POINTER(rq->timeline, tl);913 RCU_INIT_POINTER(rq->timeline, tl);
921 rq->hwsp_seqno = tl->hwsp_seqno;914 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
1845 bool prepare_bandwidth_transition)1845 bool prepare_bandwidth_transition)
1846{1846{
1847 const struct tegra_plane_state *old_tegra_state, *new_tegra_state;1847 const struct tegra_plane_state *old_tegra_state, *new_tegra_state;
1848 const struct tegra_dc_state *old_dc_state, *new_dc_state;
1849 u32 i, new_avg_bw, old_avg_bw, new_peak_bw, old_peak_bw;1848 u32 i, new_avg_bw, old_avg_bw, new_peak_bw, old_peak_bw;
1850 const struct drm_plane_state *old_plane_state;1849 const struct drm_plane_state *old_plane_state;
1851 const struct drm_crtc_state *old_crtc_state;1850 const struct drm_crtc_state *old_crtc_state;
@@ -1858,8 +1857,6 @@ tegra_crtc_update_memory_bandwidth(struct drm_crtc *crtc, · 6 unmodified lines
1858 return;1857 return;
1859 1858
1860 old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc);1859 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);
1863 1860
1864 if (!crtc->state->active) {1861 if (!crtc->state->active) {
1865 if (!old_crtc_state->active)1862 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
35 return NULL;35 return NULL;
36}36}
37 37
38static inline const struct tegra_dc_state *
39to_const_dc_state(const struct drm_crtc_state *state)
40{
41 return to_dc_state((struct drm_crtc_state *)state);
42}
43
44struct tegra_dc_stats {38struct tegra_dc_stats {
45 unsigned long frames;39 unsigned long frames;
46 unsigned long vblank;40 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
222 mapping->iova = sg_dma_address(mapping->sgt->sgl);222 mapping->iova = sg_dma_address(mapping->sgt->sgl);
223 }223 }
224 224
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;
226 226
227 err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX),227 err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX),
228 GFP_KERNEL);228 GFP_KERNEL);
drivers/gpu/host1x/fence.c+4−2
@@ -15,7 +15,7 @@ · 14 unmodified lines
15#include "intr.h"15#include "intr.h"
16#include "syncpt.h"16#include "syncpt.h"
17 17
18DEFINE_SPINLOCK(lock);18static DEFINE_SPINLOCK(lock);
19 19
20struct host1x_syncpt_fence {20struct host1x_syncpt_fence {
21 struct dma_fence base;21 struct dma_fence base;
@@ -152,8 +152,10 @@ struct dma_fence *host1x_fence_create(struct host1x_syncpt *sp, u32 threshold) · 130 unmodified lines
152 return ERR_PTR(-ENOMEM);152 return ERR_PTR(-ENOMEM);
153 153
154 fence->waiter = kzalloc(sizeof(*fence->waiter), GFP_KERNEL);154 fence->waiter = kzalloc(sizeof(*fence->waiter), GFP_KERNEL);
155 if (!fence->waiter)155 if (!fence->waiter) {
156 kfree(fence);
156 return ERR_PTR(-ENOMEM);157 return ERR_PTR(-ENOMEM);
158 }
157 159
158 fence->sp = sp;160 fence->sp = sp;
159 fence->threshold = threshold;161 fence->threshold = threshold;
drivers/hwmon/k10temp.c+0−6
@@ -362,12 +362,6 @@ static const struct hwmon_channel_info *k10temp_info[] = { · 361 unmodified lines
362 HWMON_T_INPUT | HWMON_T_LABEL,362 HWMON_T_INPUT | HWMON_T_LABEL,
363 HWMON_T_INPUT | HWMON_T_LABEL,363 HWMON_T_INPUT | HWMON_T_LABEL,
364 HWMON_T_INPUT | HWMON_T_LABEL),364 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),
371 NULL365 NULL
372};366};
373 367
drivers/hwmon/ltc2947-core.c+6−2
@@ -989,8 +989,12 @@ static int ltc2947_setup(struct ltc2947_data *st) · 988 unmodified lines
989 return ret;989 return ret;
990 990
991 /* check external clock presence */991 /* check external clock presence */
992 extclk = devm_clk_get(st->dev, NULL);992 extclk = devm_clk_get_optional(st->dev, NULL);
993 if (!IS_ERR(extclk)) {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) {
994 unsigned long rate_hz;998 unsigned long rate_hz;
995 u8 pre = 0, div, tbctl;999 u8 pre = 0, div, tbctl;
996 u64 aux;1000 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
315{315{
316 struct mlxreg_fan *fan = cdev->devdata;316 struct mlxreg_fan *fan = cdev->devdata;
317 unsigned long cur_state;317 unsigned long cur_state;
318 int i, config = 0;
318 u32 regval;319 u32 regval;
319 int i;
320 int err;320 int err;
321 321
322 /*322 /*
@@ -329,6 +329,12 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, · 6 unmodified lines
329 * overwritten.329 * overwritten.
330 */330 */
331 if (state >= MLXREG_FAN_SPEED_MIN && state <= MLXREG_FAN_SPEED_MAX) {331 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;
332 state -= MLXREG_FAN_MAX_STATE;338 state -= MLXREG_FAN_MAX_STATE;
333 for (i = 0; i < state; i++)339 for (i = 0; i < state; i++)
334 fan->cooling_levels[i] = state;340 fan->cooling_levels[i] = state;
@@ -343,7 +349,7 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, · 8 unmodified lines
343 349
344 cur_state = MLXREG_FAN_PWM_DUTY2STATE(regval);350 cur_state = MLXREG_FAN_PWM_DUTY2STATE(regval);
345 if (state < cur_state)351 if (state < cur_state)
346 return 0;352 return config;
347 353
348 state = cur_state;354 state = cur_state;
349 }355 }
@@ -359,7 +365,7 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, · 9 unmodified lines
359 dev_err(fan->dev, "Failed to write PWM duty\n");365 dev_err(fan->dev, "Failed to write PWM duty\n");
360 return err;366 return err;
361 }367 }
362 return 0;368 return config;
363}369}
364 370
365static const struct thermal_cooling_device_ops mlxreg_fan_cooling_ops = {371static 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
340 if (val == OCC_TEMP_SENSOR_FAULT)340 if (val == OCC_TEMP_SENSOR_FAULT)
341 return -EREMOTEIO;341 return -EREMOTEIO;
342 342
343 /*343 /* sensor not ready */
344 * VRM doesn't return temperature, only alarm bit. This344 if (val == 0)
345 * attribute maps to tempX_alarm instead of tempX_input for345 return -EAGAIN;
346 * VRM
347 */
348 if (temp->fru_type != OCC_FRU_TYPE_VRM) {
349 /* sensor not ready */
350 if (val == 0)
351 return -EAGAIN;
352 346
353 val *= 1000;347 val *= 1000;
354 }
355 break;348 break;
356 case 2:349 case 2:
357 val = temp->fru_type;350 val = temp->fru_type;
@@ -886,7 +879,7 @@ static int occ_setup_sensor_attrs(struct occ *occ) · 528 unmodified lines
886 0, i);879 0, i);
887 attr++;880 attr++;
888 881
889 if (sensors->temp.version > 1 &&882 if (sensors->temp.version == 2 &&
890 temp->fru_type == OCC_FRU_TYPE_VRM) {883 temp->fru_type == OCC_FRU_TYPE_VRM) {
891 snprintf(attr->name, sizeof(attr->name),884 snprintf(attr->name, sizeof(attr->name),
892 "temp%d_alarm", s);885 "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
171 cmd = CFFPS_SN_CMD;171 cmd = CFFPS_SN_CMD;
172 break;172 break;
173 case CFFPS_DEBUGFS_MAX_POWER_OUT:173 case CFFPS_DEBUGFS_MAX_POWER_OUT:
174 rc = i2c_smbus_read_word_swapped(psu->client,174 if (psu->version == cffps1) {
175 CFFPS_MAX_POWER_OUT_CMD);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
176 if (rc < 0)182 if (rc < 0)
177 return rc;183 return rc;
178 184
drivers/hwmon/pmbus/mp2975.c+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
54 54
55#define MP2975_RAIL2_FUNC (PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | \55#define MP2975_RAIL2_FUNC (PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | \
56 PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | \56 PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | \
57 PMBUS_PHASE_VIRTUAL)57 PMBUS_HAVE_POUT | PMBUS_PHASE_VIRTUAL)
58 58
59struct mp2975_data {59struct mp2975_data {
60 struct pmbus_driver_info info;60 struct pmbus_driver_info info;
drivers/hwmon/tmp421.c+39−32
@@ -100,71 +100,81 @@ struct tmp421_data { · 99 unmodified lines
100 s16 temp[4];100 s16 temp[4];
101};101};
102 102
103static int temp_from_s16(s16 reg)103static int temp_from_raw(u16 reg, bool extended)
104{104{
105 /* Mask out status bits */105 /* Mask out status bits */
106 int temp = reg & ~0xf;106 int temp = reg & ~0xf;
107 107
108 return (temp * 1000 + 128) / 256;108 if (extended)
109}109 temp = temp - 64 * 256;
110 110 else
111static int temp_from_u16(u16 reg)111 temp = (s16)temp;
112{
113 /* Mask out status bits */
114 int temp = reg & ~0xf;
115
116 /* Add offset for extended temperature range. */
117 temp -= 64 * 256;
118 112
119 return (temp * 1000 + 128) / 256;113 return DIV_ROUND_CLOSEST(temp * 1000, 256);
120}114}
121 115
122static struct tmp421_data *tmp421_update_device(struct device *dev)116static int tmp421_update_device(struct tmp421_data *data)
123{117{
124 struct tmp421_data *data = dev_get_drvdata(dev);
125 struct i2c_client *client = data->client;118 struct i2c_client *client = data->client;
119 int ret = 0;
126 int i;120 int i;
127 121
128 mutex_lock(&data->update_lock);122 mutex_lock(&data->update_lock);
129 123
130 if (time_after(jiffies, data->last_updated + (HZ / 2)) ||124 if (time_after(jiffies, data->last_updated + (HZ / 2)) ||
131 !data->valid) {125 !data->valid) {
132 data->config = i2c_smbus_read_byte_data(client,126 ret = i2c_smbus_read_byte_data(client, TMP421_CONFIG_REG_1);
133 TMP421_CONFIG_REG_1);127 if (ret < 0)
128 goto exit;
129 data->config = ret;
134 130
135 for (i = 0; i < data->channels; i++) {131 for (i = 0; i < data->channels; i++) {
136 data->temp[i] = i2c_smbus_read_byte_data(client,132 ret = i2c_smbus_read_byte_data(client, TMP421_TEMP_MSB[i]);
137 TMP421_TEMP_MSB[i]) << 8;133 if (ret < 0)
138 data->temp[i] |= i2c_smbus_read_byte_data(client,134 goto exit;
139 TMP421_TEMP_LSB[i]);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;
140 }141 }
141 data->last_updated = jiffies;142 data->last_updated = jiffies;
142 data->valid = 1;143 data->valid = 1;
143 }144 }
144 145
146exit:
145 mutex_unlock(&data->update_lock);147 mutex_unlock(&data->update_lock);
146 148
147 return data;149 if (ret < 0) {
150 data->valid = 0;
151 return ret;
152 }
153
154 return 0;
148}155}
149 156
150static int tmp421_read(struct device *dev, enum hwmon_sensor_types type,157static int tmp421_read(struct device *dev, enum hwmon_sensor_types type,
151 u32 attr, int channel, long *val)158 u32 attr, int channel, long *val)
152{159{
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;
154 166
155 switch (attr) {167 switch (attr) {
156 case hwmon_temp_input:168 case hwmon_temp_input:
157 if (tmp421->config & TMP421_CONFIG_RANGE)169 *val = temp_from_raw(tmp421->temp[channel],
158 *val = temp_from_u16(tmp421->temp[channel]);170 tmp421->config & TMP421_CONFIG_RANGE);
159 else
160 *val = temp_from_s16(tmp421->temp[channel]);
161 return 0;171 return 0;
162 case hwmon_temp_fault:172 case hwmon_temp_fault:
163 /*173 /*
164 * The OPEN bit signals a fault. This is bit 0 of the temperature174 * Any of OPEN or /PVLD bits indicate a hardware mulfunction
165 * register (low byte).175 * and the conversion result may be incorrect
166 */176 */
167 *val = tmp421->temp[channel] & 0x01;177 *val = !!(tmp421->temp[channel] & 0x03);
168 return 0;178 return 0;
169 default:179 default:
170 return -EOPNOTSUPP;180 return -EOPNOTSUPP;
@@ -177,9 +187,6 @@ static umode_t tmp421_is_visible(const void *data, enum hwmon_sensor_types type, · 6 unmodified lines
177{187{
178 switch (attr) {188 switch (attr) {
179 case hwmon_temp_fault:189 case hwmon_temp_fault:
180 if (channel == 0)
181 return 0;
182 return 0444;
183 case hwmon_temp_input:190 case hwmon_temp_input:
184 return 0444;191 return 0444;
185 default:192 default:
drivers/hwmon/w83791d.c+11−18
@@ -273,9 +273,6 @@ struct w83791d_data { · 272 unmodified lines
273 char valid; /* !=0 if following fields are valid */273 char valid; /* !=0 if following fields are valid */
274 unsigned long last_updated; /* In jiffies */274 unsigned long last_updated; /* In jiffies */
275 275
276 /* array of 2 pointers to subclients */
277 struct i2c_client *lm75[2];
278
279 /* volts */276 /* volts */
280 u8 in[NUMBER_OF_VIN]; /* Register value */277 u8 in[NUMBER_OF_VIN]; /* Register value */
281 u8 in_max[NUMBER_OF_VIN]; /* Register value */278 u8 in_max[NUMBER_OF_VIN]; /* Register value */
@@ -1257,7 +1254,6 @@ static const struct attribute_group w83791d_group_fanpwm45 = { · 975 unmodified lines
1257static int w83791d_detect_subclients(struct i2c_client *client)1254static int w83791d_detect_subclients(struct i2c_client *client)
1258{1255{
1259 struct i2c_adapter *adapter = client->adapter;1256 struct i2c_adapter *adapter = client->adapter;
1260 struct w83791d_data *data = i2c_get_clientdata(client);
1261 int address = client->addr;1257 int address = client->addr;
1262 int i, id;1258 int i, id;
1263 u8 val;1259 u8 val;
@@ -1280,22 +1276,19 @@ static int w83791d_detect_subclients(struct i2c_client *client) · 16 unmodified lines
1280 }1276 }
1281 1277
1282 val = w83791d_read(client, W83791D_REG_I2C_SUBADDR);1278 val = w83791d_read(client, W83791D_REG_I2C_SUBADDR);
1283 if (!(val & 0x08))1279
1284 data->lm75[0] = devm_i2c_new_dummy_device(&client->dev, adapter,1280 if (!(val & 0x88) && (val & 0x7) == ((val >> 4) & 0x7)) {
1285 0x48 + (val & 0x7));1281 dev_err(&client->dev,
1286 if (!(val & 0x80)) {1282 "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (val & 0x7));
1287 if (!IS_ERR(data->lm75[0]) &&1283 return -ENODEV;
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));
1297 }1284 }
1298 1285
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
1299 return 0;1292 return 0;
1300}1293}
1301 1294
drivers/hwmon/w83792d.c+11−17
@@ -264,9 +264,6 @@ struct w83792d_data { · 263 unmodified lines
264 char valid; /* !=0 if following fields are valid */264 char valid; /* !=0 if following fields are valid */
265 unsigned long last_updated; /* In jiffies */265 unsigned long last_updated; /* In jiffies */
266 266
267 /* array of 2 pointers to subclients */
268 struct i2c_client *lm75[2];
269
270 u8 in[9]; /* Register value */267 u8 in[9]; /* Register value */
271 u8 in_max[9]; /* Register value */268 u8 in_max[9]; /* Register value */
272 u8 in_min[9]; /* Register value */269 u8 in_min[9]; /* Register value */
@@ -927,7 +924,6 @@ w83792d_detect_subclients(struct i2c_client *new_client) · 654 unmodified lines
927 int address = new_client->addr;924 int address = new_client->addr;
928 u8 val;925 u8 val;
929 struct i2c_adapter *adapter = new_client->adapter;926 struct i2c_adapter *adapter = new_client->adapter;
930 struct w83792d_data *data = i2c_get_clientdata(new_client);
931 927
932 id = i2c_adapter_id(adapter);928 id = i2c_adapter_id(adapter);
933 if (force_subclients[0] == id && force_subclients[1] == address) {929 if (force_subclients[0] == id && force_subclients[1] == address) {
@@ -946,21 +942,19 @@ w83792d_detect_subclients(struct i2c_client *new_client) · 12 unmodified lines
946 }942 }
947 943
948 val = w83792d_read_value(new_client, W83792D_REG_I2C_SUBADDR);944 val = w83792d_read_value(new_client, W83792D_REG_I2C_SUBADDR);
949 if (!(val & 0x08))945
950 data->lm75[0] = devm_i2c_new_dummy_device(&new_client->dev, adapter,946 if (!(val & 0x88) && (val & 0x7) == ((val >> 4) & 0x7)) {
951 0x48 + (val & 0x7));947 dev_err(&new_client->dev,
952 if (!(val & 0x80)) {948 "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (val & 0x7));
953 if (!IS_ERR(data->lm75[0]) &&949 return -ENODEV;
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));
962 }950 }
963 951
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
964 return 0;958 return 0;
965}959}
966 960
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
202}202}
203 203
204struct w83793_data {204struct w83793_data {
205 struct i2c_client *lm75[2];
206 struct device *hwmon_dev;205 struct device *hwmon_dev;
207 struct mutex update_lock;206 struct mutex update_lock;
208 char valid; /* !=0 if following fields are valid */207 char valid; /* !=0 if following fields are valid */
@@ -1566,7 +1565,6 @@ w83793_detect_subclients(struct i2c_client *client) · 1357 unmodified lines
1566 int address = client->addr;1565 int address = client->addr;
1567 u8 tmp;1566 u8 tmp;
1568 struct i2c_adapter *adapter = client->adapter;1567 struct i2c_adapter *adapter = client->adapter;
1569 struct w83793_data *data = i2c_get_clientdata(client);
1570 1568
1571 id = i2c_adapter_id(adapter);1569 id = i2c_adapter_id(adapter);
1572 if (force_subclients[0] == id && force_subclients[1] == address) {1570 if (force_subclients[0] == id && force_subclients[1] == address) {
@@ -1586,21 +1584,19 @@ w83793_detect_subclients(struct i2c_client *client) · 13 unmodified lines
1586 }1584 }
1587 1585
1588 tmp = w83793_read_value(client, W83793_REG_I2C_SUBADDR);1586 tmp = w83793_read_value(client, W83793_REG_I2C_SUBADDR);
1589 if (!(tmp & 0x08))1587
1590 data->lm75[0] = devm_i2c_new_dummy_device(&client->dev, adapter,1588 if (!(tmp & 0x88) && (tmp & 0x7) == ((tmp >> 4) & 0x7)) {
1591 0x48 + (tmp & 0x7));1589 dev_err(&client->dev,
1592 if (!(tmp & 0x80)) {1590 "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (tmp & 0x7));
1593 if (!IS_ERR(data->lm75[0])1591 return -ENODEV;
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));
1602 }1592 }
1603 1593
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
1604 return 0;1600 return 0;
1605}1601}
1606 1602
drivers/interconnect/qcom/sdm660.c+19−6
@@ -44,9 +44,9 @@ · 43 unmodified lines
44#define NOC_PERM_MODE_BYPASS (1 << NOC_QOS_MODE_BYPASS)44#define NOC_PERM_MODE_BYPASS (1 << NOC_QOS_MODE_BYPASS)
45 45
46#define NOC_QOS_PRIORITYn_ADDR(n) (0x8 + (n * 0x1000))46#define NOC_QOS_PRIORITYn_ADDR(n) (0x8 + (n * 0x1000))
47#define NOC_QOS_PRIORITY_MASK 0xf47#define NOC_QOS_PRIORITY_P1_MASK 0xc
48#define NOC_QOS_PRIORITY_P0_MASK 0x3
48#define NOC_QOS_PRIORITY_P1_SHIFT 0x249#define NOC_QOS_PRIORITY_P1_SHIFT 0x2
49#define NOC_QOS_PRIORITY_P0_SHIFT 0x3
50 50
51#define NOC_QOS_MODEn_ADDR(n) (0xc + (n * 0x1000))51#define NOC_QOS_MODEn_ADDR(n) (0xc + (n * 0x1000))
52#define NOC_QOS_MODEn_MASK 0x352#define NOC_QOS_MODEn_MASK 0x3
@@ -173,6 +173,16 @@ static const struct clk_bulk_data bus_mm_clocks[] = { · 120 unmodified lines
173 { .id = "iface" },173 { .id = "iface" },
174};174};
175 175
176static 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
176/**186/**
177 * struct qcom_icc_provider - Qualcomm specific interconnect provider187 * struct qcom_icc_provider - Qualcomm specific interconnect provider
178 * @provider: generic interconnect provider188 * @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
307DEFINE_QNODE(slv_prng, SDM660_SLAVE_PRNG, 4, -1, 44, true, -1, 0, -1, 0);317DEFINE_QNODE(slv_prng, SDM660_SLAVE_PRNG, 4, -1, 44, true, -1, 0, -1, 0);
308DEFINE_QNODE(slv_spdm, SDM660_SLAVE_SPDM, 4, -1, 60, true, -1, 0, -1, 0);318DEFINE_QNODE(slv_spdm, SDM660_SLAVE_SPDM, 4, -1, 60, true, -1, 0, -1, 0);
309DEFINE_QNODE(slv_qdss_cfg, SDM660_SLAVE_QDSS_CFG, 4, -1, 63, true, -1, 0, -1, 0);319DEFINE_QNODE(slv_qdss_cfg, SDM660_SLAVE_QDSS_CFG, 4, -1, 63, true, -1, 0, -1, 0);
310DEFINE_QNODE(slv_cnoc_mnoc_cfg, SDM660_SLAVE_BLSP_1, 4, -1, 66, true, -1, 0, -1, SDM660_MASTER_CNOC_MNOC_CFG);320DEFINE_QNODE(slv_cnoc_mnoc_cfg, SDM660_SLAVE_CNOC_MNOC_CFG, 4, -1, 66, true, -1, 0, -1, SDM660_MASTER_CNOC_MNOC_CFG);
311DEFINE_QNODE(slv_snoc_cfg, SDM660_SLAVE_SNOC_CFG, 4, -1, 70, true, -1, 0, -1, 0);321DEFINE_QNODE(slv_snoc_cfg, SDM660_SLAVE_SNOC_CFG, 4, -1, 70, true, -1, 0, -1, 0);
312DEFINE_QNODE(slv_qm_cfg, SDM660_SLAVE_QM_CFG, 4, -1, 212, true, -1, 0, -1, 0);322DEFINE_QNODE(slv_qm_cfg, SDM660_SLAVE_QM_CFG, 4, -1, 212, true, -1, 0, -1, 0);
313DEFINE_QNODE(slv_clk_ctl, SDM660_SLAVE_CLK_CTL, 4, -1, 47, true, -1, 0, -1, 0);323DEFINE_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
624 /* Must be updated one at a time, P1 first, P0 last */634 /* Must be updated one at a time, P1 first, P0 last */
625 val = qos->areq_prio << NOC_QOS_PRIORITY_P1_SHIFT;635 val = qos->areq_prio << NOC_QOS_PRIORITY_P1_SHIFT;
626 rc = regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port),636 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);
628 if (rc)638 if (rc)
629 return rc;639 return rc;
630 640
631 val = qos->prio_level << NOC_QOS_PRIORITY_P0_SHIFT;
632 return regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port),641 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);
634}643}
635 644
636static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw)645static 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
810 qp->bus_clks = devm_kmemdup(dev, bus_mm_clocks,819 qp->bus_clks = devm_kmemdup(dev, bus_mm_clocks,
811 sizeof(bus_mm_clocks), GFP_KERNEL);820 sizeof(bus_mm_clocks), GFP_KERNEL);
812 qp->num_clks = ARRAY_SIZE(bus_mm_clocks);821 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);
813 } else {826 } else {
814 if (of_device_is_compatible(dev->of_node, "qcom,sdm660-bimc"))827 if (of_device_is_compatible(dev->of_node, "qcom,sdm660-bimc"))
815 qp->is_bimc_node = true;828 qp->is_bimc_node = true;
drivers/iommu/apple-dart.c+35−21
@@ -183,7 +183,6 @@ struct apple_dart_master_cfg { · 182 unmodified lines
183 183
184static struct platform_driver apple_dart_driver;184static struct platform_driver apple_dart_driver;
185static const struct iommu_ops apple_dart_iommu_ops;185static const struct iommu_ops apple_dart_iommu_ops;
186static const struct iommu_flush_ops apple_dart_tlb_ops;
187 186
188static struct apple_dart_domain *to_dart_domain(struct iommu_domain *dom)187static struct apple_dart_domain *to_dart_domain(struct iommu_domain *dom)
189{188{
@@ -338,22 +337,6 @@ static void apple_dart_iotlb_sync_map(struct iommu_domain *domain, · 148 unmodified lines
338 apple_dart_domain_flush_tlb(to_dart_domain(domain));337 apple_dart_domain_flush_tlb(to_dart_domain(domain));
339}338}
340 339
341static void apple_dart_tlb_flush_all(void *cookie)
342{
343 apple_dart_domain_flush_tlb(cookie);
344}
345
346static 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
352static 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
357static phys_addr_t apple_dart_iova_to_phys(struct iommu_domain *domain,340static phys_addr_t apple_dart_iova_to_phys(struct iommu_domain *domain,
358 dma_addr_t iova)341 dma_addr_t iova)
359{342{
@@ -435,7 +418,6 @@ static int apple_dart_finalize_domain(struct iommu_domain *domain, · 75 unmodified lines
435 .ias = 32,418 .ias = 32,
436 .oas = 36,419 .oas = 36,
437 .coherent_walk = 1,420 .coherent_walk = 1,
438 .tlb = &apple_dart_tlb_ops,
439 .iommu_dev = dart->dev,421 .iommu_dev = dart->dev,
440 };422 };
441 423
@@ -661,16 +643,34 @@ static int apple_dart_of_xlate(struct device *dev, struct of_phandle_args *args) · 219 unmodified lines
661 return -EINVAL;643 return -EINVAL;
662}644}
663 645
646static DEFINE_MUTEX(apple_dart_groups_lock);
647
648static 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
664static struct iommu_group *apple_dart_device_group(struct device *dev)664static struct iommu_group *apple_dart_device_group(struct device *dev)
665{665{
666 static DEFINE_MUTEX(lock);
667 int i, sid;666 int i, sid;
668 struct apple_dart_master_cfg *cfg = dev_iommu_priv_get(dev);667 struct apple_dart_master_cfg *cfg = dev_iommu_priv_get(dev);
669 struct apple_dart_stream_map *stream_map;668 struct apple_dart_stream_map *stream_map;
669 struct apple_dart_master_cfg *group_master_cfg;
670 struct iommu_group *group = NULL;670 struct iommu_group *group = NULL;
671 struct iommu_group *res = ERR_PTR(-EINVAL);671 struct iommu_group *res = ERR_PTR(-EINVAL);
672 672
673 mutex_lock(&lock);673 mutex_lock(&apple_dart_groups_lock);
674 674
675 for_each_stream_map(i, cfg, stream_map) {675 for_each_stream_map(i, cfg, stream_map) {
676 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) {676 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
698#endif698#endif
699 group = generic_device_group(dev);699 group = generic_device_group(dev);
700 700
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
701 for_each_stream_map(i, cfg, stream_map)715 for_each_stream_map(i, cfg, stream_map)
702 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS)716 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS)
703 stream_map->dart->sid2group[sid] = group;717 stream_map->dart->sid2group[sid] = group;
@@ -705,7 +719,7 @@ static struct iommu_group *apple_dart_device_group(struct device *dev) · 1 unmodified line
705 res = group;719 res = group;
706 720
707out:721out:
708 mutex_unlock(&lock);722 mutex_unlock(&apple_dart_groups_lock);
709 return res;723 return res;
710}724}
711 725
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
1942 reason = dmar_get_fault_reason(fault_reason, &fault_type);1942 reason = dmar_get_fault_reason(fault_reason, &fault_type);
1943 1943
1944 if (fault_type == INTR_REMAP)1944 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",
1946 source_id >> 8, PCI_SLOT(source_id & 0xFF),1946 source_id >> 8, PCI_SLOT(source_id & 0xFF),
1947 PCI_FUNC(source_id & 0xFF), addr >> 48,1947 PCI_FUNC(source_id & 0xFF), addr >> 48,
1948 fault_reason, reason);1948 fault_reason, reason);
1949 else if (pasid == INVALID_IOASID)1949 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",
1951 type ? "DMA Read" : "DMA Write",1951 type ? "DMA Read" : "DMA Write",
1952 source_id >> 8, PCI_SLOT(source_id & 0xFF),1952 source_id >> 8, PCI_SLOT(source_id & 0xFF),
1953 PCI_FUNC(source_id & 0xFF), addr,1953 PCI_FUNC(source_id & 0xFF), addr,
1954 fault_reason, reason);1954 fault_reason, reason);
1955 else1955 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",
1957 type ? "DMA Read" : "DMA Write", pasid,1957 type ? "DMA Read" : "DMA Write", pasid,
1958 source_id >> 8, PCI_SLOT(source_id & 0xFF),1958 source_id >> 8, PCI_SLOT(source_id & 0xFF),
1959 PCI_FUNC(source_id & 0xFF), addr,1959 PCI_FUNC(source_id & 0xFF), addr,
drivers/ipack/devices/ipoctal.c+47−16
@@ -33,6 +33,7 @@ struct ipoctal_channel { · 32 unmodified lines
33 unsigned int pointer_read;33 unsigned int pointer_read;
34 unsigned int pointer_write;34 unsigned int pointer_write;
35 struct tty_port tty_port;35 struct tty_port tty_port;
36 bool tty_registered;
36 union scc2698_channel __iomem *regs;37 union scc2698_channel __iomem *regs;
37 union scc2698_block __iomem *block_regs;38 union scc2698_block __iomem *block_regs;
38 unsigned int board_id;39 unsigned int board_id;
@@ -81,22 +82,34 @@ static int ipoctal_port_activate(struct tty_port *port, struct tty_struct *tty) · 42 unmodified lines
81 return 0;82 return 0;
82}83}
83 84
84static int ipoctal_open(struct tty_struct *tty, struct file *file)85static int ipoctal_install(struct tty_driver *driver, struct tty_struct *tty)
85{86{
86 struct ipoctal_channel *channel = dev_get_drvdata(tty->dev);87 struct ipoctal_channel *channel = dev_get_drvdata(tty->dev);
87 struct ipoctal *ipoctal = chan_to_ipoctal(channel, tty->index);88 struct ipoctal *ipoctal = chan_to_ipoctal(channel, tty->index);
88 int err;89 int res;
89
90 tty->driver_data = channel;
91 90
92 if (!ipack_get_carrier(ipoctal->dev))91 if (!ipack_get_carrier(ipoctal->dev))
93 return -EBUSY;92 return -EBUSY;
94 93
95 err = tty_port_open(&channel->tty_port, tty, file);94 res = tty_standard_install(driver, tty);
96 if (err)95 if (res)
97 ipack_put_carrier(ipoctal->dev);96 goto err_put_carrier;
97
98 tty->driver_data = channel;
99
100 return 0;
101
102err_put_carrier:
103 ipack_put_carrier(ipoctal->dev);
104
105 return res;
106}
107
108static int ipoctal_open(struct tty_struct *tty, struct file *file)
109{
110 struct ipoctal_channel *channel = tty->driver_data;
98 111
99 return err;112 return tty_port_open(&channel->tty_port, tty, file);
100}113}
101 114
102static void ipoctal_reset_stats(struct ipoctal_stats *stats)115static 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
264 int res;277 int res;
265 int i;278 int i;
266 struct tty_driver *tty;279 struct tty_driver *tty;
267 char name[20];
268 struct ipoctal_channel *channel;280 struct ipoctal_channel *channel;
269 struct ipack_region *region;281 struct ipack_region *region;
270 void __iomem *addr;282 void __iomem *addr;
@@ -355,8 +367,11 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 84 unmodified lines
355 /* Fill struct tty_driver with ipoctal data */367 /* Fill struct tty_driver with ipoctal data */
356 tty->owner = THIS_MODULE;368 tty->owner = THIS_MODULE;
357 tty->driver_name = KBUILD_MODNAME;369 tty->driver_name = KBUILD_MODNAME;
358 sprintf(name, KBUILD_MODNAME ".%d.%d.", bus_nr, slot);370 tty->name = kasprintf(GFP_KERNEL, KBUILD_MODNAME ".%d.%d.", bus_nr, slot);
359 tty->name = name;371 if (!tty->name) {
372 res = -ENOMEM;
373 goto err_put_driver;
374 }
360 tty->major = 0;375 tty->major = 0;
361 376
362 tty->minor_start = 0;377 tty->minor_start = 0;
@@ -371,8 +386,7 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 8 unmodified lines
371 res = tty_register_driver(tty);386 res = tty_register_driver(tty);
372 if (res) {387 if (res) {
373 dev_err(&ipoctal->dev->dev, "Can't register tty driver.\n");388 dev_err(&ipoctal->dev->dev, "Can't register tty driver.\n");
374 tty_driver_kref_put(tty);389 goto err_free_name;
375 return res;
376 }390 }
377 391
378 /* Save struct tty_driver for use it when uninstalling the device */392 /* 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
383 397
384 channel = &ipoctal->channel[i];398 channel = &ipoctal->channel[i];
385 tty_port_init(&channel->tty_port);399 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;
387 channel->tty_port.ops = &ipoctal_tty_port_ops;403 channel->tty_port.ops = &ipoctal_tty_port_ops;
388 404
389 ipoctal_reset_stats(&channel->stats);405 ipoctal_reset_stats(&channel->stats);
@@ -391,13 +407,15 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 1 unmodified line
391 spin_lock_init(&channel->lock);407 spin_lock_init(&channel->lock);
392 channel->pointer_read = 0;408 channel->pointer_read = 0;
393 channel->pointer_write = 0;409 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);
395 if (IS_ERR(tty_dev)) {412 if (IS_ERR(tty_dev)) {
396 dev_err(&ipoctal->dev->dev, "Failed to register tty device.\n");413 dev_err(&ipoctal->dev->dev, "Failed to register tty device.\n");
414 tty_port_free_xmit_buf(&channel->tty_port);
397 tty_port_destroy(&channel->tty_port);415 tty_port_destroy(&channel->tty_port);
398 continue;416 continue;
399 }417 }
400 dev_set_drvdata(tty_dev, channel);418 channel->tty_registered = true;
401 }419 }
402 420
403 /*421 /*
@@ -409,6 +427,13 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 5 unmodified lines
409 ipoctal_irq_handler, ipoctal);427 ipoctal_irq_handler, ipoctal);
410 428
411 return 0;429 return 0;
430
431err_free_name:
432 kfree(tty->name);
433err_put_driver:
434 tty_driver_kref_put(tty);
435
436 return res;
412}437}
413 438
414static inline int ipoctal_copy_write_buffer(struct ipoctal_channel *channel,439static 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
648 673
649static const struct tty_operations ipoctal_fops = {674static const struct tty_operations ipoctal_fops = {
650 .ioctl = NULL,675 .ioctl = NULL,
676 .install = ipoctal_install,
651 .open = ipoctal_open,677 .open = ipoctal_open,
652 .close = ipoctal_close,678 .close = ipoctal_close,
653 .write = ipoctal_write_tty,679 .write = ipoctal_write_tty,
@@ -690,12 +716,17 @@ static void __ipoctal_remove(struct ipoctal *ipoctal) · 36 unmodified lines
690 716
691 for (i = 0; i < NR_CHANNELS; i++) {717 for (i = 0; i < NR_CHANNELS; i++) {
692 struct ipoctal_channel *channel = &ipoctal->channel[i];718 struct ipoctal_channel *channel = &ipoctal->channel[i];
719
720 if (!channel->tty_registered)
721 continue;
722
693 tty_unregister_device(ipoctal->tty_drv, i);723 tty_unregister_device(ipoctal->tty_drv, i);
694 tty_port_free_xmit_buf(&channel->tty_port);724 tty_port_free_xmit_buf(&channel->tty_port);
695 tty_port_destroy(&channel->tty_port);725 tty_port_destroy(&channel->tty_port);
696 }726 }
697 727
698 tty_unregister_driver(ipoctal->tty_drv);728 tty_unregister_driver(ipoctal->tty_drv);
729 kfree(ipoctal->tty_drv->name);
699 tty_driver_kref_put(ipoctal->tty_drv);730 tty_driver_kref_put(ipoctal->tty_drv);
700 kfree(ipoctal);731 kfree(ipoctal);
701}732}
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
779 gve_num_tx_qpls(priv));779 gve_num_tx_qpls(priv));
780 780
781 /* we are out of rx qpls */781 /* 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))
783 return NULL;783 return NULL;
784 784
785 set_bit(id, priv->qpl_cfg.qpl_id_map);785 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
41{41{
42 struct gve_priv *priv = netdev_priv(dev);42 struct gve_priv *priv = netdev_priv(dev);
43 unsigned int start;43 unsigned int start;
44 u64 packets, bytes;
44 int ring;45 int ring;
45 46
46 if (priv->rx) {47 if (priv->rx) {
@@ -48,10 +49,12 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s) · 1 unmodified line
48 do {49 do {
49 start =50 start =
50 u64_stats_fetch_begin(&priv->rx[ring].statss);51 u64_stats_fetch_begin(&priv->rx[ring].statss);
51 s->rx_packets += priv->rx[ring].rpackets;52 packets = priv->rx[ring].rpackets;
52 s->rx_bytes += priv->rx[ring].rbytes;53 bytes = priv->rx[ring].rbytes;
53 } while (u64_stats_fetch_retry(&priv->rx[ring].statss,54 } while (u64_stats_fetch_retry(&priv->rx[ring].statss,
54 start));55 start));
56 s->rx_packets += packets;
57 s->rx_bytes += bytes;
55 }58 }
56 }59 }
57 if (priv->tx) {60 if (priv->tx) {
@@ -59,10 +62,12 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s) · 1 unmodified line
59 do {62 do {
60 start =63 start =
61 u64_stats_fetch_begin(&priv->tx[ring].statss);64 u64_stats_fetch_begin(&priv->tx[ring].statss);
62 s->tx_packets += priv->tx[ring].pkt_done;65 packets = priv->tx[ring].pkt_done;
63 s->tx_bytes += priv->tx[ring].bytes_done;66 bytes = priv->tx[ring].bytes_done;
64 } while (u64_stats_fetch_retry(&priv->tx[ring].statss,67 } while (u64_stats_fetch_retry(&priv->tx[ring].statss,
65 start));68 start));
69 s->tx_packets += packets;
70 s->tx_bytes += bytes;
66 }71 }
67 }72 }
68}73}
@@ -82,6 +87,9 @@ static int gve_alloc_counter_array(struct gve_priv *priv) · 13 unmodified lines
82 87
83static void gve_free_counter_array(struct gve_priv *priv)88static void gve_free_counter_array(struct gve_priv *priv)
84{89{
90 if (!priv->counter_array)
91 return;
92
85 dma_free_coherent(&priv->pdev->dev,93 dma_free_coherent(&priv->pdev->dev,
86 priv->num_event_counters *94 priv->num_event_counters *
87 sizeof(*priv->counter_array),95 sizeof(*priv->counter_array),
@@ -142,6 +150,9 @@ static int gve_alloc_stats_report(struct gve_priv *priv) · 54 unmodified lines
142 150
143static void gve_free_stats_report(struct gve_priv *priv)151static void gve_free_stats_report(struct gve_priv *priv)
144{152{
153 if (!priv->stats_report)
154 return;
155
145 del_timer_sync(&priv->stats_report_timer);156 del_timer_sync(&priv->stats_report_timer);
146 dma_free_coherent(&priv->pdev->dev, priv->stats_report_len,157 dma_free_coherent(&priv->pdev->dev, priv->stats_report_len,
147 priv->stats_report, priv->stats_report_bus);158 priv->stats_report, priv->stats_report_bus);
@@ -370,18 +381,19 @@ static void gve_free_notify_blocks(struct gve_priv *priv) · 222 unmodified lines
370{381{
371 int i;382 int i;
372 383
373 if (priv->msix_vectors) {384 if (!priv->msix_vectors)
374 /* Free the irqs */385 return;
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;
378 386
379 irq_set_affinity_hint(priv->msix_vectors[msix_idx].vector,387 /* Free the irqs */
380 NULL);388 for (i = 0; i < priv->num_ntfy_blks; i++) {
381 free_irq(priv->msix_vectors[msix_idx].vector, block);389 struct gve_notify_block *block = &priv->ntfy_blocks[i];
382 }390 int msix_idx = i;
383 free_irq(priv->msix_vectors[priv->mgmt_msix_idx].vector, priv);391
392 irq_set_affinity_hint(priv->msix_vectors[msix_idx].vector,
393 NULL);
394 free_irq(priv->msix_vectors[msix_idx].vector, block);
384 }395 }
396 free_irq(priv->msix_vectors[priv->mgmt_msix_idx].vector, priv);
385 dma_free_coherent(&priv->pdev->dev,397 dma_free_coherent(&priv->pdev->dev,
386 priv->num_ntfy_blks * sizeof(*priv->ntfy_blocks),398 priv->num_ntfy_blks * sizeof(*priv->ntfy_blocks),
387 priv->ntfy_blocks, priv->ntfy_block_bus);399 priv->ntfy_blocks, priv->ntfy_block_bus);
@@ -1184,9 +1196,10 @@ static void gve_handle_reset(struct gve_priv *priv) · 796 unmodified lines
1184 1196
1185void gve_handle_report_stats(struct gve_priv *priv)1197void gve_handle_report_stats(struct gve_priv *priv)
1186{1198{
1187 int idx, stats_idx = 0, tx_bytes;
1188 unsigned int start = 0;
1189 struct stats *stats = priv->stats_report->stats;1199 struct stats *stats = priv->stats_report->stats;
1200 int idx, stats_idx = 0;
1201 unsigned int start = 0;
1202 u64 tx_bytes;
1190 1203
1191 if (!gve_get_report_stats(priv))1204 if (!gve_get_report_stats(priv))
1192 return;1205 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
104 if (!rx->data.page_info)104 if (!rx->data.page_info)
105 return -ENOMEM;105 return -ENOMEM;
106 106
107 if (!rx->data.raw_addressing)107 if (!rx->data.raw_addressing) {
108 rx->data.qpl = gve_assign_rx_qpl(priv);108 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 }
109 for (i = 0; i < slots; i++) {115 for (i = 0; i < slots; i++) {
110 if (!rx->data.raw_addressing) {116 if (!rx->data.raw_addressing) {
111 struct page *page = rx->data.qpl->pages[i];117 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
4871{4871{
4872 int i;4872 int i;
4873 4873
4874 i40e_free_misc_vector(pf);4874 if (test_bit(__I40E_MISC_IRQ_REQUESTED, pf->state))
4875 i40e_free_misc_vector(pf);
4875 4876
4876 i40e_put_lump(pf->irq_pile, pf->iwarp_base_vector,4877 i40e_put_lump(pf->irq_pile, pf->iwarp_base_vector,
4877 I40E_IWARP_IRQ_PILE_ID);4878 I40E_IWARP_IRQ_PILE_ID);
@@ -10113,7 +10114,7 @@ static int i40e_get_capabilities(struct i40e_pf *pf, · 5235 unmodified lines
10113 if (pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOMEM) {10114 if (pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOMEM) {
10114 /* retry with a larger buffer */10115 /* retry with a larger buffer */
10115 buf_len = data_size;10116 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) {
10117 dev_info(&pf->pdev->dev,10118 dev_info(&pf->pdev->dev,
10118 "capability discovery failed, err %s aq_err %s\n",10119 "capability discovery failed, err %s aq_err %s\n",
10119 i40e_stat_str(&pf->hw, err),10120 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
1965 }1965 }
1966 adapter->aq_required = 0;1966 adapter->aq_required = 0;
1967 adapter->current_op = VIRTCHNL_OP_UNKNOWN;1967 adapter->current_op = VIRTCHNL_OP_UNKNOWN;
1968 mutex_unlock(&adapter->crit_lock);
1969 queue_delayed_work(iavf_wq,1968 queue_delayed_work(iavf_wq,
1970 &adapter->watchdog_task,1969 &adapter->watchdog_task,
1971 msecs_to_jiffies(10));1970 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
998}998}
999 999
1000struct ocelot_vcap_filter *1000struct ocelot_vcap_filter *
1001ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block, int cookie,1001ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block,
1002 bool tc_offload)1002 unsigned long cookie, bool tc_offload)
1003{1003{
1004 struct ocelot_vcap_filter *filter;1004 struct ocelot_vcap_filter *filter;
1005 1005
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
1293 if (err && err != -EEXIST) {1293 if (err && err != -EEXIST) {
1294 /* set the state back to NEW so we can try again later */1294 /* set the state back to NEW so we can try again later */
1295 f = ionic_rx_filter_by_addr(lif, addr);1295 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) {
1297 f->state = IONIC_FILTER_STATE_NEW;1297 f->state = IONIC_FILTER_STATE_NEW;
1298 set_bit(IONIC_LIF_F_FILTER_SYNC_NEEDED, lif->state);
1299 }
1298 1300
1299 spin_unlock_bh(&lif->rx_filters.lock);1301 spin_unlock_bh(&lif->rx_filters.lock);
1300 1302
drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c+0−3
@@ -349,9 +349,6 @@ loop_out: · 348 unmodified lines
349 list_for_each_entry_safe(sync_item, spos, &sync_add_list, list) {349 list_for_each_entry_safe(sync_item, spos, &sync_add_list, list) {
350 (void)ionic_lif_addr_add(lif, sync_item->f.cmd.mac.addr);350 (void)ionic_lif_addr_add(lif, sync_item->f.cmd.mac.addr);
351 351
352 if (sync_item->f.state != IONIC_FILTER_STATE_SYNCED)
353 set_bit(IONIC_LIF_F_FILTER_SYNC_NEEDED, lif->state);
354
355 list_del(&sync_item->list);352 list_del(&sync_item->list);
356 devm_kfree(dev, sync_item);353 devm_kfree(dev, sync_item);
357 }354 }
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c+5−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
21#include <linux/delay.h>21#include <linux/delay.h>
22#include <linux/mfd/syscon.h>22#include <linux/mfd/syscon.h>
23#include <linux/regmap.h>23#include <linux/regmap.h>
24#include <linux/pm_runtime.h>
24 25
25#include "stmmac_platform.h"26#include "stmmac_platform.h"
26 27
@@ -1528,6 +1529,8 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv) · 1501 unmodified lines
1528 return ret;1529 return ret;
1529 }1530 }
1530 1531
1532 pm_runtime_get_sync(dev);
1533
1531 if (bsp_priv->integrated_phy)1534 if (bsp_priv->integrated_phy)
1532 rk_gmac_integrated_phy_powerup(bsp_priv);1535 rk_gmac_integrated_phy_powerup(bsp_priv);
1533 1536
@@ -1539,6 +1542,8 @@ static void rk_gmac_powerdown(struct rk_priv_data *gmac) · 5 unmodified lines
1539 if (gmac->integrated_phy)1542 if (gmac->integrated_phy)
1540 rk_gmac_integrated_phy_powerdown(gmac);1543 rk_gmac_integrated_phy_powerdown(gmac);
1541 1544
1545 pm_runtime_put_sync(&gmac->pdev->dev);
1546
1542 phy_power_on(gmac, false);1547 phy_power_on(gmac, false);
1543 gmac_clk_enable(gmac, false);1548 gmac_clk_enable(gmac, false);
1544}1549}
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
477 stmmac_lpi_entry_timer_config(priv, 0);477 stmmac_lpi_entry_timer_config(priv, 0);
478 del_timer_sync(&priv->eee_ctrl_timer);478 del_timer_sync(&priv->eee_ctrl_timer);
479 stmmac_set_eee_timer(priv, priv->hw, 0, eee_tw_timer);479 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);
480 }484 }
481 mutex_unlock(&priv->lock);485 mutex_unlock(&priv->lock);
482 return false;486 return false;
@@ -1038,7 +1042,7 @@ static void stmmac_mac_link_down(struct phylink_config *config, · 555 unmodified lines
1038 stmmac_mac_set(priv, priv->ioaddr, false);1042 stmmac_mac_set(priv, priv->ioaddr, false);
1039 priv->eee_active = false;1043 priv->eee_active = false;
1040 priv->tx_lpi_enabled = false;1044 priv->tx_lpi_enabled = false;
1041 stmmac_eee_init(priv);1045 priv->eee_enabled = stmmac_eee_init(priv);
1042 stmmac_set_eee_pls(priv, priv->hw, false);1046 stmmac_set_eee_pls(priv, priv->hw, false);
1043 1047
1044 if (priv->dma_cap.fpesel)1048 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
666{666{
667 int ret;667 int ret;
668 668
669 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL0);
670 if (ret < 0)
671 return ret;
672
669 if (enable) {673 if (enable) {
670 /* Enable EEE */674 /* Enable EEE */
671 ret = DW_VR_MII_EEE_LTX_EN | DW_VR_MII_EEE_LRX_EN |675 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
673 DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL |677 DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL |
674 mult_fact_100ns << DW_VR_MII_EEE_MULT_FACT_100NS_SHIFT;678 mult_fact_100ns << DW_VR_MII_EEE_MULT_FACT_100NS_SHIFT;
675 } else {679 } else {
676 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL0);
677 if (ret < 0)
678 return ret;
679 ret &= ~(DW_VR_MII_EEE_LTX_EN | DW_VR_MII_EEE_LRX_EN |680 ret &= ~(DW_VR_MII_EEE_LTX_EN | DW_VR_MII_EEE_LRX_EN |
680 DW_VR_MII_EEE_TX_QUIET_EN | DW_VR_MII_EEE_RX_QUIET_EN |681 DW_VR_MII_EEE_TX_QUIET_EN | DW_VR_MII_EEE_RX_QUIET_EN |
681 DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL |682 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
690 if (ret < 0)691 if (ret < 0)
691 return ret;692 return ret;
692 693
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
694 return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL1, ret);699 return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL1, ret);
695}700}
696EXPORT_SYMBOL_GPL(xpcs_config_eee);701EXPORT_SYMBOL_GPL(xpcs_config_eee);
697 702
698static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, unsigned int mode)703static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, unsigned int mode)
699{704{
700 int ret;705 int ret, mdio_ctrl;
701 706
702 /* For AN for C37 SGMII mode, the settings are :-707 /* For AN for C37 SGMII mode, the settings are :-
703 * 1) VR_MII_AN_CTRL Bit(2:1)[PCS_MODE] = 10b (SGMII AN)708 * 1) VR_MII_MMD_CTRL Bit(12) [AN_ENABLE] = 0b (Disable SGMII AN in case
704 * 2) VR_MII_AN_CTRL Bit(3) [TX_CONFIG] = 0b (MAC side SGMII)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)
705 * DW xPCS used with DW EQoS MAC is always MAC side SGMII.712 * DW xPCS used with DW EQoS MAC is always MAC side SGMII.
706 * 3) VR_MII_DIG_CTRL1 Bit(9) [MAC_AUTO_SW] = 1b (Automatic713 * 4) VR_MII_DIG_CTRL1 Bit(9) [MAC_AUTO_SW] = 1b (Automatic
707 * speed/duplex mode change by HW after SGMII AN complete)714 * speed/duplex mode change by HW after SGMII AN complete)
715 * 5) VR_MII_MMD_CTRL Bit(12) [AN_ENABLE] = 1b (Enable SGMII AN)
708 *716 *
709 * Note: Since it is MAC side SGMII, there is no need to set717 * Note: Since it is MAC side SGMII, there is no need to set
710 * SR_MII_AN_ADV. MAC side SGMII receives AN Tx Config from718 * 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
712 * between PHY and Link Partner. There is also no need to720 * between PHY and Link Partner. There is also no need to
713 * trigger AN restart for MAC-side SGMII.721 * trigger AN restart for MAC-side SGMII.
714 */722 */
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
715 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL);734 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL);
716 if (ret < 0)735 if (ret < 0)
717 return ret;736 return ret;
@@ -736,7 +755,15 @@ static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, unsigned int mode) · 18 unmodified lines
736 else755 else
737 ret &= ~DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW;756 ret &= ~DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW;
738 757
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;
740}767}
741 768
742static int xpcs_config_2500basex(struct dw_xpcs *xpcs)769static 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
525 NULL == bus->read || NULL == bus->write)525 NULL == bus->read || NULL == bus->write)
526 return -EINVAL;526 return -EINVAL;
527 527
528 if (bus->parent && bus->parent->of_node)
529 bus->parent->of_node->fwnode.flags |=
530 FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD;
531
528 BUG_ON(bus->state != MDIOBUS_ALLOCATED &&532 BUG_ON(bus->state != MDIOBUS_ALLOCATED &&
529 bus->state != MDIOBUS_UNREGISTERED);533 bus->state != MDIOBUS_UNREGISTERED);
530 534
@@ -534,10 +538,16 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) · 3 unmodified lines
534 bus->dev.groups = NULL;538 bus->dev.groups = NULL;
535 dev_set_name(&bus->dev, "%s", bus->id);539 dev_set_name(&bus->dev, "%s", bus->id);
536 540
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
537 err = device_register(&bus->dev);548 err = device_register(&bus->dev);
538 if (err) {549 if (err) {
539 pr_err("mii_bus %s failed to register\n", bus->id);550 pr_err("mii_bus %s failed to register\n", bus->id);
540 put_device(&bus->dev);
541 return -EINVAL;551 return -EINVAL;
542 }552 }
543 553
drivers/net/phy/sfp.c+1−1
@@ -134,7 +134,7 @@ static const char * const sm_state_strings[] = { · 133 unmodified lines
134 [SFP_S_LINK_UP] = "link_up",134 [SFP_S_LINK_UP] = "link_up",
135 [SFP_S_TX_FAULT] = "tx_fault",135 [SFP_S_TX_FAULT] = "tx_fault",
136 [SFP_S_REINIT] = "reinit",136 [SFP_S_REINIT] = "reinit",
137 [SFP_S_TX_DISABLE] = "rx_disable",137 [SFP_S_TX_DISABLE] = "tx_disable",
138};138};
139 139
140static const char *sm_state_to_str(unsigned short sm_state)140static 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
767 PHY_RESET,767 PHY_RESET,
768 SCHEDULE_TASKLET,768 SCHEDULE_TASKLET,
769 GREEN_ETHERNET,769 GREEN_ETHERNET,
770 RX_EPROTO,
770};771};
771 772
772#define DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2 0x3082773#define DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2 0x3082
@@ -1770,6 +1771,14 @@ static void read_bulk_callback(struct urb *urb) · 997 unmodified lines
1770 rtl_set_unplug(tp);1771 rtl_set_unplug(tp);
1771 netif_device_detach(tp->netdev);1772 netif_device_detach(tp->netdev);
1772 return;1773 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;
1773 case -ENOENT:1782 case -ENOENT:
1774 return; /* the urb is in unlink state */1783 return; /* the urb is in unlink state */
1775 case -ETIME:1784 case -ETIME:
@@ -2425,6 +2434,7 @@ static int rx_bottom(struct r8152 *tp, int budget) · 649 unmodified lines
2425 if (list_empty(&tp->rx_done))2434 if (list_empty(&tp->rx_done))
2426 goto out1;2435 goto out1;
2427 2436
2437 clear_bit(RX_EPROTO, &tp->flags);
2428 INIT_LIST_HEAD(&rx_queue);2438 INIT_LIST_HEAD(&rx_queue);
2429 spin_lock_irqsave(&tp->rx_lock, flags);2439 spin_lock_irqsave(&tp->rx_lock, flags);
2430 list_splice_init(&tp->rx_done, &rx_queue);2440 list_splice_init(&tp->rx_done, &rx_queue);
@@ -2441,7 +2451,7 @@ static int rx_bottom(struct r8152 *tp, int budget) · 10 unmodified lines
2441 2451
2442 agg = list_entry(cursor, struct rx_agg, list);2452 agg = list_entry(cursor, struct rx_agg, list);
2443 urb = agg->urb;2453 urb = agg->urb;
2444 if (urb->actual_length < ETH_ZLEN)2454 if (urb->status != 0 || urb->actual_length < ETH_ZLEN)
2445 goto submit;2455 goto submit;
2446 2456
2447 agg_free = rtl_get_free_rx(tp, GFP_ATOMIC);2457 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
6643 netif_carrier_ok(tp->netdev))6653 netif_carrier_ok(tp->netdev))
6644 tasklet_schedule(&tp->tx_tl);6654 tasklet_schedule(&tp->tx_tl);
6645 6655
6656 if (test_and_clear_bit(RX_EPROTO, &tp->flags) &&
6657 !list_empty(&tp->rx_done))
6658 napi_schedule(&tp->napi);
6659
6646 mutex_unlock(&tp->control);6660 mutex_unlock(&tp->control);
6647 6661
6648out1:6662out1:
drivers/net/wireless/ath/ath5k/Kconfig+1−3
@@ -3,9 +3,7 @@ config ATH5K · 2 unmodified lines
3 tristate "Atheros 5xxx wireless cards support"3 tristate "Atheros 5xxx wireless cards support"
4 depends on (PCI || ATH25) && MAC802114 depends on (PCI || ATH25) && MAC80211
5 select ATH_COMMON5 select ATH_COMMON
6 select MAC80211_LEDS6 select MAC80211_LEDS if LEDS_CLASS=y || LEDS_CLASS=MAC80211
7 select LEDS_CLASS
8 select NEW_LEDS
9 select ATH5K_AHB if ATH257 select ATH5K_AHB if ATH25
10 select ATH5K_PCI if !ATH258 select ATH5K_PCI if !ATH25
11 help9 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
89 89
90void ath5k_led_enable(struct ath5k_hw *ah)90void ath5k_led_enable(struct ath5k_hw *ah)
91{91{
92 if (test_bit(ATH_STAT_LEDSOFT, ah->status)) {92 if (IS_ENABLED(CONFIG_MAC80211_LEDS) &&
93 test_bit(ATH_STAT_LEDSOFT, ah->status)) {
93 ath5k_hw_set_gpio_output(ah, ah->led_pin);94 ath5k_hw_set_gpio_output(ah, ah->led_pin);
94 ath5k_led_off(ah);95 ath5k_led_off(ah);
95 }96 }
@@ -104,7 +105,8 @@ static void ath5k_led_on(struct ath5k_hw *ah) · 8 unmodified lines
104 105
105void ath5k_led_off(struct ath5k_hw *ah)106void ath5k_led_off(struct ath5k_hw *ah)
106{107{
107 if (!test_bit(ATH_STAT_LEDSOFT, ah->status))108 if (!IS_ENABLED(CONFIG_MAC80211_LEDS) ||
109 !test_bit(ATH_STAT_LEDSOFT, ah->status))
108 return;110 return;
109 ath5k_hw_set_gpio(ah, ah->led_pin, !ah->led_on);111 ath5k_hw_set_gpio(ah, ah->led_pin, !ah->led_on);
110}112}
@@ -146,7 +148,7 @@ ath5k_register_led(struct ath5k_hw *ah, struct ath5k_led *led, · 35 unmodified lines
146static void148static void
147ath5k_unregister_led(struct ath5k_led *led)149ath5k_unregister_led(struct ath5k_led *led)
148{150{
149 if (!led->ah)151 if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !led->ah)
150 return;152 return;
151 led_classdev_unregister(&led->led_dev);153 led_classdev_unregister(&led->led_dev);
152 ath5k_led_off(led->ah);154 ath5k_led_off(led->ah);
@@ -169,7 +171,7 @@ int ath5k_init_leds(struct ath5k_hw *ah) · 16 unmodified lines
169 char name[ATH5K_LED_MAX_NAME_LEN + 1];171 char name[ATH5K_LED_MAX_NAME_LEN + 1];
170 const struct pci_device_id *match;172 const struct pci_device_id *match;
171 173
172 if (!ah->pdev)174 if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !ah->pdev)
173 return 0;175 return 0;
174 176
175#ifdef CONFIG_ATH5K_AHB177#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
7463 s32 found_index;7463 s32 found_index;
7464 int i;7464 int i;
7465 7465
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
7466 if ((alpha2[0] == ccreq->country_abbrev[0]) &&7472 if ((alpha2[0] == ccreq->country_abbrev[0]) &&
7467 (alpha2[1] == ccreq->country_abbrev[1])) {7473 (alpha2[1] == ccreq->country_abbrev[1])) {
7468 brcmf_dbg(TRACE, "Country code already set\n");7474 brcmf_dbg(TRACE, "Country code already set\n");
7469 return -EAGAIN;7475 return -EAGAIN;
7470 }7476 }
7471 7477
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
7483 found_index = -1;7478 found_index = -1;
7484 for (i = 0; i < country_codes->table_size; i++) {7479 for (i = 0; i < country_codes->table_size; i++) {
7485 cc = &country_codes->table[i];7480 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
160 mvm->ptk_icvlen = key->icv_len;160 mvm->ptk_icvlen = key->icv_len;
161 mvm->gtk_ivlen = key->iv_len;161 mvm->gtk_ivlen = key->iv_len;
162 mvm->gtk_icvlen = key->icv_len;162 mvm->gtk_icvlen = key->icv_len;
163 mutex_unlock(&mvm->mutex);
163 164
164 /* don't upload key again */165 /* don't upload key again */
165 return;166 return;
@@ -360,11 +361,11 @@ static void iwl_mvm_wowlan_get_rsc_v5_data(struct ieee80211_hw *hw, · 194 unmodified lines
360 if (sta) {361 if (sta) {
361 rsc = data->rsc->ucast_rsc;362 rsc = data->rsc->ucast_rsc;
362 } else {363 } else {
363 if (WARN_ON(data->gtks > ARRAY_SIZE(data->gtk_ids)))364 if (WARN_ON(data->gtks >= ARRAY_SIZE(data->gtk_ids)))
364 return;365 return;
365 data->gtk_ids[data->gtks] = key->keyidx;366 data->gtk_ids[data->gtks] = key->keyidx;
366 rsc = data->rsc->mcast_rsc[data->gtks % 2];367 rsc = data->rsc->mcast_rsc[data->gtks % 2];
367 if (WARN_ON(key->keyidx >368 if (WARN_ON(key->keyidx >=
368 ARRAY_SIZE(data->rsc->mcast_key_id_map)))369 ARRAY_SIZE(data->rsc->mcast_key_id_map)))
369 return;370 return;
370 data->rsc->mcast_key_id_map[key->keyidx] = data->gtks % 2;371 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
662 u32 *uid)662 u32 *uid)
663{663{
664 u32 id;664 u32 id;
665 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);665 struct iwl_mvm_vif *mvmvif;
666 enum nl80211_iftype iftype;666 enum nl80211_iftype iftype;
667 667
668 if (!te_data->vif)668 if (!te_data->vif)
669 return false;669 return false;
670 670
671 mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
671 iftype = te_data->vif->type;672 iftype = te_data->vif->type;
672 673
673 /*674 /*
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
547 IWL_DEV_INFO(0x43F0, 0x0074, iwl_ax201_cfg_qu_hr, NULL),547 IWL_DEV_INFO(0x43F0, 0x0074, iwl_ax201_cfg_qu_hr, NULL),
548 IWL_DEV_INFO(0x43F0, 0x0078, iwl_ax201_cfg_qu_hr, NULL),548 IWL_DEV_INFO(0x43F0, 0x0078, iwl_ax201_cfg_qu_hr, NULL),
549 IWL_DEV_INFO(0x43F0, 0x007C, iwl_ax201_cfg_qu_hr, NULL),549 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),
550 IWL_DEV_INFO(0x43F0, 0x2074, iwl_ax201_cfg_qu_hr, NULL),552 IWL_DEV_INFO(0x43F0, 0x2074, iwl_ax201_cfg_qu_hr, NULL),
551 IWL_DEV_INFO(0x43F0, 0x4070, iwl_ax201_cfg_qu_hr, NULL),553 IWL_DEV_INFO(0x43F0, 0x4070, iwl_ax201_cfg_qu_hr, NULL),
552 IWL_DEV_INFO(0xA0F0, 0x0070, iwl_ax201_cfg_qu_hr, NULL),554 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
62 62
63 pkt_type = mwifiex_is_skb_mgmt_frame(skb) ? PKT_TYPE_MGMT : 0;63 pkt_type = mwifiex_is_skb_mgmt_frame(skb) ? PKT_TYPE_MGMT : 0;
64 64
65 pad = ((void *)skb->data - (sizeof(*local_tx_pd) + hroom)-65 pad = ((uintptr_t)skb->data - (sizeof(*local_tx_pd) + hroom)) &
66 NULL) & (MWIFIEX_DMA_ALIGN_SZ - 1);66 (MWIFIEX_DMA_ALIGN_SZ - 1);
67 skb_push(skb, sizeof(*local_tx_pd) + pad);67 skb_push(skb, sizeof(*local_tx_pd) + pad);
68 68
69 local_tx_pd = (struct txpd *) skb->data;69 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
475 475
476 pkt_type = mwifiex_is_skb_mgmt_frame(skb) ? PKT_TYPE_MGMT : 0;476 pkt_type = mwifiex_is_skb_mgmt_frame(skb) ? PKT_TYPE_MGMT : 0;
477 477
478 pad = ((void *)skb->data - (sizeof(*txpd) + hroom) - NULL) &478 pad = ((uintptr_t)skb->data - (sizeof(*txpd) + hroom)) &
479 (MWIFIEX_DMA_ALIGN_SZ - 1);479 (MWIFIEX_DMA_ALIGN_SZ - 1);
480 480
481 skb_push(skb, sizeof(*txpd) + pad);481 skb_push(skb, sizeof(*txpd) + pad);
482 482
drivers/nvdimm/pmem.c+1−4
@@ -380,7 +380,6 @@ static int pmem_attach_disk(struct device *dev, · 379 unmodified lines
380 struct nd_pfn_sb *pfn_sb;380 struct nd_pfn_sb *pfn_sb;
381 struct pmem_device *pmem;381 struct pmem_device *pmem;
382 struct request_queue *q;382 struct request_queue *q;
383 struct device *gendev;
384 struct gendisk *disk;383 struct gendisk *disk;
385 void *addr;384 void *addr;
386 int rc;385 int rc;
@@ -489,10 +488,8 @@ static int pmem_attach_disk(struct device *dev, · 102 unmodified lines
489 }488 }
490 dax_write_cache(dax_dev, nvdimm_has_cache(nd_region));489 dax_write_cache(dax_dev, nvdimm_has_cache(nd_region));
491 pmem->dax_dev = dax_dev;490 pmem->dax_dev = dax_dev;
492 gendev = disk_to_dev(disk);
493 gendev->groups = pmem_attribute_groups;
494 491
495 device_add_disk(dev, disk, NULL);492 device_add_disk(dev, disk, pmem_attribute_groups);
496 if (devm_add_action_or_reset(dev, pmem_release_disk, pmem))493 if (devm_add_action_or_reset(dev, pmem_release_disk, pmem))
497 return -ENOMEM;494 return -ENOMEM;
498 495
drivers/nvme/host/core.c+3−1
@@ -978,6 +978,7 @@ EXPORT_SYMBOL_GPL(nvme_cleanup_cmd); · 977 unmodified lines
978blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req)978blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req)
979{979{
980 struct nvme_command *cmd = nvme_req(req)->cmd;980 struct nvme_command *cmd = nvme_req(req)->cmd;
981 struct nvme_ctrl *ctrl = nvme_req(req)->ctrl;
981 blk_status_t ret = BLK_STS_OK;982 blk_status_t ret = BLK_STS_OK;
982 983
983 if (!(req->rq_flags & RQF_DONTPREP)) {984 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
1026 return BLK_STS_IOERR;1027 return BLK_STS_IOERR;
1027 }1028 }
1028 1029
1029 nvme_req(req)->genctr++;1030 if (!(ctrl->quirks & NVME_QUIRK_SKIP_CID_GEN))
1031 nvme_req(req)->genctr++;
1030 cmd->common.command_id = nvme_cid(req);1032 cmd->common.command_id = nvme_cid(req);
1031 trace_nvme_setup_cmd(req, cmd);1033 trace_nvme_setup_cmd(req, cmd);
1032 return ret;1034 return ret;
drivers/nvme/host/nvme.h+6−0
@@ -138,6 +138,12 @@ enum nvme_quirks { · 137 unmodified lines
138 * 48 bits.138 * 48 bits.
139 */139 */
140 NVME_QUIRK_DMA_ADDRESS_BITS_48 = (1 << 16),140 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),
141};147};
142 148
143/*149/*
drivers/nvme/host/pci.c+2−1
@@ -3369,7 +3369,8 @@ static const struct pci_device_id nvme_id_table[] = { · 3368 unmodified lines
3369 { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2005),3369 { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2005),
3370 .driver_data = NVME_QUIRK_SINGLE_VECTOR |3370 .driver_data = NVME_QUIRK_SINGLE_VECTOR |
3371 NVME_QUIRK_128_BYTES_SQES |3371 NVME_QUIRK_128_BYTES_SQES |
3372 NVME_QUIRK_SHARED_TAGS },3372 NVME_QUIRK_SHARED_TAGS |
3373 NVME_QUIRK_SKIP_CID_GEN },
3373 3374
3374 { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },3375 { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
3375 { 0, }3376 { 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
3301 return 0;3301 return 0;
3302 3302
3303 if (!keep_devs) {3303 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);
3305 spin_lock_irqsave(&hbus->device_list_lock, flags);3308 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) {
3307 list_del(&hpdev->list_entry);3315 list_del(&hpdev->list_entry);
3308 if (hpdev->pci_slot)3316 if (hpdev->pci_slot)
3309 pci_destroy_slot(hpdev->pci_slot);3317 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
3311 put_pcichild(hpdev);3319 put_pcichild(hpdev);
3312 put_pcichild(hpdev);3320 put_pcichild(hpdev);
3313 }3321 }
3314 spin_unlock_irqrestore(&hbus->device_list_lock, flags);
3315 }3322 }
3316 3323
3317 ret = hv_send_resources_released(hdev);3324 ret = hv_send_resources_released(hdev);
drivers/ptp/ptp_kvm_x86.c+2−7
@@ -15,8 +15,6 @@ · 14 unmodified lines
15#include <linux/ptp_clock_kernel.h>15#include <linux/ptp_clock_kernel.h>
16#include <linux/ptp_kvm.h>16#include <linux/ptp_kvm.h>
17 17
18struct pvclock_vsyscall_time_info *hv_clock;
19
20static phys_addr_t clock_pair_gpa;18static phys_addr_t clock_pair_gpa;
21static struct kvm_clock_pairing clock_pair;19static struct kvm_clock_pairing clock_pair;
22 20
@@ -28,8 +26,7 @@ int kvm_arch_ptp_init(void) · 5 unmodified lines
28 return -ENODEV;26 return -ENODEV;
29 27
30 clock_pair_gpa = slow_virt_to_phys(&clock_pair);28 clock_pair_gpa = slow_virt_to_phys(&clock_pair);
31 hv_clock = pvclock_get_pvti_cpu0_va();29 if (!pvclock_get_pvti_cpu0_va())
32 if (!hv_clock)
33 return -ENODEV;30 return -ENODEV;
34 31
35 ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, clock_pair_gpa,32 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
64 struct pvclock_vcpu_time_info *src;61 struct pvclock_vcpu_time_info *src;
65 unsigned int version;62 unsigned int version;
66 long ret;63 long ret;
67 int cpu;
68 64
69 cpu = smp_processor_id();65 src = this_cpu_pvti();
70 src = &hv_clock[cpu].pvti;
71 66
72 do {67 do {
73 /*68 /*
drivers/ptp/ptp_pch.c+1−0
@@ -644,6 +644,7 @@ static const struct pci_device_id pch_ieee1588_pcidev_id[] = { · 643 unmodified lines
644 },644 },
645 {0}645 {0}
646};646};
647MODULE_DEVICE_TABLE(pci, pch_ieee1588_pcidev_id);
647 648
648static SIMPLE_DEV_PM_OPS(pch_pm_ops, pch_suspend, pch_resume);649static SIMPLE_DEV_PM_OPS(pch_pm_ops, pch_suspend, pch_resume);
649 650
drivers/s390/cio/blacklist.c+5−3
@@ -262,10 +262,12 @@ static int blacklist_parse_proc_parameters(char *buf) · 261 unmodified lines
262 262
263 if (strcmp("free", parm) == 0) {263 if (strcmp("free", parm) == 0) {
264 rc = blacklist_parse_parameters(buf, free, 0);264 rc = blacklist_parse_parameters(buf, free, 0);
265 /* There could be subchannels without proper devices connected.265 /*
266 * evaluate all the entries266 * 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.
267 */269 */
268 css_schedule_eval_all();270 css_schedule_eval_cond(CSS_EVAL_NOT_ONLINE, 0);
269 } else if (strcmp("add", parm) == 0)271 } else if (strcmp("add", parm) == 0)
270 rc = blacklist_parse_parameters(buf, add, 0);272 rc = blacklist_parse_parameters(buf, add, 0);
271 else if (strcmp("purge", parm) == 0)273 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
788 return 0;788 return 0;
789}789}
790 790
791void css_schedule_eval_all_unreg(unsigned long delay)791static 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
803void css_schedule_eval_cond(enum css_eval_cond cond, unsigned long delay)
792{804{
793 unsigned long flags;805 unsigned long flags;
794 struct idset *unreg_set;806 struct idset *set;
795 807
796 /* Find unregistered subchannels. */808 /* Find unregistered subchannels. */
797 unreg_set = idset_sch_new();809 set = idset_sch_new();
798 if (!unreg_set) {810 if (!set) {
799 /* Fallback. */811 /* Fallback. */
800 css_schedule_eval_all();812 css_schedule_eval_all();
801 return;813 return;
802 }814 }
803 idset_fill(unreg_set);815 idset_fill(set);
804 bus_for_each_dev(&css_bus_type, NULL, unreg_set, __unset_registered);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
805 /* Apply to slow_subchannel_set. */827 /* Apply to slow_subchannel_set. */
806 spin_lock_irqsave(&slow_subchannel_lock, flags);828 spin_lock_irqsave(&slow_subchannel_lock, flags);
807 idset_add_set(slow_subchannel_set, unreg_set);829 idset_add_set(slow_subchannel_set, set);
808 atomic_set(&css_eval_scheduled, 1);830 atomic_set(&css_eval_scheduled, 1);
809 queue_delayed_work(cio_work_q, &slow_path_work, delay);831 queue_delayed_work(cio_work_q, &slow_path_work, delay);
810 spin_unlock_irqrestore(&slow_subchannel_lock, flags);832 spin_unlock_irqrestore(&slow_subchannel_lock, flags);
811 idset_free(unreg_set);833 idset_free(set);
812}834}
813 835
814void css_wait_for_slow_path(void)836void css_wait_for_slow_path(void)
@@ -820,7 +842,7 @@ void css_wait_for_slow_path(void) · 5 unmodified lines
820void css_schedule_reprobe(void)842void css_schedule_reprobe(void)
821{843{
822 /* Schedule with a delay to allow merging of subsequent calls. */844 /* 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);
824}846}
825EXPORT_SYMBOL_GPL(css_schedule_reprobe);847EXPORT_SYMBOL_GPL(css_schedule_reprobe);
826 848
drivers/s390/cio/css.h+9−1
@@ -34,6 +34,14 @@ · 33 unmodified lines
34#define SNID_STATE3_MULTI_PATH 134#define SNID_STATE3_MULTI_PATH 1
35#define SNID_STATE3_SINGLE_PATH 035#define SNID_STATE3_SINGLE_PATH 0
36 36
37/*
38 * Conditions used to specify which subchannels need evaluation
39 */
40enum css_eval_cond {
41 CSS_EVAL_UNREG, /* unregistered subchannels */
42 CSS_EVAL_NOT_ONLINE /* sch without an online-device */
43};
44
37struct path_state {45struct path_state {
38 __u8 state1 : 2; /* path state value 1 */46 __u8 state1 : 2; /* path state value 1 */
39 __u8 state2 : 2; /* path state value 2 */47 __u8 state2 : 2; /* path state value 2 */
@@ -136,7 +144,7 @@ static inline struct channel_subsystem *css_by_id(u8 cssid) · 96 unmodified lines
136/* Helper functions to build lists for the slow path. */144/* Helper functions to build lists for the slow path. */
137void css_schedule_eval(struct subchannel_id schid);145void css_schedule_eval(struct subchannel_id schid);
138void css_schedule_eval_all(void);146void css_schedule_eval_all(void);
139void css_schedule_eval_all_unreg(unsigned long delay);147void css_schedule_eval_cond(enum css_eval_cond, unsigned long delay);
140int css_complete_work(void);148int css_complete_work(void);
141 149
142int sch_is_pseudo_sch(struct subchannel *);150int 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
1254MODULE_VERSION(CSIO_DRV_VERSION);1254MODULE_VERSION(CSIO_DRV_VERSION);
1255MODULE_FIRMWARE(FW_FNAME_T5);1255MODULE_FIRMWARE(FW_FNAME_T5);
1256MODULE_FIRMWARE(FW_FNAME_T6);1256MODULE_FIRMWARE(FW_FNAME_T6);
1257MODULE_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
2634 }2634 }
2635 2635
2636 if (unlikely(logit))2636 if (unlikely(logit))
2637 ql_log(ql_log_warn, fcport->vha, 0x5060,2637 ql_log(ql_dbg_io, fcport->vha, 0x5060,
2638 "NVME-%s ERR Handling - hdl=%x status(%x) tr_len:%x resid=%x ox_id=%x\n",2638 "NVME-%s ERR Handling - hdl=%x status(%x) tr_len:%x resid=%x ox_id=%x\n",
2639 sp->name, sp->handle, comp_status,2639 sp->name, sp->handle, comp_status,
2640 fd->transferred_length, le32_to_cpu(sts->residual_len),2640 fd->transferred_length, le32_to_cpu(sts->residual_len),
@@ -3491,7 +3491,7 @@ check_scsi_status: · 850 unmodified lines
3491 3491
3492out:3492out:
3493 if (logit)3493 if (logit)
3494 ql_log(ql_log_warn, fcport->vha, 0x3022,3494 ql_log(ql_dbg_io, fcport->vha, 0x3022,
3495 "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",3495 "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",
3496 comp_status, scsi_status, res, vha->host_no,3496 comp_status, scsi_status, res, vha->host_no,
3497 cp->device->id, cp->device->lun, fcport->d_id.b.domain,3497 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
118static int ses_send_diag(struct scsi_device *sdev, int page_code,118static int ses_send_diag(struct scsi_device *sdev, int page_code,
119 void *buf, int bufflen)119 void *buf, int bufflen)
120{120{
121 u32 result;121 int result;
122 122
123 unsigned char cmd[] = {123 unsigned char cmd[] = {
124 SEND_DIAGNOSTIC,124 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
318static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int tag,318static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int tag,
319 enum ufs_trace_str_t str_t)319 enum ufs_trace_str_t str_t)
320{320{
321 int off = (int)tag - hba->nutrs;321 struct utp_task_req_desc *descp = &hba->utmrdl_base_addr[tag];
322 struct utp_task_req_desc *descp = &hba->utmrdl_base_addr[off];
323 322
324 if (!trace_ufshcd_upiu_enabled())323 if (!trace_ufshcd_upiu_enabled())
325 return;324 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
300 }300 }
301 break;301 break;
302 default:302 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);
304 }304 }
305}305}
306 306
@@ -392,7 +392,7 @@ static void virtscsi_handle_event(struct work_struct *work) · 85 unmodified lines
392 virtscsi_handle_param_change(vscsi, event);392 virtscsi_handle_param_change(vscsi, event);
393 break;393 break;
394 default:394 default:
395 pr_err("Unsupport virtio scsi event %x\n", event->event);395 pr_err("Unsupported virtio scsi event %x\n", event->event);
396 }396 }
397 virtscsi_kick_event(vscsi, event_node);397 virtscsi_kick_event(vscsi, event_node);
398}398}
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
98 if (ehdr->e_phnum < 2)98 if (ehdr->e_phnum < 2)
99 return ERR_PTR(-EINVAL);99 return ERR_PTR(-EINVAL);
100 100
101 if (phdrs[0].p_type == PT_LOAD || phdrs[1].p_type == PT_LOAD)101 if (phdrs[0].p_type == PT_LOAD)
102 return ERR_PTR(-EINVAL);102 return ERR_PTR(-EINVAL);
103 103
104 if ((phdrs[1].p_flags & QCOM_MDT_TYPE_MASK) != QCOM_MDT_TYPE_HASH)104 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
628 /* Feed the soc specific unique data into entropy pool */628 /* Feed the soc specific unique data into entropy pool */
629 add_device_randomness(info, item_size);629 add_device_randomness(info, item_size);
630 630
631 platform_set_drvdata(pdev, qs->soc_dev);631 platform_set_drvdata(pdev, qs);
632 632
633 return 0;633 return 0;
634}634}
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
825 writel_relaxed(v, reset->prm->base + reset->prm->data->rstctrl);825 writel_relaxed(v, reset->prm->base + reset->prm->data->rstctrl);
826 spin_unlock_irqrestore(&reset->lock, flags);826 spin_unlock_irqrestore(&reset->lock, flags);
827 827
828 if (!has_rstst)828 /* wait for the reset bit to clear */
829 goto exit;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);
830 836
831 /* wait for the status to be set */837 /* 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 +
833 reset->prm->data->rstst,840 reset->prm->data->rstst,
834 v, v & BIT(st_bit), 1,841 v, v & BIT(st_bit), 1,
835 OMAP_RESET_MAX_WAIT);842 OMAP_RESET_MAX_WAIT);
836 if (ret)843 if (ret)
837 pr_err("%s: timedout waiting for %s:%lu\n", __func__,844 pr_err("%s: timedout waiting for %s:%lu\n", __func__,
838 reset->prm->data->name, id);845 reset->prm->data->name, id);
846 }
839 847
840exit:848 if (reset->clkdm)
841 if (reset->clkdm) {
842 /* At least dra7 iva needs a delay before clkdm idle */
843 if (has_rstst)
844 udelay(1);
845 pdata->clkdm_allow_idle(reset->clkdm);849 pdata->clkdm_allow_idle(reset->clkdm);
846 }
847 850
848 return ret;851 return ret;
849}852}
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
1646 default:1646 default:
1647 return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;1647 return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED;
1648 }1648 }
1649
1650 return INPUT_SYSTEM_ERR_NO_ERROR;
1649}1651}
1650 1652
1651// Test flags and set structure.1653// 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
35 unsigned int nr_pages = 1 << order, i;35 unsigned int nr_pages = 1 << order, i;
36 struct page **pages;36 struct page **pages;
37 37
38 pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL);38 pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL);
39 if (!pages) {39 if (!pages) {
40 rc = -ENOMEM;40 rc = -ENOMEM;
41 goto err;41 goto err;
drivers/usb/host/ohci-omap.c+2−70
@@ -40,17 +40,6 @@ · 39 unmodified lines
40#include <mach/usb.h>40#include <mach/usb.h>
41 41
42 42
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
54#define DRIVER_DESC "OHCI OMAP driver"43#define DRIVER_DESC "OHCI OMAP driver"
55 44
56struct ohci_omap_priv {45struct ohci_omap_priv {
@@ -104,61 +93,6 @@ static int omap_ohci_transceiver_power(struct ohci_omap_priv *priv, int on) · 47 unmodified lines
104 return 0;93 return 0;
105}94}
106 95
107#ifdef CONFIG_ARCH_OMAP15XX
108/*
109 * OMAP-1510 specific Local Bus clock on/off
110 */
111static 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 */
130static 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
162#ifdef CONFIG_USB_OTG96#ifdef CONFIG_USB_OTG
163 97
164static void start_hnp(struct ohci_hcd *ohci)98static void start_hnp(struct ohci_hcd *ohci)
@@ -229,10 +163,8 @@ static int ohci_omap_reset(struct usb_hcd *hcd) · 64 unmodified lines
229 163
230 omap_ohci_clock_power(priv, 1);164 omap_ohci_clock_power(priv, 1);
231 165
232 if (cpu_is_omap15xx()) {166 if (config->lb_reset)
233 omap_1510_local_bus_power(1);167 config->lb_reset();
234 omap_1510_local_bus_init();
235 }
236 168
237 ret = ohci_setup(hcd);169 ret = ohci_setup(hcd);
238 if (ret < 0)170 if (ret < 0)
fs/9p/cache.c+4−4
@@ -23,7 +23,7 @@ struct fscache_netfs v9fs_cache_netfs = { · 22 unmodified lines
23 .version = 0,23 .version = 0,
24};24};
25 25
26/**26/*
27 * v9fs_random_cachetag - Generate a random tag to be associated27 * v9fs_random_cachetag - Generate a random tag to be associated
28 * with a new cache session.28 * with a new cache session.
29 *29 *
@@ -233,7 +233,7 @@ static void v9fs_vfs_readpage_complete(struct page *page, void *data, · 203 unmodified lines
233 unlock_page(page);233 unlock_page(page);
234}234}
235 235
236/**236/*
237 * __v9fs_readpage_from_fscache - read a page from cache237 * __v9fs_readpage_from_fscache - read a page from cache
238 *238 *
239 * Returns 0 if the pages are in cache and a BIO is submitted,239 * 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
268 }268 }
269}269}
270 270
271/**271/*
272 * __v9fs_readpages_from_fscache - read multiple pages from cache272 * __v9fs_readpages_from_fscache - read multiple pages from cache
273 *273 *
274 * Returns 0 if the pages are in cache and a BIO is submitted,274 * 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
308 }308 }
309}309}
310 310
311/**311/*
312 * __v9fs_readpage_to_fscache - write a page to the cache312 * __v9fs_readpage_to_fscache - write a page to the cache
313 *313 *
314 */314 */
fs/9p/fid.c+7−7
@@ -19,18 +19,18 @@ · 18 unmodified lines
19#include "v9fs_vfs.h"19#include "v9fs_vfs.h"
20#include "fid.h"20#include "fid.h"
21 21
22static 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
22/**28/**
23 * v9fs_fid_add - add a fid to a dentry29 * v9fs_fid_add - add a fid to a dentry
24 * @dentry: dentry that the fid is being added to30 * @dentry: dentry that the fid is being added to
25 * @fid: fid to add31 * @fid: fid to add
26 *32 *
27 */33 */
28
29static 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
34void v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)34void v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid)
35{35{
36 spin_lock(&dentry->d_lock);36 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
67 67
68/**68/**
69 * v9fs_open_fid_add - add an open fid to an inode69 * v9fs_open_fid_add - add an open fid to an inode
70 * @dentry: inode that the fid is being added to70 * @inode: inode that the fid is being added to
71 * @fid: fid to add71 * @fid: fid to add
72 *72 *
73 */73 */
fs/9p/v9fs.c+3−5
@@ -155,6 +155,7 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root) · 154 unmodified lines
155/**155/**
156 * v9fs_parse_options - parse mount options into session structure156 * v9fs_parse_options - parse mount options into session structure
157 * @v9ses: existing v9fs session information157 * @v9ses: existing v9fs session information
158 * @opts: The mount option string
158 *159 *
159 * Return 0 upon success, -ERRNO upon failure.160 * Return 0 upon success, -ERRNO upon failure.
160 */161 */
@@ -542,12 +543,9 @@ extern int v9fs_error_init(void); · 381 unmodified lines
542static struct kobject *v9fs_kobj;543static struct kobject *v9fs_kobj;
543 544
544#ifdef CONFIG_9P_FSCACHE545#ifdef CONFIG_9P_FSCACHE
545/**546/*
546 * caches_show - list caches associated with a session547 * List caches associated with a session
547 *
548 * Returns the size of buffer written.
549 */548 */
550
551static ssize_t caches_show(struct kobject *kobj,549static ssize_t caches_show(struct kobject *kobj,
552 struct kobj_attribute *attr,550 struct kobj_attribute *attr,
553 char *buf)551 char *buf)
fs/9p/vfs_addr.c+9−5
@@ -30,8 +30,7 @@ · 29 unmodified lines
30 30
31/**31/**
32 * v9fs_fid_readpage - read an entire page in from 9P32 * v9fs_fid_readpage - read an entire page in from 9P
33 *33 * @data: Opaque pointer to the fid being read
34 * @fid: fid being read
35 * @page: structure to page34 * @page: structure to page
36 *35 *
37 */36 */
@@ -116,6 +115,8 @@ static int v9fs_vfs_readpages(struct file *filp, struct address_space *mapping, · 78 unmodified lines
116 115
117/**116/**
118 * v9fs_release_page - release the private state associated with a page117 * 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
119 *120 *
120 * Returns 1 if the page can be released, false otherwise.121 * Returns 1 if the page can be released, false otherwise.
121 */122 */
@@ -129,9 +130,9 @@ static int v9fs_release_page(struct page *page, gfp_t gfp) · 7 unmodified lines
129 130
130/**131/**
131 * v9fs_invalidate_page - Invalidate a page completely or partially132 * v9fs_invalidate_page - Invalidate a page completely or partially
132 *133 * @page: The page to be invalidated
133 * @page: structure to page134 * @offset: offset of the invalidated region
134 * @offset: offset in the page135 * @length: length of the invalidated region
135 */136 */
136 137
137static void v9fs_invalidate_page(struct page *page, unsigned int offset,138static 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
199 200
200/**201/**
201 * v9fs_launder_page - Writeback a dirty page202 * v9fs_launder_page - Writeback a dirty page
203 * @page: The page to be cleaned up
204 *
202 * Returns 0 on success.205 * Returns 0 on success.
203 */206 */
204 207
@@ -219,6 +222,7 @@ static int v9fs_launder_page(struct page *page) · 14 unmodified lines
219/**222/**
220 * v9fs_direct_IO - 9P address space operation for direct I/O223 * v9fs_direct_IO - 9P address space operation for direct I/O
221 * @iocb: target I/O control block224 * @iocb: target I/O control block
225 * @iter: The data/buffer to use
222 *226 *
223 * The presence of v9fs_direct_IO() in the address space ops vector227 * The presence of v9fs_direct_IO() in the address space ops vector
224 * allowes open() O_DIRECT flags which would have failed otherwise.228 * 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
359}359}
360 360
361/**361/**
362 * v9fs_file_read - read from a file362 * v9fs_file_read_iter - read from a file
363 * @filp: file pointer to read363 * @iocb: The operation parameters
364 * @udata: user data buffer to read data into364 * @to: The buffer to read into
365 * @count: size of buffer
366 * @offset: offset at which to read data
367 *365 *
368 */366 */
369
370static ssize_t367static ssize_t
371v9fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)368v9fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
372{369{
@@ -388,11 +385,9 @@ v9fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) · 15 unmodified lines
388}385}
389 386
390/**387/**
391 * v9fs_file_write - write to a file388 * v9fs_file_write_iter - write to a file
392 * @filp: file pointer to write389 * @iocb: The operation parameters
393 * @data: data buffer to write data from390 * @from: The data to write
394 * @count: size of buffer
395 * @offset: offset at which to write data
396 *391 *
397 */392 */
398static ssize_t393static ssize_t
@@ -561,11 +556,9 @@ out_unlock: · 162 unmodified lines
561}556}
562 557
563/**558/**
564 * v9fs_mmap_file_read - read from a file559 * v9fs_mmap_file_read_iter - read from a file
565 * @filp: file pointer to read560 * @iocb: The operation parameters
566 * @data: user data buffer to read data into561 * @to: The buffer to read into
567 * @count: size of buffer
568 * @offset: offset at which to read data
569 *562 *
570 */563 */
571static ssize_t564static ssize_t
@@ -576,11 +569,9 @@ v9fs_mmap_file_read_iter(struct kiocb *iocb, struct iov_iter *to) · 4 unmodified lines
576}569}
577 570
578/**571/**
579 * v9fs_mmap_file_write - write to a file572 * v9fs_mmap_file_write_iter - write to a file
580 * @filp: file pointer to write573 * @iocb: The operation parameters
581 * @data: data buffer to write data from574 * @from: The data to write
582 * @count: size of buffer
583 * @offset: offset at which to write data
584 *575 *
585 */576 */
586static ssize_t577static ssize_t
fs/9p/vfs_inode.c+16−8
@@ -218,7 +218,7 @@ v9fs_blank_wstat(struct p9_wstat *wstat) · 217 unmodified lines
218 218
219/**219/**
220 * v9fs_alloc_inode - helper function to allocate an inode220 * v9fs_alloc_inode - helper function to allocate an inode
221 *221 * @sb: The superblock to allocate the inode from
222 */222 */
223struct inode *v9fs_alloc_inode(struct super_block *sb)223struct inode *v9fs_alloc_inode(struct super_block *sb)
224{224{
@@ -238,7 +238,7 @@ struct inode *v9fs_alloc_inode(struct super_block *sb) · 13 unmodified lines
238 238
239/**239/**
240 * v9fs_free_inode - destroy an inode240 * v9fs_free_inode - destroy an inode
241 *241 * @inode: The inode to be freed
242 */242 */
243 243
244void v9fs_free_inode(struct inode *inode)244void v9fs_free_inode(struct inode *inode)
@@ -343,7 +343,7 @@ error: · 98 unmodified lines
343 * v9fs_get_inode - helper function to setup an inode343 * v9fs_get_inode - helper function to setup an inode
344 * @sb: superblock344 * @sb: superblock
345 * @mode: mode to setup inode with345 * @mode: mode to setup inode with
346 *346 * @rdev: The device numbers to set
347 */347 */
348 348
349struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t rdev)349struct 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
369}369}
370 370
371/**371/**
372 * v9fs_clear_inode - release an inode372 * v9fs_evict_inode - Remove an inode from the inode cache
373 * @inode: inode to release373 * @inode: inode to release
374 *374 *
375 */375 */
@@ -665,14 +665,15 @@ error: · 289 unmodified lines
665 665
666/**666/**
667 * v9fs_vfs_create - VFS hook to create a regular file667 * 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
668 *673 *
669 * open(.., O_CREAT) is handled in v9fs_vfs_atomic_open(). This is only called674 * open(.., O_CREAT) is handled in v9fs_vfs_atomic_open(). This is only called
670 * for mknod(2).675 * for mknod(2).
671 *676 *
672 * @dir: directory inode that is being created
673 * @dentry: dentry that is being deleted
674 * @mode: create permissions
675 *
676 */677 */
677 678
678static int679static int
@@ -696,6 +697,7 @@ v9fs_vfs_create(struct user_namespace *mnt_userns, struct inode *dir, · 17 unmodified lines
696 697
697/**698/**
698 * v9fs_vfs_mkdir - VFS mkdir hook to create a directory699 * v9fs_vfs_mkdir - VFS mkdir hook to create a directory
700 * @mnt_userns: The user namespace of the mount
699 * @dir: inode that is being unlinked701 * @dir: inode that is being unlinked
700 * @dentry: dentry that is being unlinked702 * @dentry: dentry that is being unlinked
701 * @mode: mode for new directory703 * @mode: mode for new directory
@@ -900,10 +902,12 @@ int v9fs_vfs_rmdir(struct inode *i, struct dentry *d) · 198 unmodified lines
900 902
901/**903/**
902 * v9fs_vfs_rename - VFS hook to rename an inode904 * v9fs_vfs_rename - VFS hook to rename an inode
905 * @mnt_userns: The user namespace of the mount
903 * @old_dir: old dir inode906 * @old_dir: old dir inode
904 * @old_dentry: old dentry907 * @old_dentry: old dentry
905 * @new_dir: new dir inode908 * @new_dir: new dir inode
906 * @new_dentry: new dentry909 * @new_dentry: new dentry
910 * @flags: RENAME_* flags
907 *911 *
908 */912 */
909 913
@@ -1009,6 +1013,7 @@ done: · 99 unmodified lines
1009 1013
1010/**1014/**
1011 * v9fs_vfs_getattr - retrieve file metadata1015 * v9fs_vfs_getattr - retrieve file metadata
1016 * @mnt_userns: The user namespace of the mount
1012 * @path: Object to query1017 * @path: Object to query
1013 * @stat: metadata structure to populate1018 * @stat: metadata structure to populate
1014 * @request_mask: Mask of STATX_xxx flags indicating the caller's interests1019 * @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
1050 1055
1051/**1056/**
1052 * v9fs_vfs_setattr - set file metadata1057 * v9fs_vfs_setattr - set file metadata
1058 * @mnt_userns: The user namespace of the mount
1053 * @dentry: file whose metadata to set1059 * @dentry: file whose metadata to set
1054 * @iattr: metadata assignment structure1060 * @iattr: metadata assignment structure
1055 *1061 *
@@ -1285,6 +1291,7 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry, · 229 unmodified lines
1285 1291
1286/**1292/**
1287 * v9fs_vfs_symlink - helper function to create symlinks1293 * v9fs_vfs_symlink - helper function to create symlinks
1294 * @mnt_userns: The user namespace of the mount
1288 * @dir: directory inode containing symlink1295 * @dir: directory inode containing symlink
1289 * @dentry: dentry for symlink1296 * @dentry: dentry for symlink
1290 * @symname: symlink data1297 * @symname: symlink data
@@ -1340,6 +1347,7 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir, · 49 unmodified lines
1340 1347
1341/**1348/**
1342 * v9fs_vfs_mknod - create a special file1349 * v9fs_vfs_mknod - create a special file
1350 * @mnt_userns: The user namespace of the mount
1343 * @dir: inode destination for new link1351 * @dir: inode destination for new link
1344 * @dentry: dentry for file1352 * @dentry: dentry for file
1345 * @mode: mode for creation1353 * @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
37 struct dentry *dentry, umode_t omode, dev_t rdev);37 struct dentry *dentry, umode_t omode, dev_t rdev);
38 38
39/**39/**
40 * v9fs_get_fsgid_for_create - Helper function to get the gid for creating a40 * 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
41 * new file system object. This checks the S_ISGID to determine the owning44 * new file system object. This checks the S_ISGID to determine the owning
42 * group of the new file system object.45 * group of the new file system object.
43 */46 */
@@ -211,12 +214,13 @@ int v9fs_open_to_dotl_flags(int flags) · 167 unmodified lines
211 214
212/**215/**
213 * v9fs_vfs_create_dotl - VFS hook to create files for 9P2000.L protocol.216 * v9fs_vfs_create_dotl - VFS hook to create files for 9P2000.L protocol.
217 * @mnt_userns: The user namespace of the mount
214 * @dir: directory inode that is being created218 * @dir: directory inode that is being created
215 * @dentry: dentry that is being deleted219 * @dentry: dentry that is being deleted
216 * @omode: create permissions220 * @omode: create permissions
221 * @excl: True if the file must not yet exist
217 *222 *
218 */223 */
219
220static int224static int
221v9fs_vfs_create_dotl(struct user_namespace *mnt_userns, struct inode *dir,225v9fs_vfs_create_dotl(struct user_namespace *mnt_userns, struct inode *dir,
222 struct dentry *dentry, umode_t omode, bool excl)226 struct dentry *dentry, umode_t omode, bool excl)
@@ -361,6 +365,7 @@ err_clunk_old_fid: · 138 unmodified lines
361 365
362/**366/**
363 * v9fs_vfs_mkdir_dotl - VFS mkdir hook to create a directory367 * v9fs_vfs_mkdir_dotl - VFS mkdir hook to create a directory
368 * @mnt_userns: The user namespace of the mount
364 * @dir: inode that is being unlinked369 * @dir: inode that is being unlinked
365 * @dentry: dentry that is being unlinked370 * @dentry: dentry that is being unlinked
366 * @omode: mode for new directory371 * @omode: mode for new directory
@@ -537,6 +542,7 @@ static int v9fs_mapped_iattr_valid(int iattr_valid) · 170 unmodified lines
537 542
538/**543/**
539 * v9fs_vfs_setattr_dotl - set file metadata544 * v9fs_vfs_setattr_dotl - set file metadata
545 * @mnt_userns: The user namespace of the mount
540 * @dentry: file whose metadata to set546 * @dentry: file whose metadata to set
541 * @iattr: metadata assignment structure547 * @iattr: metadata assignment structure
542 *548 *
@@ -816,6 +822,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir, · 273 unmodified lines
816 822
817/**823/**
818 * v9fs_vfs_mknod_dotl - create a special file824 * v9fs_vfs_mknod_dotl - create a special file
825 * @mnt_userns: The user namespace of the mount
819 * @dir: inode destination for new link826 * @dir: inode destination for new link
820 * @dentry: dentry for file827 * @dentry: dentry for file
821 * @omode: mode for creation828 * @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
86 return afs_do_sync_operation(op);86 return afs_do_sync_operation(op);
87}87}
88 88
89/**89/*
90 * afs_sillyrename - Perform a silly-rename of a dentry90 * Perform silly-rename of a dentry.
91 *91 *
92 * AFS is stateless and the server doesn't know when the client is holding a92 * AFS is stateless and the server doesn't know when the client is holding a
93 * file open. To prevent application problems when a file is unlinked while93 * 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
974 iov_iter_bvec(&iter, WRITE, bv, 1, bv[0].bv_len);974 iov_iter_bvec(&iter, WRITE, bv, 1, bv[0].bv_len);
975 975
976 trace_afs_page_dirty(vnode, tracepoint_string("launder"), page);976 trace_afs_page_dirty(vnode, tracepoint_string("launder"), page);
977 ret = afs_store_data(vnode, &iter, (loff_t)page->index * PAGE_SIZE,977 ret = afs_store_data(vnode, &iter, page_offset(page) + f, true);
978 true);
979 }978 }
980 979
981 trace_afs_page_dirty(vnode, tracepoint_string("laundered"), page);980 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
630 630
631 vaddr = eppnt->p_vaddr;631 vaddr = eppnt->p_vaddr;
632 if (interp_elf_ex->e_type == ET_EXEC || load_addr_set)632 if (interp_elf_ex->e_type == ET_EXEC || load_addr_set)
633 elf_type |= MAP_FIXED_NOREPLACE;633 elf_type |= MAP_FIXED;
634 else if (no_base && interp_elf_ex->e_type == ET_DYN)634 else if (no_base && interp_elf_ex->e_type == ET_DYN)
635 load_addr = -vaddr;635 load_addr = -vaddr;
636 636
fs/debugfs/inode.c+1−1
@@ -528,7 +528,7 @@ void debugfs_create_file_size(const char *name, umode_t mode, · 527 unmodified lines
528{528{
529 struct dentry *de = debugfs_create_file(name, mode, parent, data, fops);529 struct dentry *de = debugfs_create_file(name, mode, parent, data, fops);
530 530
531 if (de)531 if (!IS_ERR(de))
532 d_inode(de)->i_size = file_size;532 d_inode(de)->i_size = file_size;
533}533}
534EXPORT_SYMBOL_GPL(debugfs_create_file_size);534EXPORT_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
551 struct dir_private_info *info = file->private_data;551 struct dir_private_info *info = file->private_data;
552 struct inode *inode = file_inode(file);552 struct inode *inode = file_inode(file);
553 struct fname *fname;553 struct fname *fname;
554 int ret;554 int ret = 0;
555 555
556 if (!info) {556 if (!info) {
557 info = ext4_htree_create_dir_info(file, ctx->pos);557 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
599 info->curr_minor_hash,599 info->curr_minor_hash,
600 &info->next_hash);600 &info->next_hash);
601 if (ret < 0)601 if (ret < 0)
602 return ret;602 goto finished;
603 if (ret == 0) {603 if (ret == 0) {
604 ctx->pos = ext4_get_htree_eof(file);604 ctx->pos = ext4_get_htree_eof(file);
605 break;605 break;
@@ -630,7 +630,7 @@ static int ext4_dx_readdir(struct file *file, struct dir_context *ctx) · 24 unmodified lines
630 }630 }
631finished:631finished:
632 info->last_pos = ctx->pos;632 info->last_pos = ctx->pos;
633 return 0;633 return ret < 0 ? ret : 0;
634}634}
635 635
636static int ext4_release_dir(struct inode *inode, struct file *filp)636static 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
3593 unsigned flags,3593 unsigned flags,
3594 struct page **pagep,3594 struct page **pagep,
3595 void **fsdata);3595 void **fsdata);
3596extern int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos,
3597 unsigned len, unsigned copied,
3598 struct page *page);
3599extern int ext4_try_add_inline_entry(handle_t *handle,3596extern int ext4_try_add_inline_entry(handle_t *handle,
3600 struct ext4_filename *fname,3597 struct ext4_filename *fname,
3601 struct inode *dir, struct inode *inode);3598 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
5916}5916}
5917 5917
5918/* Check if *cur is a hole and if it is, skip it */5918/* Check if *cur is a hole and if it is, skip it */
5919static void skip_hole(struct inode *inode, ext4_lblk_t *cur)5919static int skip_hole(struct inode *inode, ext4_lblk_t *cur)
5920{5920{
5921 int ret;5921 int ret;
5922 struct ext4_map_blocks map;5922 struct ext4_map_blocks map;
@@ -5925,9 +5925,12 @@ static void skip_hole(struct inode *inode, ext4_lblk_t *cur) · 2 unmodified lines
5925 map.m_len = ((inode->i_size) >> inode->i_sb->s_blocksize_bits) - *cur;5925 map.m_len = ((inode->i_size) >> inode->i_sb->s_blocksize_bits) - *cur;
5926 5926
5927 ret = ext4_map_blocks(NULL, inode, &map, 0);5927 ret = ext4_map_blocks(NULL, inode, &map, 0);
5928 if (ret < 0)
5929 return ret;
5928 if (ret != 0)5930 if (ret != 0)
5929 return;5931 return 0;
5930 *cur = *cur + map.m_len;5932 *cur = *cur + map.m_len;
5933 return 0;
5931}5934}
5932 5935
5933/* Count number of blocks used by this inode and update i_blocks */5936/* 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
5976 * iblocks by total number of differences found.5979 * iblocks by total number of differences found.
5977 */5980 */
5978 cur = 0;5981 cur = 0;
5979 skip_hole(inode, &cur);5982 ret = skip_hole(inode, &cur);
5983 if (ret < 0)
5984 goto out;
5980 path = ext4_find_extent(inode, cur, NULL, 0);5985 path = ext4_find_extent(inode, cur, NULL, 0);
5981 if (IS_ERR(path))5986 if (IS_ERR(path))
5982 goto out;5987 goto out;
@@ -5995,8 +6000,12 @@ int ext4_ext_replay_set_iblocks(struct inode *inode) · 12 unmodified lines
5995 }6000 }
5996 cur = max(cur + 1, le32_to_cpu(ex->ee_block) +6001 cur = max(cur + 1, le32_to_cpu(ex->ee_block) +
5997 ext4_ext_get_actual_len(ex));6002 ext4_ext_get_actual_len(ex));
5998 skip_hole(inode, &cur);6003 ret = skip_hole(inode, &cur);
5999 6004 if (ret < 0) {
6005 ext4_ext_drop_refs(path);
6006 kfree(path);
6007 break;
6008 }
6000 path2 = ext4_find_extent(inode, cur, NULL, 0);6009 path2 = ext4_find_extent(inode, cur, NULL, 0);
6001 if (IS_ERR(path2)) {6010 if (IS_ERR(path2)) {
6002 ext4_ext_drop_refs(path);6011 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
892 sizeof(lrange), (u8 *)&lrange, crc))892 sizeof(lrange), (u8 *)&lrange, crc))
893 return -ENOSPC;893 return -ENOSPC;
894 } else {894 } 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
895 fc_ext.fc_ino = cpu_to_le32(inode->i_ino);901 fc_ext.fc_ino = cpu_to_le32(inode->i_ino);
896 ex = (struct ext4_extent *)&fc_ext.fc_ex;902 ex = (struct ext4_extent *)&fc_ext.fc_ex;
897 ex->ee_block = cpu_to_le32(map.m_lblk);903 ex->ee_block = cpu_to_le32(map.m_lblk);
fs/ext4/inline.c+85−65
@@ -7,6 +7,7 @@ · 6 unmodified lines
7#include <linux/iomap.h>7#include <linux/iomap.h>
8#include <linux/fiemap.h>8#include <linux/fiemap.h>
9#include <linux/iversion.h>9#include <linux/iversion.h>
10#include <linux/backing-dev.h>
10 11
11#include "ext4_jbd2.h"12#include "ext4_jbd2.h"
12#include "ext4.h"13#include "ext4.h"
@@ -733,45 +734,83 @@ convert: · 720 unmodified lines
733int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,734int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len,
734 unsigned copied, struct page *page)735 unsigned copied, struct page *page)
735{736{
736 int ret, no_expand;737 handle_t *handle = ext4_journal_current_handle();
738 int no_expand;
737 void *kaddr;739 void *kaddr;
738 struct ext4_iloc iloc;740 struct ext4_iloc iloc;
741 int ret = 0, ret2;
742
743 if (unlikely(copied < len) && !PageUptodate(page))
744 copied = 0;
739 745
740 if (unlikely(copied < len)) {746 if (likely(copied)) {
741 if (!PageUptodate(page)) {747 ret = ext4_get_inode_loc(inode, &iloc);
742 copied = 0;748 if (ret) {
749 unlock_page(page);
750 put_page(page);
751 ext4_std_error(inode->i_sb, ret);
743 goto out;752 goto out;
744 }753 }
745 }754 ext4_write_lock_xattr(inode, &no_expand);
755 BUG_ON(!ext4_has_inline_data(inode));
746 756
747 ret = ext4_get_inode_loc(inode, &iloc);757 /*
748 if (ret) {758 * ei->i_inline_off may have changed since
749 ext4_std_error(inode->i_sb, ret);759 * ext4_write_begin() called
750 copied = 0;760 * ext4_try_to_write_inline_data()
751 goto out;761 */
752 }762 (void) ext4_find_inline_data_nolock(inode);
753 763
754 ext4_write_lock_xattr(inode, &no_expand);764 kaddr = kmap_atomic(page);
755 BUG_ON(!ext4_has_inline_data(inode));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);
756 770
757 /*771 ext4_write_unlock_xattr(inode, &no_expand);
758 * ei->i_inline_off may have changed since ext4_write_begin()772 brelse(iloc.bh);
759 * called ext4_try_to_write_inline_data()
760 */
761 (void) ext4_find_inline_data_nolock(inode);
762 773
763 kaddr = kmap_atomic(page);774 /*
764 ext4_write_inline_data(inode, &iloc, kaddr, pos, len);775 * It's important to update i_size while still holding page
765 kunmap_atomic(kaddr);776 * lock: page writeout could otherwise come in and zero
766 SetPageUptodate(page);777 * beyond i_size.
767 /* clear page dirty so that writepages wouldn't work for us. */778 */
768 ClearPageDirty(page);779 ext4_update_inode_size(inode, pos + copied);
780 }
781 unlock_page(page);
782 put_page(page);
769 783
770 ext4_write_unlock_xattr(inode, &no_expand);784 /*
771 brelse(iloc.bh);785 * Don't mark the inode dirty under page lock. First, it unnecessarily
772 mark_inode_dirty(inode);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);
773out:792out:
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;
775}814}
776 815
777struct buffer_head *816struct buffer_head *
@@ -953,43 +992,6 @@ out: · 175 unmodified lines
953 return ret;992 return ret;
954}993}
955 994
956int 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
993#ifdef INLINE_DIR_DEBUG995#ifdef INLINE_DIR_DEBUG
994void ext4_show_inline_dir(struct inode *dir, struct buffer_head *bh,996void ext4_show_inline_dir(struct inode *dir, struct buffer_head *bh,
995 void *inline_start, int inline_size)997 void *inline_start, int inline_size)
@@ -1917,6 +1919,24 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline) · 921 unmodified lines
1917 EXT4_I(inode)->i_disksize = i_size;1919 EXT4_I(inode)->i_disksize = i_size;
1918 1920
1919 if (i_size < inline_size) {1921 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)) {
1929retry:
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
1920 /* Clear the content in the xattr space. */1940 /* Clear the content in the xattr space. */
1921 if (inline_size > EXT4_MIN_INLINE_DATA_SIZE) {1941 if (inline_size > EXT4_MIN_INLINE_DATA_SIZE) {
1922 if ((err = ext4_xattr_ibody_find(inode, &i, &is)) != 0)1942 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
1284 loff_t old_size = inode->i_size;1284 loff_t old_size = inode->i_size;
1285 int ret = 0, ret2;1285 int ret = 0, ret2;
1286 int i_size_changed = 0;1286 int i_size_changed = 0;
1287 int inline_data = ext4_has_inline_data(inode);
1288 bool verity = ext4_verity_in_progress(inode);1287 bool verity = ext4_verity_in_progress(inode);
1289 1288
1290 trace_ext4_write_end(inode, pos, len, copied);1289 trace_ext4_write_end(inode, pos, len, copied);
1291 if (inline_data) {1290
1292 ret = ext4_write_inline_data_end(inode, pos, len,1291 if (ext4_has_inline_data(inode))
1293 copied, page);1292 return ext4_write_inline_data_end(inode, pos, len, copied, page);
1294 if (ret < 0) {1293
1295 unlock_page(page);1294 copied = block_write_end(file, mapping, pos, len, copied, page, fsdata);
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);
1303 /*1295 /*
1304 * it's important to update i_size while still holding page lock:1296 * it's important to update i_size while still holding page lock:
1305 * page writeout could otherwise come in and zero beyond i_size.1297 * 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
1320 * ordering of page lock and transaction start for journaling1312 * ordering of page lock and transaction start for journaling
1321 * filesystems.1313 * filesystems.
1322 */1314 */
1323 if (i_size_changed || inline_data)1315 if (i_size_changed)
1324 ret = ext4_mark_inode_dirty(handle, inode);1316 ret = ext4_mark_inode_dirty(handle, inode);
1325 1317
1326 if (pos + len > inode->i_size && !verity && ext4_can_truncate(inode))1318 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
1329 * inode->i_size. So truncate them1321 * inode->i_size. So truncate them
1330 */1322 */
1331 ext4_orphan_add(handle, inode);1323 ext4_orphan_add(handle, inode);
1332errout:1324
1333 ret2 = ext4_journal_stop(handle);1325 ret2 = ext4_journal_stop(handle);
1334 if (!ret)1326 if (!ret)
1335 ret = ret2;1327 ret = ret2;
@@ -1395,7 +1387,6 @@ static int ext4_journalled_write_end(struct file *file, · 59 unmodified lines
1395 int partial = 0;1387 int partial = 0;
1396 unsigned from, to;1388 unsigned from, to;
1397 int size_changed = 0;1389 int size_changed = 0;
1398 int inline_data = ext4_has_inline_data(inode);
1399 bool verity = ext4_verity_in_progress(inode);1390 bool verity = ext4_verity_in_progress(inode);
1400 1391
1401 trace_ext4_journalled_write_end(inode, pos, len, copied);1392 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
1404 1395
1405 BUG_ON(!ext4_handle_valid(handle));1396 BUG_ON(!ext4_handle_valid(handle));
1406 1397
1407 if (inline_data) {1398 if (ext4_has_inline_data(inode))
1408 ret = ext4_write_inline_data_end(inode, pos, len,1399 return ext4_write_inline_data_end(inode, pos, len, copied, page);
1409 copied, page);1400
1410 if (ret < 0) {1401 if (unlikely(copied < len) && !PageUptodate(page)) {
1411 unlock_page(page);
1412 put_page(page);
1413 goto errout;
1414 }
1415 copied = ret;
1416 } else if (unlikely(copied < len) && !PageUptodate(page)) {
1417 copied = 0;1402 copied = 0;
1418 ext4_journalled_zero_new_buffers(handle, inode, page, from, to);1403 ext4_journalled_zero_new_buffers(handle, inode, page, from, to);
1419 } else {1404 } else {
@@ -1436,7 +1421,7 @@ static int ext4_journalled_write_end(struct file *file, · 16 unmodified lines
1436 if (old_size < pos && !verity)1421 if (old_size < pos && !verity)
1437 pagecache_isize_extended(inode, old_size, pos);1422 pagecache_isize_extended(inode, old_size, pos);
1438 1423
1439 if (size_changed || inline_data) {1424 if (size_changed) {
1440 ret2 = ext4_mark_inode_dirty(handle, inode);1425 ret2 = ext4_mark_inode_dirty(handle, inode);
1441 if (!ret)1426 if (!ret)
1442 ret = ret2;1427 ret = ret2;
@@ -1449,7 +1434,6 @@ static int ext4_journalled_write_end(struct file *file, · 6 unmodified lines
1449 */1434 */
1450 ext4_orphan_add(handle, inode);1435 ext4_orphan_add(handle, inode);
1451 1436
1452errout:
1453 ret2 = ext4_journal_stop(handle);1437 ret2 = ext4_journal_stop(handle);
1454 if (!ret)1438 if (!ret)
1455 ret = ret2;1439 ret = ret2;
@@ -1644,6 +1628,7 @@ static int ext4_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk) · 188 unmodified lines
1644 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);1628 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
1645 int ret;1629 int ret;
1646 bool allocated = false;1630 bool allocated = false;
1631 bool reserved = false;
1647 1632
1648 /*1633 /*
1649 * If the cluster containing lblk is shared with a delayed,1634 * 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
1660 ret = ext4_da_reserve_space(inode);1645 ret = ext4_da_reserve_space(inode);
1661 if (ret != 0) /* ENOSPC */1646 if (ret != 0) /* ENOSPC */
1662 goto errout;1647 goto errout;
1648 reserved = true;
1663 } else { /* bigalloc */1649 } else { /* bigalloc */
1664 if (!ext4_es_scan_clu(inode, &ext4_es_is_delonly, lblk)) {1650 if (!ext4_es_scan_clu(inode, &ext4_es_is_delonly, lblk)) {
1665 if (!ext4_es_scan_clu(inode,1651 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
1672 ret = ext4_da_reserve_space(inode);1658 ret = ext4_da_reserve_space(inode);
1673 if (ret != 0) /* ENOSPC */1659 if (ret != 0) /* ENOSPC */
1674 goto errout;1660 goto errout;
1661 reserved = true;
1675 } else {1662 } else {
1676 allocated = true;1663 allocated = true;
1677 }1664 }
@@ -1682,6 +1669,8 @@ static int ext4_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk) · 4 unmodified lines
1682 }1669 }
1683 1670
1684 ret = ext4_es_insert_delayed_block(inode, lblk, allocated);1671 ret = ext4_es_insert_delayed_block(inode, lblk, allocated);
1672 if (ret && reserved)
1673 ext4_da_release_space(inode, 1);
1685 1674
1686errout:1675errout:
1687 return ret;1676 return ret;
@@ -1722,13 +1711,16 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock, · 34 unmodified lines
1722 }1711 }
1723 1712
1724 /*1713 /*
1725 * Delayed extent could be allocated by fallocate.1714 * the buffer head associated with a delayed and not unwritten
1726 * So we need to check it.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
1727 */1719 */
1728 if (ext4_es_is_delayed(&es) && !ext4_es_is_unwritten(&es)) {1720 if (ext4_es_is_delonly(&es)) {
1729 map_bh(bh, inode->i_sb, invalid_block);1721 BUG_ON(bh->b_blocknr != invalid_block);
1730 set_buffer_new(bh);1722 BUG_ON(!buffer_new(bh));
1731 set_buffer_delay(bh);1723 BUG_ON(!buffer_delay(bh));
1732 return 0;1724 return 0;
1733 }1725 }
1734 1726
@@ -2932,19 +2924,6 @@ static int ext4_nonda_switch(struct super_block *sb) · 1197 unmodified lines
2932 return 0;2924 return 0;
2933}2925}
2934 2926
2935/* We always reserve for an inode update; the superblock could be there too */
2936static 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
2948static int ext4_da_write_begin(struct file *file, struct address_space *mapping,2927static int ext4_da_write_begin(struct file *file, struct address_space *mapping,
2949 loff_t pos, unsigned len, unsigned flags,2928 loff_t pos, unsigned len, unsigned flags,
2950 struct page **pagep, void **fsdata)2929 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
2953 struct page *page;2932 struct page *page;
2954 pgoff_t index;2933 pgoff_t index;
2955 struct inode *inode = mapping->host;2934 struct inode *inode = mapping->host;
2956 handle_t *handle;
2957 2935
2958 if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb))))2936 if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb))))
2959 return -EIO;2937 return -EIO;
@@ -2979,41 +2957,11 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping, · 19 unmodified lines
2979 return 0;2957 return 0;
2980 }2958 }
2981 2959
2982 /*2960retry:
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 */
2989retry_grab:
2990 page = grab_cache_page_write_begin(mapping, index, flags);2961 page = grab_cache_page_write_begin(mapping, index, flags);
2991 if (!page)2962 if (!page)
2992 return -ENOMEM;2963 return -ENOMEM;
2993 unlock_page(page);
2994 2964
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 */
3001retry_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 }
3017 /* In case writeback began while the page was unlocked */2965 /* In case writeback began while the page was unlocked */
3018 wait_for_stable_page(page);2966 wait_for_stable_page(page);
3019 2967
@@ -3025,20 +2973,18 @@ retry_journal: · 5 unmodified lines
3025#endif2973#endif
3026 if (ret < 0) {2974 if (ret < 0) {
3027 unlock_page(page);2975 unlock_page(page);
3028 ext4_journal_stop(handle);2976 put_page(page);
3029 /*2977 /*
3030 * block_write_begin may have instantiated a few blocks2978 * block_write_begin may have instantiated a few blocks
3031 * outside i_size. Trim these off again. Don't need2979 * 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.
3033 */2981 */
3034 if (pos + len > inode->i_size)2982 if (pos + len > inode->i_size)
3035 ext4_truncate_failed_write(inode);2983 ext4_truncate_failed_write(inode);
3036 2984
3037 if (ret == -ENOSPC &&2985 if (ret == -ENOSPC &&
3038 ext4_should_retry_alloc(inode->i_sb, &retries))2986 ext4_should_retry_alloc(inode->i_sb, &retries))
3039 goto retry_journal;2987 goto retry;
3040
3041 put_page(page);
3042 return ret;2988 return ret;
3043 }2989 }
3044 2990
@@ -3075,8 +3021,6 @@ static int ext4_da_write_end(struct file *file, · 30 unmodified lines
3075 struct page *page, void *fsdata)3021 struct page *page, void *fsdata)
3076{3022{
3077 struct inode *inode = mapping->host;3023 struct inode *inode = mapping->host;
3078 int ret = 0, ret2;
3079 handle_t *handle = ext4_journal_current_handle();
3080 loff_t new_i_size;3024 loff_t new_i_size;
3081 unsigned long start, end;3025 unsigned long start, end;
3082 int write_mode = (int)(unsigned long)fsdata;3026 int write_mode = (int)(unsigned long)fsdata;
@@ -3086,44 +3030,36 @@ static int ext4_da_write_end(struct file *file, · 3 unmodified lines
3086 len, copied, page, fsdata);3030 len, copied, page, fsdata);
3087 3031
3088 trace_ext4_da_write_end(inode, pos, len, copied);3032 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
3089 start = pos & (PAGE_SIZE - 1);3039 start = pos & (PAGE_SIZE - 1);
3090 end = start + copied - 1;3040 end = start + copied - 1;
3091 3041
3092 /*3042 /*
3093 * generic_write_end() will run mark_inode_dirty() if i_size3043 * Since we are holding inode lock, we are sure i_disksize <=
3094 * changes. So let's piggyback the i_disksize mark_inode_dirty3044 * i_size. We also know that if i_disksize < i_size, there are
3095 * into that.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().
3096 */3056 */
3097 new_i_size = pos + copied;3057 new_i_size = pos + copied;
3098 if (copied && new_i_size > EXT4_I(inode)->i_disksize) {3058 if (copied && new_i_size > inode->i_size &&
3099 if (ext4_has_inline_data(inode) ||3059 ext4_da_should_update_i_disksize(page, end))
3100 ext4_da_should_update_i_disksize(page, end)) {3060 ext4_update_i_disksize(inode, new_i_size);
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 }
3109 3061
3110 if (write_mode != CONVERT_INLINE_DATA &&3062 return generic_write_end(file, mapping, pos, len, copied, page, fsdata);
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;
3127}3063}
3128 3064
3129/*3065/*
@@ -4340,6 +4276,12 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino, · 1210 unmodified lines
4340 goto has_buffer;4276 goto has_buffer;
4341 4277
4342 lock_buffer(bh);4278 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
4343 /*4285 /*
4344 * If we have all information of the inode in memory and this4286 * If we have all information of the inode in memory and this
4345 * is the only valid inode in the block, we need not read the4287 * 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
658 * constraints, it may not be safe to do it right here so we658 * constraints, it may not be safe to do it right here so we
659 * defer superblock flushing to a workqueue.659 * defer superblock flushing to a workqueue.
660 */660 */
661 if (continue_fs)661 if (continue_fs && journal)
662 schedule_work(&EXT4_SB(sb)->s_error_work);662 schedule_work(&EXT4_SB(sb)->s_error_work);
663 else663 else
664 ext4_commit_super(sb);664 ext4_commit_super(sb);
@@ -1350,6 +1350,12 @@ static void ext4_destroy_inode(struct inode *inode) · 685 unmodified lines
1350 true);1350 true);
1351 dump_stack();1351 dump_stack();
1352 }1352 }
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);
1353}1359}
1354 1360
1355static void init_once(void *foo)1361static void init_once(void *foo)
@@ -3021,17 +3027,17 @@ static loff_t ext4_max_size(int blkbits, int has_huge_files) · 1665 unmodified lines
3021 */3027 */
3022static loff_t ext4_max_bitmap_size(int bits, int has_huge_files)3028static loff_t ext4_max_bitmap_size(int bits, int has_huge_files)
3023{3029{
3024 loff_t res = EXT4_NDIR_BLOCKS;3030 unsigned long long upper_limit, res = EXT4_NDIR_BLOCKS;
3025 int meta_blocks;3031 int meta_blocks;
3026 loff_t upper_limit;3032
3027 /* This is calculated to be the largest file size for a dense, block3033 /*
3034 * This is calculated to be the largest file size for a dense, block
3028 * mapped file such that the file's total number of 512-byte sectors,3035 * mapped file such that the file's total number of 512-byte sectors,
3029 * including data and all indirect blocks, does not exceed (2^48 - 1).3036 * including data and all indirect blocks, does not exceed (2^48 - 1).
3030 *3037 *
3031 * __u32 i_blocks_lo and _u16 i_blocks_high represent the total3038 * __u32 i_blocks_lo and _u16 i_blocks_high represent the total
3032 * number of 512-byte sectors of the file.3039 * number of 512-byte sectors of the file.
3033 */3040 */
3034
3035 if (!has_huge_files) {3041 if (!has_huge_files) {
3036 /*3042 /*
3037 * !has_huge_files or implies that the inode i_block field3043 * !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
3074 if (res > MAX_LFS_FILESIZE)3080 if (res > MAX_LFS_FILESIZE)
3075 res = MAX_LFS_FILESIZE;3081 res = MAX_LFS_FILESIZE;
3076 3082
3077 return res;3083 return (loff_t)res;
3078}3084}
3079 3085
3080static ext4_fsblk_t descriptor_loc(struct super_block *sb,3086static ext4_fsblk_t descriptor_loc(struct super_block *sb,
@@ -5042,12 +5048,15 @@ failed_mount_wq: · 1961 unmodified lines
5042 sbi->s_ea_block_cache = NULL;5048 sbi->s_ea_block_cache = NULL;
5043 5049
5044 if (sbi->s_journal) {5050 if (sbi->s_journal) {
5051 /* flush s_error_work before journal destroy. */
5052 flush_work(&sbi->s_error_work);
5045 jbd2_journal_destroy(sbi->s_journal);5053 jbd2_journal_destroy(sbi->s_journal);
5046 sbi->s_journal = NULL;5054 sbi->s_journal = NULL;
5047 }5055 }
5048failed_mount3a:5056failed_mount3a:
5049 ext4_es_unregister_shrinker(sbi);5057 ext4_es_unregister_shrinker(sbi);
5050failed_mount3:5058failed_mount3:
5059 /* flush s_error_work before sbi destroy */
5051 flush_work(&sbi->s_error_work);5060 flush_work(&sbi->s_error_work);
5052 del_timer_sync(&sbi->s_err_report);5061 del_timer_sync(&sbi->s_err_report);
5053 ext4_stop_mmpd(sbi);5062 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
77static WORK_STATE(PARENT_READY, "PRDY", fscache_parent_ready);77static WORK_STATE(PARENT_READY, "PRDY", fscache_parent_ready);
78static WORK_STATE(ABORT_INIT, "ABRT", fscache_abort_initialisation);78static WORK_STATE(ABORT_INIT, "ABRT", fscache_abort_initialisation);
79static WORK_STATE(LOOK_UP_OBJECT, "LOOK", fscache_look_up_object);79static WORK_STATE(LOOK_UP_OBJECT, "LOOK", fscache_look_up_object);
80static WORK_STATE(CREATE_OBJECT, "CRTO", fscache_look_up_object);
81static WORK_STATE(OBJECT_AVAILABLE, "AVBL", fscache_object_available);80static WORK_STATE(OBJECT_AVAILABLE, "AVBL", fscache_object_available);
82static WORK_STATE(JUMPSTART_DEPS, "JUMP", fscache_jumpstart_dependents);81static WORK_STATE(JUMPSTART_DEPS, "JUMP", fscache_jumpstart_dependents);
83 82
@@ -907,6 +906,7 @@ static void fscache_dequeue_object(struct fscache_object *object) · 823 unmodified lines
907 * @object: The object to ask about906 * @object: The object to ask about
908 * @data: The auxiliary data for the object907 * @data: The auxiliary data for the object
909 * @datalen: The size of the auxiliary data908 * @datalen: The size of the auxiliary data
909 * @object_size: The size of the object according to the server.
910 *910 *
911 * This function consults the netfs about the coherency state of an object.911 * This function consults the netfs about the coherency state of an object.
912 * The caller must be holding a ref on cookie->n_active (held by912 * 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
22 22
23/**23/**
24 * fscache_operation_init - Do basic initialisation of an operation24 * fscache_operation_init - Do basic initialisation of an operation
25 * @cookie: The cookie to operate on
25 * @op: The operation to initialise26 * @op: The operation to initialise
27 * @processor: The function to perform the operation
28 * @cancel: A function to handle operation cancellation
26 * @release: The release function to assign29 * @release: The release function to assign
27 *30 *
28 * Do basic initialisation of an operation. The caller must still set flags,31 * 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
584 584
585 if (!get_signal(&ksig))585 if (!get_signal(&ksig))
586 continue;586 continue;
587 if (fatal_signal_pending(current) ||587 break;
588 signal_group_exit(current->signal))
589 break;
590 continue;
591 }588 }
592 last_timeout = !ret;589 last_timeout = !ret;
593 }590 }
fs/io_uring.c+2−15
@@ -403,7 +403,6 @@ struct io_ring_ctx { · 402 unmodified lines
403 struct wait_queue_head cq_wait;403 struct wait_queue_head cq_wait;
404 unsigned cq_extra;404 unsigned cq_extra;
405 atomic_t cq_timeouts;405 atomic_t cq_timeouts;
406 struct fasync_struct *cq_fasync;
407 unsigned cq_last_tm_flush;406 unsigned cq_last_tm_flush;
408 } ____cacheline_aligned_in_smp;407 } ____cacheline_aligned_in_smp;
409 408
@@ -1614,10 +1613,8 @@ static void io_cqring_ev_posted(struct io_ring_ctx *ctx) · 1204 unmodified lines
1614 wake_up(&ctx->sq_data->wait);1613 wake_up(&ctx->sq_data->wait);
1615 if (io_should_trigger_evfd(ctx))1614 if (io_should_trigger_evfd(ctx))
1616 eventfd_signal(ctx->cq_ev_fd, 1);1615 eventfd_signal(ctx->cq_ev_fd, 1);
1617 if (waitqueue_active(&ctx->poll_wait)) {1616 if (waitqueue_active(&ctx->poll_wait))
1618 wake_up_interruptible(&ctx->poll_wait);1617 wake_up_interruptible(&ctx->poll_wait);
1619 kill_fasync(&ctx->cq_fasync, SIGIO, POLL_IN);
1620 }
1621}1618}
1622 1619
1623static void io_cqring_ev_posted_iopoll(struct io_ring_ctx *ctx)1620static 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
1631 }1628 }
1632 if (io_should_trigger_evfd(ctx))1629 if (io_should_trigger_evfd(ctx))
1633 eventfd_signal(ctx->cq_ev_fd, 1);1630 eventfd_signal(ctx->cq_ev_fd, 1);
1634 if (waitqueue_active(&ctx->poll_wait)) {1631 if (waitqueue_active(&ctx->poll_wait))
1635 wake_up_interruptible(&ctx->poll_wait);1632 wake_up_interruptible(&ctx->poll_wait);
1636 kill_fasync(&ctx->cq_fasync, SIGIO, POLL_IN);
1637 }
1638}1633}
1639 1634
1640/* Returns true if there are no backlogged entries after the flush */1635/* 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
9345 return mask;9340 return mask;
9346}9341}
9347 9342
9348static 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
9355static int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id)9343static int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id)
9356{9344{
9357 const struct cred *creds;9345 const struct cred *creds;
@@ -10145,7 +10133,6 @@ static const struct file_operations io_uring_fops = { · 787 unmodified lines
10145 .mmap_capabilities = io_uring_nommu_mmap_capabilities,10133 .mmap_capabilities = io_uring_nommu_mmap_capabilities,
10146#endif10134#endif
10147 .poll = io_uring_poll,10135 .poll = io_uring_poll,
10148 .fasync = io_uring_fasync,
10149#ifdef CONFIG_PROC_FS10136#ifdef CONFIG_PROC_FS
10150 .show_fdinfo = io_uring_show_fdinfo,10137 .show_fdinfo = io_uring_show_fdinfo,
10151#endif10138#endif
fs/kernfs/dir.c+7−2
@@ -1116,8 +1116,13 @@ static struct dentry *kernfs_iop_lookup(struct inode *dir, · 1115 unmodified lines
1116 if (!inode)1116 if (!inode)
1117 inode = ERR_PTR(-ENOMEM);1117 inode = ERR_PTR(-ENOMEM);
1118 }1118 }
1119 /* Needed only for negative dentry validation */1119 /*
1120 if (!inode)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))
1121 kernfs_set_rev(parent, dentry);1126 kernfs_set_rev(parent, dentry);
1122 up_read(&kernfs_rwsem);1127 up_read(&kernfs_rwsem);
1123 1128
fs/ksmbd/auth.c+0−205
@@ -68,125 +68,6 @@ void ksmbd_copy_gss_neg_header(void *buf) · 67 unmodified lines
68 memcpy(buf, NEGOTIATE_GSS_HEADER, AUTH_GSS_LENGTH);68 memcpy(buf, NEGOTIATE_GSS_HEADER, AUTH_GSS_LENGTH);
69}69}
70 70
71static void
72str_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
88static int
89smbhash(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
106static 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 */
120static 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");
147out:
148 ksmbd_release_crypto_ctx(ctx);
149 return rc;
150}
151
152static 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");
185out:
186 ksmbd_release_crypto_ctx(ctx);
187 return rc;
188}
189
190/**71/**
191 * ksmbd_gen_sess_key() - function to generate session key72 * ksmbd_gen_sess_key() - function to generate session key
192 * @sess: session of connection73 * @sess: session of connection
@@ -324,43 +205,6 @@ out: · 131 unmodified lines
324 return ret;205 return ret;
325}206}
326 207
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 */
335int 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
364/**208/**
365 * ksmbd_auth_ntlmv2() - NTLMv2 authentication handler209 * ksmbd_auth_ntlmv2() - NTLMv2 authentication handler
366 * @sess: session of connection210 * @sess: session of connection
@@ -441,44 +285,6 @@ out: · 74 unmodified lines
441 return rc;285 return rc;
442}286}
443 287
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 */
452static 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;
478out:
479 return rc;
480}
481
482/**288/**
483 * ksmbd_decode_ntlmssp_auth_blob() - helper function to construct289 * ksmbd_decode_ntlmssp_auth_blob() - helper function to construct
484 * authenticate blob290 * authenticate blob
@@ -512,17 +318,6 @@ int ksmbd_decode_ntlmssp_auth_blob(struct authenticate_message *authblob, · 27 unmodified lines
512 nt_off = le32_to_cpu(authblob->NtChallengeResponse.BufferOffset);318 nt_off = le32_to_cpu(authblob->NtChallengeResponse.BufferOffset);
513 nt_len = le16_to_cpu(authblob->NtChallengeResponse.Length);319 nt_len = le16_to_cpu(authblob->NtChallengeResponse.Length);
514 320
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
526 /* TODO : use domain name that imported from configuration file */321 /* TODO : use domain name that imported from configuration file */
527 domain_name = smb_strndup_from_utf16((const char *)authblob +322 domain_name = smb_strndup_from_utf16((const char *)authblob +
528 le32_to_cpu(authblob->DomainName.BufferOffset),323 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
81 case CRYPTO_SHASH_SHA512:81 case CRYPTO_SHASH_SHA512:
82 tfm = crypto_alloc_shash("sha512", 0, 0);82 tfm = crypto_alloc_shash("sha512", 0, 0);
83 break;83 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;
90 default:84 default:
91 return NULL;85 return NULL;
92 }86 }
@@ -214,16 +208,6 @@ struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha512(void) · 121 unmodified lines
214 return ____crypto_shash_ctx_find(CRYPTO_SHASH_SHA512);208 return ____crypto_shash_ctx_find(CRYPTO_SHASH_SHA512);
215}209}
216 210
217struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md4(void)
218{
219 return ____crypto_shash_ctx_find(CRYPTO_SHASH_MD4);
220}
221
222struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md5(void)
223{
224 return ____crypto_shash_ctx_find(CRYPTO_SHASH_MD5);
225}
226
227static struct ksmbd_crypto_ctx *____crypto_aead_ctx_find(int id)211static struct ksmbd_crypto_ctx *____crypto_aead_ctx_find(int id)
228{212{
229 struct ksmbd_crypto_ctx *ctx;213 struct ksmbd_crypto_ctx *ctx;
fs/ksmbd/crypto_ctx.h+0−8
@@ -15,8 +15,6 @@ enum { · 14 unmodified lines
15 CRYPTO_SHASH_CMACAES,15 CRYPTO_SHASH_CMACAES,
16 CRYPTO_SHASH_SHA256,16 CRYPTO_SHASH_SHA256,
17 CRYPTO_SHASH_SHA512,17 CRYPTO_SHASH_SHA512,
18 CRYPTO_SHASH_MD4,
19 CRYPTO_SHASH_MD5,
20 CRYPTO_SHASH_MAX,18 CRYPTO_SHASH_MAX,
21};19};
22 20
@@ -43,8 +41,6 @@ struct ksmbd_crypto_ctx { · 20 unmodified lines
43#define CRYPTO_CMACAES(c) ((c)->desc[CRYPTO_SHASH_CMACAES])41#define CRYPTO_CMACAES(c) ((c)->desc[CRYPTO_SHASH_CMACAES])
44#define CRYPTO_SHA256(c) ((c)->desc[CRYPTO_SHASH_SHA256])42#define CRYPTO_SHA256(c) ((c)->desc[CRYPTO_SHASH_SHA256])
45#define CRYPTO_SHA512(c) ((c)->desc[CRYPTO_SHASH_SHA512])43#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])
48 44
49#define CRYPTO_HMACMD5_TFM(c) ((c)->desc[CRYPTO_SHASH_HMACMD5]->tfm)45#define CRYPTO_HMACMD5_TFM(c) ((c)->desc[CRYPTO_SHASH_HMACMD5]->tfm)
50#define CRYPTO_HMACSHA256_TFM(c)\46#define CRYPTO_HMACSHA256_TFM(c)\
@@ -52,8 +48,6 @@ struct ksmbd_crypto_ctx { · 1 unmodified line
52#define CRYPTO_CMACAES_TFM(c) ((c)->desc[CRYPTO_SHASH_CMACAES]->tfm)48#define CRYPTO_CMACAES_TFM(c) ((c)->desc[CRYPTO_SHASH_CMACAES]->tfm)
53#define CRYPTO_SHA256_TFM(c) ((c)->desc[CRYPTO_SHASH_SHA256]->tfm)49#define CRYPTO_SHA256_TFM(c) ((c)->desc[CRYPTO_SHASH_SHA256]->tfm)
54#define CRYPTO_SHA512_TFM(c) ((c)->desc[CRYPTO_SHASH_SHA512]->tfm)50#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)
57 51
58#define CRYPTO_GCM(c) ((c)->ccmaes[CRYPTO_AEAD_AES_GCM])52#define CRYPTO_GCM(c) ((c)->ccmaes[CRYPTO_AEAD_AES_GCM])
59#define CRYPTO_CCM(c) ((c)->ccmaes[CRYPTO_AEAD_AES_CCM])53#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
64struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_cmacaes(void);58struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_cmacaes(void);
65struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha512(void);59struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha512(void);
66struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha256(void);60struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha256(void);
67struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md4(void);
68struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md5(void);
69struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_gcm(void);61struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_gcm(void);
70struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_ccm(void);62struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_ccm(void);
71void ksmbd_crypto_destroy(void);63void ksmbd_crypto_destroy(void);
fs/ksmbd/misc.c+7−10
@@ -162,17 +162,14 @@ char *convert_to_nt_pathname(char *filename) · 161 unmodified lines
162{162{
163 char *ab_pathname;163 char *ab_pathname;
164 164
165 if (strlen(filename) == 0) {165 if (strlen(filename) == 0)
166 ab_pathname = kmalloc(2, GFP_KERNEL);166 filename = "\\";
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;
173 167
174 ksmbd_conv_path_to_windows(ab_pathname);168 ab_pathname = kstrdup(filename, GFP_KERNEL);
175 }169 if (!ab_pathname)
170 return NULL;
171
172 ksmbd_conv_path_to_windows(ab_pathname);
176 return ab_pathname;173 return ab_pathname;
177}174}
178 175
fs/ksmbd/oplock.c+31−10
@@ -1451,26 +1451,47 @@ struct lease_ctx_info *parse_lease_state(void *open_req) · 1450 unmodified lines
1451 */1451 */
1452struct create_context *smb2_find_context_vals(void *open_req, const char *tag)1452struct create_context *smb2_find_context_vals(void *open_req, const char *tag)
1453{1453{
1454 char *data_offset;
1455 struct create_context *cc;1454 struct create_context *cc;
1456 unsigned int next = 0;1455 unsigned int next = 0;
1457 char *name;1456 char *name;
1458 struct smb2_create_req *req = (struct smb2_create_req *)open_req;1457 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;
1459 1460
1460 data_offset = (char *)req + 4 + le32_to_cpu(req->CreateContextsOffset);1461 /*
1461 cc = (struct create_context *)data_offset;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);
1462 do {1468 do {
1463 int val;
1464
1465 cc = (struct create_context *)((char *)cc + next);1469 cc = (struct create_context *)((char *)cc + next);
1466 name = le16_to_cpu(cc->NameOffset) + (char *)cc;1470 if (remain_len < offsetof(struct create_context, Buffer))
1467 val = le16_to_cpu(cc->NameLength);
1468 if (val < 4)
1469 return ERR_PTR(-EINVAL);1471 return ERR_PTR(-EINVAL);
1470 1472
1471 if (memcmp(name, tag, val) == 0)
1472 return cc;
1473 next = le32_to_cpu(cc->Next);1473 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;
1474 } while (next != 0);1495 } while (next != 0);
1475 1496
1476 return NULL;1497 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
459bool is_chained_smb2_message(struct ksmbd_work *work)459bool is_chained_smb2_message(struct ksmbd_work *work)
460{460{
461 struct smb2_hdr *hdr = work->request_buf;461 struct smb2_hdr *hdr = work->request_buf;
462 unsigned int len;462 unsigned int len, next_cmd;
463 463
464 if (hdr->ProtocolId != SMB2_PROTO_NUMBER)464 if (hdr->ProtocolId != SMB2_PROTO_NUMBER)
465 return false;465 return false;
466 466
467 hdr = ksmbd_req_buf_next(work);467 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
469 ksmbd_debug(SMB, "got SMB2 chained command\n");478 ksmbd_debug(SMB, "got SMB2 chained command\n");
470 init_chained_smb2_rsp(work);479 init_chained_smb2_rsp(work);
471 return true;480 return true;
@@ -1058,6 +1067,7 @@ int smb2_handle_negotiate(struct ksmbd_work *work) · 586 unmodified lines
1058 struct smb2_negotiate_req *req = work->request_buf;1067 struct smb2_negotiate_req *req = work->request_buf;
1059 struct smb2_negotiate_rsp *rsp = work->response_buf;1068 struct smb2_negotiate_rsp *rsp = work->response_buf;
1060 int rc = 0;1069 int rc = 0;
1070 unsigned int smb2_buf_len, smb2_neg_size;
1061 __le32 status;1071 __le32 status;
1062 1072
1063 ksmbd_debug(SMB, "Received negotiate request\n");1073 ksmbd_debug(SMB, "Received negotiate request\n");
@@ -1075,6 +1085,44 @@ int smb2_handle_negotiate(struct ksmbd_work *work) · 11 unmodified lines
1075 goto err_out;1085 goto err_out;
1076 }1086 }
1077 1087
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
1078 conn->cli_cap = le32_to_cpu(req->Capabilities);1126 conn->cli_cap = le32_to_cpu(req->Capabilities);
1079 switch (conn->dialect) {1127 switch (conn->dialect) {
1080 case SMB311_PROT_ID:1128 case SMB311_PROT_ID:
@@ -2093,16 +2141,22 @@ out: · 1012 unmodified lines
2093 * smb2_set_ea() - handler for setting extended attributes using set2141 * smb2_set_ea() - handler for setting extended attributes using set
2094 * info command2142 * info command
2095 * @eabuf: set info command buffer2143 * @eabuf: set info command buffer
2144 * @buf_len: set info command buffer length
2096 * @path: dentry path for get ea2145 * @path: dentry path for get ea
2097 *2146 *
2098 * Return: 0 on success, otherwise error2147 * Return: 0 on success, otherwise error
2099 */2148 */
2100static int smb2_set_ea(struct smb2_ea_info *eabuf, struct path *path)2149static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len,
2150 struct path *path)
2101{2151{
2102 struct user_namespace *user_ns = mnt_user_ns(path->mnt);2152 struct user_namespace *user_ns = mnt_user_ns(path->mnt);
2103 char *attr_name = NULL, *value;2153 char *attr_name = NULL, *value;
2104 int rc = 0;2154 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;
2106 2160
2107 attr_name = kmalloc(XATTR_NAME_MAX + 1, GFP_KERNEL);2161 attr_name = kmalloc(XATTR_NAME_MAX + 1, GFP_KERNEL);
2108 if (!attr_name)2162 if (!attr_name)
@@ -2167,7 +2221,13 @@ static int smb2_set_ea(struct smb2_ea_info *eabuf, struct path *path) · 58 unmodified lines
2167 2221
2168next:2222next:
2169 next = le32_to_cpu(eabuf->NextEntryOffset);2223 next = le32_to_cpu(eabuf->NextEntryOffset);
2224 if (next == 0 || buf_len < next)
2225 break;
2226 buf_len -= next;
2170 eabuf = (struct smb2_ea_info *)((char *)eabuf + next);2227 eabuf = (struct smb2_ea_info *)((char *)eabuf + next);
2228 if (next < (u32)eabuf->EaNameLength + le16_to_cpu(eabuf->EaValueLength))
2229 break;
2230
2171 } while (next != 0);2231 } while (next != 0);
2172 2232
2173 kfree(attr_name);2233 kfree(attr_name);
@@ -2367,6 +2427,10 @@ static int smb2_create_sd_buffer(struct ksmbd_work *work, · 193 unmodified lines
2367 ksmbd_debug(SMB,2427 ksmbd_debug(SMB,
2368 "Set ACLs using SMB2_CREATE_SD_BUFFER context\n");2428 "Set ACLs using SMB2_CREATE_SD_BUFFER context\n");
2369 sd_buf = (struct create_sd_buf_req *)context;2429 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;
2370 return set_info_sec(work->conn, work->tcon, path, &sd_buf->ntsd,2434 return set_info_sec(work->conn, work->tcon, path, &sd_buf->ntsd,
2371 le32_to_cpu(sd_buf->ccontext.DataLength), true);2435 le32_to_cpu(sd_buf->ccontext.DataLength), true);
2372}2436}
@@ -2561,6 +2625,12 @@ int smb2_open(struct ksmbd_work *work) · 188 unmodified lines
2561 goto err_out1;2625 goto err_out1;
2562 } else if (context) {2626 } else if (context) {
2563 ea_buf = (struct create_ea_buf_req *)context;2627 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 }
2564 if (req->CreateOptions & FILE_NO_EA_KNOWLEDGE_LE) {2634 if (req->CreateOptions & FILE_NO_EA_KNOWLEDGE_LE) {
2565 rsp->hdr.Status = STATUS_ACCESS_DENIED;2635 rsp->hdr.Status = STATUS_ACCESS_DENIED;
2566 rc = -EACCES;2636 rc = -EACCES;
@@ -2599,6 +2669,12 @@ int smb2_open(struct ksmbd_work *work) · 32 unmodified lines
2599 } else if (context) {2669 } else if (context) {
2600 struct create_posix *posix =2670 struct create_posix *posix =
2601 (struct create_posix *)context;2671 (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 }
2602 ksmbd_debug(SMB, "get posix context\n");2678 ksmbd_debug(SMB, "get posix context\n");
2603 2679
2604 posix_mode = le32_to_cpu(posix->Mode);2680 posix_mode = le32_to_cpu(posix->Mode);
@@ -2748,7 +2824,15 @@ int smb2_open(struct ksmbd_work *work) · 143 unmodified lines
2748 created = true;2824 created = true;
2749 user_ns = mnt_user_ns(path.mnt);2825 user_ns = mnt_user_ns(path.mnt);
2750 if (ea_buf) {2826 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);
2752 if (rc == -EOPNOTSUPP)2836 if (rc == -EOPNOTSUPP)
2753 rc = 0;2837 rc = 0;
2754 else if (rc)2838 else if (rc)
@@ -2981,9 +3065,16 @@ int smb2_open(struct ksmbd_work *work) · 226 unmodified lines
2981 rc = PTR_ERR(az_req);3065 rc = PTR_ERR(az_req);
2982 goto err_out;3066 goto err_out;
2983 } else if (az_req) {3067 } else if (az_req) {
2984 loff_t alloc_size = le64_to_cpu(az_req->AllocationSize);3068 loff_t alloc_size;
2985 int err;3069 int err;
2986 3070
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);
2987 ksmbd_debug(SMB,3078 ksmbd_debug(SMB,
2988 "request smb2 create allocate size : %llu\n",3079 "request smb2 create allocate size : %llu\n",
2989 alloc_size);3080 alloc_size);
@@ -4152,7 +4243,7 @@ static void get_file_access_info(struct smb2_query_info_rsp *rsp, · 1162 unmodified lines
4152static int get_file_basic_info(struct smb2_query_info_rsp *rsp,4243static int get_file_basic_info(struct smb2_query_info_rsp *rsp,
4153 struct ksmbd_file *fp, void *rsp_org)4244 struct ksmbd_file *fp, void *rsp_org)
4154{4245{
4155 struct smb2_file_all_info *basic_info;4246 struct smb2_file_basic_info *basic_info;
4156 struct kstat stat;4247 struct kstat stat;
4157 u64 time;4248 u64 time;
4158 4249
@@ -4162,7 +4253,7 @@ static int get_file_basic_info(struct smb2_query_info_rsp *rsp, · 3 unmodified lines
4162 return -EACCES;4253 return -EACCES;
4163 }4254 }
4164 4255
4165 basic_info = (struct smb2_file_all_info *)rsp->Buffer;4256 basic_info = (struct smb2_file_basic_info *)rsp->Buffer;
4166 generic_fillattr(file_mnt_user_ns(fp->filp), file_inode(fp->filp),4257 generic_fillattr(file_mnt_user_ns(fp->filp), file_inode(fp->filp),
4167 &stat);4258 &stat);
4168 basic_info->CreationTime = cpu_to_le64(fp->create_time);4259 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
4175 basic_info->Attributes = fp->f_ci->m_fattr;4266 basic_info->Attributes = fp->f_ci->m_fattr;
4176 basic_info->Pad1 = 0;4267 basic_info->Pad1 = 0;
4177 rsp->OutputBufferLength =4268 rsp->OutputBufferLength =
4178 cpu_to_le32(offsetof(struct smb2_file_all_info, AllocationSize));4269 cpu_to_le32(sizeof(struct smb2_file_basic_info));
4179 inc_rfc1001_len(rsp_org, offsetof(struct smb2_file_all_info,4270 inc_rfc1001_len(rsp_org, sizeof(struct smb2_file_basic_info));
4180 AllocationSize));
4181 return 0;4271 return 0;
4182}4272}
4183 4273
@@ -5333,7 +5423,7 @@ out: · 1149 unmodified lines
5333static int smb2_create_link(struct ksmbd_work *work,5423static int smb2_create_link(struct ksmbd_work *work,
5334 struct ksmbd_share_config *share,5424 struct ksmbd_share_config *share,
5335 struct smb2_file_link_info *file_info,5425 struct smb2_file_link_info *file_info,
5336 struct file *filp,5426 unsigned int buf_len, struct file *filp,
5337 struct nls_table *local_nls)5427 struct nls_table *local_nls)
5338{5428{
5339 char *link_name = NULL, *target_name = NULL, *pathname = NULL;5429 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
5341 bool file_present = true;5431 bool file_present = true;
5342 int rc;5432 int rc;
5343 5433
5434 if (buf_len < (u64)sizeof(struct smb2_file_link_info) +
5435 le32_to_cpu(file_info->FileNameLength))
5436 return -EINVAL;
5437
5344 ksmbd_debug(SMB, "setting FILE_LINK_INFORMATION\n");5438 ksmbd_debug(SMB, "setting FILE_LINK_INFORMATION\n");
5345 pathname = kmalloc(PATH_MAX, GFP_KERNEL);5439 pathname = kmalloc(PATH_MAX, GFP_KERNEL);
5346 if (!pathname)5440 if (!pathname)
@@ -5400,10 +5494,10 @@ out: · 53 unmodified lines
5400 return rc;5494 return rc;
5401}5495}
5402 5496
5403static int set_file_basic_info(struct ksmbd_file *fp, char *buf,5497static int set_file_basic_info(struct ksmbd_file *fp,
5498 struct smb2_file_basic_info *file_info,
5404 struct ksmbd_share_config *share)5499 struct ksmbd_share_config *share)
5405{5500{
5406 struct smb2_file_all_info *file_info;
5407 struct iattr attrs;5501 struct iattr attrs;
5408 struct timespec64 ctime;5502 struct timespec64 ctime;
5409 struct file *filp;5503 struct file *filp;
@@ -5414,7 +5508,6 @@ static int set_file_basic_info(struct ksmbd_file *fp, char *buf, · 4 unmodified lines
5414 if (!(fp->daccess & FILE_WRITE_ATTRIBUTES_LE))5508 if (!(fp->daccess & FILE_WRITE_ATTRIBUTES_LE))
5415 return -EACCES;5509 return -EACCES;
5416 5510
5417 file_info = (struct smb2_file_all_info *)buf;
5418 attrs.ia_valid = 0;5511 attrs.ia_valid = 0;
5419 filp = fp->filp;5512 filp = fp->filp;
5420 inode = file_inode(filp);5513 inode = file_inode(filp);
@@ -5491,7 +5584,8 @@ static int set_file_basic_info(struct ksmbd_file *fp, char *buf, · 70 unmodified lines
5491}5584}
5492 5585
5493static int set_file_allocation_info(struct ksmbd_work *work,5586static 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)
5495{5589{
5496 /*5590 /*
5497 * TODO : It's working fine only when store dos attributes5591 * 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
5499 * properly with any smb.conf option5593 * properly with any smb.conf option
5500 */5594 */
5501 5595
5502 struct smb2_file_alloc_info *file_alloc_info;
5503 loff_t alloc_blks;5596 loff_t alloc_blks;
5504 struct inode *inode;5597 struct inode *inode;
5505 int rc;5598 int rc;
@@ -5507,7 +5600,6 @@ static int set_file_allocation_info(struct ksmbd_work *work, · 1 unmodified line
5507 if (!(fp->daccess & FILE_WRITE_DATA_LE))5600 if (!(fp->daccess & FILE_WRITE_DATA_LE))
5508 return -EACCES;5601 return -EACCES;
5509 5602
5510 file_alloc_info = (struct smb2_file_alloc_info *)buf;
5511 alloc_blks = (le64_to_cpu(file_alloc_info->AllocationSize) + 511) >> 9;5603 alloc_blks = (le64_to_cpu(file_alloc_info->AllocationSize) + 511) >> 9;
5512 inode = file_inode(fp->filp);5604 inode = file_inode(fp->filp);
5513 5605
@@ -5543,9 +5635,8 @@ static int set_file_allocation_info(struct ksmbd_work *work, · 29 unmodified lines
5543}5635}
5544 5636
5545static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp,5637static 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)
5547{5639{
5548 struct smb2_file_eof_info *file_eof_info;
5549 loff_t newsize;5640 loff_t newsize;
5550 struct inode *inode;5641 struct inode *inode;
5551 int rc;5642 int rc;
@@ -5553,7 +5644,6 @@ static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp, · 1 unmodified line
5553 if (!(fp->daccess & FILE_WRITE_DATA_LE))5644 if (!(fp->daccess & FILE_WRITE_DATA_LE))
5554 return -EACCES;5645 return -EACCES;
5555 5646
5556 file_eof_info = (struct smb2_file_eof_info *)buf;
5557 newsize = le64_to_cpu(file_eof_info->EndOfFile);5647 newsize = le64_to_cpu(file_eof_info->EndOfFile);
5558 inode = file_inode(fp->filp);5648 inode = file_inode(fp->filp);
5559 5649
@@ -5580,7 +5670,8 @@ static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp, · 20 unmodified lines
5580}5670}
5581 5671
5582static int set_rename_info(struct ksmbd_work *work, struct ksmbd_file *fp,5672static 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)
5584{5675{
5585 struct user_namespace *user_ns;5676 struct user_namespace *user_ns;
5586 struct ksmbd_file *parent_fp;5677 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
5593 return -EACCES;5684 return -EACCES;
5594 }5685 }
5595 5686
5687 if (buf_len < (u64)sizeof(struct smb2_file_rename_info) +
5688 le32_to_cpu(rename_info->FileNameLength))
5689 return -EINVAL;
5690
5596 user_ns = file_mnt_user_ns(fp->filp);5691 user_ns = file_mnt_user_ns(fp->filp);
5597 if (ksmbd_stream_fd(fp))5692 if (ksmbd_stream_fd(fp))
5598 goto next;5693 goto next;
@@ -5615,14 +5710,13 @@ static int set_rename_info(struct ksmbd_work *work, struct ksmbd_file *fp, · 16 unmodified lines
5615 }5710 }
5616 }5711 }
5617next:5712next:
5618 return smb2_rename(work, fp, user_ns,5713 return smb2_rename(work, fp, user_ns, rename_info,
5619 (struct smb2_file_rename_info *)buf,
5620 work->sess->conn->local_nls);5714 work->sess->conn->local_nls);
5621}5715}
5622 5716
5623static int set_file_disposition_info(struct ksmbd_file *fp, char *buf)5717static int set_file_disposition_info(struct ksmbd_file *fp,
5718 struct smb2_file_disposition_info *file_info)
5624{5719{
5625 struct smb2_file_disposition_info *file_info;
5626 struct inode *inode;5720 struct inode *inode;
5627 5721
5628 if (!(fp->daccess & FILE_DELETE_LE)) {5722 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
5631 }5725 }
5632 5726
5633 inode = file_inode(fp->filp);5727 inode = file_inode(fp->filp);
5634 file_info = (struct smb2_file_disposition_info *)buf;
5635 if (file_info->DeletePending) {5728 if (file_info->DeletePending) {
5636 if (S_ISDIR(inode->i_mode) &&5729 if (S_ISDIR(inode->i_mode) &&
5637 ksmbd_vfs_empty_dir(fp) == -ENOTEMPTY)5730 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
5643 return 0;5736 return 0;
5644}5737}
5645 5738
5646static int set_file_position_info(struct ksmbd_file *fp, char *buf)5739static int set_file_position_info(struct ksmbd_file *fp,
5740 struct smb2_file_pos_info *file_info)
5647{5741{
5648 struct smb2_file_pos_info *file_info;
5649 loff_t current_byte_offset;5742 loff_t current_byte_offset;
5650 unsigned long sector_size;5743 unsigned long sector_size;
5651 struct inode *inode;5744 struct inode *inode;
5652 5745
5653 inode = file_inode(fp->filp);5746 inode = file_inode(fp->filp);
5654 file_info = (struct smb2_file_pos_info *)buf;
5655 current_byte_offset = le64_to_cpu(file_info->CurrentByteOffset);5747 current_byte_offset = le64_to_cpu(file_info->CurrentByteOffset);
5656 sector_size = inode->i_sb->s_blocksize;5748 sector_size = inode->i_sb->s_blocksize;
5657 5749
@@ -5667,12 +5759,11 @@ static int set_file_position_info(struct ksmbd_file *fp, char *buf) · 9 unmodified lines
5667 return 0;5759 return 0;
5668}5760}
5669 5761
5670static int set_file_mode_info(struct ksmbd_file *fp, char *buf)5762static int set_file_mode_info(struct ksmbd_file *fp,
5763 struct smb2_file_mode_info *file_info)
5671{5764{
5672 struct smb2_file_mode_info *file_info;
5673 __le32 mode;5765 __le32 mode;
5674 5766
5675 file_info = (struct smb2_file_mode_info *)buf;
5676 mode = file_info->Mode;5767 mode = file_info->Mode;
5677 5768
5678 if ((mode & ~FILE_MODE_INFO_MASK) ||5769 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
5702 * TODO: need to implement an error handling for STATUS_INFO_LENGTH_MISMATCH5793 * TODO: need to implement an error handling for STATUS_INFO_LENGTH_MISMATCH
5703 */5794 */
5704static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,5795static 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,
5706 struct ksmbd_share_config *share)5797 struct ksmbd_share_config *share)
5707{5798{
5708 switch (info_class) {5799 unsigned int buf_len = le32_to_cpu(req->BufferLength);
5800
5801 switch (req->FileInfoClass) {
5709 case FILE_BASIC_INFORMATION:5802 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;
5711 5806
5807 return set_file_basic_info(fp, (struct smb2_file_basic_info *)req->Buffer, share);
5808 }
5712 case FILE_ALLOCATION_INFORMATION:5809 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;
5714 5813
5814 return set_file_allocation_info(work, fp,
5815 (struct smb2_file_alloc_info *)req->Buffer);
5816 }
5715 case FILE_END_OF_FILE_INFORMATION:5817 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;
5717 5821
5822 return set_end_of_file_info(work, fp,
5823 (struct smb2_file_eof_info *)req->Buffer);
5824 }
5718 case FILE_RENAME_INFORMATION:5825 case FILE_RENAME_INFORMATION:
5826 {
5719 if (!test_tree_conn_flag(work->tcon, KSMBD_TREE_CONN_FLAG_WRITABLE)) {5827 if (!test_tree_conn_flag(work->tcon, KSMBD_TREE_CONN_FLAG_WRITABLE)) {
5720 ksmbd_debug(SMB,5828 ksmbd_debug(SMB,
5721 "User does not have write permission\n");5829 "User does not have write permission\n");
5722 return -EACCES;5830 return -EACCES;
5723 }5831 }
5724 return set_rename_info(work, fp, buf);
5725 5832
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 }
5726 case FILE_LINK_INFORMATION:5840 case FILE_LINK_INFORMATION:
5841 {
5842 if (buf_len < sizeof(struct smb2_file_link_info))
5843 return -EINVAL;
5844
5727 return smb2_create_link(work, work->tcon->share_conf,5845 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,
5729 work->sess->conn->local_nls);5848 work->sess->conn->local_nls);
5730 5849 }
5731 case FILE_DISPOSITION_INFORMATION:5850 case FILE_DISPOSITION_INFORMATION:
5851 {
5732 if (!test_tree_conn_flag(work->tcon, KSMBD_TREE_CONN_FLAG_WRITABLE)) {5852 if (!test_tree_conn_flag(work->tcon, KSMBD_TREE_CONN_FLAG_WRITABLE)) {
5733 ksmbd_debug(SMB,5853 ksmbd_debug(SMB,
5734 "User does not have write permission\n");5854 "User does not have write permission\n");
5735 return -EACCES;5855 return -EACCES;
5736 }5856 }
5737 return set_file_disposition_info(fp, buf);
5738 5857
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 }
5739 case FILE_FULL_EA_INFORMATION:5864 case FILE_FULL_EA_INFORMATION:
5740 {5865 {
5741 if (!(fp->daccess & FILE_WRITE_EA_LE)) {5866 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
5744 return -EACCES;5869 return -EACCES;
5745 }5870 }
5746 5871
5747 return smb2_set_ea((struct smb2_ea_info *)buf,5872 if (buf_len < sizeof(struct smb2_ea_info))
5748 &fp->filp->f_path);5873 return -EINVAL;
5749 }
5750 5874
5875 return smb2_set_ea((struct smb2_ea_info *)req->Buffer,
5876 buf_len, &fp->filp->f_path);
5877 }
5751 case FILE_POSITION_INFORMATION:5878 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;
5753 5882
5883 return set_file_position_info(fp, (struct smb2_file_pos_info *)req->Buffer);
5884 }
5754 case FILE_MODE_INFORMATION:5885 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 }
5756 }5892 }
5757 5893
5758 pr_err("Unimplemented Fileinfoclass :%d\n", info_class);5894 pr_err("Unimplemented Fileinfoclass :%d\n", req->FileInfoClass);
5759 return -EOPNOTSUPP;5895 return -EOPNOTSUPP;
5760}5896}
5761 5897
@@ -5816,8 +5952,7 @@ int smb2_set_info(struct ksmbd_work *work) · 54 unmodified lines
5816 switch (req->InfoType) {5952 switch (req->InfoType) {
5817 case SMB2_O_INFO_FILE:5953 case SMB2_O_INFO_FILE:
5818 ksmbd_debug(SMB, "GOT SMB2_O_INFO_FILE\n");5954 ksmbd_debug(SMB, "GOT SMB2_O_INFO_FILE\n");
5819 rc = smb2_set_info_file(work, fp, req->FileInfoClass,5955 rc = smb2_set_info_file(work, fp, req, work->tcon->share_conf);
5820 req->Buffer, work->tcon->share_conf);
5821 break;5956 break;
5822 case SMB2_O_INFO_SECURITY:5957 case SMB2_O_INFO_SECURITY:
5823 ksmbd_debug(SMB, "GOT SMB2_O_INFO_SECURITY\n");5958 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
8171 8306
8172 WORK_BUFFERS(work, req, rsp);8307 WORK_BUFFERS(work, req, rsp);
8173 8308
8174 if (le16_to_cpu(req->Command) == SMB2_NEGOTIATE_HE)8309 if (le16_to_cpu(req->Command) == SMB2_NEGOTIATE_HE &&
8310 conn->preauth_info)
8175 ksmbd_gen_preauth_integrity_hash(conn, (char *)rsp,8311 ksmbd_gen_preauth_integrity_hash(conn, (char *)rsp,
8176 conn->preauth_info->Preauth_HashValue);8312 conn->preauth_info->Preauth_HashValue);
8177 8313
@@ -8278,16 +8414,8 @@ int smb3_decrypt_req(struct ksmbd_work *work) · 100 unmodified lines
8278 unsigned int buf_data_size = pdu_length + 4 -8414 unsigned int buf_data_size = pdu_length + 4 -
8279 sizeof(struct smb2_transform_hdr);8415 sizeof(struct smb2_transform_hdr);
8280 struct smb2_transform_hdr *tr_hdr = (struct smb2_transform_hdr *)buf;8416 struct smb2_transform_hdr *tr_hdr = (struct smb2_transform_hdr *)buf;
8281 unsigned int orig_len = le32_to_cpu(tr_hdr->OriginalMessageSize);
8282 int rc = 0;8417 int rc = 0;
8283 8418
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
8291 if (pdu_length + 4 <8419 if (pdu_length + 4 <
8292 sizeof(struct smb2_transform_hdr) + sizeof(struct smb2_hdr)) {8420 sizeof(struct smb2_transform_hdr) + sizeof(struct smb2_hdr)) {
8293 pr_err("Transform message is too small (%u)\n",8421 pr_err("Transform message is too small (%u)\n",
@@ -8295,11 +8423,19 @@ int smb3_decrypt_req(struct ksmbd_work *work) · 1 unmodified line
8295 return -ECONNABORTED;8423 return -ECONNABORTED;
8296 }8424 }
8297 8425
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)) {
8299 pr_err("Transform message is broken\n");8428 pr_err("Transform message is broken\n");
8300 return -ECONNABORTED;8429 return -ECONNABORTED;
8301 }8430 }
8302 8431
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
8303 iov[0].iov_base = buf;8439 iov[0].iov_base = buf;
8304 iov[0].iov_len = sizeof(struct smb2_transform_hdr);8440 iov[0].iov_len = sizeof(struct smb2_transform_hdr);
8305 iov[1].iov_base = buf + sizeof(struct smb2_transform_hdr);8441 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
1464 char FileName[1];1464 char FileName[1];
1465} __packed; /* level 18 Query */1465} __packed; /* level 18 Query */
1466 1466
1467struct 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
1467struct smb2_file_alt_name_info {1476struct smb2_file_alt_name_info {
1468 __le32 FileNameLength;1477 __le32 FileNameLength;
1469 char FileName[0];1478 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
155 */155 */
156bool ksmbd_smb_request(struct ksmbd_conn *conn)156bool ksmbd_smb_request(struct ksmbd_conn *conn)
157{157{
158 int type = *(char *)conn->request_buf;158 return conn->request_buf[0] == 0;
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;
172}159}
173 160
174static bool supported_protocol(int idx)161static bool supported_protocol(int idx)
@@ -182,10 +169,12 @@ static bool supported_protocol(int idx) · 7 unmodified lines
182 idx <= server_conf.max_protocol);169 idx <= server_conf.max_protocol);
183}170}
184 171
185static char *next_dialect(char *dialect, int *next_off)172static char *next_dialect(char *dialect, int *next_off, int bcount)
186{173{
187 dialect = dialect + *next_off;174 dialect = dialect + *next_off;
188 *next_off = strlen(dialect);175 *next_off = strnlen(dialect, bcount);
176 if (dialect[*next_off] != '\0')
177 return NULL;
189 return dialect;178 return dialect;
190}179}
191 180
@@ -200,7 +189,9 @@ static int ksmbd_lookup_dialect_by_name(char *cli_dialects, __le16 byte_count) · 8 unmodified lines
200 dialect = cli_dialects;189 dialect = cli_dialects;
201 bcount = le16_to_cpu(byte_count);190 bcount = le16_to_cpu(byte_count);
202 do {191 do {
203 dialect = next_dialect(dialect, &next);192 dialect = next_dialect(dialect, &next, bcount);
193 if (!dialect)
194 break;
204 ksmbd_debug(SMB, "client requested dialect %s\n",195 ksmbd_debug(SMB, "client requested dialect %s\n",
205 dialect);196 dialect);
206 if (!strcmp(dialect, smb1_protos[i].name)) {197 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
248 239
249static int ksmbd_negotiate_smb_dialect(void *buf)240static int ksmbd_negotiate_smb_dialect(void *buf)
250{241{
251 __le32 proto;242 int smb_buf_length = get_rfc1002_len(buf);
243 __le32 proto = ((struct smb2_hdr *)buf)->ProtocolId;
252 244
253 proto = ((struct smb2_hdr *)buf)->ProtocolId;
254 if (proto == SMB2_PROTO_NUMBER) {245 if (proto == SMB2_PROTO_NUMBER) {
255 struct smb2_negotiate_req *req;246 struct smb2_negotiate_req *req;
247 int smb2_neg_size =
248 offsetof(struct smb2_negotiate_req, Dialects) - 4;
256 249
257 req = (struct smb2_negotiate_req *)buf;250 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
258 return ksmbd_lookup_dialect_by_id(req->Dialects,258 return ksmbd_lookup_dialect_by_id(req->Dialects,
259 req->DialectCount);259 req->DialectCount);
260 }260 }
@@ -264,10 +264,19 @@ static int ksmbd_negotiate_smb_dialect(void *buf) · 3 unmodified lines
264 struct smb_negotiate_req *req;264 struct smb_negotiate_req *req;
265 265
266 req = (struct smb_negotiate_req *)buf;266 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
267 return ksmbd_lookup_dialect_by_name(req->DialectsArray,275 return ksmbd_lookup_dialect_by_name(req->DialectsArray,
268 req->ByteCount);276 req->ByteCount);
269 }277 }
270 278
279err_out:
271 return BAD_PROT_ID;280 return BAD_PROT_ID;
272}281}
273 282
fs/ksmbd/smb_common.h+0−8
@@ -48,14 +48,6 @@ · 47 unmodified lines
48#define CIFS_DEFAULT_IOSIZE (64 * 1024)48#define CIFS_DEFAULT_IOSIZE (64 * 1024)
49#define MAX_CIFS_SMALL_BUFFER_SIZE 448 /* big enough for most */49#define MAX_CIFS_SMALL_BUFFER_SIZE 448 /* big enough for most */
50 50
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
59/* Responses when opening a file. */51/* Responses when opening a file. */
60#define F_SUPERSEDED 052#define F_SUPERSEDED 0
61#define F_OPENED 153#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
380{380{
381 int i, ret;381 int i, ret;
382 int num_aces = 0;382 int num_aces = 0;
383 int acl_size;383 unsigned int acl_size;
384 char *acl_base;384 char *acl_base;
385 struct smb_ace **ppace;385 struct smb_ace **ppace;
386 struct posix_acl_entry *cf_pace, *cf_pdace;386 struct posix_acl_entry *cf_pace, *cf_pdace;
@@ -392,7 +392,7 @@ static void parse_dacl(struct user_namespace *user_ns, · 5 unmodified lines
392 return;392 return;
393 393
394 /* validate that we do not go past end of acl */394 /* 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) ||
396 end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) {396 end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) {
397 pr_err("ACL too small to parse DACL\n");397 pr_err("ACL too small to parse DACL\n");
398 return;398 return;
@@ -431,8 +431,22 @@ static void parse_dacl(struct user_namespace *user_ns, · 32 unmodified lines
431 * user/group/other have no permissions431 * user/group/other have no permissions
432 */432 */
433 for (i = 0; i < num_aces; ++i) {433 for (i = 0; i < num_aces; ++i) {
434 if (end_of_acl - acl_base < acl_size)
435 break;
436
434 ppace[i] = (struct smb_ace *)(acl_base + acl_size);437 ppace[i] = (struct smb_ace *)(acl_base + acl_size);
435 acl_base = (char *)ppace[i];438 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
436 acl_size = le16_to_cpu(ppace[i]->size);450 acl_size = le16_to_cpu(ppace[i]->size);
437 ppace[i]->access_req =451 ppace[i]->access_req =
438 smb_map_generic_desired_access(ppace[i]->access_req);452 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
807 if (!pntsd)821 if (!pntsd)
808 return -EIO;822 return -EIO;
809 823
824 if (acl_len < sizeof(struct smb_ntsd))
825 return -EINVAL;
826
810 owner_sid_ptr = (struct smb_sid *)((char *)pntsd +827 owner_sid_ptr = (struct smb_sid *)((char *)pntsd +
811 le32_to_cpu(pntsd->osidoffset));828 le32_to_cpu(pntsd->osidoffset));
812 group_sid_ptr = (struct smb_sid *)((char *)pntsd +829 group_sid_ptr = (struct smb_sid *)((char *)pntsd +
fs/ksmbd/transport_tcp.c+2−2
@@ -215,7 +215,7 @@ out_error: · 214 unmodified lines
215 * ksmbd_kthread_fn() - listen to new SMB connections and callback server215 * ksmbd_kthread_fn() - listen to new SMB connections and callback server
216 * @p: arguments to forker thread216 * @p: arguments to forker thread
217 *217 *
218 * Return: Returns a task_struct or ERR_PTR218 * Return: 0 on success, error number otherwise
219 */219 */
220static int ksmbd_kthread_fn(void *p)220static int ksmbd_kthread_fn(void *p)
221{221{
@@ -387,7 +387,7 @@ static void tcp_destroy_socket(struct socket *ksmbd_socket) · 165 unmodified lines
387/**387/**
388 * create_socket - create socket for ksmbd/0388 * create_socket - create socket for ksmbd/0
389 *389 *
390 * Return: Returns a task_struct or ERR_PTR390 * Return: 0 on success, error number otherwise
391 */391 */
392static int create_socket(struct interface *iface)392static int create_socket(struct interface *iface)
393{393{
fs/netfs/read_helper.c+1−1
@@ -150,7 +150,7 @@ static void netfs_clear_unread(struct netfs_read_subrequest *subreq) · 149 unmodified lines
150{150{
151 struct iov_iter iter;151 struct iov_iter iter;
152 152
153 iov_iter_xarray(&iter, WRITE, &subreq->rreq->mapping->i_pages,153 iov_iter_xarray(&iter, READ, &subreq->rreq->mapping->i_pages,
154 subreq->start + subreq->transferred,154 subreq->start + subreq->transferred,
155 subreq->len - subreq->transferred);155 subreq->len - subreq->transferred);
156 iov_iter_zero(iov_iter_count(&iter), &iter);156 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
42 42
43/**43/**
44 * locks_end_grace44 * locks_end_grace
45 * @net: net namespace that this lock manager belongs to
46 * @lm: who this grace period is for45 * @lm: who this grace period is for
47 *46 *
48 * Call this function to state that the given lock manager is ready to47 * 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
542}542}
543 543
544/**544/**
545 * nfsd_file_close_inode_sync - attempt to forcibly close a nfsd_file545 * nfsd_file_close_inode - attempt a delayed close of a nfsd_file
546 * @inode: inode of the file to attempt to remove546 * @inode: inode of the file to attempt to remove
547 *547 *
548 * Walk the whole hash bucket, looking for any files that correspond to "inode".548 * 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
3544 goto fail;3544 goto fail;
3545 cd->rd_maxcount -= entry_bytes;3545 cd->rd_maxcount -= entry_bytes;
3546 /*3546 /*
3547 * RFC 3530 14.2.24 describes rd_dircount as only a "hint", so3547 * RFC 3530 14.2.24 describes rd_dircount as only a "hint", and
3548 * let's always let through the first entry, at least:3548 * notes that it could be zero. If it is zero, then the server
3549 * should enforce only the rd_maxcount value.
3549 */3550 */
3550 if (!cd->rd_dircount)3551 if (cd->rd_dircount) {
3551 goto fail;3552 name_and_cookie = 4 + 4 * XDR_QUADLEN(namlen) + 8;
3552 name_and_cookie = 4 + 4 * XDR_QUADLEN(namlen) + 8;3553 if (name_and_cookie > cd->rd_dircount && cd->cookie_offset)
3553 if (name_and_cookie > cd->rd_dircount && cd->cookie_offset)3554 goto fail;
3554 goto fail;3555 cd->rd_dircount -= min(cd->rd_dircount, name_and_cookie);
3555 cd->rd_dircount -= min(cd->rd_dircount, name_and_cookie);3556 if (!cd->rd_dircount)
3557 cd->rd_maxcount = 0;
3558 }
3556 3559
3557 cd->cookie_offset = cookie_offset;3560 cd->cookie_offset = cookie_offset;
3558skip_entry:3561skip_entry:
fs/nfsd/nfsctl.c+5−2
@@ -793,7 +793,10 @@ out_close: · 792 unmodified lines
793 svc_xprt_put(xprt);793 svc_xprt_put(xprt);
794 }794 }
795out_err:795out_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);
797 return err;800 return err;
798}801}
799 802
@@ -1545,7 +1548,7 @@ static int __init init_nfsd(void) · 745 unmodified lines
1545 goto out_free_all;1548 goto out_free_all;
1546 return 0;1549 return 0;
1547out_free_all:1550out_free_all:
1548 unregister_pernet_subsys(&nfsd_net_ops);1551 unregister_filesystem(&nfsd_fs_type);
1549out_free_exports:1552out_free_exports:
1550 remove_proc_entry("fs/nfs/exports", NULL);1553 remove_proc_entry("fs/nfs/exports", NULL);
1551 remove_proc_entry("fs/nfs", NULL);1554 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
1219 goto out_dput;1219 goto out_dput;
1220 }1220 }
1221 } else {1221 } else {
1222 if (!d_is_negative(newdentry) &&1222 if (!d_is_negative(newdentry)) {
1223 (!new_opaque || !ovl_is_whiteout(newdentry)))1223 if (!new_opaque || !ovl_is_whiteout(newdentry))
1224 goto out_dput;1224 goto out_dput;
1225 } else {
1226 if (flags & RENAME_EXCHANGE)
1227 goto out_dput;
1228 }
1225 }1229 }
1226 1230
1227 if (olddentry == trap)1231 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
296 if (ret)296 if (ret)
297 return ret;297 return ret;
298 298
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
299 old_cred = ovl_override_creds(file_inode(file)->i_sb);305 old_cred = ovl_override_creds(file_inode(file)->i_sb);
300 if (is_sync_kiocb(iocb)) {306 if (is_sync_kiocb(iocb)) {
301 ret = vfs_iter_read(real.file, iter, &iocb->ki_pos,307 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
320out:326out:
321 revert_creds(old_cred);327 revert_creds(old_cred);
322 ovl_file_accessed(file);328 ovl_file_accessed(file);
323 329out_fdput:
324 fdput(real);330 fdput(real);
325 331
326 return ret;332 return ret;
@@ -349,6 +355,12 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter) · 22 unmodified lines
349 if (ret)355 if (ret)
350 goto out_unlock;356 goto out_unlock;
351 357
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
352 if (!ovl_should_sync(OVL_FS(inode->i_sb)))364 if (!ovl_should_sync(OVL_FS(inode->i_sb)))
353 ifl &= ~(IOCB_DSYNC | IOCB_SYNC);365 ifl &= ~(IOCB_DSYNC | IOCB_SYNC);
354 366
@@ -384,6 +396,7 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter) · 29 unmodified lines
384 }396 }
385out:397out:
386 revert_creds(old_cred);398 revert_creds(old_cred);
399out_fdput:
387 fdput(real);400 fdput(real);
388 401
389out_unlock:402out_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
996 * cpumask; Typically used by bin_attribute to export cpumask bitmask996 * cpumask; Typically used by bin_attribute to export cpumask bitmask
997 * ABI.997 * ABI.
998 *998 *
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'.
1000 */1001 */
1001static inline ssize_t1002static inline ssize_t
1002cpumap_print_bitmask_to_buf(char *buf, const struct cpumask *mask,1003cpumap_print_bitmask_to_buf(char *buf, const struct cpumask *mask,
1003 loff_t off, size_t count)1004 loff_t off, size_t count)
1004{1005{
1005 return bitmap_print_bitmask_to_buf(buf, cpumask_bits(mask),1006 return bitmap_print_bitmask_to_buf(buf, cpumask_bits(mask),
1006 nr_cpu_ids, off, count);1007 nr_cpu_ids, off, count) - 1;
1007}1008}
1008 1009
1009/**1010/**
@@ -1018,7 +1019,7 @@ cpumap_print_list_to_buf(char *buf, const struct cpumask *mask, · 8 unmodified lines
1018 loff_t off, size_t count)1019 loff_t off, size_t count)
1019{1020{
1020 return bitmap_print_list_to_buf(buf, cpumask_bits(mask),1021 return bitmap_print_list_to_buf(buf, cpumask_bits(mask),
1021 nr_cpu_ids, off, count);1022 nr_cpu_ids, off, count) - 1;
1022}1023}
1023 1024
1024#if NR_CPUS <= BITS_PER_LONG1025#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
314 */314 */
315static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)315static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
316{316{
317 ether_addr_copy(dev->dev_addr, addr);317 __dev_addr_set(dev, addr, ETH_ALEN);
318}318}
319 319
320/**320/**
include/linux/fwnode.h+8−3
@@ -22,10 +22,15 @@ struct device; · 21 unmodified lines
22 * LINKS_ADDED: The fwnode has already be parsed to add fwnode links.22 * LINKS_ADDED: The fwnode has already be parsed to add fwnode links.
23 * NOT_DEVICE: The fwnode will never be populated as a struct device.23 * NOT_DEVICE: The fwnode will never be populated as a struct device.
24 * INITIALIZED: The hardware corresponding to fwnode has been initialized.24 * 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.
25 */29 */
26#define FWNODE_FLAG_LINKS_ADDED BIT(0)30#define FWNODE_FLAG_LINKS_ADDED BIT(0)
27#define FWNODE_FLAG_NOT_DEVICE BIT(1)31#define FWNODE_FLAG_NOT_DEVICE BIT(1)
28#define FWNODE_FLAG_INITIALIZED BIT(2)32#define FWNODE_FLAG_INITIALIZED BIT(2)
33#define FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD BIT(3)
29 34
30struct fwnode_handle {35struct fwnode_handle {
31 struct fwnode_handle *secondary;36 struct fwnode_handle *secondary;
include/linux/perf_event.h+3−1
@@ -684,7 +684,9 @@ struct perf_event { · 683 unmodified lines
684 /*684 /*
685 * timestamp shadows the actual context timing but it can685 * timestamp shadows the actual context timing but it can
686 * be safely used in NMI interrupt context. It reflects the686 * 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.
688 *690 *
689 * ctx_time already accounts for ctx->timestamp. Therefore to691 * ctx_time already accounts for ctx->timestamp. Therefore to
690 * compute ctx_time for a sample, simply add perf_clock().692 * 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
48 u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);48 u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
49 49
50 int (*ocpi_enable)(void);50 int (*ocpi_enable)(void);
51
52 void (*lb_reset)(void);
51};53};
52 54
53#endif /* __LINUX_USB_OMAP1_H */55#endif /* __LINUX_USB_OMAP1_H */
include/linux/sched.h+1−1
@@ -1720,7 +1720,7 @@ extern struct pid *cad_pid; · 1719 unmodified lines
1720#define tsk_used_math(p) ((p)->flags & PF_USED_MATH)1720#define tsk_used_math(p) ((p)->flags & PF_USED_MATH)
1721#define used_math() tsk_used_math(current)1721#define used_math() tsk_used_math(current)
1722 1722
1723static inline bool is_percpu_thread(void)1723static __always_inline bool is_percpu_thread(void)
1724{1724{
1725#ifdef CONFIG_SMP1725#ifdef CONFIG_SMP
1726 return (current->flags & PF_NO_SETAFFINITY) &&1726 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
17struct nft_ct_frag6_pernet {17struct nft_ct_frag6_pernet {
18 struct ctl_table_header *nf_frag_frags_hdr;18 struct ctl_table_header *nf_frag_frags_hdr;
19 struct fqdir *fqdir;19 struct fqdir *fqdir;
20 unsigned int users;
21};20};
22 21
23#endif /* _NF_DEFRAG_IPV6_H */22#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
1202 1202
1203void nft_obj_notify(struct net *net, const struct nft_table *table,1203void nft_obj_notify(struct net *net, const struct nft_table *table,
1204 struct nft_object *obj, u32 portid, u32 seq,1204 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);
1206 1206
1207/**1207/**
1208 * struct nft_object_type - stateful object type1208 * struct nft_object_type - stateful object type
include/net/netns/netfilter.h+6−0
@@ -27,5 +27,11 @@ struct netns_nf { · 26 unmodified lines
27#if IS_ENABLED(CONFIG_DECNET)27#if IS_ENABLED(CONFIG_DECNET)
28 struct nf_hook_entries __rcu *hooks_decnet[NF_DN_NUMHOOKS];28 struct nf_hook_entries __rcu *hooks_decnet[NF_DN_NUMHOOKS];
29#endif29#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
30};36};
31#endif37#endif
include/net/sock.h+1−0
@@ -307,6 +307,7 @@ struct bpf_local_storage; · 306 unmodified lines
307 * @sk_priority: %SO_PRIORITY setting307 * @sk_priority: %SO_PRIORITY setting
308 * @sk_type: socket type (%SOCK_STREAM, etc)308 * @sk_type: socket type (%SOCK_STREAM, etc)
309 * @sk_protocol: which protocol this socket belongs in this network family309 * @sk_protocol: which protocol this socket belongs in this network family
310 * @sk_peer_lock: lock protecting @sk_peer_pid and @sk_peer_cred
310 * @sk_peer_pid: &struct pid for this socket's peer311 * @sk_peer_pid: &struct pid for this socket's peer
311 * @sk_peer_cred: %SO_PEERCRED setting312 * @sk_peer_cred: %SO_PEERCRED setting
312 * @sk_rcvlowat: %SO_RCVLOWAT setting313 * @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
704int ocelot_vcap_filter_del(struct ocelot *ocelot,704int ocelot_vcap_filter_del(struct ocelot *ocelot,
705 struct ocelot_vcap_filter *rule);705 struct ocelot_vcap_filter *rule);
706struct ocelot_vcap_filter *706struct ocelot_vcap_filter *
707ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block, int id,707ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block,
708 bool tc_offload);708 unsigned long cookie, bool tc_offload);
709 709
710#endif /* _OCELOT_VCAP_H_ */710#endif /* _OCELOT_VCAP_H_ */
include/trace/events/cachefiles.h+3−3
@@ -178,7 +178,7 @@ TRACE_EVENT(cachefiles_unlink, · 177 unmodified lines
178 ),178 ),
179 179
180 TP_fast_assign(180 TP_fast_assign(
181 __entry->obj = obj->fscache.debug_id;181 __entry->obj = obj ? obj->fscache.debug_id : UINT_MAX;
182 __entry->de = de;182 __entry->de = de;
183 __entry->why = why;183 __entry->why = why;
184 ),184 ),
@@ -205,7 +205,7 @@ TRACE_EVENT(cachefiles_rename, · 20 unmodified lines
205 ),205 ),
206 206
207 TP_fast_assign(207 TP_fast_assign(
208 __entry->obj = obj->fscache.debug_id;208 __entry->obj = obj ? obj->fscache.debug_id : UINT_MAX;
209 __entry->de = de;209 __entry->de = de;
210 __entry->to = to;210 __entry->to = to;
211 __entry->why = why;211 __entry->why = why;
@@ -305,7 +305,7 @@ TRACE_EVENT(cachefiles_mark_buried, · 93 unmodified lines
305 ),305 ),
306 306
307 TP_fast_assign(307 TP_fast_assign(
308 __entry->obj = obj->fscache.debug_id;308 __entry->obj = obj ? obj->fscache.debug_id : UINT_MAX;
309 __entry->de = de;309 __entry->de = de;
310 __entry->why = why;310 __entry->why = why;
311 ),311 ),
include/uapi/linux/hyperv.h+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#ifndef _UAPI_HYPERV_H26#ifndef _UAPI_HYPERV_H
27#define _UAPI_HYPERV_H27#define _UAPI_HYPERV_H
28 28
29#include <linux/uuid.h>29#include <linux/types.h>
30 30
31/*31/*
32 * Framework version for util services.32 * Framework version for util services.
include/uapi/linux/xfrm.h+9−6
@@ -213,13 +213,13 @@ enum { · 212 unmodified lines
213 XFRM_MSG_GETSPDINFO,213 XFRM_MSG_GETSPDINFO,
214#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO214#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO
215 215
216 XFRM_MSG_MAPPING,
217#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING
218
216 XFRM_MSG_SETDEFAULT,219 XFRM_MSG_SETDEFAULT,
217#define XFRM_MSG_SETDEFAULT XFRM_MSG_SETDEFAULT220#define XFRM_MSG_SETDEFAULT XFRM_MSG_SETDEFAULT
218 XFRM_MSG_GETDEFAULT,221 XFRM_MSG_GETDEFAULT,
219#define XFRM_MSG_GETDEFAULT XFRM_MSG_GETDEFAULT222#define XFRM_MSG_GETDEFAULT XFRM_MSG_GETDEFAULT
220
221 XFRM_MSG_MAPPING,
222#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING
223 __XFRM_MSG_MAX223 __XFRM_MSG_MAX
224};224};
225#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)225#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -514,9 +514,12 @@ struct xfrm_user_offload { · 288 unmodified lines
514#define XFRM_OFFLOAD_INBOUND 2514#define XFRM_OFFLOAD_INBOUND 2
515 515
516struct xfrm_userpolicy_default {516struct xfrm_userpolicy_default {
517#define XFRM_USERPOLICY_DIRMASK_MAX (sizeof(__u8) * 8)517#define XFRM_USERPOLICY_UNSPEC 0
518 __u8 dirmask;518#define XFRM_USERPOLICY_BLOCK 1
519 __u8 action;519#define XFRM_USERPOLICY_ACCEPT 2
520 __u8 in;
521 __u8 fwd;
522 __u8 out;
520};523};
521 524
522#ifndef __KERNEL__525#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
63 63
64static int prealloc_elems_and_freelist(struct bpf_stack_map *smap)64static int prealloc_elems_and_freelist(struct bpf_stack_map *smap)
65{65{
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;
67 int err;68 int err;
68 69
69 smap->elems = bpf_map_area_alloc(elem_size * smap->map.max_entries,70 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
3707 return 0;3707 return 0;
3708}3708}
3709 3709
3710static 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
3722static 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
3710static int merge_sched_in(struct perf_event *event, void *data)3733static int merge_sched_in(struct perf_event *event, void *data)
3711{3734{
3712 struct perf_event_context *ctx = event->ctx;3735 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
3725 }3748 }
3726 3749
3727 if (event->state == PERF_EVENT_STATE_INACTIVE) {3750 if (event->state == PERF_EVENT_STATE_INACTIVE) {
3751 *can_add_hw = 0;
3728 if (event->attr.pinned) {3752 if (event->attr.pinned) {
3729 perf_cgroup_event_disable(event, ctx);3753 perf_cgroup_event_disable(event, ctx);
3730 perf_event_set_state(event, PERF_EVENT_STATE_ERROR);3754 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);
3731 }3759 }
3732
3733 *can_add_hw = 0;
3734 ctx->rotate_necessary = 1;
3735 perf_mux_hrtimer_restart(cpuctx);
3736 }3760 }
3737 3761
3738 return 0;3762 return 0;
@@ -6324,6 +6348,8 @@ accounting: · 2585 unmodified lines
6324 6348
6325 ring_buffer_attach(event, rb);6349 ring_buffer_attach(event, rb);
6326 6350
6351 perf_event_update_time(event);
6352 perf_set_shadow_time(event, event->ctx);
6327 perf_event_init_userpage(event);6353 perf_event_init_userpage(event);
6328 perf_event_update_userpage(event);6354 perf_event_update_userpage(event);
6329 } else {6355 } 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
173 size_t cnt, loff_t *ppos)173 size_t cnt, loff_t *ppos)
174{174{
175 char buf[16];175 char buf[16];
176 unsigned int scaling;
176 177
177 if (cnt > 15)178 if (cnt > 15)
178 cnt = 15;179 cnt = 15;
179 180
180 if (copy_from_user(&buf, ubuf, cnt))181 if (copy_from_user(&buf, ubuf, cnt))
181 return -EFAULT;182 return -EFAULT;
183 buf[cnt] = '\0';
182 184
183 if (kstrtouint(buf, 10, &sysctl_sched_tunable_scaling))185 if (kstrtouint(buf, 10, &scaling))
184 return -EINVAL;186 return -EINVAL;
185 187
188 if (scaling >= SCHED_TUNABLESCALING_END)
189 return -EINVAL;
190
191 sysctl_sched_tunable_scaling = scaling;
186 if (sched_update_scaling())192 if (sched_update_scaling())
187 return -EINVAL;193 return -EINVAL;
188 194
kernel/sched/fair.c+5−1
@@ -4936,8 +4936,12 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq) · 4935 unmodified lines
4936 /* update hierarchical throttle state */4936 /* update hierarchical throttle state */
4937 walk_tg_tree_from(cfs_rq->tg, tg_nop, tg_unthrottle_up, (void *)rq);4937 walk_tg_tree_from(cfs_rq->tg, tg_nop, tg_unthrottle_up, (void *)rq);
4938 4938
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;
4940 return;4943 return;
4944 }
4941 4945
4942 task_delta = cfs_rq->h_nr_running;4946 task_delta = cfs_rq->h_nr_running;
4943 idle_task_delta = cfs_rq->idle_h_nr_running;4947 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
1666 }1666 }
1667 1667
1668 return numvls * nla_total_size(sizeof(struct bridge_vlan_xstats)) +1668 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) +
1670 nla_total_size(0);1671 nla_total_size(0);
1671}1672}
1672 1673
net/core/rtnetlink.c+1−1
@@ -5262,7 +5262,7 @@ nla_put_failure: · 5261 unmodified lines
5262static size_t if_nlmsg_stats_size(const struct net_device *dev,5262static size_t if_nlmsg_stats_size(const struct net_device *dev,
5263 u32 filter_mask)5263 u32 filter_mask)
5264{5264{
5265 size_t size = 0;5265 size_t size = NLMSG_ALIGN(sizeof(struct if_stats_msg));
5266 5266
5267 if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_64, 0))5267 if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_64, 0))
5268 size += nla_total_size_64bit(sizeof(struct rtnl_link_stats64));5268 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
210 cmd = dsa_header[0] >> 6;210 cmd = dsa_header[0] >> 6;
211 switch (cmd) {211 switch (cmd) {
212 case DSA_CMD_FORWARD:212 case DSA_CMD_FORWARD:
213 trunk = !!(dsa_header[1] & 7);213 trunk = !!(dsa_header[1] & 4);
214 break;214 break;
215 215
216 case DSA_CMD_TO_CPU:216 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
242 242
243 if (!inet_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif))243 if (!inet_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif))
244 return -1;244 return -1;
245 score = sk->sk_bound_dev_if ? 2 : 1;
245 246
246 score = sk->sk_family == PF_INET ? 2 : 1;247 if (sk->sk_family == PF_INET)
248 score++;
247 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())249 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())
248 score++;250 score++;
249 }251 }
net/ipv4/netfilter/nf_defrag_ipv4.c+9−21
@@ -20,13 +20,8 @@ · 19 unmodified lines
20#endif20#endif
21#include <net/netfilter/nf_conntrack_zones.h>21#include <net/netfilter/nf_conntrack_zones.h>
22 22
23static unsigned int defrag4_pernet_id __read_mostly;
24static DEFINE_MUTEX(defrag4_mutex);23static DEFINE_MUTEX(defrag4_mutex);
25 24
26struct defrag4_pernet {
27 unsigned int users;
28};
29
30static int nf_ct_ipv4_gather_frags(struct net *net, struct sk_buff *skb,25static int nf_ct_ipv4_gather_frags(struct net *net, struct sk_buff *skb,
31 u_int32_t user)26 u_int32_t user)
32{27{
@@ -111,19 +106,15 @@ static const struct nf_hook_ops ipv4_defrag_ops[] = { · 78 unmodified lines
111 106
112static void __net_exit defrag4_net_exit(struct net *net)107static void __net_exit defrag4_net_exit(struct net *net)
113{108{
114 struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id);109 if (net->nf.defrag_ipv4_users) {
115
116 if (nf_defrag->users) {
117 nf_unregister_net_hooks(net, ipv4_defrag_ops,110 nf_unregister_net_hooks(net, ipv4_defrag_ops,
118 ARRAY_SIZE(ipv4_defrag_ops));111 ARRAY_SIZE(ipv4_defrag_ops));
119 nf_defrag->users = 0;112 net->nf.defrag_ipv4_users = 0;
120 }113 }
121}114}
122 115
123static struct pernet_operations defrag4_net_ops = {116static struct pernet_operations defrag4_net_ops = {
124 .exit = defrag4_net_exit,117 .exit = defrag4_net_exit,
125 .id = &defrag4_pernet_id,
126 .size = sizeof(struct defrag4_pernet),
127};118};
128 119
129static int __init nf_defrag_init(void)120static int __init nf_defrag_init(void)
@@ -138,24 +129,23 @@ static void __exit nf_defrag_fini(void) · 8 unmodified lines
138 129
139int nf_defrag_ipv4_enable(struct net *net)130int nf_defrag_ipv4_enable(struct net *net)
140{131{
141 struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id);
142 int err = 0;132 int err = 0;
143 133
144 mutex_lock(&defrag4_mutex);134 mutex_lock(&defrag4_mutex);
145 if (nf_defrag->users == UINT_MAX) {135 if (net->nf.defrag_ipv4_users == UINT_MAX) {
146 err = -EOVERFLOW;136 err = -EOVERFLOW;
147 goto out_unlock;137 goto out_unlock;
148 }138 }
149 139
150 if (nf_defrag->users) {140 if (net->nf.defrag_ipv4_users) {
151 nf_defrag->users++;141 net->nf.defrag_ipv4_users++;
152 goto out_unlock;142 goto out_unlock;
153 }143 }
154 144
155 err = nf_register_net_hooks(net, ipv4_defrag_ops,145 err = nf_register_net_hooks(net, ipv4_defrag_ops,
156 ARRAY_SIZE(ipv4_defrag_ops));146 ARRAY_SIZE(ipv4_defrag_ops));
157 if (err == 0)147 if (err == 0)
158 nf_defrag->users = 1;148 net->nf.defrag_ipv4_users = 1;
159 149
160 out_unlock:150 out_unlock:
161 mutex_unlock(&defrag4_mutex);151 mutex_unlock(&defrag4_mutex);
@@ -165,12 +155,10 @@ EXPORT_SYMBOL_GPL(nf_defrag_ipv4_enable); · 3 unmodified lines
165 155
166void nf_defrag_ipv4_disable(struct net *net)156void nf_defrag_ipv4_disable(struct net *net)
167{157{
168 struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id);
169
170 mutex_lock(&defrag4_mutex);158 mutex_lock(&defrag4_mutex);
171 if (nf_defrag->users) {159 if (net->nf.defrag_ipv4_users) {
172 nf_defrag->users--;160 net->nf.defrag_ipv4_users--;
173 if (nf_defrag->users == 0)161 if (net->nf.defrag_ipv4_users == 0)
174 nf_unregister_net_hooks(net, ipv4_defrag_ops,162 nf_unregister_net_hooks(net, ipv4_defrag_ops,
175 ARRAY_SIZE(ipv4_defrag_ops));163 ARRAY_SIZE(ipv4_defrag_ops));
176 }164 }
net/ipv4/udp.c+2−1
@@ -390,7 +390,8 @@ static int compute_score(struct sock *sk, struct net *net, · 389 unmodified lines
390 dif, sdif);390 dif, sdif);
391 if (!dev_match)391 if (!dev_match)
392 return -1;392 return -1;
393 score += 4;393 if (sk->sk_bound_dev_if)
394 score += 4;
394 395
395 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())396 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())
396 score++;397 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
106 if (!inet_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif))106 if (!inet_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif))
107 return -1;107 return -1;
108 108
109 score = 1;109 score = sk->sk_bound_dev_if ? 2 : 1;
110 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())110 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())
111 score++;111 score++;
112 }112 }
net/ipv6/netfilter/nf_conntrack_reasm.c+1−1
@@ -33,7 +33,7 @@ · 32 unmodified lines
33 33
34static const char nf_frags_cache_name[] = "nf-frags";34static const char nf_frags_cache_name[] = "nf-frags";
35 35
36unsigned int nf_frag_pernet_id __read_mostly;36static unsigned int nf_frag_pernet_id __read_mostly;
37static struct inet_frags nf_frags;37static struct inet_frags nf_frags;
38 38
39static struct nft_ct_frag6_pernet *nf_frag_pernet(struct net *net)39static 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
25#include <net/netfilter/nf_conntrack_zones.h>25#include <net/netfilter/nf_conntrack_zones.h>
26#include <net/netfilter/ipv6/nf_defrag_ipv6.h>26#include <net/netfilter/ipv6/nf_defrag_ipv6.h>
27 27
28extern unsigned int nf_frag_pernet_id;
29
30static DEFINE_MUTEX(defrag6_mutex);28static DEFINE_MUTEX(defrag6_mutex);
31 29
32static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum,30static 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
91 89
92static void __net_exit defrag6_net_exit(struct net *net)90static void __net_exit defrag6_net_exit(struct net *net)
93{91{
94 struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id);92 if (net->nf.defrag_ipv6_users) {
95
96 if (nf_frag->users) {
97 nf_unregister_net_hooks(net, ipv6_defrag_ops,93 nf_unregister_net_hooks(net, ipv6_defrag_ops,
98 ARRAY_SIZE(ipv6_defrag_ops));94 ARRAY_SIZE(ipv6_defrag_ops));
99 nf_frag->users = 0;95 net->nf.defrag_ipv6_users = 0;
100 }96 }
101}97}
102 98
@@ -134,24 +130,23 @@ static void __exit nf_defrag_fini(void) · 31 unmodified lines
134 130
135int nf_defrag_ipv6_enable(struct net *net)131int nf_defrag_ipv6_enable(struct net *net)
136{132{
137 struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id);
138 int err = 0;133 int err = 0;
139 134
140 mutex_lock(&defrag6_mutex);135 mutex_lock(&defrag6_mutex);
141 if (nf_frag->users == UINT_MAX) {136 if (net->nf.defrag_ipv6_users == UINT_MAX) {
142 err = -EOVERFLOW;137 err = -EOVERFLOW;
143 goto out_unlock;138 goto out_unlock;
144 }139 }
145 140
146 if (nf_frag->users) {141 if (net->nf.defrag_ipv6_users) {
147 nf_frag->users++;142 net->nf.defrag_ipv6_users++;
148 goto out_unlock;143 goto out_unlock;
149 }144 }
150 145
151 err = nf_register_net_hooks(net, ipv6_defrag_ops,146 err = nf_register_net_hooks(net, ipv6_defrag_ops,
152 ARRAY_SIZE(ipv6_defrag_ops));147 ARRAY_SIZE(ipv6_defrag_ops));
153 if (err == 0)148 if (err == 0)
154 nf_frag->users = 1;149 net->nf.defrag_ipv6_users = 1;
155 150
156 out_unlock:151 out_unlock:
157 mutex_unlock(&defrag6_mutex);152 mutex_unlock(&defrag6_mutex);
@@ -161,12 +156,10 @@ EXPORT_SYMBOL_GPL(nf_defrag_ipv6_enable); · 3 unmodified lines
161 156
162void nf_defrag_ipv6_disable(struct net *net)157void nf_defrag_ipv6_disable(struct net *net)
163{158{
164 struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id);
165
166 mutex_lock(&defrag6_mutex);159 mutex_lock(&defrag6_mutex);
167 if (nf_frag->users) {160 if (net->nf.defrag_ipv6_users) {
168 nf_frag->users--;161 net->nf.defrag_ipv6_users--;
169 if (nf_frag->users == 0)162 if (net->nf.defrag_ipv6_users == 0)
170 nf_unregister_net_hooks(net, ipv6_defrag_ops,163 nf_unregister_net_hooks(net, ipv6_defrag_ops,
171 ARRAY_SIZE(ipv6_defrag_ops));164 ARRAY_SIZE(ipv6_defrag_ops));
172 }165 }
net/ipv6/udp.c+2−1
@@ -133,7 +133,8 @@ static int compute_score(struct sock *sk, struct net *net, · 132 unmodified lines
133 dev_match = udp_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif);133 dev_match = udp_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif);
134 if (!dev_match)134 if (!dev_match)
135 return -1;135 return -1;
136 score++;136 if (sk->sk_bound_dev_if)
137 score++;
137 138
138 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())139 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id())
139 score++;140 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
780{780{
781 struct nftables_pernet *nft_net;781 struct nftables_pernet *nft_net;
782 struct sk_buff *skb;782 struct sk_buff *skb;
783 u16 flags = 0;
783 int err;784 int err;
784 785
785 if (!ctx->report &&786 if (!ctx->report &&
@@ -790,8 +791,11 @@ static void nf_tables_table_notify(const struct nft_ctx *ctx, int event) · 4 unmodified lines
790 if (skb == NULL)791 if (skb == NULL)
791 goto err;792 goto err;
792 793
794 if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL))
795 flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL);
796
793 err = nf_tables_fill_table_info(skb, ctx->net, ctx->portid, ctx->seq,797 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);
795 if (err < 0) {799 if (err < 0) {
796 kfree_skb(skb);800 kfree_skb(skb);
797 goto err;801 goto err;
@@ -1563,6 +1567,7 @@ static void nf_tables_chain_notify(const struct nft_ctx *ctx, int event) · 765 unmodified lines
1563{1567{
1564 struct nftables_pernet *nft_net;1568 struct nftables_pernet *nft_net;
1565 struct sk_buff *skb;1569 struct sk_buff *skb;
1570 u16 flags = 0;
1566 int err;1571 int err;
1567 1572
1568 if (!ctx->report &&1573 if (!ctx->report &&
@@ -1573,8 +1578,11 @@ static void nf_tables_chain_notify(const struct nft_ctx *ctx, int event) · 4 unmodified lines
1573 if (skb == NULL)1578 if (skb == NULL)
1574 goto err;1579 goto err;
1575 1580
1581 if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL))
1582 flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL);
1583
1576 err = nf_tables_fill_chain_info(skb, ctx->net, ctx->portid, ctx->seq,1584 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,
1578 ctx->chain);1586 ctx->chain);
1579 if (err < 0) {1587 if (err < 0) {
1580 kfree_skb(skb);1588 kfree_skb(skb);
@@ -2866,8 +2874,7 @@ static int nf_tables_fill_rule_info(struct sk_buff *skb, struct net *net, · 1285 unmodified lines
2866 u32 flags, int family,2874 u32 flags, int family,
2867 const struct nft_table *table,2875 const struct nft_table *table,
2868 const struct nft_chain *chain,2876 const struct nft_chain *chain,
2869 const struct nft_rule *rule,2877 const struct nft_rule *rule, u64 handle)
2870 const struct nft_rule *prule)
2871{2878{
2872 struct nlmsghdr *nlh;2879 struct nlmsghdr *nlh;
2873 const struct nft_expr *expr, *next;2880 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
2887 NFTA_RULE_PAD))2894 NFTA_RULE_PAD))
2888 goto nla_put_failure;2895 goto nla_put_failure;
2889 2896
2890 if (event != NFT_MSG_DELRULE && prule) {2897 if (event != NFT_MSG_DELRULE && handle) {
2891 if (nla_put_be64(skb, NFTA_RULE_POSITION,2898 if (nla_put_be64(skb, NFTA_RULE_POSITION, cpu_to_be64(handle),
2892 cpu_to_be64(prule->handle),
2893 NFTA_RULE_PAD))2899 NFTA_RULE_PAD))
2894 goto nla_put_failure;2900 goto nla_put_failure;
2895 }2901 }
@@ -2925,7 +2931,10 @@ static void nf_tables_rule_notify(const struct nft_ctx *ctx, · 29 unmodified lines
2925 const struct nft_rule *rule, int event)2931 const struct nft_rule *rule, int event)
2926{2932{
2927 struct nftables_pernet *nft_net = nft_pernet(ctx->net);2933 struct nftables_pernet *nft_net = nft_pernet(ctx->net);
2934 const struct nft_rule *prule;
2928 struct sk_buff *skb;2935 struct sk_buff *skb;
2936 u64 handle = 0;
2937 u16 flags = 0;
2929 int err;2938 int err;
2930 2939
2931 if (!ctx->report &&2940 if (!ctx->report &&
@@ -2936,9 +2945,20 @@ static void nf_tables_rule_notify(const struct nft_ctx *ctx, · 4 unmodified lines
2936 if (skb == NULL)2945 if (skb == NULL)
2937 goto err;2946 goto err;
2938 2947
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
2939 err = nf_tables_fill_rule_info(skb, ctx->net, ctx->portid, ctx->seq,2959 err = nf_tables_fill_rule_info(skb, ctx->net, ctx->portid, ctx->seq,
2940 event, 0, ctx->family, ctx->table,2960 event, flags, ctx->family, ctx->table,
2941 ctx->chain, rule, NULL);2961 ctx->chain, rule, handle);
2942 if (err < 0) {2962 if (err < 0) {
2943 kfree_skb(skb);2963 kfree_skb(skb);
2944 goto err;2964 goto err;
@@ -2964,6 +2984,7 @@ static int __nf_tables_dump_rules(struct sk_buff *skb, · 19 unmodified lines
2964 struct net *net = sock_net(skb->sk);2984 struct net *net = sock_net(skb->sk);
2965 const struct nft_rule *rule, *prule;2985 const struct nft_rule *rule, *prule;
2966 unsigned int s_idx = cb->args[0];2986 unsigned int s_idx = cb->args[0];
2987 u64 handle;
2967 2988
2968 prule = NULL;2989 prule = NULL;
2969 list_for_each_entry_rcu(rule, &chain->rules, list) {2990 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
2975 memset(&cb->args[1], 0,2996 memset(&cb->args[1], 0,
2976 sizeof(cb->args) - sizeof(cb->args[0]));2997 sizeof(cb->args) - sizeof(cb->args[0]));
2977 }2998 }
2999 if (prule)
3000 handle = prule->handle;
3001 else
3002 handle = 0;
3003
2978 if (nf_tables_fill_rule_info(skb, net, NETLINK_CB(cb->skb).portid,3004 if (nf_tables_fill_rule_info(skb, net, NETLINK_CB(cb->skb).portid,
2979 cb->nlh->nlmsg_seq,3005 cb->nlh->nlmsg_seq,
2980 NFT_MSG_NEWRULE,3006 NFT_MSG_NEWRULE,
2981 NLM_F_MULTI | NLM_F_APPEND,3007 NLM_F_MULTI | NLM_F_APPEND,
2982 table->family,3008 table->family,
2983 table, chain, rule, prule) < 0)3009 table, chain, rule, handle) < 0)
2984 return 1;3010 return 1;
2985 3011
2986 nl_dump_check_consistent(cb, nlmsg_hdr(skb));3012 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
3143 3169
3144 err = nf_tables_fill_rule_info(skb2, net, NETLINK_CB(skb).portid,3170 err = nf_tables_fill_rule_info(skb2, net, NETLINK_CB(skb).portid,
3145 info->nlh->nlmsg_seq, NFT_MSG_NEWRULE, 0,3171 info->nlh->nlmsg_seq, NFT_MSG_NEWRULE, 0,
3146 family, table, chain, rule, NULL);3172 family, table, chain, rule, 0);
3147 if (err < 0)3173 if (err < 0)
3148 goto err_fill_rule_info;3174 goto err_fill_rule_info;
3149 3175
@@ -3403,17 +3429,15 @@ static int nf_tables_newrule(struct sk_buff *skb, const struct nfnl_info *info, · 253 unmodified lines
3403 }3429 }
3404 3430
3405 if (info->nlh->nlmsg_flags & NLM_F_REPLACE) {3431 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
3406 trans = nft_trans_rule_add(&ctx, NFT_MSG_NEWRULE, rule);3436 trans = nft_trans_rule_add(&ctx, NFT_MSG_NEWRULE, rule);
3407 if (trans == NULL) {3437 if (trans == NULL) {
3408 err = -ENOMEM;3438 err = -ENOMEM;
3409 goto err_destroy_flow_rule;3439 goto err_destroy_flow_rule;
3410 }3440 }
3411 err = nft_delrule(&ctx, old_rule);
3412 if (err < 0) {
3413 nft_trans_destroy(trans);
3414 goto err_destroy_flow_rule;
3415 }
3416
3417 list_add_tail_rcu(&rule->list, &old_rule->list);3441 list_add_tail_rcu(&rule->list, &old_rule->list);
3418 } else {3442 } else {
3419 trans = nft_trans_rule_add(&ctx, NFT_MSG_NEWRULE, rule);3443 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
3943 gfp_t gfp_flags)3967 gfp_t gfp_flags)
3944{3968{
3945 struct nftables_pernet *nft_net = nft_pernet(ctx->net);3969 struct nftables_pernet *nft_net = nft_pernet(ctx->net);
3946 struct sk_buff *skb;
3947 u32 portid = ctx->portid;3970 u32 portid = ctx->portid;
3971 struct sk_buff *skb;
3972 u16 flags = 0;
3948 int err;3973 int err;
3949 3974
3950 if (!ctx->report &&3975 if (!ctx->report &&
@@ -3955,7 +3980,10 @@ static void nf_tables_set_notify(const struct nft_ctx *ctx, · 4 unmodified lines
3955 if (skb == NULL)3980 if (skb == NULL)
3956 goto err;3981 goto err;
3957 3982
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);
3959 if (err < 0) {3987 if (err < 0) {
3960 kfree_skb(skb);3988 kfree_skb(skb);
3961 goto err;3989 goto err;
@@ -5231,12 +5259,13 @@ static int nf_tables_getsetelem(struct sk_buff *skb, · 1269 unmodified lines
5231static void nf_tables_setelem_notify(const struct nft_ctx *ctx,5259static void nf_tables_setelem_notify(const struct nft_ctx *ctx,
5232 const struct nft_set *set,5260 const struct nft_set *set,
5233 const struct nft_set_elem *elem,5261 const struct nft_set_elem *elem,
5234 int event, u16 flags)5262 int event)
5235{5263{
5236 struct nftables_pernet *nft_net;5264 struct nftables_pernet *nft_net;
5237 struct net *net = ctx->net;5265 struct net *net = ctx->net;
5238 u32 portid = ctx->portid;5266 u32 portid = ctx->portid;
5239 struct sk_buff *skb;5267 struct sk_buff *skb;
5268 u16 flags = 0;
5240 int err;5269 int err;
5241 5270
5242 if (!ctx->report && !nfnetlink_has_listeners(net, NFNLGRP_NFTABLES))5271 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
5246 if (skb == NULL)5275 if (skb == NULL)
5247 goto err;5276 goto err;
5248 5277
5278 if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL))
5279 flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL);
5280
5249 err = nf_tables_fill_setelem_info(skb, ctx, 0, portid, event, flags,5281 err = nf_tables_fill_setelem_info(skb, ctx, 0, portid, event, flags,
5250 set, elem);5282 set, elem);
5251 if (err < 0) {5283 if (err < 0) {
@@ -6921,7 +6953,7 @@ static int nf_tables_delobj(struct sk_buff *skb, const struct nfnl_info *info, · 1669 unmodified lines
6921 6953
6922void nft_obj_notify(struct net *net, const struct nft_table *table,6954void nft_obj_notify(struct net *net, const struct nft_table *table,
6923 struct nft_object *obj, u32 portid, u32 seq, int event,6955 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)
6925{6957{
6926 struct nftables_pernet *nft_net = nft_pernet(net);6958 struct nftables_pernet *nft_net = nft_pernet(net);
6927 struct sk_buff *skb;6959 struct sk_buff *skb;
@@ -6946,8 +6978,9 @@ void nft_obj_notify(struct net *net, const struct nft_table *table, · 18 unmodified lines
6946 if (skb == NULL)6978 if (skb == NULL)
6947 goto err;6979 goto err;
6948 6980
6949 err = nf_tables_fill_obj_info(skb, net, portid, seq, event, 0, family,6981 err = nf_tables_fill_obj_info(skb, net, portid, seq, event,
6950 table, obj, false);6982 flags & (NLM_F_CREATE | NLM_F_EXCL),
6983 family, table, obj, false);
6951 if (err < 0) {6984 if (err < 0) {
6952 kfree_skb(skb);6985 kfree_skb(skb);
6953 goto err;6986 goto err;
@@ -6964,7 +6997,7 @@ static void nf_tables_obj_notify(const struct nft_ctx *ctx, · 10 unmodified lines
6964 struct nft_object *obj, int event)6997 struct nft_object *obj, int event)
6965{6998{
6966 nft_obj_notify(ctx->net, ctx->table, obj, ctx->portid, ctx->seq, event,6999 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);
6968}7001}
6969 7002
6970/*7003/*
@@ -7745,6 +7778,7 @@ static void nf_tables_flowtable_notify(struct nft_ctx *ctx, · 774 unmodified lines
7745{7778{
7746 struct nftables_pernet *nft_net = nft_pernet(ctx->net);7779 struct nftables_pernet *nft_net = nft_pernet(ctx->net);
7747 struct sk_buff *skb;7780 struct sk_buff *skb;
7781 u16 flags = 0;
7748 int err;7782 int err;
7749 7783
7750 if (!ctx->report &&7784 if (!ctx->report &&
@@ -7755,8 +7789,11 @@ static void nf_tables_flowtable_notify(struct nft_ctx *ctx, · 4 unmodified lines
7755 if (skb == NULL)7789 if (skb == NULL)
7756 goto err;7790 goto err;
7757 7791
7792 if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL))
7793 flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL);
7794
7758 err = nf_tables_fill_flowtable_info(skb, ctx->net, ctx->portid,7795 err = nf_tables_fill_flowtable_info(skb, ctx->net, ctx->portid,
7759 ctx->seq, event, 0,7796 ctx->seq, event, flags,
7760 ctx->family, flowtable, hook_list);7797 ctx->family, flowtable, hook_list);
7761 if (err < 0) {7798 if (err < 0) {
7762 kfree_skb(skb);7799 kfree_skb(skb);
@@ -8634,7 +8671,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) · 871 unmodified lines
8634 nft_setelem_activate(net, te->set, &te->elem);8671 nft_setelem_activate(net, te->set, &te->elem);
8635 nf_tables_setelem_notify(&trans->ctx, te->set,8672 nf_tables_setelem_notify(&trans->ctx, te->set,
8636 &te->elem,8673 &te->elem,
8637 NFT_MSG_NEWSETELEM, 0);8674 NFT_MSG_NEWSETELEM);
8638 nft_trans_destroy(trans);8675 nft_trans_destroy(trans);
8639 break;8676 break;
8640 case NFT_MSG_DELSETELEM:8677 case NFT_MSG_DELSETELEM:
@@ -8642,7 +8679,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) · 1 unmodified line
8642 8679
8643 nf_tables_setelem_notify(&trans->ctx, te->set,8680 nf_tables_setelem_notify(&trans->ctx, te->set,
8644 &te->elem,8681 &te->elem,
8645 NFT_MSG_DELSETELEM, 0);8682 NFT_MSG_DELSETELEM);
8646 nft_setelem_remove(net, te->set, &te->elem);8683 nft_setelem_remove(net, te->set, &te->elem);
8647 if (!nft_setelem_is_catchall(te->set, &te->elem)) {8684 if (!nft_setelem_is_catchall(te->set, &te->elem)) {
8648 atomic_dec(&te->set->nelems);8685 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
60 if (overquota &&60 if (overquota &&
61 !test_and_set_bit(NFT_QUOTA_DEPLETED_BIT, &priv->flags))61 !test_and_set_bit(NFT_QUOTA_DEPLETED_BIT, &priv->flags))
62 nft_obj_notify(nft_net(pkt), obj->key.table, obj, 0, 0,62 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);
64}64}
65 65
66static int nft_quota_do_init(const struct nlattr * const tb[],66static 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
594 594
595 /* We need to ensure that the socket is hashed and visible. */595 /* We need to ensure that the socket is hashed and visible. */
596 smp_wmb();596 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);
598 601
599err:602err:
600 release_sock(sk);603 release_sock(sk);
@@ -1012,7 +1015,8 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr, · 411 unmodified lines
1012 if (nlk->ngroups < BITS_PER_LONG)1015 if (nlk->ngroups < BITS_PER_LONG)
1013 groups &= (1UL << nlk->ngroups) - 1;1016 groups &= (1UL << nlk->ngroups) - 1;
1014 1017
1015 bound = nlk->bound;1018 /* Paired with WRITE_ONCE() in netlink_insert() */
1019 bound = READ_ONCE(nlk->bound);
1016 if (bound) {1020 if (bound) {
1017 /* Ensure nlk->portid is up-to-date. */1021 /* Ensure nlk->portid is up-to-date. */
1018 smp_rmb();1022 smp_rmb();
@@ -1098,8 +1102,9 @@ static int netlink_connect(struct socket *sock, struct sockaddr *addr, · 79 unmodified lines
1098 1102
1099 /* No need for barriers here as we return to user-space without1103 /* No need for barriers here as we return to user-space without
1100 * using any of the bound attributes.1104 * using any of the bound attributes.
1105 * Paired with WRITE_ONCE() in netlink_insert().
1101 */1106 */
1102 if (!nlk->bound)1107 if (!READ_ONCE(nlk->bound))
1103 err = netlink_autobind(sock);1108 err = netlink_autobind(sock);
1104 1109
1105 if (err == 0) {1110 if (err == 0) {
@@ -1869,7 +1874,8 @@ static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) · 763 unmodified lines
1869 dst_group = nlk->dst_group;1874 dst_group = nlk->dst_group;
1870 }1875 }
1871 1876
1872 if (!nlk->bound) {1877 /* Paired with WRITE_ONCE() in netlink_insert() */
1878 if (!READ_ONCE(nlk->bound)) {
1873 err = netlink_autobind(sock);1879 err = netlink_autobind(sock);
1874 if (err)1880 if (err)
1875 goto out;1881 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
233 if (strncmp(q->ops->id + 1, "fifo", 4) != 0)233 if (strncmp(q->ops->id + 1, "fifo", 4) != 0)
234 return 0;234 return 0;
235 235
236 if (!q->ops->change)
237 return 0;
238
236 nla = kmalloc(nla_attr_size(sizeof(struct tc_fifo_qopt)), GFP_KERNEL);239 nla = kmalloc(nla_attr_size(sizeof(struct tc_fifo_qopt)), GFP_KERNEL);
237 if (nla) {240 if (nla) {
238 nla->nla_type = RTM_NEWQDISC;241 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
1641 list_del(&q->taprio_list);1641 list_del(&q->taprio_list);
1642 spin_unlock(&taprio_list_lock);1642 spin_unlock(&taprio_list_lock);
1643 1643
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);
1644 1648
1645 taprio_disable_offload(dev, q, NULL);1649 taprio_disable_offload(dev, q, NULL);
1646 1650
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
645 }645 }
646 __set_bit(seq_num % GSS_SEQ_WIN, sd->sd_win);646 __set_bit(seq_num % GSS_SEQ_WIN, sd->sd_win);
647 goto ok;647 goto ok;
648 } else if (seq_num <= sd->sd_max - GSS_SEQ_WIN) {648 } else if (seq_num + GSS_SEQ_WIN <= sd->sd_max) {
649 goto toolow;649 goto toolow;
650 }650 }
651 if (__test_and_set_bit(seq_num % GSS_SEQ_WIN, sd->sd_win))651 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
2882 2882
2883 unix_state_lock(sk);2883 unix_state_lock(sk);
2884 sk->sk_shutdown |= mode;2884 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;
2885 other = unix_peer(sk);2888 other = unix_peer(sk);
2886 if (other)2889 if (other)
2887 sock_hold(other);2890 sock_hold(other);
@@ -2904,12 +2907,10 @@ static int unix_shutdown(struct socket *sock, int mode) · 16 unmodified lines
2904 other->sk_shutdown |= peer_mode;2907 other->sk_shutdown |= peer_mode;
2905 unix_state_unlock(other);2908 unix_state_unlock(other);
2906 other->sk_state_change(other);2909 other->sk_state_change(other);
2907 if (peer_mode == SHUTDOWN_MASK) {2910 if (peer_mode == SHUTDOWN_MASK)
2908 sk_wake_async(other, SOCK_WAKE_WAITD, POLL_HUP);2911 sk_wake_async(other, SOCK_WAKE_WAITD, POLL_HUP);
2909 other->sk_state = TCP_CLOSE;2912 else if (peer_mode & RCV_SHUTDOWN)
2910 } else if (peer_mode & RCV_SHUTDOWN) {
2911 sk_wake_async(other, SOCK_WAKE_WAITD, POLL_IN);2913 sk_wake_async(other, SOCK_WAKE_WAITD, POLL_IN);
2912 }
2913 }2914 }
2914 if (other)2915 if (other)
2915 sock_put(other);2916 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
1961 return skb;1961 return skb;
1962}1962}
1963 1963
1964static 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
1964static int xfrm_set_default(struct sk_buff *skb, struct nlmsghdr *nlh,1999static int xfrm_set_default(struct sk_buff *skb, struct nlmsghdr *nlh,
1965 struct nlattr **attrs)2000 struct nlattr **attrs)
1966{2001{
1967 struct net *net = sock_net(skb->sk);2002 struct net *net = sock_net(skb->sk);
1968 struct xfrm_userpolicy_default *up = nlmsg_data(nlh);2003 struct xfrm_userpolicy_default *up = nlmsg_data(nlh);
1969 u8 dirmask;
1970 u8 old_default = net->xfrm.policy_default;
1971 2004
1972 if (up->dirmask >= XFRM_USERPOLICY_DIRMASK_MAX)2005 if (up->in == XFRM_USERPOLICY_BLOCK)
1973 return -EINVAL;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;
1974 2009
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;
1976 2014
1977 net->xfrm.policy_default = (old_default & (0xff ^ dirmask))2015 if (up->out == XFRM_USERPOLICY_BLOCK)
1978 | (up->action << up->dirmask);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;
1979 2019
1980 rt_genid_bump_all(net);2020 rt_genid_bump_all(net);
1981 2021
2022 xfrm_notify_userpolicy(net);
1982 return 0;2023 return 0;
1983}2024}
1984 2025
@@ -1988,13 +2029,11 @@ static int xfrm_get_default(struct sk_buff *skb, struct nlmsghdr *nlh, · 3 unmodified lines
1988 struct sk_buff *r_skb;2029 struct sk_buff *r_skb;
1989 struct nlmsghdr *r_nlh;2030 struct nlmsghdr *r_nlh;
1990 struct net *net = sock_net(skb->sk);2031 struct net *net = sock_net(skb->sk);
1991 struct xfrm_userpolicy_default *r_up, *up;2032 struct xfrm_userpolicy_default *r_up;
1992 int len = NLMSG_ALIGN(sizeof(struct xfrm_userpolicy_default));2033 int len = NLMSG_ALIGN(sizeof(struct xfrm_userpolicy_default));
1993 u32 portid = NETLINK_CB(skb).portid;2034 u32 portid = NETLINK_CB(skb).portid;
1994 u32 seq = nlh->nlmsg_seq;2035 u32 seq = nlh->nlmsg_seq;
1995 2036
1996 up = nlmsg_data(nlh);
1997
1998 r_skb = nlmsg_new(len, GFP_ATOMIC);2037 r_skb = nlmsg_new(len, GFP_ATOMIC);
1999 if (!r_skb)2038 if (!r_skb)
2000 return -ENOMEM;2039 return -ENOMEM;
@@ -2007,8 +2046,12 @@ static int xfrm_get_default(struct sk_buff *skb, struct nlmsghdr *nlh, · 6 unmodified lines
2007 2046
2008 r_up = nlmsg_data(r_nlh);2047 r_up = nlmsg_data(r_nlh);
2009 2048
2010 r_up->action = ((net->xfrm.policy_default & (1 << up->dirmask)) >> up->dirmask);2049 r_up->in = net->xfrm.policy_default & XFRM_POL_DEFAULT_IN ?
2011 r_up->dirmask = up->dirmask;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;
2012 nlmsg_end(r_skb, r_nlh);2055 nlmsg_end(r_skb, r_nlh);
2013 2056
2014 return nlmsg_unicast(net->xfrm.nlsk, r_skb, portid);2057 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
322 322
323-include $(BPF_SAMPLES_PATH)/Makefile.target323-include $(BPF_SAMPLES_PATH)/Makefile.target
324 324
325VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux) \325VMLINUX_BTF_PATHS ?= $(abspath $(if $(O),$(O)/vmlinux)) \
326 $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux) \326 $(abspath $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux)) \
327 ../../../../vmlinux \327 $(abspath ./vmlinux)
328 /sys/kernel/btf/vmlinux \
329 /boot/vmlinux-$(shell uname -r)
330VMLINUX_BTF ?= $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS))))328VMLINUX_BTF ?= $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS))))
331 329
332ifeq ($(VMLINUX_BTF),)
333$(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)")
334endif
335
336$(obj)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)330$(obj)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)
337ifeq ($(VMLINUX_H),)331ifeq ($(VMLINUX_H),)
338 $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@332 $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@
@@ -340,6 +334,11 @@ else · 1 unmodified line
340 $(Q)cp "$(VMLINUX_H)" $@334 $(Q)cp "$(VMLINUX_H)" $@
341endif335endif
342 336
337ifeq ($(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)
340endif
341
343clean-files += vmlinux.h342clean-files += vmlinux.h
344 343
345# Get Clang's default includes on this system, as opposed to those seen by344# 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) */
2/* eBPF instruction mini library */2/* eBPF instruction mini library */
3#ifndef __BPF_INSN_H3#ifndef __BPF_INSN_H
4#define __BPF_INSN_H4#define __BPF_INSN_H
samples/bpf/xdp_redirect_map_multi.bpf.c+0−5
@@ -5,11 +5,6 @@ · 4 unmodified lines
5#include "xdp_sample.bpf.h"5#include "xdp_sample.bpf.h"
6#include "xdp_sample_shared.h"6#include "xdp_sample_shared.h"
7 7
8enum {
9 BPF_F_BROADCAST = (1ULL << 3),
10 BPF_F_EXCLUDE_INGRESS = (1ULL << 4),
11};
12
13struct {8struct {
14 __uint(type, BPF_MAP_TYPE_DEVMAP_HASH);9 __uint(type, BPF_MAP_TYPE_DEVMAP_HASH);
15 __uint(key_size, sizeof(int));10 __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
126 { XFRM_MSG_NEWSPDINFO, NETLINK_XFRM_SOCKET__NLMSG_WRITE },126 { XFRM_MSG_NEWSPDINFO, NETLINK_XFRM_SOCKET__NLMSG_WRITE },
127 { XFRM_MSG_GETSPDINFO, NETLINK_XFRM_SOCKET__NLMSG_READ },127 { XFRM_MSG_GETSPDINFO, NETLINK_XFRM_SOCKET__NLMSG_READ },
128 { XFRM_MSG_MAPPING, NETLINK_XFRM_SOCKET__NLMSG_READ },128 { 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 },
129};131};
130 132
131static const struct nlmsg_perm nlmsg_audit_perms[] =133static 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
189 * structures at the top of this file with the new mappings191 * structures at the top of this file with the new mappings
190 * before updating the BUILD_BUG_ON() macro!192 * before updating the BUILD_BUG_ON() macro!
191 */193 */
192 BUILD_BUG_ON(XFRM_MSG_MAX != XFRM_MSG_MAPPING);194 BUILD_BUG_ON(XFRM_MSG_MAX != XFRM_MSG_GETDEFAULT);
193 err = nlmsg_perm(nlmsg_type, perm, nlmsg_xfrm_perms,195 err = nlmsg_perm(nlmsg_type, perm, nlmsg_xfrm_perms,
194 sizeof(nlmsg_xfrm_perms));196 sizeof(nlmsg_xfrm_perms));
195 break;197 break;
tools/include/uapi/sound/asound.h+1−0
@@ -784,6 +784,7 @@ struct snd_rawmidi_status { · 783 unmodified lines
784 784
785#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)785#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
786#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)786#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
787#define SNDRV_RAWMIDI_IOCTL_USER_PVERSION _IOW('W', 0x02, int)
787#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)788#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
788#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)789#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
789#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)790#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
7024 7024
7025 if (obj->gen_loader) {7025 if (obj->gen_loader) {
7026 /* reset FDs */7026 /* reset FDs */
7027 btf__set_fd(obj->btf, -1);7027 if (obj->btf)
7028 btf__set_fd(obj->btf, -1);
7028 for (i = 0; i < obj->nr_maps; i++)7029 for (i = 0; i < obj->nr_maps; i++)
7029 obj->maps[i].fd = -1;7030 obj->maps[i].fd = -1;
7030 if (!err)7031 if (!err)
tools/lib/bpf/strset.c+1−0
@@ -88,6 +88,7 @@ void strset__free(struct strset *set) · 87 unmodified lines
88 88
89 hashmap__free(set->strs_hash);89 hashmap__free(set->strs_hash);
90 free(set->strs_data);90 free(set->strs_data);
91 free(set);
91}92}
92 93
93size_t strset__data_size(const struct strset *set)94size_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
58{58{
59}59}
60 60
61static 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
61static int get_alt_entry(struct elf *elf, struct special_entry *entry,79static int get_alt_entry(struct elf *elf, struct special_entry *entry,
62 struct section *sec, int idx,80 struct section *sec, int idx,
63 struct special_alt *alt)81 struct special_alt *alt)
@@ -91,15 +109,14 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry, · 27 unmodified lines
91 WARN_FUNC("can't find orig reloc", sec, offset + entry->orig);109 WARN_FUNC("can't find orig reloc", sec, offset + entry->orig);
92 return -1;110 return -1;
93 }111 }
94 if (orig_reloc->sym->type != STT_SECTION) {112 if (!reloc2sec_off(orig_reloc, &alt->orig_sec, &alt->orig_off)) {
95 WARN_FUNC("don't know how to handle non-section reloc symbol %s",113 WARN_FUNC("don't know how to handle reloc symbol type %d: %s",
96 sec, offset + entry->orig, orig_reloc->sym->name);114 sec, offset + entry->orig,
115 orig_reloc->sym->type,
116 orig_reloc->sym->name);
97 return -1;117 return -1;
98 }118 }
99 119
100 alt->orig_sec = orig_reloc->sym->sec;
101 alt->orig_off = orig_reloc->addend;
102
103 if (!entry->group || alt->new_len) {120 if (!entry->group || alt->new_len) {
104 new_reloc = find_reloc_by_dest(elf, sec, offset + entry->new);121 new_reloc = find_reloc_by_dest(elf, sec, offset + entry->new);
105 if (!new_reloc) {122 if (!new_reloc) {
@@ -116,8 +133,13 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry, · 10 unmodified lines
116 if (arch_is_retpoline(new_reloc->sym))133 if (arch_is_retpoline(new_reloc->sym))
117 return 1;134 return 1;
118 135
119 alt->new_sec = new_reloc->sym->sec;136 if (!reloc2sec_off(new_reloc, &alt->new_sec, &alt->new_off)) {
120 alt->new_off = (unsigned int)new_reloc->addend;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 }
121 143
122 /* _ASM_EXTABLE_EX hack */144 /* _ASM_EXTABLE_EX hack */
123 if (alt->new_off >= 0x7ffffff0)145 if (alt->new_off >= 0x7ffffff0)
tools/perf/Makefile.config+1−1
@@ -143,7 +143,7 @@ FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto · 142 unmodified lines
143ifdef CSINCLUDES143ifdef CSINCLUDES
144 LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)144 LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
145endif145endif
146OPENCSDLIBS := -lopencsd_c_api -lopencsd146OPENCSDLIBS := -lopencsd_c_api -lopencsd -lstdc++
147ifdef CSLIBS147ifdef CSLIBS
148 LIBOPENCSD_LDFLAGS := -L$(CSLIBS)148 LIBOPENCSD_LDFLAGS := -L$(CSLIBS)
149endif149endif
tools/perf/Makefile.perf+1−1
@@ -802,7 +802,7 @@ endif · 801 unmodified lines
802 802
803$(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)803$(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
804 804
805LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'805LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(filter-out -static,$(LDFLAGS))'
806 806
807$(LIBTRACEEVENT): FORCE807$(LIBTRACEEVENT): FORCE
808 $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a808 $(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
1285 }1285 }
1286 1286
1287 free_arch_std_events();1287 free_arch_std_events();
1288 free_sys_event_tables();
1288 free(mapfile);1289 free(mapfile);
1289 return 0;1290 return 0;
1290 1291
@@ -1306,6 +1307,7 @@ err_close_eventsfp: · 15 unmodified lines
1306 create_empty_mapping(output_file);1307 create_empty_mapping(output_file);
1307err_out:1308err_out:
1308 free_arch_std_events();1309 free_arch_std_events();
1310 free_sys_event_tables();
1309 free(mapfile);1311 free(mapfile);
1310 return ret;1312 return ret;
1311}1313}
tools/perf/tests/attr/test-stat-default+97−0
@@ -68,3 +68,100 @@ fd=10 · 67 unmodified lines
68type=068type=0
69config=569config=5
70optional=170optional=1
71
72# PERF_TYPE_RAW / slots (0x400)
73[event11:base-stat]
74fd=11
75group_fd=-1
76type=4
77config=1024
78read_format=15
79optional=1
80
81# PERF_TYPE_RAW / topdown-retiring (0x8000)
82[event12:base-stat]
83fd=12
84group_fd=11
85type=4
86config=32768
87disabled=0
88enable_on_exec=0
89read_format=15
90optional=1
91
92# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
93[event13:base-stat]
94fd=13
95group_fd=11
96type=4
97config=33024
98disabled=0
99enable_on_exec=0
100read_format=15
101optional=1
102
103# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
104[event14:base-stat]
105fd=14
106group_fd=11
107type=4
108config=33280
109disabled=0
110enable_on_exec=0
111read_format=15
112optional=1
113
114# PERF_TYPE_RAW / topdown-be-bound (0x8300)
115[event15:base-stat]
116fd=15
117group_fd=11
118type=4
119config=33536
120disabled=0
121enable_on_exec=0
122read_format=15
123optional=1
124
125# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
126[event16:base-stat]
127fd=16
128group_fd=11
129type=4
130config=33792
131disabled=0
132enable_on_exec=0
133read_format=15
134optional=1
135
136# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
137[event17:base-stat]
138fd=17
139group_fd=11
140type=4
141config=34048
142disabled=0
143enable_on_exec=0
144read_format=15
145optional=1
146
147# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
148[event18:base-stat]
149fd=18
150group_fd=11
151type=4
152config=34304
153disabled=0
154enable_on_exec=0
155read_format=15
156optional=1
157
158# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
159[event19:base-stat]
160fd=19
161group_fd=11
162type=4
163config=34560
164disabled=0
165enable_on_exec=0
166read_format=15
167optional=1
tools/perf/tests/attr/test-stat-detailed-1+105−8
@@ -70,12 +70,109 @@ type=0 · 69 unmodified lines
70config=570config=5
71optional=171optional=1
72 72
73# PERF_TYPE_RAW / slots (0x400)
74[event11:base-stat]
75fd=11
76group_fd=-1
77type=4
78config=1024
79read_format=15
80optional=1
81
82# PERF_TYPE_RAW / topdown-retiring (0x8000)
83[event12:base-stat]
84fd=12
85group_fd=11
86type=4
87config=32768
88disabled=0
89enable_on_exec=0
90read_format=15
91optional=1
92
93# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
94[event13:base-stat]
95fd=13
96group_fd=11
97type=4
98config=33024
99disabled=0
100enable_on_exec=0
101read_format=15
102optional=1
103
104# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
105[event14:base-stat]
106fd=14
107group_fd=11
108type=4
109config=33280
110disabled=0
111enable_on_exec=0
112read_format=15
113optional=1
114
115# PERF_TYPE_RAW / topdown-be-bound (0x8300)
116[event15:base-stat]
117fd=15
118group_fd=11
119type=4
120config=33536
121disabled=0
122enable_on_exec=0
123read_format=15
124optional=1
125
126# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
127[event16:base-stat]
128fd=16
129group_fd=11
130type=4
131config=33792
132disabled=0
133enable_on_exec=0
134read_format=15
135optional=1
136
137# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
138[event17:base-stat]
139fd=17
140group_fd=11
141type=4
142config=34048
143disabled=0
144enable_on_exec=0
145read_format=15
146optional=1
147
148# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
149[event18:base-stat]
150fd=18
151group_fd=11
152type=4
153config=34304
154disabled=0
155enable_on_exec=0
156read_format=15
157optional=1
158
159# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
160[event19:base-stat]
161fd=19
162group_fd=11
163type=4
164config=34560
165disabled=0
166enable_on_exec=0
167read_format=15
168optional=1
169
73# PERF_TYPE_HW_CACHE /170# PERF_TYPE_HW_CACHE /
74# PERF_COUNT_HW_CACHE_L1D << 0 |171# PERF_COUNT_HW_CACHE_L1D << 0 |
75# (PERF_COUNT_HW_CACHE_OP_READ << 8) |172# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
76# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)173# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
77[event11:base-stat]174[event20:base-stat]
78fd=11175fd=20
79type=3176type=3
80config=0177config=0
81optional=1178optional=1
@@ -84,8 +181,8 @@ optional=1 · 2 unmodified lines
84# PERF_COUNT_HW_CACHE_L1D << 0 |181# PERF_COUNT_HW_CACHE_L1D << 0 |
85# (PERF_COUNT_HW_CACHE_OP_READ << 8) |182# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
86# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)183# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
87[event12:base-stat]184[event21:base-stat]
88fd=12185fd=21
89type=3186type=3
90config=65536187config=65536
91optional=1188optional=1
@@ -94,8 +191,8 @@ optional=1 · 2 unmodified lines
94# PERF_COUNT_HW_CACHE_LL << 0 |191# PERF_COUNT_HW_CACHE_LL << 0 |
95# (PERF_COUNT_HW_CACHE_OP_READ << 8) |192# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
96# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)193# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
97[event13:base-stat]194[event22:base-stat]
98fd=13195fd=22
99type=3196type=3
100config=2197config=2
101optional=1198optional=1
@@ -104,8 +201,8 @@ optional=1 · 2 unmodified lines
104# PERF_COUNT_HW_CACHE_LL << 0 |201# PERF_COUNT_HW_CACHE_LL << 0 |
105# (PERF_COUNT_HW_CACHE_OP_READ << 8) |202# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
106# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)203# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
107[event14:base-stat]204[event23:base-stat]
108fd=14205fd=23
109type=3206type=3
110config=65538207config=65538
111optional=1208optional=1
tools/perf/tests/attr/test-stat-detailed-2+117−20
@@ -70,12 +70,109 @@ type=0 · 69 unmodified lines
70config=570config=5
71optional=171optional=1
72 72
73# PERF_TYPE_RAW / slots (0x400)
74[event11:base-stat]
75fd=11
76group_fd=-1
77type=4
78config=1024
79read_format=15
80optional=1
81
82# PERF_TYPE_RAW / topdown-retiring (0x8000)
83[event12:base-stat]
84fd=12
85group_fd=11
86type=4
87config=32768
88disabled=0
89enable_on_exec=0
90read_format=15
91optional=1
92
93# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
94[event13:base-stat]
95fd=13
96group_fd=11
97type=4
98config=33024
99disabled=0
100enable_on_exec=0
101read_format=15
102optional=1
103
104# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
105[event14:base-stat]
106fd=14
107group_fd=11
108type=4
109config=33280
110disabled=0
111enable_on_exec=0
112read_format=15
113optional=1
114
115# PERF_TYPE_RAW / topdown-be-bound (0x8300)
116[event15:base-stat]
117fd=15
118group_fd=11
119type=4
120config=33536
121disabled=0
122enable_on_exec=0
123read_format=15
124optional=1
125
126# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
127[event16:base-stat]
128fd=16
129group_fd=11
130type=4
131config=33792
132disabled=0
133enable_on_exec=0
134read_format=15
135optional=1
136
137# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
138[event17:base-stat]
139fd=17
140group_fd=11
141type=4
142config=34048
143disabled=0
144enable_on_exec=0
145read_format=15
146optional=1
147
148# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
149[event18:base-stat]
150fd=18
151group_fd=11
152type=4
153config=34304
154disabled=0
155enable_on_exec=0
156read_format=15
157optional=1
158
159# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
160[event19:base-stat]
161fd=19
162group_fd=11
163type=4
164config=34560
165disabled=0
166enable_on_exec=0
167read_format=15
168optional=1
169
73# PERF_TYPE_HW_CACHE /170# PERF_TYPE_HW_CACHE /
74# PERF_COUNT_HW_CACHE_L1D << 0 |171# PERF_COUNT_HW_CACHE_L1D << 0 |
75# (PERF_COUNT_HW_CACHE_OP_READ << 8) |172# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
76# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)173# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
77[event11:base-stat]174[event20:base-stat]
78fd=11175fd=20
79type=3176type=3
80config=0177config=0
81optional=1178optional=1
@@ -84,8 +181,8 @@ optional=1 · 2 unmodified lines
84# PERF_COUNT_HW_CACHE_L1D << 0 |181# PERF_COUNT_HW_CACHE_L1D << 0 |
85# (PERF_COUNT_HW_CACHE_OP_READ << 8) |182# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
86# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)183# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
87[event12:base-stat]184[event21:base-stat]
88fd=12185fd=21
89type=3186type=3
90config=65536187config=65536
91optional=1188optional=1
@@ -94,8 +191,8 @@ optional=1 · 2 unmodified lines
94# PERF_COUNT_HW_CACHE_LL << 0 |191# PERF_COUNT_HW_CACHE_LL << 0 |
95# (PERF_COUNT_HW_CACHE_OP_READ << 8) |192# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
96# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)193# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
97[event13:base-stat]194[event22:base-stat]
98fd=13195fd=22
99type=3196type=3
100config=2197config=2
101optional=1198optional=1
@@ -104,8 +201,8 @@ optional=1 · 2 unmodified lines
104# PERF_COUNT_HW_CACHE_LL << 0 |201# PERF_COUNT_HW_CACHE_LL << 0 |
105# (PERF_COUNT_HW_CACHE_OP_READ << 8) |202# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
106# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)203# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
107[event14:base-stat]204[event23:base-stat]
108fd=14205fd=23
109type=3206type=3
110config=65538207config=65538
111optional=1208optional=1
@@ -114,8 +211,8 @@ optional=1 · 2 unmodified lines
114# PERF_COUNT_HW_CACHE_L1I << 0 |211# PERF_COUNT_HW_CACHE_L1I << 0 |
115# (PERF_COUNT_HW_CACHE_OP_READ << 8) |212# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
116# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)213# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
117[event15:base-stat]214[event24:base-stat]
118fd=15215fd=24
119type=3216type=3
120config=1217config=1
121optional=1218optional=1
@@ -124,8 +221,8 @@ optional=1 · 2 unmodified lines
124# PERF_COUNT_HW_CACHE_L1I << 0 |221# PERF_COUNT_HW_CACHE_L1I << 0 |
125# (PERF_COUNT_HW_CACHE_OP_READ << 8) |222# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
126# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)223# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
127[event16:base-stat]224[event25:base-stat]
128fd=16225fd=25
129type=3226type=3
130config=65537227config=65537
131optional=1228optional=1
@@ -134,8 +231,8 @@ optional=1 · 2 unmodified lines
134# PERF_COUNT_HW_CACHE_DTLB << 0 |231# PERF_COUNT_HW_CACHE_DTLB << 0 |
135# (PERF_COUNT_HW_CACHE_OP_READ << 8) |232# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
136# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)233# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
137[event17:base-stat]234[event26:base-stat]
138fd=17235fd=26
139type=3236type=3
140config=3237config=3
141optional=1238optional=1
@@ -144,8 +241,8 @@ optional=1 · 2 unmodified lines
144# PERF_COUNT_HW_CACHE_DTLB << 0 |241# PERF_COUNT_HW_CACHE_DTLB << 0 |
145# (PERF_COUNT_HW_CACHE_OP_READ << 8) |242# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
146# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)243# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
147[event18:base-stat]244[event27:base-stat]
148fd=18245fd=27
149type=3246type=3
150config=65539247config=65539
151optional=1248optional=1
@@ -154,8 +251,8 @@ optional=1 · 2 unmodified lines
154# PERF_COUNT_HW_CACHE_ITLB << 0 |251# PERF_COUNT_HW_CACHE_ITLB << 0 |
155# (PERF_COUNT_HW_CACHE_OP_READ << 8) |252# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
156# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)253# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
157[event19:base-stat]254[event28:base-stat]
158fd=19255fd=28
159type=3256type=3
160config=4257config=4
161optional=1258optional=1
@@ -164,8 +261,8 @@ optional=1 · 2 unmodified lines
164# PERF_COUNT_HW_CACHE_ITLB << 0 |261# PERF_COUNT_HW_CACHE_ITLB << 0 |
165# (PERF_COUNT_HW_CACHE_OP_READ << 8) |262# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
166# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)263# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
167[event20:base-stat]264[event29:base-stat]
168fd=20265fd=29
169type=3266type=3
170config=65540267config=65540
171optional=1268optional=1
tools/perf/tests/attr/test-stat-detailed-3+121−24
@@ -70,12 +70,109 @@ type=0 · 69 unmodified lines
70config=570config=5
71optional=171optional=1
72 72
73# PERF_TYPE_RAW / slots (0x400)
74[event11:base-stat]
75fd=11
76group_fd=-1
77type=4
78config=1024
79read_format=15
80optional=1
81
82# PERF_TYPE_RAW / topdown-retiring (0x8000)
83[event12:base-stat]
84fd=12
85group_fd=11
86type=4
87config=32768
88disabled=0
89enable_on_exec=0
90read_format=15
91optional=1
92
93# PERF_TYPE_RAW / topdown-bad-spec (0x8100)
94[event13:base-stat]
95fd=13
96group_fd=11
97type=4
98config=33024
99disabled=0
100enable_on_exec=0
101read_format=15
102optional=1
103
104# PERF_TYPE_RAW / topdown-fe-bound (0x8200)
105[event14:base-stat]
106fd=14
107group_fd=11
108type=4
109config=33280
110disabled=0
111enable_on_exec=0
112read_format=15
113optional=1
114
115# PERF_TYPE_RAW / topdown-be-bound (0x8300)
116[event15:base-stat]
117fd=15
118group_fd=11
119type=4
120config=33536
121disabled=0
122enable_on_exec=0
123read_format=15
124optional=1
125
126# PERF_TYPE_RAW / topdown-heavy-ops (0x8400)
127[event16:base-stat]
128fd=16
129group_fd=11
130type=4
131config=33792
132disabled=0
133enable_on_exec=0
134read_format=15
135optional=1
136
137# PERF_TYPE_RAW / topdown-br-mispredict (0x8500)
138[event17:base-stat]
139fd=17
140group_fd=11
141type=4
142config=34048
143disabled=0
144enable_on_exec=0
145read_format=15
146optional=1
147
148# PERF_TYPE_RAW / topdown-fetch-lat (0x8600)
149[event18:base-stat]
150fd=18
151group_fd=11
152type=4
153config=34304
154disabled=0
155enable_on_exec=0
156read_format=15
157optional=1
158
159# PERF_TYPE_RAW / topdown-mem-bound (0x8700)
160[event19:base-stat]
161fd=19
162group_fd=11
163type=4
164config=34560
165disabled=0
166enable_on_exec=0
167read_format=15
168optional=1
169
73# PERF_TYPE_HW_CACHE /170# PERF_TYPE_HW_CACHE /
74# PERF_COUNT_HW_CACHE_L1D << 0 |171# PERF_COUNT_HW_CACHE_L1D << 0 |
75# (PERF_COUNT_HW_CACHE_OP_READ << 8) |172# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
76# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)173# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
77[event11:base-stat]174[event20:base-stat]
78fd=11175fd=20
79type=3176type=3
80config=0177config=0
81optional=1178optional=1
@@ -84,8 +181,8 @@ optional=1 · 2 unmodified lines
84# PERF_COUNT_HW_CACHE_L1D << 0 |181# PERF_COUNT_HW_CACHE_L1D << 0 |
85# (PERF_COUNT_HW_CACHE_OP_READ << 8) |182# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
86# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)183# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
87[event12:base-stat]184[event21:base-stat]
88fd=12185fd=21
89type=3186type=3
90config=65536187config=65536
91optional=1188optional=1
@@ -94,8 +191,8 @@ optional=1 · 2 unmodified lines
94# PERF_COUNT_HW_CACHE_LL << 0 |191# PERF_COUNT_HW_CACHE_LL << 0 |
95# (PERF_COUNT_HW_CACHE_OP_READ << 8) |192# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
96# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)193# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
97[event13:base-stat]194[event22:base-stat]
98fd=13195fd=22
99type=3196type=3
100config=2197config=2
101optional=1198optional=1
@@ -104,8 +201,8 @@ optional=1 · 2 unmodified lines
104# PERF_COUNT_HW_CACHE_LL << 0 |201# PERF_COUNT_HW_CACHE_LL << 0 |
105# (PERF_COUNT_HW_CACHE_OP_READ << 8) |202# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
106# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)203# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
107[event14:base-stat]204[event23:base-stat]
108fd=14205fd=23
109type=3206type=3
110config=65538207config=65538
111optional=1208optional=1
@@ -114,8 +211,8 @@ optional=1 · 2 unmodified lines
114# PERF_COUNT_HW_CACHE_L1I << 0 |211# PERF_COUNT_HW_CACHE_L1I << 0 |
115# (PERF_COUNT_HW_CACHE_OP_READ << 8) |212# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
116# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)213# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
117[event15:base-stat]214[event24:base-stat]
118fd=15215fd=24
119type=3216type=3
120config=1217config=1
121optional=1218optional=1
@@ -124,8 +221,8 @@ optional=1 · 2 unmodified lines
124# PERF_COUNT_HW_CACHE_L1I << 0 |221# PERF_COUNT_HW_CACHE_L1I << 0 |
125# (PERF_COUNT_HW_CACHE_OP_READ << 8) |222# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
126# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)223# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
127[event16:base-stat]224[event25:base-stat]
128fd=16225fd=25
129type=3226type=3
130config=65537227config=65537
131optional=1228optional=1
@@ -134,8 +231,8 @@ optional=1 · 2 unmodified lines
134# PERF_COUNT_HW_CACHE_DTLB << 0 |231# PERF_COUNT_HW_CACHE_DTLB << 0 |
135# (PERF_COUNT_HW_CACHE_OP_READ << 8) |232# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
136# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)233# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
137[event17:base-stat]234[event26:base-stat]
138fd=17235fd=26
139type=3236type=3
140config=3237config=3
141optional=1238optional=1
@@ -144,8 +241,8 @@ optional=1 · 2 unmodified lines
144# PERF_COUNT_HW_CACHE_DTLB << 0 |241# PERF_COUNT_HW_CACHE_DTLB << 0 |
145# (PERF_COUNT_HW_CACHE_OP_READ << 8) |242# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
146# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)243# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
147[event18:base-stat]244[event27:base-stat]
148fd=18245fd=27
149type=3246type=3
150config=65539247config=65539
151optional=1248optional=1
@@ -154,8 +251,8 @@ optional=1 · 2 unmodified lines
154# PERF_COUNT_HW_CACHE_ITLB << 0 |251# PERF_COUNT_HW_CACHE_ITLB << 0 |
155# (PERF_COUNT_HW_CACHE_OP_READ << 8) |252# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
156# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)253# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
157[event19:base-stat]254[event28:base-stat]
158fd=19255fd=28
159type=3256type=3
160config=4257config=4
161optional=1258optional=1
@@ -164,8 +261,8 @@ optional=1 · 2 unmodified lines
164# PERF_COUNT_HW_CACHE_ITLB << 0 |261# PERF_COUNT_HW_CACHE_ITLB << 0 |
165# (PERF_COUNT_HW_CACHE_OP_READ << 8) |262# (PERF_COUNT_HW_CACHE_OP_READ << 8) |
166# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)263# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
167[event20:base-stat]264[event29:base-stat]
168fd=20265fd=29
169type=3266type=3
170config=65540267config=65540
171optional=1268optional=1
@@ -174,8 +271,8 @@ optional=1 · 2 unmodified lines
174# PERF_COUNT_HW_CACHE_L1D << 0 |271# PERF_COUNT_HW_CACHE_L1D << 0 |
175# (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) |272# (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) |
176# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)273# (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16)
177[event21:base-stat]274[event30:base-stat]
178fd=21275fd=30
179type=3276type=3
180config=512277config=512
181optional=1278optional=1
@@ -184,8 +281,8 @@ optional=1 · 2 unmodified lines
184# PERF_COUNT_HW_CACHE_L1D << 0 |281# PERF_COUNT_HW_CACHE_L1D << 0 |
185# (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) |282# (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) |
186# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)283# (PERF_COUNT_HW_CACHE_RESULT_MISS << 16)
187[event22:base-stat]284[event31:base-stat]
188fd=22285fd=31
189type=3286type=3
190config=66048287config=66048
191optional=1288optional=1
tools/testing/selftests/drivers/dma-buf/udmabuf.c+4−1
@@ -1,10 +1,13 @@
1// SPDX-License-Identifier: GPL-2.01// SPDX-License-Identifier: GPL-2.0
2#define _GNU_SOURCE
3#define __EXPORTED_HEADERS__
4
2#include <stdio.h>5#include <stdio.h>
3#include <stdlib.h>6#include <stdlib.h>
4#include <unistd.h>7#include <unistd.h>
5#include <string.h>8#include <string.h>
6#include <errno.h>9#include <errno.h>
7#include <linux/fcntl.h>10#include <fcntl.h>
8#include <malloc.h>11#include <malloc.h>
9 12
10#include <sys/ioctl.h>13#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
315#define GET_XMM(__xmm) \315#define GET_XMM(__xmm) \
316({ \316({ \
317 unsigned long __val; \317 unsigned long __val; \
318 asm volatile("movq %%"#__xmm", %0" : "=r"(__val) : : #__xmm); \318 asm volatile("movq %%"#__xmm", %0" : "=r"(__val)); \
319 __val; \319 __val; \
320})320})
321 321
tools/testing/selftests/kvm/rseq_test.c+59−10
@@ -10,6 +10,7 @@ · 9 unmodified lines
10#include <signal.h>10#include <signal.h>
11#include <syscall.h>11#include <syscall.h>
12#include <sys/ioctl.h>12#include <sys/ioctl.h>
13#include <sys/sysinfo.h>
13#include <asm/barrier.h>14#include <asm/barrier.h>
14#include <linux/atomic.h>15#include <linux/atomic.h>
15#include <linux/rseq.h>16#include <linux/rseq.h>
@@ -39,6 +40,7 @@ static __thread volatile struct rseq __rseq = { · 23 unmodified lines
39 40
40static pthread_t migration_thread;41static pthread_t migration_thread;
41static cpu_set_t possible_mask;42static cpu_set_t possible_mask;
43static int min_cpu, max_cpu;
42static bool done;44static bool done;
43 45
44static atomic_t seq_cnt;46static atomic_t seq_cnt;
@@ -57,20 +59,37 @@ static void sys_rseq(int flags) · 12 unmodified lines
57 TEST_ASSERT(!r, "rseq failed, errno = %d (%s)", errno, strerror(errno));59 TEST_ASSERT(!r, "rseq failed, errno = %d (%s)", errno, strerror(errno));
58}60}
59 61
62static 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
60static void *migration_worker(void *ign)85static void *migration_worker(void *ign)
61{86{
62 cpu_set_t allowed_mask;87 cpu_set_t allowed_mask;
63 int r, i, nr_cpus, cpu;88 int r, i, cpu;
64 89
65 CPU_ZERO(&allowed_mask);90 CPU_ZERO(&allowed_mask);
66 91
67 nr_cpus = CPU_COUNT(&possible_mask);92 for (i = 0, cpu = min_cpu; i < NR_TASK_MIGRATIONS; i++, cpu = next_cpu(cpu)) {
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
74 CPU_SET(cpu, &allowed_mask);93 CPU_SET(cpu, &allowed_mask);
75 94
76 /*95 /*
@@ -154,6 +173,36 @@ static void *migration_worker(void *ign) · 77 unmodified lines
154 return NULL;173 return NULL;
155}174}
156 175
176static 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
157int main(int argc, char *argv[])206int main(int argc, char *argv[])
158{207{
159 int r, i, snapshot;208 int r, i, snapshot;
@@ -167,8 +216,8 @@ int main(int argc, char *argv[]) · 7 unmodified lines
167 TEST_ASSERT(!r, "sched_getaffinity failed, errno = %d (%s)", errno,216 TEST_ASSERT(!r, "sched_getaffinity failed, errno = %d (%s)", errno,
168 strerror(errno));217 strerror(errno));
169 218
170 if (CPU_COUNT(&possible_mask) < 2) {219 if (calc_min_max_cpu()) {
171 print_skip("Only one CPU, task migration not possible\n");220 print_skip("Only one usable CPU, task migration not possible");
172 exit(KSFT_SKIP);221 exit(KSFT_SKIP);
173 }222 }
174 223