History

Merge tag 'v5.5-rc4' into locking/kcsan, to resolve conflicts

Conflicts: init/main.c lib/Kconfig.debug

Ingo Molnar committed 6 years ago

Commit 28336be2 parents 5cbaefe fd6988411292 files · +552974 −238881Browse files

Showing the changes to include/linux (317 of 11292 files). Show all

Unified · Split

317 files
  1. include/linux/acpi.h +8 −0
  2. include/linux/aer.h +4 −0
  3. include/linux/agpgart.h +0 −2
  4. include/linux/ahci_platform.h +2 −0
  5. include/linux/arch_topology.h +1 −0
  6. include/linux/arm-smccc.h +75 −0
  7. include/linux/arm_sdei.h +0 −6
  8. include/linux/audit.h +3 −2
  9. include/linux/bitmap.h +51 −0
  10. include/linux/bitops.h +12 −0
  11. include/linux/blk-cgroup.h +37 −164
  12. include/linux/blk-mq.h +246 −54
  13. include/linux/blk_types.h +27 −1
  14. include/linux/blkdev.h +27 −30
  15. include/linux/bpf-cgroup.h +4 −4
  16. include/linux/bpf.h +244 −55
  17. include/linux/bpf_types.h +52 −25
  18. include/linux/bpf_verifier.h +10 −2
  19. include/linux/brcmphy.h +8 −2
  20. include/linux/bsearch.h +1 −1
  21. include/linux/btf.h +33 −0
  22. include/linux/build_bug.h +2 −2
  23. include/linux/bvec.h +10 −12
  24. include/linux/can/platform/mcp251x.h +0 −22
  25. include/linux/can/rx-offload.h +3 −4
  26. include/linux/ceph/libceph.h +6 −4
  27. include/linux/cgroup-defs.h +3 −16
  28. include/linux/cgroup.h +11 −16
  29. include/linux/clk-provider.h +1 −0
  30. include/linux/clk/tegra.h +24 −0
  31. include/linux/clk/ti.h +2 −1
  32. include/linux/compat.h +6 −15
  33. include/linux/context_tracking.h +15 −15
  34. include/linux/context_tracking_state.h +13 −8
  35. include/linux/coresight.h +6 −0
  36. include/linux/counter.h +10 −66
  37. include/linux/cpu.h +6 −1
  38. include/linux/cpu_cooling.h +8 −10
  39. include/linux/cpufreq.h +0 −11
  40. include/linux/cpuhotplug.h +2 −0
  41. include/linux/cpuidle.h +20 −9
  42. include/linux/crypto.h +2 −859
  43. include/linux/dcache.h +5 −0
  44. include/linux/debugfs.h +63 −73
  45. include/linux/devfreq.h +10 −4
  46. include/linux/device-mapper.h +19 −8
  47. include/linux/device.h +38 −5
  48. include/linux/device_cgroup.h +4 −15
  49. include/linux/dim.h +33 −30
  50. include/linux/dma-buf.h +57 −6
  51. include/linux/dma-direct.h +26 −11
  52. include/linux/dma-mapping.h +8 −7
  53. include/linux/dma-noncoherent.h +10 −12
  54. include/linux/dma/sprd-dma.h +4 −0
  55. include/linux/dmar.h +2 −0
  56. include/linux/dmi.h +4 −0
  57. include/linux/edac.h +68 −78
  58. include/linux/efi.h +22 −6
  59. include/linux/energy_model.h +1 −2
  60. include/linux/errname.h +16 −0
  61. include/linux/export.h +29 −63
  62. include/linux/exportfs.h +5 −0
  63. include/linux/extable.h +10 −0
  64. include/linux/falloc.h +26 −0
  65. include/linux/fb.h +1 −1
  66. include/linux/filter.h +36 −11
  67. include/linux/firmware/broadcom/tee_bnxt_fw.h +14 −0
  68. include/linux/firmware/intel/stratix10-svc-client.h +8 −0
  69. include/linux/firmware/meson/meson_sm.h +9 −6
  70. include/linux/firmware/xlnx-zynqmp.h +14 −2
  71. include/linux/fs.h +13 −6
  72. include/linux/fscrypt.h +3 −32
  73. include/linux/fsl/mc.h +2 −0
  74. include/linux/ftrace.h +134 −23
  75. include/linux/futex.h +27 −13
  76. include/linux/fwnode.h +49 −3
  77. include/linux/genalloc.h +1 −1
  78. include/linux/genhd.h +3 −2
  79. include/linux/gfp.h +2 −0
  80. include/linux/gpio/consumer.h +44 −10
  81. include/linux/gpio/driver.h +8 −0
  82. include/linux/hmm.h +14 −176
  83. include/linux/host1x.h +18 −8
  84. include/linux/hrtimer.h +10 −4
  85. include/linux/huge_mm.h +0 −2
  86. include/linux/hugetlb.h +116 −24
  87. include/linux/hyperv.h +26 −5
  88. include/linux/i2c-pxa.h +0 −18
  89. include/linux/i2c.h +20 −11
  90. include/linux/icmp.h +15 −0
  91. include/linux/icmpv6.h +14 −0
  92. include/linux/iio/adc/ad_sigma_delta.h +2 −0
  93. include/linux/iio/iio.h +2 −0
  94. include/linux/iio/imu/adis.h +4 −2
  95. include/linux/ima.h +2 −1
  96. include/linux/initrd.h +2 −0
  97. include/linux/input.h +1 −0
  98. include/linux/interrupt.h +14 −2
  99. include/linux/io-pgtable.h +1 −1
  100. include/linux/io.h +2 −0
  101. include/linux/ioasid.h +76 −0
  102. include/linux/iomap.h +95 −34
  103. include/linux/iommu.h +60 −5
  104. include/linux/ioport.h +1 −0
  105. include/linux/ipmi_smi.h +8 −4
  106. include/linux/irq.h +6 −0
  107. include/linux/irq_work.h +7 −3
  108. include/linux/irqchip/arm-gic-v3.h +4 −2
  109. include/linux/irqchip/arm-gic-v4.h +4 −0
  110. include/linux/irqchip/ingenic.h +0 −14
  111. include/linux/irqdomain.h +1 −0
  112. include/linux/jbd2.h +58 −62
  113. include/linux/journal-head.h +14 −7
  114. include/linux/kasan.h +34 −0
  115. include/linux/kcov.h +23 −0
  116. include/linux/kernel.h +14 −12
  117. include/linux/kernel_stat.h +18 −0
  118. include/linux/kernfs.h +38 −19
  119. include/linux/kvm_host.h +31 −12
  120. include/linux/kvm_types.h +2 −0
  121. include/linux/led-class-flash.h +28 −13
  122. include/linux/leds.h +44 −56
  123. include/linux/libata.h +8 −6
  124. include/linux/libfdt_env.h +4 −1
  125. include/linux/libnvdimm.h +0 −7
  126. include/linux/license.h +1 −0
  127. include/linux/linkage.h +241 −8
  128. include/linux/linkmode.h +6 −0
  129. include/linux/livepatch.h +17 −0
  130. include/linux/lockd/debug.h +0 −4
  131. include/linux/lockd/lockd.h +0 −4
  132. include/linux/lockdep.h +10 −11
  133. include/linux/logic_pio.h +2 −2
  134. include/linux/lsm_hooks.h +15 −0
  135. include/linux/memblock.h +3 −0
  136. include/linux/memcontrol.h +22 −27
  137. include/linux/memory_hotplug.h +4 −7
  138. include/linux/memregion.h +23 −0
  139. include/linux/mfd/abx500/ab8500-gpadc.h +0 −75
  140. include/linux/mfd/arizona/registers.h +0 −7
  141. include/linux/mfd/core.h +29 −20
  142. include/linux/mfd/db8500-prcmu.h +2 −2
  143. include/linux/mfd/dbx500-prcmu.h +4 −3
  144. include/linux/mfd/madera/core.h +11 −0
  145. include/linux/mfd/max77620.h +0 −1
  146. include/linux/mfd/mt6397/rtc.h +71 −0
  147. include/linux/mfd/rk808.h +1 −1
  148. include/linux/mfd/stm32-timers.h +4 −8
  149. include/linux/mfd/syscon/atmel-matrix.h +0 −1
  150. include/linux/mfd/twl.h +8 −4
  151. include/linux/miscdevice.h +2 −0
  152. include/linux/mlx5/driver.h +16 −4
  153. include/linux/mlx5/fs.h +2 −1
  154. include/linux/mlx5/mlx5_ifc.h +2 −1
  155. include/linux/mm.h +32 −28
  156. include/linux/mmc/card.h +2 −1
  157. include/linux/mmc/sdio_ids.h +2 −0
  158. include/linux/mmu_notifier.h +118 −29
  159. include/linux/mmzone.h +46 −33
  160. include/linux/mod_devicetable.h +2 −2
  161. include/linux/module.h +5 −2
  162. include/linux/moduleloader.h +1 −1
  163. include/linux/moduleparam.h +2 −2
  164. include/linux/mroute_base.h +14 −14
  165. include/linux/mtd/spi-nor.h +36 −28
  166. include/linux/mtio.h +60 −0
  167. include/linux/namei.h +1 −0
  168. include/linux/nd.h +1 −1
  169. include/linux/netdevice.h +42 −8
  170. include/linux/netfilter.h +31 −10
  171. include/linux/netfilter/ipset/ip_set.h +8 −188
  172. include/linux/netfilter/ipset/ip_set_bitmap.h +0 −14
  173. include/linux/netfilter/ipset/ip_set_getport.h +0 −3
  174. include/linux/nfs4.h +26 −0
  175. include/linux/nfs_fs.h +3 −1
  176. include/linux/nfs_fs_sb.h +5 −1
  177. include/linux/nfs_xdr.h +24 −7
  178. include/linux/notifier.h +0 −4
  179. include/linux/nvme-fc-driver.h +4 −0
  180. include/linux/nvme-fc.h +137 −45
  181. include/linux/nvme.h +57 −3
  182. include/linux/nvmem-consumer.h +10 −1
  183. include/linux/of_address.h +1 −20
  184. include/linux/of_mdio.h +6 −0
  185. include/linux/of_net.h +5 −2
  186. include/linux/of_pci.h +2 −3
  187. include/linux/page-isolation.h +2 −2
  188. include/linux/pagewalk.h +9 −0
  189. include/linux/parport.h +1 −0
  190. include/linux/pci-ats.h +21 −56
  191. include/linux/pci-epc.h +1 −1
  192. include/linux/pci.h +29 −33
  193. include/linux/pci_ids.h +1 −0
  194. include/linux/percpu-refcount.h +8 −8
  195. include/linux/percpu-rwsem.h +2 −2
  196. include/linux/perf_event.h +69 −5
  197. include/linux/phy.h +26 −2
  198. include/linux/phy/phy.h +2 −1
  199. include/linux/phy/tegra/xusb.h +3 −1
  200. include/linux/phy_led_triggers.h +1 −1
  201. include/linux/phylink.h +13 −12
  202. include/linux/pid.h +6 −1
  203. include/linux/pid_namespace.h +2 −0
  204. include/linux/pipe_fs_i.h +60 −6
  205. include/linux/platform_data/cros_ec_commands.h +220 −65
  206. include/linux/platform_data/cros_ec_proto.h +27 −111
  207. include/linux/platform_data/cros_ec_sensorhub.h +30 −0
  208. include/linux/platform_data/gpio_backlight.h +0 −3
  209. include/linux/platform_data/hsmmc-omap.h +0 −3
  210. include/linux/platform_data/i2c-pxa.h +0 −4
  211. include/linux/platform_data/intel-spi.h +1 −0
  212. include/linux/platform_data/pixcir_i2c_ts.h +0 −64
  213. include/linux/platform_data/spi-mt65xx.h +0 −1
  214. include/linux/platform_data/st_sensors_pdata.h +2 −0
  215. include/linux/platform_data/ti-prm.h +21 −0
  216. include/linux/platform_data/ti-sysc.h +2 −0
  217. include/linux/platform_data/wilco-ec.h +15 −0
  218. include/linux/platform_device.h +18 −52
  219. include/linux/pm.h +2 −0
  220. include/linux/pm_domain.h +5 −0
  221. include/linux/pm_opp.h +13 −0
  222. include/linux/pm_qos.h +50 −36
  223. include/linux/pm_wakeup.h +9 −0
  224. include/linux/power/smartreflex.h +3 −0
  225. include/linux/printk.h +1 −2
  226. include/linux/proc_fs.h +2 −2
  227. include/linux/property.h +53 −53
  228. include/linux/psci.h +2 −7
  229. include/linux/pwm.h +1 −4
  230. include/linux/pxa2xx_ssp.h +1 −1
  231. include/linux/qcom_scm.h +28 −0
  232. include/linux/quota.h +1 −1
  233. include/linux/quotaops.h +13 −1
  234. include/linux/rbtree_augmented.h +2 −4
  235. include/linux/rculist_bl.h +0 −28
  236. include/linux/rculist_nulls.h +37 −0
  237. include/linux/rcupdate.h +19 −1
  238. include/linux/rcutiny.h +1 −0
  239. include/linux/rcutree.h +1 −0
  240. include/linux/refcount.h +229 −40
  241. include/linux/regulator/ab8500.h +0 −3
  242. include/linux/regulator/fixed.h +1 −0
  243. include/linux/reset-controller.h +2 −1
  244. include/linux/reset.h +46 −0
  245. include/linux/resource_ext.h +12 −0
  246. include/linux/rtc.h +5 −0
  247. include/linux/rtc/ds1685.h +5 −7
  248. include/linux/rtsx_pci.h +1 −0
  249. include/linux/rwlock_api_smp.h +8 −8
  250. include/linux/sbitmap.h +0 −9
  251. include/linux/sched.h +19 −4
  252. include/linux/sched/cpufreq.h +3 −0
  253. include/linux/sched/mm.h +4 −2
  254. include/linux/sched/task.h +3 −0
  255. include/linux/seccomp.h +3 −3
  256. include/linux/security.h +40 −1
  257. include/linux/sed-opal.h +1 −0
  258. include/linux/seq_buf.h +3 −0
  259. include/linux/seqlock.h +2 −2
  260. include/linux/sfp.h +22 −9
  261. include/linux/skbuff.h +21 −9
  262. include/linux/skmsg.h +21 −17
  263. include/linux/slab.h +0 −20
  264. include/linux/soc/mmp/cputype.h +87 −0
  265. include/linux/soc/qcom/irq.h +34 −0
  266. include/linux/soc/qcom/llcc-qcom.h +20 −74
  267. include/linux/socket.h +16 −4
  268. include/linux/sort.h +4 −4
  269. include/linux/soundwire/sdw.h +3 −4
  270. include/linux/spi/spi.h +116 −16
  271. include/linux/spinlock_api_smp.h +4 −4
  272. include/linux/stat.h +2 −1
  273. include/linux/stmmac.h +3 −1
  274. include/linux/string.h +2 −0
  275. include/linux/sunrpc/auth.h +0 −3
  276. include/linux/sunrpc/auth_gss.h +0 −2
  277. include/linux/sunrpc/clnt.h +1 −3
  278. include/linux/sunrpc/gss_api.h +0 −2
  279. include/linux/sunrpc/gss_err.h +0 −3
  280. include/linux/sunrpc/msg_prot.h +0 −3
  281. include/linux/sunrpc/rpc_pipe_fs.h +0 −3
  282. include/linux/sunrpc/svcauth.h +0 −4
  283. include/linux/sunrpc/svcauth_gss.h +0 −2
  284. include/linux/sunrpc/xdr.h +0 −3
  285. include/linux/sunrpc/xprt.h +2 −5
  286. include/linux/sunrpc/xprtsock.h +0 −4
  287. include/linux/swap.h +1 −1
  288. include/linux/sxgbe_platform.h +3 −1
  289. include/linux/sys_soc.h +1 −0
  290. include/linux/syscalls.h +8 −11
  291. include/linux/sysctl.h +2 −4
  292. include/linux/tcp.h +1 −1
  293. include/linux/thermal.h +0 −11
  294. include/linux/thread_info.h +2 −0
  295. include/linux/tick.h +7 −2
  296. include/linux/time.h +18 −4
  297. include/linux/time32.h +1 −1
  298. include/linux/tpm.h +233 −18
  299. include/linux/trace.h +8 −0
  300. include/linux/trace_events.h +7 −1
  301. include/linux/trace_seq.h +4 −0
  302. include/linux/types.h +6 −1
  303. include/linux/u64_stats_sync.h +47 −4
  304. include/linux/uaccess.h +16 −0
  305. include/linux/uio.h +2 −2
  306. include/linux/usb/role.h +3 −0
  307. include/linux/usb/tcpm.h +0 −41
  308. include/linux/usb/typec.h +23 −18
  309. include/linux/virtio_vsock.h +3 −15
  310. include/linux/vm_sockets.h +0 −15
  311. include/linux/vmalloc.h +13 −0
  312. include/linux/vmstat.h +50 −0
  313. include/linux/vmw_vmci_api.h +2 −0
  314. include/linux/vtime.h +30 −29
  315. include/linux/w1.h +1 −0
  316. include/linux/wait.h +7 −4
  317. include/linux/ww_mutex.h +1 −1
include/linux/acpi.h+8−0
@@ -678,6 +678,14 @@ static inline bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) · 677 unmodified lines
678678 return false;
679679 }
680680
681+struct acpi_device;
682+
683+static inline bool
684+acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const char *uid2)
685+{
686+ return false;
687+}
688+
681689 static inline struct acpi_device *
682690 acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
683691 {
include/linux/aer.h+4−0
@@ -46,6 +46,8 @@ int pci_enable_pcie_error_reporting(struct pci_dev *dev); · 45 unmodified lines
4646 int pci_disable_pcie_error_reporting(struct pci_dev *dev);
4747 int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
4848 int pci_cleanup_aer_error_status_regs(struct pci_dev *dev);
49+void pci_save_aer_state(struct pci_dev *dev);
50+void pci_restore_aer_state(struct pci_dev *dev);
4951 #else
5052 static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
5153 {
@@ -63,6 +65,8 @@ static inline int pci_cleanup_aer_error_status_regs(struct pci_dev *dev) · 11 unmodified lines
6365 {
6466 return -EINVAL;
6567 }
68+static inline void pci_save_aer_state(struct pci_dev *dev) {}
69+static inline void pci_restore_aer_state(struct pci_dev *dev) {}
6670 #endif
6771
6872 void cper_print_aer(struct pci_dev *dev, int aer_severity,
include/linux/agpgart.h+0−2
@@ -30,8 +30,6 @@ · 29 unmodified lines
3030 #include <linux/agp_backend.h>
3131 #include <uapi/linux/agpgart.h>
3232
33−#define AGPGART_MINOR 175
34−
3533 struct agp_info {
3634 struct agp_version version; /* version of the driver */
3735 u32 bridge_id; /* bridge vendor/device */
include/linux/ahci_platform.h+2−0
@@ -19,6 +19,8 @@ struct ahci_host_priv; · 18 unmodified lines
1919 struct platform_device;
2020 struct scsi_host_template;
2121
22+int ahci_platform_enable_phys(struct ahci_host_priv *hpriv);
23+void ahci_platform_disable_phys(struct ahci_host_priv *hpriv);
2224 int ahci_platform_enable_clks(struct ahci_host_priv *hpriv);
2325 void ahci_platform_disable_clks(struct ahci_host_priv *hpriv);
2426 int ahci_platform_enable_regulators(struct ahci_host_priv *hpriv);
include/linux/arch_topology.h+1−0
@@ -57,6 +57,7 @@ const struct cpumask *cpu_coregroup_mask(int cpu); · 56 unmodified lines
5757 void update_siblings_masks(unsigned int cpu);
5858 void remove_cpu_topology(unsigned int cpuid);
5959 void reset_cpu_topology(void);
60+int parse_acpi_topology(void);
6061 #endif
6162
6263 #endif /* _LINUX_ARCH_TOPOLOGY_H_ */
include/linux/arm-smccc.h+75−0
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 #define ARM_SMCCC_OWNER_SIP 2
4646 #define ARM_SMCCC_OWNER_OEM 3
4747 #define ARM_SMCCC_OWNER_STANDARD 4
48+#define ARM_SMCCC_OWNER_STANDARD_HYP 5
4849 #define ARM_SMCCC_OWNER_TRUSTED_APP 48
4950 #define ARM_SMCCC_OWNER_TRUSTED_APP_END 49
5051 #define ARM_SMCCC_OWNER_TRUSTED_OS 50
@@ -80,6 +81,22 @@ · 29 unmodified lines
8081
8182 #include <linux/linkage.h>
8283 #include <linux/types.h>
84+
85+enum arm_smccc_conduit {
86+ SMCCC_CONDUIT_NONE,
87+ SMCCC_CONDUIT_SMC,
88+ SMCCC_CONDUIT_HVC,
89+};
90+
91+/**
92+ * arm_smccc_1_1_get_conduit()
93+ *
94+ * Returns the conduit to be used for SMCCCv1.1 or later.
95+ *
96+ * When SMCCCv1.1 is not present, returns SMCCC_CONDUIT_NONE.
97+ */
98+enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void);
99+
83100 /**
84101 * struct arm_smccc_res - Result from SMC/HVC call
85102 * @a0-a3 result values from registers 0 to 3
@@ -302,5 +319,63 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, · 216 unmodified lines
302319 #define SMCCC_RET_NOT_SUPPORTED -1
303320 #define SMCCC_RET_NOT_REQUIRED -2
304321
322+/*
323+ * Like arm_smccc_1_1* but always returns SMCCC_RET_NOT_SUPPORTED.
324+ * Used when the SMCCC conduit is not defined. The empty asm statement
325+ * avoids compiler warnings about unused variables.
326+ */
327+#define __fail_smccc_1_1(...) \
328+ do { \
329+ __declare_args(__count_args(__VA_ARGS__), __VA_ARGS__); \
330+ asm ("" __constraints(__count_args(__VA_ARGS__))); \
331+ if (___res) \
332+ ___res->a0 = SMCCC_RET_NOT_SUPPORTED; \
333+ } while (0)
334+
335+/*
336+ * arm_smccc_1_1_invoke() - make an SMCCC v1.1 compliant call
337+ *
338+ * This is a variadic macro taking one to eight source arguments, and
339+ * an optional return structure.
340+ *
341+ * @a0-a7: arguments passed in registers 0 to 7
342+ * @res: result values from registers 0 to 3
343+ *
344+ * This macro will make either an HVC call or an SMC call depending on the
345+ * current SMCCC conduit. If no valid conduit is available then -1
346+ * (SMCCC_RET_NOT_SUPPORTED) is returned in @res.a0 (if supplied).
347+ *
348+ * The return value also provides the conduit that was used.
349+ */
350+#define arm_smccc_1_1_invoke(...) ({ \
351+ int method = arm_smccc_1_1_get_conduit(); \
352+ switch (method) { \
353+ case SMCCC_CONDUIT_HVC: \
354+ arm_smccc_1_1_hvc(__VA_ARGS__); \
355+ break; \
356+ case SMCCC_CONDUIT_SMC: \
357+ arm_smccc_1_1_smc(__VA_ARGS__); \
358+ break; \
359+ default: \
360+ __fail_smccc_1_1(__VA_ARGS__); \
361+ method = SMCCC_CONDUIT_NONE; \
362+ break; \
363+ } \
364+ method; \
365+ })
366+
367+/* Paravirtualised time calls (defined by ARM DEN0057A) */
368+#define ARM_SMCCC_HV_PV_TIME_FEATURES \
369+ ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
370+ ARM_SMCCC_SMC_64, \
371+ ARM_SMCCC_OWNER_STANDARD_HYP, \
372+ 0x20)
373+
374+#define ARM_SMCCC_HV_PV_TIME_ST \
375+ ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
376+ ARM_SMCCC_SMC_64, \
377+ ARM_SMCCC_OWNER_STANDARD_HYP, \
378+ 0x21)
379+
305380 #endif /*__ASSEMBLY__*/
306381 #endif /*__LINUX_ARM_SMCCC_H*/
include/linux/arm_sdei.h+0−6
@@ -5,12 +5,6 @@ · 4 unmodified lines
55
66 #include <uapi/linux/arm_sdei.h>
77
8−enum sdei_conduit_types {
9− CONDUIT_INVALID = 0,
10− CONDUIT_SMC,
11− CONDUIT_HVC,
12−};
13−
148 #include <acpi/ghes.h>
159
1610 #ifdef CONFIG_ARM_SDE_INTERFACE
include/linux/audit.h+3−2
@@ -156,7 +156,8 @@ extern void audit_log_d_path(struct audit_buffer *ab, · 155 unmodified lines
156156 const struct path *path);
157157 extern void audit_log_key(struct audit_buffer *ab,
158158 char *key);
159−extern void audit_log_link_denied(const char *operation);
159+extern void audit_log_path_denied(int type,
160+ const char *operation);
160161 extern void audit_log_lost(const char *message);
161162
162163 extern int audit_log_task_context(struct audit_buffer *ab);
@@ -217,7 +218,7 @@ static inline void audit_log_d_path(struct audit_buffer *ab, · 54 unmodified lines
217218 { }
218219 static inline void audit_log_key(struct audit_buffer *ab, char *key)
219220 { }
220−static inline void audit_log_link_denied(const char *string)
221+static inline void audit_log_path_denied(int type, const char *operation)
221222 { }
222223 static inline int audit_log_task_context(struct audit_buffer *ab)
223224 {
include/linux/bitmap.h+51−0
@@ -53,6 +53,7 @@ · 52 unmodified lines
5353 * bitmap_find_next_zero_area_off(buf, len, pos, n, mask) as above
5454 * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n
5555 * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n
56+ * bitmap_replace(dst, old, new, mask, nbits) *dst = (*old & ~(*mask)) | (*new & *mask)
5657 * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src)
5758 * bitmap_bitremap(oldbit, old, new, nbits) newbit = map(old, new)(oldbit)
5859 * bitmap_onto(dst, orig, relmap, nbits) *dst = orig relative to relmap
@@ -66,6 +67,8 @@ · 7 unmodified lines
6667 * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region
6768 * bitmap_from_arr32(dst, buf, nbits) Copy nbits from u32[] buf to dst
6869 * bitmap_to_arr32(buf, src, nbits) Copy nbits from buf to u32[] dst
70+ * bitmap_get_value8(map, start) Get 8bit value from map at start
71+ * bitmap_set_value8(map, value, start) Set 8bit value to map at start
6972 *
7073 * Note, bitmap_zero() and bitmap_fill() operate over the region of
7174 * unsigned longs, that is, bits behind bitmap till the unsigned long
@@ -138,6 +141,9 @@ extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1, · 66 unmodified lines
138141 const unsigned long *bitmap2, unsigned int nbits);
139142 extern int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,
140143 const unsigned long *bitmap2, unsigned int nbits);
144+extern void __bitmap_replace(unsigned long *dst,
145+ const unsigned long *old, const unsigned long *new,
146+ const unsigned long *mask, unsigned int nbits);
141147 extern int __bitmap_intersects(const unsigned long *bitmap1,
142148 const unsigned long *bitmap2, unsigned int nbits);
143149 extern int __bitmap_subset(const unsigned long *bitmap1,
@@ -432,6 +438,18 @@ static inline void bitmap_shift_left(unsigned long *dst, const unsigned long *sr · 288 unmodified lines
432438 __bitmap_shift_left(dst, src, shift, nbits);
433439 }
434440
441+static inline void bitmap_replace(unsigned long *dst,
442+ const unsigned long *old,
443+ const unsigned long *new,
444+ const unsigned long *mask,
445+ unsigned int nbits)
446+{
447+ if (small_const_nbits(nbits))
448+ *dst = (*old & ~(*mask)) | (*new & *mask);
449+ else
450+ __bitmap_replace(dst, old, new, mask, nbits);
451+}
452+
435453 static inline int bitmap_parse(const char *buf, unsigned int buflen,
436454 unsigned long *maskp, int nmaskbits)
437455 {
@@ -489,6 +507,39 @@ static inline void bitmap_from_u64(unsigned long *dst, u64 mask) · 51 unmodified lines
489507 dst[1] = mask >> 32;
490508 }
491509
510+/**
511+ * bitmap_get_value8 - get an 8-bit value within a memory region
512+ * @map: address to the bitmap memory region
513+ * @start: bit offset of the 8-bit value; must be a multiple of 8
514+ *
515+ * Returns the 8-bit value located at the @start bit offset within the @src
516+ * memory region.
517+ */
518+static inline unsigned long bitmap_get_value8(const unsigned long *map,
519+ unsigned long start)
520+{
521+ const size_t index = BIT_WORD(start);
522+ const unsigned long offset = start % BITS_PER_LONG;
523+
524+ return (map[index] >> offset) & 0xFF;
525+}
526+
527+/**
528+ * bitmap_set_value8 - set an 8-bit value within a memory region
529+ * @map: address to the bitmap memory region
530+ * @value: the 8-bit value; values wider than 8 bits may clobber bitmap
531+ * @start: bit offset of the 8-bit value; must be a multiple of 8
532+ */
533+static inline void bitmap_set_value8(unsigned long *map, unsigned long value,
534+ unsigned long start)
535+{
536+ const size_t index = BIT_WORD(start);
537+ const unsigned long offset = start % BITS_PER_LONG;
538+
539+ map[index] &= ~(0xFFUL << offset);
540+ map[index] |= value << offset;
541+}
542+
492543 #endif /* __ASSEMBLY__ */
493544
494545 #endif /* __LINUX_BITMAP_H */
include/linux/bitops.h+12−0
@@ -47,6 +47,18 @@ extern unsigned long __sw_hweight64(__u64 w); · 46 unmodified lines
4747 (bit) < (size); \
4848 (bit) = find_next_zero_bit((addr), (size), (bit) + 1))
4949
50+/**
51+ * for_each_set_clump8 - iterate over bitmap for each 8-bit clump with set bits
52+ * @start: bit offset to start search and to store the current iteration offset
53+ * @clump: location to store copy of current 8-bit clump
54+ * @bits: bitmap address to base the search on
55+ * @size: bitmap size in number of bits
56+ */
57+#define for_each_set_clump8(start, clump, bits, size) \
58+ for ((start) = find_first_clump8(&(clump), (bits), (size)); \
59+ (start) < (size); \
60+ (start) = find_next_clump8(&(clump), (bits), (size), (start) + 8))
61+
5062 static inline int get_bitmask_order(unsigned int count)
5163 {
5264 int order;
include/linux/blk-cgroup.h+37−164
@@ -15,7 +15,9 @@ · 14 unmodified lines
1515 */
1616
1717 #include <linux/cgroup.h>
18+#include <linux/percpu.h>
1819 #include <linux/percpu_counter.h>
20+#include <linux/u64_stats_sync.h>
1921 #include <linux/seq_file.h>
2022 #include <linux/radix-tree.h>
2123 #include <linux/blkdev.h>
@@ -31,15 +33,12 @@ · 9 unmodified lines
3133
3234 #ifdef CONFIG_BLK_CGROUP
3335
34−enum blkg_rwstat_type {
35− BLKG_RWSTAT_READ,
36− BLKG_RWSTAT_WRITE,
37− BLKG_RWSTAT_SYNC,
38− BLKG_RWSTAT_ASYNC,
39− BLKG_RWSTAT_DISCARD,
36+enum blkg_iostat_type {
37+ BLKG_IOSTAT_READ,
38+ BLKG_IOSTAT_WRITE,
39+ BLKG_IOSTAT_DISCARD,
4040
41− BLKG_RWSTAT_NR,
42− BLKG_RWSTAT_TOTAL = BLKG_RWSTAT_NR,
41+ BLKG_IOSTAT_NR,
4342 };
4443
4544 struct blkcg_gq;
@@ -61,17 +60,15 @@ struct blkcg { · 15 unmodified lines
6160 #endif
6261 };
6362
64−/*
65− * blkg_[rw]stat->aux_cnt is excluded for local stats but included for
66− * recursive. Used to carry stats of dead children.
67− */
68−struct blkg_rwstat {
69− struct percpu_counter cpu_cnt[BLKG_RWSTAT_NR];
70− atomic64_t aux_cnt[BLKG_RWSTAT_NR];
63+struct blkg_iostat {
64+ u64 bytes[BLKG_IOSTAT_NR];
65+ u64 ios[BLKG_IOSTAT_NR];
7166 };
7267
73−struct blkg_rwstat_sample {
74− u64 cnt[BLKG_RWSTAT_NR];
68+struct blkg_iostat_set {
69+ struct u64_stats_sync sync;
70+ struct blkg_iostat cur;
71+ struct blkg_iostat last;
7572 };
7673
7774 /*
@@ -127,8 +124,8 @@ struct blkcg_gq { · 49 unmodified lines
127124 /* is this blkg online? protected by both blkcg and q locks */
128125 bool online;
129126
130− struct blkg_rwstat stat_bytes;
131− struct blkg_rwstat stat_ios;
127+ struct blkg_iostat_set __percpu *iostat_cpu;
128+ struct blkg_iostat_set iostat;
132129
133130 struct blkg_policy_data *pd[BLKCG_MAX_POLS];
134131
@@ -191,7 +188,6 @@ struct blkcg_gq *__blkg_lookup_create(struct blkcg *blkcg, · 56 unmodified lines
191188 struct blkcg_gq *blkg_lookup_create(struct blkcg *blkcg,
192189 struct request_queue *q);
193190 int blkcg_init_queue(struct request_queue *q);
194−void blkcg_drain_queue(struct request_queue *q);
195191 void blkcg_exit_queue(struct request_queue *q);
196192
197193 /* Blkio controller policy registration */
@@ -202,13 +198,6 @@ int blkcg_activate_policy(struct request_queue *q, · 4 unmodified lines
202198 void blkcg_deactivate_policy(struct request_queue *q,
203199 const struct blkcg_policy *pol);
204200
205−static inline u64 blkg_rwstat_read_counter(struct blkg_rwstat *rwstat,
206− unsigned int idx)
207−{
208− return atomic64_read(&rwstat->aux_cnt[idx]) +
209− percpu_counter_sum_positive(&rwstat->cpu_cnt[idx]);
210−}
211−
212201 const char *blkg_dev_name(struct blkcg_gq *blkg);
213202 void blkcg_print_blkgs(struct seq_file *sf, struct blkcg *blkcg,
214203 u64 (*prfill)(struct seq_file *,
@@ -216,17 +205,6 @@ void blkcg_print_blkgs(struct seq_file *sf, struct blkcg *blkcg, · 1 unmodified line
216205 const struct blkcg_policy *pol, int data,
217206 bool show_total);
218207 u64 __blkg_prfill_u64(struct seq_file *sf, struct blkg_policy_data *pd, u64 v);
219−u64 __blkg_prfill_rwstat(struct seq_file *sf, struct blkg_policy_data *pd,
220− const struct blkg_rwstat_sample *rwstat);
221−u64 blkg_prfill_rwstat(struct seq_file *sf, struct blkg_policy_data *pd,
222− int off);
223−int blkg_print_stat_bytes(struct seq_file *sf, void *v);
224−int blkg_print_stat_ios(struct seq_file *sf, void *v);
225−int blkg_print_stat_bytes_recursive(struct seq_file *sf, void *v);
226−int blkg_print_stat_ios_recursive(struct seq_file *sf, void *v);
227−
228−void blkg_rwstat_recursive_sum(struct blkcg_gq *blkg, struct blkcg_policy *pol,
229− int off, struct blkg_rwstat_sample *sum);
230208
231209 struct blkg_conf_ctx {
232210 struct gendisk *disk;
@@ -578,128 +556,6 @@ static inline void blkg_put(struct blkcg_gq *blkg) · 345 unmodified lines
578556 if (((d_blkg) = __blkg_lookup(css_to_blkcg(pos_css), \
579557 (p_blkg)->q, false)))
580558
581−static inline int blkg_rwstat_init(struct blkg_rwstat *rwstat, gfp_t gfp)
582−{
583− int i, ret;
584−
585− for (i = 0; i < BLKG_RWSTAT_NR; i++) {
586− ret = percpu_counter_init(&rwstat->cpu_cnt[i], 0, gfp);
587− if (ret) {
588− while (--i >= 0)
589− percpu_counter_destroy(&rwstat->cpu_cnt[i]);
590− return ret;
591− }
592− atomic64_set(&rwstat->aux_cnt[i], 0);
593− }
594− return 0;
595−}
596−
597−static inline void blkg_rwstat_exit(struct blkg_rwstat *rwstat)
598−{
599− int i;
600−
601− for (i = 0; i < BLKG_RWSTAT_NR; i++)
602− percpu_counter_destroy(&rwstat->cpu_cnt[i]);
603−}
604−
605−/**
606− * blkg_rwstat_add - add a value to a blkg_rwstat
607− * @rwstat: target blkg_rwstat
608− * @op: REQ_OP and flags
609− * @val: value to add
610− *
611− * Add @val to @rwstat. The counters are chosen according to @rw. The
612− * caller is responsible for synchronizing calls to this function.
613− */
614−static inline void blkg_rwstat_add(struct blkg_rwstat *rwstat,
615− unsigned int op, uint64_t val)
616−{
617− struct percpu_counter *cnt;
618−
619− if (op_is_discard(op))
620− cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_DISCARD];
621− else if (op_is_write(op))
622− cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_WRITE];
623− else
624− cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_READ];
625−
626− percpu_counter_add_batch(cnt, val, BLKG_STAT_CPU_BATCH);
627−
628− if (op_is_sync(op))
629− cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_SYNC];
630− else
631− cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_ASYNC];
632−
633− percpu_counter_add_batch(cnt, val, BLKG_STAT_CPU_BATCH);
634−}
635−
636−/**
637− * blkg_rwstat_read - read the current values of a blkg_rwstat
638− * @rwstat: blkg_rwstat to read
639− *
640− * Read the current snapshot of @rwstat and return it in the aux counts.
641− */
642−static inline void blkg_rwstat_read(struct blkg_rwstat *rwstat,
643− struct blkg_rwstat_sample *result)
644−{
645− int i;
646−
647− for (i = 0; i < BLKG_RWSTAT_NR; i++)
648− result->cnt[i] =
649− percpu_counter_sum_positive(&rwstat->cpu_cnt[i]);
650−}
651−
652−/**
653− * blkg_rwstat_total - read the total count of a blkg_rwstat
654− * @rwstat: blkg_rwstat to read
655− *
656− * Return the total count of @rwstat regardless of the IO direction. This
657− * function can be called without synchronization and takes care of u64
658− * atomicity.
659− */
660−static inline uint64_t blkg_rwstat_total(struct blkg_rwstat *rwstat)
661−{
662− struct blkg_rwstat_sample tmp = { };
663−
664− blkg_rwstat_read(rwstat, &tmp);
665− return tmp.cnt[BLKG_RWSTAT_READ] + tmp.cnt[BLKG_RWSTAT_WRITE];
666−}
667−
668−/**
669− * blkg_rwstat_reset - reset a blkg_rwstat
670− * @rwstat: blkg_rwstat to reset
671− */
672−static inline void blkg_rwstat_reset(struct blkg_rwstat *rwstat)
673−{
674− int i;
675−
676− for (i = 0; i < BLKG_RWSTAT_NR; i++) {
677− percpu_counter_set(&rwstat->cpu_cnt[i], 0);
678− atomic64_set(&rwstat->aux_cnt[i], 0);
679− }
680−}
681−
682−/**
683− * blkg_rwstat_add_aux - add a blkg_rwstat into another's aux count
684− * @to: the destination blkg_rwstat
685− * @from: the source
686− *
687− * Add @from's count including the aux one to @to's aux count.
688− */
689−static inline void blkg_rwstat_add_aux(struct blkg_rwstat *to,
690− struct blkg_rwstat *from)
691−{
692− u64 sum[BLKG_RWSTAT_NR];
693− int i;
694−
695− for (i = 0; i < BLKG_RWSTAT_NR; i++)
696− sum[i] = percpu_counter_sum_positive(&from->cpu_cnt[i]);
697−
698− for (i = 0; i < BLKG_RWSTAT_NR; i++)
699− atomic64_add(sum[i] + atomic64_read(&from->aux_cnt[i]),
700− &to->aux_cnt[i]);
701−}
702−
703559 #ifdef CONFIG_BLK_DEV_THROTTLING
704560 extern bool blk_throtl_bio(struct request_queue *q, struct blkcg_gq *blkg,
705561 struct bio *bio);
@@ -745,15 +601,33 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, · 39 unmodified lines
745601 throtl = blk_throtl_bio(q, blkg, bio);
746602
747603 if (!throtl) {
604+ struct blkg_iostat_set *bis;
605+ int rwd, cpu;
606+
607+ if (op_is_discard(bio->bi_opf))
608+ rwd = BLKG_IOSTAT_DISCARD;
609+ else if (op_is_write(bio->bi_opf))
610+ rwd = BLKG_IOSTAT_WRITE;
611+ else
612+ rwd = BLKG_IOSTAT_READ;
613+
614+ cpu = get_cpu();
615+ bis = per_cpu_ptr(blkg->iostat_cpu, cpu);
616+ u64_stats_update_begin(&bis->sync);
617+
748618 /*
749619 * If the bio is flagged with BIO_QUEUE_ENTERED it means this
750620 * is a split bio and we would have already accounted for the
751621 * size of the bio.
752622 */
753623 if (!bio_flagged(bio, BIO_QUEUE_ENTERED))
754− blkg_rwstat_add(&blkg->stat_bytes, bio->bi_opf,
755− bio->bi_iter.bi_size);
756− blkg_rwstat_add(&blkg->stat_ios, bio->bi_opf, 1);
624+ bis->cur.bytes[rwd] += bio->bi_iter.bi_size;
625+ bis->cur.ios[rwd]++;
626+
627+ u64_stats_update_end(&bis->sync);
628+ if (cgroup_subsys_on_dfl(io_cgrp_subsys))
629+ cgroup_rstat_updated(blkg->blkcg->css.cgroup, cpu);
630+ put_cpu();
757631 }
758632
759633 blkcg_bio_issue_init(bio);
@@ -845,7 +719,6 @@ static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg, void *key) { ret · 85 unmodified lines
845719 static inline struct blkcg_gq *blk_queue_root_blkg(struct request_queue *q)
846720 { return NULL; }
847721 static inline int blkcg_init_queue(struct request_queue *q) { return 0; }
848−static inline void blkcg_drain_queue(struct request_queue *q) { }
849722 static inline void blkcg_exit_queue(struct request_queue *q) { }
850723 static inline int blkcg_policy_register(struct blkcg_policy *pol) { return 0; }
851724 static inline void blkcg_policy_unregister(struct blkcg_policy *pol) { }
include/linux/blk-mq.h+246−54
@@ -10,103 +10,239 @@ struct blk_mq_tags; · 9 unmodified lines
1010 struct blk_flush_queue;
1111
1212 /**
13− * struct blk_mq_hw_ctx - State for a hardware queue facing the hardware block device
13+ * struct blk_mq_hw_ctx - State for a hardware queue facing the hardware
14+ * block device
1415 */
1516 struct blk_mq_hw_ctx {
1617 struct {
18+ /** @lock: Protects the dispatch list. */
1719 spinlock_t lock;
20+ /**
21+ * @dispatch: Used for requests that are ready to be
22+ * dispatched to the hardware but for some reason (e.g. lack of
23+ * resources) could not be sent to the hardware. As soon as the
24+ * driver can send new requests, requests at this list will
25+ * be sent first for a fairer dispatch.
26+ */
1827 struct list_head dispatch;
19− unsigned long state; /* BLK_MQ_S_* flags */
28+ /**
29+ * @state: BLK_MQ_S_* flags. Defines the state of the hw
30+ * queue (active, scheduled to restart, stopped).
31+ */
32+ unsigned long state;
2033 } ____cacheline_aligned_in_smp;
2134
35+ /**
36+ * @run_work: Used for scheduling a hardware queue run at a later time.
37+ */
2238 struct delayed_work run_work;
39+ /** @cpumask: Map of available CPUs where this hctx can run. */
2340 cpumask_var_t cpumask;
41+ /**
42+ * @next_cpu: Used by blk_mq_hctx_next_cpu() for round-robin CPU
43+ * selection from @cpumask.
44+ */
2445 int next_cpu;
46+ /**
47+ * @next_cpu_batch: Counter of how many works left in the batch before
48+ * changing to the next CPU.
49+ */
2550 int next_cpu_batch;
2651
27− unsigned long flags; /* BLK_MQ_F_* flags */
52+ /** @flags: BLK_MQ_F_* flags. Defines the behaviour of the queue. */
53+ unsigned long flags;
2854
55+ /**
56+ * @sched_data: Pointer owned by the IO scheduler attached to a request
57+ * queue. It's up to the IO scheduler how to use this pointer.
58+ */
2959 void *sched_data;
60+ /**
61+ * @queue: Pointer to the request queue that owns this hardware context.
62+ */
3063 struct request_queue *queue;
64+ /** @fq: Queue of requests that need to perform a flush operation. */
3165 struct blk_flush_queue *fq;
3266
67+ /**
68+ * @driver_data: Pointer to data owned by the block driver that created
69+ * this hctx
70+ */
3371 void *driver_data;
3472
73+ /**
74+ * @ctx_map: Bitmap for each software queue. If bit is on, there is a
75+ * pending request in that software queue.
76+ */
3577 struct sbitmap ctx_map;
3678
79+ /**
80+ * @dispatch_from: Software queue to be used when no scheduler was
81+ * selected.
82+ */
3783 struct blk_mq_ctx *dispatch_from;
84+ /**
85+ * @dispatch_busy: Number used by blk_mq_update_dispatch_busy() to
86+ * decide if the hw_queue is busy using Exponential Weighted Moving
87+ * Average algorithm.
88+ */
3889 unsigned int dispatch_busy;
3990
91+ /** @type: HCTX_TYPE_* flags. Type of hardware queue. */
4092 unsigned short type;
93+ /** @nr_ctx: Number of software queues. */
4194 unsigned short nr_ctx;
95+ /** @ctxs: Array of software queues. */
4296 struct blk_mq_ctx **ctxs;
4397
98+ /** @dispatch_wait_lock: Lock for dispatch_wait queue. */
4499 spinlock_t dispatch_wait_lock;
100+ /**
101+ * @dispatch_wait: Waitqueue to put requests when there is no tag
102+ * available at the moment, to wait for another try in the future.
103+ */
45104 wait_queue_entry_t dispatch_wait;
105+
106+ /**
107+ * @wait_index: Index of next available dispatch_wait queue to insert
108+ * requests.
109+ */
46110 atomic_t wait_index;
47111
112+ /**
113+ * @tags: Tags owned by the block driver. A tag at this set is only
114+ * assigned when a request is dispatched from a hardware queue.
115+ */
48116 struct blk_mq_tags *tags;
117+ /**
118+ * @sched_tags: Tags owned by I/O scheduler. If there is an I/O
119+ * scheduler associated with a request queue, a tag is assigned when
120+ * that request is allocated. Else, this member is not used.
121+ */
49122 struct blk_mq_tags *sched_tags;
50123
124+ /** @queued: Number of queued requests. */
51125 unsigned long queued;
126+ /** @run: Number of dispatched requests. */
52127 unsigned long run;
53128 #define BLK_MQ_MAX_DISPATCH_ORDER 7
129+ /** @dispatched: Number of dispatch requests by queue. */
54130 unsigned long dispatched[BLK_MQ_MAX_DISPATCH_ORDER];
55131
132+ /** @numa_node: NUMA node the storage adapter has been connected to. */
56133 unsigned int numa_node;
134+ /** @queue_num: Index of this hardware queue. */
57135 unsigned int queue_num;
58136
137+ /**
138+ * @nr_active: Number of active requests. Only used when a tag set is
139+ * shared across request queues.
140+ */
59141 atomic_t nr_active;
60142
143+ /** @cpuhp_dead: List to store request if some CPU die. */
61144 struct hlist_node cpuhp_dead;
145+ /** @kobj: Kernel object for sysfs. */
62146 struct kobject kobj;
63147
148+ /** @poll_considered: Count times blk_poll() was called. */
64149 unsigned long poll_considered;
150+ /** @poll_invoked: Count how many requests blk_poll() polled. */
65151 unsigned long poll_invoked;
152+ /** @poll_success: Count how many polled requests were completed. */
66153 unsigned long poll_success;
67154
68155 #ifdef CONFIG_BLK_DEBUG_FS
156+ /**
157+ * @debugfs_dir: debugfs directory for this hardware queue. Named
158+ * as cpu<cpu_number>.
159+ */
69160 struct dentry *debugfs_dir;
161+ /** @sched_debugfs_dir: debugfs directory for the scheduler. */
70162 struct dentry *sched_debugfs_dir;
71163 #endif
72164
165+ /** @hctx_list: List of all hardware queues. */
73166 struct list_head hctx_list;
74167
75− /* Must be the last member - see also blk_mq_hw_ctx_size(). */
168+ /**
169+ * @srcu: Sleepable RCU. Use as lock when type of the hardware queue is
170+ * blocking (BLK_MQ_F_BLOCKING). Must be the last member - see also
171+ * blk_mq_hw_ctx_size().
172+ */
76173 struct srcu_struct srcu[0];
77174 };
78175
176+/**
177+ * struct blk_mq_queue_map - Map software queues to hardware queues
178+ * @mq_map: CPU ID to hardware queue index map. This is an array
179+ * with nr_cpu_ids elements. Each element has a value in the range
180+ * [@queue_offset, @queue_offset + @nr_queues).
181+ * @nr_queues: Number of hardware queues to map CPU IDs onto.
182+ * @queue_offset: First hardware queue to map onto. Used by the PCIe NVMe
183+ * driver to map each hardware queue type (enum hctx_type) onto a distinct
184+ * set of hardware queues.
185+ */
79186 struct blk_mq_queue_map {
80187 unsigned int *mq_map;
81188 unsigned int nr_queues;
82189 unsigned int queue_offset;
83190 };
84191
192+/**
193+ * enum hctx_type - Type of hardware queue
194+ * @HCTX_TYPE_DEFAULT: All I/O not otherwise accounted for.
195+ * @HCTX_TYPE_READ: Just for READ I/O.
196+ * @HCTX_TYPE_POLL: Polled I/O of any kind.
197+ * @HCTX_MAX_TYPES: Number of types of hctx.
198+ */
85199 enum hctx_type {
86− HCTX_TYPE_DEFAULT, /* all I/O not otherwise accounted for */
87− HCTX_TYPE_READ, /* just for READ I/O */
88− HCTX_TYPE_POLL, /* polled I/O of any kind */
200+ HCTX_TYPE_DEFAULT,
201+ HCTX_TYPE_READ,
202+ HCTX_TYPE_POLL,
89203
90204 HCTX_MAX_TYPES,
91205 };
92206
207+/**
208+ * struct blk_mq_tag_set - tag set that can be shared between request queues
209+ * @map: One or more ctx -> hctx mappings. One map exists for each
210+ * hardware queue type (enum hctx_type) that the driver wishes
211+ * to support. There are no restrictions on maps being of the
212+ * same size, and it's perfectly legal to share maps between
213+ * types.
214+ * @nr_maps: Number of elements in the @map array. A number in the range
215+ * [1, HCTX_MAX_TYPES].
216+ * @ops: Pointers to functions that implement block driver behavior.
217+ * @nr_hw_queues: Number of hardware queues supported by the block driver that
218+ * owns this data structure.
219+ * @queue_depth: Number of tags per hardware queue, reserved tags included.
220+ * @reserved_tags: Number of tags to set aside for BLK_MQ_REQ_RESERVED tag
221+ * allocations.
222+ * @cmd_size: Number of additional bytes to allocate per request. The block
223+ * driver owns these additional bytes.
224+ * @numa_node: NUMA node the storage adapter has been connected to.
225+ * @timeout: Request processing timeout in jiffies.
226+ * @flags: Zero or more BLK_MQ_F_* flags.
227+ * @driver_data: Pointer to data owned by the block driver that created this
228+ * tag set.
229+ * @tags: Tag sets. One tag set per hardware queue. Has @nr_hw_queues
230+ * elements.
231+ * @tag_list_lock: Serializes tag_list accesses.
232+ * @tag_list: List of the request queues that use this tag set. See also
233+ * request_queue.tag_set_list.
234+ */
93235 struct blk_mq_tag_set {
94− /*
95− * map[] holds ctx -> hctx mappings, one map exists for each type
96− * that the driver wishes to support. There are no restrictions
97− * on maps being of the same size, and it's perfectly legal to
98− * share maps between types.
99− */
100236 struct blk_mq_queue_map map[HCTX_MAX_TYPES];
101− unsigned int nr_maps; /* nr entries in map[] */
237+ unsigned int nr_maps;
102238 const struct blk_mq_ops *ops;
103− unsigned int nr_hw_queues; /* nr hw queues across maps */
104− unsigned int queue_depth; /* max hw supported */
239+ unsigned int nr_hw_queues;
240+ unsigned int queue_depth;
105241 unsigned int reserved_tags;
106− unsigned int cmd_size; /* per-request extra data */
242+ unsigned int cmd_size;
107243 int numa_node;
108244 unsigned int timeout;
109− unsigned int flags; /* BLK_MQ_F_* */
245+ unsigned int flags;
110246 void *driver_data;
111247
112248 struct blk_mq_tags **tags;
@@ -115,6 +251,12 @@ struct blk_mq_tag_set { · 2 unmodified lines
115251 struct list_head tag_list;
116252 };
117253
254+/**
255+ * struct blk_mq_queue_data - Data about a request inserted in a queue
256+ *
257+ * @rq: Request pointer.
258+ * @last: If it is the last request in the queue.
259+ */
118260 struct blk_mq_queue_data {
119261 struct request *rq;
120262 bool last;
@@ -142,81 +284,101 @@ typedef bool (busy_fn)(struct request_queue *); · 21 unmodified lines
142284 typedef void (complete_fn)(struct request *);
143285 typedef void (cleanup_rq_fn)(struct request *);
144286
145−
287+/**
288+ * struct blk_mq_ops - Callback functions that implements block driver
289+ * behaviour.
290+ */
146291 struct blk_mq_ops {
147− /*
148− * Queue request
292+ /**
293+ * @queue_rq: Queue a new request from block IO.
149294 */
150295 queue_rq_fn *queue_rq;
151296
152− /*
153− * If a driver uses bd->last to judge when to submit requests to
154− * hardware, it must define this function. In case of errors that
155− * make us stop issuing further requests, this hook serves the
297+ /**
298+ * @commit_rqs: If a driver uses bd->last to judge when to submit
299+ * requests to hardware, it must define this function. In case of errors
300+ * that make us stop issuing further requests, this hook serves the
156301 * purpose of kicking the hardware (which the last request otherwise
157302 * would have done).
158303 */
159304 commit_rqs_fn *commit_rqs;
160305
161− /*
162− * Reserve budget before queue request, once .queue_rq is
306+ /**
307+ * @get_budget: Reserve budget before queue request, once .queue_rq is
163308 * run, it is driver's responsibility to release the
164309 * reserved budget. Also we have to handle failure case
165310 * of .get_budget for avoiding I/O deadlock.
166311 */
167312 get_budget_fn *get_budget;
313+ /**
314+ * @put_budget: Release the reserved budget.
315+ */
168316 put_budget_fn *put_budget;
169317
170− /*
171− * Called on request timeout
318+ /**
319+ * @timeout: Called on request timeout.
172320 */
173321 timeout_fn *timeout;
174322
175− /*
176− * Called to poll for completion of a specific tag.
323+ /**
324+ * @poll: Called to poll for completion of a specific tag.
177325 */
178326 poll_fn *poll;
179327
328+ /**
329+ * @complete: Mark the request as complete.
330+ */
180331 complete_fn *complete;
181332
182− /*
183− * Called when the block layer side of a hardware queue has been
184− * set up, allowing the driver to allocate/init matching structures.
185− * Ditto for exit/teardown.
333+ /**
334+ * @init_hctx: Called when the block layer side of a hardware queue has
335+ * been set up, allowing the driver to allocate/init matching
336+ * structures.
186337 */
187338 init_hctx_fn *init_hctx;
339+ /**
340+ * @exit_hctx: Ditto for exit/teardown.
341+ */
188342 exit_hctx_fn *exit_hctx;
189343
190− /*
191− * Called for every command allocated by the block layer to allow
192− * the driver to set up driver specific data.
344+ /**
345+ * @init_request: Called for every command allocated by the block layer
346+ * to allow the driver to set up driver specific data.
193347 *
194348 * Tag greater than or equal to queue_depth is for setting up
195349 * flush request.
196− *
197− * Ditto for exit/teardown.
198350 */
199351 init_request_fn *init_request;
352+ /**
353+ * @exit_request: Ditto for exit/teardown.
354+ */
200355 exit_request_fn *exit_request;
201− /* Called from inside blk_get_request() */
356+
357+ /**
358+ * @initialize_rq_fn: Called from inside blk_get_request().
359+ */
202360 void (*initialize_rq_fn)(struct request *rq);
203361
204− /*
205− * Called before freeing one request which isn't completed yet,
206− * and usually for freeing the driver private data
362+ /**
363+ * @cleanup_rq: Called before freeing one request which isn't completed
364+ * yet, and usually for freeing the driver private data.
207365 */
208366 cleanup_rq_fn *cleanup_rq;
209367
210− /*
211− * If set, returns whether or not this queue currently is busy
368+ /**
369+ * @busy: If set, returns whether or not this queue currently is busy.
212370 */
213371 busy_fn *busy;
214372
373+ /**
374+ * @map_queues: This allows drivers specify their own queue mapping by
375+ * overriding the setup-time function that builds the mq_map.
376+ */
215377 map_queues_fn *map_queues;
216378
217379 #ifdef CONFIG_BLK_DEBUG_FS
218− /*
219− * Used by the debugfs implementation to show driver-specific
380+ /**
381+ * @show_rq: Used by the debugfs implementation to show driver-specific
220382 * information about a request.
221383 */
222384 void (*show_rq)(struct seq_file *m, struct request *rq);
@@ -262,7 +424,6 @@ void blk_mq_free_tag_set(struct blk_mq_tag_set *set); · 39 unmodified lines
262424 void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule);
263425
264426 void blk_mq_free_request(struct request *rq);
265−bool blk_mq_can_queue(struct blk_mq_hw_ctx *);
266427
267428 bool blk_mq_queue_inflight(struct request_queue *q);
268429
@@ -301,9 +462,25 @@ static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag) · 32 unmodified lines
301462 return unique_tag & BLK_MQ_UNIQUE_TAG_MASK;
302463 }
303464
465+/**
466+ * blk_mq_rq_state() - read the current MQ_RQ_* state of a request
467+ * @rq: target request.
468+ */
469+static inline enum mq_rq_state blk_mq_rq_state(struct request *rq)
470+{
471+ return READ_ONCE(rq->state);
472+}
473+
474+static inline int blk_mq_request_started(struct request *rq)
475+{
476+ return blk_mq_rq_state(rq) != MQ_RQ_IDLE;
477+}
478+
479+static inline int blk_mq_request_completed(struct request *rq)
480+{
481+ return blk_mq_rq_state(rq) == MQ_RQ_COMPLETE;
482+}
304483
305−int blk_mq_request_started(struct request *rq);
306−int blk_mq_request_completed(struct request *rq);
307484 void blk_mq_start_request(struct request *rq);
308485 void blk_mq_end_request(struct request *rq, blk_status_t error);
309486 void __blk_mq_end_request(struct request *rq, blk_status_t error);
@@ -324,7 +501,7 @@ void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async); · 14 unmodified lines
324501 void blk_mq_quiesce_queue(struct request_queue *q);
325502 void blk_mq_unquiesce_queue(struct request_queue *q);
326503 void blk_mq_delay_run_hw_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs);
327−bool blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
504+void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
328505 void blk_mq_run_hw_queues(struct request_queue *q, bool async);
329506 void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
330507 busy_tag_iter_fn *fn, void *priv);
@@ -343,14 +520,29 @@ void blk_mq_quiesce_queue_nowait(struct request_queue *q); · 12 unmodified lines
343520
344521 unsigned int blk_mq_rq_cpu(struct request *rq);
345522
346−/*
523+/**
524+ * blk_mq_rq_from_pdu - cast a PDU to a request
525+ * @pdu: the PDU (Protocol Data Unit) to be casted
526+ *
527+ * Return: request
528+ *
347529 * Driver command data is immediately after the request. So subtract request
348− * size to get back to the original request, add request size to get the PDU.
530+ * size to get back to the original request.
349531 */
350532 static inline struct request *blk_mq_rq_from_pdu(void *pdu)
351533 {
352534 return pdu - sizeof(struct request);
353535 }
536+
537+/**
538+ * blk_mq_rq_to_pdu - cast a request to a PDU
539+ * @rq: the request to be casted
540+ *
541+ * Return: pointer to the PDU
542+ *
543+ * Driver command data is immediately after the request. So add request to get
544+ * the PDU.
545+ */
354546 static inline void *blk_mq_rq_to_pdu(struct request *rq)
355547 {
356548 return rq + 1;
include/linux/blk_types.h+27−1
@@ -153,10 +153,10 @@ struct bio { · 152 unmodified lines
153153 unsigned short bi_write_hint;
154154 blk_status_t bi_status;
155155 u8 bi_partno;
156+ atomic_t __bi_remaining;
156157
157158 struct bvec_iter bi_iter;
158159
159− atomic_t __bi_remaining;
160160 bio_end_io_t *bi_end_io;
161161
162162 void *bi_private;
@@ -290,6 +290,12 @@ enum req_opf { · 127 unmodified lines
290290 REQ_OP_ZONE_RESET_ALL = 8,
291291 /* write the zero filled sector many times */
292292 REQ_OP_WRITE_ZEROES = 9,
293+ /* Open a zone */
294+ REQ_OP_ZONE_OPEN = 10,
295+ /* Close a zone */
296+ REQ_OP_ZONE_CLOSE = 11,
297+ /* Transition a zone to full */
298+ REQ_OP_ZONE_FINISH = 12,
293299
294300 /* SCSI passthrough using struct scsi_request */
295301 REQ_OP_SCSI_IN = 32,
@@ -371,6 +377,7 @@ enum stat_group { · 75 unmodified lines
371377 STAT_READ,
372378 STAT_WRITE,
373379 STAT_DISCARD,
380+ STAT_FLUSH,
374381
375382 NR_STAT_GROUPS
376383 };
@@ -417,6 +424,25 @@ static inline bool op_is_discard(unsigned int op) · 40 unmodified lines
417424 return (op & REQ_OP_MASK) == REQ_OP_DISCARD;
418425 }
419426
427+/*
428+ * Check if a bio or request operation is a zone management operation, with
429+ * the exception of REQ_OP_ZONE_RESET_ALL which is treated as a special case
430+ * due to its different handling in the block layer and device response in
431+ * case of command failure.
432+ */
433+static inline bool op_is_zone_mgmt(enum req_opf op)
434+{
435+ switch (op & REQ_OP_MASK) {
436+ case REQ_OP_ZONE_RESET:
437+ case REQ_OP_ZONE_OPEN:
438+ case REQ_OP_ZONE_CLOSE:
439+ case REQ_OP_ZONE_FINISH:
440+ return true;
441+ default:
442+ return false;
443+ }
444+}
445+
420446 static inline int op_stat_group(unsigned int op)
421447 {
422448 if (op_is_discard(op))
include/linux/blkdev.h+27−30
@@ -349,34 +349,28 @@ struct queue_limits { · 348 unmodified lines
349349 enum blk_zoned_model zoned;
350350 };
351351
352+typedef int (*report_zones_cb)(struct blk_zone *zone, unsigned int idx,
353+ void *data);
354+
352355 #ifdef CONFIG_BLK_DEV_ZONED
353356
354−/*
355− * Maximum number of zones to report with a single report zones command.
356− */
357−#define BLK_ZONED_REPORT_MAX_ZONES 8192U
358−
359−extern unsigned int blkdev_nr_zones(struct block_device *bdev);
360−extern int blkdev_report_zones(struct block_device *bdev,
361− sector_t sector, struct blk_zone *zones,
362− unsigned int *nr_zones);
363−extern int blkdev_reset_zones(struct block_device *bdev, sector_t sectors,
364− sector_t nr_sectors, gfp_t gfp_mask);
357+#define BLK_ALL_ZONES ((unsigned int)-1)
358+int blkdev_report_zones(struct block_device *bdev, sector_t sector,
359+ unsigned int nr_zones, report_zones_cb cb, void *data);
360+unsigned int blkdev_nr_zones(struct gendisk *disk);
361+extern int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op,
362+ sector_t sectors, sector_t nr_sectors,
363+ gfp_t gfp_mask);
365364 extern int blk_revalidate_disk_zones(struct gendisk *disk);
366365
367366 extern int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,
368367 unsigned int cmd, unsigned long arg);
369−extern int blkdev_reset_zones_ioctl(struct block_device *bdev, fmode_t mode,
370− unsigned int cmd, unsigned long arg);
368+extern int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode,
369+ unsigned int cmd, unsigned long arg);
371370
372371 #else /* CONFIG_BLK_DEV_ZONED */
373372
374−static inline unsigned int blkdev_nr_zones(struct block_device *bdev)
375−{
376− return 0;
377−}
378−
379−static inline int blk_revalidate_disk_zones(struct gendisk *disk)
373+static inline unsigned int blkdev_nr_zones(struct gendisk *disk)
380374 {
381375 return 0;
382376 }
@@ -388,9 +382,9 @@ static inline int blkdev_report_zones_ioctl(struct block_device *bdev, · 5 unmodified lines
388382 return -ENOTTY;
389383 }
390384
391−static inline int blkdev_reset_zones_ioctl(struct block_device *bdev,
392− fmode_t mode, unsigned int cmd,
393− unsigned long arg)
385+static inline int blkdev_zone_mgmt_ioctl(struct block_device *bdev,
386+ fmode_t mode, unsigned int cmd,
387+ unsigned long arg)
394388 {
395389 return -ENOTTY;
396390 }
@@ -411,7 +405,6 @@ struct request_queue { · 14 unmodified lines
411405
412406 /* sw queues */
413407 struct blk_mq_ctx __percpu *queue_ctx;
414− unsigned int nr_queues;
415408
416409 unsigned int queue_depth;
417410
@@ -505,9 +498,9 @@ struct request_queue { · 87 unmodified lines
505498 /*
506499 * Zoned block device information for request dispatch control.
507500 * nr_zones is the total number of zones of the device. This is always
508− * 0 for regular block devices. seq_zones_bitmap is a bitmap of nr_zones
509− * bits which indicates if a zone is conventional (bit clear) or
510− * sequential (bit set). seq_zones_wlock is a bitmap of nr_zones
501+ * 0 for regular block devices. conv_zones_bitmap is a bitmap of nr_zones
502+ * bits which indicates if a zone is conventional (bit set) or
503+ * sequential (bit clear). seq_zones_wlock is a bitmap of nr_zones
511504 * bits which indicates if a zone is write locked, that is, if a write
512505 * request targeting the zone was dispatched. All three fields are
513506 * initialized by the low level device driver (e.g. scsi/sd.c).
@@ -520,7 +513,7 @@ struct request_queue { · 6 unmodified lines
520513 * blk_mq_unfreeze_queue().
521514 */
522515 unsigned int nr_zones;
523− unsigned long *seq_zones_bitmap;
516+ unsigned long *conv_zones_bitmap;
524517 unsigned long *seq_zones_wlock;
525518 #endif /* CONFIG_BLK_DEV_ZONED */
526519
@@ -725,9 +718,11 @@ static inline unsigned int blk_queue_zone_no(struct request_queue *q, · 198 unmodified lines
725718 static inline bool blk_queue_zone_is_seq(struct request_queue *q,
726719 sector_t sector)
727720 {
728− if (!blk_queue_is_zoned(q) || !q->seq_zones_bitmap)
721+ if (!blk_queue_is_zoned(q))
729722 return false;
730− return test_bit(blk_queue_zone_no(q, sector), q->seq_zones_bitmap);
723+ if (!q->conv_zones_bitmap)
724+ return true;
725+ return !test_bit(blk_queue_zone_no(q, sector), q->conv_zones_bitmap);
731726 }
732727 #else /* CONFIG_BLK_DEV_ZONED */
733728 static inline unsigned int blk_queue_nr_zones(struct request_queue *q)
@@ -870,6 +865,8 @@ extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, · 136 unmodified lines
870865 unsigned int, void __user *);
871866 extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t,
872867 struct scsi_ioctl_command __user *);
868+extern int get_sg_io_hdr(struct sg_io_hdr *hdr, const void __user *argp);
869+extern int put_sg_io_hdr(const struct sg_io_hdr *hdr, void __user *argp);
873870
874871 extern int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags);
875872 extern void blk_queue_exit(struct request_queue *q);
@@ -1709,7 +1706,7 @@ struct block_device_operations { · 833 unmodified lines
17091706 /* this callback is with swap_lock and sometimes page table lock held */
17101707 void (*swap_slot_free_notify) (struct block_device *, unsigned long);
17111708 int (*report_zones)(struct gendisk *, sector_t sector,
1712− struct blk_zone *zones, unsigned int *nr_zones);
1709+ unsigned int nr_zones, report_zones_cb cb, void *data);
17131710 struct module *owner;
17141711 const struct pr_ops *pr_ops;
17151712 };
include/linux/bpf-cgroup.h+4−4
@@ -157,8 +157,8 @@ void bpf_cgroup_storage_link(struct bpf_cgroup_storage *storage, · 156 unmodified lines
157157 struct cgroup *cgroup,
158158 enum bpf_attach_type type);
159159 void bpf_cgroup_storage_unlink(struct bpf_cgroup_storage *storage);
160−int bpf_cgroup_storage_assign(struct bpf_prog *prog, struct bpf_map *map);
161−void bpf_cgroup_storage_release(struct bpf_prog *prog, struct bpf_map *map);
160+int bpf_cgroup_storage_assign(struct bpf_prog_aux *aux, struct bpf_map *map);
161+void bpf_cgroup_storage_release(struct bpf_prog_aux *aux, struct bpf_map *map);
162162
163163 int bpf_percpu_cgroup_storage_copy(struct bpf_map *map, void *key, void *value);
164164 int bpf_percpu_cgroup_storage_update(struct bpf_map *map, void *key,
@@ -360,9 +360,9 @@ static inline int cgroup_bpf_prog_query(const union bpf_attr *attr, · 195 unmodified lines
360360
361361 static inline void bpf_cgroup_storage_set(
362362 struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE]) {}
363−static inline int bpf_cgroup_storage_assign(struct bpf_prog *prog,
363+static inline int bpf_cgroup_storage_assign(struct bpf_prog_aux *aux,
364364 struct bpf_map *map) { return 0; }
365−static inline void bpf_cgroup_storage_release(struct bpf_prog *prog,
365+static inline void bpf_cgroup_storage_release(struct bpf_prog_aux *aux,
366366 struct bpf_map *map) {}
367367 static inline struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(
368368 struct bpf_prog *prog, enum bpf_cgroup_storage_type stype) { return NULL; }
include/linux/bpf.h+244−55
@@ -12,17 +12,23 @@ · 11 unmodified lines
1212 #include <linux/err.h>
1313 #include <linux/rbtree_latch.h>
1414 #include <linux/numa.h>
15+#include <linux/mm_types.h>
1516 #include <linux/wait.h>
1617 #include <linux/u64_stats_sync.h>
18+#include <linux/refcount.h>
19+#include <linux/mutex.h>
1720
1821 struct bpf_verifier_env;
22+struct bpf_verifier_log;
1923 struct perf_event;
2024 struct bpf_prog;
25+struct bpf_prog_aux;
2126 struct bpf_map;
2227 struct sock;
2328 struct seq_file;
2429 struct btf;
2530 struct btf_type;
31+struct exception_table_entry;
2632
2733 extern struct idr btf_idr;
2834 extern spinlock_t btf_idr_lock;
@@ -59,11 +65,18 @@ struct bpf_map_ops { · 30 unmodified lines
5965 const struct btf_type *key_type,
6066 const struct btf_type *value_type);
6167
68+ /* Prog poke tracking helpers. */
69+ int (*map_poke_track)(struct bpf_map *map, struct bpf_prog_aux *aux);
70+ void (*map_poke_untrack)(struct bpf_map *map, struct bpf_prog_aux *aux);
71+ void (*map_poke_run)(struct bpf_map *map, u32 key, struct bpf_prog *old,
72+ struct bpf_prog *new);
73+
6274 /* Direct value access helpers. */
6375 int (*map_direct_value_addr)(const struct bpf_map *map,
6476 u64 *imm, u32 off);
6577 int (*map_direct_value_meta)(const struct bpf_map *map,
6678 u64 imm, u32 *off);
79+ int (*map_mmap)(struct bpf_map *map, struct vm_area_struct *vma);
6780 };
6881
6982 struct bpf_map_memory {
@@ -92,17 +105,19 @@ struct bpf_map { · 22 unmodified lines
92105 u32 btf_value_type_id;
93106 struct btf *btf;
94107 struct bpf_map_memory memory;
108+ char name[BPF_OBJ_NAME_LEN];
95109 bool unpriv_array;
96− bool frozen; /* write-once */
97− /* 48 bytes hole */
110+ bool frozen; /* write-once; write-protected by freeze_mutex */
111+ /* 22 bytes hole */
98112
99113 /* The 3rd and 4th cacheline with misc members to avoid false sharing
100114 * particularly with refcounting.
101115 */
102− atomic_t refcnt ____cacheline_aligned;
103− atomic_t usercnt;
116+ atomic64_t refcnt ____cacheline_aligned;
117+ atomic64_t usercnt;
104118 struct work_struct work;
105− char name[BPF_OBJ_NAME_LEN];
119+ struct mutex freeze_mutex;
120+ u64 writecnt; /* writable mmap cnt; protected by freeze_mutex */
106121 };
107122
108123 static inline bool map_value_has_spin_lock(const struct bpf_map *map)
@@ -211,6 +226,7 @@ enum bpf_arg_type { · 102 unmodified lines
211226 ARG_PTR_TO_INT, /* pointer to int */
212227 ARG_PTR_TO_LONG, /* pointer to long */
213228 ARG_PTR_TO_SOCKET, /* pointer to bpf_sock (fullsock) */
229+ ARG_PTR_TO_BTF_ID, /* pointer to in-kernel struct */
214230 };
215231
216232 /* type of values returned from helper functions */
@@ -233,11 +249,17 @@ struct bpf_func_proto { · 16 unmodified lines
233249 bool gpl_only;
234250 bool pkt_access;
235251 enum bpf_return_type ret_type;
236− enum bpf_arg_type arg1_type;
237− enum bpf_arg_type arg2_type;
238− enum bpf_arg_type arg3_type;
239− enum bpf_arg_type arg4_type;
240− enum bpf_arg_type arg5_type;
252+ union {
253+ struct {
254+ enum bpf_arg_type arg1_type;
255+ enum bpf_arg_type arg2_type;
256+ enum bpf_arg_type arg3_type;
257+ enum bpf_arg_type arg4_type;
258+ enum bpf_arg_type arg5_type;
259+ };
260+ enum bpf_arg_type arg_type[5];
261+ };
262+ int *btf_id; /* BTF ids of arguments */
241263 };
242264
243265 /* bpf_context is intentionally undefined structure. Pointer to bpf_context is
@@ -281,6 +303,7 @@ enum bpf_reg_type { · 37 unmodified lines
281303 PTR_TO_TCP_SOCK_OR_NULL, /* reg points to struct tcp_sock or NULL */
282304 PTR_TO_TP_BUFFER, /* reg points to a writable raw tp's buffer */
283305 PTR_TO_XDP_SOCK, /* reg points to struct xdp_sock */
306+ PTR_TO_BTF_ID, /* reg points to kernel struct */
284307 };
285308
286309 /* The information passed from prog-specific *_is_valid_access
@@ -288,7 +311,11 @@ enum bpf_reg_type { · 1 unmodified line
288311 */
289312 struct bpf_insn_access_aux {
290313 enum bpf_reg_type reg_type;
291− int ctx_field_size;
314+ union {
315+ int ctx_field_size;
316+ u32 btf_id;
317+ };
318+ struct bpf_verifier_log *log; /* for verbose logs */
292319 };
293320
294321 static inline void
@@ -359,14 +386,136 @@ enum bpf_cgroup_storage_type { · 64 unmodified lines
359386
360387 #define MAX_BPF_CGROUP_STORAGE_TYPE __BPF_CGROUP_STORAGE_MAX
361388
389+/* The longest tracepoint has 12 args.
390+ * See include/trace/bpf_probe.h
391+ */
392+#define MAX_BPF_FUNC_ARGS 12
393+
362394 struct bpf_prog_stats {
363395 u64 cnt;
364396 u64 nsecs;
365397 struct u64_stats_sync syncp;
398+} __aligned(2 * sizeof(u64));
399+
400+struct btf_func_model {
401+ u8 ret_size;
402+ u8 nr_args;
403+ u8 arg_size[MAX_BPF_FUNC_ARGS];
404+};
405+
406+/* Restore arguments before returning from trampoline to let original function
407+ * continue executing. This flag is used for fentry progs when there are no
408+ * fexit progs.
409+ */
410+#define BPF_TRAMP_F_RESTORE_REGS BIT(0)
411+/* Call original function after fentry progs, but before fexit progs.
412+ * Makes sense for fentry/fexit, normal calls and indirect calls.
413+ */
414+#define BPF_TRAMP_F_CALL_ORIG BIT(1)
415+/* Skip current frame and return to parent. Makes sense for fentry/fexit
416+ * programs only. Should not be used with normal calls and indirect calls.
417+ */
418+#define BPF_TRAMP_F_SKIP_FRAME BIT(2)
419+
420+/* Different use cases for BPF trampoline:
421+ * 1. replace nop at the function entry (kprobe equivalent)
422+ * flags = BPF_TRAMP_F_RESTORE_REGS
423+ * fentry = a set of programs to run before returning from trampoline
424+ *
425+ * 2. replace nop at the function entry (kprobe + kretprobe equivalent)
426+ * flags = BPF_TRAMP_F_CALL_ORIG | BPF_TRAMP_F_SKIP_FRAME
427+ * orig_call = fentry_ip + MCOUNT_INSN_SIZE
428+ * fentry = a set of program to run before calling original function
429+ * fexit = a set of program to run after original function
430+ *
431+ * 3. replace direct call instruction anywhere in the function body
432+ * or assign a function pointer for indirect call (like tcp_congestion_ops->cong_avoid)
433+ * With flags = 0
434+ * fentry = a set of programs to run before returning from trampoline
435+ * With flags = BPF_TRAMP_F_CALL_ORIG
436+ * orig_call = original callback addr or direct function addr
437+ * fentry = a set of program to run before calling original function
438+ * fexit = a set of program to run after original function
439+ */
440+int arch_prepare_bpf_trampoline(void *image, struct btf_func_model *m, u32 flags,
441+ struct bpf_prog **fentry_progs, int fentry_cnt,
442+ struct bpf_prog **fexit_progs, int fexit_cnt,
443+ void *orig_call);
444+/* these two functions are called from generated trampoline */
445+u64 notrace __bpf_prog_enter(void);
446+void notrace __bpf_prog_exit(struct bpf_prog *prog, u64 start);
447+
448+enum bpf_tramp_prog_type {
449+ BPF_TRAMP_FENTRY,
450+ BPF_TRAMP_FEXIT,
451+ BPF_TRAMP_MAX
452+};
453+
454+struct bpf_trampoline {
455+ /* hlist for trampoline_table */
456+ struct hlist_node hlist;
457+ /* serializes access to fields of this trampoline */
458+ struct mutex mutex;
459+ refcount_t refcnt;
460+ u64 key;
461+ struct {
462+ struct btf_func_model model;
463+ void *addr;
464+ bool ftrace_managed;
465+ } func;
466+ /* list of BPF programs using this trampoline */
467+ struct hlist_head progs_hlist[BPF_TRAMP_MAX];
468+ /* Number of attached programs. A counter per kind. */
469+ int progs_cnt[BPF_TRAMP_MAX];
470+ /* Executable image of trampoline */
471+ void *image;
472+ u64 selector;
473+};
474+#ifdef CONFIG_BPF_JIT
475+struct bpf_trampoline *bpf_trampoline_lookup(u64 key);
476+int bpf_trampoline_link_prog(struct bpf_prog *prog);
477+int bpf_trampoline_unlink_prog(struct bpf_prog *prog);
478+void bpf_trampoline_put(struct bpf_trampoline *tr);
479+#else
480+static inline struct bpf_trampoline *bpf_trampoline_lookup(u64 key)
481+{
482+ return NULL;
483+}
484+static inline int bpf_trampoline_link_prog(struct bpf_prog *prog)
485+{
486+ return -ENOTSUPP;
487+}
488+static inline int bpf_trampoline_unlink_prog(struct bpf_prog *prog)
489+{
490+ return -ENOTSUPP;
491+}
492+static inline void bpf_trampoline_put(struct bpf_trampoline *tr) {}
493+#endif
494+
495+struct bpf_func_info_aux {
496+ bool unreliable;
497+};
498+
499+enum bpf_jit_poke_reason {
500+ BPF_POKE_REASON_TAIL_CALL,
501+};
502+
503+/* Descriptor of pokes pointing /into/ the JITed image. */
504+struct bpf_jit_poke_descriptor {
505+ void *ip;
506+ union {
507+ struct {
508+ struct bpf_map *map;
509+ u32 key;
510+ } tail_call;
511+ };
512+ bool ip_stable;
513+ u8 adj_off;
514+ u16 reason;
366515 };
367516
368517 struct bpf_prog_aux {
369− atomic_t refcnt;
518+ atomic64_t refcnt;
370519 u32 used_map_cnt;
371520 u32 max_ctx_offset;
372521 u32 max_pkt_offset;
@@ -375,10 +524,23 @@ struct bpf_prog_aux { · 2 unmodified lines
375524 u32 id;
376525 u32 func_cnt; /* used by non-func prog as the number of func progs */
377526 u32 func_idx; /* 0 for non-func prog, the index in func array for func prog */
527+ u32 attach_btf_id; /* in-kernel BTF type id to attach to */
528+ struct bpf_prog *linked_prog;
378529 bool verifier_zext; /* Zero extensions has been inserted by verifier. */
379530 bool offload_requested;
531+ bool attach_btf_trace; /* true if attaching to BTF-enabled raw tp */
532+ bool func_proto_unreliable;
533+ enum bpf_tramp_prog_type trampoline_prog_type;
534+ struct bpf_trampoline *trampoline;
535+ struct hlist_node tramp_hlist;
536+ /* BTF_KIND_FUNC_PROTO for valid attach_btf_id */
537+ const struct btf_type *attach_func_proto;
538+ /* function name for valid attach_btf_id */
539+ const char *attach_func_name;
380540 struct bpf_prog **func;
381541 void *jit_data; /* JIT specific data. arch dependent */
542+ struct bpf_jit_poke_descriptor *poke_tab;
543+ u32 size_poke_tab;
382544 struct latch_tree_node ksym_tnode;
383545 struct list_head ksym_lnode;
384546 const struct bpf_prog_ops *ops;
@@ -394,6 +556,7 @@ struct bpf_prog_aux { · 9 unmodified lines
394556 struct bpf_prog_offload *offload;
395557 struct btf *btf;
396558 struct bpf_func_info *func_info;
559+ struct bpf_func_info_aux *func_info_aux;
397560 /* bpf_line_info loaded from userspace. linfo->insn_off
398561 * has the xlated insn offset.
399562 * Both the main and sub prog share the same linfo.
@@ -416,6 +579,8 @@ struct bpf_prog_aux { · 16 unmodified lines
416579 * main prog always has linfo_idx == 0
417580 */
418581 u32 linfo_idx;
582+ u32 num_exentries;
583+ struct exception_table_entry *extable;
419584 struct bpf_prog_stats __percpu *stats;
420585 union {
421586 struct work_struct work;
@@ -423,17 +588,26 @@ struct bpf_prog_aux { · 1 unmodified line
423588 };
424589 };
425590
591+struct bpf_array_aux {
592+ /* 'Ownership' of prog array is claimed by the first program that
593+ * is going to use this map or by the first program which FD is
594+ * stored in the map to make sure that all callers and callees have
595+ * the same prog type and JITed flag.
596+ */
597+ enum bpf_prog_type type;
598+ bool jited;
599+ /* Programs with direct jumps into programs part of this array. */
600+ struct list_head poke_progs;
601+ struct bpf_map *map;
602+ struct mutex poke_mutex;
603+ struct work_struct work;
604+};
605+
426606 struct bpf_array {
427607 struct bpf_map map;
428608 u32 elem_size;
429609 u32 index_mask;
430− /* 'ownership' of prog_array is claimed by the first program that
431− * is going to use this map or by the first program which FD is stored
432− * in the map to make sure that all callers and callees have the same
433− * prog_type and JITed flag
434− */
435− enum bpf_prog_type owner_prog_type;
436− bool owner_jited;
610+ struct bpf_array_aux *aux;
437611 union {
438612 char value[0] __aligned(8);
439613 void *ptrs[0] __aligned(8);
@@ -482,6 +656,7 @@ struct bpf_event_entry { · 42 unmodified lines
482656
483657 bool bpf_prog_array_compatible(struct bpf_array *array, const struct bpf_prog *fp);
484658 int bpf_prog_calc_tag(struct bpf_prog *fp);
659+const char *kernel_type_name(u32 btf_type_id);
485660
486661 const struct bpf_func_proto *bpf_get_trace_printk_proto(void);
487662
@@ -620,7 +795,7 @@ DECLARE_PER_CPU(int, bpf_prog_active); · 132 unmodified lines
620795 extern const struct file_operations bpf_map_fops;
621796 extern const struct file_operations bpf_prog_fops;
622797
623−#define BPF_PROG_TYPE(_id, _name) \
798+#define BPF_PROG_TYPE(_id, _name, prog_ctx_type, kern_ctx_type) \
624799 extern const struct bpf_prog_ops _name ## _prog_ops; \
625800 extern const struct bpf_verifier_ops _name ## _verifier_ops;
626801 #define BPF_MAP_TYPE(_id, _ops) \
@@ -636,22 +811,24 @@ extern const struct bpf_verifier_ops xdp_analyzer_ops; · 9 unmodified lines
636811 struct bpf_prog *bpf_prog_get(u32 ufd);
637812 struct bpf_prog *bpf_prog_get_type_dev(u32 ufd, enum bpf_prog_type type,
638813 bool attach_drv);
639−struct bpf_prog * __must_check bpf_prog_add(struct bpf_prog *prog, int i);
814+void bpf_prog_add(struct bpf_prog *prog, int i);
640815 void bpf_prog_sub(struct bpf_prog *prog, int i);
641−struct bpf_prog * __must_check bpf_prog_inc(struct bpf_prog *prog);
816+void bpf_prog_inc(struct bpf_prog *prog);
642817 struct bpf_prog * __must_check bpf_prog_inc_not_zero(struct bpf_prog *prog);
643818 void bpf_prog_put(struct bpf_prog *prog);
644819 int __bpf_prog_charge(struct user_struct *user, u32 pages);
645820 void __bpf_prog_uncharge(struct user_struct *user, u32 pages);
821+void __bpf_free_used_maps(struct bpf_prog_aux *aux,
822+ struct bpf_map **used_maps, u32 len);
646823
647824 void bpf_prog_free_id(struct bpf_prog *prog, bool do_idr_lock);
648825 void bpf_map_free_id(struct bpf_map *map, bool do_idr_lock);
649826
650827 struct bpf_map *bpf_map_get_with_uref(u32 ufd);
651828 struct bpf_map *__bpf_map_get(struct fd f);
652−struct bpf_map * __must_check bpf_map_inc(struct bpf_map *map, bool uref);
653−struct bpf_map * __must_check bpf_map_inc_not_zero(struct bpf_map *map,
654− bool uref);
829+void bpf_map_inc(struct bpf_map *map);
830+void bpf_map_inc_with_uref(struct bpf_map *map);
831+struct bpf_map * __must_check bpf_map_inc_not_zero(struct bpf_map *map);
655832 void bpf_map_put_with_uref(struct bpf_map *map);
656833 void bpf_map_put(struct bpf_map *map);
657834 int bpf_map_charge_memlock(struct bpf_map *map, u32 pages);
@@ -661,6 +838,7 @@ void bpf_map_charge_finish(struct bpf_map_memory *mem); · 3 unmodified lines
661838 void bpf_map_charge_move(struct bpf_map_memory *dst,
662839 struct bpf_map_memory *src);
663840 void *bpf_map_area_alloc(u64 size, int numa_node);
841+void *bpf_map_area_mmapable_alloc(u64 size, int numa_node);
664842 void bpf_map_area_free(void *base);
665843 void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr);
666844
@@ -747,6 +925,24 @@ int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr, · 80 unmodified lines
747925 int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,
748926 const union bpf_attr *kattr,
749927 union bpf_attr __user *uattr);
928+bool btf_ctx_access(int off, int size, enum bpf_access_type type,
929+ const struct bpf_prog *prog,
930+ struct bpf_insn_access_aux *info);
931+int btf_struct_access(struct bpf_verifier_log *log,
932+ const struct btf_type *t, int off, int size,
933+ enum bpf_access_type atype,
934+ u32 *next_btf_id);
935+int btf_resolve_helper_id(struct bpf_verifier_log *log,
936+ const struct bpf_func_proto *fn, int);
937+
938+int btf_distill_func_proto(struct bpf_verifier_log *log,
939+ struct btf *btf,
940+ const struct btf_type *func_proto,
941+ const char *func_name,
942+ struct btf_func_model *m);
943+
944+int btf_check_func_arg_match(struct bpf_verifier_env *env, int subprog);
945+
750946 #else /* !CONFIG_BPF_SYSCALL */
751947 static inline struct bpf_prog *bpf_prog_get(u32 ufd)
752948 {
@@ -760,10 +956,8 @@ static inline struct bpf_prog *bpf_prog_get_type_dev(u32 ufd, · 7 unmodified lines
760956 return ERR_PTR(-EOPNOTSUPP);
761957 }
762958
763−static inline struct bpf_prog * __must_check bpf_prog_add(struct bpf_prog *prog,
764− int i)
959+static inline void bpf_prog_add(struct bpf_prog *prog, int i)
765960 {
766− return ERR_PTR(-EOPNOTSUPP);
767961 }
768962
769963 static inline void bpf_prog_sub(struct bpf_prog *prog, int i)
@@ -774,9 +968,8 @@ static inline void bpf_prog_put(struct bpf_prog *prog) · 4 unmodified lines
774968 {
775969 }
776970
777−static inline struct bpf_prog * __must_check bpf_prog_inc(struct bpf_prog *prog)
971+static inline void bpf_prog_inc(struct bpf_prog *prog)
778972 {
779− return ERR_PTR(-EOPNOTSUPP);
780973 }
781974
782975 static inline struct bpf_prog *__must_check
@@ -877,6 +1070,10 @@ static inline int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog, · 94 unmodified lines
8771070 {
8781071 return -ENOTSUPP;
8791072 }
1073+
1074+static inline void bpf_map_put(struct bpf_map *map)
1075+{
1076+}
8801077 #endif /* CONFIG_BPF_SYSCALL */
8811078
8821079 static inline struct bpf_prog *bpf_prog_get_type(u32 ufd,
@@ -972,31 +1169,6 @@ static inline int sock_map_get_from_fd(const union bpf_attr *attr, · 89 unmodified lines
9721169 }
9731170 #endif
9741171
975−#if defined(CONFIG_XDP_SOCKETS)
976−struct xdp_sock;
977−struct xdp_sock *__xsk_map_lookup_elem(struct bpf_map *map, u32 key);
978−int __xsk_map_redirect(struct bpf_map *map, struct xdp_buff *xdp,
979− struct xdp_sock *xs);
980−void __xsk_map_flush(struct bpf_map *map);
981−#else
982−struct xdp_sock;
983−static inline struct xdp_sock *__xsk_map_lookup_elem(struct bpf_map *map,
984− u32 key)
985−{
986− return NULL;
987−}
988−
989−static inline int __xsk_map_redirect(struct bpf_map *map, struct xdp_buff *xdp,
990− struct xdp_sock *xs)
991−{
992− return -EOPNOTSUPP;
993−}
994−
995−static inline void __xsk_map_flush(struct bpf_map *map)
996−{
997−}
998−#endif
999−
10001172 #if defined(CONFIG_INET) && defined(CONFIG_BPF_SYSCALL)
10011173 void bpf_sk_reuseport_detach(struct sock *sk);
10021174 int bpf_fd_reuseport_array_lookup_elem(struct bpf_map *map, void *key,
@@ -1095,6 +1267,15 @@ static inline u32 bpf_sock_convert_ctx_access(enum bpf_access_type type, · 92 unmodified lines
10951267 #endif
10961268
10971269 #ifdef CONFIG_INET
1270+struct sk_reuseport_kern {
1271+ struct sk_buff *skb;
1272+ struct sock *sk;
1273+ struct sock *selected_sk;
1274+ void *data_end;
1275+ u32 hash;
1276+ u32 reuseport_id;
1277+ bool bind_inany;
1278+};
10981279 bool bpf_tcp_sock_is_valid_access(int off, int size, enum bpf_access_type type,
10991280 struct bpf_insn_access_aux *info);
11001281
@@ -1145,4 +1326,12 @@ static inline u32 bpf_xdp_sock_convert_ctx_access(enum bpf_access_type type, · 44 unmodified lines
11451326 }
11461327 #endif /* CONFIG_INET */
11471328
1329+enum bpf_text_poke_type {
1330+ BPF_MOD_CALL,
1331+ BPF_MOD_JUMP,
1332+};
1333+
1334+int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
1335+ void *addr1, void *addr2);
1336+
11481337 #endif /* _LINUX_BPF_H */
include/linux/bpf_types.h+52−25
@@ -2,41 +2,68 @@ · 1 unmodified line
22 /* internal file - do not include directly */
33
44 #ifdef CONFIG_NET
5−BPF_PROG_TYPE(BPF_PROG_TYPE_SOCKET_FILTER, sk_filter)
6−BPF_PROG_TYPE(BPF_PROG_TYPE_SCHED_CLS, tc_cls_act)
7−BPF_PROG_TYPE(BPF_PROG_TYPE_SCHED_ACT, tc_cls_act)
8−BPF_PROG_TYPE(BPF_PROG_TYPE_XDP, xdp)
5+BPF_PROG_TYPE(BPF_PROG_TYPE_SOCKET_FILTER, sk_filter,
6+ struct __sk_buff, struct sk_buff)
7+BPF_PROG_TYPE(BPF_PROG_TYPE_SCHED_CLS, tc_cls_act,
8+ struct __sk_buff, struct sk_buff)
9+BPF_PROG_TYPE(BPF_PROG_TYPE_SCHED_ACT, tc_cls_act,
10+ struct __sk_buff, struct sk_buff)
11+BPF_PROG_TYPE(BPF_PROG_TYPE_XDP, xdp,
12+ struct xdp_md, struct xdp_buff)
913 #ifdef CONFIG_CGROUP_BPF
10−BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SKB, cg_skb)
11−BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCK, cg_sock)
12−BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCK_ADDR, cg_sock_addr)
14+BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SKB, cg_skb,
15+ struct __sk_buff, struct sk_buff)
16+BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCK, cg_sock,
17+ struct bpf_sock, struct sock)
18+BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCK_ADDR, cg_sock_addr,
19+ struct bpf_sock_addr, struct bpf_sock_addr_kern)
1320 #endif
14−BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_IN, lwt_in)
15−BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_OUT, lwt_out)
16−BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_XMIT, lwt_xmit)
17−BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_SEG6LOCAL, lwt_seg6local)
18−BPF_PROG_TYPE(BPF_PROG_TYPE_SOCK_OPS, sock_ops)
19−BPF_PROG_TYPE(BPF_PROG_TYPE_SK_SKB, sk_skb)
20−BPF_PROG_TYPE(BPF_PROG_TYPE_SK_MSG, sk_msg)
21−BPF_PROG_TYPE(BPF_PROG_TYPE_FLOW_DISSECTOR, flow_dissector)
21+BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_IN, lwt_in,
22+ struct __sk_buff, struct sk_buff)
23+BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_OUT, lwt_out,
24+ struct __sk_buff, struct sk_buff)
25+BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_XMIT, lwt_xmit,
26+ struct __sk_buff, struct sk_buff)
27+BPF_PROG_TYPE(BPF_PROG_TYPE_LWT_SEG6LOCAL, lwt_seg6local,
28+ struct __sk_buff, struct sk_buff)
29+BPF_PROG_TYPE(BPF_PROG_TYPE_SOCK_OPS, sock_ops,
30+ struct bpf_sock_ops, struct bpf_sock_ops_kern)
31+BPF_PROG_TYPE(BPF_PROG_TYPE_SK_SKB, sk_skb,
32+ struct __sk_buff, struct sk_buff)
33+BPF_PROG_TYPE(BPF_PROG_TYPE_SK_MSG, sk_msg,
34+ struct sk_msg_md, struct sk_msg)
35+BPF_PROG_TYPE(BPF_PROG_TYPE_FLOW_DISSECTOR, flow_dissector,
36+ struct __sk_buff, struct bpf_flow_dissector)
2237 #endif
2338 #ifdef CONFIG_BPF_EVENTS
24−BPF_PROG_TYPE(BPF_PROG_TYPE_KPROBE, kprobe)
25−BPF_PROG_TYPE(BPF_PROG_TYPE_TRACEPOINT, tracepoint)
26−BPF_PROG_TYPE(BPF_PROG_TYPE_PERF_EVENT, perf_event)
27−BPF_PROG_TYPE(BPF_PROG_TYPE_RAW_TRACEPOINT, raw_tracepoint)
28−BPF_PROG_TYPE(BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, raw_tracepoint_writable)
39+BPF_PROG_TYPE(BPF_PROG_TYPE_KPROBE, kprobe,
40+ bpf_user_pt_regs_t, struct pt_regs)
41+BPF_PROG_TYPE(BPF_PROG_TYPE_TRACEPOINT, tracepoint,
42+ __u64, u64)
43+BPF_PROG_TYPE(BPF_PROG_TYPE_PERF_EVENT, perf_event,
44+ struct bpf_perf_event_data, struct bpf_perf_event_data_kern)
45+BPF_PROG_TYPE(BPF_PROG_TYPE_RAW_TRACEPOINT, raw_tracepoint,
46+ struct bpf_raw_tracepoint_args, u64)
47+BPF_PROG_TYPE(BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, raw_tracepoint_writable,
48+ struct bpf_raw_tracepoint_args, u64)
49+BPF_PROG_TYPE(BPF_PROG_TYPE_TRACING, tracing,
50+ void *, void *)
2951 #endif
3052 #ifdef CONFIG_CGROUP_BPF
31−BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_DEVICE, cg_dev)
32−BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SYSCTL, cg_sysctl)
33−BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCKOPT, cg_sockopt)
53+BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_DEVICE, cg_dev,
54+ struct bpf_cgroup_dev_ctx, struct bpf_cgroup_dev_ctx)
55+BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SYSCTL, cg_sysctl,
56+ struct bpf_sysctl, struct bpf_sysctl_kern)
57+BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SOCKOPT, cg_sockopt,
58+ struct bpf_sockopt, struct bpf_sockopt_kern)
3459 #endif
3560 #ifdef CONFIG_BPF_LIRC_MODE2
36−BPF_PROG_TYPE(BPF_PROG_TYPE_LIRC_MODE2, lirc_mode2)
61+BPF_PROG_TYPE(BPF_PROG_TYPE_LIRC_MODE2, lirc_mode2,
62+ __u32, u32)
3763 #endif
3864 #ifdef CONFIG_INET
39−BPF_PROG_TYPE(BPF_PROG_TYPE_SK_REUSEPORT, sk_reuseport)
65+BPF_PROG_TYPE(BPF_PROG_TYPE_SK_REUSEPORT, sk_reuseport,
66+ struct sk_reuseport_md, struct sk_reuseport_kern)
4067 #endif
4168
4269 BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY, array_map_ops)
include/linux/bpf_verifier.h+10−2
@@ -52,6 +52,8 @@ struct bpf_reg_state { · 51 unmodified lines
5252 */
5353 struct bpf_map *map_ptr;
5454
55+ u32 btf_id; /* for PTR_TO_BTF_ID */
56+
5557 /* Max size from any of the above. */
5658 unsigned long raw;
5759 };
@@ -291,7 +293,7 @@ struct bpf_verifier_state_list { · 233 unmodified lines
291293 struct bpf_insn_aux_data {
292294 union {
293295 enum bpf_reg_type ptr_type; /* pointer type for load/store insns */
294− unsigned long map_state; /* pointer/poison value for maps */
296+ unsigned long map_ptr_state; /* pointer/poison value for maps */
295297 s32 call_imm; /* saved imm field of call insn */
296298 u32 alu_limit; /* limit for add/sub register with pointer */
297299 struct {
@@ -299,6 +301,7 @@ struct bpf_insn_aux_data { · 1 unmodified line
299301 u32 map_off; /* offset from value base address */
300302 };
301303 };
304+ u64 map_key_state; /* constant (32 bit) key tracking for maps */
302305 int ctx_field_size; /* the ctx field size for load insn, maybe 0 */
303306 int sanitize_stack_off; /* stack slot to be cleared */
304307 bool seen; /* this insn was processed by the verifier */
@@ -330,15 +333,18 @@ static inline bool bpf_verifier_log_full(const struct bpf_verifier_log *log) · 25 unmodified lines
330333 #define BPF_LOG_STATS 4
331334 #define BPF_LOG_LEVEL (BPF_LOG_LEVEL1 | BPF_LOG_LEVEL2)
332335 #define BPF_LOG_MASK (BPF_LOG_LEVEL | BPF_LOG_STATS)
336+#define BPF_LOG_KERNEL (BPF_LOG_MASK + 1) /* kernel internal flag */
333337
334338 static inline bool bpf_verifier_log_needed(const struct bpf_verifier_log *log)
335339 {
336− return log->level && log->ubuf && !bpf_verifier_log_full(log);
340+ return (log->level && log->ubuf && !bpf_verifier_log_full(log)) ||
341+ log->level == BPF_LOG_KERNEL;
337342 }
338343
339344 #define BPF_MAX_SUBPROGS 256
340345
341346 struct bpf_subprog_info {
347+ /* 'start' has to be the first field otherwise find_subprog() won't work */
342348 u32 start; /* insn idx of function entry point */
343349 u32 linfo_idx; /* The idx to the main_prog->aux->linfo */
344350 u16 stack_depth; /* max. stack depth used by this function */
@@ -397,6 +403,8 @@ __printf(2, 0) void bpf_verifier_vlog(struct bpf_verifier_log *log, · 52 unmodified lines
397403 const char *fmt, va_list args);
398404 __printf(2, 3) void bpf_verifier_log_write(struct bpf_verifier_env *env,
399405 const char *fmt, ...);
406+__printf(2, 3) void bpf_log(struct bpf_verifier_log *log,
407+ const char *fmt, ...);
400408
401409 static inline struct bpf_func_state *cur_func(struct bpf_verifier_env *env)
402410 {
include/linux/brcmphy.h+8−2
@@ -200,9 +200,15 @@ · 199 unmodified lines
200200 #define BCM5482_SHD_SSD 0x14 /* 10100: Secondary SerDes control */
201201 #define BCM5482_SHD_SSD_LEDM 0x0008 /* SSD LED Mode enable */
202202 #define BCM5482_SHD_SSD_EN 0x0001 /* SSD enable */
203−#define BCM5482_SHD_MODE 0x1f /* 11111: Mode Control Register */
204−#define BCM5482_SHD_MODE_1000BX 0x0001 /* Enable 1000BASE-X registers */
205203
204+/* 10011: SerDes 100-FX Control Register */
205+#define BCM54616S_SHD_100FX_CTRL 0x13
206+#define BCM54616S_100FX_MODE BIT(0) /* 100-FX SerDes Enable */
207+
208+/* 11111: Mode Control Register */
209+#define BCM54XX_SHD_MODE 0x1f
210+#define BCM54XX_SHD_INTF_SEL_MASK GENMASK(2, 1) /* INTERF_SEL[1:0] */
211+#define BCM54XX_SHD_MODE_1000BX BIT(0) /* Enable 1000-X registers */
206212
207213 /*
208214 * EXPANSION SHADOW ACCESS REGISTERS. (PHY REG 0x15, 0x16, and 0x17)
include/linux/bsearch.h+1−1
@@ -5,6 +5,6 @@ · 4 unmodified lines
55 #include <linux/types.h>
66
77 void *bsearch(const void *key, const void *base, size_t num, size_t size,
8− int (*cmp)(const void *key, const void *elt));
8+ cmp_func_t cmp);
99
1010 #endif /* _LINUX_BSEARCH_H */
include/linux/btf.h+33−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 #define _LINUX_BTF_H 1
66
77 #include <linux/types.h>
8+#include <uapi/linux/btf.h>
89
910 struct btf;
1011 struct btf_member;
@@ -53,9 +54,41 @@ bool btf_member_is_reg_int(const struct btf *btf, const struct btf_type *s, · 42 unmodified lines
5354 int btf_find_spin_lock(const struct btf *btf, const struct btf_type *t);
5455 bool btf_type_is_void(const struct btf_type *t);
5556
57+static inline bool btf_type_is_ptr(const struct btf_type *t)
58+{
59+ return BTF_INFO_KIND(t->info) == BTF_KIND_PTR;
60+}
61+
62+static inline bool btf_type_is_int(const struct btf_type *t)
63+{
64+ return BTF_INFO_KIND(t->info) == BTF_KIND_INT;
65+}
66+
67+static inline bool btf_type_is_enum(const struct btf_type *t)
68+{
69+ return BTF_INFO_KIND(t->info) == BTF_KIND_ENUM;
70+}
71+
72+static inline bool btf_type_is_typedef(const struct btf_type *t)
73+{
74+ return BTF_INFO_KIND(t->info) == BTF_KIND_TYPEDEF;
75+}
76+
77+static inline bool btf_type_is_func(const struct btf_type *t)
78+{
79+ return BTF_INFO_KIND(t->info) == BTF_KIND_FUNC;
80+}
81+
82+static inline bool btf_type_is_func_proto(const struct btf_type *t)
83+{
84+ return BTF_INFO_KIND(t->info) == BTF_KIND_FUNC_PROTO;
85+}
86+
5687 #ifdef CONFIG_BPF_SYSCALL
5788 const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id);
5889 const char *btf_name_by_offset(const struct btf *btf, u32 offset);
90+struct btf *btf_parse_vmlinux(void);
91+struct btf *bpf_prog_get_target_btf(const struct bpf_prog *prog);
5992 #else
6093 static inline const struct btf_type *btf_type_by_id(const struct btf *btf,
6194 u32 type_id)
include/linux/build_bug.h+2−2
@@ -9,11 +9,11 @@ · 8 unmodified lines
99 #else /* __CHECKER__ */
1010 /*
1111 * Force a compilation error if condition is true, but also produce a
12− * result (of value 0 and type size_t), so the expression can be used
12+ * result (of value 0 and type int), so the expression can be used
1313 * e.g. in a structure initializer (or where-ever else comma expressions
1414 * aren't permitted).
1515 */
16−#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); }))
16+#define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
1717 #endif /* __CHECKER__ */
1818
1919 /* Force a compilation error if a constant expression is not a power of 2 */
include/linux/bvec.h+10−12
@@ -87,26 +87,24 @@ struct bvec_iter_all { · 86 unmodified lines
8787 static inline bool bvec_iter_advance(const struct bio_vec *bv,
8888 struct bvec_iter *iter, unsigned bytes)
8989 {
90+ unsigned int idx = iter->bi_idx;
91+
9092 if (WARN_ONCE(bytes > iter->bi_size,
9193 "Attempted to advance past end of bvec iter\n")) {
9294 iter->bi_size = 0;
9395 return false;
9496 }
9597
96− while (bytes) {
97− const struct bio_vec *cur = bv + iter->bi_idx;
98− unsigned len = min3(bytes, iter->bi_size,
99− cur->bv_len - iter->bi_bvec_done);
100−
101− bytes -= len;
102− iter->bi_size -= len;
103− iter->bi_bvec_done += len;
98+ iter->bi_size -= bytes;
99+ bytes += iter->bi_bvec_done;
104100
105− if (iter->bi_bvec_done == cur->bv_len) {
106− iter->bi_bvec_done = 0;
107− iter->bi_idx++;
108− }
101+ while (bytes && bytes >= bv[idx].bv_len) {
102+ bytes -= bv[idx].bv_len;
103+ idx++;
109104 }
105+
106+ iter->bi_idx = idx;
107+ iter->bi_bvec_done = bytes;
110108 return true;
111109 }
112110
include/linux/can/platform/mcp251x.h+0−22
@@ -1,22 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef _CAN_PLATFORM_MCP251X_H
3−#define _CAN_PLATFORM_MCP251X_H
4−
5−/*
6− *
7− * CAN bus driver for Microchip 251x CAN Controller with SPI Interface
8− *
9− */
10−
11−#include <linux/spi/spi.h>
12−
13−/*
14− * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data
15− * @oscillator_frequency: - oscillator frequency in Hz
16− */
17−
18−struct mcp251x_platform_data {
19− unsigned long oscillator_frequency;
20−};
21−
22−#endif /* !_CAN_PLATFORM_MCP251X_H */
include/linux/can/rx-offload.h+3−4
@@ -15,9 +15,9 @@ · 14 unmodified lines
1515 struct can_rx_offload {
1616 struct net_device *dev;
1717
18− unsigned int (*mailbox_read)(struct can_rx_offload *offload,
19− struct can_frame *cf,
20− u32 *timestamp, unsigned int mb);
18+ struct sk_buff *(*mailbox_read)(struct can_rx_offload *offload,
19+ unsigned int mb, u32 *timestamp,
20+ bool drop);
2121
2222 struct sk_buff_head skb_queue;
2323 u32 skb_queue_len_max;
@@ -44,7 +44,6 @@ unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload, · 20 unmodified lines
4444 unsigned int idx, u32 timestamp);
4545 int can_rx_offload_queue_tail(struct can_rx_offload *offload,
4646 struct sk_buff *skb);
47−void can_rx_offload_reset(struct can_rx_offload *offload);
4847 void can_rx_offload_del(struct can_rx_offload *offload);
4948 void can_rx_offload_enable(struct can_rx_offload *offload);
5049
include/linux/ceph/libceph.h+6−4
@@ -280,10 +280,12 @@ extern const char *ceph_msg_type_name(int type); · 279 unmodified lines
280280 extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
281281 extern void *ceph_kvmalloc(size_t size, gfp_t flags);
282282
283−extern struct ceph_options *ceph_parse_options(char *options,
284− const char *dev_name, const char *dev_name_end,
285− int (*parse_extra_token)(char *c, void *private),
286− void *private);
283+struct fs_parameter;
284+struct ceph_options *ceph_alloc_options(void);
285+int ceph_parse_mon_ips(const char *buf, size_t len, struct ceph_options *opt,
286+ struct fs_context *fc);
287+int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
288+ struct fs_context *fc);
287289 int ceph_print_client_options(struct seq_file *m, struct ceph_client *client,
288290 bool show_all);
289291 extern void ceph_destroy_options(struct ceph_options *opt);
include/linux/cgroup-defs.h+3−16
@@ -354,16 +354,6 @@ struct cgroup { · 353 unmodified lines
354354
355355 unsigned long flags; /* "unsigned long" so bitops work */
356356
357− /*
358− * idr allocated in-hierarchy ID.
359− *
360− * ID 0 is not used, the ID of the root cgroup is always 1, and a
361− * new cgroup will be assigned with a smallest available ID.
362− *
363− * Allocating/Removing ID must be protected by cgroup_mutex.
364− */
365− int id;
366−
367357 /*
368358 * The depth this cgroup is at. The root is at depth zero and each
369359 * step down the hierarchy increments the level. This along with
@@ -458,7 +448,7 @@ struct cgroup { · 88 unmodified lines
458448 struct list_head rstat_css_list;
459449
460450 /* cgroup basic resource statistics */
461− struct cgroup_base_stat pending_bstat; /* pending from children */
451+ struct cgroup_base_stat last_bstat;
462452 struct cgroup_base_stat bstat;
463453 struct prev_cputime prev_cputime; /* for printing out cputime */
464454
@@ -488,7 +478,7 @@ struct cgroup { · 23 unmodified lines
488478 struct cgroup_freezer_state freezer;
489479
490480 /* ids of the ancestors at each level including self */
491− int ancestor_ids[];
481+ u64 ancestor_ids[];
492482 };
493483
494484 /*
@@ -509,7 +499,7 @@ struct cgroup_root { · 14 unmodified lines
509499 struct cgroup cgrp;
510500
511501 /* for cgrp->ancestor_ids[0] */
512− int cgrp_ancestor_id_storage;
502+ u64 cgrp_ancestor_id_storage;
513503
514504 /* Number of cgroups in the hierarchy, used only for /proc/cgroups */
515505 atomic_t nr_cgrps;
@@ -520,9 +510,6 @@ struct cgroup_root { · 4 unmodified lines
520510 /* Hierarchy-specific flags */
521511 unsigned int flags;
522512
523− /* IDs for cgroups in this hierarchy */
524− struct idr cgroup_idr;
525−
526513 /* The path to use for release notifications. */
527514 char release_agent_path[PATH_MAX];
528515
include/linux/cgroup.h+11−16
@@ -150,7 +150,6 @@ struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset, · 149 unmodified lines
150150 struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset,
151151 struct cgroup_subsys_state **dst_cssp);
152152
153−void cgroup_enable_task_cg_lists(void);
154153 void css_task_iter_start(struct cgroup_subsys_state *css, unsigned int flags,
155154 struct css_task_iter *it);
156155 struct task_struct *css_task_iter_next(struct css_task_iter *it);
@@ -305,6 +304,11 @@ void css_task_iter_end(struct css_task_iter *it); · 148 unmodified lines
305304 * Inline functions.
306305 */
307306
307+static inline u64 cgroup_id(struct cgroup *cgrp)
308+{
309+ return cgrp->kn->id;
310+}
311+
308312 /**
309313 * css_get - obtain a reference on the specified css
310314 * @css: target css
@@ -566,7 +570,7 @@ static inline bool cgroup_is_descendant(struct cgroup *cgrp, · 255 unmodified lines
566570 {
567571 if (cgrp->root != ancestor->root || cgrp->level < ancestor->level)
568572 return false;
569− return cgrp->ancestor_ids[ancestor->level] == ancestor->id;
573+ return cgrp->ancestor_ids[ancestor->level] == cgroup_id(ancestor);
570574 }
571575
572576 /**
@@ -617,7 +621,7 @@ static inline bool cgroup_is_populated(struct cgroup *cgrp) · 44 unmodified lines
617621 /* returns ino associated with a cgroup */
618622 static inline ino_t cgroup_ino(struct cgroup *cgrp)
619623 {
620− return cgrp->kn->id.ino;
624+ return kernfs_ino(cgrp->kn);
621625 }
622626
623627 /* cft/css accessors for cftype->write() operation */
@@ -688,18 +692,13 @@ static inline void cgroup_kthread_ready(void) · 64 unmodified lines
688692 current->no_cgroup_migration = 0;
689693 }
690694
691−static inline union kernfs_node_id *cgroup_get_kernfs_id(struct cgroup *cgrp)
692−{
693− return &cgrp->kn->id;
694−}
695−
696−void cgroup_path_from_kernfs_id(const union kernfs_node_id *id,
697− char *buf, size_t buflen);
695+void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen);
698696 #else /* !CONFIG_CGROUPS */
699697
700698 struct cgroup_subsys_state;
701699 struct cgroup;
702700
701+static inline u64 cgroup_id(struct cgroup *cgrp) { return 1; }
703702 static inline void css_get(struct cgroup_subsys_state *css) {}
704703 static inline void css_put(struct cgroup_subsys_state *css) {}
705704 static inline int cgroup_attach_task_all(struct task_struct *from,
@@ -719,10 +718,6 @@ static inline int cgroup_init_early(void) { return 0; } · 13 unmodified lines
719718 static inline int cgroup_init(void) { return 0; }
720719 static inline void cgroup_init_kthreadd(void) {}
721720 static inline void cgroup_kthread_ready(void) {}
722−static inline union kernfs_node_id *cgroup_get_kernfs_id(struct cgroup *cgrp)
723−{
724− return NULL;
725−}
726721
727722 static inline struct cgroup *cgroup_parent(struct cgroup *cgrp)
728723 {
@@ -740,8 +735,8 @@ static inline bool task_under_cgroup_hierarchy(struct task_struct *task, · 11 unmodified lines
740735 return true;
741736 }
742737
743−static inline void cgroup_path_from_kernfs_id(const union kernfs_node_id *id,
744− char *buf, size_t buflen) {}
738+static inline void cgroup_path_from_kernfs_id(u64 id, char *buf, size_t buflen)
739+{}
745740 #endif /* !CONFIG_CGROUPS */
746741
747742 #ifdef CONFIG_CGROUPS
include/linux/clk-provider.h+1−0
@@ -818,6 +818,7 @@ unsigned int clk_hw_get_num_parents(const struct clk_hw *hw); · 817 unmodified lines
818818 struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw);
819819 struct clk_hw *clk_hw_get_parent_by_index(const struct clk_hw *hw,
820820 unsigned int index);
821+int clk_hw_get_parent_index(struct clk_hw *hw);
821822 int clk_hw_set_parent(struct clk_hw *hw, struct clk_hw *new_parent);
822823 unsigned int __clk_get_enable_count(struct clk *clk);
823824 unsigned long clk_hw_get_rate(const struct clk_hw *hw);
include/linux/clk/tegra.h+24−0
@@ -108,6 +108,19 @@ static inline void tegra_cpu_clock_resume(void) · 107 unmodified lines
108108
109109 tegra_cpu_car_ops->resume();
110110 }
111+#else
112+static inline bool tegra_cpu_rail_off_ready(void)
113+{
114+ return false;
115+}
116+
117+static inline void tegra_cpu_clock_suspend(void)
118+{
119+}
120+
121+static inline void tegra_cpu_clock_resume(void)
122+{
123+}
111124 #endif
112125
113126 extern void tegra210_xusb_pll_hw_control_enable(void);
@@ -119,4 +132,15 @@ extern void tegra210_put_utmipll_in_iddq(void); · 5 unmodified lines
119132 extern void tegra210_put_utmipll_out_iddq(void);
120133 extern int tegra210_clk_handle_mbist_war(unsigned int id);
121134
135+struct clk;
136+
137+typedef long (tegra20_clk_emc_round_cb)(unsigned long rate,
138+ unsigned long min_rate,
139+ unsigned long max_rate,
140+ void *arg);
141+
142+void tegra20_clk_set_emc_round_callback(tegra20_clk_emc_round_cb *round_cb,
143+ void *cb_arg);
144+int tegra20_clk_prepare_emc_mc_same_freq(struct clk *emc_clk, bool same);
145+
122146 #endif /* __LINUX_CLK_TEGRA_H_ */
include/linux/clk/ti.h+2−1
@@ -153,7 +153,7 @@ struct clk_hw_omap { · 152 unmodified lines
153153 u8 fixed_div;
154154 struct clk_omap_reg enable_reg;
155155 u8 enable_bit;
156− u8 flags;
156+ unsigned long flags;
157157 struct clk_omap_reg clksel_reg;
158158 struct dpll_data *dpll_data;
159159 const char *clkdm_name;
@@ -298,6 +298,7 @@ struct ti_clk_features { · 138 unmodified lines
298298
299299 void ti_clk_setup_features(struct ti_clk_features *features);
300300 const struct ti_clk_features *ti_clk_get_features(void);
301+bool ti_clk_is_in_standby(struct clk *clk);
301302 int omap3_noncore_dpll_save_context(struct clk_hw *hw);
302303 void omap3_noncore_dpll_restore_context(struct clk_hw *hw);
303304
include/linux/compat.h+6−15
@@ -116,14 +116,7 @@ typedef __compat_gid32_t compat_gid_t; · 115 unmodified lines
116116 struct compat_sel_arg_struct;
117117 struct rusage;
118118
119−struct compat_itimerval {
120− struct old_timeval32 it_interval;
121− struct old_timeval32 it_value;
122−};
123−
124−struct itimerval;
125−int get_compat_itimerval(struct itimerval *, const struct compat_itimerval __user *);
126−int put_compat_itimerval(struct compat_itimerval __user *, const struct itimerval *);
119+struct old_itimerval32;
127120
128121 struct compat_tms {
129122 compat_clock_t tms_utime;
@@ -410,8 +403,6 @@ struct compat_kexec_segment; · 280 unmodified lines
410403 struct compat_mq_attr;
411404 struct compat_msgbuf;
412405
413−extern void compat_exit_robust_list(struct task_struct *curr);
414−
415406 #define BITS_PER_COMPAT_LONG (8*sizeof(compat_long_t))
416407
417408 #define BITS_TO_COMPAT_LONGS(bits) DIV_ROUND_UP(bits, BITS_PER_COMPAT_LONG)
@@ -668,10 +659,10 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr, · 250 unmodified lines
668659
669660 /* kernel/itimer.c */
670661 asmlinkage long compat_sys_getitimer(int which,
671− struct compat_itimerval __user *it);
662+ struct old_itimerval32 __user *it);
672663 asmlinkage long compat_sys_setitimer(int which,
673− struct compat_itimerval __user *in,
674− struct compat_itimerval __user *out);
664+ struct old_itimerval32 __user *in,
665+ struct old_itimerval32 __user *out);
675666
676667 /* kernel/kexec.c */
677668 asmlinkage long compat_sys_kexec_load(compat_ulong_t entry,
@@ -937,10 +928,10 @@ static inline bool in_compat_syscall(void) { return is_compat_task(); } · 259 unmodified lines
937928 */
938929 static inline struct old_timeval32 ns_to_old_timeval32(s64 nsec)
939930 {
940− struct timeval tv;
931+ struct __kernel_old_timeval tv;
941932 struct old_timeval32 ctv;
942933
943− tv = ns_to_timeval(nsec);
934+ tv = ns_to_kernel_old_timeval(nsec);
944935 ctv.tv_sec = tv.tv_sec;
945936 ctv.tv_usec = tv.tv_usec;
946937
include/linux/context_tracking.h+15−15
@@ -22,26 +22,26 @@ extern void context_tracking_user_exit(void); · 21 unmodified lines
2222
2323 static inline void user_enter(void)
2424 {
25− if (context_tracking_is_enabled())
25+ if (context_tracking_enabled())
2626 context_tracking_enter(CONTEXT_USER);
2727
2828 }
2929 static inline void user_exit(void)
3030 {
31− if (context_tracking_is_enabled())
31+ if (context_tracking_enabled())
3232 context_tracking_exit(CONTEXT_USER);
3333 }
3434
3535 /* Called with interrupts disabled. */
3636 static inline void user_enter_irqoff(void)
3737 {
38− if (context_tracking_is_enabled())
38+ if (context_tracking_enabled())
3939 __context_tracking_enter(CONTEXT_USER);
4040
4141 }
4242 static inline void user_exit_irqoff(void)
4343 {
44− if (context_tracking_is_enabled())
44+ if (context_tracking_enabled())
4545 __context_tracking_exit(CONTEXT_USER);
4646 }
4747
@@ -49,7 +49,7 @@ static inline enum ctx_state exception_enter(void) · 1 unmodified line
4949 {
5050 enum ctx_state prev_ctx;
5151
52− if (!context_tracking_is_enabled())
52+ if (!context_tracking_enabled())
5353 return 0;
5454
5555 prev_ctx = this_cpu_read(context_tracking.state);
@@ -61,7 +61,7 @@ static inline enum ctx_state exception_enter(void) · 5 unmodified lines
6161
6262 static inline void exception_exit(enum ctx_state prev_ctx)
6363 {
64− if (context_tracking_is_enabled()) {
64+ if (context_tracking_enabled()) {
6565 if (prev_ctx != CONTEXT_KERNEL)
6666 context_tracking_enter(prev_ctx);
6767 }
@@ -77,7 +77,7 @@ static inline void exception_exit(enum ctx_state prev_ctx) · 9 unmodified lines
7777 */
7878 static inline enum ctx_state ct_state(void)
7979 {
80− return context_tracking_is_enabled() ?
80+ return context_tracking_enabled() ?
8181 this_cpu_read(context_tracking.state) : CONTEXT_DISABLED;
8282 }
8383 #else
@@ -90,7 +90,7 @@ static inline void exception_exit(enum ctx_state prev_ctx) { } · 6 unmodified lines
9090 static inline enum ctx_state ct_state(void) { return CONTEXT_DISABLED; }
9191 #endif /* !CONFIG_CONTEXT_TRACKING */
9292
93−#define CT_WARN_ON(cond) WARN_ON(context_tracking_is_enabled() && (cond))
93+#define CT_WARN_ON(cond) WARN_ON(context_tracking_enabled() && (cond))
9494
9595 #ifdef CONFIG_CONTEXT_TRACKING_FORCE
9696 extern void context_tracking_init(void);
@@ -103,12 +103,12 @@ static inline void context_tracking_init(void) { } · 6 unmodified lines
103103 /* must be called with irqs disabled */
104104 static inline void guest_enter_irqoff(void)
105105 {
106− if (vtime_accounting_cpu_enabled())
106+ if (vtime_accounting_enabled_this_cpu())
107107 vtime_guest_enter(current);
108108 else
109109 current->flags |= PF_VCPU;
110110
111− if (context_tracking_is_enabled())
111+ if (context_tracking_enabled())
112112 __context_tracking_enter(CONTEXT_GUEST);
113113
114114 /* KVM does not hold any references to rcu protected data when it
@@ -118,16 +118,16 @@ static inline void guest_enter_irqoff(void) · 3 unmodified lines
118118 * one time slice). Lets treat guest mode as quiescent state, just like
119119 * we do with user-mode execution.
120120 */
121− if (!context_tracking_cpu_is_enabled())
121+ if (!context_tracking_enabled_this_cpu())
122122 rcu_virt_note_context_switch(smp_processor_id());
123123 }
124124
125125 static inline void guest_exit_irqoff(void)
126126 {
127− if (context_tracking_is_enabled())
127+ if (context_tracking_enabled())
128128 __context_tracking_exit(CONTEXT_GUEST);
129129
130− if (vtime_accounting_cpu_enabled())
130+ if (vtime_accounting_enabled_this_cpu())
131131 vtime_guest_exit(current);
132132 else
133133 current->flags &= ~PF_VCPU;
@@ -141,7 +141,7 @@ static inline void guest_enter_irqoff(void) · 7 unmodified lines
141141 * to assume that it's the stime pending cputime
142142 * to flush.
143143 */
144− vtime_account_system(current);
144+ vtime_account_kernel(current);
145145 current->flags |= PF_VCPU;
146146 rcu_virt_note_context_switch(smp_processor_id());
147147 }
@@ -149,7 +149,7 @@ static inline void guest_enter_irqoff(void) · 1 unmodified line
149149 static inline void guest_exit_irqoff(void)
150150 {
151151 /* Flush the guest cputime we spent on the guest */
152− vtime_account_system(current);
152+ vtime_account_kernel(current);
153153 current->flags &= ~PF_VCPU;
154154 }
155155 #endif /* CONFIG_VIRT_CPU_ACCOUNTING_GEN */
include/linux/context_tracking_state.h+13−8
@@ -23,17 +23,22 @@ struct context_tracking { · 22 unmodified lines
2323 };
2424
2525 #ifdef CONFIG_CONTEXT_TRACKING
26−extern struct static_key_false context_tracking_enabled;
26+extern struct static_key_false context_tracking_key;
2727 DECLARE_PER_CPU(struct context_tracking, context_tracking);
2828
29−static inline bool context_tracking_is_enabled(void)
29+static inline bool context_tracking_enabled(void)
3030 {
31− return static_branch_unlikely(&context_tracking_enabled);
31+ return static_branch_unlikely(&context_tracking_key);
3232 }
3333
34−static inline bool context_tracking_cpu_is_enabled(void)
34+static inline bool context_tracking_enabled_cpu(int cpu)
3535 {
36− return __this_cpu_read(context_tracking.active);
36+ return context_tracking_enabled() && per_cpu(context_tracking.active, cpu);
37+}
38+
39+static inline bool context_tracking_enabled_this_cpu(void)
40+{
41+ return context_tracking_enabled() && __this_cpu_read(context_tracking.active);
3742 }
3843
3944 static inline bool context_tracking_in_user(void)
@@ -42,9 +47,9 @@ static inline bool context_tracking_in_user(void) · 2 unmodified lines
4247 }
4348 #else
4449 static inline bool context_tracking_in_user(void) { return false; }
45−static inline bool context_tracking_active(void) { return false; }
46−static inline bool context_tracking_is_enabled(void) { return false; }
47−static inline bool context_tracking_cpu_is_enabled(void) { return false; }
50+static inline bool context_tracking_enabled(void) { return false; }
51+static inline bool context_tracking_enabled_cpu(int cpu) { return false; }
52+static inline bool context_tracking_enabled_this_cpu(void) { return false; }
4853 #endif /* CONFIG_CONTEXT_TRACKING */
4954
5055 #endif
include/linux/coresight.h+6−0
@@ -285,6 +285,8 @@ extern void coresight_disclaim_device(void __iomem *base); · 284 unmodified lines
285285 extern void coresight_disclaim_device_unlocked(void __iomem *base);
286286 extern char *coresight_alloc_device_name(struct coresight_dev_list *devs,
287287 struct device *dev);
288+
289+extern bool coresight_loses_context_with_cpu(struct device *dev);
288290 #else
289291 static inline struct coresight_device *
290292 coresight_register(struct coresight_desc *desc) { return NULL; }
@@ -307,6 +309,10 @@ static inline int coresight_claim_device(void __iomem *base) · 16 unmodified lines
307309 static inline void coresight_disclaim_device(void __iomem *base) {}
308310 static inline void coresight_disclaim_device_unlocked(void __iomem *base) {}
309311
312+static inline bool coresight_loses_context_with_cpu(struct device *dev)
313+{
314+ return false;
315+}
310316 #endif
311317
312318 extern int coresight_get_cpu(struct device *dev);
include/linux/counter.h+10−66
@@ -290,53 +290,22 @@ struct counter_device_state { · 289 unmodified lines
290290 const struct attribute_group **groups;
291291 };
292292
293−/**
294− * struct counter_signal_read_value - Opaque Signal read value
295− * @buf: string representation of Signal read value
296− * @len: length of string in @buf
297− */
298−struct counter_signal_read_value {
299− char *buf;
300− size_t len;
301−};
302−
303−/**
304− * struct counter_count_read_value - Opaque Count read value
305− * @buf: string representation of Count read value
306− * @len: length of string in @buf
307− */
308−struct counter_count_read_value {
309− char *buf;
310− size_t len;
311−};
312−
313−/**
314− * struct counter_count_write_value - Opaque Count write value
315− * @buf: string representation of Count write value
316− */
317−struct counter_count_write_value {
318− const char *buf;
293+enum counter_signal_value {
294+ COUNTER_SIGNAL_LOW = 0,
295+ COUNTER_SIGNAL_HIGH
319296 };
320297
321298 /**
322299 * struct counter_ops - Callbacks from driver
323300 * @signal_read: optional read callback for Signal attribute. The read
324301 * value of the respective Signal should be passed back via
325− * the val parameter. val points to an opaque type which
326− * should be set only by calling the
327− * counter_signal_read_value_set function from within the
328− * signal_read callback.
302+ * the val parameter.
329303 * @count_read: optional read callback for Count attribute. The read
330304 * value of the respective Count should be passed back via
331− * the val parameter. val points to an opaque type which
332− * should be set only by calling the
333− * counter_count_read_value_set function from within the
334− * count_read callback.
305+ * the val parameter.
335306 * @count_write: optional write callback for Count attribute. The write
336307 * value for the respective Count is passed in via the val
337− * parameter. val points to an opaque type which should be
338− * accessed only by calling the
339− * counter_count_write_value_get function.
308+ * parameter.
340309 * @function_get: function to get the current count function mode. Returns
341310 * 0 on success and negative error code on error. The index
342311 * of the respective Count's returned function mode should
@@ -346,7 +315,7 @@ struct counter_count_write_value { · 3 unmodified lines
346315 * Count's functions_list array.
347316 * @action_get: function to get the current action mode. Returns 0 on
348317 * success and negative error code on error. The index of
349− * the respective Signal's returned action mode should be
318+ * the respective Synapse's returned action mode should be
350319 * passed back via the action parameter.
351320 * @action_set: function to set the action mode. action is the index of
352321 * the requested action mode from the respective Synapse's
@@ -355,13 +324,11 @@ struct counter_count_write_value { · 2 unmodified lines
355324 struct counter_ops {
356325 int (*signal_read)(struct counter_device *counter,
357326 struct counter_signal *signal,
358− struct counter_signal_read_value *val);
327+ enum counter_signal_value *val);
359328 int (*count_read)(struct counter_device *counter,
360− struct counter_count *count,
361− struct counter_count_read_value *val);
329+ struct counter_count *count, unsigned long *val);
362330 int (*count_write)(struct counter_device *counter,
363− struct counter_count *count,
364− struct counter_count_write_value *val);
331+ struct counter_count *count, unsigned long val);
365332 int (*function_get)(struct counter_device *counter,
366333 struct counter_count *count, size_t *function);
367334 int (*function_set)(struct counter_device *counter,
@@ -477,29 +444,6 @@ struct counter_device { · 109 unmodified lines
477444 void *priv;
478445 };
479446
480−enum counter_signal_level {
481− COUNTER_SIGNAL_LEVEL_LOW = 0,
482− COUNTER_SIGNAL_LEVEL_HIGH
483−};
484−
485−enum counter_signal_value_type {
486− COUNTER_SIGNAL_LEVEL = 0
487−};
488−
489−enum counter_count_value_type {
490− COUNTER_COUNT_POSITION = 0,
491−};
492−
493−void counter_signal_read_value_set(struct counter_signal_read_value *const val,
494− const enum counter_signal_value_type type,
495− void *const data);
496−void counter_count_read_value_set(struct counter_count_read_value *const val,
497− const enum counter_count_value_type type,
498− void *const data);
499−int counter_count_write_value_get(void *const data,
500− const enum counter_count_value_type type,
501− const struct counter_count_write_value *const val);
502−
503447 int counter_register(struct counter_device *const counter);
504448 void counter_unregister(struct counter_device *const counter);
505449 int devm_counter_register(struct device *dev,
include/linux/cpu.h+6−1
@@ -184,7 +184,12 @@ void arch_cpu_idle_dead(void); · 183 unmodified lines
184184 int cpu_report_state(int cpu);
185185 int cpu_check_up_prepare(int cpu);
186186 void cpu_set_state_online(int cpu);
187−void play_idle(unsigned long duration_us);
187+void play_idle_precise(u64 duration_ns, u64 latency_ns);
188+
189+static inline void play_idle(unsigned long duration_us)
190+{
191+ play_idle_precise(duration_us * NSEC_PER_USEC, U64_MAX);
192+}
188193
189194 #ifdef CONFIG_HOTPLUG_CPU
190195 bool cpu_wait_death(unsigned int cpu, int seconds);
include/linux/cpu_cooling.h+8−10
@@ -33,6 +33,13 @@ cpufreq_cooling_register(struct cpufreq_policy *policy); · 32 unmodified lines
3333 */
3434 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
3535
36+/**
37+ * of_cpufreq_cooling_register - create cpufreq cooling device based on DT.
38+ * @policy: cpufreq policy.
39+ */
40+struct thermal_cooling_device *
41+of_cpufreq_cooling_register(struct cpufreq_policy *policy);
42+
3643 #else /* !CONFIG_CPU_THERMAL */
3744 static inline struct thermal_cooling_device *
3845 cpufreq_cooling_register(struct cpufreq_policy *policy)
@@ -45,21 +52,12 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) · 6 unmodified lines
4552 {
4653 return;
4754 }
48−#endif /* CONFIG_CPU_THERMAL */
4955
50−#if defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL)
51−/**
52− * of_cpufreq_cooling_register - create cpufreq cooling device based on DT.
53− * @policy: cpufreq policy.
54− */
55−struct thermal_cooling_device *
56−of_cpufreq_cooling_register(struct cpufreq_policy *policy);
57−#else
5856 static inline struct thermal_cooling_device *
5957 of_cpufreq_cooling_register(struct cpufreq_policy *policy)
6058 {
6159 return NULL;
6260 }
63−#endif /* defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL) */
61+#endif /* CONFIG_CPU_THERMAL */
6462
6563 #endif /* __CPU_COOLING_H__ */
include/linux/cpufreq.h+0−11
@@ -595,17 +595,6 @@ struct governor_attr { · 594 unmodified lines
595595 size_t count);
596596 };
597597
598−static inline bool cpufreq_this_cpu_can_update(struct cpufreq_policy *policy)
599−{
600− /*
601− * Allow remote callbacks if:
602− * - dvfs_possible_from_any_cpu flag is set
603− * - the local and remote CPUs share cpufreq policy
604− */
605− return policy->dvfs_possible_from_any_cpu ||
606− cpumask_test_cpu(smp_processor_id(), policy->cpus);
607−}
608−
609598 /*********************************************************************
610599 * FREQUENCY TABLE HELPERS *
611600 *********************************************************************/
include/linux/cpuhotplug.h+2−0
@@ -129,6 +129,7 @@ enum cpuhp_state { · 128 unmodified lines
129129 CPUHP_AP_ARC_TIMER_STARTING,
130130 CPUHP_AP_RISCV_TIMER_STARTING,
131131 CPUHP_AP_CSKY_TIMER_STARTING,
132+ CPUHP_AP_HYPERV_TIMER_STARTING,
132133 CPUHP_AP_KVM_STARTING,
133134 CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,
134135 CPUHP_AP_KVM_ARM_VGIC_STARTING,
@@ -136,6 +137,7 @@ enum cpuhp_state { · 1 unmodified line
136137 /* Must be the last timer callback */
137138 CPUHP_AP_DUMMY_TIMER_STARTING,
138139 CPUHP_AP_ARM_XEN_STARTING,
140+ CPUHP_AP_ARM_KVMPV_STARTING,
139141 CPUHP_AP_ARM_CORESIGHT_STARTING,
140142 CPUHP_AP_ARM64_ISNDEP_STARTING,
141143 CPUHP_AP_SMPCFD_DYING,
include/linux/cpuidle.h+20−9
@@ -29,10 +29,13 @@ struct cpuidle_driver; · 28 unmodified lines
2929 * CPUIDLE DEVICE INTERFACE *
3030 ****************************/
3131
32+#define CPUIDLE_STATE_DISABLED_BY_USER BIT(0)
33+#define CPUIDLE_STATE_DISABLED_BY_DRIVER BIT(1)
34+
3235 struct cpuidle_state_usage {
3336 unsigned long long disable;
3437 unsigned long long usage;
35− unsigned long long time; /* in US */
38+ u64 time_ns;
3639 unsigned long long above; /* Number of times it's been too deep */
3740 unsigned long long below; /* Number of times it's been too shallow */
3841 #ifdef CONFIG_SUSPEND
@@ -45,11 +48,12 @@ struct cpuidle_state { · 6 unmodified lines
4548 char name[CPUIDLE_NAME_LEN];
4649 char desc[CPUIDLE_DESC_LEN];
4750
51+ u64 exit_latency_ns;
52+ u64 target_residency_ns;
4853 unsigned int flags;
4954 unsigned int exit_latency; /* in US */
5055 int power_usage; /* in mW */
5156 unsigned int target_residency; /* in US */
52− bool disabled; /* disabled on all CPUs */
5357
5458 int (*enter) (struct cpuidle_device *dev,
5559 struct cpuidle_driver *drv,
@@ -72,6 +76,7 @@ struct cpuidle_state { · 16 unmodified lines
7276 #define CPUIDLE_FLAG_POLLING BIT(0) /* polling state */
7377 #define CPUIDLE_FLAG_COUPLED BIT(1) /* state applies to multiple cpus */
7478 #define CPUIDLE_FLAG_TIMER_STOP BIT(2) /* timer is stopped on this state */
79+#define CPUIDLE_FLAG_UNUSABLE BIT(3) /* avoid using this state */
7580
7681 struct cpuidle_device_kobj;
7782 struct cpuidle_state_kobj;
@@ -80,14 +85,14 @@ struct cpuidle_driver_kobj; · 2 unmodified lines
8085 struct cpuidle_device {
8186 unsigned int registered:1;
8287 unsigned int enabled:1;
83− unsigned int use_deepest_state:1;
8488 unsigned int poll_time_limit:1;
8589 unsigned int cpu;
8690 ktime_t next_hrtimer;
8791
8892 int last_state_idx;
89− int last_residency;
93+ u64 last_residency_ns;
9094 u64 poll_limit_ns;
95+ u64 forced_idle_latency_limit_ns;
9196 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
9297 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
9398 struct cpuidle_driver_kobj *kobj_driver;
@@ -144,6 +149,8 @@ extern int cpuidle_register_driver(struct cpuidle_driver *drv); · 50 unmodified lines
144149 extern struct cpuidle_driver *cpuidle_get_driver(void);
145150 extern struct cpuidle_driver *cpuidle_driver_ref(void);
146151 extern void cpuidle_driver_unref(void);
152+extern void cpuidle_driver_state_disabled(struct cpuidle_driver *drv, int idx,
153+ bool disable);
147154 extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
148155 extern int cpuidle_register_device(struct cpuidle_device *dev);
149156 extern void cpuidle_unregister_device(struct cpuidle_device *dev);
@@ -181,6 +188,8 @@ static inline int cpuidle_register_driver(struct cpuidle_driver *drv) · 31 unmodified lines
181188 static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
182189 static inline struct cpuidle_driver *cpuidle_driver_ref(void) {return NULL; }
183190 static inline void cpuidle_driver_unref(void) {}
191+static inline void cpuidle_driver_state_disabled(struct cpuidle_driver *drv,
192+ int idx, bool disable) { }
184193 static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }
185194 static inline int cpuidle_register_device(struct cpuidle_device *dev)
186195 {return -ENODEV; }
@@ -204,18 +213,20 @@ static inline struct cpuidle_device *cpuidle_get_device(void) {return NULL; } · 17 unmodified lines
204213
205214 #ifdef CONFIG_CPU_IDLE
206215 extern int cpuidle_find_deepest_state(struct cpuidle_driver *drv,
207− struct cpuidle_device *dev);
216+ struct cpuidle_device *dev,
217+ u64 latency_limit_ns);
208218 extern int cpuidle_enter_s2idle(struct cpuidle_driver *drv,
209219 struct cpuidle_device *dev);
210−extern void cpuidle_use_deepest_state(bool enable);
220+extern void cpuidle_use_deepest_state(u64 latency_limit_ns);
211221 #else
212222 static inline int cpuidle_find_deepest_state(struct cpuidle_driver *drv,
213− struct cpuidle_device *dev)
223+ struct cpuidle_device *dev,
224+ u64 latency_limit_ns)
214225 {return -ENODEV; }
215226 static inline int cpuidle_enter_s2idle(struct cpuidle_driver *drv,
216227 struct cpuidle_device *dev)
217228 {return -ENODEV; }
218−static inline void cpuidle_use_deepest_state(bool enable)
229+static inline void cpuidle_use_deepest_state(u64 latency_limit_ns)
219230 {
220231 }
221232 #endif
@@ -260,7 +271,7 @@ struct cpuidle_governor { · 38 unmodified lines
260271
261272 #ifdef CONFIG_CPU_IDLE
262273 extern int cpuidle_register_governor(struct cpuidle_governor *gov);
263−extern int cpuidle_governor_latency_req(unsigned int cpu);
274+extern s64 cpuidle_governor_latency_req(unsigned int cpu);
264275 #else
265276 static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
266277 {return 0;}
include/linux/crypto.h+2−859
@@ -41,8 +41,6 @@ · 40 unmodified lines
4141 #define CRYPTO_ALG_TYPE_CIPHER 0x00000001
4242 #define CRYPTO_ALG_TYPE_COMPRESS 0x00000002
4343 #define CRYPTO_ALG_TYPE_AEAD 0x00000003
44−#define CRYPTO_ALG_TYPE_BLKCIPHER 0x00000004
45−#define CRYPTO_ALG_TYPE_ABLKCIPHER 0x00000005
4644 #define CRYPTO_ALG_TYPE_SKCIPHER 0x00000005
4745 #define CRYPTO_ALG_TYPE_KPP 0x00000008
4846 #define CRYPTO_ALG_TYPE_ACOMPRESS 0x0000000a
@@ -55,7 +53,6 @@ · 6 unmodified lines
5553
5654 #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e
5755 #define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000e
58−#define CRYPTO_ALG_TYPE_BLKCIPHER_MASK 0x0000000c
5956 #define CRYPTO_ALG_TYPE_ACOMPRESS_MASK 0x0000000e
6057
6158 #define CRYPTO_ALG_LARVAL 0x00000010
@@ -139,9 +136,7 @@ · 77 unmodified lines
139136 #define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN)))
140137
141138 struct scatterlist;
142−struct crypto_ablkcipher;
143139 struct crypto_async_request;
144−struct crypto_blkcipher;
145140 struct crypto_tfm;
146141 struct crypto_type;
147142
@@ -163,25 +158,6 @@ struct crypto_async_request { · 15 unmodified lines
163158 u32 flags;
164159 };
165160
166−struct ablkcipher_request {
167− struct crypto_async_request base;
168−
169− unsigned int nbytes;
170−
171− void *info;
172−
173− struct scatterlist *src;
174− struct scatterlist *dst;
175−
176− void *__ctx[] CRYPTO_MINALIGN_ATTR;
177−};
178−
179−struct blkcipher_desc {
180− struct crypto_blkcipher *tfm;
181− void *info;
182− u32 flags;
183−};
184−
185161 /**
186162 * DOC: Block Cipher Algorithm Definitions
187163 *
@@ -189,83 +165,6 @@ struct blkcipher_desc { · 1 unmodified line
189165 * managed via crypto_register_alg() and crypto_unregister_alg().
190166 */
191167
192−/**
193− * struct ablkcipher_alg - asynchronous block cipher definition
194− * @min_keysize: Minimum key size supported by the transformation. This is the
195− * smallest key length supported by this transformation algorithm.
196− * This must be set to one of the pre-defined values as this is
197− * not hardware specific. Possible values for this field can be
198− * found via git grep "_MIN_KEY_SIZE" include/crypto/
199− * @max_keysize: Maximum key size supported by the transformation. This is the
200− * largest key length supported by this transformation algorithm.
201− * This must be set to one of the pre-defined values as this is
202− * not hardware specific. Possible values for this field can be
203− * found via git grep "_MAX_KEY_SIZE" include/crypto/
204− * @setkey: Set key for the transformation. This function is used to either
205− * program a supplied key into the hardware or store the key in the
206− * transformation context for programming it later. Note that this
207− * function does modify the transformation context. This function can
208− * be called multiple times during the existence of the transformation
209− * object, so one must make sure the key is properly reprogrammed into
210− * the hardware. This function is also responsible for checking the key
211− * length for validity. In case a software fallback was put in place in
212− * the @cra_init call, this function might need to use the fallback if
213− * the algorithm doesn't support all of the key sizes.
214− * @encrypt: Encrypt a scatterlist of blocks. This function is used to encrypt
215− * the supplied scatterlist containing the blocks of data. The crypto
216− * API consumer is responsible for aligning the entries of the
217− * scatterlist properly and making sure the chunks are correctly
218− * sized. In case a software fallback was put in place in the
219− * @cra_init call, this function might need to use the fallback if
220− * the algorithm doesn't support all of the key sizes. In case the
221− * key was stored in transformation context, the key might need to be
222− * re-programmed into the hardware in this function. This function
223− * shall not modify the transformation context, as this function may
224− * be called in parallel with the same transformation object.
225− * @decrypt: Decrypt a single block. This is a reverse counterpart to @encrypt
226− * and the conditions are exactly the same.
227− * @ivsize: IV size applicable for transformation. The consumer must provide an
228− * IV of exactly that size to perform the encrypt or decrypt operation.
229− *
230− * All fields except @ivsize are mandatory and must be filled.
231− */
232−struct ablkcipher_alg {
233− int (*setkey)(struct crypto_ablkcipher *tfm, const u8 *key,
234− unsigned int keylen);
235− int (*encrypt)(struct ablkcipher_request *req);
236− int (*decrypt)(struct ablkcipher_request *req);
237−
238− unsigned int min_keysize;
239− unsigned int max_keysize;
240− unsigned int ivsize;
241−};
242−
243−/**
244− * struct blkcipher_alg - synchronous block cipher definition
245− * @min_keysize: see struct ablkcipher_alg
246− * @max_keysize: see struct ablkcipher_alg
247− * @setkey: see struct ablkcipher_alg
248− * @encrypt: see struct ablkcipher_alg
249− * @decrypt: see struct ablkcipher_alg
250− * @ivsize: see struct ablkcipher_alg
251− *
252− * All fields except @ivsize are mandatory and must be filled.
253− */
254−struct blkcipher_alg {
255− int (*setkey)(struct crypto_tfm *tfm, const u8 *key,
256− unsigned int keylen);
257− int (*encrypt)(struct blkcipher_desc *desc,
258− struct scatterlist *dst, struct scatterlist *src,
259− unsigned int nbytes);
260− int (*decrypt)(struct blkcipher_desc *desc,
261− struct scatterlist *dst, struct scatterlist *src,
262− unsigned int nbytes);
263−
264− unsigned int min_keysize;
265− unsigned int max_keysize;
266− unsigned int ivsize;
267−};
268−
269168 /**
270169 * struct cipher_alg - single-block symmetric ciphers definition
271170 * @cia_min_keysize: Minimum key size supported by the transformation. This is
@@ -450,8 +349,6 @@ struct crypto_istat_rng { · 178 unmodified lines
450349 };
451350 #endif /* CONFIG_CRYPTO_STATS */
452351
453−#define cra_ablkcipher cra_u.ablkcipher
454−#define cra_blkcipher cra_u.blkcipher
455352 #define cra_cipher cra_u.cipher
456353 #define cra_compress cra_u.compress
457354
@@ -499,9 +396,8 @@ struct crypto_istat_rng { · 41 unmodified lines
499396 * transformation algorithm.
500397 * @cra_type: Type of the cryptographic transformation. This is a pointer to
501398 * struct crypto_type, which implements callbacks common for all
502− * transformation types. There are multiple options:
503− * &crypto_blkcipher_type, &crypto_ablkcipher_type,
504− * &crypto_ahash_type, &crypto_rng_type.
399+ * transformation types. There are multiple options, such as
400+ * &crypto_skcipher_type, &crypto_ahash_type, &crypto_rng_type.
505401 * This field might be empty. In that case, there are no common
506402 * callbacks. This is the case for: cipher, compress, shash.
507403 * @cra_u: Callbacks implementing the transformation. This is a union of
@@ -520,10 +416,6 @@ struct crypto_istat_rng { · 12 unmodified lines
520416 * @cra_exit: Deinitialize the cryptographic transformation object. This is a
521417 * counterpart to @cra_init, used to remove various changes set in
522418 * @cra_init.
523− * @cra_u.ablkcipher: Union member which contains an asynchronous block cipher
524− * definition. See @struct @ablkcipher_alg.
525− * @cra_u.blkcipher: Union member which contains a synchronous block cipher
526− * definition See @struct @blkcipher_alg.
527419 * @cra_u.cipher: Union member which contains a single-block symmetric cipher
528420 * definition. See @struct @cipher_alg.
529421 * @cra_u.compress: Union member which contains a (de)compression algorithm.
@@ -565,8 +457,6 @@ struct crypto_alg { · 35 unmodified lines
565457 const struct crypto_type *cra_type;
566458
567459 union {
568− struct ablkcipher_alg ablkcipher;
569− struct blkcipher_alg blkcipher;
570460 struct cipher_alg cipher;
571461 struct compress_alg compress;
572462 } cra_u;
@@ -594,8 +484,6 @@ struct crypto_alg { · 21 unmodified lines
594484 #ifdef CONFIG_CRYPTO_STATS
595485 void crypto_stats_init(struct crypto_alg *alg);
596486 void crypto_stats_get(struct crypto_alg *alg);
597−void crypto_stats_ablkcipher_encrypt(unsigned int nbytes, int ret, struct crypto_alg *alg);
598−void crypto_stats_ablkcipher_decrypt(unsigned int nbytes, int ret, struct crypto_alg *alg);
599487 void crypto_stats_aead_encrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret);
600488 void crypto_stats_aead_decrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret);
601489 void crypto_stats_ahash_update(unsigned int nbytes, int ret, struct crypto_alg *alg);
@@ -618,10 +506,6 @@ static inline void crypto_stats_init(struct crypto_alg *alg) · 16 unmodified lines
618506 {}
619507 static inline void crypto_stats_get(struct crypto_alg *alg)
620508 {}
621−static inline void crypto_stats_ablkcipher_encrypt(unsigned int nbytes, int ret, struct crypto_alg *alg)
622−{}
623−static inline void crypto_stats_ablkcipher_decrypt(unsigned int nbytes, int ret, struct crypto_alg *alg)
624−{}
625509 static inline void crypto_stats_aead_encrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret)
626510 {}
627511 static inline void crypto_stats_aead_decrypt(unsigned int cryptlen, struct crypto_alg *alg, int ret)
@@ -715,28 +599,6 @@ int crypto_has_alg(const char *name, u32 type, u32 mask); · 87 unmodified lines
715599 * crypto_free_*(), as well as the various helpers below.
716600 */
717601
718−struct ablkcipher_tfm {
719− int (*setkey)(struct crypto_ablkcipher *tfm, const u8 *key,
720− unsigned int keylen);
721− int (*encrypt)(struct ablkcipher_request *req);
722− int (*decrypt)(struct ablkcipher_request *req);
723−
724− struct crypto_ablkcipher *base;
725−
726− unsigned int ivsize;
727− unsigned int reqsize;
728−};
729−
730−struct blkcipher_tfm {
731− void *iv;
732− int (*setkey)(struct crypto_tfm *tfm, const u8 *key,
733− unsigned int keylen);
734− int (*encrypt)(struct blkcipher_desc *desc, struct scatterlist *dst,
735− struct scatterlist *src, unsigned int nbytes);
736− int (*decrypt)(struct blkcipher_desc *desc, struct scatterlist *dst,
737− struct scatterlist *src, unsigned int nbytes);
738−};
739−
740602 struct cipher_tfm {
741603 int (*cit_setkey)(struct crypto_tfm *tfm,
742604 const u8 *key, unsigned int keylen);
@@ -753,8 +615,6 @@ struct compress_tfm { · 10 unmodified lines
753615 u8 *dst, unsigned int *dlen);
754616 };
755617
756−#define crt_ablkcipher crt_u.ablkcipher
757−#define crt_blkcipher crt_u.blkcipher
758618 #define crt_cipher crt_u.cipher
759619 #define crt_compress crt_u.compress
760620
@@ -763,8 +623,6 @@ struct crypto_tfm { · 2 unmodified lines
763623 u32 crt_flags;
764624
765625 union {
766− struct ablkcipher_tfm ablkcipher;
767− struct blkcipher_tfm blkcipher;
768626 struct cipher_tfm cipher;
769627 struct compress_tfm compress;
770628 } crt_u;
@@ -776,14 +634,6 @@ struct crypto_tfm { · 5 unmodified lines
776634 void *__crt_ctx[] CRYPTO_MINALIGN_ATTR;
777635 };
778636
779−struct crypto_ablkcipher {
780− struct crypto_tfm base;
781−};
782−
783−struct crypto_blkcipher {
784− struct crypto_tfm base;
785−};
786−
787637 struct crypto_cipher {
788638 struct crypto_tfm base;
789639 };
@@ -891,713 +741,6 @@ static inline unsigned int crypto_tfm_ctx_alignment(void) · 101 unmodified lines
891741 return __alignof__(tfm->__crt_ctx);
892742 }
893743
894−/*
895− * API wrappers.
896− */
897−static inline struct crypto_ablkcipher *__crypto_ablkcipher_cast(
898− struct crypto_tfm *tfm)
899−{
900− return (struct crypto_ablkcipher *)tfm;
901−}
902−
903−static inline u32 crypto_skcipher_type(u32 type)
904−{
905− type &= ~CRYPTO_ALG_TYPE_MASK;
906− type |= CRYPTO_ALG_TYPE_BLKCIPHER;
907− return type;
908−}
909−
910−static inline u32 crypto_skcipher_mask(u32 mask)
911−{
912− mask &= ~CRYPTO_ALG_TYPE_MASK;
913− mask |= CRYPTO_ALG_TYPE_BLKCIPHER_MASK;
914− return mask;
915−}
916−
917−/**
918− * DOC: Asynchronous Block Cipher API
919− *
920− * Asynchronous block cipher API is used with the ciphers of type
921− * CRYPTO_ALG_TYPE_ABLKCIPHER (listed as type "ablkcipher" in /proc/crypto).
922− *
923− * Asynchronous cipher operations imply that the function invocation for a
924− * cipher request returns immediately before the completion of the operation.
925− * The cipher request is scheduled as a separate kernel thread and therefore
926− * load-balanced on the different CPUs via the process scheduler. To allow
927− * the kernel crypto API to inform the caller about the completion of a cipher
928− * request, the caller must provide a callback function. That function is
929− * invoked with the cipher handle when the request completes.
930− *
931− * To support the asynchronous operation, additional information than just the
932− * cipher handle must be supplied to the kernel crypto API. That additional
933− * information is given by filling in the ablkcipher_request data structure.
934− *
935− * For the asynchronous block cipher API, the state is maintained with the tfm
936− * cipher handle. A single tfm can be used across multiple calls and in
937− * parallel. For asynchronous block cipher calls, context data supplied and
938− * only used by the caller can be referenced the request data structure in
939− * addition to the IV used for the cipher request. The maintenance of such
940− * state information would be important for a crypto driver implementer to
941− * have, because when calling the callback function upon completion of the
942− * cipher operation, that callback function may need some information about
943− * which operation just finished if it invoked multiple in parallel. This
944− * state information is unused by the kernel crypto API.
945− */
946−
947−static inline struct crypto_tfm *crypto_ablkcipher_tfm(
948− struct crypto_ablkcipher *tfm)
949−{
950− return &tfm->base;
951−}
952−
953−/**
954− * crypto_free_ablkcipher() - zeroize and free cipher handle
955− * @tfm: cipher handle to be freed
956− */
957−static inline void crypto_free_ablkcipher(struct crypto_ablkcipher *tfm)
958−{
959− crypto_free_tfm(crypto_ablkcipher_tfm(tfm));
960−}
961−
962−/**
963− * crypto_has_ablkcipher() - Search for the availability of an ablkcipher.
964− * @alg_name: is the cra_name / name or cra_driver_name / driver name of the
965− * ablkcipher
966− * @type: specifies the type of the cipher
967− * @mask: specifies the mask for the cipher
968− *
969− * Return: true when the ablkcipher is known to the kernel crypto API; false
970− * otherwise
971− */
972−static inline int crypto_has_ablkcipher(const char *alg_name, u32 type,
973− u32 mask)
974−{
975− return crypto_has_alg(alg_name, crypto_skcipher_type(type),
976− crypto_skcipher_mask(mask));
977−}
978−
979−static inline struct ablkcipher_tfm *crypto_ablkcipher_crt(
980− struct crypto_ablkcipher *tfm)
981−{
982− return &crypto_ablkcipher_tfm(tfm)->crt_ablkcipher;
983−}
984−
985−/**
986− * crypto_ablkcipher_ivsize() - obtain IV size
987− * @tfm: cipher handle
988− *
989− * The size of the IV for the ablkcipher referenced by the cipher handle is
990− * returned. This IV size may be zero if the cipher does not need an IV.
991− *
992− * Return: IV size in bytes
993− */
994−static inline unsigned int crypto_ablkcipher_ivsize(
995− struct crypto_ablkcipher *tfm)
996−{
997− return crypto_ablkcipher_crt(tfm)->ivsize;
998−}
999−
1000−/**
1001− * crypto_ablkcipher_blocksize() - obtain block size of cipher
1002− * @tfm: cipher handle
1003− *
1004− * The block size for the ablkcipher referenced with the cipher handle is
1005− * returned. The caller may use that information to allocate appropriate
1006− * memory for the data returned by the encryption or decryption operation
1007− *
1008− * Return: block size of cipher
1009− */
1010−static inline unsigned int crypto_ablkcipher_blocksize(
1011− struct crypto_ablkcipher *tfm)
1012−{
1013− return crypto_tfm_alg_blocksize(crypto_ablkcipher_tfm(tfm));
1014−}
1015−
1016−static inline unsigned int crypto_ablkcipher_alignmask(
1017− struct crypto_ablkcipher *tfm)
1018−{
1019− return crypto_tfm_alg_alignmask(crypto_ablkcipher_tfm(tfm));
1020−}
1021−
1022−static inline u32 crypto_ablkcipher_get_flags(struct crypto_ablkcipher *tfm)
1023−{
1024− return crypto_tfm_get_flags(crypto_ablkcipher_tfm(tfm));
1025−}
1026−
1027−static inline void crypto_ablkcipher_set_flags(struct crypto_ablkcipher *tfm,
1028− u32 flags)
1029−{
1030− crypto_tfm_set_flags(crypto_ablkcipher_tfm(tfm), flags);
1031−}
1032−
1033−static inline void crypto_ablkcipher_clear_flags(struct crypto_ablkcipher *tfm,
1034− u32 flags)
1035−{
1036− crypto_tfm_clear_flags(crypto_ablkcipher_tfm(tfm), flags);
1037−}
1038−
1039−/**
1040− * crypto_ablkcipher_setkey() - set key for cipher
1041− * @tfm: cipher handle
1042− * @key: buffer holding the key
1043− * @keylen: length of the key in bytes
1044− *
1045− * The caller provided key is set for the ablkcipher referenced by the cipher
1046− * handle.
1047− *
1048− * Note, the key length determines the cipher type. Many block ciphers implement
1049− * different cipher modes depending on the key size, such as AES-128 vs AES-192
1050− * vs. AES-256. When providing a 16 byte key for an AES cipher handle, AES-128
1051− * is performed.
1052− *
1053− * Return: 0 if the setting of the key was successful; < 0 if an error occurred
1054− */
1055−static inline int crypto_ablkcipher_setkey(struct crypto_ablkcipher *tfm,
1056− const u8 *key, unsigned int keylen)
1057−{
1058− struct ablkcipher_tfm *crt = crypto_ablkcipher_crt(tfm);
1059−
1060− return crt->setkey(crt->base, key, keylen);
1061−}
1062−
1063−/**
1064− * crypto_ablkcipher_reqtfm() - obtain cipher handle from request
1065− * @req: ablkcipher_request out of which the cipher handle is to be obtained
1066− *
1067− * Return the crypto_ablkcipher handle when furnishing an ablkcipher_request
1068− * data structure.
1069− *
1070− * Return: crypto_ablkcipher handle
1071− */
1072−static inline struct crypto_ablkcipher *crypto_ablkcipher_reqtfm(
1073− struct ablkcipher_request *req)
1074−{
1075− return __crypto_ablkcipher_cast(req->base.tfm);
1076−}
1077−
1078−/**
1079− * crypto_ablkcipher_encrypt() - encrypt plaintext
1080− * @req: reference to the ablkcipher_request handle that holds all information
1081− * needed to perform the cipher operation
1082− *
1083− * Encrypt plaintext data using the ablkcipher_request handle. That data
1084− * structure and how it is filled with data is discussed with the
1085− * ablkcipher_request_* functions.
1086− *
1087− * Return: 0 if the cipher operation was successful; < 0 if an error occurred
1088− */
1089−static inline int crypto_ablkcipher_encrypt(struct ablkcipher_request *req)
1090−{
1091− struct ablkcipher_tfm *crt =
1092− crypto_ablkcipher_crt(crypto_ablkcipher_reqtfm(req));
1093− struct crypto_alg *alg = crt->base->base.__crt_alg;
1094− unsigned int nbytes = req->nbytes;
1095− int ret;
1096−
1097− crypto_stats_get(alg);
1098− ret = crt->encrypt(req);
1099− crypto_stats_ablkcipher_encrypt(nbytes, ret, alg);
1100− return ret;
1101−}
1102−
1103−/**
1104− * crypto_ablkcipher_decrypt() - decrypt ciphertext
1105− * @req: reference to the ablkcipher_request handle that holds all information
1106− * needed to perform the cipher operation
1107− *
1108− * Decrypt ciphertext data using the ablkcipher_request handle. That data
1109− * structure and how it is filled with data is discussed with the
1110− * ablkcipher_request_* functions.
1111− *
1112− * Return: 0 if the cipher operation was successful; < 0 if an error occurred
1113− */
1114−static inline int crypto_ablkcipher_decrypt(struct ablkcipher_request *req)
1115−{
1116− struct ablkcipher_tfm *crt =
1117− crypto_ablkcipher_crt(crypto_ablkcipher_reqtfm(req));
1118− struct crypto_alg *alg = crt->base->base.__crt_alg;
1119− unsigned int nbytes = req->nbytes;
1120− int ret;
1121−
1122− crypto_stats_get(alg);
1123− ret = crt->decrypt(req);
1124− crypto_stats_ablkcipher_decrypt(nbytes, ret, alg);
1125− return ret;
1126−}
1127−
1128−/**
1129− * DOC: Asynchronous Cipher Request Handle
1130− *
1131− * The ablkcipher_request data structure contains all pointers to data
1132− * required for the asynchronous cipher operation. This includes the cipher
1133− * handle (which can be used by multiple ablkcipher_request instances), pointer
1134− * to plaintext and ciphertext, asynchronous callback function, etc. It acts
1135− * as a handle to the ablkcipher_request_* API calls in a similar way as
1136− * ablkcipher handle to the crypto_ablkcipher_* API calls.
1137− */
1138−
1139−/**
1140− * crypto_ablkcipher_reqsize() - obtain size of the request data structure
1141− * @tfm: cipher handle
1142− *
1143− * Return: number of bytes
1144− */
1145−static inline unsigned int crypto_ablkcipher_reqsize(
1146− struct crypto_ablkcipher *tfm)
1147−{
1148− return crypto_ablkcipher_crt(tfm)->reqsize;
1149−}
1150−
1151−/**
1152− * ablkcipher_request_set_tfm() - update cipher handle reference in request
1153− * @req: request handle to be modified
1154− * @tfm: cipher handle that shall be added to the request handle
1155− *
1156− * Allow the caller to replace the existing ablkcipher handle in the request
1157− * data structure with a different one.
1158− */
1159−static inline void ablkcipher_request_set_tfm(
1160− struct ablkcipher_request *req, struct crypto_ablkcipher *tfm)
1161−{
1162− req->base.tfm = crypto_ablkcipher_tfm(crypto_ablkcipher_crt(tfm)->base);
1163−}
1164−
1165−static inline struct ablkcipher_request *ablkcipher_request_cast(
1166− struct crypto_async_request *req)
1167−{
1168− return container_of(req, struct ablkcipher_request, base);
1169−}
1170−
1171−/**
1172− * ablkcipher_request_alloc() - allocate request data structure
1173− * @tfm: cipher handle to be registered with the request
1174− * @gfp: memory allocation flag that is handed to kmalloc by the API call.
1175− *
1176− * Allocate the request data structure that must be used with the ablkcipher
1177− * encrypt and decrypt API calls. During the allocation, the provided ablkcipher
1178− * handle is registered in the request data structure.
1179− *
1180− * Return: allocated request handle in case of success, or NULL if out of memory
1181− */
1182−static inline struct ablkcipher_request *ablkcipher_request_alloc(
1183− struct crypto_ablkcipher *tfm, gfp_t gfp)
1184−{
1185− struct ablkcipher_request *req;
1186−
1187− req = kmalloc(sizeof(struct ablkcipher_request) +
1188− crypto_ablkcipher_reqsize(tfm), gfp);
1189−
1190− if (likely(req))
1191− ablkcipher_request_set_tfm(req, tfm);
1192−
1193− return req;
1194−}
1195−
1196−/**
1197− * ablkcipher_request_free() - zeroize and free request data structure
1198− * @req: request data structure cipher handle to be freed
1199− */
1200−static inline void ablkcipher_request_free(struct ablkcipher_request *req)
1201−{
1202− kzfree(req);
1203−}
1204−
1205−/**
1206− * ablkcipher_request_set_callback() - set asynchronous callback function
1207− * @req: request handle
1208− * @flags: specify zero or an ORing of the flags
1209− * CRYPTO_TFM_REQ_MAY_BACKLOG the request queue may back log and
1210− * increase the wait queue beyond the initial maximum size;
1211− * CRYPTO_TFM_REQ_MAY_SLEEP the request processing may sleep
1212− * @compl: callback function pointer to be registered with the request handle
1213− * @data: The data pointer refers to memory that is not used by the kernel
1214− * crypto API, but provided to the callback function for it to use. Here,
1215− * the caller can provide a reference to memory the callback function can
1216− * operate on. As the callback function is invoked asynchronously to the
1217− * related functionality, it may need to access data structures of the
1218− * related functionality which can be referenced using this pointer. The
1219− * callback function can access the memory via the "data" field in the
1220− * crypto_async_request data structure provided to the callback function.
1221− *
1222− * This function allows setting the callback function that is triggered once the
1223− * cipher operation completes.
1224− *
1225− * The callback function is registered with the ablkcipher_request handle and
1226− * must comply with the following template::
1227− *
1228− * void callback_function(struct crypto_async_request *req, int error)
1229− */
1230−static inline void ablkcipher_request_set_callback(
1231− struct ablkcipher_request *req,
1232− u32 flags, crypto_completion_t compl, void *data)
1233−{
1234− req->base.complete = compl;
1235− req->base.data = data;
1236− req->base.flags = flags;
1237−}
1238−
1239−/**
1240− * ablkcipher_request_set_crypt() - set data buffers
1241− * @req: request handle
1242− * @src: source scatter / gather list
1243− * @dst: destination scatter / gather list
1244− * @nbytes: number of bytes to process from @src
1245− * @iv: IV for the cipher operation which must comply with the IV size defined
1246− * by crypto_ablkcipher_ivsize
1247− *
1248− * This function allows setting of the source data and destination data
1249− * scatter / gather lists.
1250− *
1251− * For encryption, the source is treated as the plaintext and the
1252− * destination is the ciphertext. For a decryption operation, the use is
1253− * reversed - the source is the ciphertext and the destination is the plaintext.
1254− */
1255−static inline void ablkcipher_request_set_crypt(
1256− struct ablkcipher_request *req,
1257− struct scatterlist *src, struct scatterlist *dst,
1258− unsigned int nbytes, void *iv)
1259−{
1260− req->src = src;
1261− req->dst = dst;
1262− req->nbytes = nbytes;
1263− req->info = iv;
1264−}
1265−
1266−/**
1267− * DOC: Synchronous Block Cipher API
1268− *
1269− * The synchronous block cipher API is used with the ciphers of type
1270− * CRYPTO_ALG_TYPE_BLKCIPHER (listed as type "blkcipher" in /proc/crypto)
1271− *
1272− * Synchronous calls, have a context in the tfm. But since a single tfm can be
1273− * used in multiple calls and in parallel, this info should not be changeable
1274− * (unless a lock is used). This applies, for example, to the symmetric key.
1275− * However, the IV is changeable, so there is an iv field in blkcipher_tfm
1276− * structure for synchronous blkcipher api. So, its the only state info that can
1277− * be kept for synchronous calls without using a big lock across a tfm.
1278− *
1279− * The block cipher API allows the use of a complete cipher, i.e. a cipher
1280− * consisting of a template (a block chaining mode) and a single block cipher
1281− * primitive (e.g. AES).
1282− *
1283− * The plaintext data buffer and the ciphertext data buffer are pointed to
1284− * by using scatter/gather lists. The cipher operation is performed
1285− * on all segments of the provided scatter/gather lists.
1286− *
1287− * The kernel crypto API supports a cipher operation "in-place" which means that
1288− * the caller may provide the same scatter/gather list for the plaintext and
1289− * cipher text. After the completion of the cipher operation, the plaintext
1290− * data is replaced with the ciphertext data in case of an encryption and vice
1291− * versa for a decryption. The caller must ensure that the scatter/gather lists
1292− * for the output data point to sufficiently large buffers, i.e. multiples of
1293− * the block size of the cipher.
1294− */
1295−
1296−static inline struct crypto_blkcipher *__crypto_blkcipher_cast(
1297− struct crypto_tfm *tfm)
1298−{
1299− return (struct crypto_blkcipher *)tfm;
1300−}
1301−
1302−static inline struct crypto_blkcipher *crypto_blkcipher_cast(
1303− struct crypto_tfm *tfm)
1304−{
1305− BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_BLKCIPHER);
1306− return __crypto_blkcipher_cast(tfm);
1307−}
1308−
1309−/**
1310− * crypto_alloc_blkcipher() - allocate synchronous block cipher handle
1311− * @alg_name: is the cra_name / name or cra_driver_name / driver name of the
1312− * blkcipher cipher
1313− * @type: specifies the type of the cipher
1314− * @mask: specifies the mask for the cipher
1315− *
1316− * Allocate a cipher handle for a block cipher. The returned struct
1317− * crypto_blkcipher is the cipher handle that is required for any subsequent
1318− * API invocation for that block cipher.
1319− *
1320− * Return: allocated cipher handle in case of success; IS_ERR() is true in case
1321− * of an error, PTR_ERR() returns the error code.
1322− */
1323−static inline struct crypto_blkcipher *crypto_alloc_blkcipher(
1324− const char *alg_name, u32 type, u32 mask)
1325−{
1326− type &= ~CRYPTO_ALG_TYPE_MASK;
1327− type |= CRYPTO_ALG_TYPE_BLKCIPHER;
1328− mask |= CRYPTO_ALG_TYPE_MASK;
1329−
1330− return __crypto_blkcipher_cast(crypto_alloc_base(alg_name, type, mask));
1331−}
1332−
1333−static inline struct crypto_tfm *crypto_blkcipher_tfm(
1334− struct crypto_blkcipher *tfm)
1335−{
1336− return &tfm->base;
1337−}
1338−
1339−/**
1340− * crypto_free_blkcipher() - zeroize and free the block cipher handle
1341− * @tfm: cipher handle to be freed
1342− */
1343−static inline void crypto_free_blkcipher(struct crypto_blkcipher *tfm)
1344−{
1345− crypto_free_tfm(crypto_blkcipher_tfm(tfm));
1346−}
1347−
1348−/**
1349− * crypto_has_blkcipher() - Search for the availability of a block cipher
1350− * @alg_name: is the cra_name / name or cra_driver_name / driver name of the
1351− * block cipher
1352− * @type: specifies the type of the cipher
1353− * @mask: specifies the mask for the cipher
1354− *
1355− * Return: true when the block cipher is known to the kernel crypto API; false
1356− * otherwise
1357− */
1358−static inline int crypto_has_blkcipher(const char *alg_name, u32 type, u32 mask)
1359−{
1360− type &= ~CRYPTO_ALG_TYPE_MASK;
1361− type |= CRYPTO_ALG_TYPE_BLKCIPHER;
1362− mask |= CRYPTO_ALG_TYPE_MASK;
1363−
1364− return crypto_has_alg(alg_name, type, mask);
1365−}
1366−
1367−/**
1368− * crypto_blkcipher_name() - return the name / cra_name from the cipher handle
1369− * @tfm: cipher handle
1370− *
1371− * Return: The character string holding the name of the cipher
1372− */
1373−static inline const char *crypto_blkcipher_name(struct crypto_blkcipher *tfm)
1374−{
1375− return crypto_tfm_alg_name(crypto_blkcipher_tfm(tfm));
1376−}
1377−
1378−static inline struct blkcipher_tfm *crypto_blkcipher_crt(
1379− struct crypto_blkcipher *tfm)
1380−{
1381− return &crypto_blkcipher_tfm(tfm)->crt_blkcipher;
1382−}
1383−
1384−static inline struct blkcipher_alg *crypto_blkcipher_alg(
1385− struct crypto_blkcipher *tfm)
1386−{
1387− return &crypto_blkcipher_tfm(tfm)->__crt_alg->cra_blkcipher;
1388−}
1389−
1390−/**
1391− * crypto_blkcipher_ivsize() - obtain IV size
1392− * @tfm: cipher handle
1393− *
1394− * The size of the IV for the block cipher referenced by the cipher handle is
1395− * returned. This IV size may be zero if the cipher does not need an IV.
1396− *
1397− * Return: IV size in bytes
1398− */
1399−static inline unsigned int crypto_blkcipher_ivsize(struct crypto_blkcipher *tfm)
1400−{
1401− return crypto_blkcipher_alg(tfm)->ivsize;
1402−}
1403−
1404−/**
1405− * crypto_blkcipher_blocksize() - obtain block size of cipher
1406− * @tfm: cipher handle
1407− *
1408− * The block size for the block cipher referenced with the cipher handle is
1409− * returned. The caller may use that information to allocate appropriate
1410− * memory for the data returned by the encryption or decryption operation.
1411− *
1412− * Return: block size of cipher
1413− */
1414−static inline unsigned int crypto_blkcipher_blocksize(
1415− struct crypto_blkcipher *tfm)
1416−{
1417− return crypto_tfm_alg_blocksize(crypto_blkcipher_tfm(tfm));
1418−}
1419−
1420−static inline unsigned int crypto_blkcipher_alignmask(
1421− struct crypto_blkcipher *tfm)
1422−{
1423− return crypto_tfm_alg_alignmask(crypto_blkcipher_tfm(tfm));
1424−}
1425−
1426−static inline u32 crypto_blkcipher_get_flags(struct crypto_blkcipher *tfm)
1427−{
1428− return crypto_tfm_get_flags(crypto_blkcipher_tfm(tfm));
1429−}
1430−
1431−static inline void crypto_blkcipher_set_flags(struct crypto_blkcipher *tfm,
1432− u32 flags)
1433−{
1434− crypto_tfm_set_flags(crypto_blkcipher_tfm(tfm), flags);
1435−}
1436−
1437−static inline void crypto_blkcipher_clear_flags(struct crypto_blkcipher *tfm,
1438− u32 flags)
1439−{
1440− crypto_tfm_clear_flags(crypto_blkcipher_tfm(tfm), flags);
1441−}
1442−
1443−/**
1444− * crypto_blkcipher_setkey() - set key for cipher
1445− * @tfm: cipher handle
1446− * @key: buffer holding the key
1447− * @keylen: length of the key in bytes
1448− *
1449− * The caller provided key is set for the block cipher referenced by the cipher
1450− * handle.
1451− *
1452− * Note, the key length determines the cipher type. Many block ciphers implement
1453− * different cipher modes depending on the key size, such as AES-128 vs AES-192
1454− * vs. AES-256. When providing a 16 byte key for an AES cipher handle, AES-128
1455− * is performed.
1456− *
1457− * Return: 0 if the setting of the key was successful; < 0 if an error occurred
1458− */
1459−static inline int crypto_blkcipher_setkey(struct crypto_blkcipher *tfm,
1460− const u8 *key, unsigned int keylen)
1461−{
1462− return crypto_blkcipher_crt(tfm)->setkey(crypto_blkcipher_tfm(tfm),
1463− key, keylen);
1464−}
1465−
1466−/**
1467− * crypto_blkcipher_encrypt() - encrypt plaintext
1468− * @desc: reference to the block cipher handle with meta data
1469− * @dst: scatter/gather list that is filled by the cipher operation with the
1470− * ciphertext
1471− * @src: scatter/gather list that holds the plaintext
1472− * @nbytes: number of bytes of the plaintext to encrypt.
1473− *
1474− * Encrypt plaintext data using the IV set by the caller with a preceding
1475− * call of crypto_blkcipher_set_iv.
1476− *
1477− * The blkcipher_desc data structure must be filled by the caller and can
1478− * reside on the stack. The caller must fill desc as follows: desc.tfm is filled
1479− * with the block cipher handle; desc.flags is filled with either
1480− * CRYPTO_TFM_REQ_MAY_SLEEP or 0.
1481− *
1482− * Return: 0 if the cipher operation was successful; < 0 if an error occurred
1483− */
1484−static inline int crypto_blkcipher_encrypt(struct blkcipher_desc *desc,
1485− struct scatterlist *dst,
1486− struct scatterlist *src,
1487− unsigned int nbytes)
1488−{
1489− desc->info = crypto_blkcipher_crt(desc->tfm)->iv;
1490− return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes);
1491−}
1492−
1493−/**
1494− * crypto_blkcipher_encrypt_iv() - encrypt plaintext with dedicated IV
1495− * @desc: reference to the block cipher handle with meta data
1496− * @dst: scatter/gather list that is filled by the cipher operation with the
1497− * ciphertext
1498− * @src: scatter/gather list that holds the plaintext
1499− * @nbytes: number of bytes of the plaintext to encrypt.
1500− *
1501− * Encrypt plaintext data with the use of an IV that is solely used for this
1502− * cipher operation. Any previously set IV is not used.
1503− *
1504− * The blkcipher_desc data structure must be filled by the caller and can
1505− * reside on the stack. The caller must fill desc as follows: desc.tfm is filled
1506− * with the block cipher handle; desc.info is filled with the IV to be used for
1507− * the current operation; desc.flags is filled with either
1508− * CRYPTO_TFM_REQ_MAY_SLEEP or 0.
1509− *
1510− * Return: 0 if the cipher operation was successful; < 0 if an error occurred
1511− */
1512−static inline int crypto_blkcipher_encrypt_iv(struct blkcipher_desc *desc,
1513− struct scatterlist *dst,
1514− struct scatterlist *src,
1515− unsigned int nbytes)
1516−{
1517− return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes);
1518−}
1519−
1520−/**
1521− * crypto_blkcipher_decrypt() - decrypt ciphertext
1522− * @desc: reference to the block cipher handle with meta data
1523− * @dst: scatter/gather list that is filled by the cipher operation with the
1524− * plaintext
1525− * @src: scatter/gather list that holds the ciphertext
1526− * @nbytes: number of bytes of the ciphertext to decrypt.
1527− *
1528− * Decrypt ciphertext data using the IV set by the caller with a preceding
1529− * call of crypto_blkcipher_set_iv.
1530− *
1531− * The blkcipher_desc data structure must be filled by the caller as documented
1532− * for the crypto_blkcipher_encrypt call above.
1533− *
1534− * Return: 0 if the cipher operation was successful; < 0 if an error occurred
1535− *
1536− */
1537−static inline int crypto_blkcipher_decrypt(struct blkcipher_desc *desc,
1538− struct scatterlist *dst,
1539− struct scatterlist *src,
1540− unsigned int nbytes)
1541−{
1542− desc->info = crypto_blkcipher_crt(desc->tfm)->iv;
1543− return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes);
1544−}
1545−
1546−/**
1547− * crypto_blkcipher_decrypt_iv() - decrypt ciphertext with dedicated IV
1548− * @desc: reference to the block cipher handle with meta data
1549− * @dst: scatter/gather list that is filled by the cipher operation with the
1550− * plaintext
1551− * @src: scatter/gather list that holds the ciphertext
1552− * @nbytes: number of bytes of the ciphertext to decrypt.
1553− *
1554− * Decrypt ciphertext data with the use of an IV that is solely used for this
1555− * cipher operation. Any previously set IV is not used.
1556− *
1557− * The blkcipher_desc data structure must be filled by the caller as documented
1558− * for the crypto_blkcipher_encrypt_iv call above.
1559− *
1560− * Return: 0 if the cipher operation was successful; < 0 if an error occurred
1561− */
1562−static inline int crypto_blkcipher_decrypt_iv(struct blkcipher_desc *desc,
1563− struct scatterlist *dst,
1564− struct scatterlist *src,
1565− unsigned int nbytes)
1566−{
1567− return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes);
1568−}
1569−
1570−/**
1571− * crypto_blkcipher_set_iv() - set IV for cipher
1572− * @tfm: cipher handle
1573− * @src: buffer holding the IV
1574− * @len: length of the IV in bytes
1575− *
1576− * The caller provided IV is set for the block cipher referenced by the cipher
1577− * handle.
1578− */
1579−static inline void crypto_blkcipher_set_iv(struct crypto_blkcipher *tfm,
1580− const u8 *src, unsigned int len)
1581−{
1582− memcpy(crypto_blkcipher_crt(tfm)->iv, src, len);
1583−}
1584−
1585−/**
1586− * crypto_blkcipher_get_iv() - obtain IV from cipher
1587− * @tfm: cipher handle
1588− * @dst: buffer filled with the IV
1589− * @len: length of the buffer dst
1590− *
1591− * The caller can obtain the IV set for the block cipher referenced by the
1592− * cipher handle and store it into the user-provided buffer. If the buffer
1593− * has an insufficient space, the IV is truncated to fit the buffer.
1594− */
1595−static inline void crypto_blkcipher_get_iv(struct crypto_blkcipher *tfm,
1596− u8 *dst, unsigned int len)
1597−{
1598− memcpy(dst, crypto_blkcipher_crt(tfm)->iv, len);
1599−}
1600−
1601744 /**
1602745 * DOC: Single Block Cipher API
1603746 *
include/linux/dcache.h+5−0
@@ -440,6 +440,11 @@ static inline bool d_is_negative(const struct dentry *dentry) · 439 unmodified lines
440440 return d_is_miss(dentry);
441441 }
442442
443+static inline bool d_flags_negative(unsigned flags)
444+{
445+ return (flags & DCACHE_ENTRY_TYPE) == DCACHE_MISS_TYPE;
446+}
447+
443448 static inline bool d_is_positive(const struct dentry *dentry)
444449 {
445450 return !d_is_negative(dentry);
include/linux/debugfs.h+63−73
@@ -54,6 +54,8 @@ static const struct file_operations __fops = { \ · 53 unmodified lines
5454 .llseek = no_llseek, \
5555 }
5656
57+typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
58+
5759 #if defined(CONFIG_DEBUG_FS)
5860
5961 struct dentry *debugfs_lookup(const char *name, struct dentry *parent);
@@ -75,7 +77,6 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); · 15 unmodified lines
7577 struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
7678 const char *dest);
7779
78−typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
7980 struct dentry *debugfs_create_automount(const char *name,
8081 struct dentry *parent,
8182 debugfs_automount_t f,
@@ -97,28 +98,28 @@ ssize_t debugfs_attr_write(struct file *file, const char __user *buf, · 15 unmodified lines
9798 struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
9899 struct dentry *new_dir, const char *new_name);
99100
100−struct dentry *debugfs_create_u8(const char *name, umode_t mode,
101− struct dentry *parent, u8 *value);
102−struct dentry *debugfs_create_u16(const char *name, umode_t mode,
103− struct dentry *parent, u16 *value);
101+void debugfs_create_u8(const char *name, umode_t mode, struct dentry *parent,
102+ u8 *value);
103+void debugfs_create_u16(const char *name, umode_t mode, struct dentry *parent,
104+ u16 *value);
104105 struct dentry *debugfs_create_u32(const char *name, umode_t mode,
105106 struct dentry *parent, u32 *value);
106−struct dentry *debugfs_create_u64(const char *name, umode_t mode,
107− struct dentry *parent, u64 *value);
107+void debugfs_create_u64(const char *name, umode_t mode, struct dentry *parent,
108+ u64 *value);
108109 struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
109110 struct dentry *parent, unsigned long *value);
110−struct dentry *debugfs_create_x8(const char *name, umode_t mode,
111− struct dentry *parent, u8 *value);
112−struct dentry *debugfs_create_x16(const char *name, umode_t mode,
113− struct dentry *parent, u16 *value);
114−struct dentry *debugfs_create_x32(const char *name, umode_t mode,
115− struct dentry *parent, u32 *value);
116−struct dentry *debugfs_create_x64(const char *name, umode_t mode,
117− struct dentry *parent, u64 *value);
118−struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
119− struct dentry *parent, size_t *value);
120−struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode,
121− struct dentry *parent, atomic_t *value);
111+void debugfs_create_x8(const char *name, umode_t mode, struct dentry *parent,
112+ u8 *value);
113+void debugfs_create_x16(const char *name, umode_t mode, struct dentry *parent,
114+ u16 *value);
115+void debugfs_create_x32(const char *name, umode_t mode, struct dentry *parent,
116+ u32 *value);
117+void debugfs_create_x64(const char *name, umode_t mode, struct dentry *parent,
118+ u64 *value);
119+void debugfs_create_size_t(const char *name, umode_t mode,
120+ struct dentry *parent, size_t *value);
121+void debugfs_create_atomic_t(const char *name, umode_t mode,
122+ struct dentry *parent, atomic_t *value);
122123 struct dentry *debugfs_create_bool(const char *name, umode_t mode,
123124 struct dentry *parent, bool *value);
124125
@@ -203,7 +204,7 @@ static inline struct dentry *debugfs_create_symlink(const char *name, · 78 unmodified lines
203204
204205 static inline struct dentry *debugfs_create_automount(const char *name,
205206 struct dentry *parent,
206− struct vfsmount *(*f)(void *),
207+ debugfs_automount_t f,
207208 void *data)
208209 {
209210 return ERR_PTR(-ENODEV);
@@ -244,19 +245,11 @@ static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentr · 34 unmodified lines
244245 return ERR_PTR(-ENODEV);
245246 }
246247
247−static inline struct dentry *debugfs_create_u8(const char *name, umode_t mode,
248− struct dentry *parent,
249− u8 *value)
250−{
251− return ERR_PTR(-ENODEV);
252−}
248+static inline void debugfs_create_u8(const char *name, umode_t mode,
249+ struct dentry *parent, u8 *value) { }
253250
254−static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode,
255− struct dentry *parent,
256− u16 *value)
257−{
258− return ERR_PTR(-ENODEV);
259−}
251+static inline void debugfs_create_u16(const char *name, umode_t mode,
252+ struct dentry *parent, u16 *value) { }
260253
261254 static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,
262255 struct dentry *parent,
@@ -265,12 +258,8 @@ static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode, · 2 unmodified lines
265258 return ERR_PTR(-ENODEV);
266259 }
267260
268−static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode,
269− struct dentry *parent,
270− u64 *value)
271−{
272− return ERR_PTR(-ENODEV);
273−}
261+static inline void debugfs_create_u64(const char *name, umode_t mode,
262+ struct dentry *parent, u64 *value) { }
274263
275264 static inline struct dentry *debugfs_create_ulong(const char *name,
276265 umode_t mode,
@@ -280,46 +269,26 @@ static inline struct dentry *debugfs_create_ulong(const char *name, · 3 unmodified lines
280269 return ERR_PTR(-ENODEV);
281270 }
282271
283−static inline struct dentry *debugfs_create_x8(const char *name, umode_t mode,
284− struct dentry *parent,
285− u8 *value)
286−{
287− return ERR_PTR(-ENODEV);
288−}
272+static inline void debugfs_create_x8(const char *name, umode_t mode,
273+ struct dentry *parent, u8 *value) { }
289274
290−static inline struct dentry *debugfs_create_x16(const char *name, umode_t mode,
291− struct dentry *parent,
292− u16 *value)
293−{
294− return ERR_PTR(-ENODEV);
295−}
275+static inline void debugfs_create_x16(const char *name, umode_t mode,
276+ struct dentry *parent, u16 *value) { }
296277
297−static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode,
298− struct dentry *parent,
299− u32 *value)
300−{
301− return ERR_PTR(-ENODEV);
302−}
278+static inline void debugfs_create_x32(const char *name, umode_t mode,
279+ struct dentry *parent, u32 *value) { }
303280
304−static inline struct dentry *debugfs_create_x64(const char *name, umode_t mode,
305− struct dentry *parent,
306− u64 *value)
307−{
308− return ERR_PTR(-ENODEV);
309−}
281+static inline void debugfs_create_x64(const char *name, umode_t mode,
282+ struct dentry *parent, u64 *value) { }
310283
311−static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
312− struct dentry *parent,
313− size_t *value)
314−{
315− return ERR_PTR(-ENODEV);
316−}
284+static inline void debugfs_create_size_t(const char *name, umode_t mode,
285+ struct dentry *parent, size_t *value)
286+{ }
317287
318−static inline struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode,
319− struct dentry *parent, atomic_t *value)
320−{
321− return ERR_PTR(-ENODEV);
322−}
288+static inline void debugfs_create_atomic_t(const char *name, umode_t mode,
289+ struct dentry *parent,
290+ atomic_t *value)
291+{ }
323292
324293 static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode,
325294 struct dentry *parent,
@@ -383,4 +352,25 @@ static inline ssize_t debugfs_write_file_bool(struct file *file, · 57 unmodified lines
383352
384353 #endif
385354
355+/**
356+ * debugfs_create_xul - create a debugfs file that is used to read and write an
357+ * unsigned long value, formatted in hexadecimal
358+ * @name: a pointer to a string containing the name of the file to create.
359+ * @mode: the permission that the file should have
360+ * @parent: a pointer to the parent dentry for this file. This should be a
361+ * directory dentry if set. If this parameter is %NULL, then the
362+ * file will be created in the root of the debugfs filesystem.
363+ * @value: a pointer to the variable that the file should read to and write
364+ * from.
365+ */
366+static inline void debugfs_create_xul(const char *name, umode_t mode,
367+ struct dentry *parent,
368+ unsigned long *value)
369+{
370+ if (sizeof(*value) == sizeof(u32))
371+ debugfs_create_x32(name, mode, parent, (u32 *)value);
372+ else
373+ debugfs_create_x64(name, mode, parent, (u64 *)value);
374+}
375+
386376 #endif
include/linux/devfreq.h+10−4
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/device.h>
1414 #include <linux/notifier.h>
1515 #include <linux/pm_opp.h>
16+#include <linux/pm_qos.h>
1617
1718 #define DEVFREQ_NAME_LEN 16
1819
@@ -123,8 +124,8 @@ struct devfreq_dev_profile { · 104 unmodified lines
123124 * @previous_freq: previously configured frequency value.
124125 * @data: Private data of the governor. The devfreq framework does not
125126 * touch this.
126− * @min_freq: Limit minimum frequency requested by user (0: none)
127− * @max_freq: Limit maximum frequency requested by user (0: none)
127+ * @user_min_freq_req: PM QoS minimum frequency request from user (via sysfs)
128+ * @user_max_freq_req: PM QoS maximum frequency request from user (via sysfs)
128129 * @scaling_min_freq: Limit minimum frequency requested by OPP interface
129130 * @scaling_max_freq: Limit maximum frequency requested by OPP interface
130131 * @stop_polling: devfreq polling status of a device.
@@ -136,6 +137,8 @@ struct devfreq_dev_profile { · 5 unmodified lines
136137 * @time_in_state: Statistics of devfreq states
137138 * @last_stat_updated: The last time stat updated
138139 * @transition_notifier_list: list head of DEVFREQ_TRANSITION_NOTIFIER notifier
140+ * @nb_min: Notifier block for DEV_PM_QOS_MIN_FREQUENCY
141+ * @nb_max: Notifier block for DEV_PM_QOS_MAX_FREQUENCY
139142 *
140143 * This structure stores the devfreq information for a give device.
141144 *
@@ -161,8 +164,8 @@ struct devfreq { · 19 unmodified lines
161164
162165 void *data; /* private data for governors */
163166
164− unsigned long min_freq;
165− unsigned long max_freq;
167+ struct dev_pm_qos_request user_min_freq_req;
168+ struct dev_pm_qos_request user_max_freq_req;
166169 unsigned long scaling_min_freq;
167170 unsigned long scaling_max_freq;
168171 bool stop_polling;
@@ -178,6 +181,9 @@ struct devfreq { · 9 unmodified lines
178181 unsigned long last_stat_updated;
179182
180183 struct srcu_notifier_head transition_notifier_list;
184+
185+ struct notifier_block nb_min;
186+ struct notifier_block nb_max;
181187 };
182188
183189 struct devfreq_freqs {
include/linux/device-mapper.h+19−8
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 struct dm_dev;
1818 struct dm_target;
1919 struct dm_table;
20+struct dm_report_zones_args;
2021 struct mapped_device;
2122 struct bio_vec;
2223
@@ -93,9 +94,9 @@ typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv, · 70 unmodified lines
9394
9495 typedef int (*dm_prepare_ioctl_fn) (struct dm_target *ti, struct block_device **bdev);
9596
96−typedef int (*dm_report_zones_fn) (struct dm_target *ti, sector_t sector,
97− struct blk_zone *zones,
98− unsigned int *nr_zones);
97+typedef int (*dm_report_zones_fn) (struct dm_target *ti,
98+ struct dm_report_zones_args *args,
99+ unsigned int nr_zones);
99100
100101 /*
101102 * These iteration functions are typically used to check (and combine)
@@ -422,10 +423,23 @@ struct gendisk *dm_disk(struct mapped_device *md); · 320 unmodified lines
422423 int dm_suspended(struct dm_target *ti);
423424 int dm_noflush_suspending(struct dm_target *ti);
424425 void dm_accept_partial_bio(struct bio *bio, unsigned n_sectors);
425−void dm_remap_zone_report(struct dm_target *ti, sector_t start,
426− struct blk_zone *zones, unsigned int *nr_zones);
427426 union map_info *dm_get_rq_mapinfo(struct request *rq);
428427
428+#ifdef CONFIG_BLK_DEV_ZONED
429+struct dm_report_zones_args {
430+ struct dm_target *tgt;
431+ sector_t next_sector;
432+
433+ void *orig_data;
434+ report_zones_cb orig_cb;
435+ unsigned int zone_idx;
436+
437+ /* must be filled by ->report_zones before calling dm_report_zones_cb */
438+ sector_t start;
439+};
440+int dm_report_zones_cb(struct blk_zone *zone, unsigned int idx, void *data);
441+#endif /* CONFIG_BLK_DEV_ZONED */
442+
429443 /*
430444 * Device mapper functions to parse and create devices specified by the
431445 * parameter "dm-mod.create="
@@ -594,9 +608,6 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); · 162 unmodified lines
594608 */
595609 #define dm_round_up(n, sz) (dm_div_up((n), (sz)) * (sz))
596610
597−#define dm_array_too_big(fixed, obj, num) \
598− ((num) > (UINT_MAX - (fixed)) / (obj))
599−
600611 /*
601612 * Sector offset taken relative to the start of the target instead of
602613 * relative to the start of the device.
include/linux/device.h+38−5
@@ -80,6 +80,13 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); · 79 unmodified lines
8080 * that generate uevents to add the environment variables.
8181 * @probe: Called when a new device or driver add to this bus, and callback
8282 * the specific driver's probe to initial the matched device.
83+ * @sync_state: Called to sync device state to software state after all the
84+ * state tracking consumers linked to this device (present at
85+ * the time of late_initcall) have successfully bound to a
86+ * driver. If the device has no consumers, this function will
87+ * be called at late_initcall_sync level. If the device has
88+ * consumers that are never bound to a driver, this function
89+ * will never get called until they do.
8390 * @remove: Called when a device removed from this bus.
8491 * @shutdown: Called at shut-down time to quiesce the device.
8592 *
@@ -123,6 +130,7 @@ struct bus_type { · 37 unmodified lines
123130 int (*match)(struct device *dev, struct device_driver *drv);
124131 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
125132 int (*probe)(struct device *dev);
133+ void (*sync_state)(struct device *dev);
126134 int (*remove)(struct device *dev);
127135 void (*shutdown)(struct device *dev);
128136
@@ -340,6 +348,13 @@ enum probe_type { · 211 unmodified lines
340348 * @probe: Called to query the existence of a specific device,
341349 * whether this driver can work with it, and bind the driver
342350 * to a specific device.
351+ * @sync_state: Called to sync device state to software state after all the
352+ * state tracking consumers linked to this device (present at
353+ * the time of late_initcall) have successfully bound to a
354+ * driver. If the device has no consumers, this function will
355+ * be called at late_initcall_sync level. If the device has
356+ * consumers that are never bound to a driver, this function
357+ * will never get called until they do.
343358 * @remove: Called when the device is removed from the system to
344359 * unbind a device from this driver.
345360 * @shutdown: Called at shut-down time to quiesce the device.
@@ -379,6 +394,7 @@ struct device_driver { · 33 unmodified lines
379394 const struct acpi_device_id *acpi_match_table;
380395
381396 int (*probe) (struct device *dev);
397+ void (*sync_state)(struct device *dev);
382398 int (*remove) (struct device *dev);
383399 void (*shutdown) (struct device *dev);
384400 int (*suspend) (struct device *dev, pm_message_t state);
@@ -946,6 +962,8 @@ extern void devm_free_pages(struct device *dev, unsigned long addr); · 561 unmodified lines
946962
947963 void __iomem *devm_ioremap_resource(struct device *dev,
948964 const struct resource *res);
965+void __iomem *devm_ioremap_resource_wc(struct device *dev,
966+ const struct resource *res);
949967
950968 void __iomem *devm_of_iomap(struct device *dev,
951969 struct device_node *node, int index,
@@ -1080,6 +1098,7 @@ enum device_link_state { · 128 unmodified lines
10801098 * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
10811099 * AUTOPROBE_CONSUMER: Probe consumer driver automatically after supplier binds.
10821100 * MANAGED: The core tracks presence of supplier/consumer drivers (internal).
1101+ * SYNC_STATE_ONLY: Link only affects sync_state() behavior.
10831102 */
10841103 #define DL_FLAG_STATELESS BIT(0)
10851104 #define DL_FLAG_AUTOREMOVE_CONSUMER BIT(1)
@@ -1088,6 +1107,7 @@ enum device_link_state { · 2 unmodified lines
10881107 #define DL_FLAG_AUTOREMOVE_SUPPLIER BIT(4)
10891108 #define DL_FLAG_AUTOPROBE_CONSUMER BIT(5)
10901109 #define DL_FLAG_MANAGED BIT(6)
1110+#define DL_FLAG_SYNC_STATE_ONLY BIT(7)
10911111
10921112 /**
10931113 * struct device_link - Device link representation.
@@ -1135,11 +1155,18 @@ enum dl_dev_state { · 41 unmodified lines
11351155 * struct dev_links_info - Device data related to device links.
11361156 * @suppliers: List of links to supplier devices.
11371157 * @consumers: List of links to consumer devices.
1158+ * @needs_suppliers: Hook to global list of devices waiting for suppliers.
1159+ * @defer_sync: Hook to global list of devices that have deferred sync_state.
1160+ * @need_for_probe: If needs_suppliers is on a list, this indicates if the
1161+ * suppliers are needed for probe or not.
11381162 * @status: Driver status information.
11391163 */
11401164 struct dev_links_info {
11411165 struct list_head suppliers;
11421166 struct list_head consumers;
1167+ struct list_head needs_suppliers;
1168+ struct list_head defer_sync;
1169+ bool need_for_probe;
11431170 enum dl_dev_state status;
11441171 };
11451172
@@ -1186,8 +1213,8 @@ struct dev_links_info { · 40 unmodified lines
11861213 * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all
11871214 * hardware supports 64-bit addresses for consistent allocations
11881215 * such descriptors.
1189− * @bus_dma_mask: Mask of an upstream bridge or bus which imposes a smaller DMA
1190− * limit than the device itself supports.
1216+ * @bus_dma_limit: Limit of an upstream bridge or bus which imposes a smaller
1217+ * DMA limit than the device itself supports.
11911218 * @dma_pfn_offset: offset of DMA memory range relatively of RAM
11921219 * @dma_parms: A low level driver may set these to teach IOMMU code about
11931220 * segment limitations.
@@ -1215,6 +1242,9 @@ struct dev_links_info { · 21 unmodified lines
12151242 * @offline: Set after successful invocation of bus type's .offline().
12161243 * @of_node_reused: Set if the device-tree node is shared with an ancestor
12171244 * device.
1245+ * @state_synced: The hardware state of this device has been synced to match
1246+ * the software state of this device by calling the driver/bus
1247+ * sync_state() callback.
12181248 * @dma_coherent: this particular device is dma coherent, even if the
12191249 * architecture supports non-coherent devices.
12201250 *
@@ -1270,7 +1300,7 @@ struct device { · 49 unmodified lines
12701300 not all hardware supports
12711301 64 bit addresses for consistent
12721302 allocations such descriptors. */
1273− u64 bus_dma_mask; /* upstream dma_mask constraint */
1303+ u64 bus_dma_limit; /* upstream dma constraint */
12741304 unsigned long dma_pfn_offset;
12751305
12761306 struct device_dma_parameters *dma_parms;
@@ -1311,6 +1341,7 @@ struct device { · 34 unmodified lines
13111341 bool offline_disabled:1;
13121342 bool offline:1;
13131343 bool of_node_reused:1;
1344+ bool state_synced:1;
13141345 #if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
13151346 defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \
13161347 defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
@@ -1635,11 +1666,11 @@ extern bool kill_device(struct device *dev); · 318 unmodified lines
16351666 #ifdef CONFIG_DEVTMPFS
16361667 extern int devtmpfs_create_node(struct device *dev);
16371668 extern int devtmpfs_delete_node(struct device *dev);
1638−extern int devtmpfs_mount(const char *mntdir);
1669+extern int devtmpfs_mount(void);
16391670 #else
16401671 static inline int devtmpfs_create_node(struct device *dev) { return 0; }
16411672 static inline int devtmpfs_delete_node(struct device *dev) { return 0; }
1642−static inline int devtmpfs_mount(const char *mountpoint) { return 0; }
1673+static inline int devtmpfs_mount(void) { return 0; }
16431674 #endif
16441675
16451676 /* drivers/base/power/shutdown.c */
@@ -1653,6 +1684,8 @@ struct device_link *device_link_add(struct device *consumer, · 7 unmodified lines
16531684 struct device *supplier, u32 flags);
16541685 void device_link_del(struct device_link *link);
16551686 void device_link_remove(void *consumer, struct device *supplier);
1687+void device_links_supplier_sync_state_pause(void);
1688+void device_links_supplier_sync_state_resume(void);
16561689
16571690 #ifndef dev_fmt
16581691 #define dev_fmt(fmt) fmt
include/linux/device_cgroup.h+4−15
@@ -12,26 +12,15 @@ · 11 unmodified lines
1212 #define DEVCG_DEV_ALL 4 /* this represents all devices */
1313
1414 #ifdef CONFIG_CGROUP_DEVICE
15−extern int __devcgroup_check_permission(short type, u32 major, u32 minor,
16− short access);
15+int devcgroup_check_permission(short type, u32 major, u32 minor,
16+ short access);
1717 #else
18−static inline int __devcgroup_check_permission(short type, u32 major, u32 minor,
19− short access)
18+static inline int devcgroup_check_permission(short type, u32 major, u32 minor,
19+ short access)
2020 { return 0; }
2121 #endif
2222
2323 #if defined(CONFIG_CGROUP_DEVICE) || defined(CONFIG_CGROUP_BPF)
24−static inline int devcgroup_check_permission(short type, u32 major, u32 minor,
25− short access)
26−{
27− int rc = BPF_CGROUP_RUN_PROG_DEVICE_CGROUP(type, major, minor, access);
28−
29− if (rc)
30− return -EPERM;
31−
32− return __devcgroup_check_permission(type, major, minor, access);
33−}
34−
3524 static inline int devcgroup_inode_permission(struct inode *inode, int mask)
3625 {
3726 short type, access = 0;
include/linux/dim.h+33−30
@@ -4,22 +4,26 @@ · 3 unmodified lines
44 #ifndef DIM_H
55 #define DIM_H
66
7+#include <linux/bits.h>
8+#include <linux/kernel.h>
79 #include <linux/module.h>
10+#include <linux/types.h>
11+#include <linux/workqueue.h>
812
9−/**
13+/*
1014 * Number of events between DIM iterations.
1115 * Causes a moderation of the algorithm run.
1216 */
1317 #define DIM_NEVENTS 64
1418
15−/**
19+/*
1620 * Is a difference between values justifies taking an action.
1721 * We consider 10% difference as significant.
1822 */
1923 #define IS_SIGNIFICANT_DIFF(val, ref) \
2024 (((100UL * abs((val) - (ref))) / (ref)) > 10)
2125
22−/**
26+/*
2327 * Calculate the gap between two values.
2428 * Take wrap-around and variable size into consideration.
2529 */
@@ -27,12 +31,13 @@ · 1 unmodified line
2731 & (BIT_ULL(bits) - 1))
2832
2933 /**
30− * Structure for CQ moderation values.
34+ * struct dim_cq_moder - Structure for CQ moderation values.
3135 * Used for communications between DIM and its consumer.
3236 *
3337 * @usec: CQ timer suggestion (by DIM)
3438 * @pkts: CQ packet counter suggestion (by DIM)
35− * @cq_period_mode: CQ priod count mode (from CQE/EQE)
39+ * @comps: Completion counter
40+ * @cq_period_mode: CQ period count mode (from CQE/EQE)
3641 */
3742 struct dim_cq_moder {
3843 u16 usec;
@@ -42,13 +47,14 @@ struct dim_cq_moder { · 3 unmodified lines
4247 };
4348
4449 /**
45− * Structure for DIM sample data.
50+ * struct dim_sample - Structure for DIM sample data.
4651 * Used for communications between DIM and its consumer.
4752 *
4853 * @time: Sample timestamp
4954 * @pkt_ctr: Number of packets
5055 * @byte_ctr: Number of bytes
5156 * @event_ctr: Number of events
57+ * @comp_ctr: Current completion counter
5258 */
5359 struct dim_sample {
5460 ktime_t time;
@@ -59,12 +65,14 @@ struct dim_sample { · 4 unmodified lines
5965 };
6066
6167 /**
62− * Structure for DIM stats.
68+ * struct dim_stats - Structure for DIM stats.
6369 * Used for holding current measured rates.
6470 *
6571 * @ppms: Packets per msec
6672 * @bpms: Bytes per msec
6773 * @epms: Events per msec
74+ * @cpms: Completions per msec
75+ * @cpe_ratio: Ratio of completions to events
6876 */
6977 struct dim_stats {
7078 int ppms; /* packets per msec */
@@ -75,12 +83,13 @@ struct dim_stats { · 4 unmodified lines
7583 };
7684
7785 /**
78− * Main structure for dynamic interrupt moderation (DIM).
86+ * struct dim - Main structure for dynamic interrupt moderation (DIM).
7987 * Used for holding all information about a specific DIM instance.
8088 *
8189 * @state: Algorithm state (see below)
8290 * @prev_stats: Measured rates from previous iteration (for comparison)
8391 * @start_sample: Sampled data at start of current iteration
92+ * @measuring_sample: A &dim_sample that is used to update the current events
8493 * @work: Work to perform on action required
8594 * @priv: A pointer to the struct that points to dim
8695 * @profile_ix: Current moderation profile
@@ -106,24 +115,21 @@ struct dim { · 19 unmodified lines
106115 };
107116
108117 /**
109− * enum dim_cq_period_mode
110− *
111− * These are the modes for CQ period count.
118+ * enum dim_cq_period_mode - Modes for CQ period count
112119 *
113120 * @DIM_CQ_PERIOD_MODE_START_FROM_EQE: Start counting from EQE
114121 * @DIM_CQ_PERIOD_MODE_START_FROM_CQE: Start counting from CQE (implies timer reset)
115122 * @DIM_CQ_PERIOD_NUM_MODES: Number of modes
116123 */
117−enum {
124+enum dim_cq_period_mode {
118125 DIM_CQ_PERIOD_MODE_START_FROM_EQE = 0x0,
119126 DIM_CQ_PERIOD_MODE_START_FROM_CQE = 0x1,
120127 DIM_CQ_PERIOD_NUM_MODES
121128 };
122129
123130 /**
124− * enum dim_state
131+ * enum dim_state - DIM algorithm states
125132 *
126− * These are the DIM algorithm states.
127133 * These will determine if the algorithm is in a valid state to start an iteration.
128134 *
129135 * @DIM_START_MEASURE: This is the first iteration (also after applying a new profile)
@@ -131,16 +137,15 @@ enum { · 1 unmodified line
131137 * need to perform an action
132138 * @DIM_APPLY_NEW_PROFILE: DIM consumer is currently applying a profile - no need to measure
133139 */
134−enum {
140+enum dim_state {
135141 DIM_START_MEASURE,
136142 DIM_MEASURE_IN_PROGRESS,
137143 DIM_APPLY_NEW_PROFILE,
138144 };
139145
140146 /**
141− * enum dim_tune_state
147+ * enum dim_tune_state - DIM algorithm tune states
142148 *
143− * These are the DIM algorithm tune states.
144149 * These will determine which action the algorithm should perform.
145150 *
146151 * @DIM_PARKING_ON_TOP: Algorithm found a local top point - exit on significant difference
@@ -148,7 +153,7 @@ enum { · 1 unmodified line
148153 * @DIM_GOING_RIGHT: Algorithm is currently trying higher moderation levels
149154 * @DIM_GOING_LEFT: Algorithm is currently trying lower moderation levels
150155 */
151−enum {
156+enum dim_tune_state {
152157 DIM_PARKING_ON_TOP,
153158 DIM_PARKING_TIRED,
154159 DIM_GOING_RIGHT,
@@ -156,25 +161,23 @@ enum { · 1 unmodified line
156161 };
157162
158163 /**
159− * enum dim_stats_state
164+ * enum dim_stats_state - DIM algorithm statistics states
160165 *
161− * These are the DIM algorithm statistics states.
162166 * These will determine the verdict of current iteration.
163167 *
164168 * @DIM_STATS_WORSE: Current iteration shows worse performance than before
165− * @DIM_STATS_WORSE: Current iteration shows same performance than before
166− * @DIM_STATS_WORSE: Current iteration shows better performance than before
169+ * @DIM_STATS_SAME: Current iteration shows same performance than before
170+ * @DIM_STATS_BETTER: Current iteration shows better performance than before
167171 */
168−enum {
172+enum dim_stats_state {
169173 DIM_STATS_WORSE,
170174 DIM_STATS_SAME,
171175 DIM_STATS_BETTER,
172176 };
173177
174178 /**
175− * enum dim_step_result
179+ * enum dim_step_result - DIM algorithm step results
176180 *
177− * These are the DIM algorithm step results.
178181 * These describe the result of a step.
179182 *
180183 * @DIM_STEPPED: Performed a regular step
@@ -182,7 +185,7 @@ enum { · 1 unmodified line
182185 * tired parking
183186 * @DIM_ON_EDGE: Stepped to the most left/right profile
184187 */
185−enum {
188+enum dim_step_result {
186189 DIM_STEPPED,
187190 DIM_TOO_TIRED,
188191 DIM_ON_EDGE,
@@ -199,7 +202,7 @@ enum { · 10 unmodified lines
199202 bool dim_on_top(struct dim *dim);
200203
201204 /**
202− * dim_turn - change profile alterning direction
205+ * dim_turn - change profile altering direction
203206 * @dim: DIM context
204207 *
205208 * Go left if we were going right and vice-versa.
@@ -238,7 +241,7 @@ void dim_calc_stats(struct dim_sample *start, struct dim_sample *end, · 32 unmodified lines
238241 struct dim_stats *curr_stats);
239242
240243 /**
241− * dim_update_sample - set a sample's fields with give values
244+ * dim_update_sample - set a sample's fields with given values
242245 * @event_ctr: number of events to set
243246 * @packets: number of packets to set
244247 * @bytes: number of bytes to set
@@ -304,8 +307,8 @@ struct dim_cq_moder net_dim_get_def_tx_moderation(u8 cq_period_mode); · 59 unmodified lines
304307 * @end_sample: Current data measurement
305308 *
306309 * Called by the consumer.
307− * This is the main logic of the algorithm, where data is processed in order to decide on next
308− * required action.
310+ * This is the main logic of the algorithm, where data is processed in order
311+ * to decide on next required action.
309312 */
310313 void net_dim(struct dim *dim, struct dim_sample end_sample);
311314
include/linux/dma-buf.h+57−6
@@ -42,6 +42,18 @@ struct dma_buf_ops { · 41 unmodified lines
4242 */
4343 bool cache_sgt_mapping;
4444
45+ /**
46+ * @dynamic_mapping:
47+ *
48+ * If true the framework makes sure that the map/unmap_dma_buf
49+ * callbacks are always called with the dma_resv object locked.
50+ *
51+ * If false the framework makes sure that the map/unmap_dma_buf
52+ * callbacks are always called without the dma_resv object locked.
53+ * Mutual exclusive with @cache_sgt_mapping.
54+ */
55+ bool dynamic_mapping;
56+
4557 /**
4658 * @attach:
4759 *
@@ -109,6 +121,9 @@ struct dma_buf_ops { · 61 unmodified lines
109121 * any other kind of sharing that the exporter might wish to make
110122 * available to buffer-users.
111123 *
124+ * This is always called with the dmabuf->resv object locked when
125+ * the dynamic_mapping flag is true.
126+ *
112127 * Returns:
113128 *
114129 * A &sg_table scatter list of or the backing storage of the DMA buffer,
@@ -267,14 +282,16 @@ struct dma_buf_ops { · 152 unmodified lines
267282 * struct dma_buf - shared buffer object
268283 * @size: size of the buffer
269284 * @file: file pointer used for sharing buffers across, and for refcounting.
270− * @attachments: list of dma_buf_attachment that denotes all devices attached.
285+ * @attachments: list of dma_buf_attachment that denotes all devices attached,
286+ * protected by dma_resv lock.
271287 * @ops: dma_buf_ops associated with this buffer object.
272288 * @lock: used internally to serialize list manipulation, attach/detach and
273− * vmap/unmap, and accesses to name
289+ * vmap/unmap
274290 * @vmapping_counter: used internally to refcnt the vmaps
275291 * @vmap_ptr: the current vmap ptr if vmapping_counter > 0
276292 * @exp_name: name of the exporter; useful for debugging.
277− * @name: userspace-provided name; useful for accounting and debugging.
293+ * @name: userspace-provided name; useful for accounting and debugging,
294+ * protected by @resv.
278295 * @owner: pointer to exporter module; used for refcounting when exporter is a
279296 * kernel module.
280297 * @list_node: node for dma_buf accounting and debugging.
@@ -323,10 +340,12 @@ struct dma_buf { · 42 unmodified lines
323340 * struct dma_buf_attachment - holds device-buffer attachment data
324341 * @dmabuf: buffer for this attachment.
325342 * @dev: device attached to the buffer.
326− * @node: list of dma_buf_attachment.
343+ * @node: list of dma_buf_attachment, protected by dma_resv lock of the dmabuf.
327344 * @sgt: cached mapping.
328345 * @dir: direction of cached mapping.
329346 * @priv: exporter specific attachment data.
347+ * @dynamic_mapping: true if dma_buf_map/unmap_attachment() is called with the
348+ * dma_resv lock held.
330349 *
331350 * This structure holds the attachment information between the dma_buf buffer
332351 * and its user device(s). The list contains one attachment struct per device
@@ -343,6 +362,7 @@ struct dma_buf_attachment { · 10 unmodified lines
343362 struct list_head node;
344363 struct sg_table *sgt;
345364 enum dma_data_direction dir;
365+ bool dynamic_mapping;
346366 void *priv;
347367 };
348368
@@ -394,10 +414,40 @@ static inline void get_dma_buf(struct dma_buf *dmabuf) · 45 unmodified lines
394414 get_file(dmabuf->file);
395415 }
396416
417+/**
418+ * dma_buf_is_dynamic - check if a DMA-buf uses dynamic mappings.
419+ * @dmabuf: the DMA-buf to check
420+ *
421+ * Returns true if a DMA-buf exporter wants to be called with the dma_resv
422+ * locked for the map/unmap callbacks, false if it doesn't wants to be called
423+ * with the lock held.
424+ */
425+static inline bool dma_buf_is_dynamic(struct dma_buf *dmabuf)
426+{
427+ return dmabuf->ops->dynamic_mapping;
428+}
429+
430+/**
431+ * dma_buf_attachment_is_dynamic - check if a DMA-buf attachment uses dynamic
432+ * mappinsg
433+ * @attach: the DMA-buf attachment to check
434+ *
435+ * Returns true if a DMA-buf importer wants to call the map/unmap functions with
436+ * the dma_resv lock held.
437+ */
438+static inline bool
439+dma_buf_attachment_is_dynamic(struct dma_buf_attachment *attach)
440+{
441+ return attach->dynamic_mapping;
442+}
443+
397444 struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
398− struct device *dev);
445+ struct device *dev);
446+struct dma_buf_attachment *
447+dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev,
448+ bool dynamic_mapping);
399449 void dma_buf_detach(struct dma_buf *dmabuf,
400− struct dma_buf_attachment *dmabuf_attach);
450+ struct dma_buf_attachment *attach);
401451
402452 struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info);
403453
@@ -409,6 +459,7 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *, · 5 unmodified lines
409459 enum dma_data_direction);
410460 void dma_buf_unmap_attachment(struct dma_buf_attachment *, struct sg_table *,
411461 enum dma_data_direction);
462+void dma_buf_move_notify(struct dma_buf *dma_buf);
412463 int dma_buf_begin_cpu_access(struct dma_buf *dma_buf,
413464 enum dma_data_direction dir);
414465 int dma_buf_end_cpu_access(struct dma_buf *dma_buf,
include/linux/dma-direct.h+26−11
@@ -3,8 +3,11 @@ · 2 unmodified lines
33 #define _LINUX_DMA_DIRECT_H 1
44
55 #include <linux/dma-mapping.h>
6+#include <linux/memblock.h> /* for min_low_pfn */
67 #include <linux/mem_encrypt.h>
78
9+extern unsigned int zone_dma_bits;
10+
811 #ifdef CONFIG_ARCH_HAS_PHYS_TO_DMA
912 #include <asm/dma-direct.h>
1013 #else
@@ -21,15 +24,6 @@ static inline phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dev_addr) · 10 unmodified lines
2124
2225 return paddr + ((phys_addr_t)dev->dma_pfn_offset << PAGE_SHIFT);
2326 }
24−
25−static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
26−{
27− if (!dev->dma_mask)
28− return false;
29−
30− return addr + size - 1 <=
31− min_not_zero(*dev->dma_mask, dev->bus_dma_mask);
32−}
3327 #endif /* !CONFIG_ARCH_HAS_PHYS_TO_DMA */
3428
3529 #ifdef CONFIG_ARCH_HAS_FORCE_DMA_UNENCRYPTED
@@ -57,6 +51,21 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr) · 21 unmodified lines
5751 return __sme_clr(__dma_to_phys(dev, daddr));
5852 }
5953
54+static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size,
55+ bool is_ram)
56+{
57+ dma_addr_t end = addr + size - 1;
58+
59+ if (!dev->dma_mask)
60+ return false;
61+
62+ if (is_ram && !IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT) &&
63+ min(addr, end) < phys_to_dma(dev, PFN_PHYS(min_low_pfn)))
64+ return false;
65+
66+ return end <= min_not_zero(*dev->dma_mask, dev->bus_dma_limit);
67+}
68+
6069 u64 dma_direct_get_required_mask(struct device *dev);
6170 void *dma_direct_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
6271 gfp_t gfp, unsigned long attrs);
@@ -67,7 +76,13 @@ void *dma_direct_alloc_pages(struct device *dev, size_t size, · 4 unmodified lines
6776 void dma_direct_free_pages(struct device *dev, size_t size, void *cpu_addr,
6877 dma_addr_t dma_addr, unsigned long attrs);
6978 struct page *__dma_direct_alloc_pages(struct device *dev, size_t size,
70− dma_addr_t *dma_handle, gfp_t gfp, unsigned long attrs);
71−void __dma_direct_free_pages(struct device *dev, size_t size, struct page *page);
79+ gfp_t gfp, unsigned long attrs);
80+int dma_direct_get_sgtable(struct device *dev, struct sg_table *sgt,
81+ void *cpu_addr, dma_addr_t dma_addr, size_t size,
82+ unsigned long attrs);
83+bool dma_direct_can_mmap(struct device *dev);
84+int dma_direct_mmap(struct device *dev, struct vm_area_struct *vma,
85+ void *cpu_addr, dma_addr_t dma_addr, size_t size,
86+ unsigned long attrs);
7287 int dma_direct_supported(struct device *dev, u64 mask);
7388 #endif /* _LINUX_DMA_DIRECT_H */
include/linux/dma-mapping.h+8−7
@@ -15,11 +15,8 @@ · 14 unmodified lines
1515 /**
1616 * List of possible attributes associated with a DMA mapping. The semantics
1717 * of each attribute should be defined in Documentation/DMA-attributes.txt.
18− *
19− * DMA_ATTR_WRITE_BARRIER: DMA to a memory region with this attribute
20− * forces all pending DMA writes to complete.
2118 */
22−#define DMA_ATTR_WRITE_BARRIER (1UL << 0)
19+
2320 /*
2421 * DMA_ATTR_WEAK_ORDERING: Specifies that reads and writes to the mapping
2522 * may be weakly ordered, that is that reads and writes may pass each other.
@@ -162,7 +159,7 @@ int dma_release_from_dev_coherent(struct device *dev, int order, void *vaddr); · 136 unmodified lines
162159 int dma_mmap_from_dev_coherent(struct device *dev, struct vm_area_struct *vma,
163160 void *cpu_addr, size_t size, int *ret);
164161
165−void *dma_alloc_from_global_coherent(ssize_t size, dma_addr_t *dma_handle);
162+void *dma_alloc_from_global_coherent(struct device *dev, ssize_t size, dma_addr_t *dma_handle);
166163 int dma_release_from_global_coherent(int order, void *vaddr);
167164 int dma_mmap_from_global_coherent(struct vm_area_struct *vma, void *cpu_addr,
168165 size_t size, int *ret);
@@ -172,7 +169,7 @@ int dma_mmap_from_global_coherent(struct vm_area_struct *vma, void *cpu_addr, · 3 unmodified lines
172169 #define dma_release_from_dev_coherent(dev, order, vaddr) (0)
173170 #define dma_mmap_from_dev_coherent(dev, vma, vaddr, order, ret) (0)
174171
175−static inline void *dma_alloc_from_global_coherent(ssize_t size,
172+static inline void *dma_alloc_from_global_coherent(struct device *dev, ssize_t size,
176173 dma_addr_t *dma_handle)
177174 {
178175 return NULL;
@@ -583,6 +580,10 @@ static inline unsigned long dma_get_merge_boundary(struct device *dev) · 404 unmodified lines
583580 static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
584581 size_t size, enum dma_data_direction dir, unsigned long attrs)
585582 {
583+ /* DMA must never operate on areas that might be remapped. */
584+ if (dev_WARN_ONCE(dev, is_vmalloc_addr(ptr),
585+ "rejecting DMA map of vmalloc memory\n"))
586+ return DMA_MAPPING_ERROR;
586587 debug_dma_map_single(dev, ptr, size);
587588 return dma_map_page_attrs(dev, virt_to_page(ptr), offset_in_page(ptr),
588589 size, dir, attrs);
@@ -693,7 +694,7 @@ static inline int dma_coerce_mask_and_coherent(struct device *dev, u64 mask) · 104 unmodified lines
693694 */
694695 static inline bool dma_addressing_limited(struct device *dev)
695696 {
696− return min_not_zero(dma_get_mask(dev), dev->bus_dma_mask) <
697+ return min_not_zero(dma_get_mask(dev), dev->bus_dma_limit) <
697698 dma_get_required_mask(dev);
698699 }
699700
include/linux/dma-noncoherent.h+10−12
@@ -41,8 +41,6 @@ void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, · 40 unmodified lines
4141 gfp_t gfp, unsigned long attrs);
4242 void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
4343 dma_addr_t dma_addr, unsigned long attrs);
44−long arch_dma_coherent_to_pfn(struct device *dev, void *cpu_addr,
45− dma_addr_t dma_addr);
4644
4745 #ifdef CONFIG_MMU
4846 /*
@@ -75,29 +73,29 @@ static inline void arch_dma_cache_sync(struct device *dev, void *vaddr, · 26 unmodified lines
7573 #endif /* CONFIG_DMA_NONCOHERENT_CACHE_SYNC */
7674
7775 #ifdef CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE
78−void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
79− size_t size, enum dma_data_direction dir);
76+void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
77+ enum dma_data_direction dir);
8078 #else
81−static inline void arch_sync_dma_for_device(struct device *dev,
82− phys_addr_t paddr, size_t size, enum dma_data_direction dir)
79+static inline void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
80+ enum dma_data_direction dir)
8381 {
8482 }
8583 #endif /* ARCH_HAS_SYNC_DMA_FOR_DEVICE */
8684
8785 #ifdef CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU
88−void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr,
89− size_t size, enum dma_data_direction dir);
86+void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
87+ enum dma_data_direction dir);
9088 #else
91−static inline void arch_sync_dma_for_cpu(struct device *dev,
92− phys_addr_t paddr, size_t size, enum dma_data_direction dir)
89+static inline void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
90+ enum dma_data_direction dir)
9391 {
9492 }
9593 #endif /* ARCH_HAS_SYNC_DMA_FOR_CPU */
9694
9795 #ifdef CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
98−void arch_sync_dma_for_cpu_all(struct device *dev);
96+void arch_sync_dma_for_cpu_all(void);
9997 #else
100−static inline void arch_sync_dma_for_cpu_all(struct device *dev)
98+static inline void arch_sync_dma_for_cpu_all(void)
10199 {
102100 }
103101 #endif /* CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL */
include/linux/dma/sprd-dma.h+4−0
@@ -118,6 +118,9 @@ enum sprd_dma_int_type { · 117 unmodified lines
118118 * struct sprd_dma_linklist - DMA link-list address structure
119119 * @virt_addr: link-list virtual address to configure link-list node
120120 * @phy_addr: link-list physical address to link DMA transfer
121+ * @wrap_addr: the wrap address for link-list mode, which means once the
122+ * transfer address reaches the wrap address, the next transfer address
123+ * will jump to the address specified by wrap_to register.
121124 *
122125 * The Spreadtrum DMA controller supports the link-list mode, that means slaves
123126 * can supply several groups configurations (each configuration represents one
@@ -181,6 +184,7 @@ enum sprd_dma_int_type { · 57 unmodified lines
181184 struct sprd_dma_linklist {
182185 unsigned long virt_addr;
183186 phys_addr_t phy_addr;
187+ phys_addr_t wrap_addr;
184188 };
185189
186190 #endif
include/linux/dmar.h+2−0
@@ -129,6 +129,7 @@ static inline int dmar_res_noop(struct acpi_dmar_header *hdr, void *arg) · 128 unmodified lines
129129 #ifdef CONFIG_INTEL_IOMMU
130130 extern int iommu_detected, no_iommu;
131131 extern int intel_iommu_init(void);
132+extern void intel_iommu_shutdown(void);
132133 extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg);
133134 extern int dmar_parse_one_atsr(struct acpi_dmar_header *header, void *arg);
134135 extern int dmar_check_one_atsr(struct acpi_dmar_header *hdr, void *arg);
@@ -137,6 +138,7 @@ extern int dmar_iommu_hotplug(struct dmar_drhd_unit *dmaru, bool insert); · 2 unmodified lines
137138 extern int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info);
138139 #else /* !CONFIG_INTEL_IOMMU: */
139140 static inline int intel_iommu_init(void) { return -ENODEV; }
141+static inline void intel_iommu_shutdown(void) { }
140142
141143 #define dmar_parse_one_rmrr dmar_res_noop
142144 #define dmar_parse_one_atsr dmar_res_noop
include/linux/dmi.h+4−0
@@ -113,6 +113,8 @@ extern int dmi_walk(void (*decode)(const struct dmi_header *, void *), · 112 unmodified lines
113113 extern bool dmi_match(enum dmi_field f, const char *str);
114114 extern void dmi_memdev_name(u16 handle, const char **bank, const char **device);
115115 extern u64 dmi_memdev_size(u16 handle);
116+extern u8 dmi_memdev_type(u16 handle);
117+extern u16 dmi_memdev_handle(int slot);
116118
117119 #else
118120
@@ -142,6 +144,8 @@ static inline bool dmi_match(enum dmi_field f, const char *str) · 23 unmodified lines
142144 static inline void dmi_memdev_name(u16 handle, const char **bank,
143145 const char **device) { }
144146 static inline u64 dmi_memdev_size(u16 handle) { return ~0ul; }
147+static inline u8 dmi_memdev_type(u16 handle) { return 0x0; }
148+static inline u16 dmi_memdev_handle(int slot) { return 0xffff; }
145149 static inline const struct dmi_system_id *
146150 dmi_first_match(const struct dmi_system_id *list) { return NULL; }
147151
include/linux/edac.h+68−78
@@ -362,78 +362,6 @@ struct edac_mc_layer { · 361 unmodified lines
362362 */
363363 #define EDAC_MAX_LAYERS 3
364364
365−/**
366− * EDAC_DIMM_OFF - Macro responsible to get a pointer offset inside a pointer
367− * array for the element given by [layer0,layer1,layer2]
368− * position
369− *
370− * @layers: a struct edac_mc_layer array, describing how many elements
371− * were allocated for each layer
372− * @nlayers: Number of layers at the @layers array
373− * @layer0: layer0 position
374− * @layer1: layer1 position. Unused if n_layers < 2
375− * @layer2: layer2 position. Unused if n_layers < 3
376− *
377− * For 1 layer, this macro returns "var[layer0] - var";
378− *
379− * For 2 layers, this macro is similar to allocate a bi-dimensional array
380− * and to return "var[layer0][layer1] - var";
381− *
382− * For 3 layers, this macro is similar to allocate a tri-dimensional array
383− * and to return "var[layer0][layer1][layer2] - var".
384− *
385− * A loop could be used here to make it more generic, but, as we only have
386− * 3 layers, this is a little faster.
387− *
388− * By design, layers can never be 0 or more than 3. If that ever happens,
389− * a NULL is returned, causing an OOPS during the memory allocation routine,
390− * with would point to the developer that he's doing something wrong.
391− */
392−#define EDAC_DIMM_OFF(layers, nlayers, layer0, layer1, layer2) ({ \
393− int __i; \
394− if ((nlayers) == 1) \
395− __i = layer0; \
396− else if ((nlayers) == 2) \
397− __i = (layer1) + ((layers[1]).size * (layer0)); \
398− else if ((nlayers) == 3) \
399− __i = (layer2) + ((layers[2]).size * ((layer1) + \
400− ((layers[1]).size * (layer0)))); \
401− else \
402− __i = -EINVAL; \
403− __i; \
404−})
405−
406−/**
407− * EDAC_DIMM_PTR - Macro responsible to get a pointer inside a pointer array
408− * for the element given by [layer0,layer1,layer2] position
409− *
410− * @layers: a struct edac_mc_layer array, describing how many elements
411− * were allocated for each layer
412− * @var: name of the var where we want to get the pointer
413− * (like mci->dimms)
414− * @nlayers: Number of layers at the @layers array
415− * @layer0: layer0 position
416− * @layer1: layer1 position. Unused if n_layers < 2
417− * @layer2: layer2 position. Unused if n_layers < 3
418− *
419− * For 1 layer, this macro returns "var[layer0]";
420− *
421− * For 2 layers, this macro is similar to allocate a bi-dimensional array
422− * and to return "var[layer0][layer1]";
423− *
424− * For 3 layers, this macro is similar to allocate a tri-dimensional array
425− * and to return "var[layer0][layer1][layer2]";
426− */
427−#define EDAC_DIMM_PTR(layers, var, nlayers, layer0, layer1, layer2) ({ \
428− typeof(*var) __p; \
429− int ___i = EDAC_DIMM_OFF(layers, nlayers, layer0, layer1, layer2); \
430− if (___i < 0) \
431− __p = NULL; \
432− else \
433− __p = (var)[___i]; \
434− __p; \
435−})
436−
437365 struct dimm_info {
438366 struct device dev;
439367
@@ -443,6 +371,7 @@ struct dimm_info { · 3 unmodified lines
443371 unsigned int location[EDAC_MAX_LAYERS];
444372
445373 struct mem_ctl_info *mci; /* the parent */
374+ unsigned int idx; /* index within the parent dimm array */
446375
447376 u32 grain; /* granularity of reported error in bytes */
448377 enum dev_type dtype; /* memory device type */
@@ -528,15 +457,10 @@ struct errcount_attribute_data { · 79 unmodified lines
528457 * (typically, a memory controller error)
529458 */
530459 struct edac_raw_error_desc {
531− /*
532− * NOTE: everything before grain won't be cleaned by
533− * edac_raw_error_desc_clean()
534− */
535460 char location[LOCATION_SIZE];
536461 char label[(EDAC_MC_LABEL_LEN + 1 + sizeof(OTHER_LABEL)) * EDAC_MAX_LABELS];
537462 long grain;
538463
539− /* the vars below and grain will be cleaned on every new error report */
540464 u16 error_count;
541465 int top_layer;
542466 int mid_layer;
@@ -669,4 +593,70 @@ struct mem_ctl_info { · 126 unmodified lines
669593 bool fake_inject_ue;
670594 u16 fake_inject_count;
671595 };
672−#endif
596+
597+#define mci_for_each_dimm(mci, dimm) \
598+ for ((dimm) = (mci)->dimms[0]; \
599+ (dimm); \
600+ (dimm) = (dimm)->idx + 1 < (mci)->tot_dimms \
601+ ? (mci)->dimms[(dimm)->idx + 1] \
602+ : NULL)
603+
604+/**
605+ * edac_get_dimm_by_index - Get DIMM info at @index from a memory
606+ * controller
607+ *
608+ * @mci: MC descriptor struct mem_ctl_info
609+ * @index: index in the memory controller's DIMM array
610+ *
611+ * Returns a struct dimm_info * or NULL on failure.
612+ */
613+static inline struct dimm_info *
614+edac_get_dimm_by_index(struct mem_ctl_info *mci, int index)
615+{
616+ if (index < 0 || index >= mci->tot_dimms)
617+ return NULL;
618+
619+ if (WARN_ON_ONCE(mci->dimms[index]->idx != index))
620+ return NULL;
621+
622+ return mci->dimms[index];
623+}
624+
625+/**
626+ * edac_get_dimm - Get DIMM info from a memory controller given by
627+ * [layer0,layer1,layer2] position
628+ *
629+ * @mci: MC descriptor struct mem_ctl_info
630+ * @layer0: layer0 position
631+ * @layer1: layer1 position. Unused if n_layers < 2
632+ * @layer2: layer2 position. Unused if n_layers < 3
633+ *
634+ * For 1 layer, this function returns "dimms[layer0]";
635+ *
636+ * For 2 layers, this function is similar to allocating a two-dimensional
637+ * array and returning "dimms[layer0][layer1]";
638+ *
639+ * For 3 layers, this function is similar to allocating a tri-dimensional
640+ * array and returning "dimms[layer0][layer1][layer2]";
641+ */
642+static inline struct dimm_info *edac_get_dimm(struct mem_ctl_info *mci,
643+ int layer0, int layer1, int layer2)
644+{
645+ int index;
646+
647+ if (layer0 < 0
648+ || (mci->n_layers > 1 && layer1 < 0)
649+ || (mci->n_layers > 2 && layer2 < 0))
650+ return NULL;
651+
652+ index = layer0;
653+
654+ if (mci->n_layers > 1)
655+ index = index * mci->layers[1].size + layer1;
656+
657+ if (mci->n_layers > 2)
658+ index = index * mci->layers[2].size + layer2;
659+
660+ return edac_get_dimm_by_index(mci, index);
661+}
662+#endif /* _LINUX_EDAC_H_ */
include/linux/efi.h+22−6
@@ -112,6 +112,7 @@ typedef struct { · 111 unmodified lines
112112 #define EFI_MEMORY_MORE_RELIABLE \
113113 ((u64)0x0000000000010000ULL) /* higher reliability */
114114 #define EFI_MEMORY_RO ((u64)0x0000000000020000ULL) /* read-only */
115+#define EFI_MEMORY_SP ((u64)0x0000000000040000ULL) /* soft reserved */
115116 #define EFI_MEMORY_RUNTIME ((u64)0x8000000000000000ULL) /* range requires runtime mapping */
116117 #define EFI_MEMORY_DESCRIPTOR_VERSION 1
117118
@@ -823,7 +824,7 @@ typedef struct { · 705 unmodified lines
823824 __aligned_u64 image_size;
824825 unsigned int image_code_type;
825826 unsigned int image_data_type;
826− unsigned long unload;
827+ u32 unload;
827828 } efi_loaded_image_32_t;
828829
829830 typedef struct {
@@ -839,14 +840,14 @@ typedef struct { · 9 unmodified lines
839840 __aligned_u64 image_size;
840841 unsigned int image_code_type;
841842 unsigned int image_data_type;
842− unsigned long unload;
843+ u64 unload;
843844 } efi_loaded_image_64_t;
844845
845846 typedef struct {
846847 u32 revision;
847− void *parent_handle;
848+ efi_handle_t parent_handle;
848849 efi_system_table_t *system_table;
849− void *device_handle;
850+ efi_handle_t device_handle;
850851 void *file_path;
851852 void *reserved;
852853 u32 load_options_size;
@@ -855,7 +856,7 @@ typedef struct { · 2 unmodified lines
855856 __aligned_u64 image_size;
856857 unsigned int image_code_type;
857858 unsigned int image_data_type;
858− unsigned long unload;
859+ efi_status_t (*unload)(efi_handle_t image_handle);
859860 } efi_loaded_image_t;
860861
861862
@@ -1044,7 +1045,6 @@ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if pos · 182 unmodified lines
10441045 extern efi_status_t efi_query_variable_store(u32 attributes,
10451046 unsigned long size,
10461047 bool nonblocking);
1047−extern void efi_find_mirror(void);
10481048 #else
10491049
10501050 static inline efi_status_t efi_query_variable_store(u32 attributes,
@@ -1202,6 +1202,7 @@ extern int __init efi_setup_pcdp_console(char *); · 151 unmodified lines
12021202 #define EFI_DBG 8 /* Print additional debug info at runtime */
12031203 #define EFI_NX_PE_DATA 9 /* Can runtime data regions be mapped non-executable? */
12041204 #define EFI_MEM_ATTR 10 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */
1205+#define EFI_MEM_NO_SOFT_RESERVE 11 /* Is the kernel configured to ignore soft reservations? */
12051206
12061207 #ifdef CONFIG_EFI
12071208 /*
@@ -1212,6 +1213,14 @@ static inline bool efi_enabled(int feature) · 4 unmodified lines
12121213 return test_bit(feature, &efi.flags) != 0;
12131214 }
12141215 extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
1216+
1217+bool __pure __efi_soft_reserve_enabled(void);
1218+
1219+static inline bool __pure efi_soft_reserve_enabled(void)
1220+{
1221+ return IS_ENABLED(CONFIG_EFI_SOFT_RESERVE)
1222+ && __efi_soft_reserve_enabled();
1223+}
12151224 #else
12161225 static inline bool efi_enabled(int feature)
12171226 {
@@ -1225,6 +1234,11 @@ efi_capsule_pending(int *reset_type) · 7 unmodified lines
12251234 {
12261235 return false;
12271236 }
1237+
1238+static inline bool efi_soft_reserve_enabled(void)
1239+{
1240+ return false;
1241+}
12281242 #endif
12291243
12301244 extern int efi_status_to_err(efi_status_t status);
@@ -1645,6 +1659,8 @@ static inline void · 414 unmodified lines
16451659 efi_enable_reset_attack_mitigation(efi_system_table_t *sys_table_arg) { }
16461660 #endif
16471661
1662+efi_status_t efi_random_get_seed(efi_system_table_t *sys_table_arg);
1663+
16481664 void efi_retrieve_tpm2_eventlog(efi_system_table_t *sys_table);
16491665
16501666 /*
include/linux/energy_model.h+1−2
@@ -9,7 +9,6 @@ · 8 unmodified lines
99 #include <linux/sched/topology.h>
1010 #include <linux/types.h>
1111
12−#ifdef CONFIG_ENERGY_MODEL
1312 /**
1413 * em_cap_state - Capacity state of a performance domain
1514 * @frequency: The CPU frequency in KHz, for consistency with CPUFreq
@@ -40,6 +39,7 @@ struct em_perf_domain { · 24 unmodified lines
4039 unsigned long cpus[0];
4140 };
4241
42+#ifdef CONFIG_ENERGY_MODEL
4343 #define EM_CPU_MAX_POWER 0xFFFF
4444
4545 struct em_data_callback {
@@ -160,7 +160,6 @@ static inline int em_pd_nr_cap_states(struct em_perf_domain *pd) · 114 unmodified lines
160160 }
161161
162162 #else
163−struct em_perf_domain {};
164163 struct em_data_callback {};
165164 #define EM_DATA_CB(_active_power_cb) { }
166165
include/linux/errname.h+16−0
@@ -0,0 +1,16 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _LINUX_ERRNAME_H
3+#define _LINUX_ERRNAME_H
4+
5+#include <linux/stddef.h>
6+
7+#ifdef CONFIG_SYMBOLIC_ERRNAME
8+const char *errname(int err);
9+#else
10+static inline const char *errname(int err)
11+{
12+ return NULL;
13+}
14+#endif
15+
16+#endif /* _LINUX_ERRNAME_H */
include/linux/export.h+29−63
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
12 #ifndef _LINUX_EXPORT_H
23 #define _LINUX_EXPORT_H
34
@@ -46,7 +47,7 @@ extern struct module __this_module; · 42 unmodified lines
4647 * absolute relocations that require runtime processing on relocatable
4748 * kernels.
4849 */
49−#define __KSYMTAB_ENTRY_NS(sym, sec) \
50+#define __KSYMTAB_ENTRY(sym, sec) \
5051 __ADDRESSABLE(sym) \
5152 asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \
5253 " .balign 4 \n" \
@@ -56,33 +57,17 @@ extern struct module __this_module; · 3 unmodified lines
5657 " .long __kstrtabns_" #sym "- . \n" \
5758 " .previous \n")
5859
59−#define __KSYMTAB_ENTRY(sym, sec) \
60− __ADDRESSABLE(sym) \
61− asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \
62− " .balign 4 \n" \
63− "__ksymtab_" #sym ": \n" \
64− " .long " #sym "- . \n" \
65− " .long __kstrtab_" #sym "- . \n" \
66− " .long 0 \n" \
67− " .previous \n")
68−
6960 struct kernel_symbol {
7061 int value_offset;
7162 int name_offset;
7263 int namespace_offset;
7364 };
7465 #else
75−#define __KSYMTAB_ENTRY_NS(sym, sec) \
76− static const struct kernel_symbol __ksymtab_##sym \
77− __attribute__((section("___ksymtab" sec "+" #sym), used)) \
78− __aligned(sizeof(void *)) \
79− = { (unsigned long)&sym, __kstrtab_##sym, __kstrtabns_##sym }
80−
8166 #define __KSYMTAB_ENTRY(sym, sec) \
8267 static const struct kernel_symbol __ksymtab_##sym \
8368 __attribute__((section("___ksymtab" sec "+" #sym), used)) \
8469 __aligned(sizeof(void *)) \
85− = { (unsigned long)&sym, __kstrtab_##sym, NULL }
70+ = { (unsigned long)&sym, __kstrtab_##sym, __kstrtabns_##sym }
8671
8772 struct kernel_symbol {
8873 unsigned long value;
@@ -93,28 +78,20 @@ struct kernel_symbol { · 4 unmodified lines
9378
9479 #ifdef __GENKSYMS__
9580
96−#define ___EXPORT_SYMBOL(sym,sec) __GENKSYMS_EXPORT_SYMBOL(sym)
97−#define ___EXPORT_SYMBOL_NS(sym,sec,ns) __GENKSYMS_EXPORT_SYMBOL(sym)
81+#define ___EXPORT_SYMBOL(sym, sec, ns) __GENKSYMS_EXPORT_SYMBOL(sym)
9882
9983 #else
10084
101−#define ___export_symbol_common(sym, sec) \
85+/* For every exported symbol, place a struct in the __ksymtab section */
86+#define ___EXPORT_SYMBOL(sym, sec, ns) \
10287 extern typeof(sym) sym; \
10388 __CRC_SYMBOL(sym, sec); \
10489 static const char __kstrtab_##sym[] \
10590 __attribute__((section("__ksymtab_strings"), used, aligned(1))) \
106− = #sym \
107−
108−/* For every exported symbol, place a struct in the __ksymtab section */
109−#define ___EXPORT_SYMBOL_NS(sym, sec, ns) \
110− ___export_symbol_common(sym, sec); \
91+ = #sym; \
11192 static const char __kstrtabns_##sym[] \
11293 __attribute__((section("__ksymtab_strings"), used, aligned(1))) \
113− = #ns; \
114− __KSYMTAB_ENTRY_NS(sym, sec)
115−
116−#define ___EXPORT_SYMBOL(sym, sec) \
117− ___export_symbol_common(sym, sec); \
94+ = ns; \
11895 __KSYMTAB_ENTRY(sym, sec)
11996
12097 #endif
@@ -126,8 +103,7 @@ struct kernel_symbol { · 5 unmodified lines
126103 * be reused in other execution contexts such as the UEFI stub or the
127104 * decompressor.
128105 */
129−#define __EXPORT_SYMBOL_NS(sym, sec, ns)
130−#define __EXPORT_SYMBOL(sym, sec)
106+#define __EXPORT_SYMBOL(sym, sec, ns)
131107
132108 #elif defined(CONFIG_TRIM_UNUSED_KSYMS)
133109
@@ -143,48 +119,38 @@ struct kernel_symbol { · 9 unmodified lines
143119 #define __ksym_marker(sym) \
144120 static int __ksym_marker_##sym[0] __section(".discard.ksym") __used
145121
146−#define __EXPORT_SYMBOL(sym, sec) \
147− __ksym_marker(sym); \
148− __cond_export_sym(sym, sec, __is_defined(__KSYM_##sym))
149−#define __cond_export_sym(sym, sec, conf) \
150− ___cond_export_sym(sym, sec, conf)
151−#define ___cond_export_sym(sym, sec, enabled) \
152− __cond_export_sym_##enabled(sym, sec)
153−#define __cond_export_sym_1(sym, sec) ___EXPORT_SYMBOL(sym, sec)
154−#define __cond_export_sym_0(sym, sec) /* nothing */
155−
156−#define __EXPORT_SYMBOL_NS(sym, sec, ns) \
122+#define __EXPORT_SYMBOL(sym, sec, ns) \
157123 __ksym_marker(sym); \
158− __cond_export_ns_sym(sym, sec, ns, __is_defined(__KSYM_##sym))
159−#define __cond_export_ns_sym(sym, sec, ns, conf) \
160− ___cond_export_ns_sym(sym, sec, ns, conf)
161−#define ___cond_export_ns_sym(sym, sec, ns, enabled) \
162− __cond_export_ns_sym_##enabled(sym, sec, ns)
163−#define __cond_export_ns_sym_1(sym, sec, ns) ___EXPORT_SYMBOL_NS(sym, sec, ns)
164−#define __cond_export_ns_sym_0(sym, sec, ns) /* nothing */
124+ __cond_export_sym(sym, sec, ns, __is_defined(__KSYM_##sym))
125+#define __cond_export_sym(sym, sec, ns, conf) \
126+ ___cond_export_sym(sym, sec, ns, conf)
127+#define ___cond_export_sym(sym, sec, ns, enabled) \
128+ __cond_export_sym_##enabled(sym, sec, ns)
129+#define __cond_export_sym_1(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
130+#define __cond_export_sym_0(sym, sec, ns) /* nothing */
165131
166132 #else
167133
168−#define __EXPORT_SYMBOL_NS(sym,sec,ns) ___EXPORT_SYMBOL_NS(sym,sec,ns)
169−#define __EXPORT_SYMBOL(sym,sec) ___EXPORT_SYMBOL(sym,sec)
134+#define __EXPORT_SYMBOL(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns)
170135
171136 #endif /* CONFIG_MODULES */
172137
173138 #ifdef DEFAULT_SYMBOL_NAMESPACE
174−#undef __EXPORT_SYMBOL
175−#define __EXPORT_SYMBOL(sym, sec) \
176− __EXPORT_SYMBOL_NS(sym, sec, DEFAULT_SYMBOL_NAMESPACE)
139+#include <linux/stringify.h>
140+#define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, __stringify(DEFAULT_SYMBOL_NAMESPACE))
141+#else
142+#define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
177143 #endif
178144
179−#define EXPORT_SYMBOL(sym) __EXPORT_SYMBOL(sym, "")
180−#define EXPORT_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_gpl")
181−#define EXPORT_SYMBOL_GPL_FUTURE(sym) __EXPORT_SYMBOL(sym, "_gpl_future")
182−#define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL_NS(sym, "", ns)
183−#define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL_NS(sym, "_gpl", ns)
145+#define EXPORT_SYMBOL(sym) _EXPORT_SYMBOL(sym, "")
146+#define EXPORT_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "_gpl")
147+#define EXPORT_SYMBOL_GPL_FUTURE(sym) _EXPORT_SYMBOL(sym, "_gpl_future")
148+#define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL(sym, "", #ns)
149+#define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL(sym, "_gpl", #ns)
184150
185151 #ifdef CONFIG_UNUSED_SYMBOLS
186−#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
187−#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
152+#define EXPORT_UNUSED_SYMBOL(sym) _EXPORT_SYMBOL(sym, "_unused")
153+#define EXPORT_UNUSED_SYMBOL_GPL(sym) _EXPORT_SYMBOL(sym, "_unused_gpl")
188154 #else
189155 #define EXPORT_UNUSED_SYMBOL(sym)
190156 #define EXPORT_UNUSED_SYMBOL_GPL(sym)
include/linux/exportfs.h+5−0
@@ -104,6 +104,11 @@ enum fid_type { · 103 unmodified lines
104104 */
105105 FILEID_LUSTRE = 0x97,
106106
107+ /*
108+ * 64 bit unique kernfs id
109+ */
110+ FILEID_KERNFS = 0xfe,
111+
107112 /*
108113 * Filesystems must not use 0xff file ID.
109114 */
include/linux/extable.h+10−0
@@ -33,4 +33,14 @@ search_module_extables(unsigned long addr) · 32 unmodified lines
3333 }
3434 #endif /*CONFIG_MODULES*/
3535
36+#ifdef CONFIG_BPF_JIT
37+const struct exception_table_entry *search_bpf_extables(unsigned long addr);
38+#else
39+static inline const struct exception_table_entry *
40+search_bpf_extables(unsigned long addr)
41+{
42+ return NULL;
43+}
44+#endif
45+
3646 #endif /* _LINUX_EXTABLE_H */
include/linux/falloc.h+26−0
@@ -20,7 +20,10 @@ struct space_resv { · 19 unmodified lines
2020 };
2121
2222 #define FS_IOC_RESVSP _IOW('X', 40, struct space_resv)
23+#define FS_IOC_UNRESVSP _IOW('X', 41, struct space_resv)
2324 #define FS_IOC_RESVSP64 _IOW('X', 42, struct space_resv)
25+#define FS_IOC_UNRESVSP64 _IOW('X', 43, struct space_resv)
26+#define FS_IOC_ZERO_RANGE _IOW('X', 57, struct space_resv)
2427
2528 #define FALLOC_FL_SUPPORTED_MASK (FALLOC_FL_KEEP_SIZE | \
2629 FALLOC_FL_PUNCH_HOLE | \
@@ -29,4 +32,27 @@ struct space_resv { · 2 unmodified lines
2932 FALLOC_FL_INSERT_RANGE | \
3033 FALLOC_FL_UNSHARE_RANGE)
3134
35+/* on ia32 l_start is on a 32-bit boundary */
36+#if defined(CONFIG_X86_64)
37+struct space_resv_32 {
38+ __s16 l_type;
39+ __s16 l_whence;
40+ __s64 l_start __attribute__((packed));
41+ /* len == 0 means until end of file */
42+ __s64 l_len __attribute__((packed));
43+ __s32 l_sysid;
44+ __u32 l_pid;
45+ __s32 l_pad[4]; /* reserve area */
46+};
47+
48+#define FS_IOC_RESVSP_32 _IOW ('X', 40, struct space_resv_32)
49+#define FS_IOC_UNRESVSP_32 _IOW ('X', 41, struct space_resv_32)
50+#define FS_IOC_RESVSP64_32 _IOW ('X', 42, struct space_resv_32)
51+#define FS_IOC_UNRESVSP64_32 _IOW ('X', 43, struct space_resv_32)
52+#define FS_IOC_ZERO_RANGE_32 _IOW ('X', 57, struct space_resv_32)
53+
54+int compat_ioctl_preallocate(struct file *, int, struct space_resv_32 __user *);
55+
56+#endif
57+
3258 #endif /* _FALLOC_H_ */
include/linux/fb.h+1−1
@@ -607,7 +607,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, · 606 unmodified lines
607607 extern int register_framebuffer(struct fb_info *fb_info);
608608 extern void unregister_framebuffer(struct fb_info *fb_info);
609609 extern void unlink_framebuffer(struct fb_info *fb_info);
610−extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,
610+extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
611611 const char *name);
612612 extern int remove_conflicting_framebuffers(struct apertures_struct *a,
613613 const char *name, bool primary);
include/linux/filter.h+36−11
@@ -65,6 +65,9 @@ struct ctl_table_header; · 64 unmodified lines
6565 /* unused opcode to mark special call to bpf_tail_call() helper */
6666 #define BPF_TAIL_CALL 0xf0
6767
68+/* unused opcode to mark special load instruction. Same as BPF_ABS */
69+#define BPF_PROBE_MEM 0x20
70+
6871 /* unused opcode to mark call to interpreter with arguments */
6972 #define BPF_CALL_ARGS 0xe0
7073
@@ -417,7 +420,7 @@ static inline bool insn_is_zext(const struct bpf_insn *insn) · 346 unmodified lines
417420
418421 #define BPF_FIELD_SIZEOF(type, field) \
419422 ({ \
420− const int __size = bytes_to_bpf_size(FIELD_SIZEOF(type, field)); \
423+ const int __size = bytes_to_bpf_size(sizeof_field(type, field)); \
421424 BUILD_BUG_ON(__size < 0); \
422425 __size; \
423426 })
@@ -464,10 +467,11 @@ static inline bool insn_is_zext(const struct bpf_insn *insn) · 40 unmodified lines
464467 #define BPF_CALL_x(x, name, ...) \
465468 static __always_inline \
466469 u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \
470+ typedef u64 (*btf_##name)(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \
467471 u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \
468472 u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \
469473 { \
470− return ____##name(__BPF_MAP(x,__BPF_CAST,__BPF_N,__VA_ARGS__));\
474+ return ((btf_##name)____##name)(__BPF_MAP(x,__BPF_CAST,__BPF_N,__VA_ARGS__));\
471475 } \
472476 static __always_inline \
473477 u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__))
@@ -493,7 +497,7 @@ static inline bool insn_is_zext(const struct bpf_insn *insn) · 19 unmodified lines
493497
494498 #define bpf_target_off(TYPE, MEMBER, SIZE, PTR_SIZE) \
495499 ({ \
496− BUILD_BUG_ON(FIELD_SIZEOF(TYPE, MEMBER) != (SIZE)); \
500+ BUILD_BUG_ON(sizeof_field(TYPE, MEMBER) != (SIZE)); \
497501 *(PTR_SIZE) = (SIZE); \
498502 offsetof(TYPE, MEMBER); \
499503 })
@@ -511,10 +515,12 @@ struct sock_fprog_kern { · 11 unmodified lines
511515 struct sock_filter *filter;
512516 };
513517
518+/* Some arches need doubleword alignment for their instructions and/or data */
519+#define BPF_IMAGE_ALIGNMENT 8
520+
514521 struct bpf_binary_header {
515522 u32 pages;
516− /* Some arches need word alignment for their instructions */
517− u8 image[] __aligned(4);
523+ u8 image[] __aligned(BPF_IMAGE_ALIGNMENT);
518524 };
519525
520526 struct bpf_prog {
@@ -602,7 +608,7 @@ static inline void bpf_compute_data_pointers(struct sk_buff *skb) · 81 unmodified lines
602608 {
603609 struct bpf_skb_data_end *cb = (struct bpf_skb_data_end *)skb->cb;
604610
605− BUILD_BUG_ON(sizeof(*cb) > FIELD_SIZEOF(struct sk_buff, cb));
611+ BUILD_BUG_ON(sizeof(*cb) > sizeof_field(struct sk_buff, cb));
606612 cb->data_meta = skb->data - skb_metadata_len(skb);
607613 cb->data_end = skb->data + skb_headlen(skb);
608614 }
@@ -640,9 +646,9 @@ static inline u8 *bpf_skb_cb(struct sk_buff *skb) · 31 unmodified lines
640646 * attached to sockets, we need to clear the bpf_skb_cb() area
641647 * to not leak previous contents to user space.
642648 */
643− BUILD_BUG_ON(FIELD_SIZEOF(struct __sk_buff, cb) != BPF_SKB_CB_LEN);
644− BUILD_BUG_ON(FIELD_SIZEOF(struct __sk_buff, cb) !=
645− FIELD_SIZEOF(struct qdisc_skb_cb, data));
649+ BUILD_BUG_ON(sizeof_field(struct __sk_buff, cb) != BPF_SKB_CB_LEN);
650+ BUILD_BUG_ON(sizeof_field(struct __sk_buff, cb) !=
651+ sizeof_field(struct qdisc_skb_cb, data));
646652
647653 return qdisc_skb_cb(skb)->data;
648654 }
@@ -770,8 +776,12 @@ bpf_ctx_narrow_access_offset(u32 off, u32 size, u32 size_default) · 121 unmodified lines
770776
771777 static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
772778 {
773− set_vm_flush_reset_perms(fp);
774− set_memory_ro((unsigned long)fp, fp->pages);
779+#ifndef CONFIG_BPF_JIT_ALWAYS_ON
780+ if (!fp->jited) {
781+ set_vm_flush_reset_perms(fp);
782+ set_memory_ro((unsigned long)fp, fp->pages);
783+ }
784+#endif
775785 }
776786
777787 static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr)
@@ -946,6 +956,9 @@ void *bpf_jit_alloc_exec(unsigned long size); · 168 unmodified lines
946956 void bpf_jit_free_exec(void *addr);
947957 void bpf_jit_free(struct bpf_prog *fp);
948958
959+int bpf_jit_add_poke_descriptor(struct bpf_prog *prog,
960+ struct bpf_jit_poke_descriptor *poke);
961+
949962 int bpf_jit_get_func_addr(const struct bpf_prog *prog,
950963 const struct bpf_insn *insn, bool extra_pass,
951964 u64 *func_addr, bool *func_addr_fixed);
@@ -1044,11 +1057,23 @@ static inline bool ebpf_jit_enabled(void) · 92 unmodified lines
10441057 return false;
10451058 }
10461059
1060+static inline bool bpf_jit_blinding_enabled(struct bpf_prog *prog)
1061+{
1062+ return false;
1063+}
1064+
10471065 static inline bool bpf_prog_ebpf_jited(const struct bpf_prog *fp)
10481066 {
10491067 return false;
10501068 }
10511069
1070+static inline int
1071+bpf_jit_add_poke_descriptor(struct bpf_prog *prog,
1072+ struct bpf_jit_poke_descriptor *poke)
1073+{
1074+ return -ENOTSUPP;
1075+}
1076+
10521077 static inline void bpf_jit_free(struct bpf_prog *fp)
10531078 {
10541079 bpf_prog_unlock_free(fp);
include/linux/firmware/broadcom/tee_bnxt_fw.h+14−0
@@ -0,0 +1,14 @@
1+/* SPDX-License-Identifier: BSD-2-Clause */
2+/*
3+ * Copyright 2019 Broadcom.
4+ */
5+
6+#ifndef _BROADCOM_TEE_BNXT_FW_H
7+#define _BROADCOM_TEE_BNXT_FW_H
8+
9+#include <linux/types.h>
10+
11+int tee_bnxt_fw_load(void);
12+int tee_bnxt_copy_coredump(void *buf, u32 offset, u32 size);
13+
14+#endif /* _BROADCOM_TEE_BNXT_FW_H */
include/linux/firmware/intel/stratix10-svc-client.h+8−0
@@ -41,6 +41,12 @@ · 40 unmodified lines
4141 *
4242 * SVC_STATUS_RSU_OK:
4343 * Secure firmware accepts the request of remote status update (RSU).
44+ *
45+ * SVC_STATUS_RSU_ERROR:
46+ * Error encountered during remote system update.
47+ *
48+ * SVC_STATUS_RSU_NO_SUPPORT:
49+ * Secure firmware doesn't support RSU retry or notify feature.
4450 */
4551 #define SVC_STATUS_RECONFIG_REQUEST_OK 0
4652 #define SVC_STATUS_RECONFIG_BUFFER_SUBMITTED 1
@@ -50,6 +56,8 @@ · 3 unmodified lines
5056 #define SVC_STATUS_RECONFIG_ERROR 5
5157 #define SVC_STATUS_RSU_OK 6
5258 #define SVC_STATUS_RSU_ERROR 7
59+#define SVC_STATUS_RSU_NO_SUPPORT 8
60+
5361 /**
5462 * Flag bit for COMMAND_RECONFIG
5563 *
include/linux/firmware/meson/meson_sm.h+9−6
@@ -16,11 +16,14 @@ enum { · 15 unmodified lines
1616
1717 struct meson_sm_firmware;
1818
19−int meson_sm_call(unsigned int cmd_index, u32 *ret, u32 arg0, u32 arg1,
20− u32 arg2, u32 arg3, u32 arg4);
21−int meson_sm_call_write(void *buffer, unsigned int b_size, unsigned int cmd_index,
22− u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4);
23−int meson_sm_call_read(void *buffer, unsigned int bsize, unsigned int cmd_index,
24− u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4);
19+int meson_sm_call(struct meson_sm_firmware *fw, unsigned int cmd_index,
20+ u32 *ret, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4);
21+int meson_sm_call_write(struct meson_sm_firmware *fw, void *buffer,
22+ unsigned int b_size, unsigned int cmd_index, u32 arg0,
23+ u32 arg1, u32 arg2, u32 arg3, u32 arg4);
24+int meson_sm_call_read(struct meson_sm_firmware *fw, void *buffer,
25+ unsigned int bsize, unsigned int cmd_index, u32 arg0,
26+ u32 arg1, u32 arg2, u32 arg3, u32 arg4);
27+struct meson_sm_firmware *meson_sm_get(struct device_node *firmware_node);
2528
2629 #endif /* _MESON_SM_FW_H_ */
include/linux/firmware/xlnx-zynqmp.h+14−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 /*
33 * Xilinx Zynq MPSoC Firmware layer
44 *
5− * Copyright (C) 2014-2018 Xilinx
5+ * Copyright (C) 2014-2019 Xilinx
66 *
77 * Michal Simek <michal.simek@xilinx.com>
88 * Davorin Mista <davorin.mista@aggios.com>
@@ -46,6 +46,7 @@ · 37 unmodified lines
4646 #define ZYNQMP_PM_CAPABILITY_ACCESS 0x1U
4747 #define ZYNQMP_PM_CAPABILITY_CONTEXT 0x2U
4848 #define ZYNQMP_PM_CAPABILITY_WAKEUP 0x4U
49+#define ZYNQMP_PM_CAPABILITY_UNUSABLE 0x8U
4950
5051 /*
5152 * Firmware FPGA Manager flags
@@ -91,7 +92,8 @@ enum pm_ret_status { · 39 unmodified lines
9192 };
9293
9394 enum pm_ioctl_id {
94− IOCTL_SET_PLL_FRAC_MODE = 8,
95+ IOCTL_SET_SD_TAPDELAY = 7,
96+ IOCTL_SET_PLL_FRAC_MODE,
9597 IOCTL_GET_PLL_FRAC_MODE,
9698 IOCTL_SET_PLL_FRAC_DATA,
9799 IOCTL_GET_PLL_FRAC_DATA,
@@ -250,6 +252,16 @@ enum zynqmp_pm_request_ack { · 152 unmodified lines
250252 ZYNQMP_PM_REQUEST_ACK_NON_BLOCKING,
251253 };
252254
255+enum pm_node_id {
256+ NODE_SD_0 = 39,
257+ NODE_SD_1,
258+};
259+
260+enum tap_delay_type {
261+ PM_TAPDELAY_INPUT = 0,
262+ PM_TAPDELAY_OUTPUT,
263+};
264+
253265 /**
254266 * struct zynqmp_pm_query_data - PM query data
255267 * @qid: query ID
include/linux/fs.h+13−6
@@ -1727,6 +1727,13 @@ int vfs_mkobj(struct dentry *, umode_t, · 1726 unmodified lines
17271727
17281728 extern long vfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
17291729
1730+#ifdef CONFIG_COMPAT
1731+extern long compat_ptr_ioctl(struct file *file, unsigned int cmd,
1732+ unsigned long arg);
1733+#else
1734+#define compat_ptr_ioctl NULL
1735+#endif
1736+
17301737 /*
17311738 * VFS file helper functions.
17321739 */
@@ -2547,7 +2554,7 @@ extern int finish_no_open(struct file *file, struct dentry *dentry); · 814 unmodified lines
25472554
25482555 /* fs/ioctl.c */
25492556
2550−extern int ioctl_preallocate(struct file *filp, void __user *argp);
2557+extern int ioctl_preallocate(struct file *filp, int mode, void __user *argp);
25512558
25522559 /* fs/dcache.c */
25532560 extern void __init vfs_caches_init_early(void);
@@ -2632,8 +2639,6 @@ extern void bd_finish_claiming(struct block_device *bdev, · 78 unmodified lines
26322639 extern void bd_abort_claiming(struct block_device *bdev,
26332640 struct block_device *whole, void *holder);
26342641 extern void blkdev_put(struct block_device *bdev, fmode_t mode);
2635−extern int __blkdev_reread_part(struct block_device *bdev);
2636−extern int blkdev_reread_part(struct block_device *bdev);
26372642
26382643 #ifdef CONFIG_SYSFS
26392644 extern int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk);
@@ -2703,8 +2708,6 @@ extern void make_bad_inode(struct inode *); · 63 unmodified lines
27032708 extern bool is_bad_inode(struct inode *);
27042709
27052710 #ifdef CONFIG_BLOCK
2706−extern void check_disk_size_change(struct gendisk *disk,
2707− struct block_device *bdev, bool verbose);
27082711 extern int revalidate_disk(struct gendisk *);
27092712 extern int check_disk_change(struct block_device *);
27102713 extern int __invalidate_device(struct block_device *, bool);
@@ -3153,7 +3156,6 @@ enum { · 442 unmodified lines
31533156 };
31543157
31553158 void dio_end_io(struct bio *bio);
3156−void dio_warn_stale_pagecache(struct file *filp);
31573159
31583160 ssize_t __blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,
31593161 struct block_device *bdev, struct iov_iter *iter,
@@ -3198,6 +3200,11 @@ static inline void inode_dio_end(struct inode *inode) · 38 unmodified lines
31983200 wake_up_bit(&inode->i_state, __I_DIO_WAKEUP);
31993201 }
32003202
3203+/*
3204+ * Warn about a page cache invalidation failure diring a direct I/O write.
3205+ */
3206+void dio_warn_stale_pagecache(struct file *filp);
3207+
32013208 extern void inode_set_flags(struct inode *inode, unsigned int flags,
32023209 unsigned int mask);
32033210
include/linux/fscrypt.h+3−32
@@ -20,7 +20,6 @@ · 19 unmodified lines
2020
2121 #define FS_CRYPTO_BLOCK_SIZE 16
2222
23−struct fscrypt_ctx;
2423 struct fscrypt_info;
2524
2625 struct fscrypt_str {
@@ -62,18 +61,9 @@ struct fscrypt_operations { · 35 unmodified lines
6261 bool (*dummy_context)(struct inode *);
6362 bool (*empty_dir)(struct inode *);
6463 unsigned int max_namelen;
65−};
66−
67−/* Decryption work */
68−struct fscrypt_ctx {
69− union {
70− struct {
71− struct bio *bio;
72− struct work_struct work;
73− };
74− struct list_head free_list; /* Free list */
75− };
76− u8 flags; /* Flags */
64+ bool (*has_stable_inodes)(struct super_block *sb);
65+ void (*get_ino_and_lblk_bits)(struct super_block *sb,
66+ int *ino_bits_ret, int *lblk_bits_ret);
7767 };
7868
7969 static inline bool fscrypt_has_encryption_key(const struct inode *inode)
@@ -102,8 +92,6 @@ static inline void fscrypt_handle_d_move(struct dentry *dentry) · 22 unmodified lines
10292
10393 /* crypto.c */
10494 extern void fscrypt_enqueue_decrypt_work(struct work_struct *);
105−extern struct fscrypt_ctx *fscrypt_get_ctx(gfp_t);
106−extern void fscrypt_release_ctx(struct fscrypt_ctx *);
10795
10896 extern struct page *fscrypt_encrypt_pagecache_blocks(struct page *page,
10997 unsigned int len,
@@ -244,8 +232,6 @@ static inline bool fscrypt_match_name(const struct fscrypt_name *fname, · 134 unmodified lines
244232
245233 /* bio.c */
246234 extern void fscrypt_decrypt_bio(struct bio *);
247−extern void fscrypt_enqueue_decrypt_bio(struct fscrypt_ctx *ctx,
248− struct bio *bio);
249235 extern int fscrypt_zeroout_range(const struct inode *, pgoff_t, sector_t,
250236 unsigned int);
251237
@@ -295,16 +281,6 @@ static inline void fscrypt_enqueue_decrypt_work(struct work_struct *work) · 43 unmodified lines
295281 {
296282 }
297283
298−static inline struct fscrypt_ctx *fscrypt_get_ctx(gfp_t gfp_flags)
299−{
300− return ERR_PTR(-EOPNOTSUPP);
301−}
302−
303−static inline void fscrypt_release_ctx(struct fscrypt_ctx *ctx)
304−{
305− return;
306−}
307−
308284 static inline struct page *fscrypt_encrypt_pagecache_blocks(struct page *page,
309285 unsigned int len,
310286 unsigned int offs,
@@ -484,11 +460,6 @@ static inline void fscrypt_decrypt_bio(struct bio *bio) · 173 unmodified lines
484460 {
485461 }
486462
487−static inline void fscrypt_enqueue_decrypt_bio(struct fscrypt_ctx *ctx,
488− struct bio *bio)
489−{
490−}
491−
492463 static inline int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
493464 sector_t pblk, unsigned int len)
494465 {
include/linux/fsl/mc.h+2−0
@@ -403,6 +403,8 @@ int __must_check fsl_mc_allocate_irqs(struct fsl_mc_device *mc_dev); · 402 unmodified lines
403403
404404 void fsl_mc_free_irqs(struct fsl_mc_device *mc_dev);
405405
406+struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev);
407+
406408 extern struct bus_type fsl_mc_bus_type;
407409
408410 extern struct device_type fsl_mc_bus_dprc_type;
include/linux/ftrace.h+134−23
@@ -51,6 +51,7 @@ static inline void early_trace_init(void) { } · 50 unmodified lines
5151
5252 struct module;
5353 struct ftrace_hash;
54+struct ftrace_direct_func;
5455
5556 #if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_MODULES) && \
5657 defined(CONFIG_DYNAMIC_FTRACE)
@@ -142,24 +143,30 @@ ftrace_func_t ftrace_ops_get_func(struct ftrace_ops *ops); · 85 unmodified lines
142143 * PID - Is affected by set_ftrace_pid (allows filtering on those pids)
143144 * RCU - Set when the ops can only be called when RCU is watching.
144145 * TRACE_ARRAY - The ops->private points to a trace_array descriptor.
146+ * PERMANENT - Set when the ops is permanent and should not be affected by
147+ * ftrace_enabled.
148+ * DIRECT - Used by the direct ftrace_ops helper for direct functions
149+ * (internal ftrace only, should not be used by others)
145150 */
146151 enum {
147− FTRACE_OPS_FL_ENABLED = 1 << 0,
148− FTRACE_OPS_FL_DYNAMIC = 1 << 1,
149− FTRACE_OPS_FL_SAVE_REGS = 1 << 2,
150− FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 3,
151− FTRACE_OPS_FL_RECURSION_SAFE = 1 << 4,
152− FTRACE_OPS_FL_STUB = 1 << 5,
153− FTRACE_OPS_FL_INITIALIZED = 1 << 6,
154− FTRACE_OPS_FL_DELETED = 1 << 7,
155− FTRACE_OPS_FL_ADDING = 1 << 8,
156− FTRACE_OPS_FL_REMOVING = 1 << 9,
157− FTRACE_OPS_FL_MODIFYING = 1 << 10,
158− FTRACE_OPS_FL_ALLOC_TRAMP = 1 << 11,
159− FTRACE_OPS_FL_IPMODIFY = 1 << 12,
160− FTRACE_OPS_FL_PID = 1 << 13,
161− FTRACE_OPS_FL_RCU = 1 << 14,
162− FTRACE_OPS_FL_TRACE_ARRAY = 1 << 15,
152+ FTRACE_OPS_FL_ENABLED = BIT(0),
153+ FTRACE_OPS_FL_DYNAMIC = BIT(1),
154+ FTRACE_OPS_FL_SAVE_REGS = BIT(2),
155+ FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = BIT(3),
156+ FTRACE_OPS_FL_RECURSION_SAFE = BIT(4),
157+ FTRACE_OPS_FL_STUB = BIT(5),
158+ FTRACE_OPS_FL_INITIALIZED = BIT(6),
159+ FTRACE_OPS_FL_DELETED = BIT(7),
160+ FTRACE_OPS_FL_ADDING = BIT(8),
161+ FTRACE_OPS_FL_REMOVING = BIT(9),
162+ FTRACE_OPS_FL_MODIFYING = BIT(10),
163+ FTRACE_OPS_FL_ALLOC_TRAMP = BIT(11),
164+ FTRACE_OPS_FL_IPMODIFY = BIT(12),
165+ FTRACE_OPS_FL_PID = BIT(13),
166+ FTRACE_OPS_FL_RCU = BIT(14),
167+ FTRACE_OPS_FL_TRACE_ARRAY = BIT(15),
168+ FTRACE_OPS_FL_PERMANENT = BIT(16),
169+ FTRACE_OPS_FL_DIRECT = BIT(17),
163170 };
164171
165172 #ifdef CONFIG_DYNAMIC_FTRACE
@@ -239,6 +246,75 @@ static inline void ftrace_free_init_mem(void) { } · 73 unmodified lines
239246 static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { }
240247 #endif /* CONFIG_FUNCTION_TRACER */
241248
249+struct ftrace_func_entry {
250+ struct hlist_node hlist;
251+ unsigned long ip;
252+ unsigned long direct; /* for direct lookup only */
253+};
254+
255+struct dyn_ftrace;
256+
257+#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
258+extern int ftrace_direct_func_count;
259+int register_ftrace_direct(unsigned long ip, unsigned long addr);
260+int unregister_ftrace_direct(unsigned long ip, unsigned long addr);
261+int modify_ftrace_direct(unsigned long ip, unsigned long old_addr, unsigned long new_addr);
262+struct ftrace_direct_func *ftrace_find_direct_func(unsigned long addr);
263+int ftrace_modify_direct_caller(struct ftrace_func_entry *entry,
264+ struct dyn_ftrace *rec,
265+ unsigned long old_addr,
266+ unsigned long new_addr);
267+unsigned long ftrace_find_rec_direct(unsigned long ip);
268+#else
269+# define ftrace_direct_func_count 0
270+static inline int register_ftrace_direct(unsigned long ip, unsigned long addr)
271+{
272+ return -ENOTSUPP;
273+}
274+static inline int unregister_ftrace_direct(unsigned long ip, unsigned long addr)
275+{
276+ return -ENOTSUPP;
277+}
278+static inline int modify_ftrace_direct(unsigned long ip,
279+ unsigned long old_addr, unsigned long new_addr)
280+{
281+ return -ENOTSUPP;
282+}
283+static inline struct ftrace_direct_func *ftrace_find_direct_func(unsigned long addr)
284+{
285+ return NULL;
286+}
287+static inline int ftrace_modify_direct_caller(struct ftrace_func_entry *entry,
288+ struct dyn_ftrace *rec,
289+ unsigned long old_addr,
290+ unsigned long new_addr)
291+{
292+ return -ENODEV;
293+}
294+static inline unsigned long ftrace_find_rec_direct(unsigned long ip)
295+{
296+ return 0;
297+}
298+#endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */
299+
300+#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
301+/*
302+ * This must be implemented by the architecture.
303+ * It is the way the ftrace direct_ops helper, when called
304+ * via ftrace (because there's other callbacks besides the
305+ * direct call), can inform the architecture's trampoline that this
306+ * routine has a direct caller, and what the caller is.
307+ *
308+ * For example, in x86, it returns the direct caller
309+ * callback function via the regs->orig_ax parameter.
310+ * Then in the ftrace trampoline, if this is set, it makes
311+ * the return from the trampoline jump to the direct caller
312+ * instead of going back to the function it just traced.
313+ */
314+static inline void arch_ftrace_set_direct_caller(struct pt_regs *regs,
315+ unsigned long addr) { }
316+#endif /* CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */
317+
242318 #ifdef CONFIG_STACK_TRACER
243319
244320 extern int stack_tracer_enabled;
@@ -291,8 +367,6 @@ static inline void stack_tracer_enable(void) { } · 46 unmodified lines
291367 int ftrace_arch_code_modify_prepare(void);
292368 int ftrace_arch_code_modify_post_process(void);
293369
294−struct dyn_ftrace;
295−
296370 enum ftrace_bug_type {
297371 FTRACE_BUG_UNKNOWN,
298372 FTRACE_BUG_INIT,
@@ -330,6 +404,7 @@ bool is_ftrace_trampoline(unsigned long addr); · 31 unmodified lines
330404 * REGS_EN - the function is set up to save regs.
331405 * IPMODIFY - the record allows for the IP address to be changed.
332406 * DISABLED - the record is not ready to be touched yet
407+ * DIRECT - there is a direct function to call
333408 *
334409 * When a new ftrace_ops is registered and wants a function to save
335410 * pt_regs, the rec->flag REGS is set. When the function has been
@@ -345,10 +420,12 @@ enum { · 9 unmodified lines
345420 FTRACE_FL_TRAMP_EN = (1UL << 27),
346421 FTRACE_FL_IPMODIFY = (1UL << 26),
347422 FTRACE_FL_DISABLED = (1UL << 25),
423+ FTRACE_FL_DIRECT = (1UL << 24),
424+ FTRACE_FL_DIRECT_EN = (1UL << 23),
348425 };
349426
350−#define FTRACE_REF_MAX_SHIFT 25
351−#define FTRACE_FL_BITS 7
427+#define FTRACE_REF_MAX_SHIFT 23
428+#define FTRACE_FL_BITS 9
352429 #define FTRACE_FL_MASKED_BITS ((1UL << FTRACE_FL_BITS) - 1)
353430 #define FTRACE_FL_MASK (FTRACE_FL_MASKED_BITS << FTRACE_REF_MAX_SHIFT)
354431 #define FTRACE_REF_MAX ((1UL << FTRACE_REF_MAX_SHIFT) - 1)
@@ -499,7 +576,7 @@ static inline int ftrace_disable_ftrace_graph_caller(void) { return 0; } · 144 unmodified lines
499576 /**
500577 * ftrace_make_nop - convert code into nop
501578 * @mod: module structure if called by module load initialization
502− * @rec: the mcount call site record
579+ * @rec: the call site record (e.g. mcount/fentry)
503580 * @addr: the address that the call site should be calling
504581 *
505582 * This is a very sensitive operation and great care needs
@@ -520,9 +597,38 @@ static inline int ftrace_disable_ftrace_graph_caller(void) { return 0; } · 14 unmodified lines
520597 extern int ftrace_make_nop(struct module *mod,
521598 struct dyn_ftrace *rec, unsigned long addr);
522599
600+
601+/**
602+ * ftrace_init_nop - initialize a nop call site
603+ * @mod: module structure if called by module load initialization
604+ * @rec: the call site record (e.g. mcount/fentry)
605+ *
606+ * This is a very sensitive operation and great care needs
607+ * to be taken by the arch. The operation should carefully
608+ * read the location, check to see if what is read is indeed
609+ * what we expect it to be, and then on success of the compare,
610+ * it should write to the location.
611+ *
612+ * The code segment at @rec->ip should contain the contents created by
613+ * the compiler
614+ *
615+ * Return must be:
616+ * 0 on success
617+ * -EFAULT on error reading the location
618+ * -EINVAL on a failed compare of the contents
619+ * -EPERM on error writing to the location
620+ * Any other value will be considered a failure.
621+ */
622+#ifndef ftrace_init_nop
623+static inline int ftrace_init_nop(struct module *mod, struct dyn_ftrace *rec)
624+{
625+ return ftrace_make_nop(mod, rec, MCOUNT_ADDR);
626+}
627+#endif
628+
523629 /**
524630 * ftrace_make_call - convert a nop call site into a call to addr
525− * @rec: the mcount call site record
631+ * @rec: the call site record (e.g. mcount/fentry)
526632 * @addr: the address that the call site should call
527633 *
528634 * This is a very sensitive operation and great care needs
@@ -545,7 +651,7 @@ extern int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr); · 16 unmodified lines
545651 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
546652 /**
547653 * ftrace_modify_call - convert from one addr to another (no nop)
548− * @rec: the mcount call site record
654+ * @rec: the call site record (e.g. mcount/fentry)
549655 * @old_addr: the address expected to be currently called to
550656 * @addr: the address to change to
551657 *
@@ -709,6 +815,11 @@ static inline unsigned long get_lock_parent_ip(void) · 157 unmodified lines
709815
710816 #ifdef CONFIG_FTRACE_MCOUNT_RECORD
711817 extern void ftrace_init(void);
818+#ifdef CC_USING_PATCHABLE_FUNCTION_ENTRY
819+#define FTRACE_CALLSITE_SECTION "__patchable_function_entries"
820+#else
821+#define FTRACE_CALLSITE_SECTION "__mcount_loc"
822+#endif
712823 #else
713824 static inline void ftrace_init(void) { }
714825 #endif
include/linux/futex.h+27−13
@@ -2,7 +2,9 @@ · 1 unmodified line
22 #ifndef _LINUX_FUTEX_H
33 #define _LINUX_FUTEX_H
44
5+#include <linux/sched.h>
56 #include <linux/ktime.h>
7+
68 #include <uapi/linux/futex.h>
79
810 struct inode;
@@ -48,15 +50,35 @@ union futex_key { · 39 unmodified lines
4850 #define FUTEX_KEY_INIT (union futex_key) { .both = { .ptr = NULL } }
4951
5052 #ifdef CONFIG_FUTEX
51−extern void exit_robust_list(struct task_struct *curr);
53+enum {
54+ FUTEX_STATE_OK,
55+ FUTEX_STATE_EXITING,
56+ FUTEX_STATE_DEAD,
57+};
5258
53−long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
54− u32 __user *uaddr2, u32 val2, u32 val3);
55−#else
56−static inline void exit_robust_list(struct task_struct *curr)
59+static inline void futex_init_task(struct task_struct *tsk)
5760 {
61+ tsk->robust_list = NULL;
62+#ifdef CONFIG_COMPAT
63+ tsk->compat_robust_list = NULL;
64+#endif
65+ INIT_LIST_HEAD(&tsk->pi_state_list);
66+ tsk->pi_state_cache = NULL;
67+ tsk->futex_state = FUTEX_STATE_OK;
68+ mutex_init(&tsk->futex_exit_mutex);
5869 }
5970
71+void futex_exit_recursive(struct task_struct *tsk);
72+void futex_exit_release(struct task_struct *tsk);
73+void futex_exec_release(struct task_struct *tsk);
74+
75+long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
76+ u32 __user *uaddr2, u32 val2, u32 val3);
77+#else
78+static inline void futex_init_task(struct task_struct *tsk) { }
79+static inline void futex_exit_recursive(struct task_struct *tsk) { }
80+static inline void futex_exit_release(struct task_struct *tsk) { }
81+static inline void futex_exec_release(struct task_struct *tsk) { }
6082 static inline long do_futex(u32 __user *uaddr, int op, u32 val,
6183 ktime_t *timeout, u32 __user *uaddr2,
6284 u32 val2, u32 val3)
@@ -65,12 +87,4 @@ static inline long do_futex(u32 __user *uaddr, int op, u32 val, · 2 unmodified lines
6587 }
6688 #endif
6789
68−#ifdef CONFIG_FUTEX_PI
69−extern void exit_pi_state_list(struct task_struct *curr);
70−#else
71−static inline void exit_pi_state_list(struct task_struct *curr)
72−{
73−}
74−#endif
75−
7690 #endif
include/linux/fwnode.h+49−3
@@ -17,6 +17,7 @@ struct device; · 16 unmodified lines
1717 struct fwnode_handle {
1818 struct fwnode_handle *secondary;
1919 const struct fwnode_operations *ops;
20+ struct device *dev;
2021 };
2122
2223 /**
@@ -49,13 +50,15 @@ struct fwnode_reference_args { · 26 unmodified lines
4950 * struct fwnode_operations - Operations for fwnode interface
5051 * @get: Get a reference to an fwnode.
5152 * @put: Put a reference to an fwnode.
53+ * @device_is_available: Return true if the device is available.
5254 * @device_get_match_data: Return the device driver match data.
5355 * @property_present: Return true if a property is present.
54− * @property_read_integer_array: Read an array of integer properties. Return
55− * zero on success, a negative error code
56− * otherwise.
56+ * @property_read_int_array: Read an array of integer properties. Return zero on
57+ * success, a negative error code otherwise.
5758 * @property_read_string_array: Read an array of string properties. Return zero
5859 * on success, a negative error code otherwise.
60+ * @get_name: Return the name of an fwnode.
61+ * @get_name_prefix: Get a prefix for a node (for printing purposes).
5962 * @get_parent: Return the parent of an fwnode.
6063 * @get_next_child_node: Return the next child node in an iteration.
6164 * @get_named_child_node: Return a child node with a given name.
@@ -65,6 +68,44 @@ struct fwnode_reference_args { · 3 unmodified lines
6568 * endpoint node.
6669 * @graph_get_port_parent: Return the parent node of a port node.
6770 * @graph_parse_endpoint: Parse endpoint for port and endpoint id.
71+ * @add_links: Called after the device corresponding to the fwnode is added
72+ * using device_add(). The function is expected to create device
73+ * links to all the suppliers of the device that are available at
74+ * the time this function is called. The function must NOT stop
75+ * at the first failed device link if other unlinked supplier
76+ * devices are present in the system. This is necessary for the
77+ * driver/bus sync_state() callbacks to work correctly.
78+ *
79+ * For example, say Device-C depends on suppliers Device-S1 and
80+ * Device-S2 and the dependency is listed in that order in the
81+ * firmware. Say, S1 gets populated from the firmware after
82+ * late_initcall_sync(). Say S2 is populated and probed way
83+ * before that in device_initcall(). When C is populated, if this
84+ * add_links() function doesn't continue past a "failed linking to
85+ * S1" and continue linking C to S2, then S2 will get a
86+ * sync_state() callback before C is probed. This is because from
87+ * the perspective of S2, C was never a consumer when its
88+ * sync_state() evaluation is done. To avoid this, the add_links()
89+ * function has to go through all available suppliers of the
90+ * device (that corresponds to this fwnode) and link to them
91+ * before returning.
92+ *
93+ * If some suppliers are not yet available (indicated by an error
94+ * return value), this function will be called again when other
95+ * devices are added to allow creating device links to any newly
96+ * available suppliers.
97+ *
98+ * Return 0 if device links have been successfully created to all
99+ * the known suppliers of this device or if the supplier
100+ * information is not known.
101+ *
102+ * Return -ENODEV if the suppliers needed for probing this device
103+ * have not been registered yet (because device links can only be
104+ * created to devices registered with the driver core).
105+ *
106+ * Return -EAGAIN if some of the suppliers of this device have not
107+ * been registered yet, but none of those suppliers are necessary
108+ * for probing the device.
68109 */
69110 struct fwnode_operations {
70111 struct fwnode_handle *(*get)(struct fwnode_handle *fwnode);
@@ -82,6 +123,8 @@ struct fwnode_operations { · 11 unmodified lines
82123 (*property_read_string_array)(const struct fwnode_handle *fwnode_handle,
83124 const char *propname, const char **val,
84125 size_t nval);
126+ const char *(*get_name)(const struct fwnode_handle *fwnode);
127+ const char *(*get_name_prefix)(const struct fwnode_handle *fwnode);
85128 struct fwnode_handle *(*get_parent)(const struct fwnode_handle *fwnode);
86129 struct fwnode_handle *
87130 (*get_next_child_node)(const struct fwnode_handle *fwnode,
@@ -102,6 +145,8 @@ struct fwnode_operations { · 14 unmodified lines
102145 (*graph_get_port_parent)(struct fwnode_handle *fwnode);
103146 int (*graph_parse_endpoint)(const struct fwnode_handle *fwnode,
104147 struct fwnode_endpoint *endpoint);
148+ int (*add_links)(const struct fwnode_handle *fwnode,
149+ struct device *dev);
105150 };
106151
107152 #define fwnode_has_op(fwnode, op) \
@@ -123,5 +168,6 @@ struct fwnode_operations { · 15 unmodified lines
123168 if (fwnode_has_op(fwnode, op)) \
124169 (fwnode)->ops->op(fwnode, ## __VA_ARGS__); \
125170 } while (false)
171+#define get_dev_from_fwnode(fwnode) get_device((fwnode)->dev)
126172
127173 #endif
include/linux/genalloc.h+1−1
@@ -206,7 +206,7 @@ extern struct gen_pool *devm_gen_pool_create(struct device *dev, · 205 unmodified lines
206206 int min_alloc_order, int nid, const char *name);
207207 extern struct gen_pool *gen_pool_get(struct device *dev, const char *name);
208208
209−bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start,
209+extern bool gen_pool_has_addr(struct gen_pool *pool, unsigned long start,
210210 size_t size);
211211
212212 #ifdef CONFIG_OF
include/linux/genhd.h+3−2
@@ -621,9 +621,10 @@ extern void blk_invalidate_devt(dev_t devt); · 620 unmodified lines
621621 extern dev_t blk_lookup_devt(const char *name, int partno);
622622 extern char *disk_name (struct gendisk *hd, int partno, char *buf);
623623
624+int bdev_disk_changed(struct block_device *bdev, bool invalidate);
625+int blk_add_partitions(struct gendisk *disk, struct block_device *bdev);
626+int blk_drop_partitions(struct gendisk *disk, struct block_device *bdev);
624627 extern int disk_expand_part_tbl(struct gendisk *disk, int target);
625−extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev);
626−extern int invalidate_partitions(struct gendisk *disk, struct block_device *bdev);
627628 extern struct hd_struct * __must_check add_partition(struct gendisk *disk,
628629 int partno, sector_t start,
629630 sector_t len, int flags,
include/linux/gfp.h+2−0
@@ -612,6 +612,8 @@ static inline bool pm_suspended_storage(void) · 611 unmodified lines
612612 /* The below functions must be run on a range from a single zone. */
613613 extern int alloc_contig_range(unsigned long start, unsigned long end,
614614 unsigned migratetype, gfp_t gfp_mask);
615+extern struct page *alloc_contig_pages(unsigned long nr_pages, gfp_t gfp_mask,
616+ int nid, nodemask_t *nodemask);
615617 #endif
616618 void free_contig_range(unsigned long pfn, unsigned int nr_pages);
617619
include/linux/gpio/consumer.h+44−10
@@ -176,11 +176,15 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, · 175 unmodified lines
176176 const char *propname, int index,
177177 enum gpiod_flags dflags,
178178 const char *label);
179−struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev,
180− const char *con_id, int index,
181− struct fwnode_handle *child,
182− enum gpiod_flags flags,
183− const char *label);
179+struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode,
180+ const char *con_id, int index,
181+ enum gpiod_flags flags,
182+ const char *label);
183+struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
184+ struct fwnode_handle *child,
185+ const char *con_id, int index,
186+ enum gpiod_flags flags,
187+ const char *label);
184188
185189 #else /* CONFIG_GPIOLIB */
186190
@@ -531,6 +535,38 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, · 344 unmodified lines
531535 return ERR_PTR(-ENOSYS);
532536 }
533537
538+static inline
539+struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode,
540+ const char *con_id, int index,
541+ enum gpiod_flags flags,
542+ const char *label)
543+{
544+ return ERR_PTR(-ENOSYS);
545+}
546+
547+static inline
548+struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
549+ struct fwnode_handle *fwnode,
550+ const char *con_id, int index,
551+ enum gpiod_flags flags,
552+ const char *label)
553+{
554+ return ERR_PTR(-ENOSYS);
555+}
556+
557+#endif /* CONFIG_GPIOLIB */
558+
559+static inline
560+struct gpio_desc *devm_fwnode_gpiod_get(struct device *dev,
561+ struct fwnode_handle *fwnode,
562+ const char *con_id,
563+ enum gpiod_flags flags,
564+ const char *label)
565+{
566+ return devm_fwnode_gpiod_get_index(dev, fwnode, con_id, 0,
567+ flags, label);
568+}
569+
534570 static inline
535571 struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev,
536572 const char *con_id, int index,
@@ -538,11 +574,10 @@ struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev, · 1 unmodified line
538574 enum gpiod_flags flags,
539575 const char *label)
540576 {
541− return ERR_PTR(-ENOSYS);
577+ return devm_fwnode_gpiod_get_index(dev, child, con_id, index,
578+ flags, label);
542579 }
543580
544−#endif /* CONFIG_GPIOLIB */
545−
546581 static inline
547582 struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev,
548583 const char *con_id,
@@ -550,8 +585,7 @@ struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev, · 1 unmodified line
550585 enum gpiod_flags flags,
551586 const char *label)
552587 {
553− return devm_fwnode_get_index_gpiod_from_child(dev, con_id, 0, child,
554− flags, label);
588+ return devm_fwnode_gpiod_get_index(dev, child, con_id, 0, flags, label);
555589 }
556590
557591 #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_OF_GPIO)
include/linux/gpio/driver.h+8−0
@@ -22,6 +22,9 @@ enum gpio_lookup_flags; · 21 unmodified lines
2222
2323 struct gpio_chip;
2424
25+#define GPIO_LINE_DIRECTION_IN 1
26+#define GPIO_LINE_DIRECTION_OUT 0
27+
2528 /**
2629 * struct gpio_irq_chip - GPIO interrupt controller
2730 */
@@ -286,6 +289,9 @@ struct gpio_irq_chip { · 258 unmodified lines
286289 * state (such as pullup/pulldown configuration).
287290 * @init_valid_mask: optional routine to initialize @valid_mask, to be used if
288291 * not all GPIOs are valid.
292+ * @add_pin_ranges: optional routine to initialize pin ranges, to be used when
293+ * requires special mapping of the pins that provides GPIO functionality.
294+ * It is called after adding GPIO chip and before adding IRQ chip.
289295 * @base: identifies the first GPIO number handled by this chip;
290296 * or, if negative during registration, requests dynamic ID allocation.
291297 * DEPRECATION: providing anything non-negative and nailing the base
@@ -376,6 +382,8 @@ struct gpio_chip { · 84 unmodified lines
376382 unsigned long *valid_mask,
377383 unsigned int ngpios);
378384
385+ int (*add_pin_ranges)(struct gpio_chip *chip);
386+
379387 int base;
380388 u16 ngpio;
381389 const char *const *names;
include/linux/hmm.h+14−176
@@ -62,37 +62,12 @@ · 61 unmodified lines
6262 #include <linux/kconfig.h>
6363 #include <asm/pgtable.h>
6464
65−#ifdef CONFIG_HMM_MIRROR
66−
6765 #include <linux/device.h>
6866 #include <linux/migrate.h>
6967 #include <linux/memremap.h>
7068 #include <linux/completion.h>
7169 #include <linux/mmu_notifier.h>
7270
73−
74−/*
75− * struct hmm - HMM per mm struct
76− *
77− * @mm: mm struct this HMM struct is bound to
78− * @lock: lock protecting ranges list
79− * @ranges: list of range being snapshotted
80− * @mirrors: list of mirrors for this mm
81− * @mmu_notifier: mmu notifier to track updates to CPU page table
82− * @mirrors_sem: read/write semaphore protecting the mirrors list
83− * @wq: wait queue for user waiting on a range invalidation
84− * @notifiers: count of active mmu notifiers
85− */
86−struct hmm {
87− struct mmu_notifier mmu_notifier;
88− spinlock_t ranges_lock;
89− struct list_head ranges;
90− struct list_head mirrors;
91− struct rw_semaphore mirrors_sem;
92− wait_queue_head_t wq;
93− long notifiers;
94−};
95−
9671 /*
9772 * hmm_pfn_flag_e - HMM flag enums
9873 *
@@ -145,6 +120,8 @@ enum hmm_pfn_value_e { · 46 unmodified lines
145120 /*
146121 * struct hmm_range - track invalidation lock on virtual address range
147122 *
123+ * @notifier: a mmu_interval_notifier that includes the start/end
124+ * @notifier_seq: result of mmu_interval_read_begin()
148125 * @hmm: the core HMM structure this range is active against
149126 * @vma: the vm area struct for the range
150127 * @list: all range lock are on a list
@@ -159,8 +136,8 @@ enum hmm_pfn_value_e { · 8 unmodified lines
159136 * @valid: pfns array did not change since it has been fill by an HMM function
160137 */
161138 struct hmm_range {
162− struct hmm *hmm;
163− struct list_head list;
139+ struct mmu_interval_notifier *notifier;
140+ unsigned long notifier_seq;
164141 unsigned long start;
165142 unsigned long end;
166143 uint64_t *pfns;
@@ -169,32 +146,8 @@ struct hmm_range { · 2 unmodified lines
169146 uint64_t default_flags;
170147 uint64_t pfn_flags_mask;
171148 uint8_t pfn_shift;
172− bool valid;
173149 };
174150
175−/*
176− * hmm_range_wait_until_valid() - wait for range to be valid
177− * @range: range affected by invalidation to wait on
178− * @timeout: time out for wait in ms (ie abort wait after that period of time)
179− * Return: true if the range is valid, false otherwise.
180− */
181−static inline bool hmm_range_wait_until_valid(struct hmm_range *range,
182− unsigned long timeout)
183−{
184− return wait_event_timeout(range->hmm->wq, range->valid,
185− msecs_to_jiffies(timeout)) != 0;
186−}
187−
188−/*
189− * hmm_range_valid() - test if a range is valid or not
190− * @range: range
191− * Return: true if the range is valid, false otherwise.
192− */
193−static inline bool hmm_range_valid(struct hmm_range *range)
194−{
195− return range->valid;
196−}
197−
198151 /*
199152 * hmm_device_entry_to_page() - return struct page pointed to by a device entry
200153 * @range: range use to decode device entry value
@@ -264,120 +217,6 @@ static inline uint64_t hmm_device_entry_from_pfn(const struct hmm_range *range, · 63 unmodified lines
264217 range->flags[HMM_PFN_VALID];
265218 }
266219
267−/*
268− * Mirroring: how to synchronize device page table with CPU page table.
269− *
270− * A device driver that is participating in HMM mirroring must always
271− * synchronize with CPU page table updates. For this, device drivers can either
272− * directly use mmu_notifier APIs or they can use the hmm_mirror API. Device
273− * drivers can decide to register one mirror per device per process, or just
274− * one mirror per process for a group of devices. The pattern is:
275− *
276− * int device_bind_address_space(..., struct mm_struct *mm, ...)
277− * {
278− * struct device_address_space *das;
279− *
280− * // Device driver specific initialization, and allocation of das
281− * // which contains an hmm_mirror struct as one of its fields.
282− * ...
283− *
284− * ret = hmm_mirror_register(&das->mirror, mm, &device_mirror_ops);
285− * if (ret) {
286− * // Cleanup on error
287− * return ret;
288− * }
289− *
290− * // Other device driver specific initialization
291− * ...
292− * }
293− *
294− * Once an hmm_mirror is registered for an address space, the device driver
295− * will get callbacks through sync_cpu_device_pagetables() operation (see
296− * hmm_mirror_ops struct).
297− *
298− * Device driver must not free the struct containing the hmm_mirror struct
299− * before calling hmm_mirror_unregister(). The expected usage is to do that when
300− * the device driver is unbinding from an address space.
301− *
302− *
303− * void device_unbind_address_space(struct device_address_space *das)
304− * {
305− * // Device driver specific cleanup
306− * ...
307− *
308− * hmm_mirror_unregister(&das->mirror);
309− *
310− * // Other device driver specific cleanup, and now das can be freed
311− * ...
312− * }
313− */
314−
315−struct hmm_mirror;
316−
317−/*
318− * struct hmm_mirror_ops - HMM mirror device operations callback
319− *
320− * @update: callback to update range on a device
321− */
322−struct hmm_mirror_ops {
323− /* release() - release hmm_mirror
324− *
325− * @mirror: pointer to struct hmm_mirror
326− *
327− * This is called when the mm_struct is being released. The callback
328− * must ensure that all access to any pages obtained from this mirror
329− * is halted before the callback returns. All future access should
330− * fault.
331− */
332− void (*release)(struct hmm_mirror *mirror);
333−
334− /* sync_cpu_device_pagetables() - synchronize page tables
335− *
336− * @mirror: pointer to struct hmm_mirror
337− * @update: update information (see struct mmu_notifier_range)
338− * Return: -EAGAIN if mmu_notifier_range_blockable(update) is false
339− * and callback needs to block, 0 otherwise.
340− *
341− * This callback ultimately originates from mmu_notifiers when the CPU
342− * page table is updated. The device driver must update its page table
343− * in response to this callback. The update argument tells what action
344− * to perform.
345− *
346− * The device driver must not return from this callback until the device
347− * page tables are completely updated (TLBs flushed, etc); this is a
348− * synchronous call.
349− */
350− int (*sync_cpu_device_pagetables)(
351− struct hmm_mirror *mirror,
352− const struct mmu_notifier_range *update);
353−};
354−
355−/*
356− * struct hmm_mirror - mirror struct for a device driver
357− *
358− * @hmm: pointer to struct hmm (which is unique per mm_struct)
359− * @ops: device driver callback for HMM mirror operations
360− * @list: for list of mirrors of a given mm
361− *
362− * Each address space (mm_struct) being mirrored by a device must register one
363− * instance of an hmm_mirror struct with HMM. HMM will track the list of all
364− * mirrors for each mm_struct.
365− */
366−struct hmm_mirror {
367− struct hmm *hmm;
368− const struct hmm_mirror_ops *ops;
369− struct list_head list;
370−};
371−
372−int hmm_mirror_register(struct hmm_mirror *mirror, struct mm_struct *mm);
373−void hmm_mirror_unregister(struct hmm_mirror *mirror);
374−
375−/*
376− * Please see Documentation/vm/hmm.rst for how to use the range API.
377− */
378−int hmm_range_register(struct hmm_range *range, struct hmm_mirror *mirror);
379−void hmm_range_unregister(struct hmm_range *range);
380−
381220 /*
382221 * Retry fault if non-blocking, drop mmap_sem and return -EAGAIN in that case.
383222 */
@@ -386,16 +225,17 @@ void hmm_range_unregister(struct hmm_range *range); · 2 unmodified lines
386225 /* Don't fault in missing PTEs, just snapshot the current state. */
387226 #define HMM_FAULT_SNAPSHOT (1 << 1)
388227
228+#ifdef CONFIG_HMM_MIRROR
229+/*
230+ * Please see Documentation/vm/hmm.rst for how to use the range API.
231+ */
389232 long hmm_range_fault(struct hmm_range *range, unsigned int flags);
390−
391−long hmm_range_dma_map(struct hmm_range *range,
392− struct device *device,
393− dma_addr_t *daddrs,
394− unsigned int flags);
395−long hmm_range_dma_unmap(struct hmm_range *range,
396− struct device *device,
397− dma_addr_t *daddrs,
398− bool dirty);
233+#else
234+static inline long hmm_range_fault(struct hmm_range *range, unsigned int flags)
235+{
236+ return -EOPNOTSUPP;
237+}
238+#endif
399239
400240 /*
401241 * HMM_RANGE_DEFAULT_TIMEOUT - default timeout (ms) when waiting for a range
@@ -406,6 +246,4 @@ long hmm_range_dma_unmap(struct hmm_range *range, · 4 unmodified lines
406246 */
407247 #define HMM_RANGE_DEFAULT_TIMEOUT 1000
408248
409−#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
410−
411249 #endif /* LINUX_HMM_H */
include/linux/host1x.h+18−8
@@ -18,6 +18,7 @@ enum host1x_class { · 17 unmodified lines
1818 };
1919
2020 struct host1x_client;
21+struct iommu_group;
2122
2223 /**
2324 * struct host1x_client_ops - host1x client operations
@@ -34,6 +35,7 @@ struct host1x_client_ops { · 10 unmodified lines
3435 * @list: list node for the host1x client
3536 * @parent: pointer to struct device representing the host1x controller
3637 * @dev: pointer to struct device backing this host1x client
38+ * @group: IOMMU group that this client is a member of
3739 * @ops: host1x client operations
3840 * @class: host1x class represented by this client
3941 * @channel: host1x channel associated with this client
@@ -44,6 +46,7 @@ struct host1x_client { · 4 unmodified lines
4446 struct list_head list;
4547 struct device *parent;
4648 struct device *dev;
49+ struct iommu_group *group;
4750
4851 const struct host1x_client_ops *ops;
4952
@@ -64,8 +67,9 @@ struct sg_table; · 14 unmodified lines
6467 struct host1x_bo_ops {
6568 struct host1x_bo *(*get)(struct host1x_bo *bo);
6669 void (*put)(struct host1x_bo *bo);
67− dma_addr_t (*pin)(struct host1x_bo *bo, struct sg_table **sgt);
68− void (*unpin)(struct host1x_bo *bo, struct sg_table *sgt);
70+ struct sg_table *(*pin)(struct device *dev, struct host1x_bo *bo,
71+ dma_addr_t *phys);
72+ void (*unpin)(struct device *dev, struct sg_table *sgt);
6973 void *(*mmap)(struct host1x_bo *bo);
7074 void (*munmap)(struct host1x_bo *bo, void *addr);
7175 void *(*kmap)(struct host1x_bo *bo, unsigned int pagenum);
@@ -92,15 +96,17 @@ static inline void host1x_bo_put(struct host1x_bo *bo) · 20 unmodified lines
9296 bo->ops->put(bo);
9397 }
9498
95−static inline dma_addr_t host1x_bo_pin(struct host1x_bo *bo,
96− struct sg_table **sgt)
99+static inline struct sg_table *host1x_bo_pin(struct device *dev,
100+ struct host1x_bo *bo,
101+ dma_addr_t *phys)
97102 {
98− return bo->ops->pin(bo, sgt);
103+ return bo->ops->pin(dev, bo, phys);
99104 }
100105
101−static inline void host1x_bo_unpin(struct host1x_bo *bo, struct sg_table *sgt)
106+static inline void host1x_bo_unpin(struct device *dev, struct host1x_bo *bo,
107+ struct sg_table *sgt)
102108 {
103− bo->ops->unpin(bo, sgt);
109+ bo->ops->unpin(dev, sgt);
104110 }
105111
106112 static inline void *host1x_bo_mmap(struct host1x_bo *bo)
@@ -158,7 +164,7 @@ u32 host1x_syncpt_base_id(struct host1x_syncpt_base *base); · 51 unmodified lines
158164 struct host1x_channel;
159165 struct host1x_job;
160166
161−struct host1x_channel *host1x_channel_request(struct device *dev);
167+struct host1x_channel *host1x_channel_request(struct host1x_client *client);
162168 struct host1x_channel *host1x_channel_get(struct host1x_channel *channel);
163169 void host1x_channel_put(struct host1x_channel *channel);
164170 int host1x_job_submit(struct host1x_job *job);
@@ -167,6 +173,9 @@ int host1x_job_submit(struct host1x_job *job); · 2 unmodified lines
167173 * host1x job
168174 */
169175
176+#define HOST1X_RELOC_READ (1 << 0)
177+#define HOST1X_RELOC_WRITE (1 << 1)
178+
170179 struct host1x_reloc {
171180 struct {
172181 struct host1x_bo *bo;
@@ -177,6 +186,7 @@ struct host1x_reloc { · 4 unmodified lines
177186 unsigned long offset;
178187 } target;
179188 unsigned long shift;
189+ unsigned long flags;
180190 };
181191
182192 struct host1x_job {
include/linux/hrtimer.h+10−4
@@ -456,12 +456,18 @@ extern u64 hrtimer_next_event_without(const struct hrtimer *exclude); · 455 unmodified lines
456456
457457 extern bool hrtimer_active(const struct hrtimer *timer);
458458
459−/*
460− * Helper function to check, whether the timer is on one of the queues
459+/**
460+ * hrtimer_is_queued = check, whether the timer is on one of the queues
461+ * @timer: Timer to check
462+ *
463+ * Returns: True if the timer is queued, false otherwise
464+ *
465+ * The function can be used lockless, but it gives only a current snapshot.
461466 */
462−static inline int hrtimer_is_queued(struct hrtimer *timer)
467+static inline bool hrtimer_is_queued(struct hrtimer *timer)
463468 {
464− return timer->state & HRTIMER_STATE_ENQUEUED;
469+ /* The READ_ONCE pairs with the update functions of timer->state */
470+ return !!(READ_ONCE(timer->state) & HRTIMER_STATE_ENQUEUED);
465471 }
466472
467473 /*
include/linux/huge_mm.h+0−2
@@ -216,7 +216,6 @@ static inline int is_swap_pmd(pmd_t pmd) · 215 unmodified lines
216216 static inline spinlock_t *pmd_trans_huge_lock(pmd_t *pmd,
217217 struct vm_area_struct *vma)
218218 {
219− VM_BUG_ON_VMA(!rwsem_is_locked(&vma->vm_mm->mmap_sem), vma);
220219 if (is_swap_pmd(*pmd) || pmd_trans_huge(*pmd) || pmd_devmap(*pmd))
221220 return __pmd_trans_huge_lock(pmd, vma);
222221 else
@@ -225,7 +224,6 @@ static inline spinlock_t *pmd_trans_huge_lock(pmd_t *pmd, · 2 unmodified lines
225224 static inline spinlock_t *pud_trans_huge_lock(pud_t *pud,
226225 struct vm_area_struct *vma)
227226 {
228− VM_BUG_ON_VMA(!rwsem_is_locked(&vma->vm_mm->mmap_sem), vma);
229227 if (pud_trans_huge(*pud) || pud_devmap(*pud))
230228 return __pud_trans_huge_lock(pud, vma);
231229 else
include/linux/hugetlb.h+116−24
@@ -105,8 +105,7 @@ void move_hugetlb_state(struct page *oldpage, struct page *newpage, int reason); · 104 unmodified lines
105105 void free_huge_page(struct page *page);
106106 void hugetlb_fix_reserve_counts(struct inode *inode);
107107 extern struct mutex *hugetlb_fault_mutex_table;
108−u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping,
109− pgoff_t idx, unsigned long address);
108+u32 hugetlb_fault_mutex_hash(struct address_space *mapping, pgoff_t idx);
110109
111110 pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud);
112111
@@ -164,38 +163,130 @@ static inline void adjust_range_if_pmd_sharing_possible( · 51 unmodified lines
164163 {
165164 }
166165
167−#define follow_hugetlb_page(m,v,p,vs,a,b,i,w,n) ({ BUG(); 0; })
168−#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL)
169−#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
166+static inline long follow_hugetlb_page(struct mm_struct *mm,
167+ struct vm_area_struct *vma, struct page **pages,
168+ struct vm_area_struct **vmas, unsigned long *position,
169+ unsigned long *nr_pages, long i, unsigned int flags,
170+ int *nonblocking)
171+{
172+ BUG();
173+ return 0;
174+}
175+
176+static inline struct page *follow_huge_addr(struct mm_struct *mm,
177+ unsigned long address, int write)
178+{
179+ return ERR_PTR(-EINVAL);
180+}
181+
182+static inline int copy_hugetlb_page_range(struct mm_struct *dst,
183+ struct mm_struct *src, struct vm_area_struct *vma)
184+{
185+ BUG();
186+ return 0;
187+}
188+
170189 static inline void hugetlb_report_meminfo(struct seq_file *m)
171190 {
172191 }
173−#define hugetlb_report_node_meminfo(n, buf) 0
192+
193+static inline int hugetlb_report_node_meminfo(int nid, char *buf)
194+{
195+ return 0;
196+}
197+
174198 static inline void hugetlb_show_meminfo(void)
175199 {
176200 }
177−#define follow_huge_pd(vma, addr, hpd, flags, pdshift) NULL
178−#define follow_huge_pmd(mm, addr, pmd, flags) NULL
179−#define follow_huge_pud(mm, addr, pud, flags) NULL
180−#define follow_huge_pgd(mm, addr, pgd, flags) NULL
181−#define prepare_hugepage_range(file, addr, len) (-EINVAL)
182−#define pmd_huge(x) 0
183−#define pud_huge(x) 0
184−#define is_hugepage_only_range(mm, addr, len) 0
185−#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
186−#define hugetlb_mcopy_atomic_pte(dst_mm, dst_pte, dst_vma, dst_addr, \
187− src_addr, pagep) ({ BUG(); 0; })
188−#define huge_pte_offset(mm, address, sz) 0
201+
202+static inline struct page *follow_huge_pd(struct vm_area_struct *vma,
203+ unsigned long address, hugepd_t hpd, int flags,
204+ int pdshift)
205+{
206+ return NULL;
207+}
208+
209+static inline struct page *follow_huge_pmd(struct mm_struct *mm,
210+ unsigned long address, pmd_t *pmd, int flags)
211+{
212+ return NULL;
213+}
214+
215+static inline struct page *follow_huge_pud(struct mm_struct *mm,
216+ unsigned long address, pud_t *pud, int flags)
217+{
218+ return NULL;
219+}
220+
221+static inline struct page *follow_huge_pgd(struct mm_struct *mm,
222+ unsigned long address, pgd_t *pgd, int flags)
223+{
224+ return NULL;
225+}
226+
227+static inline int prepare_hugepage_range(struct file *file,
228+ unsigned long addr, unsigned long len)
229+{
230+ return -EINVAL;
231+}
232+
233+static inline int pmd_huge(pmd_t pmd)
234+{
235+ return 0;
236+}
237+
238+static inline int pud_huge(pud_t pud)
239+{
240+ return 0;
241+}
242+
243+static inline int is_hugepage_only_range(struct mm_struct *mm,
244+ unsigned long addr, unsigned long len)
245+{
246+ return 0;
247+}
248+
249+static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
250+ unsigned long addr, unsigned long end,
251+ unsigned long floor, unsigned long ceiling)
252+{
253+ BUG();
254+}
255+
256+static inline int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
257+ pte_t *dst_pte,
258+ struct vm_area_struct *dst_vma,
259+ unsigned long dst_addr,
260+ unsigned long src_addr,
261+ struct page **pagep)
262+{
263+ BUG();
264+ return 0;
265+}
266+
267+static inline pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr,
268+ unsigned long sz)
269+{
270+ return NULL;
271+}
189272
190273 static inline bool isolate_huge_page(struct page *page, struct list_head *list)
191274 {
192275 return false;
193276 }
194−#define putback_active_hugepage(p) do {} while (0)
195−#define move_hugetlb_state(old, new, reason) do {} while (0)
196277
197−static inline unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
198− unsigned long address, unsigned long end, pgprot_t newprot)
278+static inline void putback_active_hugepage(struct page *page)
279+{
280+}
281+
282+static inline void move_hugetlb_state(struct page *oldpage,
283+ struct page *newpage, int reason)
284+{
285+}
286+
287+static inline unsigned long hugetlb_change_protection(
288+ struct vm_area_struct *vma, unsigned long address,
289+ unsigned long end, pgprot_t newprot)
199290 {
200291 return 0;
201292 }
@@ -213,9 +304,10 @@ static inline void __unmap_hugepage_range(struct mmu_gather *tlb, · 11 unmodified lines
213304 {
214305 BUG();
215306 }
307+
216308 static inline vm_fault_t hugetlb_fault(struct mm_struct *mm,
217− struct vm_area_struct *vma, unsigned long address,
218− unsigned int flags)
309+ struct vm_area_struct *vma, unsigned long address,
310+ unsigned int flags)
219311 {
220312 BUG();
221313 return 0;
include/linux/hyperv.h+26−5
@@ -182,19 +182,21 @@ static inline u32 hv_get_avail_to_write_percent( · 181 unmodified lines
182182 * 2 . 4 (Windows 8)
183183 * 3 . 0 (Windows 8 R2)
184184 * 4 . 0 (Windows 10)
185+ * 4 . 1 (Windows 10 RS3)
185186 * 5 . 0 (Newer Windows 10)
187+ * 5 . 1 (Windows 10 RS4)
188+ * 5 . 2 (Windows Server 2019, RS5)
186189 */
187190
188191 #define VERSION_WS2008 ((0 << 16) | (13))
189192 #define VERSION_WIN7 ((1 << 16) | (1))
190193 #define VERSION_WIN8 ((2 << 16) | (4))
191194 #define VERSION_WIN8_1 ((3 << 16) | (0))
192−#define VERSION_WIN10 ((4 << 16) | (0))
195+#define VERSION_WIN10 ((4 << 16) | (0))
196+#define VERSION_WIN10_V4_1 ((4 << 16) | (1))
193197 #define VERSION_WIN10_V5 ((5 << 16) | (0))
194−
195−#define VERSION_INVAL -1
196−
197−#define VERSION_CURRENT VERSION_WIN10_V5
198+#define VERSION_WIN10_V5_1 ((5 << 16) | (1))
199+#define VERSION_WIN10_V5_2 ((5 << 16) | (2))
198200
199201 /* Make maximum size of pipe payload of 16K */
200202 #define MAX_PIPE_DATA_PAYLOAD (sizeof(u8) * 16384)
@@ -932,6 +934,21 @@ struct vmbus_channel { · 731 unmodified lines
932934 * full outbound ring buffer.
933935 */
934936 u64 out_full_first;
937+
938+ /* enabling/disabling fuzz testing on the channel (default is false)*/
939+ bool fuzz_testing_state;
940+
941+ /*
942+ * Interrupt delay will delay the guest from emptying the ring buffer
943+ * for a specific amount of time. The delay is in microseconds and will
944+ * be between 1 to a maximum of 1000, its default is 0 (no delay).
945+ * The Message delay will delay guest reading on a per message basis
946+ * in microseconds between 1 to 1000 with the default being 0
947+ * (no delay).
948+ */
949+ u32 fuzz_testing_interrupt_delay;
950+ u32 fuzz_testing_message_delay;
951+
935952 };
936953
937954 static inline bool is_hvsock_channel(const struct vmbus_channel *c)
@@ -1180,6 +1197,10 @@ struct hv_device { · 242 unmodified lines
11801197
11811198 struct vmbus_channel *channel;
11821199 struct kset *channels_kset;
1200+
1201+ /* place holder to keep track of the dir for hv device in debugfs */
1202+ struct dentry *debug_dir;
1203+
11831204 };
11841205
11851206
include/linux/i2c-pxa.h+0−18
@@ -1,18 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef _LINUX_I2C_ALGO_PXA_H
3−#define _LINUX_I2C_ALGO_PXA_H
4−
5−typedef enum i2c_slave_event_e {
6− I2C_SLAVE_EVENT_START_READ,
7− I2C_SLAVE_EVENT_START_WRITE,
8− I2C_SLAVE_EVENT_STOP
9−} i2c_slave_event_t;
10−
11−struct i2c_slave_client {
12− void *data;
13− void (*event)(void *ptr, i2c_slave_event_t event);
14− int (*read) (void *ptr);
15− void (*write)(void *ptr, unsigned int val);
16−};
17−
18−#endif /* _LINUX_I2C_ALGO_PXA_H */
include/linux/i2c.h+20−11
@@ -300,6 +300,7 @@ struct i2c_driver { · 299 unmodified lines
300300 * generic enough to hide second-sourcing and compatible revisions.
301301 * @adapter: manages the bus segment hosting this I2C device
302302 * @dev: Driver model device node for the slave.
303+ * @init_irq: IRQ that was set at initialization
303304 * @irq: indicates the IRQ generated by this device (if any)
304305 * @detected: member of an i2c_driver.clients list or i2c-core's
305306 * userspace_devices list
@@ -452,20 +453,20 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf · 146 unmodified lines
452453 * a default probing method is used.
453454 */
454455 extern struct i2c_client *
456+i2c_new_scanned_device(struct i2c_adapter *adap,
457+ struct i2c_board_info *info,
458+ unsigned short const *addr_list,
459+ int (*probe)(struct i2c_adapter *adap, unsigned short addr));
460+
461+extern struct i2c_client *
455462 i2c_new_probed_device(struct i2c_adapter *adap,
456− struct i2c_board_info *info,
457− unsigned short const *addr_list,
458− int (*probe)(struct i2c_adapter *adap, unsigned short addr));
463+ struct i2c_board_info *info,
464+ unsigned short const *addr_list,
465+ int (*probe)(struct i2c_adapter *adap, unsigned short addr));
459466
460467 /* Common custom probe functions */
461468 extern int i2c_probe_func_quick_read(struct i2c_adapter *adap, unsigned short addr);
462469
463−/* For devices that use several addresses, use i2c_new_dummy() to make
464− * client handles for the extra addresses.
465− */
466−extern struct i2c_client *
467−i2c_new_dummy(struct i2c_adapter *adap, u16 address);
468−
469470 extern struct i2c_client *
470471 i2c_new_dummy_device(struct i2c_adapter *adapter, u16 address);
471472
@@ -575,6 +576,10 @@ struct i2c_lock_operations { · 103 unmodified lines
575576 * @scl_int_delay_ns: time IP core additionally needs to setup SCL in ns
576577 * @sda_fall_ns: time SDA signal takes to fall in ns; t(f) in the I2C specification
577578 * @sda_hold_ns: time IP core additionally needs to hold SDA in ns
579+ * @digital_filter_width_ns: width in ns of spikes on i2c lines that the IP core
580+ * digital filter can filter out
581+ * @analog_filter_cutoff_freq_hz: threshold frequency for the low pass IP core
582+ * analog filter
578583 */
579584 struct i2c_timings {
580585 u32 bus_freq_hz;
@@ -583,6 +588,8 @@ struct i2c_timings { · 2 unmodified lines
583588 u32 scl_int_delay_ns;
584589 u32 sda_fall_ns;
585590 u32 sda_hold_ns;
591+ u32 digital_filter_width_ns;
592+ u32 analog_filter_cutoff_freq_hz;
586593 };
587594
588595 /**
@@ -844,8 +851,10 @@ extern void i2c_del_driver(struct i2c_driver *driver); · 255 unmodified lines
844851 #define i2c_add_driver(driver) \
845852 i2c_register_driver(THIS_MODULE, driver)
846853
847−extern struct i2c_client *i2c_use_client(struct i2c_client *client);
848−extern void i2c_release_client(struct i2c_client *client);
854+static inline bool i2c_client_has_driver(struct i2c_client *client)
855+{
856+ return !IS_ERR_OR_NULL(client) && client->dev.driver;
857+}
849858
850859 /* call the i2c_client->command() of all attached clients with
851860 * the given arguments */
include/linux/icmp.h+15−0
@@ -20,4 +20,19 @@ static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb) · 19 unmodified lines
2020 {
2121 return (struct icmphdr *)skb_transport_header(skb);
2222 }
23+
24+static inline bool icmp_is_err(int type)
25+{
26+ switch (type) {
27+ case ICMP_DEST_UNREACH:
28+ case ICMP_SOURCE_QUENCH:
29+ case ICMP_REDIRECT:
30+ case ICMP_TIME_EXCEEDED:
31+ case ICMP_PARAMETERPROB:
32+ return true;
33+ }
34+
35+ return false;
36+}
37+
2338 #endif /* _LINUX_ICMP_H */
include/linux/icmpv6.h+14−0
@@ -46,4 +46,18 @@ extern void icmpv6_flow_init(struct sock *sk, · 45 unmodified lines
4646 const struct in6_addr *saddr,
4747 const struct in6_addr *daddr,
4848 int oif);
49+
50+static inline bool icmpv6_is_err(int type)
51+{
52+ switch (type) {
53+ case ICMPV6_DEST_UNREACH:
54+ case ICMPV6_PKT_TOOBIG:
55+ case ICMPV6_TIME_EXCEED:
56+ case ICMPV6_PARAMPROB:
57+ return true;
58+ }
59+
60+ return false;
61+}
62+
4963 #endif
include/linux/iio/adc/ad_sigma_delta.h+2−0
@@ -119,6 +119,8 @@ int ad_sd_reset(struct ad_sigma_delta *sigma_delta, · 118 unmodified lines
119119
120120 int ad_sigma_delta_single_conversion(struct iio_dev *indio_dev,
121121 const struct iio_chan_spec *chan, int *val);
122+int ad_sd_calibrate(struct ad_sigma_delta *sigma_delta,
123+ unsigned int mode, unsigned int channel);
122124 int ad_sd_calibrate_all(struct ad_sigma_delta *sigma_delta,
123125 const struct ad_sd_calib_data *cd, unsigned int n);
124126 int ad_sd_init(struct ad_sigma_delta *sigma_delta, struct iio_dev *indio_dev,
include/linux/iio/iio.h+2−0
@@ -510,6 +510,7 @@ struct iio_buffer_setup_ops { · 509 unmodified lines
510510 * attributes
511511 * @chan_attr_group: [INTERN] group for all attrs in base directory
512512 * @name: [DRIVER] name of the device.
513+ * @label: [DRIVER] unique name to identify which device this is
513514 * @info: [DRIVER] callbacks and constant info from driver
514515 * @clock_id: [INTERN] timestamping clock posix identifier
515516 * @info_exist_lock: [INTERN] lock to prevent use during removal
@@ -553,6 +554,7 @@ struct iio_dev { · 37 unmodified lines
553554 struct list_head channel_attr_list;
554555 struct attribute_group chan_attr_group;
555556 const char *name;
557+ const char *label;
556558 const struct iio_info *info;
557559 clockid_t clock_id;
558560 struct mutex info_exist_lock;
include/linux/iio/imu/adis.h+4−2
@@ -129,7 +129,8 @@ static inline int adis_read_reg_16(struct adis *adis, unsigned int reg, · 128 unmodified lines
129129 int ret;
130130
131131 ret = adis_read_reg(adis, reg, &tmp, 2);
132− *val = tmp;
132+ if (ret == 0)
133+ *val = tmp;
133134
134135 return ret;
135136 }
@@ -147,7 +148,8 @@ static inline int adis_read_reg_32(struct adis *adis, unsigned int reg, · 11 unmodified lines
147148 int ret;
148149
149150 ret = adis_read_reg(adis, reg, &tmp, 4);
150− *val = tmp;
151+ if (ret == 0)
152+ *val = tmp;
151153
152154 return ret;
153155 }
include/linux/ima.h+2−1
@@ -29,7 +29,8 @@ extern void ima_kexec_cmdline(const void *buf, int size); · 28 unmodified lines
2929 extern void ima_add_kexec_buffer(struct kimage *image);
3030 #endif
3131
32−#if (defined(CONFIG_X86) && defined(CONFIG_EFI)) || defined(CONFIG_S390)
32+#if (defined(CONFIG_X86) && defined(CONFIG_EFI)) || defined(CONFIG_S390) \
33+ || defined(CONFIG_PPC_SECURE_BOOT)
3334 extern bool arch_ima_get_secureboot(void);
3435 extern const char * const *arch_get_ima_policy(void);
3536 #else
include/linux/initrd.h+2−0
@@ -28,3 +28,5 @@ extern unsigned int real_root_dev; · 27 unmodified lines
2828
2929 extern char __initramfs_start[];
3030 extern unsigned long __initramfs_size;
31+
32+void console_on_rootfs(void);
include/linux/input.h+1−0
@@ -383,6 +383,7 @@ int input_setup_polling(struct input_dev *dev, · 382 unmodified lines
383383 void input_set_poll_interval(struct input_dev *dev, unsigned int interval);
384384 void input_set_min_poll_interval(struct input_dev *dev, unsigned int interval);
385385 void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval);
386+int input_get_poll_interval(struct input_dev *dev);
386387
387388 int __must_check input_register_handler(struct input_handler *);
388389 void input_unregister_handler(struct input_handler *);
include/linux/interrupt.h+14−2
@@ -140,6 +140,19 @@ request_threaded_irq(unsigned int irq, irq_handler_t handler, · 139 unmodified lines
140140 irq_handler_t thread_fn,
141141 unsigned long flags, const char *name, void *dev);
142142
143+/**
144+ * request_irq - Add a handler for an interrupt line
145+ * @irq: The interrupt line to allocate
146+ * @handler: Function to be called when the IRQ occurs.
147+ * Primary handler for threaded interrupts
148+ * If NULL, the default primary handler is installed
149+ * @flags: Handling flags
150+ * @name: Name of the device generating this interrupt
151+ * @dev: A cookie passed to the handler function
152+ *
153+ * This call allocates an interrupt and establishes a handler; see
154+ * the documentation for request_threaded_irq() for details.
155+ */
143156 static inline int __must_check
144157 request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
145158 const char *name, void *dev)
@@ -520,8 +533,7 @@ enum · 374 unmodified lines
520533 IRQ_POLL_SOFTIRQ,
521534 TASKLET_SOFTIRQ,
522535 SCHED_SOFTIRQ,
523− HRTIMER_SOFTIRQ, /* Unused, but kept as tools rely on the
524− numbering. Sigh! */
536+ HRTIMER_SOFTIRQ,
525537 RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */
526538
527539 NR_SOFTIRQS
include/linux/io-pgtable.h+1−1
@@ -102,7 +102,7 @@ struct io_pgtable_cfg { · 101 unmodified lines
102102 struct {
103103 u64 ttbr[2];
104104 u64 tcr;
105− u64 mair[2];
105+ u64 mair;
106106 } arm_lpae_s1_cfg;
107107
108108 struct {
include/linux/io.h+2−0
@@ -64,6 +64,8 @@ static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr) · 63 unmodified lines
6464
6565 void __iomem *devm_ioremap(struct device *dev, resource_size_t offset,
6666 resource_size_t size);
67+void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset,
68+ resource_size_t size);
6769 void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset,
6870 resource_size_t size);
6971 void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset,
include/linux/ioasid.h+76−0
@@ -0,0 +1,76 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __LINUX_IOASID_H
3+#define __LINUX_IOASID_H
4+
5+#include <linux/types.h>
6+#include <linux/errno.h>
7+
8+#define INVALID_IOASID ((ioasid_t)-1)
9+typedef unsigned int ioasid_t;
10+typedef ioasid_t (*ioasid_alloc_fn_t)(ioasid_t min, ioasid_t max, void *data);
11+typedef void (*ioasid_free_fn_t)(ioasid_t ioasid, void *data);
12+
13+struct ioasid_set {
14+ int dummy;
15+};
16+
17+/**
18+ * struct ioasid_allocator_ops - IOASID allocator helper functions and data
19+ *
20+ * @alloc: helper function to allocate IOASID
21+ * @free: helper function to free IOASID
22+ * @list: for tracking ops that share helper functions but not data
23+ * @pdata: data belong to the allocator, provided when calling alloc()
24+ */
25+struct ioasid_allocator_ops {
26+ ioasid_alloc_fn_t alloc;
27+ ioasid_free_fn_t free;
28+ struct list_head list;
29+ void *pdata;
30+};
31+
32+#define DECLARE_IOASID_SET(name) struct ioasid_set name = { 0 }
33+
34+#if IS_ENABLED(CONFIG_IOASID)
35+ioasid_t ioasid_alloc(struct ioasid_set *set, ioasid_t min, ioasid_t max,
36+ void *private);
37+void ioasid_free(ioasid_t ioasid);
38+void *ioasid_find(struct ioasid_set *set, ioasid_t ioasid,
39+ bool (*getter)(void *));
40+int ioasid_register_allocator(struct ioasid_allocator_ops *allocator);
41+void ioasid_unregister_allocator(struct ioasid_allocator_ops *allocator);
42+int ioasid_set_data(ioasid_t ioasid, void *data);
43+
44+#else /* !CONFIG_IOASID */
45+static inline ioasid_t ioasid_alloc(struct ioasid_set *set, ioasid_t min,
46+ ioasid_t max, void *private)
47+{
48+ return INVALID_IOASID;
49+}
50+
51+static inline void ioasid_free(ioasid_t ioasid)
52+{
53+}
54+
55+static inline void *ioasid_find(struct ioasid_set *set, ioasid_t ioasid,
56+ bool (*getter)(void *))
57+{
58+ return NULL;
59+}
60+
61+static inline int ioasid_register_allocator(struct ioasid_allocator_ops *allocator)
62+{
63+ return -ENOTSUPP;
64+}
65+
66+static inline void ioasid_unregister_allocator(struct ioasid_allocator_ops *allocator)
67+{
68+}
69+
70+static inline int ioasid_set_data(ioasid_t ioasid, void *data)
71+{
72+ return -ENOTSUPP;
73+}
74+
75+#endif /* CONFIG_IOASID */
76+#endif /* __LINUX_IOASID_H */
include/linux/iomap.h+95−34
@@ -4,6 +4,7 @@ · 3 unmodified lines
44
55 #include <linux/atomic.h>
66 #include <linux/bitmap.h>
7+#include <linux/blk_types.h>
78 #include <linux/mm.h>
89 #include <linux/types.h>
910 #include <linux/mm_types.h>
@@ -12,6 +13,7 @@ · 2 unmodified lines
1213 struct address_space;
1314 struct fiemap_extent_info;
1415 struct inode;
16+struct iomap_writepage_ctx;
1517 struct iov_iter;
1618 struct kiocb;
1719 struct page;
@@ -21,28 +23,45 @@ struct vm_fault; · 3 unmodified lines
2123 /*
2224 * Types of block ranges for iomap mappings:
2325 */
24−#define IOMAP_HOLE 0x01 /* no blocks allocated, need allocation */
25−#define IOMAP_DELALLOC 0x02 /* delayed allocation blocks */
26−#define IOMAP_MAPPED 0x03 /* blocks allocated at @addr */
27−#define IOMAP_UNWRITTEN 0x04 /* blocks allocated at @addr in unwritten state */
28−#define IOMAP_INLINE 0x05 /* data inline in the inode */
26+#define IOMAP_HOLE 0 /* no blocks allocated, need allocation */
27+#define IOMAP_DELALLOC 1 /* delayed allocation blocks */
28+#define IOMAP_MAPPED 2 /* blocks allocated at @addr */
29+#define IOMAP_UNWRITTEN 3 /* blocks allocated at @addr in unwritten state */
30+#define IOMAP_INLINE 4 /* data inline in the inode */
2931
3032 /*
31− * Flags for all iomap mappings:
33+ * Flags reported by the file system from iomap_begin:
34+ *
35+ * IOMAP_F_NEW indicates that the blocks have been newly allocated and need
36+ * zeroing for areas that no data is copied to.
3237 *
3338 * IOMAP_F_DIRTY indicates the inode has uncommitted metadata needed to access
3439 * written data and requires fdatasync to commit them to persistent storage.
40+ * This needs to take into account metadata changes that *may* be made at IO
41+ * completion, such as file size updates from direct IO.
42+ *
43+ * IOMAP_F_SHARED indicates that the blocks are shared, and will need to be
44+ * unshared as part a write.
45+ *
46+ * IOMAP_F_MERGED indicates that the iomap contains the merge of multiple block
47+ * mappings.
48+ *
49+ * IOMAP_F_BUFFER_HEAD indicates that the file system requires the use of
50+ * buffer heads for this mapping.
3551 */
36−#define IOMAP_F_NEW 0x01 /* blocks have been newly allocated */
37−#define IOMAP_F_DIRTY 0x02 /* uncommitted metadata */
38−#define IOMAP_F_BUFFER_HEAD 0x04 /* file system requires buffer heads */
39−#define IOMAP_F_SIZE_CHANGED 0x08 /* file size has changed */
52+#define IOMAP_F_NEW 0x01
53+#define IOMAP_F_DIRTY 0x02
54+#define IOMAP_F_SHARED 0x04
55+#define IOMAP_F_MERGED 0x08
56+#define IOMAP_F_BUFFER_HEAD 0x10
4057
4158 /*
42− * Flags that only need to be reported for IOMAP_REPORT requests:
59+ * Flags set by the core iomap code during operations:
60+ *
61+ * IOMAP_F_SIZE_CHANGED indicates to the iomap_end method that the file size
62+ * has changed as the result of this write operation.
4363 */
44−#define IOMAP_F_MERGED 0x10 /* contains multiple blocks/extents */
45−#define IOMAP_F_SHARED 0x20 /* block shared with another file */
64+#define IOMAP_F_SIZE_CHANGED 0x100
4665
4766 /*
4867 * Flags from 0x1000 up are for file system specific usage:
@@ -110,7 +129,8 @@ struct iomap_ops { · 61 unmodified lines
110129 * The actual length is returned in iomap->length.
111130 */
112131 int (*iomap_begin)(struct inode *inode, loff_t pos, loff_t length,
113− unsigned flags, struct iomap *iomap);
132+ unsigned flags, struct iomap *iomap,
133+ struct iomap *srcmap);
114134
115135 /*
116136 * Commit and/or unreserve space previous allocated using iomap_begin.
@@ -126,29 +146,12 @@ struct iomap_ops { · 9 unmodified lines
126146 * Main iomap iterator function.
127147 */
128148 typedef loff_t (*iomap_actor_t)(struct inode *inode, loff_t pos, loff_t len,
129− void *data, struct iomap *iomap);
149+ void *data, struct iomap *iomap, struct iomap *srcmap);
130150
131151 loff_t iomap_apply(struct inode *inode, loff_t pos, loff_t length,
132152 unsigned flags, const struct iomap_ops *ops, void *data,
133153 iomap_actor_t actor);
134154
135−/*
136− * Structure allocate for each page when block size < PAGE_SIZE to track
137− * sub-page uptodate status and I/O completions.
138− */
139−struct iomap_page {
140− atomic_t read_count;
141− atomic_t write_count;
142− DECLARE_BITMAP(uptodate, PAGE_SIZE / 512);
143−};
144−
145−static inline struct iomap_page *to_iomap_page(struct page *page)
146−{
147− if (page_has_private(page))
148− return (struct iomap_page *)page_private(page);
149− return NULL;
150−}
151−
152155 ssize_t iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *from,
153156 const struct iomap_ops *ops);
154157 int iomap_readpage(struct page *page, const struct iomap_ops *ops);
@@ -166,7 +169,7 @@ int iomap_migrate_page(struct address_space *mapping, struct page *newpage, · 11 unmodified lines
166169 #else
167170 #define iomap_migrate_page NULL
168171 #endif
169−int iomap_file_dirty(struct inode *inode, loff_t pos, loff_t len,
172+int iomap_file_unshare(struct inode *inode, loff_t pos, loff_t len,
170173 const struct iomap_ops *ops);
171174 int iomap_zero_range(struct inode *inode, loff_t pos, loff_t len,
172175 bool *did_zero, const struct iomap_ops *ops);
@@ -183,6 +186,63 @@ loff_t iomap_seek_data(struct inode *inode, loff_t offset, · 10 unmodified lines
183186 sector_t iomap_bmap(struct address_space *mapping, sector_t bno,
184187 const struct iomap_ops *ops);
185188
189+/*
190+ * Structure for writeback I/O completions.
191+ */
192+struct iomap_ioend {
193+ struct list_head io_list; /* next ioend in chain */
194+ u16 io_type;
195+ u16 io_flags; /* IOMAP_F_* */
196+ struct inode *io_inode; /* file being written to */
197+ size_t io_size; /* size of the extent */
198+ loff_t io_offset; /* offset in the file */
199+ void *io_private; /* file system private data */
200+ struct bio *io_bio; /* bio being built */
201+ struct bio io_inline_bio; /* MUST BE LAST! */
202+};
203+
204+struct iomap_writeback_ops {
205+ /*
206+ * Required, maps the blocks so that writeback can be performed on
207+ * the range starting at offset.
208+ */
209+ int (*map_blocks)(struct iomap_writepage_ctx *wpc, struct inode *inode,
210+ loff_t offset);
211+
212+ /*
213+ * Optional, allows the file systems to perform actions just before
214+ * submitting the bio and/or override the bio end_io handler for complex
215+ * operations like copy on write extent manipulation or unwritten extent
216+ * conversions.
217+ */
218+ int (*prepare_ioend)(struct iomap_ioend *ioend, int status);
219+
220+ /*
221+ * Optional, allows the file system to discard state on a page where
222+ * we failed to submit any I/O.
223+ */
224+ void (*discard_page)(struct page *page);
225+};
226+
227+struct iomap_writepage_ctx {
228+ struct iomap iomap;
229+ struct iomap_ioend *ioend;
230+ const struct iomap_writeback_ops *ops;
231+};
232+
233+void iomap_finish_ioends(struct iomap_ioend *ioend, int error);
234+void iomap_ioend_try_merge(struct iomap_ioend *ioend,
235+ struct list_head *more_ioends,
236+ void (*merge_private)(struct iomap_ioend *ioend,
237+ struct iomap_ioend *next));
238+void iomap_sort_ioends(struct list_head *ioend_list);
239+int iomap_writepage(struct page *page, struct writeback_control *wbc,
240+ struct iomap_writepage_ctx *wpc,
241+ const struct iomap_writeback_ops *ops);
242+int iomap_writepages(struct address_space *mapping,
243+ struct writeback_control *wbc, struct iomap_writepage_ctx *wpc,
244+ const struct iomap_writeback_ops *ops);
245+
186246 /*
187247 * Flags for direct I/O ->end_io:
188248 */
@@ -195,7 +255,8 @@ struct iomap_dio_ops { · 6 unmodified lines
195255 };
196256
197257 ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,
198− const struct iomap_ops *ops, const struct iomap_dio_ops *dops);
258+ const struct iomap_ops *ops, const struct iomap_dio_ops *dops,
259+ bool wait_for_completion);
199260 int iomap_dio_iopoll(struct kiocb *kiocb, bool spin);
200261
201262 #ifdef CONFIG_SWAP
include/linux/iommu.h+60−5
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/errno.h>
1414 #include <linux/err.h>
1515 #include <linux/of.h>
16+#include <linux/ioasid.h>
1617 #include <uapi/linux/iommu.h>
1718
1819 #define IOMMU_READ (1 << 0)
@@ -31,11 +32,11 @@ · 12 unmodified lines
3132 */
3233 #define IOMMU_PRIV (1 << 5)
3334 /*
34− * Non-coherent masters on few Qualcomm SoCs can use this page protection flag
35− * to set correct cacheability attributes to use an outer level of cache -
36− * last level cache, aka system cache.
35+ * Non-coherent masters can use this page protection flag to set cacheable
36+ * memory attributes for only a transparent outer level of cache, also known as
37+ * the last-level or system cache.
3738 */
38−#define IOMMU_QCOM_SYS_CACHE (1 << 6)
39+#define IOMMU_SYS_CACHE_ONLY (1 << 6)
3940
4041 struct iommu_ops;
4142 struct iommu_group;
@@ -244,7 +245,10 @@ struct iommu_iotlb_gather { · 202 unmodified lines
244245 * @sva_unbind: Unbind process address space from device
245246 * @sva_get_pasid: Get PASID associated to a SVA handle
246247 * @page_response: handle page request response
248+ * @cache_invalidate: invalidate translation caches
247249 * @pgsize_bitmap: bitmap of all possible supported page sizes
250+ * @sva_bind_gpasid: bind guest pasid and mm
251+ * @sva_unbind_gpasid: unbind guest pasid and mm
248252 */
249253 struct iommu_ops {
250254 bool (*capable)(enum iommu_cap);
@@ -256,7 +260,7 @@ struct iommu_ops { · 5 unmodified lines
256260 int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
257261 void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
258262 int (*map)(struct iommu_domain *domain, unsigned long iova,
259− phys_addr_t paddr, size_t size, int prot);
263+ phys_addr_t paddr, size_t size, int prot, gfp_t gfp);
260264 size_t (*unmap)(struct iommu_domain *domain, unsigned long iova,
261265 size_t size, struct iommu_iotlb_gather *iotlb_gather);
262266 void (*flush_iotlb_all)(struct iommu_domain *domain);
@@ -306,6 +310,12 @@ struct iommu_ops { · 43 unmodified lines
306310 int (*page_response)(struct device *dev,
307311 struct iommu_fault_event *evt,
308312 struct iommu_page_response *msg);
313+ int (*cache_invalidate)(struct iommu_domain *domain, struct device *dev,
314+ struct iommu_cache_invalidate_info *inv_info);
315+ int (*sva_bind_gpasid)(struct iommu_domain *domain,
316+ struct device *dev, struct iommu_gpasid_bind_data *data);
317+
318+ int (*sva_unbind_gpasid)(struct device *dev, int pasid);
309319
310320 unsigned long pgsize_bitmap;
311321 };
@@ -417,10 +427,19 @@ extern int iommu_attach_device(struct iommu_domain *domain, · 105 unmodified lines
417427 struct device *dev);
418428 extern void iommu_detach_device(struct iommu_domain *domain,
419429 struct device *dev);
430+extern int iommu_cache_invalidate(struct iommu_domain *domain,
431+ struct device *dev,
432+ struct iommu_cache_invalidate_info *inv_info);
433+extern int iommu_sva_bind_gpasid(struct iommu_domain *domain,
434+ struct device *dev, struct iommu_gpasid_bind_data *data);
435+extern int iommu_sva_unbind_gpasid(struct iommu_domain *domain,
436+ struct device *dev, ioasid_t pasid);
420437 extern struct iommu_domain *iommu_get_domain_for_dev(struct device *dev);
421438 extern struct iommu_domain *iommu_get_dma_domain(struct device *dev);
422439 extern int iommu_map(struct iommu_domain *domain, unsigned long iova,
423440 phys_addr_t paddr, size_t size, int prot);
441+extern int iommu_map_atomic(struct iommu_domain *domain, unsigned long iova,
442+ phys_addr_t paddr, size_t size, int prot);
424443 extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova,
425444 size_t size);
426445 extern size_t iommu_unmap_fast(struct iommu_domain *domain,
@@ -428,6 +447,9 @@ extern size_t iommu_unmap_fast(struct iommu_domain *domain, · 1 unmodified line
428447 struct iommu_iotlb_gather *iotlb_gather);
429448 extern size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
430449 struct scatterlist *sg,unsigned int nents, int prot);
450+extern size_t iommu_map_sg_atomic(struct iommu_domain *domain,
451+ unsigned long iova, struct scatterlist *sg,
452+ unsigned int nents, int prot);
431453 extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova);
432454 extern void iommu_set_fault_handler(struct iommu_domain *domain,
433455 iommu_fault_handler_t handler, void *token);
@@ -662,6 +684,13 @@ static inline int iommu_map(struct iommu_domain *domain, unsigned long iova, · 228 unmodified lines
662684 return -ENODEV;
663685 }
664686
687+static inline int iommu_map_atomic(struct iommu_domain *domain,
688+ unsigned long iova, phys_addr_t paddr,
689+ size_t size, int prot)
690+{
691+ return -ENODEV;
692+}
693+
665694 static inline size_t iommu_unmap(struct iommu_domain *domain,
666695 unsigned long iova, size_t size)
667696 {
@@ -682,6 +711,13 @@ static inline size_t iommu_map_sg(struct iommu_domain *domain, · 14 unmodified lines
682711 return 0;
683712 }
684713
714+static inline size_t iommu_map_sg_atomic(struct iommu_domain *domain,
715+ unsigned long iova, struct scatterlist *sg,
716+ unsigned int nents, int prot)
717+{
718+ return 0;
719+}
720+
685721 static inline void iommu_flush_tlb_all(struct iommu_domain *domain)
686722 {
687723 }
@@ -1005,6 +1041,25 @@ static inline int iommu_sva_get_pasid(struct iommu_sva *handle) · 317 unmodified lines
10051041 return IOMMU_PASID_INVALID;
10061042 }
10071043
1044+static inline int
1045+iommu_cache_invalidate(struct iommu_domain *domain,
1046+ struct device *dev,
1047+ struct iommu_cache_invalidate_info *inv_info)
1048+{
1049+ return -ENODEV;
1050+}
1051+static inline int iommu_sva_bind_gpasid(struct iommu_domain *domain,
1052+ struct device *dev, struct iommu_gpasid_bind_data *data)
1053+{
1054+ return -ENODEV;
1055+}
1056+
1057+static inline int iommu_sva_unbind_gpasid(struct iommu_domain *domain,
1058+ struct device *dev, int pasid)
1059+{
1060+ return -ENODEV;
1061+}
1062+
10081063 #endif /* CONFIG_IOMMU_API */
10091064
10101065 #ifdef CONFIG_IOMMU_DEBUGFS
include/linux/ioport.h+1−0
@@ -134,6 +134,7 @@ enum { · 133 unmodified lines
134134 IORES_DESC_PERSISTENT_MEMORY_LEGACY = 5,
135135 IORES_DESC_DEVICE_PRIVATE_MEMORY = 6,
136136 IORES_DESC_RESERVED = 7,
137+ IORES_DESC_SOFT_RESERVED = 8,
137138 };
138139
139140 /*
include/linux/ipmi_smi.h+8−4
@@ -224,10 +224,14 @@ static inline int ipmi_demangle_device_id(uint8_t netfn, uint8_t cmd, · 223 unmodified lines
224224 * is called, and the lower layer must get the interface from that
225225 * call.
226226 */
227−int ipmi_register_smi(const struct ipmi_smi_handlers *handlers,
228− void *send_info,
229− struct device *dev,
230− unsigned char slave_addr);
227+int ipmi_add_smi(struct module *owner,
228+ const struct ipmi_smi_handlers *handlers,
229+ void *send_info,
230+ struct device *dev,
231+ unsigned char slave_addr);
232+
233+#define ipmi_register_smi(handlers, send_info, dev, slave_addr) \
234+ ipmi_add_smi(THIS_MODULE, handlers, send_info, dev, slave_addr)
231235
232236 /*
233237 * Remove a low-level interface from the IPMI driver. This will
include/linux/irq.h+6−0
@@ -610,6 +610,12 @@ extern int irq_chip_pm_put(struct irq_data *data); · 609 unmodified lines
610610 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
611611 extern void handle_fasteoi_ack_irq(struct irq_desc *desc);
612612 extern void handle_fasteoi_mask_irq(struct irq_desc *desc);
613+extern int irq_chip_set_parent_state(struct irq_data *data,
614+ enum irqchip_irq_state which,
615+ bool val);
616+extern int irq_chip_get_parent_state(struct irq_data *data,
617+ enum irqchip_irq_state which,
618+ bool *state);
613619 extern void irq_chip_enable_parent(struct irq_data *data);
614620 extern void irq_chip_disable_parent(struct irq_data *data);
615621 extern void irq_chip_ack_parent(struct irq_data *data);
include/linux/irq_work.h+7−3
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #define IRQ_WORK_CLAIMED (IRQ_WORK_PENDING | IRQ_WORK_BUSY)
2323
2424 struct irq_work {
25− unsigned long flags;
25+ atomic_t flags;
2626 struct llist_node llnode;
2727 void (*func)(struct irq_work *);
2828 };
@@ -30,11 +30,15 @@ struct irq_work { · 1 unmodified line
3030 static inline
3131 void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *))
3232 {
33− work->flags = 0;
33+ atomic_set(&work->flags, 0);
3434 work->func = func;
3535 }
3636
37−#define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { .func = (_f), }
37+#define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { \
38+ .flags = ATOMIC_INIT(0), \
39+ .func = (_f) \
40+}
41+
3842
3943 bool irq_work_queue(struct irq_work *work);
4044 bool irq_work_queue_on(struct irq_work *work, int cpu);
include/linux/irqchip/arm-gic-v3.h+4−2
@@ -334,10 +334,10 @@ · 333 unmodified lines
334334 #define GITS_TYPER_PLPIS (1UL << 0)
335335 #define GITS_TYPER_VLPIS (1UL << 1)
336336 #define GITS_TYPER_ITT_ENTRY_SIZE_SHIFT 4
337−#define GITS_TYPER_ITT_ENTRY_SIZE(r) ((((r) >> GITS_TYPER_ITT_ENTRY_SIZE_SHIFT) & 0xf) + 1)
337+#define GITS_TYPER_ITT_ENTRY_SIZE GENMASK_ULL(7, 4)
338338 #define GITS_TYPER_IDBITS_SHIFT 8
339339 #define GITS_TYPER_DEVBITS_SHIFT 13
340−#define GITS_TYPER_DEVBITS(r) ((((r) >> GITS_TYPER_DEVBITS_SHIFT) & 0x1f) + 1)
340+#define GITS_TYPER_DEVBITS GENMASK_ULL(17, 13)
341341 #define GITS_TYPER_PTA (1UL << 19)
342342 #define GITS_TYPER_HCC_SHIFT 24
343343 #define GITS_TYPER_HCC(r) (((r) >> GITS_TYPER_HCC_SHIFT) & 0xff)
@@ -487,6 +487,8 @@ · 143 unmodified lines
487487 #define ICC_CTLR_EL1_EOImode_MASK (1 << ICC_CTLR_EL1_EOImode_SHIFT)
488488 #define ICC_CTLR_EL1_CBPR_SHIFT 0
489489 #define ICC_CTLR_EL1_CBPR_MASK (1 << ICC_CTLR_EL1_CBPR_SHIFT)
490+#define ICC_CTLR_EL1_PMHE_SHIFT 6
491+#define ICC_CTLR_EL1_PMHE_MASK (1 << ICC_CTLR_EL1_PMHE_SHIFT)
490492 #define ICC_CTLR_EL1_PRI_BITS_SHIFT 8
491493 #define ICC_CTLR_EL1_PRI_BITS_MASK (0x7 << ICC_CTLR_EL1_PRI_BITS_SHIFT)
492494 #define ICC_CTLR_EL1_ID_BITS_SHIFT 11
include/linux/irqchip/arm-gic-v4.h+4−0
@@ -32,9 +32,13 @@ struct its_vm { · 31 unmodified lines
3232 struct its_vpe {
3333 struct page *vpt_page;
3434 struct its_vm *its_vm;
35+ /* per-vPE VLPI tracking */
36+ atomic_t vlpi_count;
3537 /* Doorbell interrupt */
3638 int irq;
3739 irq_hw_number_t vpe_db_lpi;
40+ /* VPE resident */
41+ bool resident;
3842 /* VPE proxy mapping */
3943 int vpe_proxy_event;
4044 /*
include/linux/irqchip/ingenic.h+0−14
@@ -1,14 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-or-later */
2−/*
3− * Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de>
4− */
5−
6−#ifndef __LINUX_IRQCHIP_INGENIC_H__
7−#define __LINUX_IRQCHIP_INGENIC_H__
8−
9−#include <linux/irq.h>
10−
11−extern void ingenic_intc_irq_suspend(struct irq_data *data);
12−extern void ingenic_intc_irq_resume(struct irq_data *data);
13−
14−#endif
include/linux/irqdomain.h+1−0
@@ -83,6 +83,7 @@ enum irq_domain_bus_token { · 82 unmodified lines
8383 DOMAIN_BUS_IPI,
8484 DOMAIN_BUS_FSL_MC_MSI,
8585 DOMAIN_BUS_TI_SCI_INTA_MSI,
86+ DOMAIN_BUS_WAKEUP,
8687 };
8788
8889 /**
include/linux/jbd2.h+58−62
@@ -313,7 +313,6 @@ enum jbd_state_bits { · 312 unmodified lines
313313 BH_Revoked, /* Has been revoked from the log */
314314 BH_RevokeValid, /* Revoked flag is valid */
315315 BH_JBDDirty, /* Is dirty but journaled */
316− BH_State, /* Pins most journal_head state */
317316 BH_JournalHead, /* Pins bh->b_private and jh->b_bh */
318317 BH_Shadow, /* IO on shadow buffer is running */
319318 BH_Verified, /* Metadata block has been verified ok */
@@ -342,26 +341,6 @@ static inline struct journal_head *bh2jh(struct buffer_head *bh) · 22 unmodified lines
342341 return bh->b_private;
343342 }
344343
345−static inline void jbd_lock_bh_state(struct buffer_head *bh)
346−{
347− bit_spin_lock(BH_State, &bh->b_state);
348−}
349−
350−static inline int jbd_trylock_bh_state(struct buffer_head *bh)
351−{
352− return bit_spin_trylock(BH_State, &bh->b_state);
353−}
354−
355−static inline int jbd_is_locked_bh_state(struct buffer_head *bh)
356−{
357− return bit_spin_is_locked(BH_State, &bh->b_state);
358−}
359−
360−static inline void jbd_unlock_bh_state(struct buffer_head *bh)
361−{
362− bit_spin_unlock(BH_State, &bh->b_state);
363−}
364−
365344 static inline void jbd_lock_bh_journal_head(struct buffer_head *bh)
366345 {
367346 bit_spin_lock(BH_JournalHead, &bh->b_state);
@@ -477,7 +456,9 @@ struct jbd2_revoke_table_s; · 109 unmodified lines
477456 * @h_transaction: Which compound transaction is this update a part of?
478457 * @h_journal: Which journal handle belongs to - used iff h_reserved set.
479458 * @h_rsv_handle: Handle reserved for finishing the logical operation.
480− * @h_buffer_credits: Number of remaining buffers we are allowed to dirty.
459+ * @h_total_credits: Number of remaining buffers we are allowed to add to
460+ * journal. These are dirty buffers and revoke descriptor blocks.
461+ * @h_revoke_credits: Number of remaining revoke records available for handle
481462 * @h_ref: Reference count on this handle.
482463 * @h_err: Field for caller's use to track errors through large fs operations.
483464 * @h_sync: Flag for sync-on-close.
@@ -487,7 +468,8 @@ struct jbd2_revoke_table_s; · 3 unmodified lines
487468 * @h_type: For handle statistics.
488469 * @h_line_no: For handle statistics.
489470 * @h_start_jiffies: Handle Start time.
490− * @h_requested_credits: Holds @h_buffer_credits after handle is started.
471+ * @h_requested_credits: Holds @h_total_credits after handle is started.
472+ * @h_revoke_credits_requested: Holds @h_revoke_credits after handle is started.
491473 * @saved_alloc_context: Saved context while transaction is open.
492474 **/
493475
@@ -504,7 +486,9 @@ struct jbd2_journal_handle · 10 unmodified lines
504486 };
505487
506488 handle_t *h_rsv_handle;
507− int h_buffer_credits;
489+ int h_total_credits;
490+ int h_revoke_credits;
491+ int h_revoke_credits_requested;
508492 int h_ref;
509493 int h_err;
510494
@@ -556,9 +540,9 @@ struct transaction_chp_stats_s { · 45 unmodified lines
556540 * ->jbd_lock_bh_journal_head() (This is "innermost")
557541 *
558542 * j_state_lock
559− * ->jbd_lock_bh_state()
543+ * ->b_state_lock
560544 *
561− * jbd_lock_bh_state()
545+ * b_state_lock
562546 * ->j_list_lock
563547 *
564548 * j_state_lock
@@ -681,11 +665,24 @@ struct transaction_s · 116 unmodified lines
681665 atomic_t t_updates;
682666
683667 /*
684− * Number of buffers reserved for use by all handles in this transaction
685− * handle but not yet modified. [none]
668+ * Number of blocks reserved for this transaction in the journal.
669+ * This is including all credits reserved when starting transaction
670+ * handles as well as all journal descriptor blocks needed for this
671+ * transaction. [none]
686672 */
687673 atomic_t t_outstanding_credits;
688674
675+ /*
676+ * Number of revoke records for this transaction added by already
677+ * stopped handles. [none]
678+ */
679+ atomic_t t_outstanding_revokes;
680+
681+ /*
682+ * How many handles used this transaction? [none]
683+ */
684+ atomic_t t_handle_count;
685+
689686 /*
690687 * Forward and backward links for the circular list of all transactions
691688 * awaiting checkpoint. [j_list_lock]
@@ -703,11 +700,6 @@ struct transaction_s · 11 unmodified lines
703700 */
704701 ktime_t t_start_time;
705702
706− /*
707− * How many handles used this transaction? [none]
708− */
709− atomic_t t_handle_count;
710−
711703 /*
712704 * This transaction is being forced and some process is
713705 * waiting for it to finish.
@@ -1024,6 +1016,13 @@ struct journal_s · 310 unmodified lines
10241016 */
10251017 int j_max_transaction_buffers;
10261018
1019+ /**
1020+ * @j_revoke_records_per_block:
1021+ *
1022+ * Number of revoke records that fit in one descriptor block.
1023+ */
1024+ int j_revoke_records_per_block;
1025+
10271026 /**
10281027 * @j_commit_interval:
10291028 *
@@ -1170,7 +1169,7 @@ struct journal_s · 140 unmodified lines
11701169 #define jbd2_might_wait_for_commit(j) \
11711170 do { \
11721171 rwsem_acquire(&j->j_trans_commit_map, 0, 0, _THIS_IP_); \
1173− rwsem_release(&j->j_trans_commit_map, 1, _THIS_IP_); \
1172+ rwsem_release(&j->j_trans_commit_map, _THIS_IP_); \
11741173 } while (0)
11751174
11761175 /* journal feature predicate functions */
@@ -1257,7 +1256,7 @@ JBD2_FEATURE_INCOMPAT_FUNCS(csum3, CSUM_V3) · 80 unmodified lines
12571256
12581257 /* Filing buffers */
12591258 extern void jbd2_journal_unfile_buffer(journal_t *, struct journal_head *);
1260−extern void __jbd2_journal_refile_buffer(struct journal_head *);
1259+extern bool __jbd2_journal_refile_buffer(struct journal_head *);
12611260 extern void jbd2_journal_refile_buffer(journal_t *, struct journal_head *);
12621261 extern void __jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int);
12631262 extern void __journal_free_buffer(struct journal_head *bh);
@@ -1358,14 +1357,16 @@ static inline handle_t *journal_current_handle(void) · 94 unmodified lines
13581357
13591358 extern handle_t *jbd2_journal_start(journal_t *, int nblocks);
13601359 extern handle_t *jbd2__journal_start(journal_t *, int blocks, int rsv_blocks,
1361− gfp_t gfp_mask, unsigned int type,
1362− unsigned int line_no);
1360+ int revoke_records, gfp_t gfp_mask,
1361+ unsigned int type, unsigned int line_no);
13631362 extern int jbd2_journal_restart(handle_t *, int nblocks);
1364−extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask);
1363+extern int jbd2__journal_restart(handle_t *, int nblocks,
1364+ int revoke_records, gfp_t gfp_mask);
13651365 extern int jbd2_journal_start_reserved(handle_t *handle,
13661366 unsigned int type, unsigned int line_no);
13671367 extern void jbd2_journal_free_reserved(handle_t *handle);
1368−extern int jbd2_journal_extend (handle_t *, int nblocks);
1368+extern int jbd2_journal_extend(handle_t *handle, int nblocks,
1369+ int revoke_records);
13691370 extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *);
13701371 extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *);
13711372 extern int jbd2_journal_get_undo_access(handle_t *, struct buffer_head *);
@@ -1560,38 +1561,19 @@ static inline int jbd2_journal_has_csum_v2or3(journal_t *journal) · 188 unmodified lines
15601561 return journal->j_chksum_driver != NULL;
15611562 }
15621563
1563−/*
1564− * We reserve t_outstanding_credits >> JBD2_CONTROL_BLOCKS_SHIFT for
1565− * transaction control blocks.
1566− */
1567−#define JBD2_CONTROL_BLOCKS_SHIFT 5
1568−
1569−/*
1570− * Return the minimum number of blocks which must be free in the journal
1571− * before a new transaction may be started. Must be called under j_state_lock.
1572− */
1573−static inline int jbd2_space_needed(journal_t *journal)
1574−{
1575− int nblocks = journal->j_max_transaction_buffers;
1576− return nblocks + (nblocks >> JBD2_CONTROL_BLOCKS_SHIFT);
1577−}
1578−
15791564 /*
15801565 * Return number of free blocks in the log. Must be called under j_state_lock.
15811566 */
15821567 static inline unsigned long jbd2_log_space_left(journal_t *journal)
15831568 {
15841569 /* Allow for rounding errors */
1585− unsigned long free = journal->j_free - 32;
1570+ long free = journal->j_free - 32;
15861571
15871572 if (journal->j_committing_transaction) {
1588− unsigned long committing = atomic_read(&journal->
1589− j_committing_transaction->t_outstanding_credits);
1590−
1591− /* Transaction + control blocks */
1592− free -= committing + (committing >> JBD2_CONTROL_BLOCKS_SHIFT);
1573+ free -= atomic_read(&journal->
1574+ j_committing_transaction->t_outstanding_credits);
15931575 }
1594− return free;
1576+ return max_t(long, free, 0);
15951577 }
15961578
15971579 /*
@@ -1645,6 +1627,20 @@ static inline tid_t jbd2_get_latest_transaction(journal_t *journal) · 47 unmodified lines
16451627 return tid;
16461628 }
16471629
1630+static inline int jbd2_handle_buffer_credits(handle_t *handle)
1631+{
1632+ journal_t *journal;
1633+
1634+ if (!handle->h_reserved)
1635+ journal = handle->h_transaction->t_journal;
1636+ else
1637+ journal = handle->h_journal;
1638+
1639+ return handle->h_total_credits -
1640+ DIV_ROUND_UP(handle->h_revoke_credits_requested,
1641+ journal->j_revoke_records_per_block);
1642+}
1643+
16481644 #ifdef __KERNEL__
16491645
16501646 #define buffer_trace_init(bh) do {} while (0)
include/linux/journal-head.h+14−7
@@ -11,6 +11,8 @@ · 10 unmodified lines
1111 #ifndef JOURNAL_HEAD_H_INCLUDED
1212 #define JOURNAL_HEAD_H_INCLUDED
1313
14+#include <linux/spinlock.h>
15+
1416 typedef unsigned int tid_t; /* Unique transaction ID */
1517 typedef struct transaction_s transaction_t; /* Compound transaction type */
1618
@@ -23,6 +25,11 @@ struct journal_head { · 6 unmodified lines
2325 */
2426 struct buffer_head *b_bh;
2527
28+ /*
29+ * Protect the buffer head state
30+ */
31+ spinlock_t b_state_lock;
32+
2633 /*
2734 * Reference count - see description in journal.c
2835 * [jbd_lock_bh_journal_head()]
@@ -30,7 +37,7 @@ struct journal_head { · 1 unmodified line
3037 int b_jcount;
3138
3239 /*
33− * Journalling list for this buffer [jbd_lock_bh_state()]
40+ * Journalling list for this buffer [b_state_lock]
3441 * NOTE: We *cannot* combine this with b_modified into a bitfield
3542 * as gcc would then (which the C standard allows but which is
3643 * very unuseful) make 64-bit accesses to the bitfield and clobber
@@ -41,20 +48,20 @@ struct journal_head { · 4 unmodified lines
4148 /*
4249 * This flag signals the buffer has been modified by
4350 * the currently running transaction
44− * [jbd_lock_bh_state()]
51+ * [b_state_lock]
4552 */
4653 unsigned b_modified;
4754
4855 /*
4956 * Copy of the buffer data frozen for writing to the log.
50− * [jbd_lock_bh_state()]
57+ * [b_state_lock]
5158 */
5259 char *b_frozen_data;
5360
5461 /*
5562 * Pointer to a saved copy of the buffer containing no uncommitted
5663 * deallocation references, so that allocations can avoid overwriting
57− * uncommitted deletes. [jbd_lock_bh_state()]
64+ * uncommitted deletes. [b_state_lock]
5865 */
5966 char *b_committed_data;
6067
@@ -63,7 +70,7 @@ struct journal_head { · 2 unmodified lines
6370 * metadata: either the running transaction or the committing
6471 * transaction (if there is one). Only applies to buffers on a
6572 * transaction's data or metadata journaling list.
66− * [j_list_lock] [jbd_lock_bh_state()]
73+ * [j_list_lock] [b_state_lock]
6774 * Either of these locks is enough for reading, both are needed for
6875 * changes.
6976 */
@@ -73,13 +80,13 @@ struct journal_head { · 3 unmodified lines
7380 * Pointer to the running compound transaction which is currently
7481 * modifying the buffer's metadata, if there was already a transaction
7582 * committing it when the new transaction touched it.
76− * [t_list_lock] [jbd_lock_bh_state()]
83+ * [t_list_lock] [b_state_lock]
7784 */
7885 transaction_t *b_next_transaction;
7986
8087 /*
8188 * Doubly-linked list of buffers on a transaction's data, metadata or
82− * forget queue. [t_list_lock] [jbd_lock_bh_state()]
89+ * forget queue. [t_list_lock] [b_state_lock]
8390 */
8491 struct journal_head *b_tnext, *b_tprev;
8592
include/linux/kasan.h+34−0
@@ -70,8 +70,18 @@ struct kasan_cache { · 69 unmodified lines
7070 int free_meta_offset;
7171 };
7272
73+/*
74+ * These functions provide a special case to support backing module
75+ * allocations with real shadow memory. With KASAN vmalloc, the special
76+ * case is unnecessary, as the work is handled in the generic case.
77+ */
78+#ifndef CONFIG_KASAN_VMALLOC
7379 int kasan_module_alloc(void *addr, size_t size);
7480 void kasan_free_shadow(const struct vm_struct *vm);
81+#else
82+static inline int kasan_module_alloc(void *addr, size_t size) { return 0; }
83+static inline void kasan_free_shadow(const struct vm_struct *vm) {}
84+#endif
7585
7686 int kasan_add_zero_shadow(void *start, unsigned long size);
7787 void kasan_remove_zero_shadow(void *start, unsigned long size);
@@ -194,4 +204,28 @@ static inline void *kasan_reset_tag(const void *addr) · 116 unmodified lines
194204
195205 #endif /* CONFIG_KASAN_SW_TAGS */
196206
207+#ifdef CONFIG_KASAN_VMALLOC
208+int kasan_populate_vmalloc(unsigned long addr, unsigned long size);
209+void kasan_poison_vmalloc(const void *start, unsigned long size);
210+void kasan_unpoison_vmalloc(const void *start, unsigned long size);
211+void kasan_release_vmalloc(unsigned long start, unsigned long end,
212+ unsigned long free_region_start,
213+ unsigned long free_region_end);
214+#else
215+static inline int kasan_populate_vmalloc(unsigned long start,
216+ unsigned long size)
217+{
218+ return 0;
219+}
220+
221+static inline void kasan_poison_vmalloc(const void *start, unsigned long size)
222+{ }
223+static inline void kasan_unpoison_vmalloc(const void *start, unsigned long size)
224+{ }
225+static inline void kasan_release_vmalloc(unsigned long start,
226+ unsigned long end,
227+ unsigned long free_region_start,
228+ unsigned long free_region_end) {}
229+#endif
230+
197231 #endif /* LINUX_KASAN_H */
include/linux/kcov.h+23−0
@@ -37,12 +37,35 @@ do { \ · 36 unmodified lines
3737 (t)->kcov_mode &= ~KCOV_IN_CTXSW; \
3838 } while (0)
3939
40+/* See Documentation/dev-tools/kcov.rst for usage details. */
41+void kcov_remote_start(u64 handle);
42+void kcov_remote_stop(void);
43+u64 kcov_common_handle(void);
44+
45+static inline void kcov_remote_start_common(u64 id)
46+{
47+ kcov_remote_start(kcov_remote_handle(KCOV_SUBSYSTEM_COMMON, id));
48+}
49+
50+static inline void kcov_remote_start_usb(u64 id)
51+{
52+ kcov_remote_start(kcov_remote_handle(KCOV_SUBSYSTEM_USB, id));
53+}
54+
4055 #else
4156
4257 static inline void kcov_task_init(struct task_struct *t) {}
4358 static inline void kcov_task_exit(struct task_struct *t) {}
4459 static inline void kcov_prepare_switch(struct task_struct *t) {}
4560 static inline void kcov_finish_switch(struct task_struct *t) {}
61+static inline void kcov_remote_start(u64 handle) {}
62+static inline void kcov_remote_stop(void) {}
63+static inline u64 kcov_common_handle(void)
64+{
65+ return 0;
66+}
67+static inline void kcov_remote_start_common(u64 id) {}
68+static inline void kcov_remote_start_usb(u64 id) {}
4669
4770 #endif /* CONFIG_KCOV */
4871 #endif /* _LINUX_KCOV_H */
include/linux/kernel.h+14−12
@@ -328,13 +328,6 @@ extern int oops_may_print(void); · 327 unmodified lines
328328 void do_exit(long error_code) __noreturn;
329329 void complete_and_exit(struct completion *, long) __noreturn;
330330
331−#ifdef CONFIG_ARCH_HAS_REFCOUNT
332−void refcount_error_report(struct pt_regs *regs, const char *err);
333−#else
334−static inline void refcount_error_report(struct pt_regs *regs, const char *err)
335−{ }
336−#endif
337−
338331 /* Internal, do not use. */
339332 int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);
340333 int __must_check _kstrtol(const char *s, unsigned int base, long *res);
@@ -355,8 +348,7 @@ int __must_check kstrtoll(const char *s, unsigned int base, long long *res); · 14 unmodified lines
355348 * @res: Where to write the result of the conversion on success.
356349 *
357350 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
358− * Used as a replacement for the obsolete simple_strtoull. Return code must
359− * be checked.
351+ * Used as a replacement for the simple_strtoull. Return code must be checked.
360352 */
361353 static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
362354 {
@@ -384,8 +376,7 @@ static inline int __must_check kstrtoul(const char *s, unsigned int base, unsign · 21 unmodified lines
384376 * @res: Where to write the result of the conversion on success.
385377 *
386378 * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error.
387− * Used as a replacement for the obsolete simple_strtoull. Return code must
388− * be checked.
379+ * Used as a replacement for the simple_strtoull. Return code must be checked.
389380 */
390381 static inline int __must_check kstrtol(const char *s, unsigned int base, long *res)
391382 {
@@ -461,7 +452,18 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t · 69 unmodified lines
461452 return kstrtoint_from_user(s, count, base, res);
462453 }
463454
464−/* Obsolete, do not use. Use kstrto<foo> instead */
455+/*
456+ * Use kstrto<foo> instead.
457+ *
458+ * NOTE: simple_strto<foo> does not check for the range overflow and,
459+ * depending on the input, may give interesting results.
460+ *
461+ * Use these functions if and only if you cannot use kstrto<foo>, because
462+ * the conversion ends on the first non-digit character, which may be far
463+ * beyond the supported range. It might be useful to parse the strings like
464+ * 10x50 or 12:21 without altering original string or temporary buffer in use.
465+ * Keep in mind above caveat.
466+ */
465467
466468 extern unsigned long simple_strtoul(const char *,char **,unsigned int);
467469 extern long simple_strtol(const char *,char **,unsigned int);
include/linux/kernel_stat.h+18−0
@@ -78,6 +78,24 @@ static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu) · 77 unmodified lines
7878 return kstat_cpu(cpu).irqs_sum;
7979 }
8080
81+#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
82+extern u64 kcpustat_field(struct kernel_cpustat *kcpustat,
83+ enum cpu_usage_stat usage, int cpu);
84+extern void kcpustat_cpu_fetch(struct kernel_cpustat *dst, int cpu);
85+#else
86+static inline u64 kcpustat_field(struct kernel_cpustat *kcpustat,
87+ enum cpu_usage_stat usage, int cpu)
88+{
89+ return kcpustat->cpustat[usage];
90+}
91+
92+static inline void kcpustat_cpu_fetch(struct kernel_cpustat *dst, int cpu)
93+{
94+ *dst = kcpustat_cpu(cpu);
95+}
96+
97+#endif
98+
8199 extern void account_user_time(struct task_struct *, u64);
82100 extern void account_guest_time(struct task_struct *, u64);
83101 extern void account_system_time(struct task_struct *, int, u64);
include/linux/kernfs.h+38−19
@@ -104,21 +104,6 @@ struct kernfs_elem_attr { · 103 unmodified lines
104104 struct kernfs_node *notify_next; /* for kernfs_notify() */
105105 };
106106
107−/* represent a kernfs node */
108−union kernfs_node_id {
109− struct {
110− /*
111− * blktrace will export this struct as a simplified 'struct
112− * fid' (which is a big data struction), so userspace can use
113− * it to find kernfs node. The layout must match the first two
114− * fields of 'struct fid' exactly.
115− */
116− u32 ino;
117− u32 generation;
118− };
119− u64 id;
120−};
121−
122107 /*
123108 * kernfs_node - the building block of kernfs hierarchy. Each and every
124109 * kernfs node is represented by single kernfs_node. Most fields are
@@ -155,7 +140,12 @@ struct kernfs_node { · 30 unmodified lines
155140
156141 void *priv;
157142
158− union kernfs_node_id id;
143+ /*
144+ * 64bit unique ID. On 64bit ino setups, id is the ino. On 32bit,
145+ * the low 32bits are ino and upper generation.
146+ */
147+ u64 id;
148+
159149 unsigned short flags;
160150 umode_t mode;
161151 struct kernfs_iattrs *iattr;
@@ -187,7 +177,8 @@ struct kernfs_root { · 25 unmodified lines
187177
188178 /* private fields, do not use outside kernfs proper */
189179 struct idr ino_idr;
190− u32 next_generation;
180+ u32 last_id_lowbits;
181+ u32 id_highbits;
191182 struct kernfs_syscall_ops *syscall_ops;
192183
193184 /* list of kernfs_super_info of this root, protected by kernfs_mutex */
@@ -291,6 +282,34 @@ static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn) · 97 unmodified lines
291282 return kn->flags & KERNFS_TYPE_MASK;
292283 }
293284
285+static inline ino_t kernfs_id_ino(u64 id)
286+{
287+ /* id is ino if ino_t is 64bit; otherwise, low 32bits */
288+ if (sizeof(ino_t) >= sizeof(u64))
289+ return id;
290+ else
291+ return (u32)id;
292+}
293+
294+static inline u32 kernfs_id_gen(u64 id)
295+{
296+ /* gen is fixed at 1 if ino_t is 64bit; otherwise, high 32bits */
297+ if (sizeof(ino_t) >= sizeof(u64))
298+ return 1;
299+ else
300+ return id >> 32;
301+}
302+
303+static inline ino_t kernfs_ino(struct kernfs_node *kn)
304+{
305+ return kernfs_id_ino(kn->id);
306+}
307+
308+static inline ino_t kernfs_gen(struct kernfs_node *kn)
309+{
310+ return kernfs_id_gen(kn->id);
311+}
312+
294313 /**
295314 * kernfs_enable_ns - enable namespace under a directory
296315 * @kn: directory of interest, should be empty
@@ -382,8 +401,8 @@ void kernfs_kill_sb(struct super_block *sb); · 85 unmodified lines
382401
383402 void kernfs_init(void);
384403
385−struct kernfs_node *kernfs_get_node_by_id(struct kernfs_root *root,
386− const union kernfs_node_id *id);
404+struct kernfs_node *kernfs_find_and_get_node_by_id(struct kernfs_root *root,
405+ u64 id);
387406 #else /* CONFIG_KERNFS */
388407
389408 static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
include/linux/kvm_host.h+31−12
@@ -149,7 +149,7 @@ static inline bool is_error_page(struct page *page) · 148 unmodified lines
149149 #define KVM_REQUEST_ARCH_BASE 8
150150
151151 #define KVM_ARCH_REQ_FLAGS(nr, flags) ({ \
152− BUILD_BUG_ON((unsigned)(nr) >= (FIELD_SIZEOF(struct kvm_vcpu, requests) * 8) - KVM_REQUEST_ARCH_BASE); \
152+ BUILD_BUG_ON((unsigned)(nr) >= (sizeof_field(struct kvm_vcpu, requests) * 8) - KVM_REQUEST_ARCH_BASE); \
153153 (unsigned)(((nr) + KVM_REQUEST_ARCH_BASE) | (flags)); \
154154 })
155155 #define KVM_ARCH_REQ(nr) KVM_ARCH_REQ_FLAGS(nr, 0)
@@ -266,7 +266,8 @@ struct kvm_vcpu { · 110 unmodified lines
266266 struct preempt_notifier preempt_notifier;
267267 #endif
268268 int cpu;
269− int vcpu_id;
269+ int vcpu_id; /* id given by userspace at creation */
270+ int vcpu_idx; /* index in kvm->vcpus array */
270271 int srcu_idx;
271272 int mode;
272273 u64 requests;
@@ -278,7 +279,6 @@ struct kvm_vcpu { · 5 unmodified lines
278279 struct mutex mutex;
279280 struct kvm_run *run;
280281
281− int guest_xcr0_loaded;
282282 struct swait_queue_head wq;
283283 struct pid __rcu *pid;
284284 int sigset_active;
@@ -571,13 +571,7 @@ static inline struct kvm_vcpu *kvm_get_vcpu_by_id(struct kvm *kvm, int id) · 286 unmodified lines
571571
572572 static inline int kvm_vcpu_get_idx(struct kvm_vcpu *vcpu)
573573 {
574− struct kvm_vcpu *tmp;
575− int idx;
576−
577− kvm_for_each_vcpu(idx, tmp, vcpu->kvm)
578− if (tmp == vcpu)
579− return idx;
580− BUG();
574+ return vcpu->vcpu_idx;
581575 }
582576
583577 #define kvm_for_each_memslot(memslot, slots) \
@@ -622,6 +616,7 @@ void kvm_exit(void); · 38 unmodified lines
622616
623617 void kvm_get_kvm(struct kvm *kvm);
624618 void kvm_put_kvm(struct kvm *kvm);
619+void kvm_put_kvm_no_destroy(struct kvm *kvm);
625620
626621 static inline struct kvm_memslots *__kvm_memslots(struct kvm *kvm, int as_id)
627622 {
@@ -746,6 +741,28 @@ int kvm_write_guest_offset_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, · 118 unmodified lines
746741 unsigned long len);
747742 int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
748743 gpa_t gpa, unsigned long len);
744+
745+#define __kvm_put_guest(kvm, gfn, offset, value, type) \
746+({ \
747+ unsigned long __addr = gfn_to_hva(kvm, gfn); \
748+ type __user *__uaddr = (type __user *)(__addr + offset); \
749+ int __ret = -EFAULT; \
750+ \
751+ if (!kvm_is_error_hva(__addr)) \
752+ __ret = put_user(value, __uaddr); \
753+ if (!__ret) \
754+ mark_page_dirty(kvm, gfn); \
755+ __ret; \
756+})
757+
758+#define kvm_put_guest(kvm, gpa, value, type) \
759+({ \
760+ gpa_t __gpa = gpa; \
761+ struct kvm *__kvm = kvm; \
762+ __kvm_put_guest(__kvm, __gpa >> PAGE_SHIFT, \
763+ offset_in_page(__gpa), (value), type); \
764+})
765+
749766 int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len);
750767 int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len);
751768 struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn);
@@ -791,6 +808,8 @@ void kvm_reload_remote_mmus(struct kvm *kvm); · 39 unmodified lines
791808 bool kvm_make_vcpus_request_mask(struct kvm *kvm, unsigned int req,
792809 unsigned long *vcpu_bitmap, cpumask_var_t tmp);
793810 bool kvm_make_all_cpus_request(struct kvm *kvm, unsigned int req);
811+bool kvm_make_cpus_request_mask(struct kvm *kvm, unsigned int req,
812+ unsigned long *vcpu_bitmap);
794813
795814 long kvm_arch_dev_ioctl(struct file *filp,
796815 unsigned int ioctl, unsigned long arg);
@@ -1241,7 +1260,7 @@ extern unsigned int halt_poll_ns_grow_start; · 444 unmodified lines
12411260 extern unsigned int halt_poll_ns_shrink;
12421261
12431262 struct kvm_device {
1244− struct kvm_device_ops *ops;
1263+ const struct kvm_device_ops *ops;
12451264 struct kvm *kvm;
12461265 void *private;
12471266 struct list_head vm_node;
@@ -1294,7 +1313,7 @@ struct kvm_device_ops { · 46 unmodified lines
12941313 void kvm_device_get(struct kvm_device *dev);
12951314 void kvm_device_put(struct kvm_device *dev);
12961315 struct kvm_device *kvm_device_from_filp(struct file *filp);
1297−int kvm_register_device_ops(struct kvm_device_ops *ops, u32 type);
1316+int kvm_register_device_ops(const struct kvm_device_ops *ops, u32 type);
12981317 void kvm_unregister_device_ops(u32 type);
12991318
13001319 extern struct kvm_device_ops kvm_mpic_ops;
include/linux/kvm_types.h+2−0
@@ -35,6 +35,8 @@ typedef unsigned long gva_t; · 34 unmodified lines
3535 typedef u64 gpa_t;
3636 typedef u64 gfn_t;
3737
38+#define GPA_INVALID (~(gpa_t)0)
39+
3840 typedef unsigned long hva_t;
3941 typedef u64 hpa_t;
4042 typedef u64 hfn_t;
include/linux/led-class-flash.h+28−13
@@ -94,12 +94,15 @@ static inline struct led_classdev_flash *lcdev_to_flcdev( · 93 unmodified lines
9494 *
9595 * Returns: 0 on success or negative error value on failure
9696 */
97−extern int led_classdev_flash_register_ext(struct device *parent,
98− struct led_classdev_flash *fled_cdev,
99− struct led_init_data *init_data);
97+int led_classdev_flash_register_ext(struct device *parent,
98+ struct led_classdev_flash *fled_cdev,
99+ struct led_init_data *init_data);
100100
101−#define led_classdev_flash_register(parent, fled_cdev) \
102− led_classdev_flash_register_ext(parent, fled_cdev, NULL)
101+static inline int led_classdev_flash_register(struct device *parent,
102+ struct led_classdev_flash *fled_cdev)
103+{
104+ return led_classdev_flash_register_ext(parent, fled_cdev, NULL);
105+}
103106
104107 /**
105108 * led_classdev_flash_unregister - unregisters an object of led_classdev class
@@ -108,7 +111,21 @@ extern int led_classdev_flash_register_ext(struct device *parent, · 2 unmodified lines
108111 *
109112 * Unregister a previously registered via led_classdev_flash_register object
110113 */
111−extern void led_classdev_flash_unregister(struct led_classdev_flash *fled_cdev);
114+void led_classdev_flash_unregister(struct led_classdev_flash *fled_cdev);
115+
116+int devm_led_classdev_flash_register_ext(struct device *parent,
117+ struct led_classdev_flash *fled_cdev,
118+ struct led_init_data *init_data);
119+
120+
121+static inline int devm_led_classdev_flash_register(struct device *parent,
122+ struct led_classdev_flash *fled_cdev)
123+{
124+ return devm_led_classdev_flash_register_ext(parent, fled_cdev, NULL);
125+}
126+
127+void devm_led_classdev_flash_unregister(struct device *parent,
128+ struct led_classdev_flash *fled_cdev);
112129
113130 /**
114131 * led_set_flash_strobe - setup flash strobe
@@ -156,8 +173,8 @@ static inline int led_get_flash_strobe(struct led_classdev_flash *fled_cdev, · 41 unmodified lines
156173 *
157174 * Returns: 0 on success or negative error value on failure
158175 */
159−extern int led_set_flash_brightness(struct led_classdev_flash *fled_cdev,
160− u32 brightness);
176+int led_set_flash_brightness(struct led_classdev_flash *fled_cdev,
177+ u32 brightness);
161178
162179 /**
163180 * led_update_flash_brightness - update flash LED brightness
@@ -168,7 +185,7 @@ extern int led_set_flash_brightness(struct led_classdev_flash *fled_cdev, · 4 unmodified lines
168185 *
169186 * Returns: 0 on success or negative error value on failure
170187 */
171−extern int led_update_flash_brightness(struct led_classdev_flash *fled_cdev);
188+int led_update_flash_brightness(struct led_classdev_flash *fled_cdev);
172189
173190 /**
174191 * led_set_flash_timeout - set flash LED timeout
@@ -179,8 +196,7 @@ extern int led_update_flash_brightness(struct led_classdev_flash *fled_cdev); · 4 unmodified lines
179196 *
180197 * Returns: 0 on success or negative error value on failure
181198 */
182−extern int led_set_flash_timeout(struct led_classdev_flash *fled_cdev,
183− u32 timeout);
199+int led_set_flash_timeout(struct led_classdev_flash *fled_cdev, u32 timeout);
184200
185201 /**
186202 * led_get_flash_fault - get the flash LED fault
@@ -191,7 +207,6 @@ extern int led_set_flash_timeout(struct led_classdev_flash *fled_cdev, · 4 unmodified lines
191207 *
192208 * Returns: 0 on success or negative error value on failure
193209 */
194−extern int led_get_flash_fault(struct led_classdev_flash *fled_cdev,
195− u32 *fault);
210+int led_get_flash_fault(struct led_classdev_flash *fled_cdev, u32 *fault);
196211
197212 #endif /* __LINUX_FLASH_LEDS_H_INCLUDED */
include/linux/leds.h+44−56
@@ -161,7 +161,7 @@ struct led_classdev { · 160 unmodified lines
161161 *
162162 * Returns: 0 on success or negative error value on failure
163163 */
164−extern int led_classdev_register_ext(struct device *parent,
164+int led_classdev_register_ext(struct device *parent,
165165 struct led_classdev *led_cdev,
166166 struct led_init_data *init_data);
167167
@@ -181,7 +181,7 @@ static inline int led_classdev_register(struct device *parent, · 13 unmodified lines
181181 return led_classdev_register_ext(parent, led_cdev, NULL);
182182 }
183183
184−extern int devm_led_classdev_register_ext(struct device *parent,
184+int devm_led_classdev_register_ext(struct device *parent,
185185 struct led_classdev *led_cdev,
186186 struct led_init_data *init_data);
187187
@@ -190,11 +190,11 @@ static inline int devm_led_classdev_register(struct device *parent, · 2 unmodified lines
190190 {
191191 return devm_led_classdev_register_ext(parent, led_cdev, NULL);
192192 }
193−extern void led_classdev_unregister(struct led_classdev *led_cdev);
194−extern void devm_led_classdev_unregister(struct device *parent,
195− struct led_classdev *led_cdev);
196−extern void led_classdev_suspend(struct led_classdev *led_cdev);
197−extern void led_classdev_resume(struct led_classdev *led_cdev);
193+void led_classdev_unregister(struct led_classdev *led_cdev);
194+void devm_led_classdev_unregister(struct device *parent,
195+ struct led_classdev *led_cdev);
196+void led_classdev_suspend(struct led_classdev *led_cdev);
197+void led_classdev_resume(struct led_classdev *led_cdev);
198198
199199 /**
200200 * led_blink_set - set blinking with software fallback
@@ -211,9 +211,8 @@ extern void led_classdev_resume(struct led_classdev *led_cdev); · 10 unmodified lines
211211 * led_cdev->brightness_set() will not stop the blinking,
212212 * use led_classdev_brightness_set() instead.
213213 */
214−extern void led_blink_set(struct led_classdev *led_cdev,
215− unsigned long *delay_on,
216− unsigned long *delay_off);
214+void led_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on,
215+ unsigned long *delay_off);
217216 /**
218217 * led_blink_set_oneshot - do a oneshot software blink
219218 * @led_cdev: the LED to start blinking
@@ -228,10 +227,9 @@ extern void led_blink_set(struct led_classdev *led_cdev, · 8 unmodified lines
228227 * If invert is set, led blinks for delay_off first, then for
229228 * delay_on and leave the led on after the on-off cycle.
230229 */
231−extern void led_blink_set_oneshot(struct led_classdev *led_cdev,
232− unsigned long *delay_on,
233− unsigned long *delay_off,
234− int invert);
230+void led_blink_set_oneshot(struct led_classdev *led_cdev,
231+ unsigned long *delay_on, unsigned long *delay_off,
232+ int invert);
235233 /**
236234 * led_set_brightness - set LED brightness
237235 * @led_cdev: the LED to set
@@ -241,8 +239,8 @@ extern void led_blink_set_oneshot(struct led_classdev *led_cdev, · 3 unmodified lines
241239 * software blink timer that implements blinking when the
242240 * hardware doesn't. This function is guaranteed not to sleep.
243241 */
244−extern void led_set_brightness(struct led_classdev *led_cdev,
245− enum led_brightness brightness);
242+void led_set_brightness(struct led_classdev *led_cdev,
243+ enum led_brightness brightness);
246244
247245 /**
248246 * led_set_brightness_sync - set LED brightness synchronously
@@ -255,8 +253,8 @@ extern void led_set_brightness(struct led_classdev *led_cdev, · 6 unmodified lines
255253 *
256254 * Returns: 0 on success or negative error value on failure
257255 */
258−extern int led_set_brightness_sync(struct led_classdev *led_cdev,
259− enum led_brightness value);
256+int led_set_brightness_sync(struct led_classdev *led_cdev,
257+ enum led_brightness value);
260258
261259 /**
262260 * led_update_brightness - update LED brightness
@@ -267,7 +265,7 @@ extern int led_set_brightness_sync(struct led_classdev *led_cdev, · 4 unmodified lines
267265 *
268266 * Returns: 0 on success or negative error value on failure
269267 */
270−extern int led_update_brightness(struct led_classdev *led_cdev);
268+int led_update_brightness(struct led_classdev *led_cdev);
271269
272270 /**
273271 * led_get_default_pattern - return default pattern
@@ -279,8 +277,7 @@ extern int led_update_brightness(struct led_classdev *led_cdev); · 5 unmodified lines
279277 * Return: Allocated array of integers with default pattern from device tree
280278 * or NULL. Caller is responsible for kfree().
281279 */
282−extern u32 *led_get_default_pattern(struct led_classdev *led_cdev,
283− unsigned int *size);
280+u32 *led_get_default_pattern(struct led_classdev *led_cdev, unsigned int *size);
284281
285282 /**
286283 * led_sysfs_disable - disable LED sysfs interface
@@ -288,7 +285,7 @@ extern u32 *led_get_default_pattern(struct led_classdev *led_cdev, · 1 unmodified line
288285 *
289286 * Disable the led_cdev's sysfs interface.
290287 */
291−extern void led_sysfs_disable(struct led_classdev *led_cdev);
288+void led_sysfs_disable(struct led_classdev *led_cdev);
292289
293290 /**
294291 * led_sysfs_enable - enable LED sysfs interface
@@ -296,7 +293,7 @@ extern void led_sysfs_disable(struct led_classdev *led_cdev); · 1 unmodified line
296293 *
297294 * Enable the led_cdev's sysfs interface.
298295 */
299−extern void led_sysfs_enable(struct led_classdev *led_cdev);
296+void led_sysfs_enable(struct led_classdev *led_cdev);
300297
301298 /**
302299 * led_compose_name - compose LED class device name
@@ -310,8 +307,8 @@ extern void led_sysfs_enable(struct led_classdev *led_cdev); · 7 unmodified lines
310307 *
311308 * Returns: 0 on success or negative error value on failure
312309 */
313−extern int led_compose_name(struct device *dev, struct led_init_data *init_data,
314− char *led_classdev_name);
310+int led_compose_name(struct device *dev, struct led_init_data *init_data,
311+ char *led_classdev_name);
315312
316313 /**
317314 * led_sysfs_is_disabled - check if LED sysfs interface is disabled
@@ -360,33 +357,25 @@ struct led_trigger { · 42 unmodified lines
360357 #define led_trigger_get_led(dev) ((struct led_classdev *)dev_get_drvdata((dev)))
361358 #define led_trigger_get_drvdata(dev) (led_get_trigger_data(led_trigger_get_led(dev)))
362359
363−ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr,
364− const char *buf, size_t count);
365−ssize_t led_trigger_show(struct device *dev, struct device_attribute *attr,
366− char *buf);
367−
368360 /* Registration functions for complex triggers */
369−extern int led_trigger_register(struct led_trigger *trigger);
370−extern void led_trigger_unregister(struct led_trigger *trigger);
371−extern int devm_led_trigger_register(struct device *dev,
361+int led_trigger_register(struct led_trigger *trigger);
362+void led_trigger_unregister(struct led_trigger *trigger);
363+int devm_led_trigger_register(struct device *dev,
372364 struct led_trigger *trigger);
373365
374−extern void led_trigger_register_simple(const char *name,
366+void led_trigger_register_simple(const char *name,
375367 struct led_trigger **trigger);
376−extern void led_trigger_unregister_simple(struct led_trigger *trigger);
377−extern void led_trigger_event(struct led_trigger *trigger,
378− enum led_brightness event);
379−extern void led_trigger_blink(struct led_trigger *trigger,
380− unsigned long *delay_on,
381− unsigned long *delay_off);
382−extern void led_trigger_blink_oneshot(struct led_trigger *trigger,
383− unsigned long *delay_on,
384− unsigned long *delay_off,
385− int invert);
386−extern void led_trigger_set_default(struct led_classdev *led_cdev);
387−extern int led_trigger_set(struct led_classdev *led_cdev,
388− struct led_trigger *trigger);
389−extern void led_trigger_remove(struct led_classdev *led_cdev);
368+void led_trigger_unregister_simple(struct led_trigger *trigger);
369+void led_trigger_event(struct led_trigger *trigger, enum led_brightness event);
370+void led_trigger_blink(struct led_trigger *trigger, unsigned long *delay_on,
371+ unsigned long *delay_off);
372+void led_trigger_blink_oneshot(struct led_trigger *trigger,
373+ unsigned long *delay_on,
374+ unsigned long *delay_off,
375+ int invert);
376+void led_trigger_set_default(struct led_classdev *led_cdev);
377+int led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger);
378+void led_trigger_remove(struct led_classdev *led_cdev);
390379
391380 static inline void led_set_trigger_data(struct led_classdev *led_cdev,
392381 void *trigger_data)
@@ -414,8 +403,7 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev) · 21 unmodified lines
414403 * This is meant to be used on triggers with statically
415404 * allocated name.
416405 */
417−extern void led_trigger_rename_static(const char *name,
418− struct led_trigger *trig);
406+void led_trigger_rename_static(const char *name, struct led_trigger *trig);
419407
420408 #define module_led_trigger(__led_trigger) \
421409 module_driver(__led_trigger, led_trigger_register, \
@@ -457,20 +445,20 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev) · 35 unmodified lines
457445
458446 /* Trigger specific functions */
459447 #ifdef CONFIG_LEDS_TRIGGER_DISK
460−extern void ledtrig_disk_activity(bool write);
448+void ledtrig_disk_activity(bool write);
461449 #else
462450 static inline void ledtrig_disk_activity(bool write) {}
463451 #endif
464452
465453 #ifdef CONFIG_LEDS_TRIGGER_MTD
466−extern void ledtrig_mtd_activity(void);
454+void ledtrig_mtd_activity(void);
467455 #else
468456 static inline void ledtrig_mtd_activity(void) {}
469457 #endif
470458
471459 #if defined(CONFIG_LEDS_TRIGGER_CAMERA) || defined(CONFIG_LEDS_TRIGGER_CAMERA_MODULE)
472−extern void ledtrig_flash_ctrl(bool on);
473−extern void ledtrig_torch_ctrl(bool on);
460+void ledtrig_flash_ctrl(bool on);
461+void ledtrig_torch_ctrl(bool on);
474462 #else
475463 static inline void ledtrig_flash_ctrl(bool on) {}
476464 static inline void ledtrig_torch_ctrl(bool on) {}
@@ -550,7 +538,7 @@ enum cpu_led_event { · 73 unmodified lines
550538 CPU_LED_HALTED, /* Machine shutdown */
551539 };
552540 #ifdef CONFIG_LEDS_TRIGGER_CPU
553−extern void ledtrig_cpu(enum cpu_led_event evt);
541+void ledtrig_cpu(enum cpu_led_event evt);
554542 #else
555543 static inline void ledtrig_cpu(enum cpu_led_event evt)
556544 {
@@ -559,7 +547,7 @@ static inline void ledtrig_cpu(enum cpu_led_event evt) · 2 unmodified lines
559547 #endif
560548
561549 #ifdef CONFIG_LEDS_BRIGHTNESS_HW_CHANGED
562−extern void led_classdev_notify_brightness_hw_changed(
550+void led_classdev_notify_brightness_hw_changed(
563551 struct led_classdev *led_cdev, enum led_brightness brightness);
564552 #else
565553 static inline void led_classdev_notify_brightness_hw_changed(
include/linux/libata.h+8−6
@@ -484,6 +484,7 @@ enum hsm_task_states { · 483 unmodified lines
484484 };
485485
486486 enum ata_completion_errors {
487+ AC_ERR_OK = 0, /* no error */
487488 AC_ERR_DEV = (1 << 0), /* device reported error */
488489 AC_ERR_HSM = (1 << 1), /* host state machine violation */
489490 AC_ERR_TIMEOUT = (1 << 2), /* timeout */
@@ -891,9 +892,9 @@ struct ata_port_operations { · 401 unmodified lines
891892 /*
892893 * Command execution
893894 */
894− int (*qc_defer)(struct ata_queued_cmd *qc);
895− int (*check_atapi_dma)(struct ata_queued_cmd *qc);
896− void (*qc_prep)(struct ata_queued_cmd *qc);
895+ int (*qc_defer)(struct ata_queued_cmd *qc);
896+ int (*check_atapi_dma)(struct ata_queued_cmd *qc);
897+ enum ata_completion_errors (*qc_prep)(struct ata_queued_cmd *qc);
897898 unsigned int (*qc_issue)(struct ata_queued_cmd *qc);
898899 bool (*qc_fill_rtf)(struct ata_queued_cmd *qc);
899900
@@ -1161,7 +1162,7 @@ extern int ata_xfer_mode2shift(unsigned long xfer_mode); · 261 unmodified lines
11611162 extern const char *ata_mode_string(unsigned long xfer_mask);
11621163 extern unsigned long ata_id_xfermask(const u16 *id);
11631164 extern int ata_std_qc_defer(struct ata_queued_cmd *qc);
1164−extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
1165+extern enum ata_completion_errors ata_noop_qc_prep(struct ata_queued_cmd *qc);
11651166 extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
11661167 unsigned int n_elem);
11671168 extern unsigned int ata_dev_classify(const struct ata_taskfile *tf);
@@ -1174,6 +1175,7 @@ extern unsigned int ata_do_dev_read_id(struct ata_device *dev, · 6 unmodified lines
11741175 struct ata_taskfile *tf, u16 *id);
11751176 extern void ata_qc_complete(struct ata_queued_cmd *qc);
11761177 extern int ata_qc_complete_multiple(struct ata_port *ap, u64 qc_active);
1178+extern u64 ata_qc_get_active(struct ata_port *ap);
11771179 extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd);
11781180 extern int ata_std_bios_param(struct scsi_device *sdev,
11791181 struct block_device *bdev,
@@ -1893,9 +1895,9 @@ extern const struct ata_port_operations ata_bmdma_port_ops; · 713 unmodified lines
18931895 .sg_tablesize = LIBATA_MAX_PRD, \
18941896 .dma_boundary = ATA_DMA_BOUNDARY
18951897
1896−extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc);
1898+extern enum ata_completion_errors ata_bmdma_qc_prep(struct ata_queued_cmd *qc);
18971899 extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc);
1898−extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc);
1900+extern enum ata_completion_errors ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc);
18991901 extern unsigned int ata_bmdma_port_intr(struct ata_port *ap,
19001902 struct ata_queued_cmd *qc);
19011903 extern irqreturn_t ata_bmdma_interrupt(int irq, void *dev_instance);
include/linux/libfdt_env.h+4−1
@@ -2,11 +2,14 @@ · 1 unmodified line
22 #ifndef LIBFDT_ENV_H
33 #define LIBFDT_ENV_H
44
5−#include <linux/kernel.h> /* For INT_MAX */
5+#include <linux/limits.h> /* For INT_MAX */
66 #include <linux/string.h>
77
88 #include <asm/byteorder.h>
99
10+#define INT32_MAX S32_MAX
11+#define UINT32_MAX U32_MAX
12+
1013 typedef __be16 fdt16_t;
1114 typedef __be32 fdt32_t;
1215 typedef __be64 fdt64_t;
include/linux/libnvdimm.h+0−7
@@ -65,13 +65,6 @@ enum { · 64 unmodified lines
6565 DPA_RESOURCE_ADJUSTED = 1 << 0,
6666 };
6767
68−extern struct attribute_group nvdimm_bus_attribute_group;
69−extern struct attribute_group nvdimm_attribute_group;
70−extern struct attribute_group nd_device_attribute_group;
71−extern struct attribute_group nd_numa_attribute_group;
72−extern struct attribute_group nd_region_attribute_group;
73−extern struct attribute_group nd_mapping_attribute_group;
74−
7568 struct nvdimm;
7669 struct nvdimm_bus_descriptor;
7770 typedef int (*ndctl_fn)(struct nvdimm_bus_descriptor *nd_desc,
include/linux/license.h+1−0
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
12 #ifndef __LICENSE_H
23 #define __LICENSE_H
34
include/linux/linkage.h+241−8
@@ -75,32 +75,61 @@ · 74 unmodified lines
7575
7676 #ifdef __ASSEMBLY__
7777
78+/* SYM_T_FUNC -- type used by assembler to mark functions */
79+#ifndef SYM_T_FUNC
80+#define SYM_T_FUNC STT_FUNC
81+#endif
82+
83+/* SYM_T_OBJECT -- type used by assembler to mark data */
84+#ifndef SYM_T_OBJECT
85+#define SYM_T_OBJECT STT_OBJECT
86+#endif
87+
88+/* SYM_T_NONE -- type used by assembler to mark entries of unknown type */
89+#ifndef SYM_T_NONE
90+#define SYM_T_NONE STT_NOTYPE
91+#endif
92+
93+/* SYM_A_* -- align the symbol? */
94+#define SYM_A_ALIGN ALIGN
95+#define SYM_A_NONE /* nothing */
96+
97+/* SYM_L_* -- linkage of symbols */
98+#define SYM_L_GLOBAL(name) .globl name
99+#define SYM_L_WEAK(name) .weak name
100+#define SYM_L_LOCAL(name) /* nothing */
101+
78102 #ifndef LINKER_SCRIPT
79103 #define ALIGN __ALIGN
80104 #define ALIGN_STR __ALIGN_STR
81105
106+/* === DEPRECATED annotations === */
107+
108+#ifndef CONFIG_X86
82109 #ifndef GLOBAL
110+/* deprecated, use SYM_DATA*, SYM_ENTRY, or similar */
83111 #define GLOBAL(name) \
84112 .globl name ASM_NL \
85113 name:
86114 #endif
87115
88116 #ifndef ENTRY
117+/* deprecated, use SYM_FUNC_START */
89118 #define ENTRY(name) \
90− .globl name ASM_NL \
91− ALIGN ASM_NL \
92− name:
119+ SYM_FUNC_START(name)
93120 #endif
121+#endif /* CONFIG_X86 */
94122 #endif /* LINKER_SCRIPT */
95123
124+#ifndef CONFIG_X86
96125 #ifndef WEAK
126+/* deprecated, use SYM_FUNC_START_WEAK* */
97127 #define WEAK(name) \
98− .weak name ASM_NL \
99− ALIGN ASM_NL \
100− name:
128+ SYM_FUNC_START_WEAK(name)
101129 #endif
102130
103131 #ifndef END
132+/* deprecated, use SYM_FUNC_END, SYM_DATA_END, or SYM_END */
104133 #define END(name) \
105134 .size name, .-name
106135 #endif
@@ -110,11 +139,215 @@ · 3 unmodified lines
110139 * static analysis tools such as stack depth analyzer.
111140 */
112141 #ifndef ENDPROC
142+/* deprecated, use SYM_FUNC_END */
113143 #define ENDPROC(name) \
114− .type name, @function ASM_NL \
115− END(name)
144+ SYM_FUNC_END(name)
145+#endif
146+#endif /* CONFIG_X86 */
147+
148+/* === generic annotations === */
149+
150+/* SYM_ENTRY -- use only if you have to for non-paired symbols */
151+#ifndef SYM_ENTRY
152+#define SYM_ENTRY(name, linkage, align...) \
153+ linkage(name) ASM_NL \
154+ align ASM_NL \
155+ name:
156+#endif
157+
158+/* SYM_START -- use only if you have to */
159+#ifndef SYM_START
160+#define SYM_START(name, linkage, align...) \
161+ SYM_ENTRY(name, linkage, align)
162+#endif
163+
164+/* SYM_END -- use only if you have to */
165+#ifndef SYM_END
166+#define SYM_END(name, sym_type) \
167+ .type name sym_type ASM_NL \
168+ .size name, .-name
169+#endif
170+
171+/* === code annotations === */
172+
173+/*
174+ * FUNC -- C-like functions (proper stack frame etc.)
175+ * CODE -- non-C code (e.g. irq handlers with different, special stack etc.)
176+ *
177+ * Objtool validates stack for FUNC, but not for CODE.
178+ * Objtool generates debug info for both FUNC & CODE, but needs special
179+ * annotations for each CODE's start (to describe the actual stack frame).
180+ *
181+ * ALIAS -- does not generate debug info -- the aliased function will
182+ */
183+
184+/* SYM_INNER_LABEL_ALIGN -- only for labels in the middle of code */
185+#ifndef SYM_INNER_LABEL_ALIGN
186+#define SYM_INNER_LABEL_ALIGN(name, linkage) \
187+ .type name SYM_T_NONE ASM_NL \
188+ SYM_ENTRY(name, linkage, SYM_A_ALIGN)
189+#endif
190+
191+/* SYM_INNER_LABEL -- only for labels in the middle of code */
192+#ifndef SYM_INNER_LABEL
193+#define SYM_INNER_LABEL(name, linkage) \
194+ .type name SYM_T_NONE ASM_NL \
195+ SYM_ENTRY(name, linkage, SYM_A_NONE)
196+#endif
197+
198+/*
199+ * SYM_FUNC_START_LOCAL_ALIAS -- use where there are two local names for one
200+ * function
201+ */
202+#ifndef SYM_FUNC_START_LOCAL_ALIAS
203+#define SYM_FUNC_START_LOCAL_ALIAS(name) \
204+ SYM_START(name, SYM_L_LOCAL, SYM_A_ALIGN)
205+#endif
206+
207+/*
208+ * SYM_FUNC_START_ALIAS -- use where there are two global names for one
209+ * function
210+ */
211+#ifndef SYM_FUNC_START_ALIAS
212+#define SYM_FUNC_START_ALIAS(name) \
213+ SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)
214+#endif
215+
216+/* SYM_FUNC_START -- use for global functions */
217+#ifndef SYM_FUNC_START
218+/*
219+ * The same as SYM_FUNC_START_ALIAS, but we will need to distinguish these two
220+ * later.
221+ */
222+#define SYM_FUNC_START(name) \
223+ SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)
224+#endif
225+
226+/* SYM_FUNC_START_NOALIGN -- use for global functions, w/o alignment */
227+#ifndef SYM_FUNC_START_NOALIGN
228+#define SYM_FUNC_START_NOALIGN(name) \
229+ SYM_START(name, SYM_L_GLOBAL, SYM_A_NONE)
230+#endif
231+
232+/* SYM_FUNC_START_LOCAL -- use for local functions */
233+#ifndef SYM_FUNC_START_LOCAL
234+/* the same as SYM_FUNC_START_LOCAL_ALIAS, see comment near SYM_FUNC_START */
235+#define SYM_FUNC_START_LOCAL(name) \
236+ SYM_START(name, SYM_L_LOCAL, SYM_A_ALIGN)
116237 #endif
117238
239+/* SYM_FUNC_START_LOCAL_NOALIGN -- use for local functions, w/o alignment */
240+#ifndef SYM_FUNC_START_LOCAL_NOALIGN
241+#define SYM_FUNC_START_LOCAL_NOALIGN(name) \
242+ SYM_START(name, SYM_L_LOCAL, SYM_A_NONE)
118243 #endif
119244
245+/* SYM_FUNC_START_WEAK -- use for weak functions */
246+#ifndef SYM_FUNC_START_WEAK
247+#define SYM_FUNC_START_WEAK(name) \
248+ SYM_START(name, SYM_L_WEAK, SYM_A_ALIGN)
120249 #endif
250+
251+/* SYM_FUNC_START_WEAK_NOALIGN -- use for weak functions, w/o alignment */
252+#ifndef SYM_FUNC_START_WEAK_NOALIGN
253+#define SYM_FUNC_START_WEAK_NOALIGN(name) \
254+ SYM_START(name, SYM_L_WEAK, SYM_A_NONE)
255+#endif
256+
257+/* SYM_FUNC_END_ALIAS -- the end of LOCAL_ALIASed or ALIASed function */
258+#ifndef SYM_FUNC_END_ALIAS
259+#define SYM_FUNC_END_ALIAS(name) \
260+ SYM_END(name, SYM_T_FUNC)
261+#endif
262+
263+/*
264+ * SYM_FUNC_END -- the end of SYM_FUNC_START_LOCAL, SYM_FUNC_START,
265+ * SYM_FUNC_START_WEAK, ...
266+ */
267+#ifndef SYM_FUNC_END
268+/* the same as SYM_FUNC_END_ALIAS, see comment near SYM_FUNC_START */
269+#define SYM_FUNC_END(name) \
270+ SYM_END(name, SYM_T_FUNC)
271+#endif
272+
273+/* SYM_CODE_START -- use for non-C (special) functions */
274+#ifndef SYM_CODE_START
275+#define SYM_CODE_START(name) \
276+ SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)
277+#endif
278+
279+/* SYM_CODE_START_NOALIGN -- use for non-C (special) functions, w/o alignment */
280+#ifndef SYM_CODE_START_NOALIGN
281+#define SYM_CODE_START_NOALIGN(name) \
282+ SYM_START(name, SYM_L_GLOBAL, SYM_A_NONE)
283+#endif
284+
285+/* SYM_CODE_START_LOCAL -- use for local non-C (special) functions */
286+#ifndef SYM_CODE_START_LOCAL
287+#define SYM_CODE_START_LOCAL(name) \
288+ SYM_START(name, SYM_L_LOCAL, SYM_A_ALIGN)
289+#endif
290+
291+/*
292+ * SYM_CODE_START_LOCAL_NOALIGN -- use for local non-C (special) functions,
293+ * w/o alignment
294+ */
295+#ifndef SYM_CODE_START_LOCAL_NOALIGN
296+#define SYM_CODE_START_LOCAL_NOALIGN(name) \
297+ SYM_START(name, SYM_L_LOCAL, SYM_A_NONE)
298+#endif
299+
300+/* SYM_CODE_END -- the end of SYM_CODE_START_LOCAL, SYM_CODE_START, ... */
301+#ifndef SYM_CODE_END
302+#define SYM_CODE_END(name) \
303+ SYM_END(name, SYM_T_NONE)
304+#endif
305+
306+/* === data annotations === */
307+
308+/* SYM_DATA_START -- global data symbol */
309+#ifndef SYM_DATA_START
310+#define SYM_DATA_START(name) \
311+ SYM_START(name, SYM_L_GLOBAL, SYM_A_NONE)
312+#endif
313+
314+/* SYM_DATA_START -- local data symbol */
315+#ifndef SYM_DATA_START_LOCAL
316+#define SYM_DATA_START_LOCAL(name) \
317+ SYM_START(name, SYM_L_LOCAL, SYM_A_NONE)
318+#endif
319+
320+/* SYM_DATA_END -- the end of SYM_DATA_START symbol */
321+#ifndef SYM_DATA_END
322+#define SYM_DATA_END(name) \
323+ SYM_END(name, SYM_T_OBJECT)
324+#endif
325+
326+/* SYM_DATA_END_LABEL -- the labeled end of SYM_DATA_START symbol */
327+#ifndef SYM_DATA_END_LABEL
328+#define SYM_DATA_END_LABEL(name, linkage, label) \
329+ linkage(label) ASM_NL \
330+ .type label SYM_T_OBJECT ASM_NL \
331+ label: \
332+ SYM_END(name, SYM_T_OBJECT)
333+#endif
334+
335+/* SYM_DATA -- start+end wrapper around simple global data */
336+#ifndef SYM_DATA
337+#define SYM_DATA(name, data...) \
338+ SYM_DATA_START(name) ASM_NL \
339+ data ASM_NL \
340+ SYM_DATA_END(name)
341+#endif
342+
343+/* SYM_DATA_LOCAL -- start+end wrapper around simple local data */
344+#ifndef SYM_DATA_LOCAL
345+#define SYM_DATA_LOCAL(name, data...) \
346+ SYM_DATA_START_LOCAL(name) ASM_NL \
347+ data ASM_NL \
348+ SYM_DATA_END(name)
349+#endif
350+
351+#endif /* __ASSEMBLY__ */
352+
353+#endif /* _LINUX_LINKAGE_H */
include/linux/linkmode.h+6−0
@@ -82,4 +82,10 @@ static inline int linkmode_equal(const unsigned long *src1, · 81 unmodified lines
8282 return bitmap_equal(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS);
8383 }
8484
85+static inline int linkmode_subset(const unsigned long *src1,
86+ const unsigned long *src2)
87+{
88+ return bitmap_subset(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS);
89+}
90+
8591 #endif /* __LINKMODE_H */
include/linux/livepatch.h+17−0
@@ -130,10 +130,23 @@ struct klp_object { · 129 unmodified lines
130130 bool patched;
131131 };
132132
133+/**
134+ * struct klp_state - state of the system modified by the livepatch
135+ * @id: system state identifier (non-zero)
136+ * @version: version of the change
137+ * @data: custom data
138+ */
139+struct klp_state {
140+ unsigned long id;
141+ unsigned int version;
142+ void *data;
143+};
144+
133145 /**
134146 * struct klp_patch - patch structure for live patching
135147 * @mod: reference to the live patch module
136148 * @objs: object entries for kernel objects to be patched
149+ * @states: system states that can get modified
137150 * @replace: replace all actively used patches
138151 * @list: list node for global list of actively used patches
139152 * @kobj: kobject for sysfs resources
@@ -147,6 +160,7 @@ struct klp_patch { · 7 unmodified lines
147160 /* external */
148161 struct module *mod;
149162 struct klp_object *objs;
163+ struct klp_state *states;
150164 bool replace;
151165
152166 /* internal */
@@ -217,6 +231,9 @@ void *klp_shadow_get_or_alloc(void *obj, unsigned long id, · 64 unmodified lines
217231 void klp_shadow_free(void *obj, unsigned long id, klp_shadow_dtor_t dtor);
218232 void klp_shadow_free_all(unsigned long id, klp_shadow_dtor_t dtor);
219233
234+struct klp_state *klp_get_state(struct klp_patch *patch, unsigned long id);
235+struct klp_state *klp_get_prev_state(unsigned long id);
236+
220237 #else /* !CONFIG_LIVEPATCH */
221238
222239 static inline int klp_module_coming(struct module *mod) { return 0; }
include/linux/lockd/debug.h+0−4
@@ -10,8 +10,6 @@ · 9 unmodified lines
1010 #ifndef LINUX_LOCKD_DEBUG_H
1111 #define LINUX_LOCKD_DEBUG_H
1212
13−#ifdef __KERNEL__
14−
1513 #include <linux/sunrpc/debug.h>
1614
1715 /*
@@ -25,8 +23,6 @@ · 7 unmodified lines
2523 # define ifdebug(flag) if (0)
2624 #endif
2725
28−#endif /* __KERNEL__ */
29−
3026 /*
3127 * Debug flags
3228 */
include/linux/lockd/lockd.h+0−4
@@ -10,8 +10,6 @@ · 9 unmodified lines
1010 #ifndef LINUX_LOCKD_LOCKD_H
1111 #define LINUX_LOCKD_LOCKD_H
1212
13−#ifdef __KERNEL__
14−
1513 #include <linux/in.h>
1614 #include <linux/in6.h>
1715 #include <net/ipv6.h>
@@ -373,6 +371,4 @@ static inline int nlm_compare_locks(const struct file_lock *fl1, · 355 unmodified lines
373371
374372 extern const struct lock_manager_operations nlmsvc_lock_operations;
375373
376−#endif /* __KERNEL__ */
377−
378374 #endif /* LINUX_LOCKD_LOCKD_H */
include/linux/lockdep.h+10−11
@@ -349,8 +349,7 @@ extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, · 348 unmodified lines
349349 int trylock, int read, int check,
350350 struct lockdep_map *nest_lock, unsigned long ip);
351351
352−extern void lock_release(struct lockdep_map *lock, int nested,
353− unsigned long ip);
352+extern void lock_release(struct lockdep_map *lock, unsigned long ip);
354353
355354 /*
356355 * Same "read" as for lock_acquire(), except -1 means any.
@@ -428,7 +427,7 @@ static inline void lockdep_set_selftest_task(struct task_struct *task) · 71 unmodified lines
428427 }
429428
430429 # define lock_acquire(l, s, t, r, c, n, i) do { } while (0)
431−# define lock_release(l, n, i) do { } while (0)
430+# define lock_release(l, i) do { } while (0)
432431 # define lock_downgrade(l, i) do { } while (0)
433432 # define lock_set_class(l, n, k, s, i) do { } while (0)
434433 # define lock_set_subclass(l, s, i) do { } while (0)
@@ -591,42 +590,42 @@ static inline void print_irqtrace_events(struct task_struct *curr) · 156 unmodified lines
591590
592591 #define spin_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
593592 #define spin_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
594−#define spin_release(l, n, i) lock_release(l, n, i)
593+#define spin_release(l, i) lock_release(l, i)
595594
596595 #define rwlock_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
597596 #define rwlock_acquire_read(l, s, t, i) lock_acquire_shared_recursive(l, s, t, NULL, i)
598−#define rwlock_release(l, n, i) lock_release(l, n, i)
597+#define rwlock_release(l, i) lock_release(l, i)
599598
600599 #define seqcount_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
601600 #define seqcount_acquire_read(l, s, t, i) lock_acquire_shared_recursive(l, s, t, NULL, i)
602−#define seqcount_release(l, n, i) lock_release(l, n, i)
601+#define seqcount_release(l, i) lock_release(l, i)
603602
604603 #define mutex_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
605604 #define mutex_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
606−#define mutex_release(l, n, i) lock_release(l, n, i)
605+#define mutex_release(l, i) lock_release(l, i)
607606
608607 #define rwsem_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
609608 #define rwsem_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
610609 #define rwsem_acquire_read(l, s, t, i) lock_acquire_shared(l, s, t, NULL, i)
611−#define rwsem_release(l, n, i) lock_release(l, n, i)
610+#define rwsem_release(l, i) lock_release(l, i)
612611
613612 #define lock_map_acquire(l) lock_acquire_exclusive(l, 0, 0, NULL, _THIS_IP_)
614613 #define lock_map_acquire_read(l) lock_acquire_shared_recursive(l, 0, 0, NULL, _THIS_IP_)
615614 #define lock_map_acquire_tryread(l) lock_acquire_shared_recursive(l, 0, 1, NULL, _THIS_IP_)
616−#define lock_map_release(l) lock_release(l, 1, _THIS_IP_)
615+#define lock_map_release(l) lock_release(l, _THIS_IP_)
617616
618617 #ifdef CONFIG_PROVE_LOCKING
619618 # define might_lock(lock) \
620619 do { \
621620 typecheck(struct lockdep_map *, &(lock)->dep_map); \
622621 lock_acquire(&(lock)->dep_map, 0, 0, 0, 1, NULL, _THIS_IP_); \
623− lock_release(&(lock)->dep_map, 0, _THIS_IP_); \
622+ lock_release(&(lock)->dep_map, _THIS_IP_); \
624623 } while (0)
625624 # define might_lock_read(lock) \
626625 do { \
627626 typecheck(struct lockdep_map *, &(lock)->dep_map); \
628627 lock_acquire(&(lock)->dep_map, 0, 0, 1, 1, NULL, _THIS_IP_); \
629− lock_release(&(lock)->dep_map, 0, _THIS_IP_); \
628+ lock_release(&(lock)->dep_map, _THIS_IP_); \
630629 } while (0)
631630
632631 #define lockdep_assert_irqs_enabled() do { \
include/linux/logic_pio.h+2−2
@@ -108,10 +108,10 @@ void logic_outsl(unsigned long addr, const void *buffer, unsigned int count); · 107 unmodified lines
108108 * area by redefining the macro below.
109109 */
110110 #define PIO_INDIRECT_SIZE 0x4000
111−#define MMIO_UPPER_LIMIT (IO_SPACE_LIMIT - PIO_INDIRECT_SIZE)
112111 #else
113−#define MMIO_UPPER_LIMIT IO_SPACE_LIMIT
112+#define PIO_INDIRECT_SIZE 0
114113 #endif /* CONFIG_INDIRECT_PIO */
114+#define MMIO_UPPER_LIMIT (IO_SPACE_LIMIT - PIO_INDIRECT_SIZE)
115115
116116 struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode);
117117 unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,
include/linux/lsm_hooks.h+15−0
@@ -1818,6 +1818,14 @@ union security_list_options { · 1817 unmodified lines
18181818 void (*bpf_prog_free_security)(struct bpf_prog_aux *aux);
18191819 #endif /* CONFIG_BPF_SYSCALL */
18201820 int (*locked_down)(enum lockdown_reason what);
1821+#ifdef CONFIG_PERF_EVENTS
1822+ int (*perf_event_open)(struct perf_event_attr *attr, int type);
1823+ int (*perf_event_alloc)(struct perf_event *event);
1824+ void (*perf_event_free)(struct perf_event *event);
1825+ int (*perf_event_read)(struct perf_event *event);
1826+ int (*perf_event_write)(struct perf_event *event);
1827+
1828+#endif
18211829 };
18221830
18231831 struct security_hook_heads {
@@ -2060,6 +2068,13 @@ struct security_hook_heads { · 236 unmodified lines
20602068 struct hlist_head bpf_prog_free_security;
20612069 #endif /* CONFIG_BPF_SYSCALL */
20622070 struct hlist_head locked_down;
2071+#ifdef CONFIG_PERF_EVENTS
2072+ struct hlist_head perf_event_open;
2073+ struct hlist_head perf_event_alloc;
2074+ struct hlist_head perf_event_free;
2075+ struct hlist_head perf_event_read;
2076+ struct hlist_head perf_event_write;
2077+#endif
20632078 } __randomize_layout;
20642079
20652080 /*
include/linux/memblock.h+3−0
@@ -358,6 +358,9 @@ static inline phys_addr_t memblock_phys_alloc(phys_addr_t size, · 357 unmodified lines
358358 MEMBLOCK_ALLOC_ACCESSIBLE);
359359 }
360360
361+void *memblock_alloc_exact_nid_raw(phys_addr_t size, phys_addr_t align,
362+ phys_addr_t min_addr, phys_addr_t max_addr,
363+ int nid);
361364 void *memblock_alloc_try_nid_raw(phys_addr_t size, phys_addr_t align,
362365 phys_addr_t min_addr, phys_addr_t max_addr,
363366 int nid);
include/linux/memcontrol.h+22−27
@@ -58,7 +58,6 @@ enum mem_cgroup_protection { · 57 unmodified lines
5858
5959 struct mem_cgroup_reclaim_cookie {
6060 pg_data_t *pgdat;
61− int priority;
6261 unsigned int generation;
6362 };
6463
@@ -81,7 +80,6 @@ struct mem_cgroup_id { · 16 unmodified lines
8180 enum mem_cgroup_events_target {
8281 MEM_CGROUP_TARGET_THRESH,
8382 MEM_CGROUP_TARGET_SOFTLIMIT,
84− MEM_CGROUP_TARGET_NUMAINFO,
8583 MEM_CGROUP_NTARGETS,
8684 };
8785
@@ -112,7 +110,7 @@ struct memcg_shrinker_map { · 24 unmodified lines
112110 };
113111
114112 /*
115− * per-zone information in memory controller.
113+ * per-node information in memory controller.
116114 */
117115 struct mem_cgroup_per_node {
118116 struct lruvec lruvec;
@@ -126,7 +124,7 @@ struct mem_cgroup_per_node { · 7 unmodified lines
126124
127125 unsigned long lru_zone_size[MAX_NR_ZONES][NR_LRU_LISTS];
128126
129− struct mem_cgroup_reclaim_iter iter[DEF_PRIORITY + 1];
127+ struct mem_cgroup_reclaim_iter iter;
130128
131129 struct memcg_shrinker_map __rcu *shrinker_map;
132130
@@ -134,9 +132,6 @@ struct mem_cgroup_per_node { · 1 unmodified line
134132 unsigned long usage_in_excess;/* Set to the value by which */
135133 /* the soft limit is exceeded*/
136134 bool on_tree;
137− bool congested; /* memcg has many dirty pages */
138− /* backed by a congested BDI */
139−
140135 struct mem_cgroup *memcg; /* Back pointer, we cannot */
141136 /* use container_of */
142137 };
@@ -313,13 +308,6 @@ struct mem_cgroup { · 170 unmodified lines
313308 struct list_head kmem_caches;
314309 #endif
315310
316− int last_scanned_node;
317−#if MAX_NUMNODES > 1
318− nodemask_t scan_nodes;
319− atomic_t numainfo_events;
320− atomic_t numainfo_updating;
321−#endif
322−
323311 #ifdef CONFIG_CGROUP_WRITEBACK
324312 struct list_head cgwb_list;
325313 struct wb_domain cgwb_domain;
@@ -394,25 +382,27 @@ mem_cgroup_nodeinfo(struct mem_cgroup *memcg, int nid) · 68 unmodified lines
394382 }
395383
396384 /**
397− * mem_cgroup_lruvec - get the lru list vector for a node or a memcg zone
398− * @node: node of the wanted lruvec
385+ * mem_cgroup_lruvec - get the lru list vector for a memcg & node
399386 * @memcg: memcg of the wanted lruvec
400387 *
401− * Returns the lru list vector holding pages for a given @node or a given
402− * @memcg and @zone. This can be the node lruvec, if the memory controller
403− * is disabled.
388+ * Returns the lru list vector holding pages for a given @memcg &
389+ * @node combination. This can be the node lruvec, if the memory
390+ * controller is disabled.
404391 */
405−static inline struct lruvec *mem_cgroup_lruvec(struct pglist_data *pgdat,
406− struct mem_cgroup *memcg)
392+static inline struct lruvec *mem_cgroup_lruvec(struct mem_cgroup *memcg,
393+ struct pglist_data *pgdat)
407394 {
408395 struct mem_cgroup_per_node *mz;
409396 struct lruvec *lruvec;
410397
411398 if (mem_cgroup_disabled()) {
412− lruvec = node_lruvec(pgdat);
399+ lruvec = &pgdat->__lruvec;
413400 goto out;
414401 }
415402
403+ if (!memcg)
404+ memcg = root_mem_cgroup;
405+
416406 mz = mem_cgroup_nodeinfo(memcg, pgdat->node_id);
417407 lruvec = &mz->lruvec;
418408 out:
@@ -728,7 +718,7 @@ static inline void __mod_lruvec_page_state(struct page *page, · 309 unmodified lines
728718 return;
729719 }
730720
731− lruvec = mem_cgroup_lruvec(pgdat, page->mem_cgroup);
721+ lruvec = mem_cgroup_lruvec(page->mem_cgroup, pgdat);
732722 __mod_lruvec_state(lruvec, idx, val);
733723 }
734724
@@ -899,16 +889,21 @@ static inline void mem_cgroup_migrate(struct page *old, struct page *new) · 164 unmodified lines
899889 {
900890 }
901891
902−static inline struct lruvec *mem_cgroup_lruvec(struct pglist_data *pgdat,
903− struct mem_cgroup *memcg)
892+static inline struct lruvec *mem_cgroup_lruvec(struct mem_cgroup *memcg,
893+ struct pglist_data *pgdat)
904894 {
905− return node_lruvec(pgdat);
895+ return &pgdat->__lruvec;
906896 }
907897
908898 static inline struct lruvec *mem_cgroup_page_lruvec(struct page *page,
909899 struct pglist_data *pgdat)
910900 {
911− return &pgdat->lruvec;
901+ return &pgdat->__lruvec;
902+}
903+
904+static inline struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg)
905+{
906+ return NULL;
912907 }
913908
914909 static inline bool mm_match_cgroup(struct mm_struct *mm,
include/linux/memory_hotplug.h+4−7
@@ -102,13 +102,10 @@ extern unsigned long __offline_isolated_pages(unsigned long start_pfn, · 101 unmodified lines
102102
103103 typedef void (*online_page_callback_t)(struct page *page, unsigned int order);
104104
105+extern void generic_online_page(struct page *page, unsigned int order);
105106 extern int set_online_page_callback(online_page_callback_t callback);
106107 extern int restore_online_page_callback(online_page_callback_t callback);
107108
108−extern void __online_page_set_limits(struct page *page);
109−extern void __online_page_increment_counters(struct page *page);
110−extern void __online_page_free(struct page *page);
111−
112109 extern int try_online_node(int nid);
113110
114111 extern int arch_add_memory(int nid, u64 start, u64 size,
@@ -229,9 +226,6 @@ void put_online_mems(void); · 114 unmodified lines
229226 void mem_hotplug_begin(void);
230227 void mem_hotplug_done(void);
231228
232−extern void set_zone_contiguous(struct zone *zone);
233−extern void clear_zone_contiguous(struct zone *zone);
234−
235229 #else /* ! CONFIG_MEMORY_HOTPLUG */
236230 #define pfn_to_online_page(pfn) \
237231 ({ \
@@ -339,6 +333,9 @@ static inline int remove_memory(int nid, u64 start, u64 size) · 101 unmodified lines
339333 static inline void __remove_memory(int nid, u64 start, u64 size) {}
340334 #endif /* CONFIG_MEMORY_HOTREMOVE */
341335
336+extern void set_zone_contiguous(struct zone *zone);
337+extern void clear_zone_contiguous(struct zone *zone);
338+
342339 extern void __ref free_area_init_core_hotplug(int nid);
343340 extern int __add_memory(int nid, u64 start, u64 size);
344341 extern int add_memory(int nid, u64 start, u64 size);
include/linux/memregion.h+23−0
@@ -0,0 +1,23 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _MEMREGION_H_
3+#define _MEMREGION_H_
4+#include <linux/types.h>
5+#include <linux/errno.h>
6+
7+struct memregion_info {
8+ int target_node;
9+};
10+
11+#ifdef CONFIG_MEMREGION
12+int memregion_alloc(gfp_t gfp);
13+void memregion_free(int id);
14+#else
15+static inline int memregion_alloc(gfp_t gfp)
16+{
17+ return -ENOMEM;
18+}
19+void memregion_free(int id)
20+{
21+}
22+#endif
23+#endif /* _MEMREGION_H_ */
include/linux/mfd/abx500/ab8500-gpadc.h+0−75
@@ -1,75 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/*
3− * Copyright (C) 2010 ST-Ericsson SA
4− *
5− * Author: Arun R Murthy <arun.murthy@stericsson.com>
6− * Author: Daniel Willerud <daniel.willerud@stericsson.com>
7− * Author: M'boumba Cedric Madianga <cedric.madianga@stericsson.com>
8− */
9−
10−#ifndef _AB8500_GPADC_H
11−#define _AB8500_GPADC_H
12−
13−/* GPADC source: From datasheet(ADCSwSel[4:0] in GPADCCtrl2
14− * and ADCHwSel[4:0] in GPADCCtrl3 ) */
15−#define BAT_CTRL 0x01
16−#define BTEMP_BALL 0x02
17−#define MAIN_CHARGER_V 0x03
18−#define ACC_DETECT1 0x04
19−#define ACC_DETECT2 0x05
20−#define ADC_AUX1 0x06
21−#define ADC_AUX2 0x07
22−#define MAIN_BAT_V 0x08
23−#define VBUS_V 0x09
24−#define MAIN_CHARGER_C 0x0A
25−#define USB_CHARGER_C 0x0B
26−#define BK_BAT_V 0x0C
27−#define DIE_TEMP 0x0D
28−#define USB_ID 0x0E
29−#define XTAL_TEMP 0x12
30−#define VBAT_TRUE_MEAS 0x13
31−#define BAT_CTRL_AND_IBAT 0x1C
32−#define VBAT_MEAS_AND_IBAT 0x1D
33−#define VBAT_TRUE_MEAS_AND_IBAT 0x1E
34−#define BAT_TEMP_AND_IBAT 0x1F
35−
36−/* Virtual channel used only for ibat convertion to ampere
37− * Battery current conversion (ibat) cannot be requested as a single conversion
38− * but it is always in combination with other input requests
39− */
40−#define IBAT_VIRTUAL_CHANNEL 0xFF
41−
42−#define SAMPLE_1 1
43−#define SAMPLE_4 4
44−#define SAMPLE_8 8
45−#define SAMPLE_16 16
46−#define RISING_EDGE 0
47−#define FALLING_EDGE 1
48−
49−/* Arbitrary ADC conversion type constants */
50−#define ADC_SW 0
51−#define ADC_HW 1
52−
53−struct ab8500_gpadc;
54−
55−struct ab8500_gpadc *ab8500_gpadc_get(char *name);
56−int ab8500_gpadc_sw_hw_convert(struct ab8500_gpadc *gpadc, u8 channel,
57− u8 avg_sample, u8 trig_edge, u8 trig_timer, u8 conv_type);
58−static inline int ab8500_gpadc_convert(struct ab8500_gpadc *gpadc, u8 channel)
59−{
60− return ab8500_gpadc_sw_hw_convert(gpadc, channel,
61− SAMPLE_16, 0, 0, ADC_SW);
62−}
63−
64−int ab8500_gpadc_read_raw(struct ab8500_gpadc *gpadc, u8 channel,
65− u8 avg_sample, u8 trig_edge, u8 trig_timer, u8 conv_type);
66−int ab8500_gpadc_double_read_raw(struct ab8500_gpadc *gpadc, u8 channel,
67− u8 avg_sample, u8 trig_edge, u8 trig_timer, u8 conv_type,
68− int *ibat);
69−int ab8500_gpadc_ad_to_voltage(struct ab8500_gpadc *gpadc,
70− u8 channel, int ad_value);
71−void ab8540_gpadc_get_otp(struct ab8500_gpadc *gpadc,
72− u16 *vmain_l, u16 *vmain_h, u16 *btemp_l, u16 *btemp_h,
73− u16 *vbat_l, u16 *vbat_h, u16 *ibat_l, u16 *ibat_h);
74−
75−#endif /* _AB8500_GPADC_H */
include/linux/mfd/arizona/registers.h+0−7
@@ -1186,13 +1186,6 @@ · 1185 unmodified lines
11861186 #define ARIZONA_DSP4_SCRATCH_1 0x1441
11871187 #define ARIZONA_DSP4_SCRATCH_2 0x1442
11881188 #define ARIZONA_DSP4_SCRATCH_3 0x1443
1189−#define ARIZONA_FRF_COEFF_1 0x1700
1190−#define ARIZONA_FRF_COEFF_2 0x1701
1191−#define ARIZONA_FRF_COEFF_3 0x1702
1192−#define ARIZONA_FRF_COEFF_4 0x1703
1193−#define ARIZONA_V2_DAC_COMP_1 0x1704
1194−#define ARIZONA_V2_DAC_COMP_2 0x1705
1195−
11961189
11971190 /*
11981191 * Field Definitions.
include/linux/mfd/core.h+29−20
@@ -12,6 +12,35 @@ · 11 unmodified lines
1212
1313 #include <linux/platform_device.h>
1414
15+#define MFD_RES_SIZE(arr) (sizeof(arr) / sizeof(struct resource))
16+
17+#define MFD_CELL_ALL(_name, _res, _pdata, _pdsize, _id, _compat, _match)\
18+ { \
19+ .name = (_name), \
20+ .resources = (_res), \
21+ .num_resources = MFD_RES_SIZE((_res)), \
22+ .platform_data = (_pdata), \
23+ .pdata_size = (_pdsize), \
24+ .of_compatible = (_compat), \
25+ .acpi_match = (_match), \
26+ .id = (_id), \
27+ }
28+
29+#define OF_MFD_CELL(_name, _res, _pdata, _pdsize,_id, _compat) \
30+ MFD_CELL_ALL(_name, _res, _pdata, _pdsize, _id, _compat, NULL) \
31+
32+#define ACPI_MFD_CELL(_name, _res, _pdata, _pdsize, _id, _match) \
33+ MFD_CELL_ALL(_name, _res, _pdata, _pdsize, _id, NULL, _match) \
34+
35+#define MFD_CELL_BASIC(_name, _res, _pdata, _pdsize, _id) \
36+ MFD_CELL_ALL(_name, _res, _pdata, _pdsize, _id, NULL, NULL) \
37+
38+#define MFD_CELL_RES(_name, _res) \
39+ MFD_CELL_ALL(_name, _res, NULL, 0, 0, NULL, NULL) \
40+
41+#define MFD_CELL_NAME(_name) \
42+ MFD_CELL_ALL(_name, NULL, NULL, 0, 0, NULL, NULL) \
43+
1544 struct irq_domain;
1645 struct property_entry;
1746
@@ -30,8 +59,6 @@ struct mfd_cell { · 12 unmodified lines
3059 const char *name;
3160 int id;
3261
33− /* refcounting for multiple drivers to use a single cell */
34− atomic_t *usage_count;
3562 int (*enable)(struct platform_device *dev);
3663 int (*disable)(struct platform_device *dev);
3764
@@ -86,24 +113,6 @@ struct mfd_cell { · 48 unmodified lines
86113 extern int mfd_cell_enable(struct platform_device *pdev);
87114 extern int mfd_cell_disable(struct platform_device *pdev);
88115
89−/*
90− * "Clone" multiple platform devices for a single cell. This is to be used
91− * for devices that have multiple users of a cell. For example, if an mfd
92− * driver wants the cell "foo" to be used by a GPIO driver, an MTD driver,
93− * and a platform driver, the following bit of code would be use after first
94− * calling mfd_add_devices():
95− *
96− * const char *fclones[] = { "foo-gpio", "foo-mtd" };
97− * err = mfd_clone_cells("foo", fclones, ARRAY_SIZE(fclones));
98− *
99− * Each driver (MTD, GPIO, and platform driver) would then register
100− * platform_drivers for "foo-mtd", "foo-gpio", and "foo", respectively.
101− * The cell's .enable/.disable hooks should be used to deal with hardware
102− * resource contention.
103− */
104−extern int mfd_clone_cell(const char *cell, const char **clones,
105− size_t n_clones);
106−
107116 /*
108117 * Given a platform device that's been created by mfd_add_devices(), fetch
109118 * the mfd_cell that created it.
include/linux/mfd/db8500-prcmu.h+2−2
@@ -489,7 +489,7 @@ struct prcmu_auto_pm_config { · 488 unmodified lines
489489
490490 #ifdef CONFIG_MFD_DB8500_PRCMU
491491
492−void db8500_prcmu_early_init(u32 phy_base, u32 size);
492+void db8500_prcmu_early_init(void);
493493 int prcmu_set_rc_a2p(enum romcode_write);
494494 enum romcode_read prcmu_get_rc_p2a(void);
495495 enum ap_pwrst prcmu_get_xp70_current_state(void);
@@ -546,7 +546,7 @@ void db8500_prcmu_write_masked(unsigned int reg, u32 mask, u32 value); · 50 unmodified lines
546546
547547 #else /* !CONFIG_MFD_DB8500_PRCMU */
548548
549−static inline void db8500_prcmu_early_init(u32 phy_base, u32 size) {}
549+static inline void db8500_prcmu_early_init(void) {}
550550
551551 static inline int prcmu_set_rc_a2p(enum romcode_write code)
552552 {
include/linux/mfd/dbx500-prcmu.h+4−3
@@ -190,6 +190,7 @@ enum ddr_pwrst { · 189 unmodified lines
190190 #define PRCMU_FW_PROJECT_U8500_MBL2 12 /* Customer specific */
191191 #define PRCMU_FW_PROJECT_U8520 13
192192 #define PRCMU_FW_PROJECT_U8420 14
193+#define PRCMU_FW_PROJECT_U8420_SYSCLK 17
193194 #define PRCMU_FW_PROJECT_A9420 20
194195 /* [32..63] 9540 and derivatives */
195196 #define PRCMU_FW_PROJECT_U9540 32
@@ -211,9 +212,9 @@ struct prcmu_fw_version { · 15 unmodified lines
211212
212213 #if defined(CONFIG_UX500_SOC_DB8500)
213214
214−static inline void prcmu_early_init(u32 phy_base, u32 size)
215+static inline void prcmu_early_init(void)
215216 {
216− return db8500_prcmu_early_init(phy_base, size);
217+ return db8500_prcmu_early_init();
217218 }
218219
219220 static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
@@ -401,7 +402,7 @@ static inline int prcmu_config_a9wdog(u8 num, bool sleep_auto_off) · 181 unmodified lines
401402 }
402403 #else
403404
404−static inline void prcmu_early_init(u32 phy_base, u32 size) {}
405+static inline void prcmu_early_init(void) {}
405406
406407 static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
407408 bool keep_ap_pll)
include/linux/mfd/madera/core.h+11−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #ifndef MADERA_CORE_H
99 #define MADERA_CORE_H
1010
11+#include <linux/clk.h>
1112 #include <linux/gpio/consumer.h>
1213 #include <linux/interrupt.h>
1314 #include <linux/mfd/madera/pdata.h>
@@ -29,6 +30,13 @@ enum madera_type { · 15 unmodified lines
2930 CS42L92 = 9,
3031 };
3132
33+enum {
34+ MADERA_MCLK1,
35+ MADERA_MCLK2,
36+ MADERA_MCLK3,
37+ MADERA_NUM_MCLK
38+};
39+
3240 #define MADERA_MAX_CORE_SUPPLIES 2
3341 #define MADERA_MAX_GPIOS 40
3442
@@ -155,6 +163,7 @@ struct snd_soc_dapm_context; · 120 unmodified lines
155163 * @irq_dev: the irqchip child driver device
156164 * @irq_data: pointer to irqchip data for the child irqchip driver
157165 * @irq: host irq number from SPI or I2C configuration
166+ * @mclk: Structure holding clock supplies
158167 * @out_clamp: indicates output clamp state for each analogue output
159168 * @out_shorted: indicates short circuit state for each analogue output
160169 * @hp_ena: bitflags of enable state for the headphone outputs
@@ -184,6 +193,8 @@ struct madera { · 23 unmodified lines
184193 struct regmap_irq_chip_data *irq_data;
185194 int irq;
186195
196+ struct clk_bulk_data mclk[MADERA_NUM_MCLK];
197+
187198 unsigned int num_micbias;
188199 unsigned int num_childbias[MADERA_MAX_MICBIAS];
189200
include/linux/mfd/max77620.h+0−1
@@ -329,7 +329,6 @@ struct max77620_chip { · 328 unmodified lines
329329 struct regmap *rmap;
330330
331331 int chip_irq;
332− int irq_base;
333332
334333 /* chip id */
335334 enum max77620_chip_id chip_id;
include/linux/mfd/mt6397/rtc.h+71−0
@@ -0,0 +1,71 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright (C) 2014-2019 MediaTek Inc.
4+ *
5+ * Author: Tianping.Fang <tianping.fang@mediatek.com>
6+ * Sean Wang <sean.wang@mediatek.com>
7+ */
8+
9+#ifndef _LINUX_MFD_MT6397_RTC_H_
10+#define _LINUX_MFD_MT6397_RTC_H_
11+
12+#include <linux/jiffies.h>
13+#include <linux/mutex.h>
14+#include <linux/regmap.h>
15+#include <linux/rtc.h>
16+
17+#define RTC_BBPU 0x0000
18+#define RTC_BBPU_CBUSY BIT(6)
19+#define RTC_BBPU_KEY (0x43 << 8)
20+
21+#define RTC_WRTGR 0x003c
22+
23+#define RTC_IRQ_STA 0x0002
24+#define RTC_IRQ_STA_AL BIT(0)
25+#define RTC_IRQ_STA_LP BIT(3)
26+
27+#define RTC_IRQ_EN 0x0004
28+#define RTC_IRQ_EN_AL BIT(0)
29+#define RTC_IRQ_EN_ONESHOT BIT(2)
30+#define RTC_IRQ_EN_LP BIT(3)
31+#define RTC_IRQ_EN_ONESHOT_AL (RTC_IRQ_EN_ONESHOT | RTC_IRQ_EN_AL)
32+
33+#define RTC_AL_MASK 0x0008
34+#define RTC_AL_MASK_DOW BIT(4)
35+
36+#define RTC_TC_SEC 0x000a
37+/* Min, Hour, Dom... register offset to RTC_TC_SEC */
38+#define RTC_OFFSET_SEC 0
39+#define RTC_OFFSET_MIN 1
40+#define RTC_OFFSET_HOUR 2
41+#define RTC_OFFSET_DOM 3
42+#define RTC_OFFSET_DOW 4
43+#define RTC_OFFSET_MTH 5
44+#define RTC_OFFSET_YEAR 6
45+#define RTC_OFFSET_COUNT 7
46+
47+#define RTC_AL_SEC 0x0018
48+
49+#define RTC_PDN2 0x002e
50+#define RTC_PDN2_PWRON_ALARM BIT(4)
51+
52+#define RTC_MIN_YEAR 1968
53+#define RTC_BASE_YEAR 1900
54+#define RTC_NUM_YEARS 128
55+#define RTC_MIN_YEAR_OFFSET (RTC_MIN_YEAR - RTC_BASE_YEAR)
56+
57+#define MTK_RTC_POLL_DELAY_US 10
58+#define MTK_RTC_POLL_TIMEOUT (jiffies_to_usecs(HZ))
59+
60+struct mt6397_rtc {
61+ struct device *dev;
62+ struct rtc_device *rtc_dev;
63+
64+ /* Protect register access from multiple tasks */
65+ struct mutex lock;
66+ struct regmap *regmap;
67+ int irq;
68+ u32 addr_base;
69+};
70+
71+#endif /* _LINUX_MFD_MT6397_RTC_H_ */
include/linux/mfd/rk808.h+1−1
@@ -610,7 +610,7 @@ enum { · 609 unmodified lines
610610 RK808_ID = 0x0000,
611611 RK809_ID = 0x8090,
612612 RK817_ID = 0x8170,
613− RK818_ID = 0x8181,
613+ RK818_ID = 0x8180,
614614 };
615615
616616 struct rk808 {
include/linux/mfd/stm32-timers.h+4−8
@@ -70,14 +70,11 @@ · 69 unmodified lines
7070 #define TIM_CCER_CC4E BIT(12) /* Capt/Comp 4 out Ena */
7171 #define TIM_CCER_CC4P BIT(13) /* Capt/Comp 4 Polarity */
7272 #define TIM_CCER_CCXE (BIT(0) | BIT(4) | BIT(8) | BIT(12))
73−#define TIM_BDTR_BKE BIT(12) /* Break input enable */
74−#define TIM_BDTR_BKP BIT(13) /* Break input polarity */
73+#define TIM_BDTR_BKE(x) BIT(12 + (x) * 12) /* Break input enable */
74+#define TIM_BDTR_BKP(x) BIT(13 + (x) * 12) /* Break input polarity */
7575 #define TIM_BDTR_AOE BIT(14) /* Automatic Output Enable */
7676 #define TIM_BDTR_MOE BIT(15) /* Main Output Enable */
77−#define TIM_BDTR_BKF (BIT(16) | BIT(17) | BIT(18) | BIT(19))
78−#define TIM_BDTR_BK2F (BIT(20) | BIT(21) | BIT(22) | BIT(23))
79−#define TIM_BDTR_BK2E BIT(24) /* Break 2 input enable */
80−#define TIM_BDTR_BK2P BIT(25) /* Break 2 input polarity */
77+#define TIM_BDTR_BKF(x) (0xf << (16 + (x) * 4))
8178 #define TIM_DCR_DBA GENMASK(4, 0) /* DMA base addr */
8279 #define TIM_DCR_DBL GENMASK(12, 8) /* DMA burst len */
8380
@@ -87,8 +84,7 @@ · 3 unmodified lines
8784 #define TIM_CR2_MMS2_SHIFT 20
8885 #define TIM_SMCR_TS_SHIFT 4
8986 #define TIM_BDTR_BKF_MASK 0xF
90−#define TIM_BDTR_BKF_SHIFT 16
91−#define TIM_BDTR_BK2F_SHIFT 20
87+#define TIM_BDTR_BKF_SHIFT(x) (16 + (x) * 4)
9288
9389 enum stm32_timers_dmas {
9490 STM32_TIMERS_DMA_CH1,
include/linux/mfd/syscon/atmel-matrix.h+0−1
@@ -106,7 +106,6 @@ · 105 unmodified lines
106106 #define AT91_MATRIX_DDR_IOSR BIT(18)
107107 #define AT91_MATRIX_NFD0_SELECT BIT(24)
108108 #define AT91_MATRIX_DDR_MP_EN BIT(25)
109−#define AT91_MATRIX_EBI_NUM_CS 8
110109
111110 #define AT91_MATRIX_USBPUCR_PUON BIT(30)
112111
include/linux/mfd/twl.h+8−4
@@ -181,14 +181,18 @@ static inline int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg) { · 180 unmodified lines
181181 }
182182
183183 static inline int twl_i2c_write_u16(u8 mod_no, u16 val, u8 reg) {
184− val = cpu_to_le16(val);
185− return twl_i2c_write(mod_no, (u8*) &val, reg, 2);
184+ __le16 value;
185+
186+ value = cpu_to_le16(val);
187+ return twl_i2c_write(mod_no, (u8 *) &value, reg, 2);
186188 }
187189
188190 static inline int twl_i2c_read_u16(u8 mod_no, u16 *val, u8 reg) {
189191 int ret;
190− ret = twl_i2c_read(mod_no, (u8*) val, reg, 2);
191− *val = le16_to_cpu(*val);
192+ __le16 value;
193+
194+ ret = twl_i2c_read(mod_no, (u8 *) &value, reg, 2);
195+ *val = le16_to_cpu(value);
192196 return ret;
193197 }
194198
include/linux/miscdevice.h+2−0
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #define SGI_MMTIMER 153
3434 #define STORE_QUEUE_MINOR 155 /* unused */
3535 #define I2O_MINOR 166
36+#define AGPGART_MINOR 175
3637 #define HWRNG_MINOR 183
3738 #define MICROCODE_MINOR 184
3839 #define IRNET_MINOR 187
@@ -57,6 +58,7 @@ · 18 unmodified lines
5758 #define UHID_MINOR 239
5859 #define USERIO_MINOR 240
5960 #define VHOST_VSOCK_MINOR 241
61+#define RFKILL_MINOR 242
6062 #define MISC_DYNAMIC_MINOR 255
6163
6264 struct device;
include/linux/mlx5/driver.h+16−4
@@ -556,8 +556,6 @@ struct mlx5_priv { · 555 unmodified lines
556556 struct dentry *cmdif_debugfs;
557557 /* end: qp staff */
558558
559− struct xarray mkey_table;
560−
561559 /* start: alloc staff */
562560 /* protect buffer alocation according to numa node */
563561 struct mutex alloc_mutex;
@@ -942,8 +940,6 @@ struct mlx5_cmd_mailbox *mlx5_alloc_cmd_mailbox_chain(struct mlx5_core_dev *dev, · 378 unmodified lines
942940 gfp_t flags, int npages);
943941 void mlx5_free_cmd_mailbox_chain(struct mlx5_core_dev *dev,
944942 struct mlx5_cmd_mailbox *head);
945−void mlx5_init_mkey_table(struct mlx5_core_dev *dev);
946−void mlx5_cleanup_mkey_table(struct mlx5_core_dev *dev);
947943 int mlx5_core_create_mkey_cb(struct mlx5_core_dev *dev,
948944 struct mlx5_core_mkey *mkey,
949945 struct mlx5_async_ctx *async_ctx, u32 *in,
@@ -1121,6 +1117,11 @@ static inline bool mlx5_core_is_pf(const struct mlx5_core_dev *dev) · 171 unmodified lines
11211117 return dev->coredev_type == MLX5_COREDEV_PF;
11221118 }
11231119
1120+static inline bool mlx5_core_is_vf(const struct mlx5_core_dev *dev)
1121+{
1122+ return dev->coredev_type == MLX5_COREDEV_VF;
1123+}
1124+
11241125 static inline bool mlx5_core_is_ecpf(struct mlx5_core_dev *dev)
11251126 {
11261127 return dev->caps.embedded_cpu;
@@ -1186,4 +1187,15 @@ enum { · 59 unmodified lines
11861187 MLX5_TRIGGERED_CMD_COMP = (u64)1 << 32,
11871188 };
11881189
1190+static inline bool mlx5_is_roce_enabled(struct mlx5_core_dev *dev)
1191+{
1192+ struct devlink *devlink = priv_to_devlink(dev);
1193+ union devlink_param_value val;
1194+
1195+ devlink_param_driverinit_value_get(devlink,
1196+ DEVLINK_PARAM_GENERIC_ID_ENABLE_ROCE,
1197+ &val);
1198+ return val.vbool;
1199+}
1200+
11891201 #endif /* MLX5_DRIVER_H */
include/linux/mlx5/fs.h+2−1
@@ -80,7 +80,8 @@ enum mlx5_flow_namespace_type { · 79 unmodified lines
8080
8181 enum {
8282 FDB_BYPASS_PATH,
83− FDB_FAST_PATH,
83+ FDB_TC_OFFLOAD,
84+ FDB_FT_OFFLOAD,
8485 FDB_SLOW_PATH,
8586 };
8687
include/linux/mlx5/mlx5_ifc.h+2−1
@@ -1110,6 +1110,7 @@ enum { · 1109 unmodified lines
11101110 };
11111111
11121112 enum {
1113+ MLX5_FLEX_PARSER_GENEVE_ENABLED = 1 << 3,
11131114 MLX5_FLEX_PARSER_VXLAN_GPE_ENABLED = 1 << 7,
11141115 MLX5_FLEX_PARSER_ICMP_V4_ENABLED = 1 << 8,
11151116 MLX5_FLEX_PARSER_ICMP_V6_ENABLED = 1 << 9,
@@ -1153,7 +1154,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 37 unmodified lines
11531154 u8 log_max_srq[0x5];
11541155 u8 reserved_at_b0[0x10];
11551156
1156− u8 reserved_at_c0[0x8];
1157+ u8 max_sgl_for_optimized_performance[0x8];
11571158 u8 log_max_cq_sz[0x8];
11581159 u8 reserved_at_d0[0xb];
11591160 u8 log_max_cq[0x5];
include/linux/mm.h+32−28
@@ -564,21 +564,6 @@ int vma_is_stack_for_current(struct vm_area_struct *vma); · 563 unmodified lines
564564 struct mmu_gather;
565565 struct inode;
566566
567−#if !defined(CONFIG_ARCH_HAS_PTE_DEVMAP) || !defined(CONFIG_TRANSPARENT_HUGEPAGE)
568−static inline int pmd_devmap(pmd_t pmd)
569−{
570− return 0;
571−}
572−static inline int pud_devmap(pud_t pud)
573−{
574− return 0;
575−}
576−static inline int pgd_devmap(pgd_t pgd)
577−{
578− return 0;
579−}
580−#endif
581−
582567 /*
583568 * FIXME: take this include out, include page-flags.h in
584569 * files which need it (119 of them)
@@ -1643,19 +1628,27 @@ static inline unsigned long get_mm_counter(struct mm_struct *mm, int member) · 1058 unmodified lines
16431628 return (unsigned long)val;
16441629 }
16451630
1631+void mm_trace_rss_stat(struct mm_struct *mm, int member, long count);
1632+
16461633 static inline void add_mm_counter(struct mm_struct *mm, int member, long value)
16471634 {
1648− atomic_long_add(value, &mm->rss_stat.count[member]);
1635+ long count = atomic_long_add_return(value, &mm->rss_stat.count[member]);
1636+
1637+ mm_trace_rss_stat(mm, member, count);
16491638 }
16501639
16511640 static inline void inc_mm_counter(struct mm_struct *mm, int member)
16521641 {
1653− atomic_long_inc(&mm->rss_stat.count[member]);
1642+ long count = atomic_long_inc_return(&mm->rss_stat.count[member]);
1643+
1644+ mm_trace_rss_stat(mm, member, count);
16541645 }
16551646
16561647 static inline void dec_mm_counter(struct mm_struct *mm, int member)
16571648 {
1658− atomic_long_dec(&mm->rss_stat.count[member]);
1649+ long count = atomic_long_dec_return(&mm->rss_stat.count[member]);
1650+
1651+ mm_trace_rss_stat(mm, member, count);
16591652 }
16601653
16611654 /* Optimized variant when page is already known not to be PageAnon */
@@ -1845,12 +1838,12 @@ static inline void mm_dec_nr_ptes(struct mm_struct *mm) {} · 183 unmodified lines
18451838 int __pte_alloc(struct mm_struct *mm, pmd_t *pmd);
18461839 int __pte_alloc_kernel(pmd_t *pmd);
18471840
1841+#if defined(CONFIG_MMU)
1842+
18481843 /*
1849− * The following ifdef needed to get the 4level-fixup.h header to work.
1850− * Remove it when 4level-fixup.h has been removed.
1844+ * The following ifdef needed to get the 5level-fixup.h header to work.
1845+ * Remove it when 5level-fixup.h has been removed.
18511846 */
1852−#if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK)
1853−
18541847 #ifndef __ARCH_HAS_5LEVEL_HACK
18551848 static inline p4d_t *p4d_alloc(struct mm_struct *mm, pgd_t *pgd,
18561849 unsigned long address)
@@ -1872,7 +1865,7 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a · 15 unmodified lines
18721865 return (unlikely(pud_none(*pud)) && __pmd_alloc(mm, pud, address))?
18731866 NULL: pmd_offset(pud, address);
18741867 }
1875−#endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */
1868+#endif /* CONFIG_MMU */
18761869
18771870 #if USE_SPLIT_PTE_PTLOCKS
18781871 #if ALLOC_SPLIT_PTLOCKS
@@ -2214,9 +2207,6 @@ void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...); · 335 unmodified lines
22142207
22152208 extern void setup_per_cpu_pageset(void);
22162209
2217−extern void zone_pcp_update(struct zone *zone);
2218−extern void zone_pcp_reset(struct zone *zone);
2219−
22202210 /* page_alloc.c */
22212211 extern int min_free_kbytes;
22222212 extern int watermark_boost_factor;
@@ -2631,7 +2621,9 @@ static inline int vm_fault_to_errno(vm_fault_t vm_fault, int foll_flags) · 408 unmodified lines
26312621 typedef int (*pte_fn_t)(pte_t *pte, unsigned long addr, void *data);
26322622 extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
26332623 unsigned long size, pte_fn_t fn, void *data);
2634−
2624+extern int apply_to_existing_page_range(struct mm_struct *mm,
2625+ unsigned long address, unsigned long size,
2626+ pte_fn_t fn, void *data);
26352627
26362628 #ifdef CONFIG_PAGE_POISONING
26372629 extern bool page_poisoning_enabled(void);
@@ -2781,7 +2773,7 @@ extern int sysctl_memory_failure_early_kill; · 143 unmodified lines
27812773 extern int sysctl_memory_failure_recovery;
27822774 extern void shake_page(struct page *p, int access);
27832775 extern atomic_long_t num_poisoned_pages __read_mostly;
2784−extern int soft_offline_page(struct page *page, int flags);
2776+extern int soft_offline_page(unsigned long pfn, int flags);
27852777
27862778
27872779 /*
@@ -2873,5 +2865,17 @@ static inline int pages_identical(struct page *page1, struct page *page2) · 85 unmodified lines
28732865 return !memcmp_pages(page1, page2);
28742866 }
28752867
2868+#ifdef CONFIG_MAPPING_DIRTY_HELPERS
2869+unsigned long clean_record_shared_mapping_range(struct address_space *mapping,
2870+ pgoff_t first_index, pgoff_t nr,
2871+ pgoff_t bitmap_pgoff,
2872+ unsigned long *bitmap,
2873+ pgoff_t *start,
2874+ pgoff_t *end);
2875+
2876+unsigned long wp_shared_mapping_range(struct address_space *mapping,
2877+ pgoff_t first_index, pgoff_t nr);
2878+#endif
2879+
28762880 #endif /* __KERNEL__ */
28772881 #endif /* _LINUX_MM_H */
include/linux/mmc/card.h+2−1
@@ -226,7 +226,7 @@ struct mmc_queue_req; · 225 unmodified lines
226226 * MMC Physical partitions
227227 */
228228 struct mmc_part {
229− unsigned int size; /* partition size (in bytes) */
229+ u64 size; /* partition size (in bytes) */
230230 unsigned int part_cfg; /* partition type */
231231 char name[MAX_MMC_PART_NAME_LEN];
232232 bool force_ro; /* to make boot parts RO by default */
@@ -291,6 +291,7 @@ struct mmc_card { · 58 unmodified lines
291291 struct sd_switch_caps sw_caps; /* switch (CMD6) caps */
292292
293293 unsigned int sdio_funcs; /* number of SDIO functions */
294+ atomic_t sdio_funcs_probed; /* number of probed SDIO funcs */
294295 struct sdio_cccr cccr; /* common card info */
295296 struct sdio_cis cis; /* common tuple info */
296297 struct sdio_func *sdio_func[SDIO_MAX_FUNCS]; /* SDIO functions (devices) */
include/linux/mmc/sdio_ids.h+2−0
@@ -71,6 +71,8 @@ · 70 unmodified lines
7171
7272 #define SDIO_VENDOR_ID_TI 0x0097
7373 #define SDIO_DEVICE_ID_TI_WL1271 0x4076
74+#define SDIO_VENDOR_ID_TI_WL1251 0x104c
75+#define SDIO_DEVICE_ID_TI_WL1251 0x9066
7476
7577 #define SDIO_VENDOR_ID_STE 0x0020
7678 #define SDIO_DEVICE_ID_STE_CW1200 0x2280
include/linux/mmu_notifier.h+118−29
@@ -6,9 +6,12 @@ · 5 unmodified lines
66 #include <linux/spinlock.h>
77 #include <linux/mm_types.h>
88 #include <linux/srcu.h>
9+#include <linux/interval_tree.h>
910
11+struct mmu_notifier_mm;
1012 struct mmu_notifier;
11−struct mmu_notifier_ops;
13+struct mmu_notifier_range;
14+struct mmu_interval_notifier;
1215
1316 /**
1417 * enum mmu_notifier_event - reason for the mmu notifier callback
@@ -31,6 +34,9 @@ struct mmu_notifier_ops; · 16 unmodified lines
3134 * access flags). User should soft dirty the page in the end callback to make
3235 * sure that anyone relying on soft dirtyness catch pages that might be written
3336 * through non CPU mappings.
37+ *
38+ * @MMU_NOTIFY_RELEASE: used during mmu_interval_notifier invalidate to signal
39+ * that the mm refcount is zero and the range is no longer accessible.
3440 */
3541 enum mmu_notifier_event {
3642 MMU_NOTIFY_UNMAP = 0,
@@ -38,38 +44,11 @@ enum mmu_notifier_event { · 1 unmodified line
3844 MMU_NOTIFY_PROTECTION_VMA,
3945 MMU_NOTIFY_PROTECTION_PAGE,
4046 MMU_NOTIFY_SOFT_DIRTY,
41−};
42−
43−#ifdef CONFIG_MMU_NOTIFIER
44−
45−#ifdef CONFIG_LOCKDEP
46−extern struct lockdep_map __mmu_notifier_invalidate_range_start_map;
47−#endif
48−
49−/*
50− * The mmu notifier_mm structure is allocated and installed in
51− * mm->mmu_notifier_mm inside the mm_take_all_locks() protected
52− * critical section and it's released only when mm_count reaches zero
53− * in mmdrop().
54− */
55−struct mmu_notifier_mm {
56− /* all mmu notifiers registerd in this mm are queued in this list */
57− struct hlist_head list;
58− /* to serialize the list modifications and hlist_unhashed */
59− spinlock_t lock;
47+ MMU_NOTIFY_RELEASE,
6048 };
6149
6250 #define MMU_NOTIFIER_RANGE_BLOCKABLE (1 << 0)
6351
64−struct mmu_notifier_range {
65− struct vm_area_struct *vma;
66− struct mm_struct *mm;
67− unsigned long start;
68− unsigned long end;
69− unsigned flags;
70− enum mmu_notifier_event event;
71−};
72−
7352 struct mmu_notifier_ops {
7453 /*
7554 * Called either by mmu_notifier_unregister or when the mm is
@@ -249,6 +228,41 @@ struct mmu_notifier { · 173 unmodified lines
249228 unsigned int users;
250229 };
251230
231+/**
232+ * struct mmu_interval_notifier_ops
233+ * @invalidate: Upon return the caller must stop using any SPTEs within this
234+ * range. This function can sleep. Return false only if sleeping
235+ * was required but mmu_notifier_range_blockable(range) is false.
236+ */
237+struct mmu_interval_notifier_ops {
238+ bool (*invalidate)(struct mmu_interval_notifier *mni,
239+ const struct mmu_notifier_range *range,
240+ unsigned long cur_seq);
241+};
242+
243+struct mmu_interval_notifier {
244+ struct interval_tree_node interval_tree;
245+ const struct mmu_interval_notifier_ops *ops;
246+ struct mm_struct *mm;
247+ struct hlist_node deferred_item;
248+ unsigned long invalidate_seq;
249+};
250+
251+#ifdef CONFIG_MMU_NOTIFIER
252+
253+#ifdef CONFIG_LOCKDEP
254+extern struct lockdep_map __mmu_notifier_invalidate_range_start_map;
255+#endif
256+
257+struct mmu_notifier_range {
258+ struct vm_area_struct *vma;
259+ struct mm_struct *mm;
260+ unsigned long start;
261+ unsigned long end;
262+ unsigned flags;
263+ enum mmu_notifier_event event;
264+};
265+
252266 static inline int mm_has_notifiers(struct mm_struct *mm)
253267 {
254268 return unlikely(mm->mmu_notifier_mm);
@@ -275,6 +289,81 @@ extern int __mmu_notifier_register(struct mmu_notifier *mn, · 20 unmodified lines
275289 struct mm_struct *mm);
276290 extern void mmu_notifier_unregister(struct mmu_notifier *mn,
277291 struct mm_struct *mm);
292+
293+unsigned long mmu_interval_read_begin(struct mmu_interval_notifier *mni);
294+int mmu_interval_notifier_insert(struct mmu_interval_notifier *mni,
295+ struct mm_struct *mm, unsigned long start,
296+ unsigned long length,
297+ const struct mmu_interval_notifier_ops *ops);
298+int mmu_interval_notifier_insert_locked(
299+ struct mmu_interval_notifier *mni, struct mm_struct *mm,
300+ unsigned long start, unsigned long length,
301+ const struct mmu_interval_notifier_ops *ops);
302+void mmu_interval_notifier_remove(struct mmu_interval_notifier *mni);
303+
304+/**
305+ * mmu_interval_set_seq - Save the invalidation sequence
306+ * @mni - The mni passed to invalidate
307+ * @cur_seq - The cur_seq passed to the invalidate() callback
308+ *
309+ * This must be called unconditionally from the invalidate callback of a
310+ * struct mmu_interval_notifier_ops under the same lock that is used to call
311+ * mmu_interval_read_retry(). It updates the sequence number for later use by
312+ * mmu_interval_read_retry(). The provided cur_seq will always be odd.
313+ *
314+ * If the caller does not call mmu_interval_read_begin() or
315+ * mmu_interval_read_retry() then this call is not required.
316+ */
317+static inline void mmu_interval_set_seq(struct mmu_interval_notifier *mni,
318+ unsigned long cur_seq)
319+{
320+ WRITE_ONCE(mni->invalidate_seq, cur_seq);
321+}
322+
323+/**
324+ * mmu_interval_read_retry - End a read side critical section against a VA range
325+ * mni: The range
326+ * seq: The return of the paired mmu_interval_read_begin()
327+ *
328+ * This MUST be called under a user provided lock that is also held
329+ * unconditionally by op->invalidate() when it calls mmu_interval_set_seq().
330+ *
331+ * Each call should be paired with a single mmu_interval_read_begin() and
332+ * should be used to conclude the read side.
333+ *
334+ * Returns true if an invalidation collided with this critical section, and
335+ * the caller should retry.
336+ */
337+static inline bool mmu_interval_read_retry(struct mmu_interval_notifier *mni,
338+ unsigned long seq)
339+{
340+ return mni->invalidate_seq != seq;
341+}
342+
343+/**
344+ * mmu_interval_check_retry - Test if a collision has occurred
345+ * mni: The range
346+ * seq: The return of the matching mmu_interval_read_begin()
347+ *
348+ * This can be used in the critical section between mmu_interval_read_begin()
349+ * and mmu_interval_read_retry(). A return of true indicates an invalidation
350+ * has collided with this critical region and a future
351+ * mmu_interval_read_retry() will return true.
352+ *
353+ * False is not reliable and only suggests a collision may not have
354+ * occured. It can be called many times and does not have to hold the user
355+ * provided lock.
356+ *
357+ * This call can be used as part of loops and other expensive operations to
358+ * expedite a retry.
359+ */
360+static inline bool mmu_interval_check_retry(struct mmu_interval_notifier *mni,
361+ unsigned long seq)
362+{
363+ /* Pairs with the WRITE_ONCE in mmu_interval_set_seq() */
364+ return READ_ONCE(mni->invalidate_seq) != seq;
365+}
366+
278367 extern void __mmu_notifier_mm_destroy(struct mm_struct *mm);
279368 extern void __mmu_notifier_release(struct mm_struct *mm);
280369 extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm,
include/linux/mmzone.h+46−33
@@ -273,12 +273,12 @@ enum lru_list { · 272 unmodified lines
273273
274274 #define for_each_evictable_lru(lru) for (lru = 0; lru <= LRU_ACTIVE_FILE; lru++)
275275
276−static inline int is_file_lru(enum lru_list lru)
276+static inline bool is_file_lru(enum lru_list lru)
277277 {
278278 return (lru == LRU_INACTIVE_FILE || lru == LRU_ACTIVE_FILE);
279279 }
280280
281−static inline int is_active_lru(enum lru_list lru)
281+static inline bool is_active_lru(enum lru_list lru)
282282 {
283283 return (lru == LRU_ACTIVE_ANON || lru == LRU_ACTIVE_FILE);
284284 }
@@ -296,6 +296,12 @@ struct zone_reclaim_stat { · 11 unmodified lines
296296 unsigned long recent_scanned[2];
297297 };
298298
299+enum lruvec_flags {
300+ LRUVEC_CONGESTED, /* lruvec has many dirty pages
301+ * backed by a congested BDI
302+ */
303+};
304+
299305 struct lruvec {
300306 struct list_head lists[NR_LRU_LISTS];
301307 struct zone_reclaim_stat reclaim_stat;
@@ -303,12 +309,14 @@ struct lruvec { · 1 unmodified line
303309 atomic_long_t inactive_age;
304310 /* Refaults at the time of last reclaim cycle */
305311 unsigned long refaults;
312+ /* Various lruvec state flags (enum lruvec_flags) */
313+ unsigned long flags;
306314 #ifdef CONFIG_MEMCG
307315 struct pglist_data *pgdat;
308316 #endif
309317 };
310318
311−/* Isolate unmapped file */
319+/* Isolate unmapped pages */
312320 #define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x2)
313321 /* Isolate for asynchronous migration */
314322 #define ISOLATE_ASYNC_MIGRATE ((__force isolate_mode_t)0x4)
@@ -359,33 +367,40 @@ struct per_cpu_nodestat { · 44 unmodified lines
359367 #endif /* !__GENERATING_BOUNDS.H */
360368
361369 enum zone_type {
362−#ifdef CONFIG_ZONE_DMA
363370 /*
364− * ZONE_DMA is used when there are devices that are not able
365− * to do DMA to all of addressable memory (ZONE_NORMAL). Then we
366− * carve out the portion of memory that is needed for these devices.
367− * The range is arch specific.
371+ * ZONE_DMA and ZONE_DMA32 are used when there are peripherals not able
372+ * to DMA to all of the addressable memory (ZONE_NORMAL).
373+ * On architectures where this area covers the whole 32 bit address
374+ * space ZONE_DMA32 is used. ZONE_DMA is left for the ones with smaller
375+ * DMA addressing constraints. This distinction is important as a 32bit
376+ * DMA mask is assumed when ZONE_DMA32 is defined. Some 64-bit
377+ * platforms may need both zones as they support peripherals with
378+ * different DMA addressing limitations.
379+ *
380+ * Some examples:
381+ *
382+ * - i386 and x86_64 have a fixed 16M ZONE_DMA and ZONE_DMA32 for the
383+ * rest of the lower 4G.
368384 *
369− * Some examples
385+ * - arm only uses ZONE_DMA, the size, up to 4G, may vary depending on
386+ * the specific device.
370387 *
371− * Architecture Limit
372− * ---------------------------
373− * parisc, ia64, sparc <4G
374− * s390, powerpc <2G
375− * arm Various
376− * alpha Unlimited or 0-16MB.
388+ * - arm64 has a fixed 1G ZONE_DMA and ZONE_DMA32 for the rest of the
389+ * lower 4G.
377390 *
378− * i386, x86_64 and multiple other arches
379− * <16M.
391+ * - powerpc only uses ZONE_DMA, the size, up to 2G, may vary
392+ * depending on the specific device.
393+ *
394+ * - s390 uses ZONE_DMA fixed to the lower 2G.
395+ *
396+ * - ia64 and riscv only use ZONE_DMA32.
397+ *
398+ * - parisc uses neither.
380399 */
400+#ifdef CONFIG_ZONE_DMA
381401 ZONE_DMA,
382402 #endif
383403 #ifdef CONFIG_ZONE_DMA32
384− /*
385− * x86_64 needs two ZONE_DMAs because it supports devices that are
386− * only able to do DMA to the lower 16M but also 32 bit devices that
387− * can only do DMA areas below 4G.
388− */
389404 ZONE_DMA32,
390405 #endif
391406 /*
@@ -565,9 +580,6 @@ struct zone { · 173 unmodified lines
565580 } ____cacheline_internodealigned_in_smp;
566581
567582 enum pgdat_flags {
568− PGDAT_CONGESTED, /* pgdat has many dirty pages backed by
569− * a congested BDI
570− */
571583 PGDAT_DIRTY, /* reclaim scanning has recently found
572584 * many dirty file pages at the tail
573585 * of the LRU.
@@ -770,7 +782,13 @@ typedef struct pglist_data { · 196 unmodified lines
770782 #endif
771783
772784 /* Fields commonly accessed by the page reclaim scanner */
773− struct lruvec lruvec;
785+
786+ /*
787+ * NOTE: THIS IS UNUSED IF MEMCG IS ENABLED.
788+ *
789+ * Use mem_cgroup_lruvec() to look up lruvecs.
790+ */
791+ struct lruvec __lruvec;
774792
775793 unsigned long flags;
776794
@@ -793,11 +811,6 @@ typedef struct pglist_data { · 16 unmodified lines
793811 #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
794812 #define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid))
795813
796−static inline struct lruvec *node_lruvec(struct pglist_data *pgdat)
797−{
798− return &pgdat->lruvec;
799−}
800−
801814 static inline unsigned long pgdat_end_pfn(pg_data_t *pgdat)
802815 {
803816 return pgdat->node_start_pfn + pgdat->node_spanned_pages;
@@ -835,7 +848,7 @@ static inline struct pglist_data *lruvec_pgdat(struct lruvec *lruvec) · 31 unmodified lines
835848 #ifdef CONFIG_MEMCG
836849 return lruvec->pgdat;
837850 #else
838− return container_of(lruvec, struct pglist_data, lruvec);
851+ return container_of(lruvec, struct pglist_data, __lruvec);
839852 #endif
840853 }
841854
@@ -1072,7 +1085,7 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, · 230 unmodified lines
10721085 /**
10731086 * for_each_zone_zonelist_nodemask - helper macro to iterate over valid zones in a zonelist at or below a given zone index and within a nodemask
10741087 * @zone - The current zone in the iterator
1075− * @z - The current pointer within zonelist->zones being iterated
1088+ * @z - The current pointer within zonelist->_zonerefs being iterated
10761089 * @zlist - The zonelist being iterated
10771090 * @highidx - The zone index of the highest zone to return
10781091 * @nodemask - Nodemask allowed by the allocator
include/linux/mod_devicetable.h+2−2
@@ -587,9 +587,9 @@ struct platform_device_id { · 586 unmodified lines
587587 #define MDIO_NAME_SIZE 32
588588 #define MDIO_MODULE_PREFIX "mdio:"
589589
590−#define MDIO_ID_FMT "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d"
590+#define MDIO_ID_FMT "%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u"
591591 #define MDIO_ID_ARGS(_id) \
592− (_id)>>31, ((_id)>>30) & 1, ((_id)>>29) & 1, ((_id)>>28) & 1, \
592+ ((_id)>>31) & 1, ((_id)>>30) & 1, ((_id)>>29) & 1, ((_id)>>28) & 1, \
593593 ((_id)>>27) & 1, ((_id)>>26) & 1, ((_id)>>25) & 1, ((_id)>>24) & 1, \
594594 ((_id)>>23) & 1, ((_id)>>22) & 1, ((_id)>>21) & 1, ((_id)>>20) & 1, \
595595 ((_id)>>19) & 1, ((_id)>>18) & 1, ((_id)>>17) & 1, ((_id)>>16) & 1, \
include/linux/module.h+5−2
@@ -1,11 +1,14 @@
1−#ifndef _LINUX_MODULE_H
2−#define _LINUX_MODULE_H
1+/* SPDX-License-Identifier: GPL-2.0-only */
32 /*
43 * Dynamic loading of modules into the kernel.
54 *
65 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
76 * Rewritten again by Rusty Russell, 2002
87 */
8+
9+#ifndef _LINUX_MODULE_H
10+#define _LINUX_MODULE_H
11+
912 #include <linux/list.h>
1013 #include <linux/stat.h>
1114 #include <linux/compiler.h>
include/linux/moduleloader.h+1−1
@@ -91,7 +91,7 @@ void module_arch_cleanup(struct module *mod); · 90 unmodified lines
9191 /* Any cleanup before freeing mod->module_init */
9292 void module_arch_freeing_init(struct module *mod);
9393
94−#ifdef CONFIG_KASAN
94+#if defined(CONFIG_KASAN) && !defined(CONFIG_KASAN_VMALLOC)
9595 #include <linux/kasan.h>
9696 #define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT)
9797 #else
include/linux/moduleparam.h+2−2
@@ -100,11 +100,11 @@ struct kparam_array · 99 unmodified lines
100100
101101 /**
102102 * module_param - typesafe helper for a module/cmdline parameter
103− * @value: the variable to alter, and exposed parameter name.
103+ * @name: the variable to alter, and exposed parameter name.
104104 * @type: the type of the parameter
105105 * @perm: visibility in sysfs.
106106 *
107− * @value becomes the module parameter, or (prefixed by KBUILD_MODNAME and a
107+ * @name becomes the module parameter, or (prefixed by KBUILD_MODNAME and a
108108 * ".") the kernel commandline parameter. Note that - is changed to _, so
109109 * the user can use "foo-bar=1" even for variable "foo_bar".
110110 *
include/linux/mroute_base.h+14−14
@@ -47,16 +47,16 @@ struct vif_entry_notifier_info { · 46 unmodified lines
4747 };
4848
4949 static inline int mr_call_vif_notifier(struct notifier_block *nb,
50− struct net *net,
5150 unsigned short family,
5251 enum fib_event_type event_type,
5352 struct vif_device *vif,
54− unsigned short vif_index, u32 tb_id)
53+ unsigned short vif_index, u32 tb_id,
54+ struct netlink_ext_ack *extack)
5555 {
5656 struct vif_entry_notifier_info info = {
5757 .info = {
5858 .family = family,
59− .net = net,
59+ .extack = extack,
6060 },
6161 .dev = vif->dev,
6262 .vif_index = vif_index,
@@ -64,7 +64,7 @@ static inline int mr_call_vif_notifier(struct notifier_block *nb, · 1 unmodified line
6464 .tb_id = tb_id,
6565 };
6666
67− return call_fib_notifier(nb, net, event_type, &info.info);
67+ return call_fib_notifier(nb, event_type, &info.info);
6868 }
6969
7070 static inline int mr_call_vif_notifiers(struct net *net,
@@ -77,7 +77,6 @@ static inline int mr_call_vif_notifiers(struct net *net, · 6 unmodified lines
7777 struct vif_entry_notifier_info info = {
7878 .info = {
7979 .family = family,
80− .net = net,
8180 },
8281 .dev = vif->dev,
8382 .vif_index = vif_index,
@@ -173,21 +172,21 @@ struct mfc_entry_notifier_info { · 89 unmodified lines
173172 };
174173
175174 static inline int mr_call_mfc_notifier(struct notifier_block *nb,
176− struct net *net,
177175 unsigned short family,
178176 enum fib_event_type event_type,
179− struct mr_mfc *mfc, u32 tb_id)
177+ struct mr_mfc *mfc, u32 tb_id,
178+ struct netlink_ext_ack *extack)
180179 {
181180 struct mfc_entry_notifier_info info = {
182181 .info = {
183182 .family = family,
184− .net = net,
183+ .extack = extack,
185184 },
186185 .mfc = mfc,
187186 .tb_id = tb_id
188187 };
189188
190− return call_fib_notifier(nb, net, event_type, &info.info);
189+ return call_fib_notifier(nb, event_type, &info.info);
191190 }
192191
193192 static inline int mr_call_mfc_notifiers(struct net *net,
@@ -199,7 +198,6 @@ static inline int mr_call_mfc_notifiers(struct net *net, · 5 unmodified lines
199198 struct mfc_entry_notifier_info info = {
200199 .info = {
201200 .family = family,
202− .net = net,
203201 },
204202 .mfc = mfc,
205203 .tb_id = tb_id
@@ -301,10 +299,11 @@ int mr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb, · 95 unmodified lines
301299
302300 int mr_dump(struct net *net, struct notifier_block *nb, unsigned short family,
303301 int (*rules_dump)(struct net *net,
304− struct notifier_block *nb),
302+ struct notifier_block *nb,
303+ struct netlink_ext_ack *extack),
305304 struct mr_table *(*mr_iter)(struct net *net,
306305 struct mr_table *mrt),
307− rwlock_t *mrt_lock);
306+ rwlock_t *mrt_lock, struct netlink_ext_ack *extack);
308307 #else
309308 static inline void vif_device_init(struct vif_device *v,
310309 struct net_device *dev,
@@ -355,10 +354,11 @@ mr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb, · 44 unmodified lines
355354 static inline int mr_dump(struct net *net, struct notifier_block *nb,
356355 unsigned short family,
357356 int (*rules_dump)(struct net *net,
358− struct notifier_block *nb),
357+ struct notifier_block *nb,
358+ struct netlink_ext_ack *extack),
359359 struct mr_table *(*mr_iter)(struct net *net,
360360 struct mr_table *mrt),
361− rwlock_t *mrt_lock)
361+ rwlock_t *mrt_lock, struct netlink_ext_ack *extack)
362362 {
363363 return -EINVAL;
364364 }
include/linux/mtd/spi-nor.h+36−28
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #define SNOR_MFR_INTEL CFI_MFR_INTEL
2323 #define SNOR_MFR_ST CFI_MFR_ST /* ST Micro */
2424 #define SNOR_MFR_MICRON CFI_MFR_MICRON /* Micron */
25+#define SNOR_MFR_ISSI CFI_MFR_PMC
2526 #define SNOR_MFR_MACRONIX CFI_MFR_MACRONIX
2627 #define SNOR_MFR_SPANSION CFI_MFR_AMD
2728 #define SNOR_MFR_SST CFI_MFR_SST
@@ -133,7 +134,7 @@ · 105 unmodified lines
133134 #define SR_E_ERR BIT(5)
134135 #define SR_P_ERR BIT(6)
135136
136−#define SR_QUAD_EN_MX BIT(6) /* Macronix Quad I/O */
137+#define SR1_QUAD_EN_BIT6 BIT(6)
137138
138139 /* Enhanced Volatile Configuration Register bits */
139140 #define EVCR_QUAD_EN_MICRON BIT(7) /* Micron Quad I/O */
@@ -144,10 +145,8 @@ · 4 unmodified lines
144145 #define FSR_P_ERR BIT(4) /* Program operation status */
145146 #define FSR_PT_ERR BIT(1) /* Protection error bit */
146147
147−/* Configuration Register bits. */
148−#define CR_QUAD_EN_SPAN BIT(1) /* Spansion Quad I/O */
149−
150148 /* Status Register 2 bits. */
149+#define SR2_QUAD_EN_BIT1 BIT(1)
151150 #define SR2_QUAD_EN_BIT7 BIT(7)
152151
153152 /* Supported SPI protocols */
@@ -243,6 +242,9 @@ enum spi_nor_option_flags { · 89 unmodified lines
243242 SNOR_F_4B_OPCODES = BIT(6),
244243 SNOR_F_HAS_4BAIT = BIT(7),
245244 SNOR_F_HAS_LOCK = BIT(8),
245+ SNOR_F_HAS_16BIT_SR = BIT(9),
246+ SNOR_F_NO_READ_CR = BIT(10),
247+
246248 };
247249
248250 /**
@@ -465,6 +467,34 @@ enum spi_nor_pp_command_index { · 216 unmodified lines
465467 /* Forward declaration that will be used in 'struct spi_nor_flash_parameter' */
466468 struct spi_nor;
467469
470+/**
471+ * struct spi_nor_controller_ops - SPI NOR controller driver specific
472+ * operations.
473+ * @prepare: [OPTIONAL] do some preparations for the
474+ * read/write/erase/lock/unlock operations.
475+ * @unprepare: [OPTIONAL] do some post work after the
476+ * read/write/erase/lock/unlock operations.
477+ * @read_reg: read out the register.
478+ * @write_reg: write data to the register.
479+ * @read: read data from the SPI NOR.
480+ * @write: write data to the SPI NOR.
481+ * @erase: erase a sector of the SPI NOR at the offset @offs; if
482+ * not provided by the driver, spi-nor will send the erase
483+ * opcode via write_reg().
484+ */
485+struct spi_nor_controller_ops {
486+ int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops);
487+ void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops);
488+ int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, size_t len);
489+ int (*write_reg)(struct spi_nor *nor, u8 opcode, const u8 *buf,
490+ size_t len);
491+
492+ ssize_t (*read)(struct spi_nor *nor, loff_t from, size_t len, u8 *buf);
493+ ssize_t (*write)(struct spi_nor *nor, loff_t to, size_t len,
494+ const u8 *buf);
495+ int (*erase)(struct spi_nor *nor, loff_t offs);
496+};
497+
468498 /**
469499 * struct spi_nor_locking_ops - SPI NOR locking methods
470500 * @lock: lock a region of the SPI NOR.
@@ -549,19 +579,7 @@ struct flash_info; · 78 unmodified lines
549579 * @read_proto: the SPI protocol for read operations
550580 * @write_proto: the SPI protocol for write operations
551581 * @reg_proto the SPI protocol for read_reg/write_reg/erase operations
552− * @prepare: [OPTIONAL] do some preparations for the
553− * read/write/erase/lock/unlock operations
554− * @unprepare: [OPTIONAL] do some post work after the
555− * read/write/erase/lock/unlock operations
556− * @read_reg: [DRIVER-SPECIFIC] read out the register
557− * @write_reg: [DRIVER-SPECIFIC] write data to the register
558− * @read: [DRIVER-SPECIFIC] read data from the SPI NOR
559− * @write: [DRIVER-SPECIFIC] write data to the SPI NOR
560− * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR
561− * at the offset @offs; if not provided by the driver,
562− * spi-nor will send the erase opcode via write_reg()
563− * @clear_sr_bp: [FLASH-SPECIFIC] clears the Block Protection Bits from
564− * the SPI NOR Status Register.
582+ * @controller_ops: SPI NOR controller driver specific operations.
565583 * @params: [FLASH-SPECIFIC] SPI-NOR flash parameters and settings.
566584 * The structure includes legacy flash parameters and
567585 * settings that can be overwritten by the spi_nor_fixups
@@ -588,18 +606,8 @@ struct spi_nor { · 20 unmodified lines
588606 bool sst_write_second;
589607 u32 flags;
590608
591− int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops);
592− void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops);
593− int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len);
594− int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len);
595−
596− ssize_t (*read)(struct spi_nor *nor, loff_t from,
597− size_t len, u_char *read_buf);
598− ssize_t (*write)(struct spi_nor *nor, loff_t to,
599− size_t len, const u_char *write_buf);
600− int (*erase)(struct spi_nor *nor, loff_t offs);
609+ const struct spi_nor_controller_ops *controller_ops;
601610
602− int (*clear_sr_bp)(struct spi_nor *nor);
603611 struct spi_nor_flash_parameter params;
604612
605613 void *priv;
include/linux/mtio.h+60−0
@@ -0,0 +1,60 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _LINUX_MTIO_COMPAT_H
3+#define _LINUX_MTIO_COMPAT_H
4+
5+#include <linux/compat.h>
6+#include <uapi/linux/mtio.h>
7+#include <linux/uaccess.h>
8+
9+/*
10+ * helper functions for implementing compat ioctls on the four tape
11+ * drivers: we define the 32-bit layout of each incompatible structure,
12+ * plus a wrapper function to copy it to user space in either format.
13+ */
14+
15+struct mtget32 {
16+ s32 mt_type;
17+ s32 mt_resid;
18+ s32 mt_dsreg;
19+ s32 mt_gstat;
20+ s32 mt_erreg;
21+ s32 mt_fileno;
22+ s32 mt_blkno;
23+};
24+#define MTIOCGET32 _IOR('m', 2, struct mtget32)
25+
26+struct mtpos32 {
27+ s32 mt_blkno;
28+};
29+#define MTIOCPOS32 _IOR('m', 3, struct mtpos32)
30+
31+static inline int put_user_mtget(void __user *u, struct mtget *k)
32+{
33+ struct mtget32 k32 = {
34+ .mt_type = k->mt_type,
35+ .mt_resid = k->mt_resid,
36+ .mt_dsreg = k->mt_dsreg,
37+ .mt_gstat = k->mt_gstat,
38+ .mt_erreg = k->mt_erreg,
39+ .mt_fileno = k->mt_fileno,
40+ .mt_blkno = k->mt_blkno,
41+ };
42+ int ret;
43+
44+ if (in_compat_syscall())
45+ ret = copy_to_user(u, &k32, sizeof(k32));
46+ else
47+ ret = copy_to_user(u, k, sizeof(*k));
48+
49+ return ret ? -EFAULT : 0;
50+}
51+
52+static inline int put_user_mtpos(void __user *u, struct mtpos *k)
53+{
54+ if (in_compat_syscall())
55+ return put_user(k->mt_blkno, (u32 __user *)u);
56+ else
57+ return put_user(k->mt_blkno, (long __user *)u);
58+}
59+
60+#endif
include/linux/namei.h+1−0
@@ -60,6 +60,7 @@ extern int kern_path_mountpoint(int, const char *, struct path *, unsigned int); · 59 unmodified lines
6060 extern struct dentry *try_lookup_one_len(const char *, struct dentry *, int);
6161 extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
6262 extern struct dentry *lookup_one_len_unlocked(const char *, struct dentry *, int);
63+extern struct dentry *lookup_positive_unlocked(const char *, struct dentry *, int);
6364
6465 extern int follow_down_one(struct path *);
6566 extern int follow_down(struct path *);
include/linux/nd.h+1−1
@@ -147,7 +147,7 @@ static inline int nvdimm_read_bytes(struct nd_namespace_common *ndns, · 146 unmodified lines
147147
148148 /**
149149 * nvdimm_write_bytes() - synchronously write bytes to an nvdimm namespace
150− * @ndns: device to read
150+ * @ndns: device to write
151151 * @offset: namespace-relative starting offset
152152 * @buf: buffer to drain
153153 * @size: transfer length
include/linux/netdevice.h+42−8
@@ -848,6 +848,7 @@ enum tc_setup_type { · 847 unmodified lines
848848 TC_SETUP_ROOT_QDISC,
849849 TC_SETUP_QDISC_GRED,
850850 TC_SETUP_QDISC_TAPRIO,
851+ TC_SETUP_FT,
851852 };
852853
853854 /* These structures hold the attributes of bpf state that are being passed
@@ -925,6 +926,15 @@ struct dev_ifalias { · 71 unmodified lines
925926 struct devlink;
926927 struct tlsdev_ops;
927928
929+struct netdev_name_node {
930+ struct hlist_node hlist;
931+ struct list_head list;
932+ struct net_device *dev;
933+ const char *name;
934+};
935+
936+int netdev_name_node_alt_create(struct net_device *dev, const char *name);
937+int netdev_name_node_alt_destroy(struct net_device *dev, const char *name);
928938
929939 /*
930940 * This structure defines the management hooks for network devices.
@@ -1317,6 +1327,10 @@ struct net_device_ops { · 386 unmodified lines
13171327 struct nlattr *port[]);
13181328 int (*ndo_get_vf_port)(struct net_device *dev,
13191329 int vf, struct sk_buff *skb);
1330+ int (*ndo_get_vf_guid)(struct net_device *dev,
1331+ int vf,
1332+ struct ifla_vf_guid *node_guid,
1333+ struct ifla_vf_guid *port_guid);
13201334 int (*ndo_set_vf_guid)(struct net_device *dev,
13211335 int vf, u64 guid,
13221336 int guid_type);
@@ -1564,7 +1578,7 @@ enum netdev_priv_flags { · 241 unmodified lines
15641578 * (i.e. as seen by users in the "Space.c" file). It is the name
15651579 * of the interface.
15661580 *
1567− * @name_hlist: Device name hash chain, please keep it close to name[]
1581+ * @name_node: Name hashlist node
15681582 * @ifalias: SNMP alias
15691583 * @mem_end: Shared memory end
15701584 * @mem_start: Shared memory start
@@ -1761,7 +1775,7 @@ enum netdev_priv_flags { · 190 unmodified lines
17611775 * for hardware timestamping
17621776 * @sfp_bus: attached &struct sfp_bus structure.
17631777 * @qdisc_tx_busylock_key: lockdep class annotating Qdisc->busylock
1764− spinlock
1778+ * spinlock
17651779 * @qdisc_running_key: lockdep class annotating Qdisc->running seqcount
17661780 * @qdisc_xmit_lock_key: lockdep class annotating
17671781 * netdev_queue->_xmit_lock spinlock
@@ -1780,7 +1794,7 @@ enum netdev_priv_flags { · 12 unmodified lines
17801794
17811795 struct net_device {
17821796 char name[IFNAMSIZ];
1783− struct hlist_node name_hlist;
1797+ struct netdev_name_node *name_node;
17841798 struct dev_ifalias __rcu *ifalias;
17851799 /*
17861800 * I/O specific fields
@@ -1867,6 +1881,11 @@ struct net_device { · 80 unmodified lines
18671881 unsigned char if_port;
18681882 unsigned char dma;
18691883
1884+ /* Note : dev->mtu is often read without holding a lock.
1885+ * Writers usually hold RTNL.
1886+ * It is recommended to use READ_ONCE() to annotate the reads,
1887+ * and to use WRITE_ONCE() to annotate the writes.
1888+ */
18701889 unsigned int mtu;
18711890 unsigned int min_mtu;
18721891 unsigned int max_mtu;
@@ -2387,11 +2406,23 @@ struct pcpu_sw_netstats { · 514 unmodified lines
23872406 } __aligned(4 * sizeof(u64));
23882407
23892408 struct pcpu_lstats {
2390− u64 packets;
2391− u64 bytes;
2409+ u64_stats_t packets;
2410+ u64_stats_t bytes;
23922411 struct u64_stats_sync syncp;
23932412 } __aligned(2 * sizeof(u64));
23942413
2414+void dev_lstats_read(struct net_device *dev, u64 *packets, u64 *bytes);
2415+
2416+static inline void dev_lstats_add(struct net_device *dev, unsigned int len)
2417+{
2418+ struct pcpu_lstats *lstats = this_cpu_ptr(dev->lstats);
2419+
2420+ u64_stats_update_begin(&lstats->syncp);
2421+ u64_stats_add(&lstats->bytes, len);
2422+ u64_stats_inc(&lstats->packets);
2423+ u64_stats_update_end(&lstats->syncp);
2424+}
2425+
23952426 #define __netdev_alloc_pcpu_stats(type, gfp) \
23962427 ({ \
23972428 typeof(type) __percpu *pcpu_stats = alloc_percpu_gfp(type, gfp);\
@@ -2487,6 +2518,9 @@ const char *netdev_cmd_to_name(enum netdev_cmd cmd); · 89 unmodified lines
24872518
24882519 int register_netdevice_notifier(struct notifier_block *nb);
24892520 int unregister_netdevice_notifier(struct notifier_block *nb);
2521+int register_netdevice_notifier_net(struct net *net, struct notifier_block *nb);
2522+int unregister_netdevice_notifier_net(struct net *net,
2523+ struct notifier_block *nb);
24902524
24912525 struct netdev_notifier_info {
24922526 struct net_device *dev;
@@ -2557,6 +2591,9 @@ extern rwlock_t dev_base_lock; /* Device list lock */ · 64 unmodified lines
25572591 list_for_each_entry_safe(d, n, &(net)->dev_base_head, dev_list)
25582592 #define for_each_netdev_continue(net, d) \
25592593 list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list)
2594+#define for_each_netdev_continue_reverse(net, d) \
2595+ list_for_each_entry_continue_reverse(d, &(net)->dev_base_head, \
2596+ dev_list)
25602597 #define for_each_netdev_continue_rcu(net, d) \
25612598 list_for_each_entry_continue_rcu(d, &(net)->dev_base_head, dev_list)
25622599 #define for_each_netdev_in_bond_rcu(bond, slave) \
@@ -4081,9 +4118,6 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, · 1518 unmodified lines
40814118 unsigned char name_assign_type,
40824119 void (*setup)(struct net_device *),
40834120 unsigned int txqs, unsigned int rxqs);
4084−int dev_get_valid_name(struct net *net, struct net_device *dev,
4085− const char *name);
4086−
40874121 #define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
40884122 alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, 1, 1)
40894123
include/linux/netfilter.h+31−10
@@ -199,6 +199,8 @@ extern struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; · 198 unmodified lines
199199 int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state,
200200 const struct nf_hook_entries *e, unsigned int i);
201201
202+void nf_hook_slow_list(struct list_head *head, struct nf_hook_state *state,
203+ const struct nf_hook_entries *e);
202204 /**
203205 * nf_hook - call a netfilter hook
204206 *
@@ -311,17 +313,36 @@ NF_HOOK_LIST(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, · 106 unmodified lines
311313 struct list_head *head, struct net_device *in, struct net_device *out,
312314 int (*okfn)(struct net *, struct sock *, struct sk_buff *))
313315 {
314− struct sk_buff *skb, *next;
315− struct list_head sublist;
316−
317− INIT_LIST_HEAD(&sublist);
318− list_for_each_entry_safe(skb, next, head, list) {
319− list_del(&skb->list);
320− if (nf_hook(pf, hook, net, sk, skb, in, out, okfn) == 1)
321− list_add_tail(&skb->list, &sublist);
316+ struct nf_hook_entries *hook_head = NULL;
317+
318+#ifdef CONFIG_JUMP_LABEL
319+ if (__builtin_constant_p(pf) &&
320+ __builtin_constant_p(hook) &&
321+ !static_key_false(&nf_hooks_needed[pf][hook]))
322+ return;
323+#endif
324+
325+ rcu_read_lock();
326+ switch (pf) {
327+ case NFPROTO_IPV4:
328+ hook_head = rcu_dereference(net->nf.hooks_ipv4[hook]);
329+ break;
330+ case NFPROTO_IPV6:
331+ hook_head = rcu_dereference(net->nf.hooks_ipv6[hook]);
332+ break;
333+ default:
334+ WARN_ON_ONCE(1);
335+ break;
322336 }
323− /* Put passed packets back on main list */
324− list_splice(&sublist, head);
337+
338+ if (hook_head) {
339+ struct nf_hook_state state;
340+
341+ nf_hook_state_init(&state, hook, pf, in, out, sk, net, okfn);
342+
343+ nf_hook_slow_list(head, &state, hook_head);
344+ }
345+ rcu_read_unlock();
325346 }
326347
327348 /* Call setsockopt() */
include/linux/netfilter/ipset/ip_set.h+8−188
@@ -269,34 +269,15 @@ ip_set_ext_destroy(struct ip_set *set, void *data) · 268 unmodified lines
269269 /* Check that the extension is enabled for the set and
270270 * call it's destroy function for its extension part in data.
271271 */
272− if (SET_WITH_COMMENT(set))
273− ip_set_extensions[IPSET_EXT_ID_COMMENT].destroy(
274− set, ext_comment(data, set));
275−}
272+ if (SET_WITH_COMMENT(set)) {
273+ struct ip_set_comment *c = ext_comment(data, set);
276274
277−static inline int
278−ip_set_put_flags(struct sk_buff *skb, struct ip_set *set)
279−{
280− u32 cadt_flags = 0;
281−
282− if (SET_WITH_TIMEOUT(set))
283− if (unlikely(nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
284− htonl(set->timeout))))
285− return -EMSGSIZE;
286− if (SET_WITH_COUNTER(set))
287− cadt_flags |= IPSET_FLAG_WITH_COUNTERS;
288− if (SET_WITH_COMMENT(set))
289− cadt_flags |= IPSET_FLAG_WITH_COMMENT;
290− if (SET_WITH_SKBINFO(set))
291− cadt_flags |= IPSET_FLAG_WITH_SKBINFO;
292− if (SET_WITH_FORCEADD(set))
293− cadt_flags |= IPSET_FLAG_WITH_FORCEADD;
294−
295− if (!cadt_flags)
296− return 0;
297− return nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(cadt_flags));
275+ ip_set_extensions[IPSET_EXT_ID_COMMENT].destroy(set, c);
276+ }
298277 }
299278
279+int ip_set_put_flags(struct sk_buff *skb, struct ip_set *set);
280+
300281 /* Netlink CB args */
301282 enum {
302283 IPSET_CB_NET = 0, /* net namespace */
@@ -506,144 +487,8 @@ ip_set_timeout_set(unsigned long *timeout, u32 value) · 203 unmodified lines
506487 *timeout = t;
507488 }
508489
509−static inline u32
510−ip_set_timeout_get(const unsigned long *timeout)
511−{
512− u32 t;
513−
514− if (*timeout == IPSET_ELEM_PERMANENT)
515− return 0;
516−
517− t = jiffies_to_msecs(*timeout - jiffies)/MSEC_PER_SEC;
518− /* Zero value in userspace means no timeout */
519− return t == 0 ? 1 : t;
520−}
521−
522−static inline char*
523−ip_set_comment_uget(struct nlattr *tb)
524−{
525− return nla_data(tb);
526−}
527−
528−/* Called from uadd only, protected by the set spinlock.
529− * The kadt functions don't use the comment extensions in any way.
530− */
531−static inline void
532−ip_set_init_comment(struct ip_set *set, struct ip_set_comment *comment,
533− const struct ip_set_ext *ext)
534−{
535− struct ip_set_comment_rcu *c = rcu_dereference_protected(comment->c, 1);
536− size_t len = ext->comment ? strlen(ext->comment) : 0;
537−
538− if (unlikely(c)) {
539− set->ext_size -= sizeof(*c) + strlen(c->str) + 1;
540− kfree_rcu(c, rcu);
541− rcu_assign_pointer(comment->c, NULL);
542− }
543− if (!len)
544− return;
545− if (unlikely(len > IPSET_MAX_COMMENT_SIZE))
546− len = IPSET_MAX_COMMENT_SIZE;
547− c = kmalloc(sizeof(*c) + len + 1, GFP_ATOMIC);
548− if (unlikely(!c))
549− return;
550− strlcpy(c->str, ext->comment, len + 1);
551− set->ext_size += sizeof(*c) + strlen(c->str) + 1;
552− rcu_assign_pointer(comment->c, c);
553−}
554−
555−/* Used only when dumping a set, protected by rcu_read_lock() */
556−static inline int
557−ip_set_put_comment(struct sk_buff *skb, const struct ip_set_comment *comment)
558−{
559− struct ip_set_comment_rcu *c = rcu_dereference(comment->c);
560−
561− if (!c)
562− return 0;
563− return nla_put_string(skb, IPSET_ATTR_COMMENT, c->str);
564−}
565−
566−/* Called from uadd/udel, flush or the garbage collectors protected
567− * by the set spinlock.
568− * Called when the set is destroyed and when there can't be any user
569− * of the set data anymore.
570− */
571−static inline void
572−ip_set_comment_free(struct ip_set *set, struct ip_set_comment *comment)
573−{
574− struct ip_set_comment_rcu *c;
575−
576− c = rcu_dereference_protected(comment->c, 1);
577− if (unlikely(!c))
578− return;
579− set->ext_size -= sizeof(*c) + strlen(c->str) + 1;
580− kfree_rcu(c, rcu);
581− rcu_assign_pointer(comment->c, NULL);
582−}
583−
584−static inline void
585−ip_set_add_bytes(u64 bytes, struct ip_set_counter *counter)
586−{
587− atomic64_add((long long)bytes, &(counter)->bytes);
588−}
589−
590−static inline void
591−ip_set_add_packets(u64 packets, struct ip_set_counter *counter)
592−{
593− atomic64_add((long long)packets, &(counter)->packets);
594−}
595−
596−static inline u64
597−ip_set_get_bytes(const struct ip_set_counter *counter)
598−{
599− return (u64)atomic64_read(&(counter)->bytes);
600−}
601−
602−static inline u64
603−ip_set_get_packets(const struct ip_set_counter *counter)
604−{
605− return (u64)atomic64_read(&(counter)->packets);
606−}
607−
608−static inline bool
609−ip_set_match_counter(u64 counter, u64 match, u8 op)
610−{
611− switch (op) {
612− case IPSET_COUNTER_NONE:
613− return true;
614− case IPSET_COUNTER_EQ:
615− return counter == match;
616− case IPSET_COUNTER_NE:
617− return counter != match;
618− case IPSET_COUNTER_LT:
619− return counter < match;
620− case IPSET_COUNTER_GT:
621− return counter > match;
622− }
623− return false;
624−}
625−
626−static inline void
627−ip_set_update_counter(struct ip_set_counter *counter,
628− const struct ip_set_ext *ext, u32 flags)
629−{
630− if (ext->packets != ULLONG_MAX &&
631− !(flags & IPSET_FLAG_SKIP_COUNTER_UPDATE)) {
632− ip_set_add_bytes(ext->bytes, counter);
633− ip_set_add_packets(ext->packets, counter);
634− }
635−}
636−
637−static inline bool
638−ip_set_put_counter(struct sk_buff *skb, const struct ip_set_counter *counter)
639−{
640− return nla_put_net64(skb, IPSET_ATTR_BYTES,
641− cpu_to_be64(ip_set_get_bytes(counter)),
642− IPSET_ATTR_PAD) ||
643− nla_put_net64(skb, IPSET_ATTR_PACKETS,
644− cpu_to_be64(ip_set_get_packets(counter)),
645− IPSET_ATTR_PAD);
646−}
490+void ip_set_init_comment(struct ip_set *set, struct ip_set_comment *comment,
491+ const struct ip_set_ext *ext);
647492
648493 static inline void
649494 ip_set_init_counter(struct ip_set_counter *counter,
@@ -655,31 +500,6 @@ ip_set_init_counter(struct ip_set_counter *counter, · 5 unmodified lines
655500 atomic64_set(&(counter)->packets, (long long)(ext->packets));
656501 }
657502
658−static inline void
659−ip_set_get_skbinfo(struct ip_set_skbinfo *skbinfo,
660− const struct ip_set_ext *ext,
661− struct ip_set_ext *mext, u32 flags)
662−{
663− mext->skbinfo = *skbinfo;
664−}
665−
666−static inline bool
667−ip_set_put_skbinfo(struct sk_buff *skb, const struct ip_set_skbinfo *skbinfo)
668−{
669− /* Send nonzero parameters only */
670− return ((skbinfo->skbmark || skbinfo->skbmarkmask) &&
671− nla_put_net64(skb, IPSET_ATTR_SKBMARK,
672− cpu_to_be64((u64)skbinfo->skbmark << 32 |
673− skbinfo->skbmarkmask),
674− IPSET_ATTR_PAD)) ||
675− (skbinfo->skbprio &&
676− nla_put_net32(skb, IPSET_ATTR_SKBPRIO,
677− cpu_to_be32(skbinfo->skbprio))) ||
678− (skbinfo->skbqueue &&
679− nla_put_net16(skb, IPSET_ATTR_SKBQUEUE,
680− cpu_to_be16(skbinfo->skbqueue)));
681−}
682−
683503 static inline void
684504 ip_set_init_skbinfo(struct ip_set_skbinfo *skbinfo,
685505 const struct ip_set_ext *ext)
include/linux/netfilter/ipset/ip_set_bitmap.h+0−14
@@ -12,18 +12,4 @@ enum { · 11 unmodified lines
1212 IPSET_ADD_START_STORED_TIMEOUT,
1313 };
1414
15−/* Common functions */
16−
17−static inline u32
18−range_to_mask(u32 from, u32 to, u8 *bits)
19−{
20− u32 mask = 0xFFFFFFFE;
21−
22− *bits = 32;
23− while (--(*bits) > 0 && mask && (to & mask) != from)
24− mask <<= 1;
25−
26− return mask;
27−}
28−
2915 #endif /* __IP_SET_BITMAP_H */
include/linux/netfilter/ipset/ip_set_getport.h+0−3
@@ -20,9 +20,6 @@ static inline bool ip_set_get_ip6_port(const struct sk_buff *skb, bool src, · 19 unmodified lines
2020 }
2121 #endif
2222
23−extern bool ip_set_get_ip_port(const struct sk_buff *skb, u8 pf, bool src,
24− __be16 *port);
25−
2623 static inline bool ip_set_proto_with_ports(u8 proto)
2724 {
2825 switch (proto) {
include/linux/nfs4.h+26−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/list.h>
1717 #include <linux/uidgid.h>
1818 #include <uapi/linux/nfs4.h>
19+#include <linux/sunrpc/msg_prot.h>
1920
2021 enum nfs4_acl_whotype {
2122 NFS4_ACL_WHO_NAMED = 0,
@@ -539,6 +540,8 @@ enum { · 517 unmodified lines
539540
540541 NFSPROC4_CLNT_LOOKUPP,
541542 NFSPROC4_CLNT_LAYOUTERROR,
543+
544+ NFSPROC4_CLNT_COPY_NOTIFY,
542545 };
543546
544547 /* nfs41 types */
@@ -674,4 +677,27 @@ struct nfs4_op_map { · 129 unmodified lines
674677 } u;
675678 };
676679
680+struct nfs42_netaddr {
681+ char netid[RPCBIND_MAXNETIDLEN];
682+ char addr[RPCBIND_MAXUADDRLEN + 1];
683+ u32 netid_len;
684+ u32 addr_len;
685+};
686+
687+enum netloc_type4 {
688+ NL4_NAME = 1,
689+ NL4_URL = 2,
690+ NL4_NETADDR = 3,
691+};
692+
693+struct nl4_server {
694+ enum netloc_type4 nl4_type;
695+ union {
696+ struct { /* NL4_NAME, NL4_URL */
697+ int nl4_str_sz;
698+ char nl4_str[NFS4_OPAQUE_LIMIT + 1];
699+ };
700+ struct nfs42_netaddr nl4_addr; /* NL4_NETADDR */
701+ } u;
702+};
677703 #endif
include/linux/nfs_fs.h+3−1
@@ -189,13 +189,15 @@ struct nfs_inode { · 188 unmodified lines
189189
190190 struct nfs4_copy_state {
191191 struct list_head copies;
192+ struct list_head src_copies;
192193 nfs4_stateid stateid;
193194 struct completion completion;
194195 uint64_t count;
195196 struct nfs_writeverf verf;
196197 int error;
197198 int flags;
198− struct nfs4_state *parent_state;
199+ struct nfs4_state *parent_src_state;
200+ struct nfs4_state *parent_dst_state;
199201 };
200202
201203 /*
include/linux/nfs_fs_sb.h+5−1
@@ -45,6 +45,9 @@ struct nfs_client { · 44 unmodified lines
4545 #define NFS_CS_INFINITE_SLOTS 3 /* - don't limit TCP slots */
4646 #define NFS_CS_NO_RETRANS_TIMEOUT 4 /* - Disable retransmit timeouts */
4747 #define NFS_CS_TSM_POSSIBLE 5 /* - Maybe state migration */
48+#define NFS_CS_NOPING 6 /* - don't ping on connect */
49+#define NFS_CS_DS 7 /* - Server is a DS */
50+#define NFS_CS_REUSEPORT 8 /* - reuse src port on reconnect */
4851 struct sockaddr_storage cl_addr; /* server identifier */
4952 size_t cl_addrlen;
5053 char * cl_hostname; /* hostname of server */
@@ -171,7 +174,7 @@ struct nfs_server { · 120 unmodified lines
171174
172175 struct nfs_fsid fsid;
173176 __u64 maxfilesize; /* maximum file size */
174− struct timespec time_delta; /* smallest time granularity */
177+ struct timespec64 time_delta; /* smallest time granularity */
175178 unsigned long mount_time; /* when this fs was mounted */
176179 struct super_block *super; /* VFS super block */
177180 dev_t s_dev; /* superblock dev numbers */
@@ -276,5 +279,6 @@ struct nfs_server { · 98 unmodified lines
276279 #define NFS_CAP_COPY (1U << 24)
277280 #define NFS_CAP_OFFLOAD_CANCEL (1U << 25)
278281 #define NFS_CAP_LAYOUTERROR (1U << 26)
282+#define NFS_CAP_COPY_NOTIFY (1U << 27)
279283
280284 #endif
include/linux/nfs_xdr.h+24−7
@@ -62,14 +62,14 @@ struct nfs_fattr { · 61 unmodified lines
6262 struct nfs_fsid fsid;
6363 __u64 fileid;
6464 __u64 mounted_on_fileid;
65− struct timespec atime;
66− struct timespec mtime;
67− struct timespec ctime;
65+ struct timespec64 atime;
66+ struct timespec64 mtime;
67+ struct timespec64 ctime;
6868 __u64 change_attr; /* NFSv4 change attribute */
6969 __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
7070 __u64 pre_size; /* pre_op_attr.size */
71− struct timespec pre_mtime; /* pre_op_attr.mtime */
72− struct timespec pre_ctime; /* pre_op_attr.ctime */
71+ struct timespec64 pre_mtime; /* pre_op_attr.mtime */
72+ struct timespec64 pre_ctime; /* pre_op_attr.ctime */
7373 unsigned long time_start;
7474 unsigned long gencount;
7575 struct nfs4_string *owner_name;
@@ -143,7 +143,7 @@ struct nfs_fsinfo { · 67 unmodified lines
143143 __u32 wtmult; /* writes should be multiple of this */
144144 __u32 dtpref; /* pref. readdir transfer size */
145145 __u64 maxfilesize;
146− struct timespec time_delta; /* server time granularity */
146+ struct timespec64 time_delta; /* server time granularity */
147147 __u32 lease_time; /* in seconds */
148148 __u32 nlayouttypes; /* number of layouttypes */
149149 __u32 layouttype[NFS_MAX_LAYOUT_TYPES]; /* supported pnfs layout driver */
@@ -869,7 +869,7 @@ struct nfs3_sattrargs { · 719 unmodified lines
869869 struct nfs_fh * fh;
870870 struct iattr * sattr;
871871 unsigned int guard;
872− struct timespec guardtime;
872+ struct timespec64 guardtime;
873873 };
874874
875875 struct nfs3_diropargs {
@@ -1435,6 +1435,7 @@ struct nfs42_copy_args { · 559 unmodified lines
14351435
14361436 u64 count;
14371437 bool sync;
1438+ struct nl4_server *cp_src;
14381439 };
14391440
14401441 struct nfs42_write_res {
@@ -1463,6 +1464,22 @@ struct nfs42_offload_status_res { · 22 unmodified lines
14631464 int osr_status;
14641465 };
14651466
1467+struct nfs42_copy_notify_args {
1468+ struct nfs4_sequence_args cna_seq_args;
1469+
1470+ struct nfs_fh *cna_src_fh;
1471+ nfs4_stateid cna_src_stateid;
1472+ struct nl4_server cna_dst;
1473+};
1474+
1475+struct nfs42_copy_notify_res {
1476+ struct nfs4_sequence_res cnr_seq_res;
1477+
1478+ struct nfstime4 cnr_lease_time;
1479+ nfs4_stateid cnr_stateid;
1480+ struct nl4_server cnr_src;
1481+};
1482+
14661483 struct nfs42_seek_args {
14671484 struct nfs4_sequence_args seq_args;
14681485
include/linux/notifier.h+0−4
@@ -150,10 +150,6 @@ extern int raw_notifier_chain_register(struct raw_notifier_head *nh, · 149 unmodified lines
150150 extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh,
151151 struct notifier_block *nb);
152152
153−extern int blocking_notifier_chain_cond_register(
154− struct blocking_notifier_head *nh,
155− struct notifier_block *nb);
156−
157153 extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh,
158154 struct notifier_block *nb);
159155 extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh,
include/linux/nvme-fc-driver.h+4−0
@@ -270,6 +270,8 @@ struct nvme_fc_remote_port { · 269 unmodified lines
270270 *
271271 * Host/Initiator Transport Entrypoints/Parameters:
272272 *
273+ * @module: The LLDD module using the interface
274+ *
273275 * @localport_delete: The LLDD initiates deletion of a localport via
274276 * nvme_fc_deregister_localport(). However, the teardown is
275277 * asynchronous. This routine is called upon the completion of the
@@ -383,6 +385,8 @@ struct nvme_fc_remote_port { · 107 unmodified lines
383385 * Value is Mandatory. Allowed to be zero.
384386 */
385387 struct nvme_fc_port_template {
388+ struct module *module;
389+
386390 /* initiator-based functions */
387391 void (*localport_delete)(struct nvme_fc_local_port *);
388392 void (*remoteport_delete)(struct nvme_fc_remote_port *);
include/linux/nvme-fc.h+137−45
@@ -4,33 +4,60 @@ · 3 unmodified lines
44 */
55
66 /*
7− * This file contains definitions relative to FC-NVME r1.14 (16-020vB).
8− * The fcnvme_lsdesc_cr_assoc_cmd struct reflects expected r1.16 content.
7+ * This file contains definitions relative to FC-NVME-2 r1.06
8+ * (T11-2019-00210-v001).
99 */
1010
1111 #ifndef _NVME_FC_H
1212 #define _NVME_FC_H 1
1313
14+#include <uapi/scsi/fc/fc_fs.h>
1415
15−#define NVME_CMD_SCSI_ID 0xFD
16+#define NVME_CMD_FORMAT_ID 0xFD
1617 #define NVME_CMD_FC_ID FC_TYPE_NVME
1718
1819 /* FC-NVME Cmd IU Flags */
19−#define FCNVME_CMD_FLAGS_DIRMASK 0x03
20−#define FCNVME_CMD_FLAGS_WRITE 0x01
21−#define FCNVME_CMD_FLAGS_READ 0x02
20+enum {
21+ FCNVME_CMD_FLAGS_DIRMASK = 0x03,
22+ FCNVME_CMD_FLAGS_WRITE = (1 << 0),
23+ FCNVME_CMD_FLAGS_READ = (1 << 1),
24+
25+ FCNVME_CMD_FLAGS_PICWP = (1 << 2),
26+};
27+
28+enum {
29+ FCNVME_CMD_CAT_MASK = 0x0F,
30+ FCNVME_CMD_CAT_ADMINQ = 0x01,
31+ FCNVME_CMD_CAT_CSSMASK = 0x07,
32+ FCNVME_CMD_CAT_CSSFLAG = 0x08,
33+};
34+
35+static inline __u8 fccmnd_set_cat_admin(__u8 rsv_cat)
36+{
37+ return (rsv_cat & ~FCNVME_CMD_CAT_MASK) | FCNVME_CMD_CAT_ADMINQ;
38+}
39+
40+static inline __u8 fccmnd_set_cat_css(__u8 rsv_cat, __u8 css)
41+{
42+ return (rsv_cat & ~FCNVME_CMD_CAT_MASK) | FCNVME_CMD_CAT_CSSFLAG |
43+ (css & FCNVME_CMD_CAT_CSSMASK);
44+}
2245
2346 struct nvme_fc_cmd_iu {
24− __u8 scsi_id;
47+ __u8 format_id;
2548 __u8 fc_id;
2649 __be16 iu_len;
27− __u8 rsvd4[3];
50+ __u8 rsvd4[2];
51+ __u8 rsv_cat;
2852 __u8 flags;
2953 __be64 connection_id;
3054 __be32 csn;
3155 __be32 data_len;
3256 struct nvme_command sqe;
33− __be32 rsvd88[2];
57+ __u8 dps;
58+ __u8 lbads;
59+ __be16 ms;
60+ __be32 rsvd92;
3461 };
3562
3663 #define NVME_FC_SIZEOF_ZEROS_RSP 12
@@ -38,11 +65,12 @@ struct nvme_fc_cmd_iu { · 1 unmodified line
3865 enum {
3966 FCNVME_SC_SUCCESS = 0,
4067 FCNVME_SC_INVALID_FIELD = 1,
41− FCNVME_SC_INVALID_CONNID = 2,
68+ /* reserved 2 */
69+ FCNVME_SC_ILL_CONN_PARAMS = 3,
4270 };
4371
4472 struct nvme_fc_ersp_iu {
45− __u8 status_code;
73+ __u8 ersp_result;
4674 __u8 rsvd1;
4775 __be16 iu_len;
4876 __be32 rsn;
@@ -53,14 +81,44 @@ struct nvme_fc_ersp_iu { · 4 unmodified lines
5381 };
5482
5583
56−/* FC-NVME Link Services */
84+#define FCNVME_NVME_SR_OPCODE 0x01
85+
86+struct nvme_fc_nvme_sr_iu {
87+ __u8 fc_id;
88+ __u8 opcode;
89+ __u8 rsvd2;
90+ __u8 retry_rctl;
91+ __be32 rsvd4;
92+};
93+
94+
95+enum {
96+ FCNVME_SRSTAT_ACC = 0x0,
97+ FCNVME_SRSTAT_INV_FCID = 0x1,
98+ /* reserved 0x2 */
99+ FCNVME_SRSTAT_LOGICAL_ERR = 0x3,
100+ FCNVME_SRSTAT_INV_QUALIF = 0x4,
101+ FCNVME_SRSTAT_UNABL2PERFORM = 0x9,
102+};
103+
104+struct nvme_fc_nvme_sr_rsp_iu {
105+ __u8 fc_id;
106+ __u8 opcode;
107+ __u8 rsvd2;
108+ __u8 status;
109+ __be32 rsvd4;
110+};
111+
112+
113+/* FC-NVME Link Services - LS cmd values (w0 bits 31:24) */
57114 enum {
58115 FCNVME_LS_RSVD = 0,
59116 FCNVME_LS_RJT = 1,
60117 FCNVME_LS_ACC = 2,
61− FCNVME_LS_CREATE_ASSOCIATION = 3,
62− FCNVME_LS_CREATE_CONNECTION = 4,
63− FCNVME_LS_DISCONNECT = 5,
118+ FCNVME_LS_CREATE_ASSOCIATION = 3, /* Create Association */
119+ FCNVME_LS_CREATE_CONNECTION = 4, /* Create I/O Connection */
120+ FCNVME_LS_DISCONNECT_ASSOC = 5, /* Disconnect Association */
121+ FCNVME_LS_DISCONNECT_CONN = 6, /* Disconnect Connection */
64122 };
65123
66124 /* FC-NVME Link Service Descriptors */
@@ -117,14 +175,17 @@ enum fcnvme_ls_rjt_reason { · 50 unmodified lines
117175 FCNVME_RJT_RC_UNSUP = 0x0b,
118176 /* command not supported */
119177
120− FCNVME_RJT_RC_INPROG = 0x0e,
121− /* command already in progress */
122−
123178 FCNVME_RJT_RC_INV_ASSOC = 0x40,
124− /* Invalid Association ID*/
179+ /* Invalid Association ID */
125180
126181 FCNVME_RJT_RC_INV_CONN = 0x41,
127− /* Invalid Connection ID*/
182+ /* Invalid Connection ID */
183+
184+ FCNVME_RJT_RC_INV_PARAM = 0x42,
185+ /* Invalid Parameters */
186+
187+ FCNVME_RJT_RC_INSUF_RES = 0x43,
188+ /* Insufficient Resources */
128189
129190 FCNVME_RJT_RC_VENDOR = 0xff,
130191 /* vendor specific error */
@@ -138,14 +199,32 @@ enum fcnvme_ls_rjt_explan { · 7 unmodified lines
138199 FCNVME_RJT_EXP_OXID_RXID = 0x17,
139200 /* invalid OX_ID-RX_ID combination */
140201
141− FCNVME_RJT_EXP_INSUF_RES = 0x29,
142− /* insufficient resources */
143−
144202 FCNVME_RJT_EXP_UNAB_DATA = 0x2a,
145203 /* unable to supply requested data */
146204
147205 FCNVME_RJT_EXP_INV_LEN = 0x2d,
148206 /* Invalid payload length */
207+
208+ FCNVME_RJT_EXP_INV_ERSP_RAT = 0x40,
209+ /* Invalid NVMe_ERSP Ratio */
210+
211+ FCNVME_RJT_EXP_INV_CTLR_ID = 0x41,
212+ /* Invalid Controller ID */
213+
214+ FCNVME_RJT_EXP_INV_QUEUE_ID = 0x42,
215+ /* Invalid Queue ID */
216+
217+ FCNVME_RJT_EXP_INV_SQSIZE = 0x43,
218+ /* Invalid Submission Queue Size */
219+
220+ FCNVME_RJT_EXP_INV_HOSTID = 0x44,
221+ /* Invalid HOST ID */
222+
223+ FCNVME_RJT_EXP_INV_HOSTNQN = 0x45,
224+ /* Invalid HOSTNQN */
225+
226+ FCNVME_RJT_EXP_INV_SUBNQN = 0x46,
227+ /* Invalid SUBNQN */
149228 };
150229
151230 /* FCNVME_LSDESC_RJT */
@@ -209,21 +288,11 @@ struct fcnvme_lsdesc_cr_conn_cmd { · 57 unmodified lines
209288 __be32 rsvd52;
210289 };
211290
212−/* Disconnect Scope Values */
213−enum {
214− FCNVME_DISCONN_ASSOCIATION = 0,
215− FCNVME_DISCONN_CONNECTION = 1,
216−};
217−
218291 /* FCNVME_LSDESC_DISCONN_CMD */
219292 struct fcnvme_lsdesc_disconn_cmd {
220293 __be32 desc_tag; /* FCNVME_LSDESC_xxx */
221294 __be32 desc_len;
222− u8 rsvd8[3];
223− /* note: scope is really a 1 bit field */
224− u8 scope; /* FCNVME_DISCONN_xxx */
225− __be32 rsvd12;
226− __be64 id;
295+ __be32 rsvd8[4];
227296 };
228297
229298 /* FCNVME_LSDESC_CONN_ID */
@@ -242,9 +311,14 @@ struct fcnvme_lsdesc_assoc_id { · 12 unmodified lines
242311
243312 /* r_ctl values */
244313 enum {
245− FCNVME_RS_RCTL_DATA = 1,
246− FCNVME_RS_RCTL_XFER_RDY = 5,
247− FCNVME_RS_RCTL_RSP = 8,
314+ FCNVME_RS_RCTL_CMND = 0x6,
315+ FCNVME_RS_RCTL_DATA = 0x1,
316+ FCNVME_RS_RCTL_CONF = 0x3,
317+ FCNVME_RS_RCTL_SR = 0x9,
318+ FCNVME_RS_RCTL_XFER_RDY = 0x5,
319+ FCNVME_RS_RCTL_RSP = 0x7,
320+ FCNVME_RS_RCTL_ERSP = 0x8,
321+ FCNVME_RS_RCTL_SR_RSP = 0xA,
248322 };
249323
250324
@@ -264,7 +338,10 @@ struct fcnvme_ls_acc_hdr { · 13 unmodified lines
264338 struct fcnvme_ls_rqst_w0 w0;
265339 __be32 desc_list_len;
266340 struct fcnvme_lsdesc_rqst rqst;
267− /* Followed by cmd-specific ACC descriptors, see next definitions */
341+ /*
342+ * Followed by cmd-specific ACCEPT descriptors, see xxx_acc
343+ * definitions below
344+ */
268345 };
269346
270347 /* FCNVME_LS_CREATE_ASSOCIATION */
@@ -302,25 +379,39 @@ struct fcnvme_ls_cr_conn_acc { · 31 unmodified lines
302379 struct fcnvme_lsdesc_conn_id connectid;
303380 };
304381
305−/* FCNVME_LS_DISCONNECT */
306−struct fcnvme_ls_disconnect_rqst {
382+/* FCNVME_LS_DISCONNECT_ASSOC */
383+struct fcnvme_ls_disconnect_assoc_rqst {
307384 struct fcnvme_ls_rqst_w0 w0;
308385 __be32 desc_list_len;
309386 struct fcnvme_lsdesc_assoc_id associd;
310387 struct fcnvme_lsdesc_disconn_cmd discon_cmd;
311388 };
312389
313−struct fcnvme_ls_disconnect_acc {
390+struct fcnvme_ls_disconnect_assoc_acc {
391+ struct fcnvme_ls_acc_hdr hdr;
392+};
393+
394+
395+/* FCNVME_LS_DISCONNECT_CONN */
396+struct fcnvme_ls_disconnect_conn_rqst {
397+ struct fcnvme_ls_rqst_w0 w0;
398+ __be32 desc_list_len;
399+ struct fcnvme_lsdesc_assoc_id associd;
400+ struct fcnvme_lsdesc_disconn_cmd connectid;
401+};
402+
403+struct fcnvme_ls_disconnect_conn_acc {
314404 struct fcnvme_ls_acc_hdr hdr;
315405 };
316406
317407
318408 /*
319− * Yet to be defined in FC-NVME:
409+ * Default R_A_TOV is pulled in from fc_fs.h but needs conversion
410+ * from ms to seconds for our use.
320411 */
321−#define NVME_FC_CONNECT_TIMEOUT_SEC 2 /* 2 seconds */
322−#define NVME_FC_LS_TIMEOUT_SEC 2 /* 2 seconds */
323−#define NVME_FC_TGTOP_TIMEOUT_SEC 2 /* 2 seconds */
412+#define FC_TWO_TIMES_R_A_TOV (2 * (FC_DEF_R_A_TOV / 1000))
413+#define NVME_FC_LS_TIMEOUT_SEC FC_TWO_TIMES_R_A_TOV
414+#define NVME_FC_TGTOP_TIMEOUT_SEC FC_TWO_TIMES_R_A_TOV
324415
325416 /*
326417 * TRADDR string must be of form "nn-<16hexdigits>:pn-<16hexdigits>"
@@ -328,6 +419,7 @@ struct fcnvme_ls_disconnect_acc { · 1 unmodified line
328419 * infront of the <16hexdigits>. Without is considered the "min" string
329420 * and with is considered the "max" string. The hexdigits may be upper
330421 * or lower case.
422+ * Note: FC-NVME-2 standard requires a "0x" prefix.
331423 */
332424 #define NVME_FC_TRADDR_NNLEN 3 /* "?n-" */
333425 #define NVME_FC_TRADDR_OXNNLEN 5 /* "?n-0x" */
include/linux/nvme.h+57−3
@@ -107,8 +107,22 @@ enum { · 106 unmodified lines
107107 NVME_REG_AQA = 0x0024, /* Admin Queue Attributes */
108108 NVME_REG_ASQ = 0x0028, /* Admin SQ Base Address */
109109 NVME_REG_ACQ = 0x0030, /* Admin CQ Base Address */
110− NVME_REG_CMBLOC = 0x0038, /* Controller Memory Buffer Location */
110+ NVME_REG_CMBLOC = 0x0038, /* Controller Memory Buffer Location */
111111 NVME_REG_CMBSZ = 0x003c, /* Controller Memory Buffer Size */
112+ NVME_REG_BPINFO = 0x0040, /* Boot Partition Information */
113+ NVME_REG_BPRSEL = 0x0044, /* Boot Partition Read Select */
114+ NVME_REG_BPMBL = 0x0048, /* Boot Partition Memory Buffer
115+ * Location
116+ */
117+ NVME_REG_PMRCAP = 0x0e00, /* Persistent Memory Capabilities */
118+ NVME_REG_PMRCTL = 0x0e04, /* Persistent Memory Region Control */
119+ NVME_REG_PMRSTS = 0x0e08, /* Persistent Memory Region Status */
120+ NVME_REG_PMREBS = 0x0e0c, /* Persistent Memory Region Elasticity
121+ * Buffer Size
122+ */
123+ NVME_REG_PMRSWTP = 0x0e10, /* Persistent Memory Region Sustained
124+ * Write Throughput
125+ */
112126 NVME_REG_DBS = 0x1000, /* SQ 0 Tail Doorbell */
113127 };
114128
@@ -295,6 +309,14 @@ enum { · 180 unmodified lines
295309 NVME_CTRL_OACS_DIRECTIVES = 1 << 5,
296310 NVME_CTRL_OACS_DBBUF_SUPP = 1 << 8,
297311 NVME_CTRL_LPA_CMD_EFFECTS_LOG = 1 << 1,
312+ NVME_CTRL_CTRATT_128_ID = 1 << 0,
313+ NVME_CTRL_CTRATT_NON_OP_PSP = 1 << 1,
314+ NVME_CTRL_CTRATT_NVM_SETS = 1 << 2,
315+ NVME_CTRL_CTRATT_READ_RECV_LVLS = 1 << 3,
316+ NVME_CTRL_CTRATT_ENDURANCE_GROUPS = 1 << 4,
317+ NVME_CTRL_CTRATT_PREDICTABLE_LAT = 1 << 5,
318+ NVME_CTRL_CTRATT_NAMESPACE_GRANULARITY = 1 << 7,
319+ NVME_CTRL_CTRATT_UUID_LIST = 1 << 9,
298320 };
299321
300322 struct nvme_lbaf {
@@ -352,6 +374,9 @@ enum { · 51 unmodified lines
352374 NVME_ID_CNS_NS_PRESENT = 0x11,
353375 NVME_ID_CNS_CTRL_NS_LIST = 0x12,
354376 NVME_ID_CNS_CTRL_LIST = 0x13,
377+ NVME_ID_CNS_SCNDRY_CTRL_LIST = 0x15,
378+ NVME_ID_CNS_NS_GRANULARITY = 0x16,
379+ NVME_ID_CNS_UUID_LIST = 0x17,
355380 };
356381
357382 enum {
@@ -409,7 +434,8 @@ struct nvme_smart_log { · 51 unmodified lines
409434 __u8 avail_spare;
410435 __u8 spare_thresh;
411436 __u8 percent_used;
412− __u8 rsvd6[26];
437+ __u8 endu_grp_crit_warn_sumry;
438+ __u8 rsvd7[25];
413439 __u8 data_units_read[16];
414440 __u8 data_units_written[16];
415441 __u8 host_reads[16];
@@ -423,7 +449,11 @@ struct nvme_smart_log { · 7 unmodified lines
423449 __le32 warning_temp_time;
424450 __le32 critical_comp_time;
425451 __le16 temp_sensor[8];
426− __u8 rsvd216[296];
452+ __le32 thm_temp1_trans_count;
453+ __le32 thm_temp2_trans_count;
454+ __le32 thm_temp1_total_time;
455+ __le32 thm_temp2_total_time;
456+ __u8 rsvd232[280];
427457 };
428458
429459 struct nvme_fw_slot_info_log {
@@ -440,6 +470,7 @@ enum { · 10 unmodified lines
440470 NVME_CMD_EFFECTS_NIC = 1 << 3,
441471 NVME_CMD_EFFECTS_CCC = 1 << 4,
442472 NVME_CMD_EFFECTS_CSE_MASK = 3 << 16,
473+ NVME_CMD_EFFECTS_UUID_SEL = 1 << 19,
443474 };
444475
445476 struct nvme_effects_log {
@@ -563,6 +594,7 @@ enum nvme_opcode { · 117 unmodified lines
563594 nvme_cmd_compare = 0x05,
564595 nvme_cmd_write_zeroes = 0x08,
565596 nvme_cmd_dsm = 0x09,
597+ nvme_cmd_verify = 0x0c,
566598 nvme_cmd_resv_register = 0x0d,
567599 nvme_cmd_resv_report = 0x0e,
568600 nvme_cmd_resv_acquire = 0x11,
@@ -772,6 +804,12 @@ struct nvme_write_zeroes_cmd { · 203 unmodified lines
772804
773805 /* Features */
774806
807+enum {
808+ NVME_TEMP_THRESH_MASK = 0xffff,
809+ NVME_TEMP_THRESH_SELECT_SHIFT = 16,
810+ NVME_TEMP_THRESH_TYPE_UNDER = 0x100000,
811+};
812+
775813 struct nvme_feat_auto_pst {
776814 __le64 entries[32];
777815 };
@@ -806,10 +844,14 @@ enum nvme_admin_opcode { · 28 unmodified lines
806844 nvme_admin_ns_mgmt = 0x0d,
807845 nvme_admin_activate_fw = 0x10,
808846 nvme_admin_download_fw = 0x11,
847+ nvme_admin_dev_self_test = 0x14,
809848 nvme_admin_ns_attach = 0x15,
810849 nvme_admin_keep_alive = 0x18,
811850 nvme_admin_directive_send = 0x19,
812851 nvme_admin_directive_recv = 0x1a,
852+ nvme_admin_virtual_mgmt = 0x1c,
853+ nvme_admin_nvme_mi_send = 0x1d,
854+ nvme_admin_nvme_mi_recv = 0x1e,
813855 nvme_admin_dbbuf = 0x7C,
814856 nvme_admin_format_nvm = 0x80,
815857 nvme_admin_security_send = 0x81,
@@ -873,6 +915,7 @@ enum { · 57 unmodified lines
873915 NVME_FEAT_PLM_CONFIG = 0x13,
874916 NVME_FEAT_PLM_WINDOW = 0x14,
875917 NVME_FEAT_HOST_BEHAVIOR = 0x16,
918+ NVME_FEAT_SANITIZE = 0x17,
876919 NVME_FEAT_SW_PROGRESS = 0x80,
877920 NVME_FEAT_HOST_ID = 0x81,
878921 NVME_FEAT_RESV_MASK = 0x82,
@@ -883,6 +926,10 @@ enum { · 4 unmodified lines
883926 NVME_LOG_FW_SLOT = 0x03,
884927 NVME_LOG_CHANGED_NS = 0x04,
885928 NVME_LOG_CMD_EFFECTS = 0x05,
929+ NVME_LOG_DEVICE_SELF_TEST = 0x06,
930+ NVME_LOG_TELEMETRY_HOST = 0x07,
931+ NVME_LOG_TELEMETRY_CTRL = 0x08,
932+ NVME_LOG_ENDURANCE_GROUP = 0x09,
886933 NVME_LOG_ANA = 0x0c,
887934 NVME_LOG_DISC = 0x70,
888935 NVME_LOG_RESERVATION = 0x80,
@@ -1290,7 +1337,11 @@ enum { · 401 unmodified lines
12901337 NVME_SC_SGL_INVALID_OFFSET = 0x16,
12911338 NVME_SC_SGL_INVALID_SUBTYPE = 0x17,
12921339
1340+ NVME_SC_SANITIZE_FAILED = 0x1C,
1341+ NVME_SC_SANITIZE_IN_PROGRESS = 0x1D,
1342+
12931343 NVME_SC_NS_WRITE_PROTECTED = 0x20,
1344+ NVME_SC_CMD_INTERRUPTED = 0x21,
12941345
12951346 NVME_SC_LBA_RANGE = 0x80,
12961347 NVME_SC_CAP_EXCEEDED = 0x81,
@@ -1328,6 +1379,8 @@ enum { · 31 unmodified lines
13281379 NVME_SC_NS_NOT_ATTACHED = 0x11a,
13291380 NVME_SC_THIN_PROV_NOT_SUPP = 0x11b,
13301381 NVME_SC_CTRL_LIST_INVALID = 0x11c,
1382+ NVME_SC_BP_WRITE_PROHIBITED = 0x11e,
1383+ NVME_SC_PMR_SAN_PROHIBITED = 0x123,
13311384
13321385 /*
13331386 * I/O Command Set Specific - NVM commands:
@@ -1368,6 +1421,7 @@ enum { · 34 unmodified lines
13681421 NVME_SC_ANA_INACCESSIBLE = 0x302,
13691422 NVME_SC_ANA_TRANSITION = 0x303,
13701423 NVME_SC_HOST_PATH_ERROR = 0x370,
1424+ NVME_SC_HOST_ABORTED_CMD = 0x371,
13711425
13721426 NVME_SC_CRD = 0x1800,
13731427 NVME_SC_DNR = 0x4000,
include/linux/nvmem-consumer.h+10−1
@@ -89,6 +89,9 @@ void nvmem_del_cell_lookups(struct nvmem_cell_lookup *entries, · 88 unmodified lines
8989 int nvmem_register_notifier(struct notifier_block *nb);
9090 int nvmem_unregister_notifier(struct notifier_block *nb);
9191
92+struct nvmem_device *nvmem_device_find(void *data,
93+ int (*match)(struct device *dev, const void *data));
94+
9295 #else
9396
9497 static inline struct nvmem_cell *nvmem_cell_get(struct device *dev,
@@ -118,7 +121,7 @@ static inline void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len) · 23 unmodified lines
118121 }
119122
120123 static inline int nvmem_cell_write(struct nvmem_cell *cell,
121− const char *buf, size_t len)
124+ void *buf, size_t len)
122125 {
123126 return -EOPNOTSUPP;
124127 }
@@ -204,6 +207,12 @@ static inline int nvmem_unregister_notifier(struct notifier_block *nb) · 79 unmodified lines
204207 return -EOPNOTSUPP;
205208 }
206209
210+static inline struct nvmem_device *nvmem_device_find(void *data,
211+ int (*match)(struct device *dev, const void *data))
212+{
213+ return NULL;
214+}
215+
207216 #endif /* CONFIG_NVMEM */
208217
209218 #if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF)
include/linux/of_address.h+1−20
@@ -12,6 +12,7 @@ struct of_pci_range_parser { · 11 unmodified lines
1212 const __be32 *end;
1313 int np;
1414 int pna;
15+ bool dma;
1516 };
1617
1718 struct of_pci_range {
@@ -33,10 +34,6 @@ extern u64 of_translate_dma_address(struct device_node *dev, · 15 unmodified lines
3334 extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
3435 extern int of_address_to_resource(struct device_node *dev, int index,
3536 struct resource *r);
36−extern struct device_node *of_find_matching_node_by_address(
37− struct device_node *from,
38− const struct of_device_id *matches,
39− u64 base_address);
4037 extern void __iomem *of_iomap(struct device_node *device, int index);
4138 void __iomem *of_io_request_and_map(struct device_node *device,
4239 int index, const char *name);
@@ -55,8 +52,6 @@ extern int of_pci_dma_range_parser_init(struct of_pci_range_parser *parser, · 12 unmodified lines
5552 extern struct of_pci_range *of_pci_range_parser_one(
5653 struct of_pci_range_parser *parser,
5754 struct of_pci_range *range);
58−extern int of_dma_get_range(struct device_node *np, u64 *dma_addr,
59− u64 *paddr, u64 *size);
6055 extern bool of_dma_is_coherent(struct device_node *np);
6156 #else /* CONFIG_OF_ADDRESS */
6257 static inline void __iomem *of_io_request_and_map(struct device_node *device,
@@ -71,14 +66,6 @@ static inline u64 of_translate_address(struct device_node *np, · 8 unmodified lines
7166 return OF_BAD_ADDR;
7267 }
7368
74−static inline struct device_node *of_find_matching_node_by_address(
75− struct device_node *from,
76− const struct of_device_id *matches,
77− u64 base_address)
78−{
79− return NULL;
80−}
81−
8269 static inline const __be32 *of_get_address(struct device_node *dev, int index,
8370 u64 *size, unsigned int *flags)
8471 {
@@ -104,12 +91,6 @@ static inline struct of_pci_range *of_pci_range_parser_one( · 19 unmodified lines
10491 return NULL;
10592 }
10693
107−static inline int of_dma_get_range(struct device_node *np, u64 *dma_addr,
108− u64 *paddr, u64 *size)
109−{
110− return -ENODEV;
111−}
112−
11394 static inline bool of_dma_is_coherent(struct device_node *np)
11495 {
11596 return false;
include/linux/of_mdio.h+6−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/of.h>
1313
1414 #if IS_ENABLED(CONFIG_OF_MDIO)
15+extern bool of_mdiobus_child_is_phy(struct device_node *child);
1516 extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np);
1617 extern struct phy_device *of_phy_find_device(struct device_node *phy_np);
1718 extern struct phy_device *of_phy_connect(struct net_device *dev,
@@ -54,6 +55,11 @@ static inline int of_mdio_parse_addr(struct device *dev, · 36 unmodified lines
5455 }
5556
5657 #else /* CONFIG_OF_MDIO */
58+static bool of_mdiobus_child_is_phy(struct device_node *child)
59+{
60+ return false;
61+}
62+
5763 static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
5864 {
5965 /*
include/linux/of_net.h+5−2
@@ -6,15 +6,18 @@ · 5 unmodified lines
66 #ifndef __LINUX_OF_NET_H
77 #define __LINUX_OF_NET_H
88
9+#include <linux/phy.h>
10+
911 #ifdef CONFIG_OF_NET
1012 #include <linux/of.h>
1113
1214 struct net_device;
13−extern int of_get_phy_mode(struct device_node *np);
15+extern int of_get_phy_mode(struct device_node *np, phy_interface_t *interface);
1416 extern const void *of_get_mac_address(struct device_node *np);
1517 extern struct net_device *of_find_net_device_by_node(struct device_node *np);
1618 #else
17−static inline int of_get_phy_mode(struct device_node *np)
19+static inline int of_get_phy_mode(struct device_node *np,
20+ phy_interface_t *interface)
1821 {
1922 return -ENODEV;
2023 }
include/linux/of_pci.h+2−3
@@ -2,11 +2,10 @@ · 1 unmodified line
22 #ifndef __OF_PCI_H
33 #define __OF_PCI_H
44
5−#include <linux/pci.h>
6−#include <linux/msi.h>
5+#include <linux/types.h>
6+#include <linux/errno.h>
77
88 struct pci_dev;
9−struct of_phandle_args;
109 struct device_node;
1110
1211 #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PCI)
include/linux/page-isolation.h+2−2
@@ -30,7 +30,7 @@ static inline bool is_migrate_isolate(int migratetype) · 29 unmodified lines
3030 }
3131 #endif
3232
33−#define SKIP_HWPOISON 0x1
33+#define MEMORY_OFFLINE 0x1
3434 #define REPORT_FAILURE 0x2
3535
3636 bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
@@ -58,7 +58,7 @@ undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, · 21 unmodified lines
5858 * Test all pages in [start_pfn, end_pfn) are isolated or not.
5959 */
6060 int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
61− bool skip_hwpoisoned_pages);
61+ int isol_flags);
6262
6363 struct page *alloc_migrate_target(struct page *page, unsigned long private);
6464
include/linux/pagewalk.h+9−0
@@ -24,6 +24,9 @@ struct mm_walk; · 23 unmodified lines
2424 * "do page table walk over the current vma", returning
2525 * a negative value means "abort current page table walk
2626 * right now" and returning 1 means "skip the current vma"
27+ * @pre_vma: if set, called before starting walk on a non-null vma.
28+ * @post_vma: if set, called after a walk on a non-null vma, provided
29+ * that @pre_vma and the vma walk succeeded.
2730 */
2831 struct mm_walk_ops {
2932 int (*pud_entry)(pud_t *pud, unsigned long addr,
@@ -39,6 +42,9 @@ struct mm_walk_ops { · 9 unmodified lines
3942 struct mm_walk *walk);
4043 int (*test_walk)(unsigned long addr, unsigned long next,
4144 struct mm_walk *walk);
45+ int (*pre_vma)(unsigned long start, unsigned long end,
46+ struct mm_walk *walk);
47+ void (*post_vma)(struct mm_walk *walk);
4248 };
4349
4450 /**
@@ -62,5 +68,8 @@ int walk_page_range(struct mm_struct *mm, unsigned long start, · 17 unmodified lines
6268 void *private);
6369 int walk_page_vma(struct vm_area_struct *vma, const struct mm_walk_ops *ops,
6470 void *private);
71+int walk_page_mapping(struct address_space *mapping, pgoff_t first_index,
72+ pgoff_t nr, const struct mm_walk_ops *ops,
73+ void *private);
6574
6675 #endif /* _LINUX_PAGEWALK_H */
include/linux/parport.h+1−0
@@ -460,6 +460,7 @@ extern size_t parport_ieee1284_epp_read_addr (struct parport *, · 459 unmodified lines
460460 void *, size_t, int);
461461
462462 /* IEEE1284.3 functions */
463+#define daisy_dev_name "Device ID probe"
463464 extern int parport_daisy_init (struct parport *port);
464465 extern void parport_daisy_fini (struct parport *port);
465466 extern struct pardevice *parport_open (int devnum, const char *name);
include/linux/pci-ats.h+21−56
@@ -4,74 +4,39 @@ · 3 unmodified lines
44
55 #include <linux/pci.h>
66
7−#ifdef CONFIG_PCI_PRI
7+#ifdef CONFIG_PCI_ATS
8+/* Address Translation Service */
9+int pci_enable_ats(struct pci_dev *dev, int ps);
10+void pci_disable_ats(struct pci_dev *dev);
11+int pci_ats_queue_depth(struct pci_dev *dev);
12+int pci_ats_page_aligned(struct pci_dev *dev);
13+#else /* CONFIG_PCI_ATS */
14+static inline int pci_enable_ats(struct pci_dev *d, int ps)
15+{ return -ENODEV; }
16+static inline void pci_disable_ats(struct pci_dev *d) { }
17+static inline int pci_ats_queue_depth(struct pci_dev *d)
18+{ return -ENODEV; }
19+static inline int pci_ats_page_aligned(struct pci_dev *dev)
20+{ return 0; }
21+#endif /* CONFIG_PCI_ATS */
822
23+#ifdef CONFIG_PCI_PRI
924 int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
1025 void pci_disable_pri(struct pci_dev *pdev);
11−void pci_restore_pri_state(struct pci_dev *pdev);
1226 int pci_reset_pri(struct pci_dev *pdev);
13−
14−#else /* CONFIG_PCI_PRI */
15−
16−static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs)
17−{
18− return -ENODEV;
19−}
20−
21−static inline void pci_disable_pri(struct pci_dev *pdev)
22−{
23−}
24−
25−static inline void pci_restore_pri_state(struct pci_dev *pdev)
26−{
27−}
28−
29−static inline int pci_reset_pri(struct pci_dev *pdev)
30−{
31− return -ENODEV;
32−}
33−
27+int pci_prg_resp_pasid_required(struct pci_dev *pdev);
3428 #endif /* CONFIG_PCI_PRI */
3529
3630 #ifdef CONFIG_PCI_PASID
37−
3831 int pci_enable_pasid(struct pci_dev *pdev, int features);
3932 void pci_disable_pasid(struct pci_dev *pdev);
40−void pci_restore_pasid_state(struct pci_dev *pdev);
4133 int pci_pasid_features(struct pci_dev *pdev);
4234 int pci_max_pasids(struct pci_dev *pdev);
43−int pci_prg_resp_pasid_required(struct pci_dev *pdev);
44−
45−#else /* CONFIG_PCI_PASID */
46−
47−static inline int pci_enable_pasid(struct pci_dev *pdev, int features)
48−{
49− return -EINVAL;
50−}
51−
52−static inline void pci_disable_pasid(struct pci_dev *pdev)
53−{
54−}
55−
56−static inline void pci_restore_pasid_state(struct pci_dev *pdev)
57−{
58−}
59−
35+#else /* CONFIG_PCI_PASID */
6036 static inline int pci_pasid_features(struct pci_dev *pdev)
61−{
62− return -EINVAL;
63−}
64−
37+{ return -EINVAL; }
6538 static inline int pci_max_pasids(struct pci_dev *pdev)
66−{
67− return -EINVAL;
68−}
69−
70−static inline int pci_prg_resp_pasid_required(struct pci_dev *pdev)
71−{
72− return 0;
73−}
39+{ return -EINVAL; }
7440 #endif /* CONFIG_PCI_PASID */
7541
76−
77−#endif /* LINUX_PCI_ATS_H*/
42+#endif /* LINUX_PCI_ATS_H */
include/linux/pci-epc.h+1−1
@@ -117,7 +117,7 @@ struct pci_epc_features { · 116 unmodified lines
117117 unsigned int msix_capable : 1;
118118 u8 reserved_bar;
119119 u8 bar_fixed_64bit;
120− u64 bar_fixed_size[BAR_5 + 1];
120+ u64 bar_fixed_size[PCI_STD_NUM_BARS];
121121 size_t align;
122122 };
123123
include/linux/pci.h+29−33
@@ -82,7 +82,7 @@ enum pci_mmap_state { · 81 unmodified lines
8282 enum {
8383 /* #0-5: standard PCI resources */
8484 PCI_STD_RESOURCES,
85− PCI_STD_RESOURCE_END = 5,
85+ PCI_STD_RESOURCE_END = PCI_STD_RESOURCES + PCI_STD_NUM_BARS - 1,
8686
8787 /* #6: expansion ROM resource */
8888 PCI_ROM_RESOURCE,
@@ -284,7 +284,6 @@ struct irq_affinity; · 195 unmodified lines
284284 struct pcie_link_state;
285285 struct pci_vpd;
286286 struct pci_sriov;
287−struct pci_ats;
288287 struct pci_p2pdma;
289288
290289 /* The pci_dev structure describes PCI devices */
@@ -452,12 +451,14 @@ struct pci_dev { · 161 unmodified lines
452451 };
453452 u16 ats_cap; /* ATS Capability offset */
454453 u8 ats_stu; /* ATS Smallest Translation Unit */
455− atomic_t ats_ref_cnt; /* Number of VFs with ATS enabled */
456454 #endif
457455 #ifdef CONFIG_PCI_PRI
456+ u16 pri_cap; /* PRI Capability offset */
458457 u32 pri_reqs_alloc; /* Number of PRI requests allocated */
458+ unsigned int pasid_required:1; /* PRG Response PASID Required */
459459 #endif
460460 #ifdef CONFIG_PCI_PASID
461+ u16 pasid_cap; /* PASID Capability offset */
461462 u16 pasid_features;
462463 #endif
463464 #ifdef CONFIG_PCI_P2PDMA
@@ -805,8 +806,6 @@ struct module; · 341 unmodified lines
805806 * The remove function always gets called from process
806807 * context, so it can sleep.
807808 * @suspend: Put device into low power state.
808− * @suspend_late: Put device into low power state.
809− * @resume_early: Wake device from low power state.
810809 * @resume: Wake device from low power state.
811810 * (Please see Documentation/power/pci.rst for descriptions
812811 * of PCI Power Management and the related functions.)
@@ -829,8 +828,6 @@ struct pci_driver { · 16 unmodified lines
829828 int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
830829 void (*remove)(struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */
831830 int (*suspend)(struct pci_dev *dev, pm_message_t state); /* Device suspended */
832− int (*suspend_late)(struct pci_dev *dev, pm_message_t state);
833− int (*resume_early)(struct pci_dev *dev);
834831 int (*resume)(struct pci_dev *dev); /* Device woken up */
835832 void (*shutdown)(struct pci_dev *dev);
836833 int (*sriov_configure)(struct pci_dev *dev, int num_vfs); /* On PF */
@@ -1232,7 +1229,7 @@ struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev, · 395 unmodified lines
12321229 int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size);
12331230 int pci_add_ext_cap_save_buffer(struct pci_dev *dev,
12341231 u16 cap, unsigned int size);
1235−int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state);
1232+int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state);
12361233 int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
12371234 pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
12381235 bool pci_pme_capable(struct pci_dev *dev, pci_power_t state);
@@ -1454,7 +1451,6 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, · 215 unmodified lines
14541451 void pci_free_irq_vectors(struct pci_dev *dev);
14551452 int pci_irq_vector(struct pci_dev *dev, unsigned int nr);
14561453 const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev, int vec);
1457−int pci_irq_get_node(struct pci_dev *pdev, int vec);
14581454
14591455 #else
14601456 static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
@@ -1497,11 +1493,6 @@ static inline const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev, · 36 unmodified lines
14971493 {
14981494 return cpu_possible_mask;
14991495 }
1500−
1501−static inline int pci_irq_get_node(struct pci_dev *pdev, int vec)
1502−{
1503− return first_online_node;
1504−}
15051496 #endif
15061497
15071498 /**
@@ -1544,9 +1535,13 @@ extern bool pcie_ports_native; · 36 unmodified lines
15441535 #define pcie_ports_native false
15451536 #endif
15461537
1547−#define PCIE_LINK_STATE_L0S 1
1548−#define PCIE_LINK_STATE_L1 2
1549−#define PCIE_LINK_STATE_CLKPM 4
1538+#define PCIE_LINK_STATE_L0S BIT(0)
1539+#define PCIE_LINK_STATE_L1 BIT(1)
1540+#define PCIE_LINK_STATE_CLKPM BIT(2)
1541+#define PCIE_LINK_STATE_L1_1 BIT(3)
1542+#define PCIE_LINK_STATE_L1_2 BIT(4)
1543+#define PCIE_LINK_STATE_L1_1_PCIPM BIT(5)
1544+#define PCIE_LINK_STATE_L1_2_PCIPM BIT(6)
15501545
15511546 #ifdef CONFIG_PCIEASPM
15521547 int pci_disable_link_state(struct pci_dev *pdev, int state);
@@ -1686,6 +1681,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class, · 133 unmodified lines
16861681 static inline void pci_set_master(struct pci_dev *dev) { }
16871682 static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
16881683 static inline void pci_disable_device(struct pci_dev *dev) { }
1684+static inline int pcim_enable_device(struct pci_dev *pdev) { return -EIO; }
16891685 static inline int pci_assign_resource(struct pci_dev *dev, int i)
16901686 { return -EBUSY; }
16911687 static inline int __pci_register_driver(struct pci_driver *drv,
@@ -1776,19 +1772,6 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, · 84 unmodified lines
17761772 NULL);
17771773 }
17781774
1779−#ifdef CONFIG_PCI_ATS
1780−/* Address Translation Service */
1781−int pci_enable_ats(struct pci_dev *dev, int ps);
1782−void pci_disable_ats(struct pci_dev *dev);
1783−int pci_ats_queue_depth(struct pci_dev *dev);
1784−int pci_ats_page_aligned(struct pci_dev *dev);
1785−#else
1786−static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }
1787−static inline void pci_disable_ats(struct pci_dev *d) { }
1788−static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; }
1789−static inline int pci_ats_page_aligned(struct pci_dev *dev) { return 0; }
1790−#endif
1791−
17921775 /* Include architecture-dependent settings and functions */
17931776
17941777 #include <asm/pci.h>
@@ -2278,6 +2261,7 @@ struct irq_domain; · 483 unmodified lines
22782261 struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus);
22792262 int pci_parse_request_of_pci_ranges(struct device *dev,
22802263 struct list_head *resources,
2264+ struct list_head *ib_resources,
22812265 struct resource **bus_range);
22822266
22832267 /* Arch may override this (weak) */
@@ -2286,9 +2270,11 @@ struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus); · 2 unmodified lines
22862270 #else /* CONFIG_OF */
22872271 static inline struct irq_domain *
22882272 pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; }
2289−static inline int pci_parse_request_of_pci_ranges(struct device *dev,
2290− struct list_head *resources,
2291− struct resource **bus_range)
2273+static inline int
2274+pci_parse_request_of_pci_ranges(struct device *dev,
2275+ struct list_head *resources,
2276+ struct list_head *ib_resources,
2277+ struct resource **bus_range)
22922278 {
22932279 return -EINVAL;
22942280 }
@@ -2310,9 +2296,11 @@ struct irq_domain *pci_host_bridge_acpi_msi_domain(struct pci_bus *bus); · 15 unmodified lines
23102296
23112297 void
23122298 pci_msi_register_fwnode_provider(struct fwnode_handle *(*fn)(struct device *));
2299+bool pci_pr3_present(struct pci_dev *pdev);
23132300 #else
23142301 static inline struct irq_domain *
23152302 pci_host_bridge_acpi_msi_domain(struct pci_bus *bus) { return NULL; }
2303+static inline bool pci_pr3_present(struct pci_dev *pdev) { return false; }
23162304 #endif
23172305
23182306 #ifdef CONFIG_EEH
@@ -2400,4 +2388,12 @@ void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type); · 81 unmodified lines
24002388 #define pci_info_ratelimited(pdev, fmt, arg...) \
24012389 dev_info_ratelimited(&(pdev)->dev, fmt, ##arg)
24022390
2391+#define pci_WARN(pdev, condition, fmt, arg...) \
2392+ WARN(condition, "%s %s: " fmt, \
2393+ dev_driver_string(&(pdev)->dev), pci_name(pdev), ##arg)
2394+
2395+#define pci_WARN_ONCE(pdev, condition, fmt, arg...) \
2396+ WARN_ONCE(condition, "%s %s: " fmt, \
2397+ dev_driver_string(&(pdev)->dev), pci_name(pdev), ##arg)
2398+
24032399 #endif /* LINUX_PCI_H */
include/linux/pci_ids.h+1−0
@@ -3006,6 +3006,7 @@ · 3005 unmodified lines
30063006 #define PCI_DEVICE_ID_INTEL_84460GX 0x84ea
30073007 #define PCI_DEVICE_ID_INTEL_IXP4XX 0x8500
30083008 #define PCI_DEVICE_ID_INTEL_IXP2800 0x9004
3009+#define PCI_DEVICE_ID_INTEL_VMD_9A0B 0x9a0b
30093010 #define PCI_DEVICE_ID_INTEL_S21152BB 0xb152
30103011
30113012 #define PCI_VENDOR_ID_SCALEMP 0x8686
include/linux/percpu-refcount.h+8−8
@@ -186,14 +186,14 @@ static inline void percpu_ref_get_many(struct percpu_ref *ref, unsigned long nr) · 185 unmodified lines
186186 {
187187 unsigned long __percpu *percpu_count;
188188
189− rcu_read_lock_sched();
189+ rcu_read_lock();
190190
191191 if (__ref_is_percpu(ref, &percpu_count))
192192 this_cpu_add(*percpu_count, nr);
193193 else
194194 atomic_long_add(nr, &ref->count);
195195
196− rcu_read_unlock_sched();
196+ rcu_read_unlock();
197197 }
198198
199199 /**
@@ -223,7 +223,7 @@ static inline bool percpu_ref_tryget(struct percpu_ref *ref) · 23 unmodified lines
223223 unsigned long __percpu *percpu_count;
224224 bool ret;
225225
226− rcu_read_lock_sched();
226+ rcu_read_lock();
227227
228228 if (__ref_is_percpu(ref, &percpu_count)) {
229229 this_cpu_inc(*percpu_count);
@@ -232,7 +232,7 @@ static inline bool percpu_ref_tryget(struct percpu_ref *ref) · 2 unmodified lines
232232 ret = atomic_long_inc_not_zero(&ref->count);
233233 }
234234
235− rcu_read_unlock_sched();
235+ rcu_read_unlock();
236236
237237 return ret;
238238 }
@@ -257,7 +257,7 @@ static inline bool percpu_ref_tryget_live(struct percpu_ref *ref) · 18 unmodified lines
257257 unsigned long __percpu *percpu_count;
258258 bool ret = false;
259259
260− rcu_read_lock_sched();
260+ rcu_read_lock();
261261
262262 if (__ref_is_percpu(ref, &percpu_count)) {
263263 this_cpu_inc(*percpu_count);
@@ -266,7 +266,7 @@ static inline bool percpu_ref_tryget_live(struct percpu_ref *ref) · 2 unmodified lines
266266 ret = atomic_long_inc_not_zero(&ref->count);
267267 }
268268
269− rcu_read_unlock_sched();
269+ rcu_read_unlock();
270270
271271 return ret;
272272 }
@@ -285,14 +285,14 @@ static inline void percpu_ref_put_many(struct percpu_ref *ref, unsigned long nr) · 12 unmodified lines
285285 {
286286 unsigned long __percpu *percpu_count;
287287
288− rcu_read_lock_sched();
288+ rcu_read_lock();
289289
290290 if (__ref_is_percpu(ref, &percpu_count))
291291 this_cpu_sub(*percpu_count, nr);
292292 else if (unlikely(atomic_long_sub_and_test(nr, &ref->count)))
293293 ref->release(ref);
294294
295− rcu_read_unlock_sched();
295+ rcu_read_unlock();
296296 }
297297
298298 /**
include/linux/percpu-rwsem.h+2−2
@@ -93,7 +93,7 @@ static inline void percpu_up_read(struct percpu_rw_semaphore *sem) · 92 unmodified lines
9393 __percpu_up_read(sem); /* Unconditional memory barrier */
9494 preempt_enable();
9595
96− rwsem_release(&sem->rw_sem.dep_map, 1, _RET_IP_);
96+ rwsem_release(&sem->rw_sem.dep_map, _RET_IP_);
9797 }
9898
9999 extern void percpu_down_write(struct percpu_rw_semaphore *);
@@ -118,7 +118,7 @@ extern void percpu_free_rwsem(struct percpu_rw_semaphore *); · 18 unmodified lines
118118 static inline void percpu_rwsem_release(struct percpu_rw_semaphore *sem,
119119 bool read, unsigned long ip)
120120 {
121− lock_release(&sem->rw_sem.dep_map, 1, ip);
121+ lock_release(&sem->rw_sem.dep_map, ip);
122122 #ifdef CONFIG_RWSEM_SPIN_ON_OWNER
123123 if (!read)
124124 atomic_long_set(&sem->rw_sem.owner, RWSEM_OWNER_UNKNOWN);
include/linux/perf_event.h+69−5
@@ -56,6 +56,7 @@ struct perf_guest_info_callbacks { · 55 unmodified lines
5656 #include <linux/perf_regs.h>
5757 #include <linux/cgroup.h>
5858 #include <linux/refcount.h>
59+#include <linux/security.h>
5960 #include <asm/local.h>
6061
6162 struct perf_callchain_entry {
@@ -248,6 +249,8 @@ struct perf_event; · 186 unmodified lines
248249 #define PERF_PMU_CAP_NO_EXCLUDE 0x80
249250 #define PERF_PMU_CAP_AUX_OUTPUT 0x100
250251
252+struct perf_output_handle;
253+
251254 /**
252255 * struct pmu - generic performance monitoring unit
253256 */
@@ -409,6 +412,15 @@ struct pmu { · 155 unmodified lines
409412 */
410413 size_t task_ctx_size;
411414
415+ /*
416+ * PMU specific parts of task perf event context (i.e. ctx->task_ctx_data)
417+ * can be synchronized using this function. See Intel LBR callstack support
418+ * implementation and Perf core context switch handling callbacks for usage
419+ * examples.
420+ */
421+ void (*swap_task_ctx) (struct perf_event_context *prev,
422+ struct perf_event_context *next);
423+ /* optional */
412424
413425 /*
414426 * Set up pmu-private data structures for an AUX area
@@ -422,6 +434,19 @@ struct pmu { · 7 unmodified lines
422434 */
423435 void (*free_aux) (void *aux); /* optional */
424436
437+ /*
438+ * Take a snapshot of the AUX buffer without touching the event
439+ * state, so that preempting ->start()/->stop() callbacks does
440+ * not interfere with their logic. Called in PMI context.
441+ *
442+ * Returns the size of AUX data copied to the output handle.
443+ *
444+ * Optional.
445+ */
446+ long (*snapshot_aux) (struct perf_event *event,
447+ struct perf_output_handle *handle,
448+ unsigned long size);
449+
425450 /*
426451 * Validate address range filters: make sure the HW supports the
427452 * requested configuration and number of filters; return 0 if the
@@ -721,6 +746,9 @@ struct perf_event { · 293 unmodified lines
721746 struct perf_cgroup *cgrp; /* cgroup event is attach to */
722747 #endif
723748
749+#ifdef CONFIG_SECURITY
750+ void *security;
751+#endif
724752 struct list_head sb_list;
725753 #endif /* CONFIG_PERF_EVENTS */
726754 };
@@ -960,6 +988,7 @@ struct perf_sample_data { · 233 unmodified lines
960988 u32 reserved;
961989 } cpu_entry;
962990 struct perf_callchain_entry *callchain;
991+ u64 aux_size;
963992
964993 /*
965994 * regs_user may point to task_pt_regs or to regs_user_copy, depending
@@ -1241,19 +1270,41 @@ extern int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write, · 275 unmodified lines
12411270 int perf_event_max_stack_handler(struct ctl_table *table, int write,
12421271 void __user *buffer, size_t *lenp, loff_t *ppos);
12431272
1244−static inline bool perf_paranoid_tracepoint_raw(void)
1273+/* Access to perf_event_open(2) syscall. */
1274+#define PERF_SECURITY_OPEN 0
1275+
1276+/* Finer grained perf_event_open(2) access control. */
1277+#define PERF_SECURITY_CPU 1
1278+#define PERF_SECURITY_KERNEL 2
1279+#define PERF_SECURITY_TRACEPOINT 3
1280+
1281+static inline int perf_is_paranoid(void)
12451282 {
12461283 return sysctl_perf_event_paranoid > -1;
12471284 }
12481285
1249−static inline bool perf_paranoid_cpu(void)
1286+static inline int perf_allow_kernel(struct perf_event_attr *attr)
1287+{
1288+ if (sysctl_perf_event_paranoid > 1 && !capable(CAP_SYS_ADMIN))
1289+ return -EACCES;
1290+
1291+ return security_perf_event_open(attr, PERF_SECURITY_KERNEL);
1292+}
1293+
1294+static inline int perf_allow_cpu(struct perf_event_attr *attr)
12501295 {
1251− return sysctl_perf_event_paranoid > 0;
1296+ if (sysctl_perf_event_paranoid > 0 && !capable(CAP_SYS_ADMIN))
1297+ return -EACCES;
1298+
1299+ return security_perf_event_open(attr, PERF_SECURITY_CPU);
12521300 }
12531301
1254−static inline bool perf_paranoid_kernel(void)
1302+static inline int perf_allow_tracepoint(struct perf_event_attr *attr)
12551303 {
1256− return sysctl_perf_event_paranoid > 1;
1304+ if (sysctl_perf_event_paranoid > -1 && !capable(CAP_SYS_ADMIN))
1305+ return -EPERM;
1306+
1307+ return security_perf_event_open(attr, PERF_SECURITY_TRACEPOINT);
12571308 }
12581309
12591310 extern void perf_event_init(void);
@@ -1327,6 +1378,9 @@ extern unsigned int perf_output_copy(struct perf_output_handle *handle, · 67 unmodified lines
13271378 const void *buf, unsigned int len);
13281379 extern unsigned int perf_output_skip(struct perf_output_handle *handle,
13291380 unsigned int len);
1381+extern long perf_output_copy_aux(struct perf_output_handle *aux_handle,
1382+ struct perf_output_handle *handle,
1383+ unsigned long from, unsigned long to);
13301384 extern int perf_swevent_get_recursion_context(void);
13311385 extern void perf_swevent_put_recursion_context(int rctx);
13321386 extern u64 perf_swevent_set_period(struct perf_event *event);
@@ -1336,6 +1390,8 @@ extern void perf_event_disable_local(struct perf_event *event); · 3 unmodified lines
13361390 extern void perf_event_disable_inatomic(struct perf_event *event);
13371391 extern void perf_event_task_tick(void);
13381392 extern int perf_event_account_interrupt(struct perf_event *event);
1393+extern int perf_event_period(struct perf_event *event, u64 value);
1394+extern u64 perf_event_pause(struct perf_event *event, bool reset);
13391395 #else /* !CONFIG_PERF_EVENTS: */
13401396 static inline void *
13411397 perf_aux_output_begin(struct perf_output_handle *handle,
@@ -1415,6 +1471,14 @@ static inline void perf_event_disable(struct perf_event *event) { } · 73 unmodified lines
14151471 static inline int __perf_event_disable(void *info) { return -1; }
14161472 static inline void perf_event_task_tick(void) { }
14171473 static inline int perf_event_release_kernel(struct perf_event *event) { return 0; }
1474+static inline int perf_event_period(struct perf_event *event, u64 value)
1475+{
1476+ return -EINVAL;
1477+}
1478+static inline u64 perf_event_pause(struct perf_event *event, bool reset)
1479+{
1480+ return 0;
1481+}
14181482 #endif
14191483
14201484 #if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL)
include/linux/phy.h+26−2
@@ -203,6 +203,8 @@ static inline const char *phy_modes(phy_interface_t interface) · 202 unmodified lines
203203
204204 struct device;
205205 struct phylink;
206+struct sfp_bus;
207+struct sfp_upstream_ops;
206208 struct sk_buff;
207209
208210 /*
@@ -342,6 +344,8 @@ struct phy_c45_device_ids { · 133 unmodified lines
342344 * dev_flags: Device-specific flags used by the PHY driver.
343345 * irq: IRQ number of the PHY's interrupt (-1 if none)
344346 * phy_timer: The timer for handling the state machine
347+ * sfp_bus_attached: flag indicating whether the SFP bus has been attached
348+ * sfp_bus: SFP bus attached to this PHY's fiber port
345349 * attached_dev: The attached enet driver's device instance ptr
346350 * adjust_link: Callback for the enet controller to respond to
347351 * changes in the link state.
@@ -432,6 +436,9 @@ struct phy_device { · 84 unmodified lines
432436
433437 struct mutex lock;
434438
439+ /* This may be modified under the rtnl lock */
440+ bool sfp_bus_attached;
441+ struct sfp_bus *sfp_bus;
435442 struct phylink *phylink;
436443 struct net_device *attached_dev;
437444
@@ -993,7 +1000,7 @@ int phy_modify_paged_changed(struct phy_device *phydev, int page, u32 regnum, · 555 unmodified lines
9931000 int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum,
9941001 u16 mask, u16 set);
9951002
996−struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
1003+struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id,
9971004 bool is_c45,
9981005 struct phy_c45_device_ids *c45_ids);
9991006 #if IS_ENABLED(CONFIG_PHYLIB)
@@ -1020,6 +1027,10 @@ int phy_suspend(struct phy_device *phydev); · 20 unmodified lines
10201027 int phy_resume(struct phy_device *phydev);
10211028 int __phy_resume(struct phy_device *phydev);
10221029 int phy_loopback(struct phy_device *phydev, bool enable);
1030+void phy_sfp_attach(void *upstream, struct sfp_bus *bus);
1031+void phy_sfp_detach(void *upstream, struct sfp_bus *bus);
1032+int phy_sfp_probe(struct phy_device *phydev,
1033+ const struct sfp_upstream_ops *ops);
10231034 struct phy_device *phy_attach(struct net_device *dev, const char *bus_id,
10241035 phy_interface_t interface);
10251036 struct phy_device *phy_find_first(struct mii_bus *bus);
@@ -1065,6 +1076,16 @@ static inline const char *phydev_name(const struct phy_device *phydev) · 39 unmodified lines
10651076 return dev_name(&phydev->mdio.dev);
10661077 }
10671078
1079+static inline void phy_lock_mdio_bus(struct phy_device *phydev)
1080+{
1081+ mutex_lock(&phydev->mdio.bus->mdio_lock);
1082+}
1083+
1084+static inline void phy_unlock_mdio_bus(struct phy_device *phydev)
1085+{
1086+ mutex_unlock(&phydev->mdio.bus->mdio_lock);
1087+}
1088+
10681089 void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
10691090 __printf(2, 3);
10701091 void phy_attached_info(struct phy_device *phydev);
@@ -1106,6 +1127,10 @@ int genphy_read_mmd_unsupported(struct phy_device *phdev, int devad, · 35 unmodified lines
11061127 int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum,
11071128 u16 regnum, u16 val);
11081129
1130+/* Clause 37 */
1131+int genphy_c37_config_aneg(struct phy_device *phydev);
1132+int genphy_c37_read_status(struct phy_device *phydev);
1133+
11091134 /* Clause 45 PHY */
11101135 int genphy_c45_restart_aneg(struct phy_device *phydev);
11111136 int genphy_c45_check_and_restart_aneg(struct phy_device *phydev, bool restart);
@@ -1145,7 +1170,6 @@ void phy_queue_state_machine(struct phy_device *phydev, unsigned long jiffies); · 33 unmodified lines
11451170 void phy_mac_interrupt(struct phy_device *phydev);
11461171 void phy_start_machine(struct phy_device *phydev);
11471172 void phy_stop_machine(struct phy_device *phydev);
1148−int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
11491173 void phy_ethtool_ksettings_get(struct phy_device *phydev,
11501174 struct ethtool_link_ksettings *cmd);
11511175 int phy_ethtool_ksettings_set(struct phy_device *phydev,
include/linux/phy/phy.h+2−1
@@ -38,7 +38,8 @@ enum phy_mode { · 37 unmodified lines
3838 PHY_MODE_PCIE,
3939 PHY_MODE_ETHERNET,
4040 PHY_MODE_MIPI_DPHY,
41− PHY_MODE_SATA
41+ PHY_MODE_SATA,
42+ PHY_MODE_LVDS,
4243 };
4344
4445 /**
include/linux/phy/tegra/xusb.h+3−1
@@ -18,5 +18,7 @@ int tegra_xusb_padctl_hsic_set_idle(struct tegra_xusb_padctl *padctl, · 17 unmodified lines
1818 unsigned int port, bool idle);
1919 int tegra_xusb_padctl_usb3_set_lfps_detect(struct tegra_xusb_padctl *padctl,
2020 unsigned int port, bool enable);
21−
21+int tegra_xusb_padctl_set_vbus_override(struct tegra_xusb_padctl *padctl,
22+ bool val);
23+int tegra_phy_xusb_utmi_port_reset(struct phy *phy);
2224 #endif /* PHY_TEGRA_XUSB_H */
include/linux/phy_led_triggers.h+1−1
@@ -14,7 +14,7 @@ struct phy_device; · 13 unmodified lines
1414 #define PHY_LED_TRIGGER_SPEED_SUFFIX_SIZE 11
1515
1616 #define PHY_LINK_LED_TRIGGER_NAME_SIZE (MII_BUS_ID_SIZE + \
17− FIELD_SIZEOF(struct mdio_device, addr)+\
17+ sizeof_field(struct mdio_device, addr)+\
1818 PHY_LED_TRIGGER_SPEED_SUFFIX_SIZE)
1919
2020 struct phy_led_trigger {
include/linux/phylink.h+13−12
@@ -72,7 +72,7 @@ struct phylink_config { · 71 unmodified lines
7272 /**
7373 * struct phylink_mac_ops - MAC operations structure.
7474 * @validate: Validate and update the link configuration.
75− * @mac_link_state: Read the current link state from the hardware.
75+ * @mac_pcs_get_state: Read the current link state from the hardware.
7676 * @mac_config: configure the MAC for the selected mode and state.
7777 * @mac_an_restart: restart 802.3z BaseX autonegotiation.
7878 * @mac_link_down: take the link down.
@@ -84,8 +84,8 @@ struct phylink_mac_ops { · 5 unmodified lines
8484 void (*validate)(struct phylink_config *config,
8585 unsigned long *supported,
8686 struct phylink_link_state *state);
87− int (*mac_link_state)(struct phylink_config *config,
88− struct phylink_link_state *state);
87+ void (*mac_pcs_get_state)(struct phylink_config *config,
88+ struct phylink_link_state *state);
8989 void (*mac_config)(struct phylink_config *config, unsigned int mode,
9090 const struct phylink_link_state *state);
9191 void (*mac_an_restart)(struct phylink_config *config);
@@ -127,18 +127,19 @@ void validate(struct phylink_config *config, unsigned long *supported, · 35 unmodified lines
127127 struct phylink_link_state *state);
128128
129129 /**
130− * mac_link_state() - Read the current link state from the hardware
130+ * mac_pcs_get_state() - Read the current inband link state from the hardware
131131 * @config: a pointer to a &struct phylink_config.
132132 * @state: a pointer to a &struct phylink_link_state.
133133 *
134− * Read the current link state from the MAC, reporting the current
135− * speed in @state->speed, duplex mode in @state->duplex, pause mode
136− * in @state->pause using the %MLO_PAUSE_RX and %MLO_PAUSE_TX bits,
137− * negotiation completion state in @state->an_complete, and link
138− * up state in @state->link.
134+ * Read the current inband link state from the MAC PCS, reporting the
135+ * current speed in @state->speed, duplex mode in @state->duplex, pause
136+ * mode in @state->pause using the %MLO_PAUSE_RX and %MLO_PAUSE_TX bits,
137+ * negotiation completion state in @state->an_complete, and link up state
138+ * in @state->link. If possible, @state->lp_advertising should also be
139+ * populated.
139140 */
140−int mac_link_state(struct phylink_config *config,
141− struct phylink_link_state *state);
141+void mac_pcs_get_state(struct phylink_config *config,
142+ struct phylink_link_state *state);
142143
143144 /**
144145 * mac_config() - configure the MAC for the selected mode and state
@@ -166,7 +167,7 @@ int mac_link_state(struct phylink_config *config, · 21 unmodified lines
166167 * 1000base-X or Cisco SGMII mode depending on the @state->interface
167168 * mode). In both cases, link state management (whether the link
168169 * is up or not) is performed by the MAC, and reported via the
169− * mac_link_state() callback. Changes in link state must be made
170+ * mac_pcs_get_state() callback. Changes in link state must be made
170171 * by calling phylink_mac_change().
171172 *
172173 * If in 802.3z mode, the link speed is fixed, dependent on the
include/linux/pid.h+6−1
@@ -85,6 +85,10 @@ static inline struct pid *get_pid(struct pid *pid) · 84 unmodified lines
8585
8686 extern void put_pid(struct pid *pid);
8787 extern struct task_struct *pid_task(struct pid *pid, enum pid_type);
88+static inline bool pid_has_task(struct pid *pid, enum pid_type type)
89+{
90+ return !hlist_empty(&pid->tasks[type]);
91+}
8892 extern struct task_struct *get_pid_task(struct pid *pid, enum pid_type);
8993
9094 extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type);
@@ -120,7 +124,8 @@ extern struct pid *find_vpid(int nr); · 29 unmodified lines
120124 extern struct pid *find_get_pid(int nr);
121125 extern struct pid *find_ge_pid(int nr, struct pid_namespace *);
122126
123−extern struct pid *alloc_pid(struct pid_namespace *ns);
127+extern struct pid *alloc_pid(struct pid_namespace *ns, pid_t *set_tid,
128+ size_t set_tid_size);
124129 extern void free_pid(struct pid *pid);
125130 extern void disable_pid_allocation(struct pid_namespace *ns);
126131
include/linux/pid_namespace.h+2−0
@@ -12,6 +12,8 @@ · 11 unmodified lines
1212 #include <linux/ns_common.h>
1313 #include <linux/idr.h>
1414
15+/* MAX_PID_NS_LEVEL is needed for limiting size of 'struct pid' */
16+#define MAX_PID_NS_LEVEL 32
1517
1618 struct fs_pin;
1719
include/linux/pipe_fs_i.h+60−6
@@ -30,14 +30,14 @@ struct pipe_buffer { · 29 unmodified lines
3030 * struct pipe_inode_info - a linux kernel pipe
3131 * @mutex: mutex protecting the whole thing
3232 * @wait: reader/writer wait point in case of empty/full pipe
33− * @nrbufs: the number of non-empty pipe buffers in this pipe
34− * @buffers: total number of buffers (should be a power of 2)
35− * @curbuf: the current pipe buffer entry
33+ * @head: The point of buffer production
34+ * @tail: The point of buffer consumption
35+ * @max_usage: The maximum number of slots that may be used in the ring
36+ * @ring_size: total number of buffers (should be a power of 2)
3637 * @tmp_page: cached released page
3738 * @readers: number of current readers of this pipe
3839 * @writers: number of current writers of this pipe
3940 * @files: number of struct file referring this pipe (protected by ->i_lock)
40− * @waiting_writers: number of writers blocked waiting for room
4141 * @r_counter: reader counter
4242 * @w_counter: writer counter
4343 * @fasync_readers: reader side fasync
@@ -48,11 +48,13 @@ struct pipe_buffer { · 4 unmodified lines
4848 struct pipe_inode_info {
4949 struct mutex mutex;
5050 wait_queue_head_t wait;
51− unsigned int nrbufs, curbuf, buffers;
51+ unsigned int head;
52+ unsigned int tail;
53+ unsigned int max_usage;
54+ unsigned int ring_size;
5255 unsigned int readers;
5356 unsigned int writers;
5457 unsigned int files;
55− unsigned int waiting_writers;
5658 unsigned int r_counter;
5759 unsigned int w_counter;
5860 struct page *tmp_page;
@@ -104,6 +106,58 @@ struct pipe_buf_operations { · 45 unmodified lines
104106 bool (*get)(struct pipe_inode_info *, struct pipe_buffer *);
105107 };
106108
109+/**
110+ * pipe_empty - Return true if the pipe is empty
111+ * @head: The pipe ring head pointer
112+ * @tail: The pipe ring tail pointer
113+ */
114+static inline bool pipe_empty(unsigned int head, unsigned int tail)
115+{
116+ return head == tail;
117+}
118+
119+/**
120+ * pipe_occupancy - Return number of slots used in the pipe
121+ * @head: The pipe ring head pointer
122+ * @tail: The pipe ring tail pointer
123+ */
124+static inline unsigned int pipe_occupancy(unsigned int head, unsigned int tail)
125+{
126+ return head - tail;
127+}
128+
129+/**
130+ * pipe_full - Return true if the pipe is full
131+ * @head: The pipe ring head pointer
132+ * @tail: The pipe ring tail pointer
133+ * @limit: The maximum amount of slots available.
134+ */
135+static inline bool pipe_full(unsigned int head, unsigned int tail,
136+ unsigned int limit)
137+{
138+ return pipe_occupancy(head, tail) >= limit;
139+}
140+
141+/**
142+ * pipe_space_for_user - Return number of slots available to userspace
143+ * @head: The pipe ring head pointer
144+ * @tail: The pipe ring tail pointer
145+ * @pipe: The pipe info structure
146+ */
147+static inline unsigned int pipe_space_for_user(unsigned int head, unsigned int tail,
148+ struct pipe_inode_info *pipe)
149+{
150+ unsigned int p_occupancy, p_space;
151+
152+ p_occupancy = pipe_occupancy(head, tail);
153+ if (p_occupancy >= pipe->max_usage)
154+ return 0;
155+ p_space = pipe->ring_size - p_occupancy;
156+ if (p_space > pipe->max_usage)
157+ p_space = pipe->max_usage;
158+ return p_space;
159+}
160+
107161 /**
108162 * pipe_buf_get - get a reference to a pipe_buffer
109163 * @pipe: the pipe that the buffer belongs to
include/linux/platform_data/cros_ec_commands.h+220−65
@@ -556,6 +556,9 @@ enum host_event_code { · 555 unmodified lines
556556 /* Keyboard recovery combo with hardware reinitialization */
557557 EC_HOST_EVENT_KEYBOARD_RECOVERY_HW_REINIT = 30,
558558
559+ /* WoV */
560+ EC_HOST_EVENT_WOV = 31,
561+
559562 /*
560563 * The high bit of the event mask is not used as a host event code. If
561564 * it reads back as set, then the entire event mask should be
@@ -1277,8 +1280,6 @@ enum ec_feature_code { · 715 unmodified lines
12771280 * MOTIONSENSE_CMD_TABLET_MODE_LID_ANGLE.
12781281 */
12791282 EC_FEATURE_REFINED_TABLET_MODE_HYSTERESIS = 37,
1280− /* EC supports audio codec. */
1281− EC_FEATURE_AUDIO_CODEC = 38,
12821283 /* The MCU is a System Companion Processor (SCP). */
12831284 EC_FEATURE_SCP = 39,
12841285 /* The MCU is an Integrated Sensor Hub */
@@ -4468,92 +4469,246 @@ enum mkbp_cec_event { · 3183 unmodified lines
44684469
44694470 /*****************************************************************************/
44704471
4471−/* Commands for I2S recording on audio codec. */
4472+/* Commands for audio codec. */
4473+#define EC_CMD_EC_CODEC 0x00BC
44724474
4473−#define EC_CMD_CODEC_I2S 0x00BC
4474−#define EC_WOV_I2S_SAMPLE_RATE 48000
4475+enum ec_codec_subcmd {
4476+ EC_CODEC_GET_CAPABILITIES = 0x0,
4477+ EC_CODEC_GET_SHM_ADDR = 0x1,
4478+ EC_CODEC_SET_SHM_ADDR = 0x2,
4479+ EC_CODEC_SUBCMD_COUNT,
4480+};
44754481
4476−enum ec_codec_i2s_subcmd {
4477− EC_CODEC_SET_SAMPLE_DEPTH = 0x0,
4478− EC_CODEC_SET_GAIN = 0x1,
4479− EC_CODEC_GET_GAIN = 0x2,
4480− EC_CODEC_I2S_ENABLE = 0x3,
4481− EC_CODEC_I2S_SET_CONFIG = 0x4,
4482− EC_CODEC_I2S_SET_TDM_CONFIG = 0x5,
4483− EC_CODEC_I2S_SET_BCLK = 0x6,
4484− EC_CODEC_I2S_SUBCMD_COUNT = 0x7,
4482+enum ec_codec_cap {
4483+ EC_CODEC_CAP_WOV_AUDIO_SHM = 0,
4484+ EC_CODEC_CAP_WOV_LANG_SHM = 1,
4485+ EC_CODEC_CAP_LAST = 32,
44854486 };
44864487
4487−enum ec_sample_depth_value {
4488− EC_CODEC_SAMPLE_DEPTH_16 = 0,
4489− EC_CODEC_SAMPLE_DEPTH_24 = 1,
4488+enum ec_codec_shm_id {
4489+ EC_CODEC_SHM_ID_WOV_AUDIO = 0x0,
4490+ EC_CODEC_SHM_ID_WOV_LANG = 0x1,
4491+ EC_CODEC_SHM_ID_LAST,
44904492 };
44914493
4492−enum ec_i2s_config {
4493− EC_DAI_FMT_I2S = 0,
4494− EC_DAI_FMT_RIGHT_J = 1,
4495− EC_DAI_FMT_LEFT_J = 2,
4496− EC_DAI_FMT_PCM_A = 3,
4497− EC_DAI_FMT_PCM_B = 4,
4498− EC_DAI_FMT_PCM_TDM = 5,
4494+enum ec_codec_shm_type {
4495+ EC_CODEC_SHM_TYPE_EC_RAM = 0x0,
4496+ EC_CODEC_SHM_TYPE_SYSTEM_RAM = 0x1,
44994497 };
45004498
4501−/*
4502− * For subcommand EC_CODEC_GET_GAIN.
4503− */
4504−struct __ec_align1 ec_codec_i2s_gain {
4499+struct __ec_align1 ec_param_ec_codec_get_shm_addr {
4500+ uint8_t shm_id;
4501+ uint8_t reserved[3];
4502+};
4503+
4504+struct __ec_align4 ec_param_ec_codec_set_shm_addr {
4505+ uint64_t phys_addr;
4506+ uint32_t len;
4507+ uint8_t shm_id;
4508+ uint8_t reserved[3];
4509+};
4510+
4511+struct __ec_align4 ec_param_ec_codec {
4512+ uint8_t cmd; /* enum ec_codec_subcmd */
4513+ uint8_t reserved[3];
4514+
4515+ union {
4516+ struct ec_param_ec_codec_get_shm_addr
4517+ get_shm_addr_param;
4518+ struct ec_param_ec_codec_set_shm_addr
4519+ set_shm_addr_param;
4520+ };
4521+};
4522+
4523+struct __ec_align4 ec_response_ec_codec_get_capabilities {
4524+ uint32_t capabilities;
4525+};
4526+
4527+struct __ec_align4 ec_response_ec_codec_get_shm_addr {
4528+ uint64_t phys_addr;
4529+ uint32_t len;
4530+ uint8_t type;
4531+ uint8_t reserved[3];
4532+};
4533+
4534+/*****************************************************************************/
4535+
4536+/* Commands for DMIC on audio codec. */
4537+#define EC_CMD_EC_CODEC_DMIC 0x00BD
4538+
4539+enum ec_codec_dmic_subcmd {
4540+ EC_CODEC_DMIC_GET_MAX_GAIN = 0x0,
4541+ EC_CODEC_DMIC_SET_GAIN_IDX = 0x1,
4542+ EC_CODEC_DMIC_GET_GAIN_IDX = 0x2,
4543+ EC_CODEC_DMIC_SUBCMD_COUNT,
4544+};
4545+
4546+enum ec_codec_dmic_channel {
4547+ EC_CODEC_DMIC_CHANNEL_0 = 0x0,
4548+ EC_CODEC_DMIC_CHANNEL_1 = 0x1,
4549+ EC_CODEC_DMIC_CHANNEL_2 = 0x2,
4550+ EC_CODEC_DMIC_CHANNEL_3 = 0x3,
4551+ EC_CODEC_DMIC_CHANNEL_4 = 0x4,
4552+ EC_CODEC_DMIC_CHANNEL_5 = 0x5,
4553+ EC_CODEC_DMIC_CHANNEL_6 = 0x6,
4554+ EC_CODEC_DMIC_CHANNEL_7 = 0x7,
4555+ EC_CODEC_DMIC_CHANNEL_COUNT,
4556+};
4557+
4558+struct __ec_align1 ec_param_ec_codec_dmic_set_gain_idx {
4559+ uint8_t channel; /* enum ec_codec_dmic_channel */
4560+ uint8_t gain;
4561+ uint8_t reserved[2];
4562+};
4563+
4564+struct __ec_align1 ec_param_ec_codec_dmic_get_gain_idx {
4565+ uint8_t channel; /* enum ec_codec_dmic_channel */
4566+ uint8_t reserved[3];
4567+};
4568+
4569+struct __ec_align4 ec_param_ec_codec_dmic {
4570+ uint8_t cmd; /* enum ec_codec_dmic_subcmd */
4571+ uint8_t reserved[3];
4572+
4573+ union {
4574+ struct ec_param_ec_codec_dmic_set_gain_idx
4575+ set_gain_idx_param;
4576+ struct ec_param_ec_codec_dmic_get_gain_idx
4577+ get_gain_idx_param;
4578+ };
4579+};
4580+
4581+struct __ec_align1 ec_response_ec_codec_dmic_get_max_gain {
4582+ uint8_t max_gain;
4583+};
4584+
4585+struct __ec_align1 ec_response_ec_codec_dmic_get_gain_idx {
4586+ uint8_t gain;
4587+};
4588+
4589+/*****************************************************************************/
4590+
4591+/* Commands for I2S RX on audio codec. */
4592+
4593+#define EC_CMD_EC_CODEC_I2S_RX 0x00BE
4594+
4595+enum ec_codec_i2s_rx_subcmd {
4596+ EC_CODEC_I2S_RX_ENABLE = 0x0,
4597+ EC_CODEC_I2S_RX_DISABLE = 0x1,
4598+ EC_CODEC_I2S_RX_SET_SAMPLE_DEPTH = 0x2,
4599+ EC_CODEC_I2S_RX_SET_DAIFMT = 0x3,
4600+ EC_CODEC_I2S_RX_SET_BCLK = 0x4,
4601+ EC_CODEC_I2S_RX_SUBCMD_COUNT,
4602+};
4603+
4604+enum ec_codec_i2s_rx_sample_depth {
4605+ EC_CODEC_I2S_RX_SAMPLE_DEPTH_16 = 0x0,
4606+ EC_CODEC_I2S_RX_SAMPLE_DEPTH_24 = 0x1,
4607+ EC_CODEC_I2S_RX_SAMPLE_DEPTH_COUNT,
4608+};
4609+
4610+enum ec_codec_i2s_rx_daifmt {
4611+ EC_CODEC_I2S_RX_DAIFMT_I2S = 0x0,
4612+ EC_CODEC_I2S_RX_DAIFMT_RIGHT_J = 0x1,
4613+ EC_CODEC_I2S_RX_DAIFMT_LEFT_J = 0x2,
4614+ EC_CODEC_I2S_RX_DAIFMT_COUNT,
4615+};
4616+
4617+struct __ec_align1 ec_param_ec_codec_i2s_rx_set_sample_depth {
4618+ uint8_t depth;
4619+ uint8_t reserved[3];
4620+};
4621+
4622+struct __ec_align1 ec_param_ec_codec_i2s_rx_set_gain {
45054623 uint8_t left;
45064624 uint8_t right;
4625+ uint8_t reserved[2];
45074626 };
45084627
4509−struct __ec_todo_unpacked ec_param_codec_i2s_tdm {
4510− int16_t ch0_delay; /* 0 to 496 */
4511− int16_t ch1_delay; /* -1 to 496 */
4512− uint8_t adjacent_to_ch0;
4513− uint8_t adjacent_to_ch1;
4628+struct __ec_align1 ec_param_ec_codec_i2s_rx_set_daifmt {
4629+ uint8_t daifmt;
4630+ uint8_t reserved[3];
45144631 };
45154632
4516−struct __ec_todo_packed ec_param_codec_i2s {
4517− /* enum ec_codec_i2s_subcmd */
4518− uint8_t cmd;
4633+struct __ec_align4 ec_param_ec_codec_i2s_rx_set_bclk {
4634+ uint32_t bclk;
4635+};
4636+
4637+struct __ec_align4 ec_param_ec_codec_i2s_rx {
4638+ uint8_t cmd; /* enum ec_codec_i2s_rx_subcmd */
4639+ uint8_t reserved[3];
4640+
45194641 union {
4520− /*
4521− * EC_CODEC_SET_SAMPLE_DEPTH
4522− * Value should be one of ec_sample_depth_value.
4523− */
4524− uint8_t depth;
4642+ struct ec_param_ec_codec_i2s_rx_set_sample_depth
4643+ set_sample_depth_param;
4644+ struct ec_param_ec_codec_i2s_rx_set_daifmt
4645+ set_daifmt_param;
4646+ struct ec_param_ec_codec_i2s_rx_set_bclk
4647+ set_bclk_param;
4648+ };
4649+};
45254650
4526− /*
4527− * EC_CODEC_SET_GAIN
4528− * Value should be 0~43 for both channels.
4529− */
4530− struct ec_codec_i2s_gain gain;
4651+/*****************************************************************************/
4652+/* Commands for WoV on audio codec. */
4653+
4654+#define EC_CMD_EC_CODEC_WOV 0x00BF
4655+
4656+enum ec_codec_wov_subcmd {
4657+ EC_CODEC_WOV_SET_LANG = 0x0,
4658+ EC_CODEC_WOV_SET_LANG_SHM = 0x1,
4659+ EC_CODEC_WOV_GET_LANG = 0x2,
4660+ EC_CODEC_WOV_ENABLE = 0x3,
4661+ EC_CODEC_WOV_DISABLE = 0x4,
4662+ EC_CODEC_WOV_READ_AUDIO = 0x5,
4663+ EC_CODEC_WOV_READ_AUDIO_SHM = 0x6,
4664+ EC_CODEC_WOV_SUBCMD_COUNT,
4665+};
45314666
4532− /*
4533− * EC_CODEC_I2S_ENABLE
4534− * 1 to enable, 0 to disable.
4535− */
4536− uint8_t i2s_enable;
4667+/*
4668+ * @hash is SHA256 of the whole language model.
4669+ * @total_len indicates the length of whole language model.
4670+ * @offset is the cursor from the beginning of the model.
4671+ * @buf is the packet buffer.
4672+ * @len denotes how many bytes in the buf.
4673+ */
4674+struct __ec_align4 ec_param_ec_codec_wov_set_lang {
4675+ uint8_t hash[32];
4676+ uint32_t total_len;
4677+ uint32_t offset;
4678+ uint8_t buf[128];
4679+ uint32_t len;
4680+};
45374681
4538− /*
4539− * EC_CODEC_I2S_SET_CONFIG
4540− * Value should be one of ec_i2s_config.
4541− */
4542− uint8_t i2s_config;
4682+struct __ec_align4 ec_param_ec_codec_wov_set_lang_shm {
4683+ uint8_t hash[32];
4684+ uint32_t total_len;
4685+};
45434686
4544− /*
4545− * EC_CODEC_I2S_SET_TDM_CONFIG
4546− * Value should be one of ec_i2s_config.
4547− */
4548− struct ec_param_codec_i2s_tdm tdm_param;
4687+struct __ec_align4 ec_param_ec_codec_wov {
4688+ uint8_t cmd; /* enum ec_codec_wov_subcmd */
4689+ uint8_t reserved[3];
45494690
4550− /*
4551− * EC_CODEC_I2S_SET_BCLK
4552− */
4553− uint32_t bclk;
4691+ union {
4692+ struct ec_param_ec_codec_wov_set_lang
4693+ set_lang_param;
4694+ struct ec_param_ec_codec_wov_set_lang_shm
4695+ set_lang_shm_param;
45544696 };
45554697 };
45564698
4699+struct __ec_align4 ec_response_ec_codec_wov_get_lang {
4700+ uint8_t hash[32];
4701+};
4702+
4703+struct __ec_align4 ec_response_ec_codec_wov_read_audio {
4704+ uint8_t buf[128];
4705+ uint32_t len;
4706+};
4707+
4708+struct __ec_align4 ec_response_ec_codec_wov_read_audio_shm {
4709+ uint32_t offset;
4710+ uint32_t len;
4711+};
45574712
45584713 /*****************************************************************************/
45594714 /* System commands */
include/linux/platform_data/cros_ec_proto.h+27−111
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/mutex.h>
1313 #include <linux/notifier.h>
1414
15+#include <linux/mfd/cros_ec.h>
1516 #include <linux/platform_data/cros_ec_commands.h>
1617
1718 #define CROS_EC_DEV_NAME "cros_ec"
@@ -115,12 +116,16 @@ struct cros_ec_command { · 97 unmodified lines
115116 * code.
116117 * @pkt_xfer: Send packet to EC and get response.
117118 * @lock: One transaction at a time.
118− * @mkbp_event_supported: True if this EC supports the MKBP event protocol.
119+ * @mkbp_event_supported: 0 if MKBP not supported. Otherwise its value is
120+ * the maximum supported version of the MKBP host event
121+ * command + 1.
119122 * @host_sleep_v1: True if this EC supports the sleep v1 command.
120123 * @event_notifier: Interrupt event notifier for transport devices.
121124 * @event_data: Raw payload transferred with the MKBP event.
122125 * @event_size: Size in bytes of the event data.
123126 * @host_event_wake_mask: Mask of host events that cause wake from suspend.
127+ * @last_event_time: exact time from the hard irq when we got notified of
128+ * a new event.
124129 * @ec: The platform_device used by the mfd driver to interface with the
125130 * main EC.
126131 * @pd: The platform_device used by the mfd driver to interface with the
@@ -153,7 +158,7 @@ struct cros_ec_device { · 26 unmodified lines
153158 int (*pkt_xfer)(struct cros_ec_device *ec,
154159 struct cros_ec_command *msg);
155160 struct mutex lock;
156− bool mkbp_event_supported;
161+ u8 mkbp_event_supported;
157162 bool host_sleep_v1;
158163 struct blocking_notifier_head event_notifier;
159164
@@ -161,20 +166,13 @@ struct cros_ec_device { · 1 unmodified line
161166 int event_size;
162167 u32 host_event_wake_mask;
163168 u32 last_resume_result;
169+ ktime_t last_event_time;
164170
165171 /* The platform devices used by the mfd driver */
166172 struct platform_device *ec;
167173 struct platform_device *pd;
168174 };
169175
170−/**
171− * struct cros_ec_sensor_platform - ChromeOS EC sensor platform information.
172− * @sensor_num: Id of the sensor, as reported by the EC.
173− */
174−struct cros_ec_sensor_platform {
175− u8 sensor_num;
176−};
177−
178176 /**
179177 * struct cros_ec_platform - ChromeOS EC platform information.
180178 * @ec_name: Name of EC device (e.g. 'cros-ec', 'cros-pd', ...)
@@ -187,133 +185,51 @@ struct cros_ec_platform { · 6 unmodified lines
187185 u16 cmd_offset;
188186 };
189187
190−/**
191− * cros_ec_suspend() - Handle a suspend operation for the ChromeOS EC device.
192− * @ec_dev: Device to suspend.
193− *
194− * This can be called by drivers to handle a suspend event.
195− *
196− * Return: 0 on success or negative error code.
197− */
198188 int cros_ec_suspend(struct cros_ec_device *ec_dev);
199189
200−/**
201− * cros_ec_resume() - Handle a resume operation for the ChromeOS EC device.
202− * @ec_dev: Device to resume.
203− *
204− * This can be called by drivers to handle a resume event.
205− *
206− * Return: 0 on success or negative error code.
207− */
208190 int cros_ec_resume(struct cros_ec_device *ec_dev);
209191
210−/**
211− * cros_ec_prepare_tx() - Prepare an outgoing message in the output buffer.
212− * @ec_dev: Device to register.
213− * @msg: Message to write.
214− *
215− * This is intended to be used by all ChromeOS EC drivers, but at present
216− * only SPI uses it. Once LPC uses the same protocol it can start using it.
217− * I2C could use it now, with a refactor of the existing code.
218− *
219− * Return: 0 on success or negative error code.
220− */
221192 int cros_ec_prepare_tx(struct cros_ec_device *ec_dev,
222193 struct cros_ec_command *msg);
223194
224−/**
225− * cros_ec_check_result() - Check ec_msg->result.
226− * @ec_dev: EC device.
227− * @msg: Message to check.
228− *
229− * This is used by ChromeOS EC drivers to check the ec_msg->result for
230− * errors and to warn about them.
231− *
232− * Return: 0 on success or negative error code.
233− */
234195 int cros_ec_check_result(struct cros_ec_device *ec_dev,
235196 struct cros_ec_command *msg);
236197
237−/**
238− * cros_ec_cmd_xfer() - Send a command to the ChromeOS EC.
239− * @ec_dev: EC device.
240− * @msg: Message to write.
241− *
242− * Call this to send a command to the ChromeOS EC. This should be used
243− * instead of calling the EC's cmd_xfer() callback directly.
244− *
245− * Return: 0 on success or negative error code.
246− */
247198 int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev,
248199 struct cros_ec_command *msg);
249200
250−/**
251− * cros_ec_cmd_xfer_status() - Send a command to the ChromeOS EC.
252− * @ec_dev: EC device.
253− * @msg: Message to write.
254− *
255− * This function is identical to cros_ec_cmd_xfer, except it returns success
256− * status only if both the command was transmitted successfully and the EC
257− * replied with success status. It's not necessary to check msg->result when
258− * using this function.
259− *
260− * Return: The number of bytes transferred on success or negative error code.
261− */
262201 int cros_ec_cmd_xfer_status(struct cros_ec_device *ec_dev,
263202 struct cros_ec_command *msg);
264203
265−/**
266− * cros_ec_register() - Register a new ChromeOS EC, using the provided info.
267− * @ec_dev: Device to register.
268− *
269− * Before calling this, allocate a pointer to a new device and then fill
270− * in all the fields up to the --private-- marker.
271− *
272− * Return: 0 on success or negative error code.
273− */
274204 int cros_ec_register(struct cros_ec_device *ec_dev);
275205
276−/**
277− * cros_ec_unregister() - Remove a ChromeOS EC.
278− * @ec_dev: Device to unregister.
279− *
280− * Call this to deregister a ChromeOS EC, then clean up any private data.
281− *
282− * Return: 0 on success or negative error code.
283− */
284206 int cros_ec_unregister(struct cros_ec_device *ec_dev);
285207
286−/**
287− * cros_ec_query_all() - Query the protocol version supported by the
288− * ChromeOS EC.
289− * @ec_dev: Device to register.
290− *
291− * Return: 0 on success or negative error code.
292− */
293208 int cros_ec_query_all(struct cros_ec_device *ec_dev);
294209
295−/**
296− * cros_ec_get_next_event() - Fetch next event from the ChromeOS EC.
297− * @ec_dev: Device to fetch event from.
298− * @wake_event: Pointer to a bool set to true upon return if the event might be
299− * treated as a wake event. Ignored if null.
300− *
301− * Return: negative error code on errors; 0 for no data; or else number of
302− * bytes received (i.e., an event was retrieved successfully). Event types are
303− * written out to @ec_dev->event_data.event_type on success.
304− */
305−int cros_ec_get_next_event(struct cros_ec_device *ec_dev, bool *wake_event);
210+int cros_ec_get_next_event(struct cros_ec_device *ec_dev,
211+ bool *wake_event,
212+ bool *has_more_events);
213+
214+u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev);
215+
216+int cros_ec_check_features(struct cros_ec_dev *ec, int feature);
217+
218+int cros_ec_get_sensor_count(struct cros_ec_dev *ec);
219+
220+bool cros_ec_handle_event(struct cros_ec_device *ec_dev);
306221
307222 /**
308− * cros_ec_get_host_event() - Return a mask of event set by the ChromeOS EC.
309− * @ec_dev: Device to fetch event from.
223+ * cros_ec_get_time_ns() - Return time in ns.
310224 *
311− * When MKBP is supported, when the EC raises an interrupt, we collect the
312− * events raised and call the functions in the ec notifier. This function
313− * is a helper to know which events are raised.
225+ * This is the function used to record the time for last_event_time in struct
226+ * cros_ec_device during the hard irq.
314227 *
315− * Return: 0 on error or non-zero bitmask of one or more EC_HOST_EVENT_*.
228+ * Return: ktime_t format since boot.
316229 */
317−u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev);
230+static inline ktime_t cros_ec_get_time_ns(void)
231+{
232+ return ktime_get_boottime_ns();
233+}
318234
319235 #endif /* __LINUX_CROS_EC_PROTO_H */
include/linux/platform_data/cros_ec_sensorhub.h+30−0
@@ -0,0 +1,30 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Chrome OS EC MEMS Sensor Hub driver.
4+ *
5+ * Copyright 2019 Google LLC
6+ */
7+
8+#ifndef __LINUX_PLATFORM_DATA_CROS_EC_SENSORHUB_H
9+#define __LINUX_PLATFORM_DATA_CROS_EC_SENSORHUB_H
10+
11+#include <linux/platform_data/cros_ec_commands.h>
12+
13+/**
14+ * struct cros_ec_sensor_platform - ChromeOS EC sensor platform information.
15+ * @sensor_num: Id of the sensor, as reported by the EC.
16+ */
17+struct cros_ec_sensor_platform {
18+ u8 sensor_num;
19+};
20+
21+/**
22+ * struct cros_ec_sensorhub - Sensor Hub device data.
23+ *
24+ * @ec: Embedded Controller where the hub is located.
25+ */
26+struct cros_ec_sensorhub {
27+ struct cros_ec_dev *ec;
28+};
29+
30+#endif /* __LINUX_PLATFORM_DATA_CROS_EC_SENSORHUB_H */
include/linux/platform_data/gpio_backlight.h+0−3
@@ -9,9 +9,6 @@ struct device; · 8 unmodified lines
99
1010 struct gpio_backlight_platform_data {
1111 struct device *fbdev;
12− int gpio;
13− int def_value;
14− const char *name;
1512 };
1613
1714 #endif
include/linux/platform_data/hsmmc-omap.h+0−3
@@ -67,9 +67,6 @@ struct omap_hsmmc_platform_data { · 66 unmodified lines
6767 /* string specifying a particular variant of hardware */
6868 char *version;
6969
70− /* if we have special card, init it using this callback */
71− void (*init_card)(struct mmc_card *card);
72−
7370 const char *name;
7471 u32 ocr_mask;
7572 };
include/linux/platform_data/i2c-pxa.h+0−4
@@ -55,11 +55,7 @@ · 54 unmodified lines
5555 */
5656 #define I2C_ISR_INIT 0x7FF /* status register init */
5757
58−struct i2c_slave_client;
59−
6058 struct i2c_pxa_platform_data {
61− unsigned int slave_addr;
62− struct i2c_slave_client *slave;
6359 unsigned int class;
6460 unsigned int use_pio :1;
6561 unsigned int fast_mode :1;
include/linux/platform_data/intel-spi.h+1−0
@@ -13,6 +13,7 @@ enum intel_spi_type { · 12 unmodified lines
1313 INTEL_SPI_BYT = 1,
1414 INTEL_SPI_LPT,
1515 INTEL_SPI_BXT,
16+ INTEL_SPI_CNL,
1617 };
1718
1819 /**
include/linux/platform_data/pixcir_i2c_ts.h+0−64
@@ -1,64 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef _PIXCIR_I2C_TS_H
3−#define _PIXCIR_I2C_TS_H
4−
5−/*
6− * Register map
7− */
8−#define PIXCIR_REG_POWER_MODE 51
9−#define PIXCIR_REG_INT_MODE 52
10−
11−/*
12− * Power modes:
13− * active: max scan speed
14− * idle: lower scan speed with automatic transition to active on touch
15− * halt: datasheet says sleep but this is more like halt as the chip
16− * clocks are cut and it can only be brought out of this mode
17− * using the RESET pin.
18− */
19−enum pixcir_power_mode {
20− PIXCIR_POWER_ACTIVE,
21− PIXCIR_POWER_IDLE,
22− PIXCIR_POWER_HALT,
23−};
24−
25−#define PIXCIR_POWER_MODE_MASK 0x03
26−#define PIXCIR_POWER_ALLOW_IDLE (1UL << 2)
27−
28−/*
29− * Interrupt modes:
30− * periodical: interrupt is asserted periodicaly
31− * diff coordinates: interrupt is asserted when coordinates change
32− * level on touch: interrupt level asserted during touch
33− * pulse on touch: interrupt pulse asserted druing touch
34− *
35− */
36−enum pixcir_int_mode {
37− PIXCIR_INT_PERIODICAL,
38− PIXCIR_INT_DIFF_COORD,
39− PIXCIR_INT_LEVEL_TOUCH,
40− PIXCIR_INT_PULSE_TOUCH,
41−};
42−
43−#define PIXCIR_INT_MODE_MASK 0x03
44−#define PIXCIR_INT_ENABLE (1UL << 3)
45−#define PIXCIR_INT_POL_HIGH (1UL << 2)
46−
47−/**
48− * struct pixcir_irc_chip_data - chip related data
49− * @max_fingers: Max number of fingers reported simultaneously by h/w
50− * @has_hw_ids: Hardware supports finger tracking IDs
51− *
52− */
53−struct pixcir_i2c_chip_data {
54− u8 max_fingers;
55− bool has_hw_ids;
56−};
57−
58−struct pixcir_ts_platform_data {
59− int x_max;
60− int y_max;
61− struct pixcir_i2c_chip_data chip;
62−};
63−
64−#endif
include/linux/platform_data/spi-mt65xx.h+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111
1212 /* Board specific platform_data */
1313 struct mtk_chip_config {
14− u32 cs_pol;
1514 u32 sample_sel;
1615 };
1716 #endif
include/linux/platform_data/st_sensors_pdata.h+2−0
@@ -18,12 +18,14 @@ · 17 unmodified lines
1818 * @open_drain: set the interrupt line to be open drain if possible.
1919 * @spi_3wire: enable spi-3wire mode.
2020 * @pullups: enable/disable i2c controller pullup resistors.
21+ * @wakeup_source: enable/disable device as wakeup generator.
2122 */
2223 struct st_sensors_platform_data {
2324 u8 drdy_int_pin;
2425 bool open_drain;
2526 bool spi_3wire;
2627 bool pullups;
28+ bool wakeup_source;
2729 };
2830
2931 #endif /* ST_SENSORS_PDATA_H */
include/linux/platform_data/ti-prm.h+21−0
@@ -0,0 +1,21 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
2+/*
3+ * TI PRM (Power & Reset Manager) platform data
4+ *
5+ * Copyright (C) 2019 Texas Instruments, Inc.
6+ *
7+ * Tero Kristo <t-kristo@ti.com>
8+ */
9+
10+#ifndef _LINUX_PLATFORM_DATA_TI_PRM_H
11+#define _LINUX_PLATFORM_DATA_TI_PRM_H
12+
13+struct clockdomain;
14+
15+struct ti_prm_platform_data {
16+ void (*clkdm_deny_idle)(struct clockdomain *clkdm);
17+ void (*clkdm_allow_idle)(struct clockdomain *clkdm);
18+ struct clockdomain * (*clkdm_lookup)(const char *name);
19+};
20+
21+#endif /* _LINUX_PLATFORM_DATA_TI_PRM_H */
include/linux/platform_data/ti-sysc.h+2−0
@@ -49,6 +49,8 @@ struct sysc_regbits { · 48 unmodified lines
4949 s8 emufree_shift;
5050 };
5151
52+#define SYSC_QUIRK_FORCE_MSTANDBY BIT(20)
53+#define SYSC_MODULE_QUIRK_AESS BIT(19)
5254 #define SYSC_MODULE_QUIRK_SGX BIT(18)
5355 #define SYSC_MODULE_QUIRK_HDQ1W BIT(17)
5456 #define SYSC_MODULE_QUIRK_I2C BIT(16)
include/linux/platform_data/wilco-ec.h+15−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 * @data_size: Size of the data buffer used for EC communication.
3030 * @debugfs_pdev: The child platform_device used by the debugfs sub-driver.
3131 * @rtc_pdev: The child platform_device used by the RTC sub-driver.
32+ * @charger_pdev: Child platform_device used by the charger config sub-driver.
3233 * @telem_pdev: The child platform_device used by the telemetry sub-driver.
3334 */
3435 struct wilco_ec_device {
@@ -41,6 +42,7 @@ struct wilco_ec_device { · 6 unmodified lines
4142 size_t data_size;
4243 struct platform_device *debugfs_pdev;
4344 struct platform_device *rtc_pdev;
45+ struct platform_device *charger_pdev;
4446 struct platform_device *telem_pdev;
4547 };
4648
@@ -120,6 +122,19 @@ struct wilco_ec_message { · 73 unmodified lines
120122 */
121123 int wilco_ec_mailbox(struct wilco_ec_device *ec, struct wilco_ec_message *msg);
122124
125+/**
126+ * wilco_keyboard_leds_init() - Set up the keyboard backlight LEDs.
127+ * @ec: EC device to query.
128+ *
129+ * After this call, the keyboard backlight will be exposed through a an LED
130+ * device at /sys/class/leds.
131+ *
132+ * This may sleep because it uses wilco_ec_mailbox().
133+ *
134+ * Return: 0 on success, negative error code on failure.
135+ */
136+int wilco_keyboard_leds_init(struct wilco_ec_device *ec);
137+
123138 /*
124139 * A Property is typically a data item that is stored to NVRAM
125140 * by the EC. Each of these data items has an index associated
include/linux/platform_device.h+18−52
@@ -57,6 +57,12 @@ platform_find_device_by_driver(struct device *start, · 56 unmodified lines
5757 extern void __iomem *
5858 devm_platform_ioremap_resource(struct platform_device *pdev,
5959 unsigned int index);
60+extern void __iomem *
61+devm_platform_ioremap_resource_wc(struct platform_device *pdev,
62+ unsigned int index);
63+extern void __iomem *
64+devm_platform_ioremap_resource_byname(struct platform_device *pdev,
65+ const char *name);
6066 extern int platform_get_irq(struct platform_device *, unsigned int);
6167 extern int platform_get_irq_optional(struct platform_device *, unsigned int);
6268 extern int platform_irq_count(struct platform_device *);
@@ -294,58 +300,6 @@ void platform_unregister_drivers(struct platform_driver * const *drivers, · 231 unmodified lines
294300 #define platform_register_drivers(drivers, count) \
295301 __platform_register_drivers(drivers, count, THIS_MODULE)
296302
297−/* early platform driver interface */
298−struct early_platform_driver {
299− const char *class_str;
300− struct platform_driver *pdrv;
301− struct list_head list;
302− int requested_id;
303− char *buffer;
304− int bufsize;
305−};
306−
307−#define EARLY_PLATFORM_ID_UNSET -2
308−#define EARLY_PLATFORM_ID_ERROR -3
309−
310−extern int early_platform_driver_register(struct early_platform_driver *epdrv,
311− char *buf);
312−extern void early_platform_add_devices(struct platform_device **devs, int num);
313−
314−static inline int is_early_platform_device(struct platform_device *pdev)
315−{
316− return !pdev->dev.driver;
317−}
318−
319−extern void early_platform_driver_register_all(char *class_str);
320−extern int early_platform_driver_probe(char *class_str,
321− int nr_probe, int user_only);
322−extern void early_platform_cleanup(void);
323−
324−#define early_platform_init(class_string, platdrv) \
325− early_platform_init_buffer(class_string, platdrv, NULL, 0)
326−
327−#ifndef MODULE
328−#define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \
329−static __initdata struct early_platform_driver early_driver = { \
330− .class_str = class_string, \
331− .buffer = buf, \
332− .bufsize = bufsiz, \
333− .pdrv = platdrv, \
334− .requested_id = EARLY_PLATFORM_ID_UNSET, \
335−}; \
336−static int __init early_platform_driver_setup_func(char *buffer) \
337−{ \
338− return early_platform_driver_register(&early_driver, buffer); \
339−} \
340−early_param(class_string, early_platform_driver_setup_func)
341−#else /* MODULE */
342−#define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \
343−static inline char *early_platform_driver_setup_func(void) \
344−{ \
345− return bufsiz ? buf : NULL; \
346−}
347−#endif /* MODULE */
348−
349303 #ifdef CONFIG_SUSPEND
350304 extern int platform_pm_suspend(struct device *dev);
351305 extern int platform_pm_resume(struct device *dev);
@@ -380,4 +334,16 @@ extern int platform_dma_configure(struct device *dev); · 28 unmodified lines
380334 #define USE_PLATFORM_PM_SLEEP_OPS
381335 #endif
382336
337+#ifndef CONFIG_SUPERH
338+/*
339+ * REVISIT: This stub is needed for all non-SuperH users of early platform
340+ * drivers. It should go away once we introduce the new platform_device-based
341+ * early driver framework.
342+ */
343+static inline int is_sh_early_platform_device(struct platform_device *pdev)
344+{
345+ return 0;
346+}
347+#endif /* CONFIG_SUPERH */
348+
383349 #endif /* _PLATFORM_DEVICE_H_ */
include/linux/pm.h+2−0
@@ -637,6 +637,7 @@ extern void dev_pm_put_subsys_data(struct device *dev); · 636 unmodified lines
637637 * struct dev_pm_domain - power management domain representation.
638638 *
639639 * @ops: Power management operations associated with this domain.
640+ * @start: Called when a user needs to start the device via the domain.
640641 * @detach: Called when removing a device from the domain.
641642 * @activate: Called before executing probe routines for bus types and drivers.
642643 * @sync: Called after successful driver probe.
@@ -648,6 +649,7 @@ extern void dev_pm_put_subsys_data(struct device *dev); · 5 unmodified lines
648649 */
649650 struct dev_pm_domain {
650651 struct dev_pm_ops ops;
652+ int (*start)(struct device *dev);
651653 void (*detach)(struct device *dev, bool power_off);
652654 int (*activate)(struct device *dev);
653655 void (*sync)(struct device *dev);
include/linux/pm_domain.h+5−0
@@ -366,6 +366,7 @@ struct device *dev_pm_domain_attach_by_id(struct device *dev, · 365 unmodified lines
366366 struct device *dev_pm_domain_attach_by_name(struct device *dev,
367367 const char *name);
368368 void dev_pm_domain_detach(struct device *dev, bool power_off);
369+int dev_pm_domain_start(struct device *dev);
369370 void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd);
370371 #else
371372 static inline int dev_pm_domain_attach(struct device *dev, bool power_on)
@@ -383,6 +384,10 @@ static inline struct device *dev_pm_domain_attach_by_name(struct device *dev, · 11 unmodified lines
383384 return NULL;
384385 }
385386 static inline void dev_pm_domain_detach(struct device *dev, bool power_off) {}
387+static inline int dev_pm_domain_start(struct device *dev)
388+{
389+ return 0;
390+}
386391 static inline void dev_pm_domain_set(struct device *dev,
387392 struct dev_pm_domain *pd) {}
388393 #endif
include/linux/pm_opp.h+13−0
@@ -22,6 +22,7 @@ struct opp_table; · 21 unmodified lines
2222
2323 enum dev_pm_opp_event {
2424 OPP_EVENT_ADD, OPP_EVENT_REMOVE, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE,
25+ OPP_EVENT_ADJUST_VOLTAGE,
2526 };
2627
2728 /**
@@ -113,6 +114,10 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, · 85 unmodified lines
113114 void dev_pm_opp_remove(struct device *dev, unsigned long freq);
114115 void dev_pm_opp_remove_all_dynamic(struct device *dev);
115116
117+int dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq,
118+ unsigned long u_volt, unsigned long u_volt_min,
119+ unsigned long u_volt_max);
120+
116121 int dev_pm_opp_enable(struct device *dev, unsigned long freq);
117122
118123 int dev_pm_opp_disable(struct device *dev, unsigned long freq);
@@ -242,6 +247,14 @@ static inline void dev_pm_opp_remove_all_dynamic(struct device *dev) · 123 unmodified lines
242247 {
243248 }
244249
250+static inline int
251+dev_pm_opp_adjust_voltage(struct device *dev, unsigned long freq,
252+ unsigned long u_volt, unsigned long u_volt_min,
253+ unsigned long u_volt_max)
254+{
255+ return 0;
256+}
257+
245258 static inline int dev_pm_opp_enable(struct device *dev, unsigned long freq)
246259 {
247260 return 0;
include/linux/pm_qos.h+50−36
@@ -34,6 +34,8 @@ enum pm_qos_flags_status { · 33 unmodified lines
3434 #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT PM_QOS_LATENCY_ANY
3535 #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT_NS PM_QOS_LATENCY_ANY_NS
3636 #define PM_QOS_LATENCY_TOLERANCE_DEFAULT_VALUE 0
37+#define PM_QOS_MIN_FREQUENCY_DEFAULT_VALUE 0
38+#define PM_QOS_MAX_FREQUENCY_DEFAULT_VALUE FREQ_QOS_MAX_DEFAULT_VALUE
3739 #define PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT (-1)
3840
3941 #define PM_QOS_FLAG_NO_POWER_OFF (1 << 0)
@@ -49,21 +51,6 @@ struct pm_qos_flags_request { · 9 unmodified lines
4951 s32 flags; /* Do not change to 64 bit */
5052 };
5153
52−enum dev_pm_qos_req_type {
53− DEV_PM_QOS_RESUME_LATENCY = 1,
54− DEV_PM_QOS_LATENCY_TOLERANCE,
55− DEV_PM_QOS_FLAGS,
56−};
57−
58−struct dev_pm_qos_request {
59− enum dev_pm_qos_req_type type;
60− union {
61− struct plist_node pnode;
62− struct pm_qos_flags_request flr;
63− } data;
64− struct device *dev;
65−};
66−
6754 enum pm_qos_type {
6855 PM_QOS_UNITIALIZED,
6956 PM_QOS_MAX, /* return the largest value */
@@ -90,9 +77,51 @@ struct pm_qos_flags { · 20 unmodified lines
9077 s32 effective_flags; /* Do not change to 64 bit */
9178 };
9279
80+
81+#define FREQ_QOS_MIN_DEFAULT_VALUE 0
82+#define FREQ_QOS_MAX_DEFAULT_VALUE S32_MAX
83+
84+enum freq_qos_req_type {
85+ FREQ_QOS_MIN = 1,
86+ FREQ_QOS_MAX,
87+};
88+
89+struct freq_constraints {
90+ struct pm_qos_constraints min_freq;
91+ struct blocking_notifier_head min_freq_notifiers;
92+ struct pm_qos_constraints max_freq;
93+ struct blocking_notifier_head max_freq_notifiers;
94+};
95+
96+struct freq_qos_request {
97+ enum freq_qos_req_type type;
98+ struct plist_node pnode;
99+ struct freq_constraints *qos;
100+};
101+
102+
103+enum dev_pm_qos_req_type {
104+ DEV_PM_QOS_RESUME_LATENCY = 1,
105+ DEV_PM_QOS_LATENCY_TOLERANCE,
106+ DEV_PM_QOS_MIN_FREQUENCY,
107+ DEV_PM_QOS_MAX_FREQUENCY,
108+ DEV_PM_QOS_FLAGS,
109+};
110+
111+struct dev_pm_qos_request {
112+ enum dev_pm_qos_req_type type;
113+ union {
114+ struct plist_node pnode;
115+ struct pm_qos_flags_request flr;
116+ struct freq_qos_request freq;
117+ } data;
118+ struct device *dev;
119+};
120+
93121 struct dev_pm_qos {
94122 struct pm_qos_constraints resume_latency;
95123 struct pm_qos_constraints latency_tolerance;
124+ struct freq_constraints freq;
96125 struct pm_qos_flags flags;
97126 struct dev_pm_qos_request *resume_latency_req;
98127 struct dev_pm_qos_request *latency_tolerance_req;
@@ -191,6 +220,10 @@ static inline s32 dev_pm_qos_read_value(struct device *dev, · 92 unmodified lines
191220 switch (type) {
192221 case DEV_PM_QOS_RESUME_LATENCY:
193222 return PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
223+ case DEV_PM_QOS_MIN_FREQUENCY:
224+ return PM_QOS_MIN_FREQUENCY_DEFAULT_VALUE;
225+ case DEV_PM_QOS_MAX_FREQUENCY:
226+ return PM_QOS_MAX_FREQUENCY_DEFAULT_VALUE;
194227 default:
195228 WARN_ON(1);
196229 return 0;
@@ -255,27 +288,6 @@ static inline s32 dev_pm_qos_raw_resume_latency(struct device *dev) · 58 unmodified lines
255288 }
256289 #endif
257290
258−#define FREQ_QOS_MIN_DEFAULT_VALUE 0
259−#define FREQ_QOS_MAX_DEFAULT_VALUE (-1)
260−
261−enum freq_qos_req_type {
262− FREQ_QOS_MIN = 1,
263− FREQ_QOS_MAX,
264−};
265−
266−struct freq_constraints {
267− struct pm_qos_constraints min_freq;
268− struct blocking_notifier_head min_freq_notifiers;
269− struct pm_qos_constraints max_freq;
270− struct blocking_notifier_head max_freq_notifiers;
271−};
272−
273−struct freq_qos_request {
274− enum freq_qos_req_type type;
275− struct plist_node pnode;
276− struct freq_constraints *qos;
277−};
278−
279291 static inline int freq_qos_request_active(struct freq_qos_request *req)
280292 {
281293 return !IS_ERR_OR_NULL(req->qos);
@@ -291,6 +303,8 @@ int freq_qos_add_request(struct freq_constraints *qos, · 9 unmodified lines
291303 enum freq_qos_req_type type, s32 value);
292304 int freq_qos_update_request(struct freq_qos_request *req, s32 new_value);
293305 int freq_qos_remove_request(struct freq_qos_request *req);
306+int freq_qos_apply(struct freq_qos_request *req,
307+ enum pm_qos_req_action action, s32 value);
294308
295309 int freq_qos_add_notifier(struct freq_constraints *qos,
296310 enum freq_qos_req_type type,
include/linux/pm_wakeup.h+9−0
@@ -63,6 +63,11 @@ struct wakeup_source { · 62 unmodified lines
6363 bool autosleep_enabled:1;
6464 };
6565
66+#define for_each_wakeup_source(ws) \
67+ for ((ws) = wakeup_sources_walk_start(); \
68+ (ws); \
69+ (ws) = wakeup_sources_walk_next((ws)))
70+
6671 #ifdef CONFIG_PM_SLEEP
6772
6873 /*
@@ -92,6 +97,10 @@ extern void wakeup_source_remove(struct wakeup_source *ws); · 23 unmodified lines
9297 extern struct wakeup_source *wakeup_source_register(struct device *dev,
9398 const char *name);
9499 extern void wakeup_source_unregister(struct wakeup_source *ws);
100+extern int wakeup_sources_read_lock(void);
101+extern void wakeup_sources_read_unlock(int idx);
102+extern struct wakeup_source *wakeup_sources_walk_start(void);
103+extern struct wakeup_source *wakeup_sources_walk_next(struct wakeup_source *ws);
95104 extern int device_wakeup_enable(struct device *dev);
96105 extern int device_wakeup_disable(struct device *dev);
97106 extern void device_set_wakeup_capable(struct device *dev, bool capable);
include/linux/power/smartreflex.h+3−0
@@ -293,6 +293,9 @@ struct omap_sr_data { · 292 unmodified lines
293293 struct voltagedomain *voltdm;
294294 };
295295
296+
297+extern struct omap_sr_data omap_sr_pdata[OMAP_SR_NR];
298+
296299 #ifdef CONFIG_POWER_AVS_OMAP
297300
298301 /* Smartreflex module enable/disable interface */
include/linux/printk.h+1−2
@@ -302,9 +302,8 @@ extern int kptr_restrict; · 301 unmodified lines
302302 printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
303303 #define pr_err(fmt, ...) \
304304 printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
305−#define pr_warning(fmt, ...) \
305+#define pr_warn(fmt, ...) \
306306 printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
307−#define pr_warn pr_warning
308307 #define pr_notice(fmt, ...) \
309308 printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
310309 #define pr_info(fmt, ...) \
include/linux/proc_fs.h+2−2
@@ -58,8 +58,8 @@ extern int remove_proc_subtree(const char *, struct proc_dir_entry *); · 57 unmodified lines
5858 struct proc_dir_entry *proc_create_net_data(const char *name, umode_t mode,
5959 struct proc_dir_entry *parent, const struct seq_operations *ops,
6060 unsigned int state_size, void *data);
61−#define proc_create_net(name, mode, parent, state_size, ops) \
62− proc_create_net_data(name, mode, parent, state_size, ops, NULL)
61+#define proc_create_net(name, mode, parent, ops, state_size) \
62+ proc_create_net_data(name, mode, parent, ops, state_size, NULL)
6363 struct proc_dir_entry *proc_create_net_single(const char *name, umode_t mode,
6464 struct proc_dir_entry *parent,
6565 int (*show)(struct seq_file *, void *), void *data);
include/linux/property.h+53−53
@@ -22,7 +22,6 @@ enum dev_prop_type { · 21 unmodified lines
2222 DEV_PROP_U32,
2323 DEV_PROP_U64,
2424 DEV_PROP_STRING,
25− DEV_PROP_MAX,
2625 };
2726
2827 enum dev_dma_attr {
@@ -80,9 +79,14 @@ struct fwnode_handle *fwnode_find_reference(const struct fwnode_handle *fwnode, · 51 unmodified lines
8079 const char *name,
8180 unsigned int index);
8281
82+const char *fwnode_get_name(const struct fwnode_handle *fwnode);
83+const char *fwnode_get_name_prefix(const struct fwnode_handle *fwnode);
8384 struct fwnode_handle *fwnode_get_parent(const struct fwnode_handle *fwnode);
8485 struct fwnode_handle *fwnode_get_next_parent(
8586 struct fwnode_handle *fwnode);
87+unsigned int fwnode_count_parents(const struct fwnode_handle *fwn);
88+struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwn,
89+ unsigned int depth);
8690 struct fwnode_handle *fwnode_get_next_child_node(
8791 const struct fwnode_handle *fwnode, struct fwnode_handle *child);
8892 struct fwnode_handle *fwnode_get_next_available_child_node(
@@ -234,13 +238,7 @@ struct property_entry { · 145 unmodified lines
234238 bool is_array;
235239 enum dev_prop_type type;
236240 union {
237− union {
238− const u8 *u8_data;
239− const u16 *u16_data;
240− const u32 *u32_data;
241− const u64 *u64_data;
242− const char * const *str;
243− } pointer;
241+ const void *pointer;
244242 union {
245243 u8 u8_data;
246244 u16 u16_data;
@@ -252,62 +250,63 @@ struct property_entry { · 5 unmodified lines
252250 };
253251
254252 /*
255− * Note: the below four initializers for the anonymous union are carefully
253+ * Note: the below initializers for the anonymous union are carefully
256254 * crafted to avoid gcc-4.4.4's problems with initialization of anon unions
257255 * and structs.
258256 */
259257
260−#define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _Type_, _val_) \
258+#define __PROPERTY_ENTRY_ELEMENT_SIZE(_elem_) \
259+ sizeof(((struct property_entry *)NULL)->value._elem_)
260+
261+#define __PROPERTY_ENTRY_ARRAY_LEN(_name_, _elem_, _Type_, _val_, _len_)\
261262 (struct property_entry) { \
262263 .name = _name_, \
263− .length = ARRAY_SIZE(_val_) * sizeof(_type_), \
264+ .length = (_len_) * __PROPERTY_ENTRY_ELEMENT_SIZE(_elem_), \
264265 .is_array = true, \
265266 .type = DEV_PROP_##_Type_, \
266− { .pointer = { ._type_##_data = _val_ } }, \
267+ { .pointer = _val_ }, \
267268 }
268269
269−#define PROPERTY_ENTRY_U8_ARRAY(_name_, _val_) \
270− PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u8, U8, _val_)
271−#define PROPERTY_ENTRY_U16_ARRAY(_name_, _val_) \
272− PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u16, U16, _val_)
273−#define PROPERTY_ENTRY_U32_ARRAY(_name_, _val_) \
274− PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u32, U32, _val_)
275−#define PROPERTY_ENTRY_U64_ARRAY(_name_, _val_) \
276− PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, U64, _val_)
277−
278−#define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \
279−(struct property_entry) { \
280− .name = _name_, \
281− .length = ARRAY_SIZE(_val_) * sizeof(const char *), \
282− .is_array = true, \
283− .type = DEV_PROP_STRING, \
284− { .pointer = { .str = _val_ } }, \
285−}
286−
287−#define PROPERTY_ENTRY_INTEGER(_name_, _type_, _Type_, _val_) \
288−(struct property_entry) { \
289− .name = _name_, \
290− .length = sizeof(_type_), \
291− .type = DEV_PROP_##_Type_, \
292− { .value = { ._type_##_data = _val_ } }, \
270+#define PROPERTY_ENTRY_U8_ARRAY_LEN(_name_, _val_, _len_) \
271+ __PROPERTY_ENTRY_ARRAY_LEN(_name_, u8_data, U8, _val_, _len_)
272+#define PROPERTY_ENTRY_U16_ARRAY_LEN(_name_, _val_, _len_) \
273+ __PROPERTY_ENTRY_ARRAY_LEN(_name_, u16_data, U16, _val_, _len_)
274+#define PROPERTY_ENTRY_U32_ARRAY_LEN(_name_, _val_, _len_) \
275+ __PROPERTY_ENTRY_ARRAY_LEN(_name_, u32_data, U32, _val_, _len_)
276+#define PROPERTY_ENTRY_U64_ARRAY_LEN(_name_, _val_, _len_) \
277+ __PROPERTY_ENTRY_ARRAY_LEN(_name_, u64_data, U64, _val_, _len_)
278+#define PROPERTY_ENTRY_STRING_ARRAY_LEN(_name_, _val_, _len_) \
279+ __PROPERTY_ENTRY_ARRAY_LEN(_name_, str, STRING, _val_, _len_)
280+
281+#define PROPERTY_ENTRY_U8_ARRAY(_name_, _val_) \
282+ PROPERTY_ENTRY_U8_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_))
283+#define PROPERTY_ENTRY_U16_ARRAY(_name_, _val_) \
284+ PROPERTY_ENTRY_U16_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_))
285+#define PROPERTY_ENTRY_U32_ARRAY(_name_, _val_) \
286+ PROPERTY_ENTRY_U32_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_))
287+#define PROPERTY_ENTRY_U64_ARRAY(_name_, _val_) \
288+ PROPERTY_ENTRY_U64_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_))
289+#define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \
290+ PROPERTY_ENTRY_STRING_ARRAY_LEN(_name_, _val_, ARRAY_SIZE(_val_))
291+
292+#define __PROPERTY_ENTRY_ELEMENT(_name_, _elem_, _Type_, _val_) \
293+(struct property_entry) { \
294+ .name = _name_, \
295+ .length = __PROPERTY_ENTRY_ELEMENT_SIZE(_elem_), \
296+ .type = DEV_PROP_##_Type_, \
297+ { .value = { ._elem_ = _val_ } }, \
293298 }
294299
295−#define PROPERTY_ENTRY_U8(_name_, _val_) \
296− PROPERTY_ENTRY_INTEGER(_name_, u8, U8, _val_)
297−#define PROPERTY_ENTRY_U16(_name_, _val_) \
298− PROPERTY_ENTRY_INTEGER(_name_, u16, U16, _val_)
299−#define PROPERTY_ENTRY_U32(_name_, _val_) \
300− PROPERTY_ENTRY_INTEGER(_name_, u32, U32, _val_)
301−#define PROPERTY_ENTRY_U64(_name_, _val_) \
302− PROPERTY_ENTRY_INTEGER(_name_, u64, U64, _val_)
303−
304−#define PROPERTY_ENTRY_STRING(_name_, _val_) \
305−(struct property_entry) { \
306− .name = _name_, \
307− .length = sizeof(const char *), \
308− .type = DEV_PROP_STRING, \
309− { .value = { .str = _val_ } }, \
310−}
300+#define PROPERTY_ENTRY_U8(_name_, _val_) \
301+ __PROPERTY_ENTRY_ELEMENT(_name_, u8_data, U8, _val_)
302+#define PROPERTY_ENTRY_U16(_name_, _val_) \
303+ __PROPERTY_ENTRY_ELEMENT(_name_, u16_data, U16, _val_)
304+#define PROPERTY_ENTRY_U32(_name_, _val_) \
305+ __PROPERTY_ENTRY_ELEMENT(_name_, u32_data, U32, _val_)
306+#define PROPERTY_ENTRY_U64(_name_, _val_) \
307+ __PROPERTY_ENTRY_ELEMENT(_name_, u64_data, U64, _val_)
308+#define PROPERTY_ENTRY_STRING(_name_, _val_) \
309+ __PROPERTY_ENTRY_ELEMENT(_name_, str, STRING, _val_)
311310
312311 #define PROPERTY_ENTRY_BOOL(_name_) \
313312 (struct property_entry) { \
@@ -418,7 +417,8 @@ struct software_node { · 104 unmodified lines
418417 };
419418
420419 bool is_software_node(const struct fwnode_handle *fwnode);
421−const struct software_node *to_software_node(struct fwnode_handle *fwnode);
420+const struct software_node *
421+to_software_node(const struct fwnode_handle *fwnode);
422422 struct fwnode_handle *software_node_fwnode(const struct software_node *node);
423423
424424 const struct software_node *
include/linux/psci.h+2−7
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #ifndef __LINUX_PSCI_H
88 #define __LINUX_PSCI_H
99
10+#include <linux/arm-smccc.h>
1011 #include <linux/init.h>
1112 #include <linux/types.h>
1213
@@ -18,12 +19,6 @@ bool psci_tos_resident_on(int cpu); · 5 unmodified lines
1819 int psci_cpu_suspend_enter(u32 state);
1920 bool psci_power_state_is_valid(u32 state);
2021
21−enum psci_conduit {
22− PSCI_CONDUIT_NONE,
23− PSCI_CONDUIT_SMC,
24− PSCI_CONDUIT_HVC,
25−};
26−
2722 enum smccc_version {
2823 SMCCC_VERSION_1_0,
2924 SMCCC_VERSION_1_1,
@@ -38,7 +33,7 @@ struct psci_operations { · 8 unmodified lines
3833 int (*affinity_info)(unsigned long target_affinity,
3934 unsigned long lowest_affinity_level);
4035 int (*migrate_info_type)(void);
41− enum psci_conduit conduit;
36+ enum arm_smccc_conduit conduit;
4237 enum smccc_version smccc_version;
4338 };
4439
include/linux/pwm.h+1−4
@@ -243,10 +243,7 @@ pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle, · 242 unmodified lines
243243 * @request: optional hook for requesting a PWM
244244 * @free: optional hook for freeing a PWM
245245 * @capture: capture and report PWM signal
246− * @apply: atomically apply a new PWM config. The state argument
247− * should be adjusted with the real hardware config (if the
248− * approximate the period or duty_cycle value, state should
249− * reflect it)
246+ * @apply: atomically apply a new PWM config
250247 * @get_state: get the current PWM state. This function is only
251248 * called once per PWM device when the PWM chip is
252249 * registered.
include/linux/pxa2xx_ssp.h+1−1
@@ -206,7 +206,7 @@ enum pxa_ssp_type { · 205 unmodified lines
206206 };
207207
208208 struct ssp_device {
209− struct platform_device *pdev;
209+ struct device *dev;
210210 struct list_head node;
211211
212212 struct clk *clk;
include/linux/qcom_scm.h+28−0
@@ -24,6 +24,26 @@ struct qcom_scm_vmperm { · 23 unmodified lines
2424 int perm;
2525 };
2626
27+enum qcom_scm_ocmem_client {
28+ QCOM_SCM_OCMEM_UNUSED_ID = 0x0,
29+ QCOM_SCM_OCMEM_GRAPHICS_ID,
30+ QCOM_SCM_OCMEM_VIDEO_ID,
31+ QCOM_SCM_OCMEM_LP_AUDIO_ID,
32+ QCOM_SCM_OCMEM_SENSORS_ID,
33+ QCOM_SCM_OCMEM_OTHER_OS_ID,
34+ QCOM_SCM_OCMEM_DEBUG_ID,
35+};
36+
37+enum qcom_scm_sec_dev_id {
38+ QCOM_SCM_MDSS_DEV_ID = 1,
39+ QCOM_SCM_OCMEM_DEV_ID = 5,
40+ QCOM_SCM_PCIE0_DEV_ID = 11,
41+ QCOM_SCM_PCIE1_DEV_ID = 12,
42+ QCOM_SCM_GFX_DEV_ID = 18,
43+ QCOM_SCM_UFS_DEV_ID = 19,
44+ QCOM_SCM_ICE_DEV_ID = 20,
45+};
46+
2747 #define QCOM_SCM_VMID_HLOS 0x3
2848 #define QCOM_SCM_VMID_MSS_MSA 0xF
2949 #define QCOM_SCM_VMID_WLAN 0x18
@@ -41,6 +61,11 @@ extern bool qcom_scm_is_available(void); · 11 unmodified lines
4161 extern bool qcom_scm_hdcp_available(void);
4262 extern int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt,
4363 u32 *resp);
64+extern bool qcom_scm_ocmem_lock_available(void);
65+extern int qcom_scm_ocmem_lock(enum qcom_scm_ocmem_client id, u32 offset,
66+ u32 size, u32 mode);
67+extern int qcom_scm_ocmem_unlock(enum qcom_scm_ocmem_client id, u32 offset,
68+ u32 size);
4469 extern bool qcom_scm_pas_supported(u32 peripheral);
4570 extern int qcom_scm_pas_init_image(u32 peripheral, const void *metadata,
4671 size_t size);
@@ -55,9 +80,11 @@ extern int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz, · 8 unmodified lines
5580 extern void qcom_scm_cpu_power_down(u32 flags);
5681 extern u32 qcom_scm_get_version(void);
5782 extern int qcom_scm_set_remote_state(u32 state, u32 id);
83+extern bool qcom_scm_restore_sec_cfg_available(void);
5884 extern int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare);
5985 extern int qcom_scm_iommu_secure_ptbl_size(u32 spare, size_t *size);
6086 extern int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare);
87+extern int qcom_scm_qsmmu500_wait_safe_toggle(bool en);
6188 extern int qcom_scm_io_readl(phys_addr_t addr, unsigned int *val);
6289 extern int qcom_scm_io_writel(phys_addr_t addr, unsigned int val);
6390 #else
@@ -97,6 +124,7 @@ qcom_scm_set_remote_state(u32 state,u32 id) { return -ENODEV; } · 33 unmodified lines
97124 static inline int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare) { return -ENODEV; }
98125 static inline int qcom_scm_iommu_secure_ptbl_size(u32 spare, size_t *size) { return -ENODEV; }
99126 static inline int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare) { return -ENODEV; }
127+static inline int qcom_scm_qsmmu500_wait_safe_toggle(bool en) { return -ENODEV; }
100128 static inline int qcom_scm_io_readl(phys_addr_t addr, unsigned int *val) { return -ENODEV; }
101129 static inline int qcom_scm_io_writel(phys_addr_t addr, unsigned int val) { return -ENODEV; }
102130 #endif
include/linux/quota.h+1−1
@@ -263,7 +263,7 @@ enum { · 262 unmodified lines
263263 };
264264
265265 struct dqstats {
266− int stat[_DQST_DQSTAT_LAST];
266+ unsigned long stat[_DQST_DQSTAT_LAST];
267267 struct percpu_counter counter[_DQST_DQSTAT_LAST];
268268 };
269269
include/linux/quotaops.h+13−1
@@ -54,6 +54,16 @@ static inline struct dquot *dqgrab(struct dquot *dquot) · 53 unmodified lines
5454 atomic_inc(&dquot->dq_count);
5555 return dquot;
5656 }
57+
58+static inline bool dquot_is_busy(struct dquot *dquot)
59+{
60+ if (test_bit(DQ_MOD_B, &dquot->dq_flags))
61+ return true;
62+ if (atomic_read(&dquot->dq_count) > 1)
63+ return true;
64+ return false;
65+}
66+
5767 void dqput(struct dquot *dquot);
5868 int dquot_scan_active(struct super_block *sb,
5969 int (*fn)(struct dquot *dquot, unsigned long priv),
@@ -87,7 +97,9 @@ int dquot_mark_dquot_dirty(struct dquot *dquot); · 27 unmodified lines
8797
8898 int dquot_file_open(struct inode *inode, struct file *file);
8999
90−int dquot_enable(struct inode *inode, int type, int format_id,
100+int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,
101+ unsigned int flags);
102+int dquot_load_quota_inode(struct inode *inode, int type, int format_id,
91103 unsigned int flags);
92104 int dquot_quota_on(struct super_block *sb, int type, int format_id,
93105 const struct path *path);
include/linux/rbtree_augmented.h+2−4
@@ -283,14 +283,12 @@ __rb_erase_augmented(struct rb_node *node, struct rb_root *root, · 282 unmodified lines
283283 __rb_change_child(node, successor, tmp, root);
284284
285285 if (child2) {
286− successor->__rb_parent_color = pc;
287286 rb_set_parent_color(child2, parent, RB_BLACK);
288287 rebalance = NULL;
289288 } else {
290− unsigned long pc2 = successor->__rb_parent_color;
291− successor->__rb_parent_color = pc;
292− rebalance = __rb_is_black(pc2) ? parent : NULL;
289+ rebalance = rb_is_black(successor) ? parent : NULL;
293290 }
291+ successor->__rb_parent_color = pc;
294292 tmp = successor;
295293 }
296294
include/linux/rculist_bl.h+0−28
@@ -24,34 +24,6 @@ static inline struct hlist_bl_node *hlist_bl_first_rcu(struct hlist_bl_head *h) · 23 unmodified lines
2424 ((unsigned long)rcu_dereference_check(h->first, hlist_bl_is_locked(h)) & ~LIST_BL_LOCKMASK);
2525 }
2626
27−/**
28− * hlist_bl_del_init_rcu - deletes entry from hash list with re-initialization
29− * @n: the element to delete from the hash list.
30− *
31− * Note: hlist_bl_unhashed() on the node returns true after this. It is
32− * useful for RCU based read lockfree traversal if the writer side
33− * must know if the list entry is still hashed or already unhashed.
34− *
35− * In particular, it means that we can not poison the forward pointers
36− * that may still be used for walking the hash list and we can only
37− * zero the pprev pointer so list_unhashed() will return true after
38− * this.
39− *
40− * The caller must take whatever precautions are necessary (such as
41− * holding appropriate locks) to avoid racing with another
42− * list-mutation primitive, such as hlist_bl_add_head_rcu() or
43− * hlist_bl_del_rcu(), running on this same list. However, it is
44− * perfectly legal to run concurrently with the _rcu list-traversal
45− * primitives, such as hlist_bl_for_each_entry_rcu().
46− */
47−static inline void hlist_bl_del_init_rcu(struct hlist_bl_node *n)
48−{
49− if (!hlist_bl_unhashed(n)) {
50− __hlist_bl_del(n);
51− n->pprev = NULL;
52− }
53−}
54−
5527 /**
5628 * hlist_bl_del_rcu - deletes entry from hash list without re-initialization
5729 * @n: the element to delete from the hash list.
include/linux/rculist_nulls.h+37−0
@@ -100,6 +100,43 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n, · 99 unmodified lines
100100 first->pprev = &n->next;
101101 }
102102
103+/**
104+ * hlist_nulls_add_tail_rcu
105+ * @n: the element to add to the hash list.
106+ * @h: the list to add to.
107+ *
108+ * Description:
109+ * Adds the specified element to the specified hlist_nulls,
110+ * while permitting racing traversals.
111+ *
112+ * The caller must take whatever precautions are necessary
113+ * (such as holding appropriate locks) to avoid racing
114+ * with another list-mutation primitive, such as hlist_nulls_add_head_rcu()
115+ * or hlist_nulls_del_rcu(), running on this same list.
116+ * However, it is perfectly legal to run concurrently with
117+ * the _rcu list-traversal primitives, such as
118+ * hlist_nulls_for_each_entry_rcu(), used to prevent memory-consistency
119+ * problems on Alpha CPUs. Regardless of the type of CPU, the
120+ * list-traversal primitive must be guarded by rcu_read_lock().
121+ */
122+static inline void hlist_nulls_add_tail_rcu(struct hlist_nulls_node *n,
123+ struct hlist_nulls_head *h)
124+{
125+ struct hlist_nulls_node *i, *last = NULL;
126+
127+ /* Note: write side code, so rcu accessors are not needed. */
128+ for (i = h->first; !is_a_nulls(i); i = i->next)
129+ last = i;
130+
131+ if (last) {
132+ n->next = last->next;
133+ n->pprev = &last->next;
134+ rcu_assign_pointer(hlist_next_rcu(last), n);
135+ } else {
136+ hlist_nulls_add_head_rcu(n, h);
137+ }
138+}
139+
103140 /**
104141 * hlist_nulls_for_each_entry_rcu - iterate over rcu list of given type
105142 * @tpos: the type * to use as a loop cursor.
include/linux/rcupdate.h+19−1
@@ -210,7 +210,7 @@ static inline void rcu_lock_acquire(struct lockdep_map *map) · 209 unmodified lines
210210
211211 static inline void rcu_lock_release(struct lockdep_map *map)
212212 {
213− lock_release(map, 1, _THIS_IP_);
213+ lock_release(map, _THIS_IP_);
214214 }
215215
216216 extern struct lockdep_map rcu_lock_map;
@@ -382,6 +382,24 @@ do { \ · 165 unmodified lines
382382 smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
383383 } while (0)
384384
385+/**
386+ * rcu_replace_pointer() - replace an RCU pointer, returning its old value
387+ * @rcu_ptr: RCU pointer, whose old value is returned
388+ * @ptr: regular pointer
389+ * @c: the lockdep conditions under which the dereference will take place
390+ *
391+ * Perform a replacement, where @rcu_ptr is an RCU-annotated
392+ * pointer and @c is the lockdep argument that is passed to the
393+ * rcu_dereference_protected() call used to read that pointer. The old
394+ * value of @rcu_ptr is returned, and @rcu_ptr is set to @ptr.
395+ */
396+#define rcu_replace_pointer(rcu_ptr, ptr, c) \
397+({ \
398+ typeof(ptr) __tmp = rcu_dereference_protected((rcu_ptr), (c)); \
399+ rcu_assign_pointer((rcu_ptr), (ptr)); \
400+ __tmp; \
401+})
402+
385403 /**
386404 * rcu_swap_protected() - swap an RCU and a regular pointer
387405 * @rcu_ptr: RCU pointer
include/linux/rcutiny.h+1−0
@@ -84,6 +84,7 @@ static inline void rcu_scheduler_starting(void) { } · 83 unmodified lines
8484 #endif /* #else #ifndef CONFIG_SRCU */
8585 static inline void rcu_end_inkernel_boot(void) { }
8686 static inline bool rcu_is_watching(void) { return true; }
87+static inline void rcu_momentary_dyntick_idle(void) { }
8788
8889 /* Avoid RCU read-side critical sections leaking across. */
8990 static inline void rcu_all_qs(void) { barrier(); }
include/linux/rcutree.h+1−0
@@ -37,6 +37,7 @@ void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func); · 36 unmodified lines
3737
3838 void rcu_barrier(void);
3939 bool rcu_eqs_special_set(int cpu);
40+void rcu_momentary_dyntick_idle(void);
4041 unsigned long get_state_synchronize_rcu(void);
4142 void cond_synchronize_rcu(unsigned long oldstate);
4243
include/linux/refcount.h+229−40
@@ -1,9 +1,88 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Variant of atomic_t specialized for reference counts.
4+ *
5+ * The interface matches the atomic_t interface (to aid in porting) but only
6+ * provides the few functions one should use for reference counting.
7+ *
8+ * Saturation semantics
9+ * ====================
10+ *
11+ * refcount_t differs from atomic_t in that the counter saturates at
12+ * REFCOUNT_SATURATED and will not move once there. This avoids wrapping the
13+ * counter and causing 'spurious' use-after-free issues. In order to avoid the
14+ * cost associated with introducing cmpxchg() loops into all of the saturating
15+ * operations, we temporarily allow the counter to take on an unchecked value
16+ * and then explicitly set it to REFCOUNT_SATURATED on detecting that underflow
17+ * or overflow has occurred. Although this is racy when multiple threads
18+ * access the refcount concurrently, by placing REFCOUNT_SATURATED roughly
19+ * equidistant from 0 and INT_MAX we minimise the scope for error:
20+ *
21+ * INT_MAX REFCOUNT_SATURATED UINT_MAX
22+ * 0 (0x7fff_ffff) (0xc000_0000) (0xffff_ffff)
23+ * +--------------------------------+----------------+----------------+
24+ * <---------- bad value! ---------->
25+ *
26+ * (in a signed view of the world, the "bad value" range corresponds to
27+ * a negative counter value).
28+ *
29+ * As an example, consider a refcount_inc() operation that causes the counter
30+ * to overflow:
31+ *
32+ * int old = atomic_fetch_add_relaxed(r);
33+ * // old is INT_MAX, refcount now INT_MIN (0x8000_0000)
34+ * if (old < 0)
35+ * atomic_set(r, REFCOUNT_SATURATED);
36+ *
37+ * If another thread also performs a refcount_inc() operation between the two
38+ * atomic operations, then the count will continue to edge closer to 0. If it
39+ * reaches a value of 1 before /any/ of the threads reset it to the saturated
40+ * value, then a concurrent refcount_dec_and_test() may erroneously free the
41+ * underlying object. Given the precise timing details involved with the
42+ * round-robin scheduling of each thread manipulating the refcount and the need
43+ * to hit the race multiple times in succession, there doesn't appear to be a
44+ * practical avenue of attack even if using refcount_add() operations with
45+ * larger increments.
46+ *
47+ * Memory ordering
48+ * ===============
49+ *
50+ * Memory ordering rules are slightly relaxed wrt regular atomic_t functions
51+ * and provide only what is strictly required for refcounts.
52+ *
53+ * The increments are fully relaxed; these will not provide ordering. The
54+ * rationale is that whatever is used to obtain the object we're increasing the
55+ * reference count on will provide the ordering. For locked data structures,
56+ * its the lock acquire, for RCU/lockless data structures its the dependent
57+ * load.
58+ *
59+ * Do note that inc_not_zero() provides a control dependency which will order
60+ * future stores against the inc, this ensures we'll never modify the object
61+ * if we did not in fact acquire a reference.
62+ *
63+ * The decrements will provide release order, such that all the prior loads and
64+ * stores will be issued before, it also provides a control dependency, which
65+ * will order us against the subsequent free().
66+ *
67+ * The control dependency is against the load of the cmpxchg (ll/sc) that
68+ * succeeded. This means the stores aren't fully ordered, but this is fine
69+ * because the 1->0 transition indicates no concurrency.
70+ *
71+ * Note that the allocator is responsible for ordering things between free()
72+ * and alloc().
73+ *
74+ * The decrements dec_and_test() and sub_and_test() also provide acquire
75+ * ordering on success.
76+ *
77+ */
78+
279 #ifndef _LINUX_REFCOUNT_H
380 #define _LINUX_REFCOUNT_H
481
582 #include <linux/atomic.h>
83+#include <linux/bug.h>
684 #include <linux/compiler.h>
85+#include <linux/limits.h>
786 #include <linux/spinlock_types.h>
887
988 struct mutex;
@@ -12,7 +91,7 @@ struct mutex; · 2 unmodified lines
1291 * struct refcount_t - variant of atomic_t specialized for reference counts
1392 * @refs: atomic_t counter field
1493 *
15− * The counter saturates at UINT_MAX and will not move once
94+ * The counter saturates at REFCOUNT_SATURATED and will not move once
1695 * there. This avoids wrapping the counter and causing 'spurious'
1796 * use-after-free bugs.
1897 */
@@ -21,13 +100,25 @@ typedef struct refcount_struct { · 2 unmodified lines
21100 } refcount_t;
22101
23102 #define REFCOUNT_INIT(n) { .refs = ATOMIC_INIT(n), }
103+#define REFCOUNT_MAX INT_MAX
104+#define REFCOUNT_SATURATED (INT_MIN / 2)
105+
106+enum refcount_saturation_type {
107+ REFCOUNT_ADD_NOT_ZERO_OVF,
108+ REFCOUNT_ADD_OVF,
109+ REFCOUNT_ADD_UAF,
110+ REFCOUNT_SUB_UAF,
111+ REFCOUNT_DEC_LEAK,
112+};
113+
114+void refcount_warn_saturate(refcount_t *r, enum refcount_saturation_type t);
24115
25116 /**
26117 * refcount_set - set a refcount's value
27118 * @r: the refcount
28119 * @n: value to which the refcount will be set
29120 */
30−static inline void refcount_set(refcount_t *r, unsigned int n)
121+static inline void refcount_set(refcount_t *r, int n)
31122 {
32123 atomic_set(&r->refs, n);
33124 }
@@ -43,70 +134,168 @@ static inline unsigned int refcount_read(const refcount_t *r) · 9 unmodified lines
43134 return atomic_read(&r->refs);
44135 }
45136
46−extern __must_check bool refcount_add_not_zero_checked(unsigned int i, refcount_t *r);
47−extern void refcount_add_checked(unsigned int i, refcount_t *r);
48−
49−extern __must_check bool refcount_inc_not_zero_checked(refcount_t *r);
50−extern void refcount_inc_checked(refcount_t *r);
51−
52−extern __must_check bool refcount_sub_and_test_checked(unsigned int i, refcount_t *r);
53−
54−extern __must_check bool refcount_dec_and_test_checked(refcount_t *r);
55−extern void refcount_dec_checked(refcount_t *r);
56−
57−#ifdef CONFIG_REFCOUNT_FULL
58−
59−#define refcount_add_not_zero refcount_add_not_zero_checked
60−#define refcount_add refcount_add_checked
61−
62−#define refcount_inc_not_zero refcount_inc_not_zero_checked
63−#define refcount_inc refcount_inc_checked
137+/**
138+ * refcount_add_not_zero - add a value to a refcount unless it is 0
139+ * @i: the value to add to the refcount
140+ * @r: the refcount
141+ *
142+ * Will saturate at REFCOUNT_SATURATED and WARN.
143+ *
144+ * Provides no memory ordering, it is assumed the caller has guaranteed the
145+ * object memory to be stable (RCU, etc.). It does provide a control dependency
146+ * and thereby orders future stores. See the comment on top.
147+ *
148+ * Use of this function is not recommended for the normal reference counting
149+ * use case in which references are taken and released one at a time. In these
150+ * cases, refcount_inc(), or one of its variants, should instead be used to
151+ * increment a reference count.
152+ *
153+ * Return: false if the passed refcount is 0, true otherwise
154+ */
155+static inline __must_check bool refcount_add_not_zero(int i, refcount_t *r)
156+{
157+ int old = refcount_read(r);
64158
65−#define refcount_sub_and_test refcount_sub_and_test_checked
159+ do {
160+ if (!old)
161+ break;
162+ } while (!atomic_try_cmpxchg_relaxed(&r->refs, &old, old + i));
66163
67−#define refcount_dec_and_test refcount_dec_and_test_checked
68−#define refcount_dec refcount_dec_checked
164+ if (unlikely(old < 0 || old + i < 0))
165+ refcount_warn_saturate(r, REFCOUNT_ADD_NOT_ZERO_OVF);
69166
70−#else
71−# ifdef CONFIG_ARCH_HAS_REFCOUNT
72−# include <asm/refcount.h>
73−# else
74−static inline __must_check bool refcount_add_not_zero(unsigned int i, refcount_t *r)
75−{
76− return atomic_add_unless(&r->refs, i, 0);
167+ return old;
77168 }
78169
79−static inline void refcount_add(unsigned int i, refcount_t *r)
170+/**
171+ * refcount_add - add a value to a refcount
172+ * @i: the value to add to the refcount
173+ * @r: the refcount
174+ *
175+ * Similar to atomic_add(), but will saturate at REFCOUNT_SATURATED and WARN.
176+ *
177+ * Provides no memory ordering, it is assumed the caller has guaranteed the
178+ * object memory to be stable (RCU, etc.). It does provide a control dependency
179+ * and thereby orders future stores. See the comment on top.
180+ *
181+ * Use of this function is not recommended for the normal reference counting
182+ * use case in which references are taken and released one at a time. In these
183+ * cases, refcount_inc(), or one of its variants, should instead be used to
184+ * increment a reference count.
185+ */
186+static inline void refcount_add(int i, refcount_t *r)
80187 {
81− atomic_add(i, &r->refs);
188+ int old = atomic_fetch_add_relaxed(i, &r->refs);
189+
190+ if (unlikely(!old))
191+ refcount_warn_saturate(r, REFCOUNT_ADD_UAF);
192+ else if (unlikely(old < 0 || old + i < 0))
193+ refcount_warn_saturate(r, REFCOUNT_ADD_OVF);
82194 }
83195
196+/**
197+ * refcount_inc_not_zero - increment a refcount unless it is 0
198+ * @r: the refcount to increment
199+ *
200+ * Similar to atomic_inc_not_zero(), but will saturate at REFCOUNT_SATURATED
201+ * and WARN.
202+ *
203+ * Provides no memory ordering, it is assumed the caller has guaranteed the
204+ * object memory to be stable (RCU, etc.). It does provide a control dependency
205+ * and thereby orders future stores. See the comment on top.
206+ *
207+ * Return: true if the increment was successful, false otherwise
208+ */
84209 static inline __must_check bool refcount_inc_not_zero(refcount_t *r)
85210 {
86− return atomic_add_unless(&r->refs, 1, 0);
211+ return refcount_add_not_zero(1, r);
87212 }
88213
214+/**
215+ * refcount_inc - increment a refcount
216+ * @r: the refcount to increment
217+ *
218+ * Similar to atomic_inc(), but will saturate at REFCOUNT_SATURATED and WARN.
219+ *
220+ * Provides no memory ordering, it is assumed the caller already has a
221+ * reference on the object.
222+ *
223+ * Will WARN if the refcount is 0, as this represents a possible use-after-free
224+ * condition.
225+ */
89226 static inline void refcount_inc(refcount_t *r)
90227 {
91− atomic_inc(&r->refs);
228+ refcount_add(1, r);
92229 }
93230
94−static inline __must_check bool refcount_sub_and_test(unsigned int i, refcount_t *r)
231+/**
232+ * refcount_sub_and_test - subtract from a refcount and test if it is 0
233+ * @i: amount to subtract from the refcount
234+ * @r: the refcount
235+ *
236+ * Similar to atomic_dec_and_test(), but it will WARN, return false and
237+ * ultimately leak on underflow and will fail to decrement when saturated
238+ * at REFCOUNT_SATURATED.
239+ *
240+ * Provides release memory ordering, such that prior loads and stores are done
241+ * before, and provides an acquire ordering on success such that free()
242+ * must come after.
243+ *
244+ * Use of this function is not recommended for the normal reference counting
245+ * use case in which references are taken and released one at a time. In these
246+ * cases, refcount_dec(), or one of its variants, should instead be used to
247+ * decrement a reference count.
248+ *
249+ * Return: true if the resulting refcount is 0, false otherwise
250+ */
251+static inline __must_check bool refcount_sub_and_test(int i, refcount_t *r)
95252 {
96− return atomic_sub_and_test(i, &r->refs);
253+ int old = atomic_fetch_sub_release(i, &r->refs);
254+
255+ if (old == i) {
256+ smp_acquire__after_ctrl_dep();
257+ return true;
258+ }
259+
260+ if (unlikely(old < 0 || old - i < 0))
261+ refcount_warn_saturate(r, REFCOUNT_SUB_UAF);
262+
263+ return false;
97264 }
98265
266+/**
267+ * refcount_dec_and_test - decrement a refcount and test if it is 0
268+ * @r: the refcount
269+ *
270+ * Similar to atomic_dec_and_test(), it will WARN on underflow and fail to
271+ * decrement when saturated at REFCOUNT_SATURATED.
272+ *
273+ * Provides release memory ordering, such that prior loads and stores are done
274+ * before, and provides an acquire ordering on success such that free()
275+ * must come after.
276+ *
277+ * Return: true if the resulting refcount is 0, false otherwise
278+ */
99279 static inline __must_check bool refcount_dec_and_test(refcount_t *r)
100280 {
101− return atomic_dec_and_test(&r->refs);
281+ return refcount_sub_and_test(1, r);
102282 }
103283
284+/**
285+ * refcount_dec - decrement a refcount
286+ * @r: the refcount
287+ *
288+ * Similar to atomic_dec(), it will WARN on underflow and fail to decrement
289+ * when saturated at REFCOUNT_SATURATED.
290+ *
291+ * Provides release memory ordering, such that prior loads and stores are done
292+ * before.
293+ */
104294 static inline void refcount_dec(refcount_t *r)
105295 {
106− atomic_dec(&r->refs);
296+ if (unlikely(atomic_fetch_sub_release(1, &r->refs) <= 1))
297+ refcount_warn_saturate(r, REFCOUNT_DEC_LEAK);
107298 }
108−# endif /* !CONFIG_ARCH_HAS_REFCOUNT */
109−#endif /* CONFIG_REFCOUNT_FULL */
110299
111300 extern __must_check bool refcount_dec_if_one(refcount_t *r);
112301 extern __must_check bool refcount_dec_not_one(refcount_t *r);
include/linux/regulator/ab8500.h+0−3
@@ -37,14 +37,11 @@ enum ab8505_regulator_id { · 36 unmodified lines
3737 AB8505_LDO_AUX6,
3838 AB8505_LDO_INTCORE,
3939 AB8505_LDO_ADC,
40− AB8505_LDO_USB,
4140 AB8505_LDO_AUDIO,
4241 AB8505_LDO_ANAMIC1,
4342 AB8505_LDO_ANAMIC2,
4443 AB8505_LDO_AUX8,
4544 AB8505_LDO_ANA,
46− AB8505_SYSCLKREQ_2,
47− AB8505_SYSCLKREQ_4,
4845 AB8505_NUM_REGULATORS,
4946 };
5047
include/linux/regulator/fixed.h+1−0
@@ -36,6 +36,7 @@ struct fixed_voltage_config { · 35 unmodified lines
3636 const char *input_supply;
3737 int microvolts;
3838 unsigned startup_delay;
39+ unsigned int off_on_delay;
3940 unsigned enabled_at_boot:1;
4041 struct regulator_init_data *init_data;
4142 };
include/linux/reset-controller.h+2−1
@@ -62,7 +62,8 @@ struct reset_control_lookup { · 61 unmodified lines
6262 * @of_node: corresponding device tree node as phandle target
6363 * @of_reset_n_cells: number of cells in reset line specifiers
6464 * @of_xlate: translation function to translate from specifier as found in the
65− * device tree to id as given to the reset control ops
65+ * device tree to id as given to the reset control ops, defaults
66+ * to :c:func:`of_reset_simple_xlate`.
6667 * @nr_resets: number of reset controls in this reset controller device
6768 */
6869 struct reset_controller_dev {
include/linux/reset.h+46−0
@@ -203,12 +203,34 @@ static inline struct reset_control *reset_control_get_shared( · 202 unmodified lines
203203 return __reset_control_get(dev, id, 0, true, false, false);
204204 }
205205
206+/**
207+ * reset_control_get_optional_exclusive - optional reset_control_get_exclusive()
208+ * @dev: device to be reset by the controller
209+ * @id: reset line name
210+ *
211+ * Optional variant of reset_control_get_exclusive(). If the requested reset
212+ * is not specified in the device tree, this function returns NULL instead of
213+ * an error.
214+ *
215+ * See reset_control_get_exclusive() for more information.
216+ */
206217 static inline struct reset_control *reset_control_get_optional_exclusive(
207218 struct device *dev, const char *id)
208219 {
209220 return __reset_control_get(dev, id, 0, false, true, true);
210221 }
211222
223+/**
224+ * reset_control_get_optional_shared - optional reset_control_get_shared()
225+ * @dev: device to be reset by the controller
226+ * @id: reset line name
227+ *
228+ * Optional variant of reset_control_get_shared(). If the requested reset
229+ * is not specified in the device tree, this function returns NULL instead of
230+ * an error.
231+ *
232+ * See reset_control_get_shared() for more information.
233+ */
212234 static inline struct reset_control *reset_control_get_optional_shared(
213235 struct device *dev, const char *id)
214236 {
@@ -354,12 +376,36 @@ static inline struct reset_control *devm_reset_control_get_shared( · 139 unmodified lines
354376 return __devm_reset_control_get(dev, id, 0, true, false, false);
355377 }
356378
379+/**
380+ * devm_reset_control_get_optional_exclusive - resource managed
381+ * reset_control_get_optional_exclusive()
382+ * @dev: device to be reset by the controller
383+ * @id: reset line name
384+ *
385+ * Managed reset_control_get_optional_exclusive(). For reset controllers
386+ * returned from this function, reset_control_put() is called automatically on
387+ * driver detach.
388+ *
389+ * See reset_control_get_optional_exclusive() for more information.
390+ */
357391 static inline struct reset_control *devm_reset_control_get_optional_exclusive(
358392 struct device *dev, const char *id)
359393 {
360394 return __devm_reset_control_get(dev, id, 0, false, true, true);
361395 }
362396
397+/**
398+ * devm_reset_control_get_optional_shared - resource managed
399+ * reset_control_get_optional_shared()
400+ * @dev: device to be reset by the controller
401+ * @id: reset line name
402+ *
403+ * Managed reset_control_get_optional_shared(). For reset controllers returned
404+ * from this function, reset_control_put() is called automatically on driver
405+ * detach.
406+ *
407+ * See reset_control_get_optional_shared() for more information.
408+ */
363409 static inline struct reset_control *devm_reset_control_get_optional_shared(
364410 struct device *dev, const char *id)
365411 {
include/linux/resource_ext.h+12−0
@@ -66,4 +66,16 @@ resource_list_destroy_entry(struct resource_entry *entry) · 65 unmodified lines
6666 #define resource_list_for_each_entry_safe(entry, tmp, list) \
6767 list_for_each_entry_safe((entry), (tmp), (list), node)
6868
69+static inline struct resource_entry *
70+resource_list_first_type(struct list_head *list, unsigned long type)
71+{
72+ struct resource_entry *entry;
73+
74+ resource_list_for_each_entry(entry, list) {
75+ if (resource_type(entry->res) == type)
76+ return entry;
77+ }
78+ return NULL;
79+}
80+
6981 #endif /* _LINUX_RESOURCE_EXT_H */
include/linux/rtc.h+5−0
@@ -159,11 +159,16 @@ struct rtc_device { · 158 unmodified lines
159159 };
160160 #define to_rtc_device(d) container_of(d, struct rtc_device, dev)
161161
162+#define rtc_lock(d) mutex_lock(&d->ops_lock)
163+#define rtc_unlock(d) mutex_unlock(&d->ops_lock)
164+
162165 /* useful timestamps */
166+#define RTC_TIMESTAMP_BEGIN_0000 -62167219200ULL /* 0000-01-01 00:00:00 */
163167 #define RTC_TIMESTAMP_BEGIN_1900 -2208988800LL /* 1900-01-01 00:00:00 */
164168 #define RTC_TIMESTAMP_BEGIN_2000 946684800LL /* 2000-01-01 00:00:00 */
165169 #define RTC_TIMESTAMP_END_2063 2966371199LL /* 2063-12-31 23:59:59 */
166170 #define RTC_TIMESTAMP_END_2099 4102444799LL /* 2099-12-31 23:59:59 */
171+#define RTC_TIMESTAMP_END_2199 7258118399LL /* 2199-12-31 23:59:59 */
167172 #define RTC_TIMESTAMP_END_9999 253402300799LL /* 9999-12-31 23:59:59 */
168173
169174 extern struct rtc_device *devm_rtc_device_register(struct device *dev,
include/linux/rtc/ds1685.h+5−7
@@ -42,14 +42,11 @@ · 41 unmodified lines
4242 struct ds1685_priv {
4343 struct rtc_device *dev;
4444 void __iomem *regs;
45+ void __iomem *data;
4546 u32 regstep;
46− resource_size_t baseaddr;
47− size_t size;
4847 int irq_num;
4948 bool bcd_mode;
5049 bool no_irq;
51− bool uie_unsupported;
52− bool alloc_io_resources;
5350 u8 (*read)(struct ds1685_priv *, int);
5451 void (*write)(struct ds1685_priv *, int, u8);
5552 void (*prepare_poweroff)(void);
@@ -74,12 +71,13 @@ struct ds1685_rtc_platform_data { · 18 unmodified lines
7471 const bool bcd_mode;
7572 const bool no_irq;
7673 const bool uie_unsupported;
77− const bool alloc_io_resources;
78− u8 (*plat_read)(struct ds1685_priv *, int);
79− void (*plat_write)(struct ds1685_priv *, int, u8);
8074 void (*plat_prepare_poweroff)(void);
8175 void (*plat_wake_alarm)(void);
8276 void (*plat_post_ram_clear)(void);
77+ enum {
78+ ds1685_reg_direct,
79+ ds1685_reg_indirect
80+ } access_type;
8381 };
8482
8583
include/linux/rtsx_pci.h+1−0
@@ -1262,6 +1262,7 @@ struct rtsx_pcr { · 1261 unmodified lines
12621262 #define PID_5250 0x5250
12631263 #define PID_525A 0x525A
12641264 #define PID_5260 0x5260
1265+#define PID_5261 0x5261
12651266
12661267 #define CHK_PCI_PID(pcr, pid) ((pcr)->pci->device == (pid))
12671268 #define PCI_VID(pcr) ((pcr)->pci->vendor)
include/linux/rwlock_api_smp.h+8−8
@@ -215,14 +215,14 @@ static inline void __raw_write_lock(rwlock_t *lock) · 214 unmodified lines
215215
216216 static inline void __raw_write_unlock(rwlock_t *lock)
217217 {
218− rwlock_release(&lock->dep_map, 1, _RET_IP_);
218+ rwlock_release(&lock->dep_map, _RET_IP_);
219219 do_raw_write_unlock(lock);
220220 preempt_enable();
221221 }
222222
223223 static inline void __raw_read_unlock(rwlock_t *lock)
224224 {
225− rwlock_release(&lock->dep_map, 1, _RET_IP_);
225+ rwlock_release(&lock->dep_map, _RET_IP_);
226226 do_raw_read_unlock(lock);
227227 preempt_enable();
228228 }
@@ -230,7 +230,7 @@ static inline void __raw_read_unlock(rwlock_t *lock) · 1 unmodified line
230230 static inline void
231231 __raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
232232 {
233− rwlock_release(&lock->dep_map, 1, _RET_IP_);
233+ rwlock_release(&lock->dep_map, _RET_IP_);
234234 do_raw_read_unlock(lock);
235235 local_irq_restore(flags);
236236 preempt_enable();
@@ -238,7 +238,7 @@ __raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) · 1 unmodified line
238238
239239 static inline void __raw_read_unlock_irq(rwlock_t *lock)
240240 {
241− rwlock_release(&lock->dep_map, 1, _RET_IP_);
241+ rwlock_release(&lock->dep_map, _RET_IP_);
242242 do_raw_read_unlock(lock);
243243 local_irq_enable();
244244 preempt_enable();
@@ -246,7 +246,7 @@ static inline void __raw_read_unlock_irq(rwlock_t *lock) · 1 unmodified line
246246
247247 static inline void __raw_read_unlock_bh(rwlock_t *lock)
248248 {
249− rwlock_release(&lock->dep_map, 1, _RET_IP_);
249+ rwlock_release(&lock->dep_map, _RET_IP_);
250250 do_raw_read_unlock(lock);
251251 __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET);
252252 }
@@ -254,7 +254,7 @@ static inline void __raw_read_unlock_bh(rwlock_t *lock) · 1 unmodified line
254254 static inline void __raw_write_unlock_irqrestore(rwlock_t *lock,
255255 unsigned long flags)
256256 {
257− rwlock_release(&lock->dep_map, 1, _RET_IP_);
257+ rwlock_release(&lock->dep_map, _RET_IP_);
258258 do_raw_write_unlock(lock);
259259 local_irq_restore(flags);
260260 preempt_enable();
@@ -262,7 +262,7 @@ static inline void __raw_write_unlock_irqrestore(rwlock_t *lock, · 1 unmodified line
262262
263263 static inline void __raw_write_unlock_irq(rwlock_t *lock)
264264 {
265− rwlock_release(&lock->dep_map, 1, _RET_IP_);
265+ rwlock_release(&lock->dep_map, _RET_IP_);
266266 do_raw_write_unlock(lock);
267267 local_irq_enable();
268268 preempt_enable();
@@ -270,7 +270,7 @@ static inline void __raw_write_unlock_irq(rwlock_t *lock) · 1 unmodified line
270270
271271 static inline void __raw_write_unlock_bh(rwlock_t *lock)
272272 {
273− rwlock_release(&lock->dep_map, 1, _RET_IP_);
273+ rwlock_release(&lock->dep_map, _RET_IP_);
274274 do_raw_write_unlock(lock);
275275 __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET);
276276 }
include/linux/sbitmap.h+0−9
@@ -216,15 +216,6 @@ int sbitmap_get_shallow(struct sbitmap *sb, unsigned int alloc_hint, · 215 unmodified lines
216216 */
217217 bool sbitmap_any_bit_set(const struct sbitmap *sb);
218218
219−/**
220− * sbitmap_any_bit_clear() - Check for an unset bit in a &struct
221− * sbitmap.
222− * @sb: Bitmap to check.
223− *
224− * Return: true if any bit in the bitmap is clear, false otherwise.
225− */
226−bool sbitmap_any_bit_clear(const struct sbitmap *sb);
227−
228219 #define SB_NR_TO_INDEX(sb, bitnr) ((bitnr) >> (sb)->shift)
229220 #define SB_NR_TO_BIT(sb, bitnr) ((bitnr) & ((1U << (sb)->shift) - 1U))
230221
include/linux/sched.h+19−4
@@ -251,16 +251,21 @@ struct prev_cputime { · 250 unmodified lines
251251 enum vtime_state {
252252 /* Task is sleeping or running in a CPU with VTIME inactive: */
253253 VTIME_INACTIVE = 0,
254− /* Task runs in userspace in a CPU with VTIME active: */
255− VTIME_USER,
254+ /* Task is idle */
255+ VTIME_IDLE,
256256 /* Task runs in kernelspace in a CPU with VTIME active: */
257257 VTIME_SYS,
258+ /* Task runs in userspace in a CPU with VTIME active: */
259+ VTIME_USER,
260+ /* Task runs as guests in a CPU with VTIME active: */
261+ VTIME_GUEST,
258262 };
259263
260264 struct vtime {
261265 seqcount_t seqcount;
262266 unsigned long long starttime;
263267 enum vtime_state state;
268+ unsigned int cpu;
264269 u64 utime;
265270 u64 stime;
266271 u64 gtime;
@@ -858,7 +863,7 @@ struct task_struct { · 591 unmodified lines
858863 u64 start_time;
859864
860865 /* Boot based time in nsecs: */
861− u64 real_start_time;
866+ u64 start_boottime;
862867
863868 /* MM fault and swap info: this can arguably be seen as either mm-specific or thread-specific: */
864869 unsigned long min_flt;
@@ -1055,6 +1060,8 @@ struct task_struct { · 190 unmodified lines
10551060 #endif
10561061 struct list_head pi_state_list;
10571062 struct futex_pi_state *pi_state_cache;
1063+ struct mutex futex_exit_mutex;
1064+ unsigned int futex_state;
10581065 #endif
10591066 #ifdef CONFIG_PERF_EVENTS
10601067 struct perf_event_context *perf_event_ctxp[perf_nr_task_contexts];
@@ -1207,6 +1214,8 @@ struct task_struct { · 146 unmodified lines
12071214 #endif /* CONFIG_TRACING */
12081215
12091216 #ifdef CONFIG_KCOV
1217+ /* See kernel/kcov.c for more details. */
1218+
12101219 /* Coverage collection mode enabled for this task (0 if disabled): */
12111220 unsigned int kcov_mode;
12121221
@@ -1218,6 +1227,12 @@ struct task_struct { · 5 unmodified lines
12181227
12191228 /* KCOV descriptor wired with this task or NULL: */
12201229 struct kcov *kcov;
1230+
1231+ /* KCOV common handle for remote coverage collection: */
1232+ u64 kcov_handle;
1233+
1234+ /* KCOV sequence number: */
1235+ int kcov_sequence;
12211236 #endif
12221237
12231238 #ifdef CONFIG_MEMCG
@@ -1446,7 +1461,6 @@ extern struct pid *cad_pid; · 222 unmodified lines
14461461 */
14471462 #define PF_IDLE 0x00000002 /* I am an IDLE thread */
14481463 #define PF_EXITING 0x00000004 /* Getting shut down */
1449−#define PF_EXITPIDONE 0x00000008 /* PI exit done on shut down */
14501464 #define PF_VCPU 0x00000010 /* I'm a virtual CPU */
14511465 #define PF_WQ_WORKER 0x00000020 /* I'm a workqueue worker */
14521466 #define PF_FORKNOEXEC 0x00000040 /* Forked but didn't exec */
@@ -1472,6 +1486,7 @@ extern struct pid *cad_pid; · 19 unmodified lines
14721486 #define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_mask */
14731487 #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */
14741488 #define PF_MEMALLOC_NOCMA 0x10000000 /* All allocation request will have _GFP_MOVABLE cleared */
1489+#define PF_IO_WORKER 0x20000000 /* Task is an IO worker */
14751490 #define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */
14761491 #define PF_SUSPEND_TASK 0x80000000 /* This thread called freeze_processes() and should not be frozen */
14771492
include/linux/sched/cpufreq.h+3−0
@@ -12,6 +12,8 @@ · 11 unmodified lines
1212 #define SCHED_CPUFREQ_MIGRATION (1U << 1)
1313
1414 #ifdef CONFIG_CPU_FREQ
15+struct cpufreq_policy;
16+
1517 struct update_util_data {
1618 void (*func)(struct update_util_data *data, u64 time, unsigned int flags);
1719 };
@@ -20,6 +22,7 @@ void cpufreq_add_update_util_hook(int cpu, struct update_util_data *data, · 2 unmodified lines
2022 void (*func)(struct update_util_data *data, u64 time,
2123 unsigned int flags));
2224 void cpufreq_remove_update_util_hook(int cpu);
25+bool cpufreq_this_cpu_can_update(struct cpufreq_policy *policy);
2326
2427 static inline unsigned long map_util_freq(unsigned long util,
2528 unsigned long freq, unsigned long cap)
include/linux/sched/mm.h+4−2
@@ -117,8 +117,10 @@ extern struct mm_struct *get_task_mm(struct task_struct *task); · 116 unmodified lines
117117 * succeeds.
118118 */
119119 extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode);
120−/* Remove the current tasks stale references to the old mm_struct */
121−extern void mm_release(struct task_struct *, struct mm_struct *);
120+/* Remove the current tasks stale references to the old mm_struct on exit() */
121+extern void exit_mm_release(struct task_struct *, struct mm_struct *);
122+/* Remove the current tasks stale references to the old mm_struct on exec() */
123+extern void exec_mm_release(struct task_struct *, struct mm_struct *);
122124
123125 #ifdef CONFIG_MEMCG
124126 extern void mm_update_next_owner(struct mm_struct *mm);
include/linux/sched/task.h+3−0
@@ -26,6 +26,9 @@ struct kernel_clone_args { · 25 unmodified lines
2626 unsigned long stack;
2727 unsigned long stack_size;
2828 unsigned long tls;
29+ pid_t *set_tid;
30+ /* Number of elements in *set_tid */
31+ size_t set_tid_size;
2932 };
3033
3134 /*
include/linux/seccomp.h+3−3
@@ -33,10 +33,10 @@ struct seccomp { · 32 unmodified lines
3333
3434 #ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
3535 extern int __secure_computing(const struct seccomp_data *sd);
36−static inline int secure_computing(const struct seccomp_data *sd)
36+static inline int secure_computing(void)
3737 {
3838 if (unlikely(test_thread_flag(TIF_SECCOMP)))
39− return __secure_computing(sd);
39+ return __secure_computing(NULL);
4040 return 0;
4141 }
4242 #else
@@ -59,7 +59,7 @@ struct seccomp { }; · 16 unmodified lines
5959 struct seccomp_filter { };
6060
6161 #ifdef CONFIG_HAVE_ARCH_SECCOMP_FILTER
62−static inline int secure_computing(struct seccomp_data *sd) { return 0; }
62+static inline int secure_computing(void) { return 0; }
6363 #else
6464 static inline void secure_computing_strict(int this_syscall) { return; }
6565 #endif
include/linux/security.h+40−1
@@ -117,12 +117,14 @@ enum lockdown_reason { · 116 unmodified lines
117117 LOCKDOWN_MODULE_PARAMETERS,
118118 LOCKDOWN_MMIOTRACE,
119119 LOCKDOWN_DEBUGFS,
120+ LOCKDOWN_XMON_WR,
120121 LOCKDOWN_INTEGRITY_MAX,
121122 LOCKDOWN_KCORE,
122123 LOCKDOWN_KPROBES,
123124 LOCKDOWN_BPF_READ,
124125 LOCKDOWN_PERF,
125126 LOCKDOWN_TRACEFS,
127+ LOCKDOWN_XMON_RW,
126128 LOCKDOWN_CONFIDENTIALITY_MAX,
127129 };
128130
@@ -1895,5 +1897,42 @@ static inline void security_bpf_prog_free(struct bpf_prog_aux *aux) · 1766 unmodified lines
18951897 #endif /* CONFIG_SECURITY */
18961898 #endif /* CONFIG_BPF_SYSCALL */
18971899
1898−#endif /* ! __LINUX_SECURITY_H */
1900+#ifdef CONFIG_PERF_EVENTS
1901+struct perf_event_attr;
1902+struct perf_event;
1903+
1904+#ifdef CONFIG_SECURITY
1905+extern int security_perf_event_open(struct perf_event_attr *attr, int type);
1906+extern int security_perf_event_alloc(struct perf_event *event);
1907+extern void security_perf_event_free(struct perf_event *event);
1908+extern int security_perf_event_read(struct perf_event *event);
1909+extern int security_perf_event_write(struct perf_event *event);
1910+#else
1911+static inline int security_perf_event_open(struct perf_event_attr *attr,
1912+ int type)
1913+{
1914+ return 0;
1915+}
1916+
1917+static inline int security_perf_event_alloc(struct perf_event *event)
1918+{
1919+ return 0;
1920+}
1921+
1922+static inline void security_perf_event_free(struct perf_event *event)
1923+{
1924+}
1925+
1926+static inline int security_perf_event_read(struct perf_event *event)
1927+{
1928+ return 0;
1929+}
18991930
1931+static inline int security_perf_event_write(struct perf_event *event)
1932+{
1933+ return 0;
1934+}
1935+#endif /* CONFIG_SECURITY */
1936+#endif /* CONFIG_PERF_EVENTS */
1937+
1938+#endif /* ! __LINUX_SECURITY_H */
include/linux/sed-opal.h+1−0
@@ -42,6 +42,7 @@ static inline bool is_sed_ioctl(unsigned int cmd) · 41 unmodified lines
4242 case IOC_OPAL_PSID_REVERT_TPR:
4343 case IOC_OPAL_MBR_DONE:
4444 case IOC_OPAL_WRITE_SHADOW_MBR:
45+ case IOC_OPAL_GENERIC_TABLE_RW:
4546 return true;
4647 }
4748 return false;
include/linux/seq_buf.h+3−0
@@ -125,6 +125,9 @@ extern int seq_buf_putmem(struct seq_buf *s, const void *mem, unsigned int len); · 124 unmodified lines
125125 extern int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
126126 unsigned int len);
127127 extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc);
128+extern int seq_buf_hex_dump(struct seq_buf *s, const char *prefix_str,
129+ int prefix_type, int rowsize, int groupsize,
130+ const void *buf, size_t len, bool ascii);
128131
129132 #ifdef CONFIG_BINARY_PRINTF
130133 extern int
include/linux/seqlock.h+2−2
@@ -95,7 +95,7 @@ static inline void seqcount_lockdep_reader_access(const seqcount_t *s) · 94 unmodified lines
9595
9696 local_irq_save(flags);
9797 seqcount_acquire_read(&l->dep_map, 0, 0, _RET_IP_);
98− seqcount_release(&l->dep_map, 1, _RET_IP_);
98+ seqcount_release(&l->dep_map, _RET_IP_);
9999 local_irq_restore(flags);
100100 }
101101
@@ -415,7 +415,7 @@ static inline void write_seqcount_begin(seqcount_t *s) · 313 unmodified lines
415415
416416 static inline void write_seqcount_end(seqcount_t *s)
417417 {
418− seqcount_release(&s->dep_map, 1, _RET_IP_);
418+ seqcount_release(&s->dep_map, _RET_IP_);
419419 raw_write_seqcount_end(s);
420420 }
421421
include/linux/sfp.h+22−9
@@ -428,6 +428,10 @@ enum { · 427 unmodified lines
428428 SFP_TEC_CUR = 0x6c,
429429
430430 SFP_STATUS = 0x6e,
431+ SFP_STATUS_TX_DISABLE = BIT(7),
432+ SFP_STATUS_TX_DISABLE_FORCE = BIT(6),
433+ SFP_STATUS_TX_FAULT = BIT(2),
434+ SFP_STATUS_RX_LOS = BIT(1),
431435 SFP_ALARM0 = 0x70,
432436 SFP_ALARM0_TEMP_HIGH = BIT(7),
433437 SFP_ALARM0_TEMP_LOW = BIT(6),
@@ -508,10 +512,11 @@ int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee, · 74 unmodified lines
508512 u8 *data);
509513 void sfp_upstream_start(struct sfp_bus *bus);
510514 void sfp_upstream_stop(struct sfp_bus *bus);
511−struct sfp_bus *sfp_register_upstream(struct fwnode_handle *fwnode,
512− void *upstream,
513− const struct sfp_upstream_ops *ops);
514−void sfp_unregister_upstream(struct sfp_bus *bus);
515+void sfp_bus_put(struct sfp_bus *bus);
516+struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode);
517+int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
518+ const struct sfp_upstream_ops *ops);
519+void sfp_bus_del_upstream(struct sfp_bus *bus);
515520 #else
516521 static inline int sfp_parse_port(struct sfp_bus *bus,
517522 const struct sfp_eeprom_id *id,
@@ -553,14 +558,22 @@ static inline void sfp_upstream_stop(struct sfp_bus *bus) · 35 unmodified lines
553558 {
554559 }
555560
556−static inline struct sfp_bus *sfp_register_upstream(
557− struct fwnode_handle *fwnode, void *upstream,
558− const struct sfp_upstream_ops *ops)
561+static inline void sfp_bus_put(struct sfp_bus *bus)
559562 {
560− return (struct sfp_bus *)-1;
561563 }
562564
563−static inline void sfp_unregister_upstream(struct sfp_bus *bus)
565+static inline struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)
566+{
567+ return NULL;
568+}
569+
570+static inline int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
571+ const struct sfp_upstream_ops *ops)
572+{
573+ return 0;
574+}
575+
576+static inline void sfp_bus_del_upstream(struct sfp_bus *bus)
564577 {
565578 }
566579 #endif
include/linux/skbuff.h+21−9
@@ -1795,7 +1795,7 @@ static inline struct sk_buff *skb_peek_next(struct sk_buff *skb, · 1794 unmodified lines
17951795 */
17961796 static inline struct sk_buff *skb_peek_tail(const struct sk_buff_head *list_)
17971797 {
1798− struct sk_buff *skb = list_->prev;
1798+ struct sk_buff *skb = READ_ONCE(list_->prev);
17991799
18001800 if (skb == (struct sk_buff *)list_)
18011801 skb = NULL;
@@ -1861,7 +1861,9 @@ static inline void __skb_insert(struct sk_buff *newsk, · 59 unmodified lines
18611861 struct sk_buff *prev, struct sk_buff *next,
18621862 struct sk_buff_head *list)
18631863 {
1864− /* see skb_queue_empty_lockless() for the opposite READ_ONCE() */
1864+ /* See skb_queue_empty_lockless() and skb_peek_tail()
1865+ * for the opposite READ_ONCE()
1866+ */
18651867 WRITE_ONCE(newsk->next, next);
18661868 WRITE_ONCE(newsk->prev, prev);
18671869 WRITE_ONCE(next->prev, newsk);
@@ -2277,12 +2279,12 @@ static inline void *pskb_pull(struct sk_buff *skb, unsigned int len) · 409 unmodified lines
22772279 return unlikely(len > skb->len) ? NULL : __pskb_pull(skb, len);
22782280 }
22792281
2280−static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len)
2282+static inline bool pskb_may_pull(struct sk_buff *skb, unsigned int len)
22812283 {
22822284 if (likely(len <= skb_headlen(skb)))
2283− return 1;
2285+ return true;
22842286 if (unlikely(len > skb->len))
2285− return 0;
2287+ return false;
22862288 return __pskb_pull_tail(skb, len - skb_headlen(skb)) != NULL;
22872289 }
22882290
@@ -3527,8 +3529,9 @@ int __skb_vlan_pop(struct sk_buff *skb, u16 *vlan_tci); · 1238 unmodified lines
35273529 int skb_vlan_pop(struct sk_buff *skb);
35283530 int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci);
35293531 int skb_mpls_push(struct sk_buff *skb, __be32 mpls_lse, __be16 mpls_proto,
3530− int mac_len);
3531−int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto, int mac_len);
3532+ int mac_len, bool ethernet);
3533+int skb_mpls_pop(struct sk_buff *skb, __be16 next_proto, int mac_len,
3534+ bool ethernet);
35323535 int skb_mpls_update_lse(struct sk_buff *skb, __be32 mpls_lse);
35333536 int skb_mpls_dec_ttl(struct sk_buff *skb);
35343537 struct sk_buff *pskb_extract(struct sk_buff *skb, int off, int to_copy,
@@ -3656,9 +3659,12 @@ static inline void skb_get_new_timestamp(const struct sk_buff *skb, · 121 unmodified lines
36563659 }
36573660
36583661 static inline void skb_get_timestampns(const struct sk_buff *skb,
3659− struct timespec *stamp)
3662+ struct __kernel_old_timespec *stamp)
36603663 {
3661− *stamp = ktime_to_timespec(skb->tstamp);
3664+ struct timespec64 ts = ktime_to_timespec64(skb->tstamp);
3665+
3666+ stamp->tv_sec = ts.tv_sec;
3667+ stamp->tv_nsec = ts.tv_nsec;
36623668 }
36633669
36643670 static inline void skb_get_new_timestampns(const struct sk_buff *skb,
@@ -4169,12 +4175,18 @@ static inline void skb_ext_reset(struct sk_buff *skb) · 504 unmodified lines
41694175 skb->active_extensions = 0;
41704176 }
41714177 }
4178+
4179+static inline bool skb_has_extensions(struct sk_buff *skb)
4180+{
4181+ return unlikely(skb->active_extensions);
4182+}
41724183 #else
41734184 static inline void skb_ext_put(struct sk_buff *skb) {}
41744185 static inline void skb_ext_reset(struct sk_buff *skb) {}
41754186 static inline void skb_ext_del(struct sk_buff *skb, int unused) {}
41764187 static inline void __skb_ext_copy(struct sk_buff *d, const struct sk_buff *s) {}
41774188 static inline void skb_ext_copy(struct sk_buff *dst, const struct sk_buff *s) {}
4189+static inline bool skb_has_extensions(struct sk_buff *skb) { return false; }
41784190 #endif /* CONFIG_SKB_EXTENSIONS */
41794191
41804192 static inline void nf_reset_ct(struct sk_buff *skb)
include/linux/skmsg.h+21−17
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <net/strparser.h>
1515
1616 #define MAX_MSG_FRAGS MAX_SKB_FRAGS
17+#define NR_MSG_FRAG_IDS (MAX_MSG_FRAGS + 1)
1718
1819 enum __sk_action {
1920 __SK_DROP = 0,
@@ -28,13 +29,16 @@ struct sk_msg_sg { · 8 unmodified lines
2829 u32 end;
2930 u32 size;
3031 u32 copybreak;
31− bool copy[MAX_MSG_FRAGS];
32− /* The extra element is used for chaining the front and sections when
33− * the list becomes partitioned (e.g. end < start). The crypto APIs
34− * require the chaining.
32+ unsigned long copy;
33+ /* The extra two elements:
34+ * 1) used for chaining the front and sections when the list becomes
35+ * partitioned (e.g. end < start). The crypto APIs require the
36+ * chaining;
37+ * 2) to chain tailer SG entries after the message.
3538 */
36− struct scatterlist data[MAX_MSG_FRAGS + 1];
39+ struct scatterlist data[MAX_MSG_FRAGS + 2];
3740 };
41+static_assert(BITS_PER_LONG >= NR_MSG_FRAG_IDS);
3842
3943 /* UAPI in filter.c depends on struct sk_msg_sg being first element. */
4044 struct sk_msg {
@@ -141,13 +145,13 @@ static inline void sk_msg_apply_bytes(struct sk_psock *psock, u32 bytes) · 100 unmodified lines
141145
142146 static inline u32 sk_msg_iter_dist(u32 start, u32 end)
143147 {
144− return end >= start ? end - start : end + (MAX_MSG_FRAGS - start);
148+ return end >= start ? end - start : end + (NR_MSG_FRAG_IDS - start);
145149 }
146150
147151 #define sk_msg_iter_var_prev(var) \
148152 do { \
149153 if (var == 0) \
150− var = MAX_MSG_FRAGS - 1; \
154+ var = NR_MSG_FRAG_IDS - 1; \
151155 else \
152156 var--; \
153157 } while (0)
@@ -155,7 +159,7 @@ static inline u32 sk_msg_iter_dist(u32 start, u32 end) · 1 unmodified line
155159 #define sk_msg_iter_var_next(var) \
156160 do { \
157161 var++; \
158− if (var == MAX_MSG_FRAGS) \
162+ if (var == NR_MSG_FRAG_IDS) \
159163 var = 0; \
160164 } while (0)
161165
@@ -172,9 +176,9 @@ static inline void sk_msg_clear_meta(struct sk_msg *msg) · 10 unmodified lines
172176
173177 static inline void sk_msg_init(struct sk_msg *msg)
174178 {
175− BUILD_BUG_ON(ARRAY_SIZE(msg->sg.data) - 1 != MAX_MSG_FRAGS);
179+ BUILD_BUG_ON(ARRAY_SIZE(msg->sg.data) - 1 != NR_MSG_FRAG_IDS);
176180 memset(msg, 0, sizeof(*msg));
177− sg_init_marker(msg->sg.data, MAX_MSG_FRAGS);
181+ sg_init_marker(msg->sg.data, NR_MSG_FRAG_IDS);
178182 }
179183
180184 static inline void sk_msg_xfer(struct sk_msg *dst, struct sk_msg *src,
@@ -195,14 +199,11 @@ static inline void sk_msg_xfer_full(struct sk_msg *dst, struct sk_msg *src) · 14 unmodified lines
195199
196200 static inline bool sk_msg_full(const struct sk_msg *msg)
197201 {
198− return (msg->sg.end == msg->sg.start) && msg->sg.size;
202+ return sk_msg_iter_dist(msg->sg.start, msg->sg.end) == MAX_MSG_FRAGS;
199203 }
200204
201205 static inline u32 sk_msg_elem_used(const struct sk_msg *msg)
202206 {
203− if (sk_msg_full(msg))
204− return MAX_MSG_FRAGS;
205−
206207 return sk_msg_iter_dist(msg->sg.start, msg->sg.end);
207208 }
208209
@@ -230,7 +231,7 @@ static inline void sk_msg_compute_data_pointers(struct sk_msg *msg) · 21 unmodified lines
230231 {
231232 struct scatterlist *sge = sk_msg_elem(msg, msg->sg.start);
232233
233− if (msg->sg.copy[msg->sg.start]) {
234+ if (test_bit(msg->sg.start, &msg->sg.copy)) {
234235 msg->data = NULL;
235236 msg->data_end = NULL;
236237 } else {
@@ -249,7 +250,7 @@ static inline void sk_msg_page_add(struct sk_msg *msg, struct page *page, · 12 unmodified lines
249250 sg_set_page(sge, page, len, offset);
250251 sg_unmark_end(sge);
251252
252− msg->sg.copy[msg->sg.end] = true;
253+ __set_bit(msg->sg.end, &msg->sg.copy);
253254 msg->sg.size += len;
254255 sk_msg_iter_next(msg, end);
255256 }
@@ -257,7 +258,10 @@ static inline void sk_msg_page_add(struct sk_msg *msg, struct page *page, · 1 unmodified line
257258 static inline void sk_msg_sg_copy(struct sk_msg *msg, u32 i, bool copy_state)
258259 {
259260 do {
260− msg->sg.copy[i] = copy_state;
261+ if (copy_state)
262+ __set_bit(i, &msg->sg.copy);
263+ else
264+ __clear_bit(i, &msg->sg.copy);
261265 sk_msg_iter_var_next(i);
262266 if (i == msg->sg.end)
263267 break;
include/linux/slab.h+0−20
@@ -561,26 +561,6 @@ static __always_inline void *kmalloc(size_t size, gfp_t flags) · 560 unmodified lines
561561 return __kmalloc(size, flags);
562562 }
563563
564−/*
565− * Determine size used for the nth kmalloc cache.
566− * return size or 0 if a kmalloc cache for that
567− * size does not exist
568− */
569−static __always_inline unsigned int kmalloc_size(unsigned int n)
570−{
571−#ifndef CONFIG_SLOB
572− if (n > 2)
573− return 1U << n;
574−
575− if (n == 1 && KMALLOC_MIN_SIZE <= 32)
576− return 96;
577−
578− if (n == 2 && KMALLOC_MIN_SIZE <= 64)
579− return 192;
580−#endif
581− return 0;
582−}
583−
584564 static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
585565 {
586566 #ifndef CONFIG_SLOB
include/linux/soc/mmp/cputype.h+87−0
@@ -0,0 +1,87 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __ASM_MACH_CPUTYPE_H
3+#define __ASM_MACH_CPUTYPE_H
4+
5+#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
6+#include <asm/cputype.h>
7+#endif
8+
9+/*
10+ * CPU Stepping CPU_ID CHIP_ID
11+ *
12+ * PXA168 S0 0x56158400 0x0000C910
13+ * PXA168 A0 0x56158400 0x00A0A168
14+ * PXA910 Y1 0x56158400 0x00F2C920
15+ * PXA910 A0 0x56158400 0x00F2C910
16+ * PXA910 A1 0x56158400 0x00A0C910
17+ * PXA920 Y0 0x56158400 0x00F2C920
18+ * PXA920 A0 0x56158400 0x00A0C920
19+ * PXA920 A1 0x56158400 0x00A1C920
20+ * MMP2 Z0 0x560f5811 0x00F00410
21+ * MMP2 Z1 0x560f5811 0x00E00410
22+ * MMP2 A0 0x560f5811 0x00A0A610
23+ * MMP3 A0 0x562f5842 0x00A02128
24+ * MMP3 B0 0x562f5842 0x00B02128
25+ */
26+
27+extern unsigned int mmp_chip_id;
28+
29+#ifdef CONFIG_CPU_PXA168
30+static inline int cpu_is_pxa168(void)
31+{
32+ return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
33+ ((mmp_chip_id & 0xfff) == 0x168);
34+}
35+#else
36+#define cpu_is_pxa168() (0)
37+#endif
38+
39+/* cpu_is_pxa910() is shared on both pxa910 and pxa920 */
40+#ifdef CONFIG_CPU_PXA910
41+static inline int cpu_is_pxa910(void)
42+{
43+ return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
44+ (((mmp_chip_id & 0xfff) == 0x910) ||
45+ ((mmp_chip_id & 0xfff) == 0x920));
46+}
47+#else
48+#define cpu_is_pxa910() (0)
49+#endif
50+
51+#if defined(CONFIG_CPU_MMP2) || defined(CONFIG_MACH_MMP2_DT)
52+static inline int cpu_is_mmp2(void)
53+{
54+ return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
55+ (((mmp_chip_id & 0xfff) == 0x410) ||
56+ ((mmp_chip_id & 0xfff) == 0x610));
57+}
58+#else
59+#define cpu_is_mmp2() (0)
60+#endif
61+
62+#ifdef CONFIG_MACH_MMP3_DT
63+static inline int cpu_is_mmp3(void)
64+{
65+ return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
66+ ((mmp_chip_id & 0xffff) == 0x2128);
67+}
68+
69+static inline int cpu_is_mmp3_a0(void)
70+{
71+ return (cpu_is_mmp3() &&
72+ ((mmp_chip_id & 0x00ff0000) == 0x00a00000));
73+}
74+
75+static inline int cpu_is_mmp3_b0(void)
76+{
77+ return (cpu_is_mmp3() &&
78+ ((mmp_chip_id & 0x00ff0000) == 0x00b00000));
79+}
80+
81+#else
82+#define cpu_is_mmp3() (0)
83+#define cpu_is_mmp3_a0() (0)
84+#define cpu_is_mmp3_b0() (0)
85+#endif
86+
87+#endif /* __ASM_MACH_CPUTYPE_H */
include/linux/soc/qcom/irq.h+34−0
@@ -0,0 +1,34 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
2+
3+#ifndef __QCOM_IRQ_H
4+#define __QCOM_IRQ_H
5+
6+#include <linux/irqdomain.h>
7+
8+#define GPIO_NO_WAKE_IRQ ~0U
9+
10+/**
11+ * QCOM specific IRQ domain flags that distinguishes the handling of wakeup
12+ * capable interrupts by different interrupt controllers.
13+ *
14+ * IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP: Line must be masked at TLMM and the
15+ * interrupt configuration is done at PDC
16+ * IRQ_DOMAIN_FLAG_QCOM_MPM_WAKEUP: Interrupt configuration is handled at TLMM
17+ */
18+#define IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP (IRQ_DOMAIN_FLAG_NONCORE << 0)
19+#define IRQ_DOMAIN_FLAG_QCOM_MPM_WAKEUP (IRQ_DOMAIN_FLAG_NONCORE << 1)
20+
21+/**
22+ * irq_domain_qcom_handle_wakeup: Return if the domain handles interrupt
23+ * configuration
24+ * @d: irq domain
25+ *
26+ * This QCOM specific irq domain call returns if the interrupt controller
27+ * requires the interrupt be masked at the child interrupt controller.
28+ */
29+static inline bool irq_domain_qcom_handle_wakeup(const struct irq_domain *d)
30+{
31+ return (d->flags & IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP);
32+}
33+
34+#endif
include/linux/soc/qcom/llcc-qcom.h+20−74
@@ -38,33 +38,27 @@ struct llcc_slice_desc { · 37 unmodified lines
3838 };
3939
4040 /**
41− * llcc_slice_config - Data associated with the llcc slice
42− * @usecase_id: usecase id for which the llcc slice is used
43− * @slice_id: llcc slice id assigned to each slice
44− * @max_cap: maximum capacity of the llcc slice
45− * @priority: priority of the llcc slice
46− * @fixed_size: whether the llcc slice can grow beyond its size
47− * @bonus_ways: bonus ways associated with llcc slice
48− * @res_ways: reserved ways associated with llcc slice
49− * @cache_mode: mode of the llcc slice
50− * @probe_target_ways: Probe only reserved and bonus ways on a cache miss
51− * @dis_cap_alloc: Disable capacity based allocation
52− * @retain_on_pc: Retain through power collapse
53− * @activate_on_init: activate the slice on init
41+ * llcc_edac_reg_data - llcc edac registers data for each error type
42+ * @name: Name of the error
43+ * @synd_reg: Syndrome register address
44+ * @count_status_reg: Status register address to read the error count
45+ * @ways_status_reg: Status register address to read the error ways
46+ * @reg_cnt: Number of registers
47+ * @count_mask: Mask value to get the error count
48+ * @ways_mask: Mask value to get the error ways
49+ * @count_shift: Shift value to get the error count
50+ * @ways_shift: Shift value to get the error ways
5451 */
55−struct llcc_slice_config {
56− u32 usecase_id;
57− u32 slice_id;
58− u32 max_cap;
59− u32 priority;
60− bool fixed_size;
61− u32 bonus_ways;
62− u32 res_ways;
63− u32 cache_mode;
64− u32 probe_target_ways;
65− bool dis_cap_alloc;
66− bool retain_on_pc;
67− bool activate_on_init;
52+struct llcc_edac_reg_data {
53+ char *name;
54+ u64 synd_reg;
55+ u64 count_status_reg;
56+ u64 ways_status_reg;
57+ u32 reg_cnt;
58+ u32 count_mask;
59+ u32 ways_mask;
60+ u8 count_shift;
61+ u8 ways_shift;
6862 };
6963
7064 /**
@@ -93,30 +87,6 @@ struct llcc_drv_data { · 22 unmodified lines
9387 int ecc_irq;
9488 };
9589
96−/**
97− * llcc_edac_reg_data - llcc edac registers data for each error type
98− * @name: Name of the error
99− * @synd_reg: Syndrome register address
100− * @count_status_reg: Status register address to read the error count
101− * @ways_status_reg: Status register address to read the error ways
102− * @reg_cnt: Number of registers
103− * @count_mask: Mask value to get the error count
104− * @ways_mask: Mask value to get the error ways
105− * @count_shift: Shift value to get the error count
106− * @ways_shift: Shift value to get the error ways
107− */
108−struct llcc_edac_reg_data {
109− char *name;
110− u64 synd_reg;
111− u64 count_status_reg;
112− u64 ways_status_reg;
113− u32 reg_cnt;
114− u32 count_mask;
115− u32 ways_mask;
116− u8 count_shift;
117− u8 ways_shift;
118−};
119−
12090 #if IS_ENABLED(CONFIG_QCOM_LLCC)
12191 /**
12292 * llcc_slice_getd - get llcc slice descriptor
@@ -154,20 +124,6 @@ int llcc_slice_activate(struct llcc_slice_desc *desc); · 31 unmodified lines
154124 */
155125 int llcc_slice_deactivate(struct llcc_slice_desc *desc);
156126
157−/**
158− * qcom_llcc_probe - program the sct table
159− * @pdev: platform device pointer
160− * @table: soc sct table
161− * @sz: Size of the config table
162− */
163−int qcom_llcc_probe(struct platform_device *pdev,
164− const struct llcc_slice_config *table, u32 sz);
165−
166−/**
167− * qcom_llcc_remove - remove the sct table
168− * @pdev: Platform device pointer
169− */
170−int qcom_llcc_remove(struct platform_device *pdev);
171127 #else
172128 static inline struct llcc_slice_desc *llcc_slice_getd(u32 uid)
173129 {
@@ -197,16 +153,6 @@ static inline int llcc_slice_deactivate(struct llcc_slice_desc *desc) · 23 unmodified lines
197153 {
198154 return -EINVAL;
199155 }
200−static inline int qcom_llcc_probe(struct platform_device *pdev,
201− const struct llcc_slice_config *table, u32 sz)
202−{
203− return -ENODEV;
204−}
205−
206−static inline int qcom_llcc_remove(struct platform_device *pdev)
207−{
208− return -ENODEV;
209−}
210156 #endif
211157
212158 #endif
include/linux/socket.h+16−4
@@ -378,12 +378,19 @@ extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, · 377 unmodified lines
378378 extern int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg,
379379 unsigned int vlen, unsigned int flags,
380380 bool forbid_cmsg_compat);
381−extern long __sys_sendmsg_sock(struct socket *sock,
382− struct user_msghdr __user *msg,
381+extern long __sys_sendmsg_sock(struct socket *sock, struct msghdr *msg,
383382 unsigned int flags);
384−extern long __sys_recvmsg_sock(struct socket *sock,
385− struct user_msghdr __user *msg,
383+extern long __sys_recvmsg_sock(struct socket *sock, struct msghdr *msg,
384+ struct user_msghdr __user *umsg,
385+ struct sockaddr __user *uaddr,
386386 unsigned int flags);
387+extern int sendmsg_copy_msghdr(struct msghdr *msg,
388+ struct user_msghdr __user *umsg, unsigned flags,
389+ struct iovec **iov);
390+extern int recvmsg_copy_msghdr(struct msghdr *msg,
391+ struct user_msghdr __user *umsg, unsigned flags,
392+ struct sockaddr __user **uaddr,
393+ struct iovec **iov);
387394
388395 /* helpers which do the actual work for syscalls */
389396 extern int __sys_recvfrom(int fd, void __user *ubuf, size_t size,
@@ -392,10 +399,15 @@ extern int __sys_recvfrom(int fd, void __user *ubuf, size_t size, · 2 unmodified lines
392399 extern int __sys_sendto(int fd, void __user *buff, size_t len,
393400 unsigned int flags, struct sockaddr __user *addr,
394401 int addr_len);
402+extern int __sys_accept4_file(struct file *file, unsigned file_flags,
403+ struct sockaddr __user *upeer_sockaddr,
404+ int __user *upeer_addrlen, int flags);
395405 extern int __sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr,
396406 int __user *upeer_addrlen, int flags);
397407 extern int __sys_socket(int family, int type, int protocol);
398408 extern int __sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen);
409+extern int __sys_connect_file(struct file *file, struct sockaddr_storage *addr,
410+ int addrlen, int file_flags);
399411 extern int __sys_connect(int fd, struct sockaddr __user *uservaddr,
400412 int addrlen);
401413 extern int __sys_listen(int fd, int backlog);
include/linux/sort.h+4−4
@@ -5,12 +5,12 @@ · 4 unmodified lines
55 #include <linux/types.h>
66
77 void sort_r(void *base, size_t num, size_t size,
8− int (*cmp)(const void *, const void *, const void *),
9− void (*swap)(void *, void *, int),
8+ cmp_r_func_t cmp_func,
9+ swap_func_t swap_func,
1010 const void *priv);
1111
1212 void sort(void *base, size_t num, size_t size,
13− int (*cmp)(const void *, const void *),
14− void (*swap)(void *, void *, int));
13+ cmp_func_t cmp_func,
14+ swap_func_t swap_func);
1515
1616 #endif
include/linux/soundwire/sdw.h+3−4
@@ -40,9 +40,6 @@ struct sdw_slave; · 39 unmodified lines
4040
4141 #define SDW_VALID_PORT_RANGE(n) ((n) <= 14 && (n) >= 1)
4242
43−#define SDW_DAI_ID_RANGE_START 100
44−#define SDW_DAI_ID_RANGE_END 200
45−
4643 enum {
4744 SDW_PORT_DIRN_SINK = 0,
4845 SDW_PORT_DIRN_SOURCE,
@@ -406,6 +403,8 @@ int sdw_slave_read_prop(struct sdw_slave *slave); · 357 unmodified lines
406403 * SDW Slave Structures and APIs
407404 */
408405
406+#define SDW_IGNORED_UNIQUE_ID 0xFF
407+
409408 /**
410409 * struct sdw_slave_id - Slave ID
411410 * @mfg_id: MIPI Manufacturer ID
@@ -421,7 +420,7 @@ struct sdw_slave_id { · 9 unmodified lines
421420 __u16 mfg_id;
422421 __u16 part_id;
423422 __u8 class_id;
424− __u8 unique_id:4;
423+ __u8 unique_id;
425424 __u8 sdw_version:4;
426425 };
427426
include/linux/spi/spi.h+116−16
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/completion.h>
1414 #include <linux/scatterlist.h>
1515 #include <linux/gpio/consumer.h>
16+#include <linux/ptp_clock_kernel.h>
1617
1718 struct dma_chan;
1819 struct property_entry;
@@ -89,6 +90,22 @@ void spi_statistics_add_transfer_stats(struct spi_statistics *stats, · 70 unmodified lines
8990 #define SPI_STATISTICS_INCREMENT_FIELD(stats, field) \
9091 SPI_STATISTICS_ADD_TO_FIELD(stats, field, 1)
9192
93+/**
94+ * struct spi_delay - SPI delay information
95+ * @value: Value for the delay
96+ * @unit: Unit for the delay
97+ */
98+struct spi_delay {
99+#define SPI_DELAY_UNIT_USECS 0
100+#define SPI_DELAY_UNIT_NSECS 1
101+#define SPI_DELAY_UNIT_SCK 2
102+ u16 value;
103+ u8 unit;
104+};
105+
106+extern int spi_delay_to_ns(struct spi_delay *_delay, struct spi_transfer *xfer);
107+extern int spi_delay_exec(struct spi_delay *_delay, struct spi_transfer *xfer);
108+
92109 /**
93110 * struct spi_device - Controller side proxy for an SPI slave device
94111 * @dev: Driver model representation of the device.
@@ -123,7 +140,7 @@ void spi_statistics_add_transfer_stats(struct spi_statistics *stats, · 28 unmodified lines
123140 * the spi_master.
124141 * @cs_gpiod: gpio descriptor of the chipselect line (optional, NULL when
125142 * not using a GPIO line)
126− * @word_delay_usecs: microsecond delay to be inserted between consecutive
143+ * @word_delay: delay to be inserted between consecutive
127144 * words of a transfer
128145 *
129146 * @statistics: statistics for the spi_device
@@ -173,7 +190,7 @@ struct spi_device { · 43 unmodified lines
173190 const char *driver_override;
174191 int cs_gpio; /* LEGACY: chip select gpio */
175192 struct gpio_desc *cs_gpiod; /* chip select gpio desc */
176− uint8_t word_delay_usecs; /* inter-word delay */
193+ struct spi_delay word_delay; /* inter-word delay */
177194
178195 /* the statistics */
179196 struct spi_statistics statistics;
@@ -390,6 +407,11 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) · 210 unmodified lines
390407 * controller has native support for memory like operations.
391408 * @unprepare_message: undo any work done by prepare_message().
392409 * @slave_abort: abort the ongoing transfer request on an SPI slave controller
410+ * @cs_setup: delay to be introduced by the controller after CS is asserted
411+ * @cs_hold: delay to be introduced by the controller before CS is deasserted
412+ * @cs_inactive: delay to be introduced by the controller after CS is
413+ * deasserted. If @cs_change_delay is used from @spi_transfer, then the
414+ * two delays will be added up.
393415 * @cs_gpios: LEGACY: array of GPIO descs to use as chip select lines; one per
394416 * CS number. Any individual value may be -ENOENT for CS lines that
395417 * are not GPIOs (driven by the SPI controller itself). Use the cs_gpiods
@@ -409,6 +431,12 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) · 13 unmodified lines
409431 * @fw_translate_cs: If the boot firmware uses different numbering scheme
410432 * what Linux expects, this optional hook can be used to translate
411433 * between the two.
434+ * @ptp_sts_supported: If the driver sets this to true, it must provide a
435+ * time snapshot in @spi_transfer->ptp_sts as close as possible to the
436+ * moment in time when @spi_transfer->ptp_sts_word_pre and
437+ * @spi_transfer->ptp_sts_word_post were transmitted.
438+ * If the driver does not set this, the SPI core takes the snapshot as
439+ * close to the driver hand-over as possible.
412440 *
413441 * Each SPI controller can communicate with one or more @spi_device
414442 * children. These make a small bus, sharing MOSI, MISO and SCK signals
@@ -502,8 +530,8 @@ struct spi_controller { · 87 unmodified lines
502530 * to configure specific CS timing through spi_set_cs_timing() after
503531 * spi_setup().
504532 */
505− void (*set_cs_timing)(struct spi_device *spi, u8 setup_clk_cycles,
506− u8 hold_clk_cycles, u8 inactive_clk_cycles);
533+ int (*set_cs_timing)(struct spi_device *spi, struct spi_delay *setup,
534+ struct spi_delay *hold, struct spi_delay *inactive);
507535
508536 /* bidirectional bulk transfers
509537 *
@@ -587,6 +615,11 @@ struct spi_controller { · 77 unmodified lines
587615 /* Optimized handlers for SPI memory-like operations. */
588616 const struct spi_controller_mem_ops *mem_ops;
589617
618+ /* CS delays */
619+ struct spi_delay cs_setup;
620+ struct spi_delay cs_hold;
621+ struct spi_delay cs_inactive;
622+
590623 /* gpio chip select */
591624 int *cs_gpios;
592625 struct gpio_desc **cs_gpiods;
@@ -604,6 +637,15 @@ struct spi_controller { · 11 unmodified lines
604637 void *dummy_tx;
605638
606639 int (*fw_translate_cs)(struct spi_controller *ctlr, unsigned cs);
640+
641+ /*
642+ * Driver sets this field to indicate it is able to snapshot SPI
643+ * transfers (needed e.g. for reading the time of POSIX clocks)
644+ */
645+ bool ptp_sts_supported;
646+
647+ /* Interrupt enable state during PTP system timestamping */
648+ unsigned long irq_flags;
607649 };
608650
609651 static inline void *spi_controller_get_devdata(struct spi_controller *ctlr)
@@ -644,6 +686,14 @@ extern struct spi_message *spi_get_next_queued_message(struct spi_controller *ct · 34 unmodified lines
644686 extern void spi_finalize_current_message(struct spi_controller *ctlr);
645687 extern void spi_finalize_current_transfer(struct spi_controller *ctlr);
646688
689+/* Helper calls for driver to timestamp transfer */
690+void spi_take_timestamp_pre(struct spi_controller *ctlr,
691+ struct spi_transfer *xfer,
692+ const void *tx, bool irqs_off);
693+void spi_take_timestamp_post(struct spi_controller *ctlr,
694+ struct spi_transfer *xfer,
695+ const void *tx, bool irqs_off);
696+
647697 /* the spi driver core manages memory for the spi_controller classdev */
648698 extern struct spi_controller *__spi_alloc_controller(struct device *host,
649699 unsigned int size, bool slave);
@@ -739,13 +789,13 @@ extern void spi_res_release(struct spi_controller *ctlr, · 89 unmodified lines
739789 * @cs_change: affects chipselect after this transfer completes
740790 * @cs_change_delay: delay between cs deassert and assert when
741791 * @cs_change is set and @spi_transfer is not the last in @spi_message
742− * @cs_change_delay_unit: unit of cs_change_delay
792+ * @delay: delay to be introduced after this transfer before
793+ * (optionally) changing the chipselect status, then starting
794+ * the next transfer or completing this @spi_message.
743795 * @delay_usecs: microseconds to delay after this transfer before
744796 * (optionally) changing the chipselect status, then starting
745797 * the next transfer or completing this @spi_message.
746− * @word_delay_usecs: microseconds to inter word delay after each word size
747− * (set by bits_per_word) transmission.
748− * @word_delay: clock cycles to inter word delay after each word size
798+ * @word_delay: inter word delay to be introduced after each word size
749799 * (set by bits_per_word) transmission.
750800 * @effective_speed_hz: the effective SCK-speed that was used to
751801 * transfer this transfer. Set to 0 if the spi bus driver does
@@ -753,6 +803,35 @@ extern void spi_res_release(struct spi_controller *ctlr, · 1 unmodified line
753803 * @transfer_list: transfers are sequenced through @spi_message.transfers
754804 * @tx_sg: Scatterlist for transmit, currently not for client use
755805 * @rx_sg: Scatterlist for receive, currently not for client use
806+ * @ptp_sts_word_pre: The word (subject to bits_per_word semantics) offset
807+ * within @tx_buf for which the SPI device is requesting that the time
808+ * snapshot for this transfer begins. Upon completing the SPI transfer,
809+ * this value may have changed compared to what was requested, depending
810+ * on the available snapshotting resolution (DMA transfer,
811+ * @ptp_sts_supported is false, etc).
812+ * @ptp_sts_word_post: See @ptp_sts_word_post. The two can be equal (meaning
813+ * that a single byte should be snapshotted).
814+ * If the core takes care of the timestamp (if @ptp_sts_supported is false
815+ * for this controller), it will set @ptp_sts_word_pre to 0, and
816+ * @ptp_sts_word_post to the length of the transfer. This is done
817+ * purposefully (instead of setting to spi_transfer->len - 1) to denote
818+ * that a transfer-level snapshot taken from within the driver may still
819+ * be of higher quality.
820+ * @ptp_sts: Pointer to a memory location held by the SPI slave device where a
821+ * PTP system timestamp structure may lie. If drivers use PIO or their
822+ * hardware has some sort of assist for retrieving exact transfer timing,
823+ * they can (and should) assert @ptp_sts_supported and populate this
824+ * structure using the ptp_read_system_*ts helper functions.
825+ * The timestamp must represent the time at which the SPI slave device has
826+ * processed the word, i.e. the "pre" timestamp should be taken before
827+ * transmitting the "pre" word, and the "post" timestamp after receiving
828+ * transmit confirmation from the controller for the "post" word.
829+ * @timestamped_pre: Set by the SPI controller driver to denote it has acted
830+ * upon the @ptp_sts request. Not set when the SPI core has taken care of
831+ * the task. SPI device drivers are free to print a warning if this comes
832+ * back unset and they need the better resolution.
833+ * @timestamped_post: See above. The reason why both exist is that these
834+ * booleans are also used to keep state in the core SPI logic.
756835 *
757836 * SPI transfers always write the same number of bytes as they read.
758837 * Protocol drivers should always provide @rx_buf and/or @tx_buf.
@@ -830,18 +909,22 @@ struct spi_transfer { · 71 unmodified lines
830909 #define SPI_NBITS_DUAL 0x02 /* 2bits transfer */
831910 #define SPI_NBITS_QUAD 0x04 /* 4bits transfer */
832911 u8 bits_per_word;
833− u8 word_delay_usecs;
834912 u16 delay_usecs;
835− u16 cs_change_delay;
836− u8 cs_change_delay_unit;
837−#define SPI_DELAY_UNIT_USECS 0
838−#define SPI_DELAY_UNIT_NSECS 1
839−#define SPI_DELAY_UNIT_SCK 2
913+ struct spi_delay delay;
914+ struct spi_delay cs_change_delay;
915+ struct spi_delay word_delay;
840916 u32 speed_hz;
841− u16 word_delay;
842917
843918 u32 effective_speed_hz;
844919
920+ unsigned int ptp_sts_word_pre;
921+ unsigned int ptp_sts_word_post;
922+
923+ struct ptp_system_timestamp *ptp_sts;
924+
925+ bool timestamped_pre;
926+ bool timestamped_post;
927+
845928 struct list_head transfer_list;
846929 };
847930
@@ -935,6 +1018,20 @@ spi_transfer_del(struct spi_transfer *t) · 87 unmodified lines
9351018 list_del(&t->transfer_list);
9361019 }
9371020
1021+static inline int
1022+spi_transfer_delay_exec(struct spi_transfer *t)
1023+{
1024+ struct spi_delay d;
1025+
1026+ if (t->delay_usecs) {
1027+ d.value = t->delay_usecs;
1028+ d.unit = SPI_DELAY_UNIT_USECS;
1029+ return spi_delay_exec(&d, NULL);
1030+ }
1031+
1032+ return spi_delay_exec(&t->delay, t);
1033+}
1034+
9381035 /**
9391036 * spi_message_init_with_transfers - Initialize spi_message and append transfers
9401037 * @m: spi_message to be initialized
@@ -982,7 +1079,10 @@ static inline void spi_message_free(struct spi_message *m) · 41 unmodified lines
9821079 kfree(m);
9831080 }
9841081
985−extern void spi_set_cs_timing(struct spi_device *spi, u8 setup, u8 hold, u8 inactive_dly);
1082+extern int spi_set_cs_timing(struct spi_device *spi,
1083+ struct spi_delay *setup,
1084+ struct spi_delay *hold,
1085+ struct spi_delay *inactive);
9861086
9871087 extern int spi_setup(struct spi_device *spi);
9881088 extern int spi_async(struct spi_device *spi, struct spi_message *message);
include/linux/spinlock_api_smp.h+4−4
@@ -147,7 +147,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) · 146 unmodified lines
147147
148148 static inline void __raw_spin_unlock(raw_spinlock_t *lock)
149149 {
150− spin_release(&lock->dep_map, 1, _RET_IP_);
150+ spin_release(&lock->dep_map, _RET_IP_);
151151 do_raw_spin_unlock(lock);
152152 preempt_enable();
153153 }
@@ -155,7 +155,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) · 1 unmodified line
155155 static inline void __raw_spin_unlock_irqrestore(raw_spinlock_t *lock,
156156 unsigned long flags)
157157 {
158− spin_release(&lock->dep_map, 1, _RET_IP_);
158+ spin_release(&lock->dep_map, _RET_IP_);
159159 do_raw_spin_unlock(lock);
160160 local_irq_restore(flags);
161161 preempt_enable();
@@ -163,7 +163,7 @@ static inline void __raw_spin_unlock_irqrestore(raw_spinlock_t *lock, · 1 unmodified line
163163
164164 static inline void __raw_spin_unlock_irq(raw_spinlock_t *lock)
165165 {
166− spin_release(&lock->dep_map, 1, _RET_IP_);
166+ spin_release(&lock->dep_map, _RET_IP_);
167167 do_raw_spin_unlock(lock);
168168 local_irq_enable();
169169 preempt_enable();
@@ -171,7 +171,7 @@ static inline void __raw_spin_unlock_irq(raw_spinlock_t *lock) · 1 unmodified line
171171
172172 static inline void __raw_spin_unlock_bh(raw_spinlock_t *lock)
173173 {
174− spin_release(&lock->dep_map, 1, _RET_IP_);
174+ spin_release(&lock->dep_map, _RET_IP_);
175175 do_raw_spin_unlock(lock);
176176 __local_bh_enable_ip(_RET_IP_, SOFTIRQ_LOCK_OFFSET);
177177 }
include/linux/stat.h+2−1
@@ -33,7 +33,8 @@ struct kstat { · 32 unmodified lines
3333 STATX_ATTR_IMMUTABLE | \
3434 STATX_ATTR_APPEND | \
3535 STATX_ATTR_NODUMP | \
36− STATX_ATTR_ENCRYPTED \
36+ STATX_ATTR_ENCRYPTED | \
37+ STATX_ATTR_VERITY \
3738 )/* Attrs corresponding to FS_*_FL flags */
3839 u64 ino;
3940 dev_t dev;
include/linux/stmmac.h+3−1
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #define __STMMAC_PLATFORM_DATA
1414
1515 #include <linux/platform_device.h>
16+#include <linux/phy.h>
1617
1718 #define MTL_MAX_RX_QUEUES 8
1819 #define MTL_MAX_TX_QUEUES 8
@@ -92,6 +93,7 @@ struct stmmac_dma_cfg { · 73 unmodified lines
9293 int fixed_burst;
9394 int mixed_burst;
9495 bool aal;
96+ bool eame;
9597 };
9698
9799 #define AXI_BLEN 7
@@ -131,7 +133,7 @@ struct plat_stmmacenet_data { · 33 unmodified lines
131133 int bus_id;
132134 int phy_addr;
133135 int interface;
134− int phy_interface;
136+ phy_interface_t phy_interface;
135137 struct stmmac_mdio_bus_data *mdio_bus_data;
136138 struct device_node *phy_node;
137139 struct device_node *phylink_node;
include/linux/string.h+2−0
@@ -216,6 +216,8 @@ int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) __printf(3, 4); · 215 unmodified lines
216216 extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
217217 const void *from, size_t available);
218218
219+int ptr_to_hashval(const void *ptr, unsigned long *hashval_out);
220+
219221 /**
220222 * strstarts - does @str start with @prefix?
221223 * @str: string to examine
include/linux/sunrpc/auth.h+0−3
@@ -10,8 +10,6 @@ · 9 unmodified lines
1010 #ifndef _LINUX_SUNRPC_AUTH_H
1111 #define _LINUX_SUNRPC_AUTH_H
1212
13−#ifdef __KERNEL__
14−
1513 #include <linux/sunrpc/sched.h>
1614 #include <linux/sunrpc/msg_prot.h>
1715 #include <linux/sunrpc/xdr.h>
@@ -194,5 +192,4 @@ struct rpc_cred *get_rpccred(struct rpc_cred *cred) · 176 unmodified lines
194192 return NULL;
195193 }
196194
197−#endif /* __KERNEL__ */
198195 #endif /* _LINUX_SUNRPC_AUTH_H */
include/linux/sunrpc/auth_gss.h+0−2
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313 #ifndef _LINUX_SUNRPC_AUTH_GSS_H
1414 #define _LINUX_SUNRPC_AUTH_GSS_H
1515
16−#ifdef __KERNEL__
1716 #include <linux/refcount.h>
1817 #include <linux/sunrpc/auth.h>
1918 #include <linux/sunrpc/svc.h>
@@ -90,6 +89,5 @@ struct gss_cred { · 70 unmodified lines
9089 unsigned long gc_upcall_timestamp;
9190 };
9291
93−#endif /* __KERNEL__ */
9492 #endif /* _LINUX_SUNRPC_AUTH_GSS_H */
9593
include/linux/sunrpc/clnt.h+1−3
@@ -109,8 +109,6 @@ struct rpc_procinfo { · 108 unmodified lines
109109 const char * p_name; /* name of procedure */
110110 };
111111
112−#ifdef __KERNEL__
113−
114112 struct rpc_create_args {
115113 struct net *net;
116114 int protocol;
@@ -149,6 +147,7 @@ struct rpc_add_xprt_test { · 32 unmodified lines
149147 #define RPC_CLNT_CREATE_NO_IDLE_TIMEOUT (1UL << 8)
150148 #define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9)
151149 #define RPC_CLNT_CREATE_SOFTERR (1UL << 10)
150+#define RPC_CLNT_CREATE_REUSEPORT (1UL << 11)
152151
153152 struct rpc_clnt *rpc_create(struct rpc_create_args *args);
154153 struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
@@ -237,5 +236,4 @@ static inline int rpc_reply_expected(struct rpc_task *task) · 82 unmodified lines
237236 (task->tk_msg.rpc_proc->p_decode != NULL);
238237 }
239238
240−#endif /* __KERNEL__ */
241239 #endif /* _LINUX_SUNRPC_CLNT_H */
include/linux/sunrpc/gss_api.h+0−2
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313 #ifndef _LINUX_SUNRPC_GSS_API_H
1414 #define _LINUX_SUNRPC_GSS_API_H
1515
16−#ifdef __KERNEL__
1716 #include <linux/sunrpc/xdr.h>
1817 #include <linux/sunrpc/msg_prot.h>
1918 #include <linux/uio.h>
@@ -160,6 +159,5 @@ struct gss_api_mech * gss_mech_get(struct gss_api_mech *); · 140 unmodified lines
160159 * corresponding call to gss_mech_put. */
161160 void gss_mech_put(struct gss_api_mech *);
162161
163−#endif /* __KERNEL__ */
164162 #endif /* _LINUX_SUNRPC_GSS_API_H */
165163
include/linux/sunrpc/gss_err.h+0−3
@@ -34,8 +34,6 @@ · 33 unmodified lines
3434 #ifndef _LINUX_SUNRPC_GSS_ERR_H
3535 #define _LINUX_SUNRPC_GSS_ERR_H
3636
37−#ifdef __KERNEL__
38−
3937 typedef unsigned int OM_uint32;
4038
4139 /*
@@ -163,5 +161,4 @@ typedef unsigned int OM_uint32; · 121 unmodified lines
163161 /* XXXX This is a necessary evil until the spec is fixed */
164162 #define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
165163
166−#endif /* __KERNEL__ */
167164 #endif /* __LINUX_SUNRPC_GSS_ERR_H */
include/linux/sunrpc/msg_prot.h+0−3
@@ -8,8 +8,6 @@ · 7 unmodified lines
88 #ifndef _LINUX_SUNRPC_MSGPROT_H_
99 #define _LINUX_SUNRPC_MSGPROT_H_
1010
11−#ifdef __KERNEL__ /* user programs should get these from the rpc header files */
12−
1311 #define RPC_VERSION 2
1412
1513 /* size of an XDR encoding unit in bytes, i.e. 32bit */
@@ -217,5 +215,4 @@ typedef __be32 rpc_fraghdr; · 201 unmodified lines
217215 /* Assume INET6_ADDRSTRLEN will always be larger than INET_ADDRSTRLEN... */
218216 #define RPCBIND_MAXUADDRLEN RPCBIND_MAXUADDR6LEN
219217
220−#endif /* __KERNEL__ */
221218 #endif /* _LINUX_SUNRPC_MSGPROT_H_ */
include/linux/sunrpc/rpc_pipe_fs.h+0−3
@@ -2,8 +2,6 @@ · 1 unmodified line
22 #ifndef _LINUX_SUNRPC_RPC_PIPE_FS_H
33 #define _LINUX_SUNRPC_RPC_PIPE_FS_H
44
5−#ifdef __KERNEL__
6−
75 #include <linux/workqueue.h>
86
97 struct rpc_pipe_dir_head {
@@ -133,4 +131,3 @@ extern void unregister_rpc_pipefs(void); · 123 unmodified lines
133131 extern bool gssd_running(struct net *net);
134132
135133 #endif
136−#endif
include/linux/sunrpc/svcauth.h+0−4
@@ -10,8 +10,6 @@ · 9 unmodified lines
1010 #ifndef _LINUX_SUNRPC_SVCAUTH_H_
1111 #define _LINUX_SUNRPC_SVCAUTH_H_
1212
13−#ifdef __KERNEL__
14−
1513 #include <linux/string.h>
1614 #include <linux/sunrpc/msg_prot.h>
1715 #include <linux/sunrpc/cache.h>
@@ -185,6 +183,4 @@ static inline unsigned long hash_mem(char const *buf, int length, int bits) · 167 unmodified lines
185183 return full_name_hash(NULL, buf, length) >> (32 - bits);
186184 }
187185
188−#endif /* __KERNEL__ */
189−
190186 #endif /* _LINUX_SUNRPC_SVCAUTH_H_ */
include/linux/sunrpc/svcauth_gss.h+0−2
@@ -9,7 +9,6 @@ · 8 unmodified lines
99 #ifndef _LINUX_SUNRPC_SVCAUTH_GSS_H
1010 #define _LINUX_SUNRPC_SVCAUTH_GSS_H
1111
12−#ifdef __KERNEL__
1312 #include <linux/sched.h>
1413 #include <linux/sunrpc/types.h>
1514 #include <linux/sunrpc/xdr.h>
@@ -24,5 +23,4 @@ void gss_svc_shutdown_net(struct net *net); · 8 unmodified lines
2423 int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name);
2524 u32 svcauth_gss_flavor(struct auth_domain *dom);
2625
27−#endif /* __KERNEL__ */
2826 #endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */
include/linux/sunrpc/xdr.h+0−3
@@ -11,8 +11,6 @@ · 10 unmodified lines
1111 #ifndef _SUNRPC_XDR_H_
1212 #define _SUNRPC_XDR_H_
1313
14−#ifdef __KERNEL__
15−
1614 #include <linux/uio.h>
1715 #include <asm/byteorder.h>
1816 #include <asm/unaligned.h>
@@ -552,6 +550,5 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr, · 533 unmodified lines
552550 *array = be32_to_cpup(p);
553551 return retval;
554552 }
555−#endif /* __KERNEL__ */
556553
557554 #endif /* _SUNRPC_XDR_H_ */
include/linux/sunrpc/xprt.h+2−5
@@ -19,8 +19,6 @@ · 18 unmodified lines
1919 #include <linux/sunrpc/xdr.h>
2020 #include <linux/sunrpc/msg_prot.h>
2121
22−#ifdef __KERNEL__
23−
2422 #define RPC_MIN_SLOT_TABLE (2U)
2523 #define RPC_DEF_SLOT_TABLE (16U)
2624 #define RPC_MAX_SLOT_TABLE_LIMIT (65536U)
@@ -207,7 +205,8 @@ struct rpc_xprt { · 180 unmodified lines
207205 unsigned int min_reqs; /* min number of slots */
208206 unsigned int num_reqs; /* total slots */
209207 unsigned long state; /* transport state */
210− unsigned char resvport : 1; /* use a reserved port */
208+ unsigned char resvport : 1, /* use a reserved port */
209+ reuseport : 1; /* reuse port on reconnect */
211210 atomic_t swapper; /* we're swapping over this
212211 transport */
213212 unsigned int bind_index; /* bind function index */
@@ -505,6 +504,4 @@ static inline void xprt_inject_disconnect(struct rpc_xprt *xprt) · 291 unmodified lines
505504 }
506505 #endif
507506
508−#endif /* __KERNEL__*/
509−
510507 #endif /* _LINUX_SUNRPC_XPRT_H */
include/linux/sunrpc/xprtsock.h+0−4
@@ -8,8 +8,6 @@ · 7 unmodified lines
88 #ifndef _LINUX_SUNRPC_XPRTSOCK_H
99 #define _LINUX_SUNRPC_XPRTSOCK_H
1010
11−#ifdef __KERNEL__
12−
1311 int init_socket_xprt(void);
1412 void cleanup_socket_xprt(void);
1513
@@ -91,6 +89,4 @@ struct sock_xprt { · 75 unmodified lines
9189 #define XPRT_SOCK_WAKE_PENDING (6)
9290 #define XPRT_SOCK_WAKE_DISCONNECT (7)
9391
94−#endif /* __KERNEL__ */
95−
9692 #endif /* _LINUX_SUNRPC_XPRTSOCK_H */
include/linux/swap.h+1−1
@@ -307,7 +307,7 @@ struct vma_swap_readahead { · 306 unmodified lines
307307 };
308308
309309 /* linux/mm/workingset.c */
310−void *workingset_eviction(struct page *page);
310+void *workingset_eviction(struct page *page, struct mem_cgroup *target_memcg);
311311 void workingset_refault(struct page *page, void *shadow);
312312 void workingset_activation(struct page *page);
313313
include/linux/sxgbe_platform.h+3−1
@@ -10,6 +10,8 @@ · 9 unmodified lines
1010 #ifndef __SXGBE_PLATFORM_H__
1111 #define __SXGBE_PLATFORM_H__
1212
13+#include <linux/phy.h>
14+
1315 /* MDC Clock Selection define*/
1416 #define SXGBE_CSR_100_150M 0x0 /* MDC = clk_scr_i/62 */
1517 #define SXGBE_CSR_150_250M 0x1 /* MDC = clk_scr_i/102 */
@@ -38,7 +40,7 @@ struct sxgbe_plat_data { · 22 unmodified lines
3840 char *phy_bus_name;
3941 int bus_id;
4042 int phy_addr;
41− int interface;
43+ phy_interface_t interface;
4244 struct sxgbe_mdio_bus_data *mdio_bus_data;
4345 struct sxgbe_dma_cfg *dma_cfg;
4446 int clk_csr;
include/linux/sys_soc.h+1−0
@@ -15,6 +15,7 @@ struct soc_device_attribute { · 14 unmodified lines
1515 const char *serial_number;
1616 const char *soc_id;
1717 const void *data;
18+ const struct attribute_group *custom_attr_group;
1819 };
1920
2021 /**
include/linux/syscalls.h+8−11
@@ -51,7 +51,7 @@ struct statx; · 50 unmodified lines
5151 struct __sysctl_args;
5252 struct sysinfo;
5353 struct timespec;
54−struct timeval;
54+struct __kernel_old_timeval;
5555 struct __kernel_timex;
5656 struct timezone;
5757 struct tms;
@@ -732,9 +732,9 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, · 674 unmodified lines
732732 asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache);
733733
734734 /* kernel/time.c */
735−asmlinkage long sys_gettimeofday(struct timeval __user *tv,
735+asmlinkage long sys_gettimeofday(struct __kernel_old_timeval __user *tv,
736736 struct timezone __user *tz);
737−asmlinkage long sys_settimeofday(struct timeval __user *tv,
737+asmlinkage long sys_settimeofday(struct __kernel_old_timeval __user *tv,
738738 struct timezone __user *tz);
739739 asmlinkage long sys_adjtimex(struct __kernel_timex __user *txc_p);
740740 asmlinkage long sys_adjtimex_time32(struct old_timex32 __user *txc_p);
@@ -1076,15 +1076,15 @@ asmlinkage long sys_fadvise64(int fd, loff_t offset, size_t len, int advice); · 335 unmodified lines
10761076 asmlinkage long sys_alarm(unsigned int seconds);
10771077 asmlinkage long sys_getpgrp(void);
10781078 asmlinkage long sys_pause(void);
1079−asmlinkage long sys_time(time_t __user *tloc);
1079+asmlinkage long sys_time(__kernel_old_time_t __user *tloc);
10801080 asmlinkage long sys_time32(old_time32_t __user *tloc);
10811081 #ifdef __ARCH_WANT_SYS_UTIME
10821082 asmlinkage long sys_utime(char __user *filename,
10831083 struct utimbuf __user *times);
10841084 asmlinkage long sys_utimes(char __user *filename,
1085− struct timeval __user *utimes);
1085+ struct __kernel_old_timeval __user *utimes);
10861086 asmlinkage long sys_futimesat(int dfd, const char __user *filename,
1087− struct timeval __user *utimes);
1087+ struct __kernel_old_timeval __user *utimes);
10881088 #endif
10891089 asmlinkage long sys_futimesat_time32(unsigned int dfd,
10901090 const char __user *filename,
@@ -1098,7 +1098,7 @@ asmlinkage long sys_getdents(unsigned int fd, · 7 unmodified lines
10981098 struct linux_dirent __user *dirent,
10991099 unsigned int count);
11001100 asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
1101− fd_set __user *exp, struct timeval __user *tvp);
1101+ fd_set __user *exp, struct __kernel_old_timeval __user *tvp);
11021102 asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
11031103 int timeout);
11041104 asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events,
@@ -1116,7 +1116,7 @@ asmlinkage long sys_sysfs(int option, · 11 unmodified lines
11161116 asmlinkage long sys_fork(void);
11171117
11181118 /* obsolete: kernel/time/time.c */
1119−asmlinkage long sys_stime(time_t __user *tptr);
1119+asmlinkage long sys_stime(__kernel_old_time_t __user *tptr);
11201120 asmlinkage long sys_stime32(old_time32_t __user *tptr);
11211121
11221122 /* obsolete: kernel/signal.c */
@@ -1231,10 +1231,7 @@ asmlinkage long sys_ni_syscall(void); · 108 unmodified lines
12311231 * the ksys_xyzyyz() functions prototyped below.
12321232 */
12331233
1234−int ksys_mount(const char __user *dev_name, const char __user *dir_name,
1235− const char __user *type, unsigned long flags, void __user *data);
12361234 int ksys_umount(char __user *name, int flags);
1237−int ksys_dup(unsigned int fildes);
12381235 int ksys_chroot(const char __user *filename);
12391236 ssize_t ksys_write(unsigned int fd, const char __user *buf, size_t count);
12401237 int ksys_chdir(const char __user *filename);
include/linux/sysctl.h+2−4
@@ -120,8 +120,7 @@ static inline void *proc_sys_poll_event(struct ctl_table_poll *poll) · 119 unmodified lines
120120 struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name)
121121
122122 /* A sysctl table is an array of struct ctl_table: */
123−struct ctl_table
124−{
123+struct ctl_table {
125124 const char *procname; /* Text ID for /proc/sys, or zero */
126125 void *data;
127126 int maxlen;
@@ -140,8 +139,7 @@ struct ctl_node { · 12 unmodified lines
140139
141140 /* struct ctl_table_header is used to maintain dynamic lists of
142141 struct ctl_table trees. */
143−struct ctl_table_header
144−{
142+struct ctl_table_header {
145143 union {
146144 struct {
147145 struct ctl_table *ctl_table;
include/linux/tcp.h+1−1
@@ -223,7 +223,7 @@ struct tcp_sock { · 222 unmodified lines
223223 fastopen_connect:1, /* FASTOPEN_CONNECT sockopt */
224224 fastopen_no_cookie:1, /* Allow send/recv SYN+data without a cookie */
225225 is_sack_reneg:1, /* in recovery from loss with SACK reneg? */
226− unused:2;
226+ fastopen_client_fail:2; /* reason why fastopen failed */
227227 u8 nonagle : 4,/* Disable Nagle algorithm? */
228228 thin_lto : 1,/* Use linear timeouts for thin streams */
229229 recvmsg_inq : 1,/* Indicate # of bytes in queue upon recvmsg */
include/linux/thermal.h+0−11
@@ -544,15 +544,4 @@ static inline void thermal_notify_framework(struct thermal_zone_device *tz, · 543 unmodified lines
544544 { }
545545 #endif /* CONFIG_THERMAL */
546546
547−#if defined(CONFIG_NET) && IS_ENABLED(CONFIG_THERMAL)
548−extern int thermal_generate_netlink_event(struct thermal_zone_device *tz,
549− enum events event);
550−#else
551−static inline int thermal_generate_netlink_event(struct thermal_zone_device *tz,
552− enum events event)
553−{
554− return 0;
555−}
556−#endif
557−
558547 #endif /* __THERMAL_H__ */
include/linux/thread_info.h+2−0
@@ -147,6 +147,8 @@ check_copy_size(const void *addr, size_t bytes, bool is_source) · 146 unmodified lines
147147 __bad_copy_to();
148148 return false;
149149 }
150+ if (WARN_ON_ONCE(bytes > INT_MAX))
151+ return false;
150152 check_object_size(addr, bytes, is_source);
151153 return true;
152154 }
include/linux/tick.h+7−2
@@ -108,7 +108,8 @@ enum tick_dep_bits { · 107 unmodified lines
108108 TICK_DEP_BIT_POSIX_TIMER = 0,
109109 TICK_DEP_BIT_PERF_EVENTS = 1,
110110 TICK_DEP_BIT_SCHED = 2,
111− TICK_DEP_BIT_CLOCK_UNSTABLE = 3
111+ TICK_DEP_BIT_CLOCK_UNSTABLE = 3,
112+ TICK_DEP_BIT_RCU = 4
112113 };
113114
114115 #define TICK_DEP_MASK_NONE 0
@@ -116,6 +117,7 @@ enum tick_dep_bits { · 1 unmodified line
116117 #define TICK_DEP_MASK_PERF_EVENTS (1 << TICK_DEP_BIT_PERF_EVENTS)
117118 #define TICK_DEP_MASK_SCHED (1 << TICK_DEP_BIT_SCHED)
118119 #define TICK_DEP_MASK_CLOCK_UNSTABLE (1 << TICK_DEP_BIT_CLOCK_UNSTABLE)
120+#define TICK_DEP_MASK_RCU (1 << TICK_DEP_BIT_RCU)
119121
120122 #ifdef CONFIG_NO_HZ_COMMON
121123 extern bool tick_nohz_enabled;
@@ -174,7 +176,7 @@ extern cpumask_var_t tick_nohz_full_mask; · 52 unmodified lines
174176
175177 static inline bool tick_nohz_full_enabled(void)
176178 {
177− if (!context_tracking_is_enabled())
179+ if (!context_tracking_enabled())
178180 return false;
179181
180182 return tick_nohz_full_running;
@@ -268,6 +270,9 @@ static inline bool tick_nohz_full_enabled(void) { return false; } · 87 unmodified lines
268270 static inline bool tick_nohz_full_cpu(int cpu) { return false; }
269271 static inline void tick_nohz_full_add_cpus_to(struct cpumask *mask) { }
270272
273+static inline void tick_nohz_dep_set_cpu(int cpu, enum tick_dep_bits bit) { }
274+static inline void tick_nohz_dep_clear_cpu(int cpu, enum tick_dep_bits bit) { }
275+
271276 static inline void tick_dep_set(enum tick_dep_bits bit) { }
272277 static inline void tick_dep_clear(enum tick_dep_bits bit) { }
273278 static inline void tick_dep_set_cpu(int cpu, enum tick_dep_bits bit) { }
include/linux/time.h+18−4
@@ -35,10 +35,11 @@ extern time64_t mktime64(const unsigned int year, const unsigned int mon, · 34 unmodified lines
3535 extern u32 (*arch_gettimeoffset)(void);
3636 #endif
3737
38−struct itimerval;
39−extern int do_setitimer(int which, struct itimerval *value,
40− struct itimerval *ovalue);
41−extern int do_getitimer(int which, struct itimerval *value);
38+#ifdef CONFIG_POSIX_TIMERS
39+extern void clear_itimer(void);
40+#else
41+static inline void clear_itimer(void) {}
42+#endif
4243
4344 extern long do_utimes(int dfd, const char __user *filename, struct timespec64 *times, int flags);
4445
@@ -96,4 +97,17 @@ static inline bool itimerspec64_valid(const struct itimerspec64 *its) · 51 unmodified lines
9697 */
9798 #define time_after32(a, b) ((s32)((u32)(b) - (u32)(a)) < 0)
9899 #define time_before32(b, a) time_after32(a, b)
100+
101+/**
102+ * time_between32 - check if a 32-bit timestamp is within a given time range
103+ * @t: the time which may be within [l,h]
104+ * @l: the lower bound of the range
105+ * @h: the higher bound of the range
106+ *
107+ * time_before32(t, l, h) returns true if @l <= @t <= @h. All operands are
108+ * treated as 32-bit integers.
109+ *
110+ * Equivalent to !(time_before32(@t, @l) || time_after32(@t, @h)).
111+ */
112+#define time_between32(t, l, h) ((u32)(h) - (u32)(l) >= (u32)(t) - (u32)(l))
99113 #endif
include/linux/time32.h+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include <linux/time64.h>
1313 #include <linux/timex.h>
1414
15−#define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1)
15+#define TIME_T_MAX (__kernel_old_time_t)((1UL << ((sizeof(__kernel_old_time_t) << 3) - 1)) - 1)
1616
1717 typedef s32 old_time32_t;
1818
include/linux/tpm.h+233−18
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/acpi.h>
2222 #include <linux/cdev.h>
2323 #include <linux/fs.h>
24+#include <linux/highmem.h>
2425 #include <crypto/hash_info.h>
2526
2627 #define TPM_DIGEST_SIZE 20 /* Max TPM v1.2 PCR size */
@@ -67,6 +68,8 @@ struct tpm_class_ops { · 40 unmodified lines
6768 u8 (*status) (struct tpm_chip *chip);
6869 void (*update_timeouts)(struct tpm_chip *chip,
6970 unsigned long *timeout_cap);
71+ void (*update_durations)(struct tpm_chip *chip,
72+ unsigned long *duration_cap);
7073 int (*go_idle)(struct tpm_chip *chip);
7174 int (*cmd_ready)(struct tpm_chip *chip);
7275 int (*request_locality)(struct tpm_chip *chip, int loc);
@@ -161,6 +164,235 @@ struct tpm_chip { · 88 unmodified lines
161164 int locality;
162165 };
163166
167+#define TPM_HEADER_SIZE 10
168+
169+enum tpm2_const {
170+ TPM2_PLATFORM_PCR = 24,
171+ TPM2_PCR_SELECT_MIN = ((TPM2_PLATFORM_PCR + 7) / 8),
172+};
173+
174+enum tpm2_timeouts {
175+ TPM2_TIMEOUT_A = 750,
176+ TPM2_TIMEOUT_B = 2000,
177+ TPM2_TIMEOUT_C = 200,
178+ TPM2_TIMEOUT_D = 30,
179+ TPM2_DURATION_SHORT = 20,
180+ TPM2_DURATION_MEDIUM = 750,
181+ TPM2_DURATION_LONG = 2000,
182+ TPM2_DURATION_LONG_LONG = 300000,
183+ TPM2_DURATION_DEFAULT = 120000,
184+};
185+
186+enum tpm2_structures {
187+ TPM2_ST_NO_SESSIONS = 0x8001,
188+ TPM2_ST_SESSIONS = 0x8002,
189+};
190+
191+/* Indicates from what layer of the software stack the error comes from */
192+#define TSS2_RC_LAYER_SHIFT 16
193+#define TSS2_RESMGR_TPM_RC_LAYER (11 << TSS2_RC_LAYER_SHIFT)
194+
195+enum tpm2_return_codes {
196+ TPM2_RC_SUCCESS = 0x0000,
197+ TPM2_RC_HASH = 0x0083, /* RC_FMT1 */
198+ TPM2_RC_HANDLE = 0x008B,
199+ TPM2_RC_INITIALIZE = 0x0100, /* RC_VER1 */
200+ TPM2_RC_FAILURE = 0x0101,
201+ TPM2_RC_DISABLED = 0x0120,
202+ TPM2_RC_COMMAND_CODE = 0x0143,
203+ TPM2_RC_TESTING = 0x090A, /* RC_WARN */
204+ TPM2_RC_REFERENCE_H0 = 0x0910,
205+ TPM2_RC_RETRY = 0x0922,
206+};
207+
208+enum tpm2_command_codes {
209+ TPM2_CC_FIRST = 0x011F,
210+ TPM2_CC_HIERARCHY_CONTROL = 0x0121,
211+ TPM2_CC_HIERARCHY_CHANGE_AUTH = 0x0129,
212+ TPM2_CC_CREATE_PRIMARY = 0x0131,
213+ TPM2_CC_SEQUENCE_COMPLETE = 0x013E,
214+ TPM2_CC_SELF_TEST = 0x0143,
215+ TPM2_CC_STARTUP = 0x0144,
216+ TPM2_CC_SHUTDOWN = 0x0145,
217+ TPM2_CC_NV_READ = 0x014E,
218+ TPM2_CC_CREATE = 0x0153,
219+ TPM2_CC_LOAD = 0x0157,
220+ TPM2_CC_SEQUENCE_UPDATE = 0x015C,
221+ TPM2_CC_UNSEAL = 0x015E,
222+ TPM2_CC_CONTEXT_LOAD = 0x0161,
223+ TPM2_CC_CONTEXT_SAVE = 0x0162,
224+ TPM2_CC_FLUSH_CONTEXT = 0x0165,
225+ TPM2_CC_VERIFY_SIGNATURE = 0x0177,
226+ TPM2_CC_GET_CAPABILITY = 0x017A,
227+ TPM2_CC_GET_RANDOM = 0x017B,
228+ TPM2_CC_PCR_READ = 0x017E,
229+ TPM2_CC_PCR_EXTEND = 0x0182,
230+ TPM2_CC_EVENT_SEQUENCE_COMPLETE = 0x0185,
231+ TPM2_CC_HASH_SEQUENCE_START = 0x0186,
232+ TPM2_CC_CREATE_LOADED = 0x0191,
233+ TPM2_CC_LAST = 0x0193, /* Spec 1.36 */
234+};
235+
236+enum tpm2_permanent_handles {
237+ TPM2_RS_PW = 0x40000009,
238+};
239+
240+enum tpm2_capabilities {
241+ TPM2_CAP_HANDLES = 1,
242+ TPM2_CAP_COMMANDS = 2,
243+ TPM2_CAP_PCRS = 5,
244+ TPM2_CAP_TPM_PROPERTIES = 6,
245+};
246+
247+enum tpm2_properties {
248+ TPM_PT_TOTAL_COMMANDS = 0x0129,
249+};
250+
251+enum tpm2_startup_types {
252+ TPM2_SU_CLEAR = 0x0000,
253+ TPM2_SU_STATE = 0x0001,
254+};
255+
256+enum tpm2_cc_attrs {
257+ TPM2_CC_ATTR_CHANDLES = 25,
258+ TPM2_CC_ATTR_RHANDLE = 28,
259+};
260+
261+#define TPM_VID_INTEL 0x8086
262+#define TPM_VID_WINBOND 0x1050
263+#define TPM_VID_STM 0x104A
264+
265+enum tpm_chip_flags {
266+ TPM_CHIP_FLAG_TPM2 = BIT(1),
267+ TPM_CHIP_FLAG_IRQ = BIT(2),
268+ TPM_CHIP_FLAG_VIRTUAL = BIT(3),
269+ TPM_CHIP_FLAG_HAVE_TIMEOUTS = BIT(4),
270+ TPM_CHIP_FLAG_ALWAYS_POWERED = BIT(5),
271+ TPM_CHIP_FLAG_FIRMWARE_POWER_MANAGED = BIT(6),
272+};
273+
274+#define to_tpm_chip(d) container_of(d, struct tpm_chip, dev)
275+
276+struct tpm_header {
277+ __be16 tag;
278+ __be32 length;
279+ union {
280+ __be32 ordinal;
281+ __be32 return_code;
282+ };
283+} __packed;
284+
285+/* A string buffer type for constructing TPM commands. This is based on the
286+ * ideas of string buffer code in security/keys/trusted.h but is heap based
287+ * in order to keep the stack usage minimal.
288+ */
289+
290+enum tpm_buf_flags {
291+ TPM_BUF_OVERFLOW = BIT(0),
292+};
293+
294+struct tpm_buf {
295+ unsigned int flags;
296+ u8 *data;
297+};
298+
299+enum tpm2_object_attributes {
300+ TPM2_OA_USER_WITH_AUTH = BIT(6),
301+};
302+
303+enum tpm2_session_attributes {
304+ TPM2_SA_CONTINUE_SESSION = BIT(0),
305+};
306+
307+struct tpm2_hash {
308+ unsigned int crypto_id;
309+ unsigned int tpm_id;
310+};
311+
312+static inline void tpm_buf_reset(struct tpm_buf *buf, u16 tag, u32 ordinal)
313+{
314+ struct tpm_header *head = (struct tpm_header *)buf->data;
315+
316+ head->tag = cpu_to_be16(tag);
317+ head->length = cpu_to_be32(sizeof(*head));
318+ head->ordinal = cpu_to_be32(ordinal);
319+}
320+
321+static inline int tpm_buf_init(struct tpm_buf *buf, u16 tag, u32 ordinal)
322+{
323+ buf->data = (u8 *)__get_free_page(GFP_KERNEL);
324+ if (!buf->data)
325+ return -ENOMEM;
326+
327+ buf->flags = 0;
328+ tpm_buf_reset(buf, tag, ordinal);
329+ return 0;
330+}
331+
332+static inline void tpm_buf_destroy(struct tpm_buf *buf)
333+{
334+ free_page((unsigned long)buf->data);
335+}
336+
337+static inline u32 tpm_buf_length(struct tpm_buf *buf)
338+{
339+ struct tpm_header *head = (struct tpm_header *)buf->data;
340+
341+ return be32_to_cpu(head->length);
342+}
343+
344+static inline u16 tpm_buf_tag(struct tpm_buf *buf)
345+{
346+ struct tpm_header *head = (struct tpm_header *)buf->data;
347+
348+ return be16_to_cpu(head->tag);
349+}
350+
351+static inline void tpm_buf_append(struct tpm_buf *buf,
352+ const unsigned char *new_data,
353+ unsigned int new_len)
354+{
355+ struct tpm_header *head = (struct tpm_header *)buf->data;
356+ u32 len = tpm_buf_length(buf);
357+
358+ /* Return silently if overflow has already happened. */
359+ if (buf->flags & TPM_BUF_OVERFLOW)
360+ return;
361+
362+ if ((len + new_len) > PAGE_SIZE) {
363+ WARN(1, "tpm_buf: overflow\n");
364+ buf->flags |= TPM_BUF_OVERFLOW;
365+ return;
366+ }
367+
368+ memcpy(&buf->data[len], new_data, new_len);
369+ head->length = cpu_to_be32(len + new_len);
370+}
371+
372+static inline void tpm_buf_append_u8(struct tpm_buf *buf, const u8 value)
373+{
374+ tpm_buf_append(buf, &value, 1);
375+}
376+
377+static inline void tpm_buf_append_u16(struct tpm_buf *buf, const u16 value)
378+{
379+ __be16 value2 = cpu_to_be16(value);
380+
381+ tpm_buf_append(buf, (u8 *) &value2, 2);
382+}
383+
384+static inline void tpm_buf_append_u32(struct tpm_buf *buf, const u32 value)
385+{
386+ __be32 value2 = cpu_to_be32(value);
387+
388+ tpm_buf_append(buf, (u8 *) &value2, 4);
389+}
390+
391+static inline u32 tpm2_rc_value(u32 rc)
392+{
393+ return (rc & BIT(7)) ? rc & 0xff : rc;
394+}
395+
164396 #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
165397
166398 extern int tpm_is_tpm2(struct tpm_chip *chip);
@@ -170,13 +402,8 @@ extern int tpm_pcr_extend(struct tpm_chip *chip, u32 pcr_idx, · 3 unmodified lines
170402 struct tpm_digest *digests);
171403 extern int tpm_send(struct tpm_chip *chip, void *cmd, size_t buflen);
172404 extern int tpm_get_random(struct tpm_chip *chip, u8 *data, size_t max);
173−extern int tpm_seal_trusted(struct tpm_chip *chip,
174− struct trusted_key_payload *payload,
175− struct trusted_key_options *options);
176−extern int tpm_unseal_trusted(struct tpm_chip *chip,
177− struct trusted_key_payload *payload,
178− struct trusted_key_options *options);
179405 extern struct tpm_chip *tpm_default_chip(void);
406+void tpm2_flush_context(struct tpm_chip *chip, u32 handle);
180407 #else
181408 static inline int tpm_is_tpm2(struct tpm_chip *chip)
182409 {
@@ -204,18 +431,6 @@ static inline int tpm_get_random(struct tpm_chip *chip, u8 *data, size_t max) · 21 unmodified lines
204431 return -ENODEV;
205432 }
206433
207−static inline int tpm_seal_trusted(struct tpm_chip *chip,
208− struct trusted_key_payload *payload,
209− struct trusted_key_options *options)
210−{
211− return -ENODEV;
212−}
213−static inline int tpm_unseal_trusted(struct tpm_chip *chip,
214− struct trusted_key_payload *payload,
215− struct trusted_key_options *options)
216−{
217− return -ENODEV;
218−}
219434 static inline struct tpm_chip *tpm_default_chip(void)
220435 {
221436 return NULL;
include/linux/trace.h+8−0
@@ -24,6 +24,14 @@ struct trace_export { · 23 unmodified lines
2424 int register_ftrace_export(struct trace_export *export);
2525 int unregister_ftrace_export(struct trace_export *export);
2626
27+struct trace_array;
28+
29+void trace_printk_init_buffers(void);
30+int trace_array_printk(struct trace_array *tr, unsigned long ip,
31+ const char *fmt, ...);
32+void trace_array_put(struct trace_array *tr);
33+struct trace_array *trace_array_get_by_name(const char *name);
34+int trace_array_destroy(struct trace_array *tr);
2735 #endif /* CONFIG_TRACING */
2836
2937 #endif /* _LINUX_TRACE_H */
include/linux/trace_events.h+7−1
@@ -45,6 +45,11 @@ const char *trace_print_array_seq(struct trace_seq *p, · 44 unmodified lines
4545 const void *buf, int count,
4646 size_t el_size);
4747
48+const char *
49+trace_print_hex_dump_seq(struct trace_seq *p, const char *prefix_str,
50+ int prefix_type, int rowsize, int groupsize,
51+ const void *buf, size_t len, bool ascii);
52+
4853 struct trace_iterator;
4954 struct trace_event;
5055
@@ -550,7 +555,8 @@ extern int trace_event_get_offsets(struct trace_event_call *call); · 499 unmodified lines
550555
551556 int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set);
552557 int trace_set_clr_event(const char *system, const char *event, int set);
553−
558+int trace_array_set_clr_event(struct trace_array *tr, const char *system,
559+ const char *event, bool enable);
554560 /*
555561 * The double __builtin_constant_p is because gcc will give us an error
556562 * if we try to allocate the static variable to fmt if it is not a
include/linux/trace_seq.h+4−0
@@ -92,6 +92,10 @@ extern int trace_seq_path(struct trace_seq *s, const struct path *path); · 91 unmodified lines
9292 extern void trace_seq_bitmask(struct trace_seq *s, const unsigned long *maskp,
9393 int nmaskbits);
9494
95+extern int trace_seq_hex_dump(struct trace_seq *s, const char *prefix_str,
96+ int prefix_type, int rowsize, int groupsize,
97+ const void *buf, size_t len, bool ascii);
98+
9599 #else /* CONFIG_TRACING */
96100 static inline void trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
97101 {
include/linux/types.h+6−1
@@ -67,7 +67,7 @@ typedef __kernel_ptrdiff_t ptrdiff_t; · 66 unmodified lines
6767
6868 #ifndef _TIME_T
6969 #define _TIME_T
70−typedef __kernel_time_t time_t;
70+typedef __kernel_old_time_t time_t;
7171 #endif
7272
7373 #ifndef _CLOCK_T
@@ -225,5 +225,10 @@ struct callback_head { · 151 unmodified lines
225225 typedef void (*rcu_callback_t)(struct rcu_head *head);
226226 typedef void (*call_rcu_func_t)(struct rcu_head *head, rcu_callback_t func);
227227
228+typedef void (*swap_func_t)(void *a, void *b, int size);
229+
230+typedef int (*cmp_r_func_t)(const void *a, const void *b, const void *priv);
231+typedef int (*cmp_func_t)(const void *a, const void *b);
232+
228233 #endif /* __ASSEMBLY__ */
229234 #endif /* _LINUX_TYPES_H */
include/linux/u64_stats_sync.h+47−4
@@ -40,8 +40,8 @@ · 39 unmodified lines
4040 * spin_lock_bh(...) or other synchronization to get exclusive access
4141 * ...
4242 * u64_stats_update_begin(&stats->syncp);
43− * stats->bytes64 += len; // non atomic operation
44− * stats->packets64++; // non atomic operation
43+ * u64_stats_add(&stats->bytes64, len); // non atomic operation
44+ * u64_stats_inc(&stats->packets64); // non atomic operation
4545 * u64_stats_update_end(&stats->syncp);
4646 *
4747 * While a consumer (reader) should use following template to get consistent
@@ -52,8 +52,8 @@ · 4 unmodified lines
5252 *
5353 * do {
5454 * start = u64_stats_fetch_begin(&stats->syncp);
55− * tbytes = stats->bytes64; // non atomic operation
56− * tpackets = stats->packets64; // non atomic operation
55+ * tbytes = u64_stats_read(&stats->bytes64); // non atomic operation
56+ * tpackets = u64_stats_read(&stats->packets64); // non atomic operation
5757 * } while (u64_stats_fetch_retry(&stats->syncp, start));
5858 *
5959 *
@@ -68,6 +68,49 @@ struct u64_stats_sync { · 8 unmodified lines
6868 #endif
6969 };
7070
71+#if BITS_PER_LONG == 64
72+#include <asm/local64.h>
73+
74+typedef struct {
75+ local64_t v;
76+} u64_stats_t ;
77+
78+static inline u64 u64_stats_read(const u64_stats_t *p)
79+{
80+ return local64_read(&p->v);
81+}
82+
83+static inline void u64_stats_add(u64_stats_t *p, unsigned long val)
84+{
85+ local64_add(val, &p->v);
86+}
87+
88+static inline void u64_stats_inc(u64_stats_t *p)
89+{
90+ local64_inc(&p->v);
91+}
92+
93+#else
94+
95+typedef struct {
96+ u64 v;
97+} u64_stats_t;
98+
99+static inline u64 u64_stats_read(const u64_stats_t *p)
100+{
101+ return p->v;
102+}
103+
104+static inline void u64_stats_add(u64_stats_t *p, unsigned long val)
105+{
106+ p->v += val;
107+}
108+
109+static inline void u64_stats_inc(u64_stats_t *p)
110+{
111+ p->v++;
112+}
113+#endif
71114
72115 static inline void u64_stats_init(struct u64_stats_sync *syncp)
73116 {
include/linux/uaccess.h+16−0
@@ -311,6 +311,7 @@ copy_struct_from_user(void *dst, size_t ksize, const void __user *src, · 310 unmodified lines
311311 * happens, handle that and return -EFAULT.
312312 */
313313 extern long probe_kernel_read(void *dst, const void *src, size_t size);
314+extern long probe_kernel_read_strict(void *dst, const void *src, size_t size);
314315 extern long __probe_kernel_read(void *dst, const void *src, size_t size);
315316
316317 /*
@@ -337,7 +338,22 @@ extern long __probe_user_read(void *dst, const void __user *src, size_t size); · 20 unmodified lines
337338 extern long notrace probe_kernel_write(void *dst, const void *src, size_t size);
338339 extern long notrace __probe_kernel_write(void *dst, const void *src, size_t size);
339340
341+/*
342+ * probe_user_write(): safely attempt to write to a location in user space
343+ * @dst: address to write to
344+ * @src: pointer to the data that shall be written
345+ * @size: size of the data chunk
346+ *
347+ * Safely write to address @dst from the buffer at @src. If a kernel fault
348+ * happens, handle that and return -EFAULT.
349+ */
350+extern long notrace probe_user_write(void __user *dst, const void *src, size_t size);
351+extern long notrace __probe_user_write(void __user *dst, const void *src, size_t size);
352+
340353 extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
354+extern long strncpy_from_unsafe_strict(char *dst, const void *unsafe_addr,
355+ long count);
356+extern long __strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count);
341357 extern long strncpy_from_unsafe_user(char *dst, const void __user *unsafe_addr,
342358 long count);
343359 extern long strnlen_unsafe_user(const void __user *unsafe_addr, long count);
include/linux/uio.h+2−2
@@ -45,8 +45,8 @@ struct iov_iter { · 44 unmodified lines
4545 union {
4646 unsigned long nr_segs;
4747 struct {
48− int idx;
49− int start_idx;
48+ unsigned int head;
49+ unsigned int start_head;
5050 };
5151 };
5252 };
include/linux/usb/role.h+3−0
@@ -50,6 +50,9 @@ struct usb_role_switch *usb_role_switch_get(struct device *dev); · 49 unmodified lines
5050 struct usb_role_switch *fwnode_usb_role_switch_get(struct fwnode_handle *node);
5151 void usb_role_switch_put(struct usb_role_switch *sw);
5252
53+struct usb_role_switch *
54+usb_role_switch_find_by_fwnode(const struct fwnode_handle *fwnode);
55+
5356 struct usb_role_switch *
5457 usb_role_switch_register(struct device *parent,
5558 const struct usb_role_switch_desc *desc);
include/linux/usb/tcpm.h+0−41
@@ -46,45 +46,6 @@ enum tcpm_transmit_type { · 45 unmodified lines
4646 TCPC_TX_BIST_MODE_2 = 7
4747 };
4848
49−/**
50− * struct tcpc_config - Port configuration
51− * @src_pdo: PDO parameters sent to port partner as response to
52− * PD_CTRL_GET_SOURCE_CAP message
53− * @nr_src_pdo: Number of entries in @src_pdo
54− * @snk_pdo: PDO parameters sent to partner as response to
55− * PD_CTRL_GET_SINK_CAP message
56− * @nr_snk_pdo: Number of entries in @snk_pdo
57− * @operating_snk_mw:
58− * Required operating sink power in mW
59− * @type: Port type (TYPEC_PORT_DFP, TYPEC_PORT_UFP, or
60− * TYPEC_PORT_DRP)
61− * @default_role:
62− * Default port role (TYPEC_SINK or TYPEC_SOURCE).
63− * Set to TYPEC_NO_PREFERRED_ROLE if no default role.
64− * @try_role_hw:True if try.{Src,Snk} is implemented in hardware
65− * @alt_modes: List of supported alternate modes
66− */
67−struct tcpc_config {
68− const u32 *src_pdo;
69− unsigned int nr_src_pdo;
70−
71− const u32 *snk_pdo;
72− unsigned int nr_snk_pdo;
73−
74− const u32 *snk_vdo;
75− unsigned int nr_snk_vdo;
76−
77− unsigned int operating_snk_mw;
78−
79− enum typec_port_type type;
80− enum typec_port_data data;
81− enum typec_role default_role;
82− bool try_role_hw; /* try.{src,snk} implemented in hardware */
83− bool self_powered; /* port belongs to a self powered device */
84−
85− const struct typec_altmode_desc *alt_modes;
86−};
87−
8849 /* Mux state attributes */
8950 #define TCPC_MUX_USB_ENABLED BIT(0) /* USB enabled */
9051 #define TCPC_MUX_DP_ENABLED BIT(1) /* DP enabled */
@@ -92,7 +53,6 @@ struct tcpc_config { · 1 unmodified line
9253
9354 /**
9455 * struct tcpc_dev - Port configuration and callback functions
95− * @config: Pointer to port configuration
9656 * @fwnode: Pointer to port fwnode
9757 * @get_vbus: Called to read current VBUS state
9858 * @get_current_limit:
@@ -121,7 +81,6 @@ struct tcpc_config { · 22 unmodified lines
12181 * @mux: Pointer to multiplexer data
12282 */
12383 struct tcpc_dev {
124− const struct tcpc_config *config;
12584 struct fwnode_handle *fwnode;
12685
12786 int (*init)(struct tcpc_dev *dev);
include/linux/usb/typec.h+23−18
@@ -168,6 +168,23 @@ struct typec_partner_desc { · 167 unmodified lines
168168 struct usb_pd_identity *identity;
169169 };
170170
171+/**
172+ * struct typec_operations - USB Type-C Port Operations
173+ * @try_role: Set data role preference for DRP port
174+ * @dr_set: Set Data Role
175+ * @pr_set: Set Power Role
176+ * @vconn_set: Source VCONN
177+ * @port_type_set: Set port type
178+ */
179+struct typec_operations {
180+ int (*try_role)(struct typec_port *port, int role);
181+ int (*dr_set)(struct typec_port *port, enum typec_data_role role);
182+ int (*pr_set)(struct typec_port *port, enum typec_role role);
183+ int (*vconn_set)(struct typec_port *port, enum typec_role role);
184+ int (*port_type_set)(struct typec_port *port,
185+ enum typec_port_type type);
186+};
187+
171188 /*
172189 * struct typec_capability - USB Type-C Port Capabilities
173190 * @type: Supported power role of the port
@@ -179,11 +196,8 @@ struct typec_partner_desc { · 5 unmodified lines
179196 * @sw: Cable plug orientation switch
180197 * @mux: Multiplexer switch for Alternate/Accessory Modes
181198 * @fwnode: Optional fwnode of the port
182− * @try_role: Set data role preference for DRP port
183− * @dr_set: Set Data Role
184− * @pr_set: Set Power Role
185− * @vconn_set: Set VCONN Role
186− * @port_type_set: Set port type
199+ * @driver_data: Private pointer for driver specific info
200+ * @ops: Port operations vector
187201 *
188202 * Static capabilities of a single USB Type-C port.
189203 */
@@ -195,21 +209,10 @@ struct typec_capability { · 5 unmodified lines
195209 int prefer_role;
196210 enum typec_accessory accessory[TYPEC_MAX_ACCESSORY];
197211
198− struct typec_switch *sw;
199− struct typec_mux *mux;
200212 struct fwnode_handle *fwnode;
213+ void *driver_data;
201214
202− int (*try_role)(const struct typec_capability *,
203− int role);
204−
205− int (*dr_set)(const struct typec_capability *,
206− enum typec_data_role);
207− int (*pr_set)(const struct typec_capability *,
208− enum typec_role);
209− int (*vconn_set)(const struct typec_capability *,
210− enum typec_role);
211− int (*port_type_set)(const struct typec_capability *,
212− enum typec_port_type);
215+ const struct typec_operations *ops;
213216 };
214217
215218 /* Specific to try_role(). Indicates the user want's to clear the preference. */
@@ -241,6 +244,8 @@ int typec_set_orientation(struct typec_port *port, · 25 unmodified lines
241244 enum typec_orientation typec_get_orientation(struct typec_port *port);
242245 int typec_set_mode(struct typec_port *port, int mode);
243246
247+void *typec_get_drvdata(struct typec_port *port);
248+
244249 int typec_find_port_power_role(const char *name);
245250 int typec_find_power_role(const char *name);
246251 int typec_find_port_data_role(const char *name);
include/linux/virtio_vsock.h+3−15
@@ -7,9 +7,6 @@ · 6 unmodified lines
77 #include <net/sock.h>
88 #include <net/af_vsock.h>
99
10−#define VIRTIO_VSOCK_DEFAULT_MIN_BUF_SIZE 128
11−#define VIRTIO_VSOCK_DEFAULT_BUF_SIZE (1024 * 256)
12−#define VIRTIO_VSOCK_DEFAULT_MAX_BUF_SIZE (1024 * 256)
1310 #define VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE (1024 * 4)
1411 #define VIRTIO_VSOCK_MAX_BUF_SIZE 0xFFFFFFFFUL
1512 #define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE (1024 * 64)
@@ -25,11 +22,6 @@ enum { · 9 unmodified lines
2522 struct virtio_vsock_sock {
2623 struct vsock_sock *vsk;
2724
28− /* Protected by lock_sock(sk_vsock(trans->vsk)) */
29− u32 buf_size;
30− u32 buf_size_min;
31− u32 buf_size_max;
32−
3325 spinlock_t tx_lock;
3426 spinlock_t rx_lock;
3527
@@ -92,12 +84,6 @@ s64 virtio_transport_stream_has_space(struct vsock_sock *vsk); · 56 unmodified lines
9284
9385 int virtio_transport_do_socket_init(struct vsock_sock *vsk,
9486 struct vsock_sock *psk);
95−u64 virtio_transport_get_buffer_size(struct vsock_sock *vsk);
96−u64 virtio_transport_get_min_buffer_size(struct vsock_sock *vsk);
97−u64 virtio_transport_get_max_buffer_size(struct vsock_sock *vsk);
98−void virtio_transport_set_buffer_size(struct vsock_sock *vsk, u64 val);
99−void virtio_transport_set_min_buffer_size(struct vsock_sock *vsk, u64 val);
100−void virtio_transport_set_max_buffer_size(struct vsock_sock *vs, u64 val);
10187 int
10288 virtio_transport_notify_poll_in(struct vsock_sock *vsk,
10389 size_t target,
@@ -124,6 +110,7 @@ int virtio_transport_notify_send_pre_enqueue(struct vsock_sock *vsk, · 20 unmodified lines
124110 struct vsock_transport_send_notify_data *data);
125111 int virtio_transport_notify_send_post_enqueue(struct vsock_sock *vsk,
126112 ssize_t written, struct vsock_transport_send_notify_data *data);
113+void virtio_transport_notify_buffer_size(struct vsock_sock *vsk, u64 *val);
127114
128115 u64 virtio_transport_stream_rcvhiwat(struct vsock_sock *vsk);
129116 bool virtio_transport_stream_is_active(struct vsock_sock *vsk);
@@ -150,7 +137,8 @@ virtio_transport_dgram_enqueue(struct vsock_sock *vsk, · 20 unmodified lines
150137
151138 void virtio_transport_destruct(struct vsock_sock *vsk);
152139
153−void virtio_transport_recv_pkt(struct virtio_vsock_pkt *pkt);
140+void virtio_transport_recv_pkt(struct virtio_transport *t,
141+ struct virtio_vsock_pkt *pkt);
154142 void virtio_transport_free_pkt(struct virtio_vsock_pkt *pkt);
155143 void virtio_transport_inc_tx_pkt(struct virtio_vsock_sock *vvs, struct virtio_vsock_pkt *pkt);
156144 u32 virtio_transport_get_credit(struct virtio_vsock_sock *vvs, u32 wanted);
include/linux/vm_sockets.h+0−15
@@ -1,15 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/*
3− * VMware vSockets Driver
4− *
5− * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
6− */
7−
8−#ifndef _VM_SOCKETS_H
9−#define _VM_SOCKETS_H
10−
11−#include <uapi/linux/vm_sockets.h>
12−
13−int vm_sockets_get_local_cid(void);
14−
15−#endif /* _VM_SOCKETS_H */
include/linux/vmalloc.h+13−0
@@ -22,6 +22,18 @@ struct notifier_block; /* in notifier.h */ · 21 unmodified lines
2222 #define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */
2323 #define VM_NO_GUARD 0x00000040 /* don't add guard page */
2424 #define VM_KASAN 0x00000080 /* has allocated kasan shadow memory */
25+
26+/*
27+ * VM_KASAN is used slighly differently depending on CONFIG_KASAN_VMALLOC.
28+ *
29+ * If IS_ENABLED(CONFIG_KASAN_VMALLOC), VM_KASAN is set on a vm_struct after
30+ * shadow memory has been mapped. It's used to handle allocation errors so that
31+ * we don't try to poision shadow on free if it was never allocated.
32+ *
33+ * Otherwise, VM_KASAN is set for kasan_module_alloc() allocations and used to
34+ * determine which allocations need the module shadow freed.
35+ */
36+
2537 /*
2638 * Memory with VM_FLUSH_RESET_PERMS cannot be freed in an interrupt or with
2739 * vfree_atomic().
@@ -93,6 +105,7 @@ extern void *vzalloc(unsigned long size); · 65 unmodified lines
93105 extern void *vmalloc_user(unsigned long size);
94106 extern void *vmalloc_node(unsigned long size, int node);
95107 extern void *vzalloc_node(unsigned long size, int node);
108+extern void *vmalloc_user_node_flags(unsigned long size, int node, gfp_t flags);
96109 extern void *vmalloc_exec(unsigned long size);
97110 extern void *vmalloc_32(unsigned long size);
98111 extern void *vmalloc_32_user(unsigned long size);
include/linux/vmstat.h+50−0
@@ -31,6 +31,12 @@ struct reclaim_stat { · 30 unmodified lines
3131 unsigned nr_unmap_fail;
3232 };
3333
34+enum writeback_stat_item {
35+ NR_DIRTY_THRESHOLD,
36+ NR_DIRTY_BG_THRESHOLD,
37+ NR_VM_WRITEBACK_STAT_ITEMS,
38+};
39+
3440 #ifdef CONFIG_VM_EVENT_COUNTERS
3541 /*
3642 * Light weight per cpu counter implementation.
@@ -381,4 +387,48 @@ static inline void __mod_zone_freepage_state(struct zone *zone, int nr_pages, · 344 unmodified lines
381387
382388 extern const char * const vmstat_text[];
383389
390+static inline const char *zone_stat_name(enum zone_stat_item item)
391+{
392+ return vmstat_text[item];
393+}
394+
395+#ifdef CONFIG_NUMA
396+static inline const char *numa_stat_name(enum numa_stat_item item)
397+{
398+ return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
399+ item];
400+}
401+#endif /* CONFIG_NUMA */
402+
403+static inline const char *node_stat_name(enum node_stat_item item)
404+{
405+ return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
406+ NR_VM_NUMA_STAT_ITEMS +
407+ item];
408+}
409+
410+static inline const char *lru_list_name(enum lru_list lru)
411+{
412+ return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
413+}
414+
415+static inline const char *writeback_stat_name(enum writeback_stat_item item)
416+{
417+ return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
418+ NR_VM_NUMA_STAT_ITEMS +
419+ NR_VM_NODE_STAT_ITEMS +
420+ item];
421+}
422+
423+#if defined(CONFIG_VM_EVENT_COUNTERS) || defined(CONFIG_MEMCG)
424+static inline const char *vm_event_name(enum vm_event_item item)
425+{
426+ return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
427+ NR_VM_NUMA_STAT_ITEMS +
428+ NR_VM_NODE_STAT_ITEMS +
429+ NR_VM_WRITEBACK_STAT_ITEMS +
430+ item];
431+}
432+#endif /* CONFIG_VM_EVENT_COUNTERS || CONFIG_MEMCG */
433+
384434 #endif /* _LINUX_VMSTAT_H */
include/linux/vmw_vmci_api.h+2−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 struct msghdr;
2020 typedef void (vmci_device_shutdown_fn) (void *device_registration,
2121 void *user_data);
22+typedef void (*vmci_vsock_cb) (bool is_host);
2223
2324 int vmci_datagram_create_handle(u32 resource_id, u32 flags,
2425 vmci_datagram_recv_cb recv_cb,
@@ -37,6 +38,7 @@ int vmci_doorbell_destroy(struct vmci_handle handle); · 12 unmodified lines
3738 int vmci_doorbell_notify(struct vmci_handle handle, u32 priv_flags);
3839 u32 vmci_get_context_id(void);
3940 bool vmci_is_context_owner(u32 context_id, kuid_t uid);
41+int vmci_register_vsock_callback(vmci_vsock_cb callback);
4042
4143 int vmci_event_subscribe(u32 event,
4244 vmci_event_cb callback, void *callback_data,
include/linux/vtime.h+30−29
@@ -11,11 +11,15 @@ · 10 unmodified lines
1111 struct task_struct;
1212
1313 /*
14− * vtime_accounting_cpu_enabled() definitions/declarations
14+ * vtime_accounting_enabled_this_cpu() definitions/declarations
1515 */
1616 #if defined(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE)
17−static inline bool vtime_accounting_cpu_enabled(void) { return true; }
17+
18+static inline bool vtime_accounting_enabled_this_cpu(void) { return true; }
19+extern void vtime_task_switch(struct task_struct *prev);
20+
1821 #elif defined(CONFIG_VIRT_CPU_ACCOUNTING_GEN)
22+
1923 /*
2024 * Checks if vtime is enabled on some CPU. Cputime readers want to be careful
2125 * in that case and compute the tickless cputime.
@@ -24,46 +28,43 @@ static inline bool vtime_accounting_cpu_enabled(void) { return true; } · 2 unmodified lines
2428 */
2529 static inline bool vtime_accounting_enabled(void)
2630 {
27− return context_tracking_is_enabled();
31+ return context_tracking_enabled();
2832 }
2933
30−static inline bool vtime_accounting_cpu_enabled(void)
34+static inline bool vtime_accounting_enabled_cpu(int cpu)
3135 {
32− if (vtime_accounting_enabled()) {
33− if (context_tracking_cpu_is_enabled())
34− return true;
35− }
36−
37− return false;
36+ return context_tracking_enabled_cpu(cpu);
3837 }
39−#else /* !CONFIG_VIRT_CPU_ACCOUNTING */
40−static inline bool vtime_accounting_cpu_enabled(void) { return false; }
41−#endif
4238
39+static inline bool vtime_accounting_enabled_this_cpu(void)
40+{
41+ return context_tracking_enabled_this_cpu();
42+}
4343
44−/*
45− * Common vtime APIs
46− */
47−#ifdef CONFIG_VIRT_CPU_ACCOUNTING
44+extern void vtime_task_switch_generic(struct task_struct *prev);
4845
49−#ifdef __ARCH_HAS_VTIME_TASK_SWITCH
50−extern void vtime_task_switch(struct task_struct *prev);
51−#else
52−extern void vtime_common_task_switch(struct task_struct *prev);
5346 static inline void vtime_task_switch(struct task_struct *prev)
5447 {
55− if (vtime_accounting_cpu_enabled())
56− vtime_common_task_switch(prev);
48+ if (vtime_accounting_enabled_this_cpu())
49+ vtime_task_switch_generic(prev);
5750 }
58−#endif /* __ARCH_HAS_VTIME_TASK_SWITCH */
59−
60−extern void vtime_account_system(struct task_struct *tsk);
61−extern void vtime_account_idle(struct task_struct *tsk);
6251
6352 #else /* !CONFIG_VIRT_CPU_ACCOUNTING */
6453
54+static inline bool vtime_accounting_enabled_cpu(int cpu) {return false; }
55+static inline bool vtime_accounting_enabled_this_cpu(void) { return false; }
6556 static inline void vtime_task_switch(struct task_struct *prev) { }
66−static inline void vtime_account_system(struct task_struct *tsk) { }
57+
58+#endif
59+
60+/*
61+ * Common vtime APIs
62+ */
63+#ifdef CONFIG_VIRT_CPU_ACCOUNTING
64+extern void vtime_account_kernel(struct task_struct *tsk);
65+extern void vtime_account_idle(struct task_struct *tsk);
66+#else /* !CONFIG_VIRT_CPU_ACCOUNTING */
67+static inline void vtime_account_kernel(struct task_struct *tsk) { }
6768 #endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
6869
6970 #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
@@ -86,7 +87,7 @@ extern void vtime_account_irq_enter(struct task_struct *tsk); · 16 unmodified lines
8687 static inline void vtime_account_irq_exit(struct task_struct *tsk)
8788 {
8889 /* On hard|softirq exit we always account to hard|softirq cputime */
89− vtime_account_system(tsk);
90+ vtime_account_kernel(tsk);
9091 }
9192 extern void vtime_flush(struct task_struct *tsk);
9293 #else /* !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
include/linux/w1.h+1−0
@@ -262,6 +262,7 @@ struct w1_family_ops { · 261 unmodified lines
262262 * @family_entry: family linked list
263263 * @fid: 8 bit family identifier
264264 * @fops: operations for this family
265+ * @of_match_table: open firmware match table
265266 * @refcnt: reference counter
266267 */
267268 struct w1_family {
include/linux/wait.h+7−4
@@ -201,9 +201,10 @@ void __wake_up(struct wait_queue_head *wq_head, unsigned int mode, int nr, void · 200 unmodified lines
201201 void __wake_up_locked_key(struct wait_queue_head *wq_head, unsigned int mode, void *key);
202202 void __wake_up_locked_key_bookmark(struct wait_queue_head *wq_head,
203203 unsigned int mode, void *key, wait_queue_entry_t *bookmark);
204−void __wake_up_sync_key(struct wait_queue_head *wq_head, unsigned int mode, int nr, void *key);
204+void __wake_up_sync_key(struct wait_queue_head *wq_head, unsigned int mode, void *key);
205+void __wake_up_locked_sync_key(struct wait_queue_head *wq_head, unsigned int mode, void *key);
205206 void __wake_up_locked(struct wait_queue_head *wq_head, unsigned int mode, int nr);
206−void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode, int nr);
207+void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode);
207208
208209 #define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL)
209210 #define wake_up_nr(x, nr) __wake_up(x, TASK_NORMAL, nr, NULL)
@@ -214,7 +215,7 @@ void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode, int nr); · 4 unmodified lines
214215 #define wake_up_interruptible(x) __wake_up(x, TASK_INTERRUPTIBLE, 1, NULL)
215216 #define wake_up_interruptible_nr(x, nr) __wake_up(x, TASK_INTERRUPTIBLE, nr, NULL)
216217 #define wake_up_interruptible_all(x) __wake_up(x, TASK_INTERRUPTIBLE, 0, NULL)
217−#define wake_up_interruptible_sync(x) __wake_up_sync((x), TASK_INTERRUPTIBLE, 1)
218+#define wake_up_interruptible_sync(x) __wake_up_sync((x), TASK_INTERRUPTIBLE)
218219
219220 /*
220221 * Wakeup macros to be used to report events to the targets.
@@ -228,7 +229,9 @@ void __wake_up_sync(struct wait_queue_head *wq_head, unsigned int mode, int nr); · 7 unmodified lines
228229 #define wake_up_interruptible_poll(x, m) \
229230 __wake_up(x, TASK_INTERRUPTIBLE, 1, poll_to_key(m))
230231 #define wake_up_interruptible_sync_poll(x, m) \
231− __wake_up_sync_key((x), TASK_INTERRUPTIBLE, 1, poll_to_key(m))
232+ __wake_up_sync_key((x), TASK_INTERRUPTIBLE, poll_to_key(m))
233+#define wake_up_interruptible_sync_poll_locked(x, m) \
234+ __wake_up_locked_sync_key((x), TASK_INTERRUPTIBLE, poll_to_key(m))
232235
233236 #define ___wait_cond_timeout(condition) \
234237 ({ \
include/linux/ww_mutex.h+1−1
@@ -182,7 +182,7 @@ static inline void ww_acquire_done(struct ww_acquire_ctx *ctx) · 181 unmodified lines
182182 static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx)
183183 {
184184 #ifdef CONFIG_DEBUG_MUTEXES
185− mutex_release(&ctx->dep_map, 0, _THIS_IP_);
185+ mutex_release(&ctx->dep_map, _THIS_IP_);
186186
187187 DEBUG_LOCKS_WARN_ON(ctx->acquired);
188188 if (!IS_ENABLED(CONFIG_PROVE_LOCKING))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

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

Repository code

Go to file
t