History

Merge drm/drm-next into drm-misc-next

Backmerging 5.2-rc1 to -misc-next for robher

Sean Paul committed 7 years ago

Commit 374ed542 parents 270afb3 a18833910984 files · +473676 −302814Browse files

Showing the changes to include/linux (333 of 10984 files). Show all

Unified · Split

333 files
  1. include/linux/acpi.h +11 −4
  2. include/linux/acpi_iort.h +8 −0
  3. include/linux/alcor_pci.h +1 −1
  4. include/linux/amba/clcd.h +0 −31
  5. include/linux/armada-37xx-rwtm-mailbox.h +23 −0
  6. include/linux/atmel_tc.h +0 −270
  7. include/linux/audit.h +75 −0
  8. include/linux/balloon_compaction.h +0 −15
  9. include/linux/binfmts.h +2 −1
  10. include/linux/bio.h +3 −17
  11. include/linux/bitops.h +8 −8
  12. include/linux/blk-mq-rdma.h +1 −0
  13. include/linux/blk-mq.h +2 −0
  14. include/linux/blk_types.h +16 −13
  15. include/linux/blkdev.h +41 −2
  16. include/linux/bpf-cgroup.h +21 −0
  17. include/linux/bpf.h +76 −10
  18. include/linux/bpf_types.h +3 −0
  19. include/linux/bpf_verifier.h +32 −0
  20. include/linux/bsg-lib.h +1 −15
  21. include/linux/btf.h +1 −0
  22. include/linux/bvec.h +7 −30
  23. include/linux/ceph/ceph_fs.h +6 −0
  24. include/linux/ceph/messenger.h +2 −1
  25. include/linux/ceph/osdmap.h +6 −7
  26. include/linux/cgroup-defs.h +33 −0
  27. include/linux/cgroup.h +43 −0
  28. include/linux/clk-provider.h +53 −60
  29. include/linux/clk.h +16 −0
  30. include/linux/clk/analogbits-wrpll-cln28hpc.h +79 −0
  31. include/linux/clk/at91_pmc.h +4 −9
  32. include/linux/clk/ti.h +2 −0
  33. include/linux/compiler.h +18 −17
  34. include/linux/compiler_types.h +1 −2
  35. include/linux/console.h +6 −1
  36. include/linux/coresight-pmu.h +2 −0
  37. include/linux/coresight.h +4 −3
  38. include/linux/counter.h +510 −0
  39. include/linux/counter_enum.h +45 −0
  40. include/linux/cper.h +167 −169
  41. include/linux/cpu.h +45 −1
  42. include/linux/cpufreq.h +21 −7
  43. include/linux/cpuhotplug.h +2 −0
  44. include/linux/cpuidle.h +1 −0
  45. include/linux/cpumask.h +1 −2
  46. include/linux/cred.h +1 −1
  47. include/linux/dcache.h +3 −4
  48. include/linux/device-mapper.h +2 −1
  49. include/linux/device.h +9 −9
  50. include/linux/dma-iommu.h +22 −2
  51. include/linux/dma-mapping.h +3 −3
  52. include/linux/dma-noncoherent.h +6 −0
  53. include/linux/dma/idma64.h +14 −0
  54. include/linux/dmi.h +2 −6
  55. include/linux/dns_resolver.h +2 −1
  56. include/linux/dsa/8021q.h +76 −0
  57. include/linux/dsa/sja1105.h +40 −0
  58. include/linux/dynamic_debug.h +11 −0
  59. include/linux/efi.h +6 −1
  60. include/linux/elevator.h +1 −0
  61. include/linux/etherdevice.h +13 −1
  62. include/linux/f2fs_fs.h +8 −3
  63. include/linux/filter.h +20 −14
  64. include/linux/firmware/imx/sci.h +5 −0
  65. include/linux/firmware/intel/stratix10-smc.h +19 −0
  66. include/linux/firmware/trusted_foundations.h +96 −0
  67. include/linux/firmware/xlnx-zynqmp.h +13 −1
  68. include/linux/fs.h +16 −4
  69. include/linux/fs_context.h +31 −7
  70. include/linux/fscrypt.h +63 −22
  71. include/linux/fsl/ftm.h +88 −0
  72. include/linux/fsnotify.h +4 −37
  73. include/linux/fsnotify_backend.h +7 −3
  74. include/linux/ftrace.h +6 −14
  75. include/linux/genhd.h +14 −6
  76. include/linux/genl_magic_func.h +2 −2
  77. include/linux/gfp.h +2 −2
  78. include/linux/gpio/driver.h +12 −6
  79. include/linux/gpio/machine.h +14 −12
  80. include/linux/hid.h +3 −1
  81. include/linux/hmm.h +250 −60
  82. include/linux/huge_mm.h +2 −4
  83. include/linux/hugetlb.h +1 −3
  84. include/linux/hwmon.h +18 −0
  85. include/linux/hyperv.h +6 −1
  86. include/linux/i2c-algo-bit.h +1 −0
  87. include/linux/i2c.h +30 −14
  88. include/linux/ieee80211.h +9 −5
  89. include/linux/if_bridge.h +0 −3
  90. include/linux/iio/adc/ad_sigma_delta.h +1 −0
  91. include/linux/iio/consumer.h +14 −0
  92. include/linux/iio/driver.h +1 −0
  93. include/linux/iio/frequency/ad9523.h +4 −4
  94. include/linux/iio/gyro/itg3200.h +1 −0
  95. include/linux/iio/iio.h +2 −2
  96. include/linux/iio/imu/adis.h +14 −0
  97. include/linux/iio/timer/stm32-timer-trigger.h +10 −1
  98. include/linux/ima.h +1 −1
  99. include/linux/inetdevice.h +14 −0
  100. include/linux/intel-iommu.h +12 −1
  101. include/linux/intel-ish-client-if.h +112 −0
  102. include/linux/interrupt.h +0 −25
  103. include/linux/iomap.h +17 −5
  104. include/linux/iommu.h +144 −0
  105. include/linux/iova.h +8 −8
  106. include/linux/ipc_namespace.h +1 −0
  107. include/linux/irq.h +2 −0
  108. include/linux/irqchip/arm-gic-v3.h +6 −6
  109. include/linux/irqchip/irq-ixp4xx.h +12 −0
  110. include/linux/irqdomain.h +1 −0
  111. include/linux/jbd2.h +5 −4
  112. include/linux/jiffies.h +1 −0
  113. include/linux/jump_label_ratelimit.h +61 −3
  114. include/linux/kernel.h +3 −12
  115. include/linux/kernfs.h +14 −1
  116. include/linux/kobject.h +2 −1
  117. include/linux/kprobes.h +1 −0
  118. include/linux/kthread.h +2 −1
  119. include/linux/kvm_host.h +54 −4
  120. include/linux/latencytop.h +2 −2
  121. include/linux/lightnvm.h +2 −0
  122. include/linux/list.h +36 −1
  123. include/linux/list_bl.h +26 −0
  124. include/linux/list_sort.h +1 −0
  125. include/linux/livepatch.h +0 −3
  126. include/linux/lockd/bind.h +2 −1
  127. include/linux/lockd/lockd.h +3 −1
  128. include/linux/lockdep.h +8 −3
  129. include/linux/lsm_hooks.h +100 −89
  130. include/linux/marvell_phy.h +1 −0
  131. include/linux/math64.h +13 −0
  132. include/linux/mdev.h +24 −11
  133. include/linux/mdio.h +2 −1
  134. include/linux/mei_cl_bus.h +3 −0
  135. include/linux/memblock.h +43 −1
  136. include/linux/memcontrol.h +58 −84
  137. include/linux/memory.h +1 −1
  138. include/linux/memory_hotplug.h +30 −12
  139. include/linux/mfd/altera-sysmgr.h +29 −0
  140. include/linux/mfd/cros_ec.h +5 −0
  141. include/linux/mfd/cros_ec_commands.h +90 −1
  142. include/linux/mfd/da9063/core.h +1 −6
  143. include/linux/mfd/da9063/registers.h +4 −9
  144. include/linux/mfd/max77620.h +3 −2
  145. include/linux/mfd/max77650.h +59 −0
  146. include/linux/mfd/palmas.h +0 −1
  147. include/linux/mfd/stmfx.h +123 −0
  148. include/linux/mfd/syscon/atmel-matrix.h +1 −5
  149. include/linux/mfd/syscon/atmel-mc.h +1 −5
  150. include/linux/mfd/syscon/atmel-smc.h +1 −4
  151. include/linux/mfd/syscon/atmel-st.h +1 −5
  152. include/linux/mfd/syscon/imx6q-iomuxc-gpr.h +9 −0
  153. include/linux/mfd/ti-lmu-register.h +0 −44
  154. include/linux/mfd/ti-lmu.h +0 −1
  155. include/linux/mfd/wm831x/regulator.h +1 −1
  156. include/linux/mfd/wm8400-private.h +0 −8
  157. include/linux/mlx5/cq.h +1 −1
  158. include/linux/mlx5/device.h +10 −1
  159. include/linux/mlx5/doorbell.h +9 −30
  160. include/linux/mlx5/driver.h +11 −3
  161. include/linux/mlx5/eswitch.h +1 −1
  162. include/linux/mlx5/fs.h +7 −0
  163. include/linux/mlx5/mlx5_ifc.h +168 −17
  164. include/linux/mlx5/port.h +1 −0
  165. include/linux/mlx5/qp.h +1 −0
  166. include/linux/mlx5/transobj.h +3 −0
  167. include/linux/mlx5/vport.h +0 −4
  168. include/linux/mm.h +102 −33
  169. include/linux/mm_inline.h +1 −1
  170. include/linux/mm_types.h +4 −1
  171. include/linux/mmc/sdio_func.h +12 −0
  172. include/linux/mmc/sdio_ids.h +2 −0
  173. include/linux/mmu_notifier.h +59 −4
  174. include/linux/mmzone.h +59 −5
  175. include/linux/module.h +24 −0
  176. include/linux/moduleparam.h +5 −7
  177. include/linux/mount.h +2 −0
  178. include/linux/msi.h +36 −18
  179. include/linux/mtd/bbm.h +1 −13
  180. include/linux/mtd/nand.h +31 −1
  181. include/linux/mtd/nand_bch.h +3 −3
  182. include/linux/mtd/onenand.h +3 −0
  183. include/linux/mtd/rawnand.h +73 −49
  184. include/linux/mtd/spinand.h +7 −0
  185. include/linux/net.h +2 −0
  186. include/linux/netdevice.h +51 −47
  187. include/linux/netfilter.h +17 −1
  188. include/linux/netfilter/ipset/ip_set.h +4 −7
  189. include/linux/netfilter/nfnetlink_osf.h +8 −3
  190. include/linux/netfilter/x_tables.h +0 −1
  191. include/linux/netfilter_ipv6.h +15 −0
  192. include/linux/nfs_fs.h +0 −1
  193. include/linux/nfs_fs_sb.h +13 −0
  194. include/linux/nfs_page.h +9 −3
  195. include/linux/node.h +71 −0
  196. include/linux/nvme-fc-driver.h +0 −6
  197. include/linux/nvme-rdma.h +1 −1
  198. include/linux/nvme.h +2 −2
  199. include/linux/nvmem-consumer.h +7 −0
  200. include/linux/of.h +4 −3
  201. include/linux/oid_registry.h +18 −0
  202. include/linux/overflow.h +15 −5
  203. include/linux/packing.h +49 −0
  204. include/linux/pagemap.h +14 −12
  205. include/linux/pci-ecam.h +1 −0
  206. include/linux/pci-epc.h +2 −0
  207. include/linux/pci-epf.h +2 −1
  208. include/linux/pci.h +27 −16
  209. include/linux/pci_hotplug.h +56 −10
  210. include/linux/percpu.h +3 −9
  211. include/linux/perf_event.h +15 −6
  212. include/linux/phy.h +6 −8
  213. include/linux/phy/phy.h +2 −0
  214. include/linux/pid.h +2 −0
  215. include/linux/pipe_fs_i.h +1 −0
  216. include/linux/platform_data/ads7828.h +1 −1
  217. include/linux/platform_data/ds620.h +1 −1
  218. include/linux/platform_data/elm.h +1 −1
  219. include/linux/platform_data/eth-ep93xx.h +10 −0
  220. include/linux/platform_data/gpio-omap.h +0 −2
  221. include/linux/platform_data/ina2xx.h +1 −1
  222. include/linux/platform_data/keypad-ep93xx.h +2 −2
  223. include/linux/platform_data/lm3630a_bl.h +4 −0
  224. include/linux/platform_data/macb.h +0 −9
  225. include/linux/platform_data/max197.h +1 −1
  226. include/linux/platform_data/mv88e6xxx.h +1 −0
  227. include/linux/platform_data/ntc_thermistor.h +1 −1
  228. include/linux/platform_data/pca954x.h +0 −48
  229. include/linux/platform_data/pm33xx.h +5 −0
  230. include/linux/platform_data/spi-ep93xx.h +0 −4
  231. include/linux/platform_data/ti-sysc.h +7 −2
  232. include/linux/platform_data/timer-ixp4xx.h +11 −0
  233. include/linux/platform_data/wilco-ec.h +2 −20
  234. include/linux/platform_data/x86/asus-wmi.h +1 −0
  235. include/linux/platform_data/xilinx-ll-temac.h +32 −0
  236. include/linux/platform_data/xtalk-bridge.h +22 −0
  237. include/linux/plist.h +2 −2
  238. include/linux/pm_domain.h +25 −1
  239. include/linux/pm_opp.h +8 −0
  240. include/linux/poll.h +4 −0
  241. include/linux/power_supply.h +9 −2
  242. include/linux/pps-gpio.h +3 −2
  243. include/linux/printk.h +4 −2
  244. include/linux/property.h +18 −0
  245. include/linux/psi.h +9 −0
  246. include/linux/psi_types.h +93 −12
  247. include/linux/psp-sev.h +1 −2
  248. include/linux/pwm.h +0 −5
  249. include/linux/qcom-geni-se.h +1 −1
  250. include/linux/qed/qed_if.h +0 −2
  251. include/linux/random.h +2 −1
  252. include/linux/rcupdate.h +4 −2
  253. include/linux/rcuwait.h +1 −1
  254. include/linux/reboot.h +2 −0
  255. include/linux/regulator/consumer.h +5 −0
  256. include/linux/reset.h +2 −0
  257. include/linux/rhashtable-types.h +0 −2
  258. include/linux/rhashtable.h +235 −123
  259. include/linux/rtc.h +3 −3
  260. include/linux/rtc/ds1685.h +0 −2
  261. include/linux/rtc/rtc-omap.h +7 −0
  262. include/linux/rwsem-spinlock.h +0 −47
  263. include/linux/rwsem.h +16 −21
  264. include/linux/scatterlist.h +5 −5
  265. include/linux/sched.h +2 −5
  266. include/linux/sched/jobctl.h +2 −0
  267. include/linux/sched/mm.h +21 −0
  268. include/linux/sched/signal.h +26 −25
  269. include/linux/sched/task.h +1 −0
  270. include/linux/sched/topology.h +2 −2
  271. include/linux/sched/user.h +7 −0
  272. include/linux/security.h +16 −0
  273. include/linux/sed-opal.h +1 −9
  274. include/linux/selection.h +4 −3
  275. include/linux/serial_core.h +1 −1
  276. include/linux/set_memory.h +11 −0
  277. include/linux/shmem_fs.h +1 −0
  278. include/linux/siphash.h +5 −0
  279. include/linux/skbuff.h +28 −20
  280. include/linux/slab_def.h +0 −3
  281. include/linux/smpboot.h +1 −1
  282. include/linux/soc/cirrus/ep93xx.h +37 −0
  283. include/linux/soc/ixp4xx/npe.h +38 −0
  284. include/linux/soc/ixp4xx/qmgr.h +91 −0
  285. include/linux/soc/ti/ti_sci_inta_msi.h +23 −0
  286. include/linux/soc/ti/ti_sci_protocol.h +124 −0
  287. include/linux/soundwire/sdw.h +8 −8
  288. include/linux/soundwire/sdw_intel.h +3 −3
  289. include/linux/soundwire/sdw_registers.h +2 −3
  290. include/linux/soundwire/sdw_type.h +3 −3
  291. include/linux/spi/pxa2xx_spi.h +1 −0
  292. include/linux/spi/spi-mem.h +12 −0
  293. include/linux/spi/spi.h +19 −5
  294. include/linux/spi/spi_bitbang.h +1 −0
  295. include/linux/spinlock.h +10 −1
  296. include/linux/srcu.h +1 −35
  297. include/linux/stackdepot.h +4 −4
  298. include/linux/stacktrace.h +65 −16
  299. include/linux/string.h +4 −0
  300. include/linux/sunrpc/clnt.h +4 −0
  301. include/linux/sunrpc/sched.h +15 −5
  302. include/linux/sunrpc/svc.h +33 −0
  303. include/linux/sunrpc/svc_xprt.h +3 −1
  304. include/linux/sunrpc/svcsock.h +2 −1
  305. include/linux/sunrpc/xprt.h +3 −3
  306. include/linux/suspend.h +3 −0
  307. include/linux/switchtec.h +1 −1
  308. include/linux/syscalls.h +9 −0
  309. include/linux/thermal.h +16 −3
  310. include/linux/thunderbolt.h +8 −0
  311. include/linux/ti-emif-sram.h +3 −0
  312. include/linux/tick.h +12 −1
  313. include/linux/time64.h +21 −0
  314. include/linux/tracepoint-defs.h +1 −0
  315. include/linux/tracepoint.h +15 −0
  316. include/linux/types.h +0 −5
  317. include/linux/uaccess.h +2 −0
  318. include/linux/uio.h +1 −1
  319. include/linux/unicode.h +30 −0
  320. include/linux/uprobes.h +5 −0
  321. include/linux/usb.h +1 −3
  322. include/linux/usb/ch9.h +8 −0
  323. include/linux/usb/hcd.h +6 −0
  324. include/linux/usb/serial.h +1 −7
  325. include/linux/usb/tcpm.h +7 −6
  326. include/linux/usb/typec_dp.h +5 −0
  327. include/linux/userfaultfd_k.h +2 −0
  328. include/linux/virtio.h +0 −17
  329. include/linux/vmalloc.h +20 −1
  330. include/linux/vmstat.h +1 −1
  331. include/linux/vmw_vmci_defs.h +18 −17
  332. include/linux/wait.h +1 −1
  333. include/linux/wait_bit.h +13 −0
include/linux/acpi.h+11−4
@@ -141,10 +141,14 @@ enum acpi_address_range_id { · 140 unmodified lines
141141
142142
143143 /* Table Handlers */
144+union acpi_subtable_headers {
145+ struct acpi_subtable_header common;
146+ struct acpi_hmat_structure hmat;
147+};
144148
145149 typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table);
146150
147−typedef int (*acpi_tbl_entry_handler)(struct acpi_subtable_header *header,
151+typedef int (*acpi_tbl_entry_handler)(union acpi_subtable_headers *header,
148152 const unsigned long end);
149153
150154 /* Debugger support */
@@ -513,7 +517,8 @@ extern bool osc_pc_lpi_support_confirmed; · 362 unmodified lines
513517 #define OSC_PCI_CLOCK_PM_SUPPORT 0x00000004
514518 #define OSC_PCI_SEGMENT_GROUPS_SUPPORT 0x00000008
515519 #define OSC_PCI_MSI_SUPPORT 0x00000010
516−#define OSC_PCI_SUPPORT_MASKS 0x0000001f
520+#define OSC_PCI_HPX_TYPE_3_SUPPORT 0x00000100
521+#define OSC_PCI_SUPPORT_MASKS 0x0000011f
517522
518523 /* PCI Host Bridge _OSC: Capabilities DWORD 3: Control Field */
519524 #define OSC_PCI_EXPRESS_NATIVE_HP_CONTROL 0x00000001
@@ -669,12 +674,14 @@ static inline bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) · 149 unmodified lines
669674 return false;
670675 }
671676
672−static inline const char *
673−acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv)
677+static inline struct acpi_device *
678+acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
674679 {
675680 return NULL;
676681 }
677682
683+static inline void acpi_dev_put(struct acpi_device *adev) {}
684+
678685 static inline bool is_acpi_node(struct fwnode_handle *fwnode)
679686 {
680687 return false;
include/linux/acpi_iort.h+8−0
@@ -26,6 +26,14 @@ · 25 unmodified lines
2626 #define IORT_IRQ_MASK(irq) (irq & 0xffffffffULL)
2727 #define IORT_IRQ_TRIGGER_MASK(irq) ((irq >> 32) & 0xffffffffULL)
2828
29+/*
30+ * PMCG model identifiers for use in smmu pmu driver. Please note
31+ * that this is purely for the use of software and has nothing to
32+ * do with hardware or with IORT specification.
33+ */
34+#define IORT_SMMU_V3_PMCG_GENERIC 0x00000000 /* Generic SMMUv3 PMCG */
35+#define IORT_SMMU_V3_PMCG_HISI_HIP08 0x00000001 /* HiSilicon HIP08 PMCG */
36+
2937 int iort_register_domain_token(int trans_id, phys_addr_t base,
3038 struct fwnode_handle *fw_node);
3139 void iort_deregister_domain_token(int trans_id);
include/linux/alcor_pci.h+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #define AU6601_BASE_CLOCK 31000000
2424 #define AU6601_MIN_CLOCK 150000
2525 #define AU6601_MAX_CLOCK 208000000
26−#define AU6601_MAX_DMA_SEGMENTS 1
26+#define AU6601_MAX_DMA_SEGMENTS 64
2727 #define AU6601_MAX_PIO_SEGMENTS 1
2828 #define AU6601_MAX_DMA_BLOCK_SIZE 0x1000
2929 #define AU6601_MAX_PIO_BLOCK_SIZE 0x200
include/linux/amba/clcd.h+0−31
@@ -124,38 +124,11 @@ struct clcd_board { · 123 unmodified lines
124124 struct amba_device;
125125 struct clk;
126126
127−/**
128− * struct clcd_vendor_data - holds hardware (IP-block) vendor-specific
129− * variant information
130− *
131− * @clock_timregs: the CLCD needs to be clocked when accessing the
132− * timer registers, or the hardware will hang.
133− * @packed_24_bit_pixels: this variant supports 24bit packed pixel data,
134− * so that RGB accesses 3 bytes at a time, not just on even 32bit
135− * boundaries, packing the pixel data in memory. ST Microelectronics
136− * have this.
137− * @st_bitmux_control: ST Microelectronics have implemented output
138− * bit line multiplexing into the CLCD control register. This indicates
139− * that we need to use this.
140− * @init_board: custom board init function for this variant
141− * @init_panel: custom panel init function for this variant
142− */
143−struct clcd_vendor_data {
144− bool clock_timregs;
145− bool packed_24_bit_pixels;
146− bool st_bitmux_control;
147− int (*init_board)(struct amba_device *adev,
148− struct clcd_board *board);
149− int (*init_panel)(struct clcd_fb *fb,
150− struct device_node *panel);
151−};
152−
153127 /* this data structure describes each frame buffer device we find */
154128 struct clcd_fb {
155129 struct fb_info fb;
156130 struct amba_device *dev;
157131 struct clk *clk;
158− struct clcd_vendor_data *vendor;
159132 struct clcd_panel *panel;
160133 struct clcd_board *board;
161134 void *board_data;
@@ -257,10 +230,6 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) · 95 unmodified lines
257230 else
258231 val |= CNTL_LCDBPP16_444;
259232 break;
260− case 24:
261− /* Modified variant supporting 24 bit packed pixels */
262− val |= CNTL_ST_LCDBPP24_PACKED;
263− break;
264233 case 32:
265234 val |= CNTL_LCDBPP24;
266235 break;
include/linux/armada-37xx-rwtm-mailbox.h+23−0
@@ -0,0 +1,23 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
2+/*
3+ * rWTM BIU Mailbox driver for Armada 37xx
4+ *
5+ * Author: Marek Behun <marek.behun@nic.cz>
6+ */
7+
8+#ifndef _LINUX_ARMADA_37XX_RWTM_MAILBOX_H_
9+#define _LINUX_ARMADA_37XX_RWTM_MAILBOX_H_
10+
11+#include <linux/types.h>
12+
13+struct armada_37xx_rwtm_tx_msg {
14+ u16 command;
15+ u32 args[16];
16+};
17+
18+struct armada_37xx_rwtm_rx_msg {
19+ u32 retval;
20+ u32 status[16];
21+};
22+
23+#endif /* _LINUX_ARMADA_37XX_RWTM_MAILBOX_H_ */
include/linux/atmel_tc.h+0−270
@@ -1,270 +0,0 @@
1−/*
2− * Timer/Counter Unit (TC) registers.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; either version 2 of the License, or
7− * (at your option) any later version.
8− */
9−
10−#ifndef ATMEL_TC_H
11−#define ATMEL_TC_H
12−
13−#include <linux/compiler.h>
14−#include <linux/list.h>
15−
16−/*
17− * Many 32-bit Atmel SOCs include one or more TC blocks, each of which holds
18− * three general-purpose 16-bit timers. These timers share one register bank.
19− * Depending on the SOC, each timer may have its own clock and IRQ, or those
20− * may be shared by the whole TC block.
21− *
22− * These TC blocks may have up to nine external pins: TCLK0..2 signals for
23− * clocks or clock gates, and per-timer TIOA and TIOB signals used for PWM
24− * or triggering. Those pins need to be set up for use with the TC block,
25− * else they will be used as GPIOs or for a different controller.
26− *
27− * Although we expect each TC block to have a platform_device node, those
28− * nodes are not what drivers bind to. Instead, they ask for a specific
29− * TC block, by number ... which is a common approach on systems with many
30− * timers. Then they use clk_get() and platform_get_irq() to get clock and
31− * IRQ resources.
32− */
33−
34−struct clk;
35−
36−/**
37− * struct atmel_tcb_config - SoC data for a Timer/Counter Block
38− * @counter_width: size in bits of a timer counter register
39− */
40−struct atmel_tcb_config {
41− size_t counter_width;
42−};
43−
44−/**
45− * struct atmel_tc - information about a Timer/Counter Block
46− * @pdev: physical device
47− * @regs: mapping through which the I/O registers can be accessed
48− * @id: block id
49− * @tcb_config: configuration data from SoC
50− * @irq: irq for each of the three channels
51− * @clk: internal clock source for each of the three channels
52− * @node: list node, for tclib internal use
53− * @allocated: if already used, for tclib internal use
54− *
55− * On some platforms, each TC channel has its own clocks and IRQs,
56− * while on others, all TC channels share the same clock and IRQ.
57− * Drivers should clk_enable() all the clocks they need even though
58− * all the entries in @clk may point to the same physical clock.
59− * Likewise, drivers should request irqs independently for each
60− * channel, but they must use IRQF_SHARED in case some of the entries
61− * in @irq are actually the same IRQ.
62− */
63−struct atmel_tc {
64− struct platform_device *pdev;
65− void __iomem *regs;
66− int id;
67− const struct atmel_tcb_config *tcb_config;
68− int irq[3];
69− struct clk *clk[3];
70− struct clk *slow_clk;
71− struct list_head node;
72− bool allocated;
73−};
74−
75−extern struct atmel_tc *atmel_tc_alloc(unsigned block);
76−extern void atmel_tc_free(struct atmel_tc *tc);
77−
78−/* platform-specific ATMEL_TC_TIMER_CLOCKx divisors (0 means 32KiHz) */
79−extern const u8 atmel_tc_divisors[5];
80−
81−
82−/*
83− * Two registers have block-wide controls. These are: configuring the three
84− * "external" clocks (or event sources) used by the timer channels; and
85− * synchronizing the timers by resetting them all at once.
86− *
87− * "External" can mean "external to chip" using the TCLK0, TCLK1, or TCLK2
88− * signals. Or, it can mean "external to timer", using the TIOA output from
89− * one of the other two timers that's being run in waveform mode.
90− */
91−
92−#define ATMEL_TC_BCR 0xc0 /* TC Block Control Register */
93−#define ATMEL_TC_SYNC (1 << 0) /* synchronize timers */
94−
95−#define ATMEL_TC_BMR 0xc4 /* TC Block Mode Register */
96−#define ATMEL_TC_TC0XC0S (3 << 0) /* external clock 0 source */
97−#define ATMEL_TC_TC0XC0S_TCLK0 (0 << 0)
98−#define ATMEL_TC_TC0XC0S_NONE (1 << 0)
99−#define ATMEL_TC_TC0XC0S_TIOA1 (2 << 0)
100−#define ATMEL_TC_TC0XC0S_TIOA2 (3 << 0)
101−#define ATMEL_TC_TC1XC1S (3 << 2) /* external clock 1 source */
102−#define ATMEL_TC_TC1XC1S_TCLK1 (0 << 2)
103−#define ATMEL_TC_TC1XC1S_NONE (1 << 2)
104−#define ATMEL_TC_TC1XC1S_TIOA0 (2 << 2)
105−#define ATMEL_TC_TC1XC1S_TIOA2 (3 << 2)
106−#define ATMEL_TC_TC2XC2S (3 << 4) /* external clock 2 source */
107−#define ATMEL_TC_TC2XC2S_TCLK2 (0 << 4)
108−#define ATMEL_TC_TC2XC2S_NONE (1 << 4)
109−#define ATMEL_TC_TC2XC2S_TIOA0 (2 << 4)
110−#define ATMEL_TC_TC2XC2S_TIOA1 (3 << 4)
111−
112−
113−/*
114− * Each TC block has three "channels", each with one counter and controls.
115− *
116− * Note that the semantics of ATMEL_TC_TIMER_CLOCKx (input clock selection
117− * when it's not "external") is silicon-specific. AT91 platforms use one
118− * set of definitions; AVR32 platforms use a different set. Don't hard-wire
119− * such knowledge into your code, use the global "atmel_tc_divisors" ...
120− * where index N is the divisor for clock N+1, else zero to indicate it uses
121− * the 32 KiHz clock.
122− *
123− * The timers can be chained in various ways, and operated in "waveform"
124− * generation mode (including PWM) or "capture" mode (to time events). In
125− * both modes, behavior can be configured in many ways.
126− *
127− * Each timer has two I/O pins, TIOA and TIOB. Waveform mode uses TIOA as a
128− * PWM output, and TIOB as either another PWM or as a trigger. Capture mode
129− * uses them only as inputs.
130− */
131−#define ATMEL_TC_CHAN(idx) ((idx)*0x40)
132−#define ATMEL_TC_REG(idx, reg) (ATMEL_TC_CHAN(idx) + ATMEL_TC_ ## reg)
133−
134−#define ATMEL_TC_CCR 0x00 /* Channel Control Register */
135−#define ATMEL_TC_CLKEN (1 << 0) /* clock enable */
136−#define ATMEL_TC_CLKDIS (1 << 1) /* clock disable */
137−#define ATMEL_TC_SWTRG (1 << 2) /* software trigger */
138−
139−#define ATMEL_TC_CMR 0x04 /* Channel Mode Register */
140−
141−/* Both modes share some CMR bits */
142−#define ATMEL_TC_TCCLKS (7 << 0) /* clock source */
143−#define ATMEL_TC_TIMER_CLOCK1 (0 << 0)
144−#define ATMEL_TC_TIMER_CLOCK2 (1 << 0)
145−#define ATMEL_TC_TIMER_CLOCK3 (2 << 0)
146−#define ATMEL_TC_TIMER_CLOCK4 (3 << 0)
147−#define ATMEL_TC_TIMER_CLOCK5 (4 << 0)
148−#define ATMEL_TC_XC0 (5 << 0)
149−#define ATMEL_TC_XC1 (6 << 0)
150−#define ATMEL_TC_XC2 (7 << 0)
151−#define ATMEL_TC_CLKI (1 << 3) /* clock invert */
152−#define ATMEL_TC_BURST (3 << 4) /* clock gating */
153−#define ATMEL_TC_GATE_NONE (0 << 4)
154−#define ATMEL_TC_GATE_XC0 (1 << 4)
155−#define ATMEL_TC_GATE_XC1 (2 << 4)
156−#define ATMEL_TC_GATE_XC2 (3 << 4)
157−#define ATMEL_TC_WAVE (1 << 15) /* true = Waveform mode */
158−
159−/* CAPTURE mode CMR bits */
160−#define ATMEL_TC_LDBSTOP (1 << 6) /* counter stops on RB load */
161−#define ATMEL_TC_LDBDIS (1 << 7) /* counter disable on RB load */
162−#define ATMEL_TC_ETRGEDG (3 << 8) /* external trigger edge */
163−#define ATMEL_TC_ETRGEDG_NONE (0 << 8)
164−#define ATMEL_TC_ETRGEDG_RISING (1 << 8)
165−#define ATMEL_TC_ETRGEDG_FALLING (2 << 8)
166−#define ATMEL_TC_ETRGEDG_BOTH (3 << 8)
167−#define ATMEL_TC_ABETRG (1 << 10) /* external trigger is TIOA? */
168−#define ATMEL_TC_CPCTRG (1 << 14) /* RC compare trigger enable */
169−#define ATMEL_TC_LDRA (3 << 16) /* RA loading edge (of TIOA) */
170−#define ATMEL_TC_LDRA_NONE (0 << 16)
171−#define ATMEL_TC_LDRA_RISING (1 << 16)
172−#define ATMEL_TC_LDRA_FALLING (2 << 16)
173−#define ATMEL_TC_LDRA_BOTH (3 << 16)
174−#define ATMEL_TC_LDRB (3 << 18) /* RB loading edge (of TIOA) */
175−#define ATMEL_TC_LDRB_NONE (0 << 18)
176−#define ATMEL_TC_LDRB_RISING (1 << 18)
177−#define ATMEL_TC_LDRB_FALLING (2 << 18)
178−#define ATMEL_TC_LDRB_BOTH (3 << 18)
179−
180−/* WAVEFORM mode CMR bits */
181−#define ATMEL_TC_CPCSTOP (1 << 6) /* RC compare stops counter */
182−#define ATMEL_TC_CPCDIS (1 << 7) /* RC compare disables counter */
183−#define ATMEL_TC_EEVTEDG (3 << 8) /* external event edge */
184−#define ATMEL_TC_EEVTEDG_NONE (0 << 8)
185−#define ATMEL_TC_EEVTEDG_RISING (1 << 8)
186−#define ATMEL_TC_EEVTEDG_FALLING (2 << 8)
187−#define ATMEL_TC_EEVTEDG_BOTH (3 << 8)
188−#define ATMEL_TC_EEVT (3 << 10) /* external event source */
189−#define ATMEL_TC_EEVT_TIOB (0 << 10)
190−#define ATMEL_TC_EEVT_XC0 (1 << 10)
191−#define ATMEL_TC_EEVT_XC1 (2 << 10)
192−#define ATMEL_TC_EEVT_XC2 (3 << 10)
193−#define ATMEL_TC_ENETRG (1 << 12) /* external event is trigger */
194−#define ATMEL_TC_WAVESEL (3 << 13) /* waveform type */
195−#define ATMEL_TC_WAVESEL_UP (0 << 13)
196−#define ATMEL_TC_WAVESEL_UPDOWN (1 << 13)
197−#define ATMEL_TC_WAVESEL_UP_AUTO (2 << 13)
198−#define ATMEL_TC_WAVESEL_UPDOWN_AUTO (3 << 13)
199−#define ATMEL_TC_ACPA (3 << 16) /* RA compare changes TIOA */
200−#define ATMEL_TC_ACPA_NONE (0 << 16)
201−#define ATMEL_TC_ACPA_SET (1 << 16)
202−#define ATMEL_TC_ACPA_CLEAR (2 << 16)
203−#define ATMEL_TC_ACPA_TOGGLE (3 << 16)
204−#define ATMEL_TC_ACPC (3 << 18) /* RC compare changes TIOA */
205−#define ATMEL_TC_ACPC_NONE (0 << 18)
206−#define ATMEL_TC_ACPC_SET (1 << 18)
207−#define ATMEL_TC_ACPC_CLEAR (2 << 18)
208−#define ATMEL_TC_ACPC_TOGGLE (3 << 18)
209−#define ATMEL_TC_AEEVT (3 << 20) /* external event changes TIOA */
210−#define ATMEL_TC_AEEVT_NONE (0 << 20)
211−#define ATMEL_TC_AEEVT_SET (1 << 20)
212−#define ATMEL_TC_AEEVT_CLEAR (2 << 20)
213−#define ATMEL_TC_AEEVT_TOGGLE (3 << 20)
214−#define ATMEL_TC_ASWTRG (3 << 22) /* software trigger changes TIOA */
215−#define ATMEL_TC_ASWTRG_NONE (0 << 22)
216−#define ATMEL_TC_ASWTRG_SET (1 << 22)
217−#define ATMEL_TC_ASWTRG_CLEAR (2 << 22)
218−#define ATMEL_TC_ASWTRG_TOGGLE (3 << 22)
219−#define ATMEL_TC_BCPB (3 << 24) /* RB compare changes TIOB */
220−#define ATMEL_TC_BCPB_NONE (0 << 24)
221−#define ATMEL_TC_BCPB_SET (1 << 24)
222−#define ATMEL_TC_BCPB_CLEAR (2 << 24)
223−#define ATMEL_TC_BCPB_TOGGLE (3 << 24)
224−#define ATMEL_TC_BCPC (3 << 26) /* RC compare changes TIOB */
225−#define ATMEL_TC_BCPC_NONE (0 << 26)
226−#define ATMEL_TC_BCPC_SET (1 << 26)
227−#define ATMEL_TC_BCPC_CLEAR (2 << 26)
228−#define ATMEL_TC_BCPC_TOGGLE (3 << 26)
229−#define ATMEL_TC_BEEVT (3 << 28) /* external event changes TIOB */
230−#define ATMEL_TC_BEEVT_NONE (0 << 28)
231−#define ATMEL_TC_BEEVT_SET (1 << 28)
232−#define ATMEL_TC_BEEVT_CLEAR (2 << 28)
233−#define ATMEL_TC_BEEVT_TOGGLE (3 << 28)
234−#define ATMEL_TC_BSWTRG (3 << 30) /* software trigger changes TIOB */
235−#define ATMEL_TC_BSWTRG_NONE (0 << 30)
236−#define ATMEL_TC_BSWTRG_SET (1 << 30)
237−#define ATMEL_TC_BSWTRG_CLEAR (2 << 30)
238−#define ATMEL_TC_BSWTRG_TOGGLE (3 << 30)
239−
240−#define ATMEL_TC_CV 0x10 /* counter Value */
241−#define ATMEL_TC_RA 0x14 /* register A */
242−#define ATMEL_TC_RB 0x18 /* register B */
243−#define ATMEL_TC_RC 0x1c /* register C */
244−
245−#define ATMEL_TC_SR 0x20 /* status (read-only) */
246−/* Status-only flags */
247−#define ATMEL_TC_CLKSTA (1 << 16) /* clock enabled */
248−#define ATMEL_TC_MTIOA (1 << 17) /* TIOA mirror */
249−#define ATMEL_TC_MTIOB (1 << 18) /* TIOB mirror */
250−
251−#define ATMEL_TC_IER 0x24 /* interrupt enable (write-only) */
252−#define ATMEL_TC_IDR 0x28 /* interrupt disable (write-only) */
253−#define ATMEL_TC_IMR 0x2c /* interrupt mask (read-only) */
254−
255−/* Status and IRQ flags */
256−#define ATMEL_TC_COVFS (1 << 0) /* counter overflow */
257−#define ATMEL_TC_LOVRS (1 << 1) /* load overrun */
258−#define ATMEL_TC_CPAS (1 << 2) /* RA compare */
259−#define ATMEL_TC_CPBS (1 << 3) /* RB compare */
260−#define ATMEL_TC_CPCS (1 << 4) /* RC compare */
261−#define ATMEL_TC_LDRAS (1 << 5) /* RA loading */
262−#define ATMEL_TC_LDRBS (1 << 6) /* RB loading */
263−#define ATMEL_TC_ETRGS (1 << 7) /* external trigger */
264−#define ATMEL_TC_ALL_IRQ (ATMEL_TC_COVFS | ATMEL_TC_LOVRS | \
265− ATMEL_TC_CPAS | ATMEL_TC_CPBS | \
266− ATMEL_TC_CPCS | ATMEL_TC_LDRAS | \
267− ATMEL_TC_LDRBS | ATMEL_TC_ETRGS) \
268− /* all IRQs */
269−
270−#endif
include/linux/audit.h+75−0
@@ -86,6 +86,29 @@ struct audit_field { · 85 unmodified lines
8686 u32 op;
8787 };
8888
89+enum audit_ntp_type {
90+ AUDIT_NTP_OFFSET,
91+ AUDIT_NTP_FREQ,
92+ AUDIT_NTP_STATUS,
93+ AUDIT_NTP_TAI,
94+ AUDIT_NTP_TICK,
95+ AUDIT_NTP_ADJUST,
96+
97+ AUDIT_NTP_NVALS /* count */
98+};
99+
100+#ifdef CONFIG_AUDITSYSCALL
101+struct audit_ntp_val {
102+ long long oldval, newval;
103+};
104+
105+struct audit_ntp_data {
106+ struct audit_ntp_val vals[AUDIT_NTP_NVALS];
107+};
108+#else
109+struct audit_ntp_data {};
110+#endif
111+
89112 extern int is_audit_feature_set(int which);
90113
91114 extern int __init audit_register_class(int class, unsigned *list);
@@ -365,6 +388,8 @@ extern void __audit_log_capset(const struct cred *new, const struct cred *old); · 273 unmodified lines
365388 extern void __audit_mmap_fd(int fd, int flags);
366389 extern void __audit_log_kern_module(char *name);
367390 extern void __audit_fanotify(unsigned int response);
391+extern void __audit_tk_injoffset(struct timespec64 offset);
392+extern void __audit_ntp_log(const struct audit_ntp_data *ad);
368393
369394 static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
370395 {
@@ -467,6 +492,39 @@ static inline void audit_fanotify(unsigned int response) · 96 unmodified lines
467492 __audit_fanotify(response);
468493 }
469494
495+static inline void audit_tk_injoffset(struct timespec64 offset)
496+{
497+ /* ignore no-op events */
498+ if (offset.tv_sec == 0 && offset.tv_nsec == 0)
499+ return;
500+
501+ if (!audit_dummy_context())
502+ __audit_tk_injoffset(offset);
503+}
504+
505+static inline void audit_ntp_init(struct audit_ntp_data *ad)
506+{
507+ memset(ad, 0, sizeof(*ad));
508+}
509+
510+static inline void audit_ntp_set_old(struct audit_ntp_data *ad,
511+ enum audit_ntp_type type, long long val)
512+{
513+ ad->vals[type].oldval = val;
514+}
515+
516+static inline void audit_ntp_set_new(struct audit_ntp_data *ad,
517+ enum audit_ntp_type type, long long val)
518+{
519+ ad->vals[type].newval = val;
520+}
521+
522+static inline void audit_ntp_log(const struct audit_ntp_data *ad)
523+{
524+ if (!audit_dummy_context())
525+ __audit_ntp_log(ad);
526+}
527+
470528 extern int audit_n_rules;
471529 extern int audit_signals;
472530 #else /* CONFIG_AUDITSYSCALL */
@@ -580,6 +638,23 @@ static inline void audit_log_kern_module(char *name) · 107 unmodified lines
580638 static inline void audit_fanotify(unsigned int response)
581639 { }
582640
641+static inline void audit_tk_injoffset(struct timespec64 offset)
642+{ }
643+
644+static inline void audit_ntp_init(struct audit_ntp_data *ad)
645+{ }
646+
647+static inline void audit_ntp_set_old(struct audit_ntp_data *ad,
648+ enum audit_ntp_type type, long long val)
649+{ }
650+
651+static inline void audit_ntp_set_new(struct audit_ntp_data *ad,
652+ enum audit_ntp_type type, long long val)
653+{ }
654+
655+static inline void audit_ntp_log(const struct audit_ntp_data *ad)
656+{ }
657+
583658 static inline void audit_ptrace(struct task_struct *t)
584659 { }
585660 #define audit_n_rules 0
include/linux/balloon_compaction.h+0−15
@@ -151,21 +151,6 @@ static inline void balloon_page_delete(struct page *page) · 150 unmodified lines
151151 list_del(&page->lru);
152152 }
153153
154−static inline bool __is_movable_balloon_page(struct page *page)
155−{
156− return false;
157−}
158−
159−static inline bool balloon_page_movable(struct page *page)
160−{
161− return false;
162−}
163−
164−static inline bool isolated_balloon_page(struct page *page)
165−{
166− return false;
167−}
168−
169154 static inline bool balloon_page_isolate(struct page *page)
170155 {
171156 return false;
include/linux/binfmts.h+2−1
@@ -15,7 +15,6 @@ struct filename; · 14 unmodified lines
1515 * This structure is used to hold the arguments that are used when loading binaries.
1616 */
1717 struct linux_binprm {
18− char buf[BINPRM_BUF_SIZE];
1918 #ifdef CONFIG_MMU
2019 struct vm_area_struct *vma;
2120 unsigned long vma_pages;
@@ -64,6 +63,8 @@ struct linux_binprm { · 42 unmodified lines
6463 unsigned long loader, exec;
6564
6665 struct rlimit rlim_stack; /* Saved RLIMIT_STACK used during exec. */
66+
67+ char buf[BINPRM_BUF_SIZE];
6768 } __randomize_layout;
6869
6970 #define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0
include/linux/bio.h+3−17
@@ -1,19 +1,6 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * Copyright (C) 2001 Jens Axboe <axboe@suse.de>
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License version 2 as
6− * published by the Free Software Foundation.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− *
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12− * GNU General Public License for more details.
13− *
14− * You should have received a copy of the GNU General Public Licens
15− * along with this program; if not, write to the Free Software
16− * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-
174 */
185 #ifndef __LINUX_BIO_H
196 #define __LINUX_BIO_H
@@ -134,9 +121,8 @@ static inline bool bio_next_segment(const struct bio *bio, · 114 unmodified lines
134121 * drivers should _never_ use the all version - the bio may have been split
135122 * before it got to the driver and the driver won't own all of it
136123 */
137−#define bio_for_each_segment_all(bvl, bio, i, iter) \
138− for (i = 0, bvl = bvec_init_iter_all(&iter); \
139− bio_next_segment((bio), &iter); i++)
124+#define bio_for_each_segment_all(bvl, bio, iter) \
125+ for (bvl = bvec_init_iter_all(&iter); bio_next_segment((bio), &iter); )
140126
141127 static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter,
142128 unsigned bytes)
include/linux/bitops.h+8−8
@@ -60,7 +60,7 @@ static __always_inline unsigned long hweight_long(unsigned long w) · 59 unmodified lines
6060 */
6161 static inline __u64 rol64(__u64 word, unsigned int shift)
6262 {
63− return (word << shift) | (word >> (64 - shift));
63+ return (word << (shift & 63)) | (word >> ((-shift) & 63));
6464 }
6565
6666 /**
@@ -70,7 +70,7 @@ static inline __u64 rol64(__u64 word, unsigned int shift) · 3 unmodified lines
7070 */
7171 static inline __u64 ror64(__u64 word, unsigned int shift)
7272 {
73− return (word >> shift) | (word << (64 - shift));
73+ return (word >> (shift & 63)) | (word << ((-shift) & 63));
7474 }
7575
7676 /**
@@ -80,7 +80,7 @@ static inline __u64 ror64(__u64 word, unsigned int shift) · 3 unmodified lines
8080 */
8181 static inline __u32 rol32(__u32 word, unsigned int shift)
8282 {
83− return (word << shift) | (word >> ((-shift) & 31));
83+ return (word << (shift & 31)) | (word >> ((-shift) & 31));
8484 }
8585
8686 /**
@@ -90,7 +90,7 @@ static inline __u32 rol32(__u32 word, unsigned int shift) · 3 unmodified lines
9090 */
9191 static inline __u32 ror32(__u32 word, unsigned int shift)
9292 {
93− return (word >> shift) | (word << (32 - shift));
93+ return (word >> (shift & 31)) | (word << ((-shift) & 31));
9494 }
9595
9696 /**
@@ -100,7 +100,7 @@ static inline __u32 ror32(__u32 word, unsigned int shift) · 3 unmodified lines
100100 */
101101 static inline __u16 rol16(__u16 word, unsigned int shift)
102102 {
103− return (word << shift) | (word >> (16 - shift));
103+ return (word << (shift & 15)) | (word >> ((-shift) & 15));
104104 }
105105
106106 /**
@@ -110,7 +110,7 @@ static inline __u16 rol16(__u16 word, unsigned int shift) · 3 unmodified lines
110110 */
111111 static inline __u16 ror16(__u16 word, unsigned int shift)
112112 {
113− return (word >> shift) | (word << (16 - shift));
113+ return (word >> (shift & 15)) | (word << ((-shift) & 15));
114114 }
115115
116116 /**
@@ -120,7 +120,7 @@ static inline __u16 ror16(__u16 word, unsigned int shift) · 3 unmodified lines
120120 */
121121 static inline __u8 rol8(__u8 word, unsigned int shift)
122122 {
123− return (word << shift) | (word >> (8 - shift));
123+ return (word << (shift & 7)) | (word >> ((-shift) & 7));
124124 }
125125
126126 /**
@@ -130,7 +130,7 @@ static inline __u8 rol8(__u8 word, unsigned int shift) · 3 unmodified lines
130130 */
131131 static inline __u8 ror8(__u8 word, unsigned int shift)
132132 {
133− return (word >> shift) | (word << (8 - shift));
133+ return (word >> (shift & 7)) | (word << ((-shift) & 7));
134134 }
135135
136136 /**
include/linux/blk-mq-rdma.h+1−0
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
12 #ifndef _LINUX_BLK_MQ_RDMA_H
23 #define _LINUX_BLK_MQ_RDMA_H
34
include/linux/blk-mq.h+2−0
@@ -70,6 +70,8 @@ struct blk_mq_hw_ctx { · 69 unmodified lines
7070 struct dentry *sched_debugfs_dir;
7171 #endif
7272
73+ struct list_head hctx_list;
74+
7375 /* Must be the last member - see also blk_mq_hw_ctx_size(). */
7476 struct srcu_struct srcu[0];
7577 };
include/linux/blk_types.h+16−13
@@ -215,21 +215,24 @@ struct bio { · 214 unmodified lines
215215 /*
216216 * bio flags
217217 */
218−#define BIO_NO_PAGE_REF 0 /* don't put release vec pages */
219−#define BIO_SEG_VALID 1 /* bi_phys_segments valid */
220−#define BIO_CLONED 2 /* doesn't own data */
221−#define BIO_BOUNCED 3 /* bio is a bounce bio */
222−#define BIO_USER_MAPPED 4 /* contains user pages */
223−#define BIO_NULL_MAPPED 5 /* contains invalid user pages */
224−#define BIO_QUIET 6 /* Make BIO Quiet */
225−#define BIO_CHAIN 7 /* chained bio, ->bi_remaining in effect */
226−#define BIO_REFFED 8 /* bio has elevated ->bi_cnt */
227−#define BIO_THROTTLED 9 /* This bio has already been subjected to
218+enum {
219+ BIO_NO_PAGE_REF, /* don't put release vec pages */
220+ BIO_SEG_VALID, /* bi_phys_segments valid */
221+ BIO_CLONED, /* doesn't own data */
222+ BIO_BOUNCED, /* bio is a bounce bio */
223+ BIO_USER_MAPPED, /* contains user pages */
224+ BIO_NULL_MAPPED, /* contains invalid user pages */
225+ BIO_QUIET, /* Make BIO Quiet */
226+ BIO_CHAIN, /* chained bio, ->bi_remaining in effect */
227+ BIO_REFFED, /* bio has elevated ->bi_cnt */
228+ BIO_THROTTLED, /* This bio has already been subjected to
228229 * throttling rules. Don't do it again. */
229−#define BIO_TRACE_COMPLETION 10 /* bio_endio() should trace the final completion
230+ BIO_TRACE_COMPLETION, /* bio_endio() should trace the final completion
230231 * of this bio. */
231−#define BIO_QUEUE_ENTERED 11 /* can use blk_queue_enter_live() */
232−#define BIO_TRACKED 12 /* set if bio goes through the rq_qos path */
232+ BIO_QUEUE_ENTERED, /* can use blk_queue_enter_live() */
233+ BIO_TRACKED, /* set if bio goes through the rq_qos path */
234+ BIO_FLAG_LAST
235+};
233236
234237 /* See BVEC_POOL_OFFSET below before adding new flags */
235238
include/linux/blkdev.h+41−2
@@ -535,6 +535,13 @@ struct request_queue { · 534 unmodified lines
535535
536536 struct mutex sysfs_lock;
537537
538+ /*
539+ * for reusing dead hctx instance in case of updating
540+ * nr_hw_queues
541+ */
542+ struct list_head unused_hctx_list;
543+ spinlock_t unused_hctx_lock;
544+
538545 atomic_t mq_freeze_depth;
539546
540547 #if defined(CONFIG_BLK_DEV_BSG)
@@ -548,7 +555,6 @@ struct request_queue { · 7 unmodified lines
548555 struct rcu_head rcu_head;
549556 wait_queue_head_t mq_freeze_wq;
550557 struct percpu_ref q_usage_counter;
551− struct list_head all_q_node;
552558
553559 struct blk_mq_tag_set *tag_set;
554560 struct list_head tag_set_list;
@@ -641,6 +647,13 @@ static inline bool blk_account_rq(struct request *rq) · 86 unmodified lines
641647
642648 #define rq_data_dir(rq) (op_is_write(req_op(rq)) ? WRITE : READ)
643649
650+#define rq_dma_dir(rq) \
651+ (op_is_write(req_op(rq)) ? DMA_TO_DEVICE : DMA_FROM_DEVICE)
652+
653+#define dma_map_bvec(dev, bv, dir, attrs) \
654+ dma_map_page_attrs(dev, (bv)->bv_page, (bv)->bv_offset, (bv)->bv_len, \
655+ (dir), (attrs))
656+
644657 static inline bool queue_is_mq(struct request_queue *q)
645658 {
646659 return q->mq_ops;
@@ -932,6 +945,17 @@ static inline unsigned int blk_rq_payload_bytes(struct request *rq) · 285 unmodified lines
932945 return blk_rq_bytes(rq);
933946 }
934947
948+/*
949+ * Return the first full biovec in the request. The caller needs to check that
950+ * there are any bvecs before calling this helper.
951+ */
952+static inline struct bio_vec req_bvec(struct request *rq)
953+{
954+ if (rq->rq_flags & RQF_SPECIAL_PAYLOAD)
955+ return rq->special_vec;
956+ return mp_bvec_iter_bvec(rq->bio->bi_io_vec, rq->bio->bi_iter);
957+}
958+
935959 static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q,
936960 int op)
937961 {
@@ -1052,7 +1076,6 @@ extern int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev, · 114 unmodified lines
10521076 extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
10531077 sector_t offset);
10541078 extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b);
1055−extern void blk_queue_dma_pad(struct request_queue *, unsigned int);
10561079 extern void blk_queue_update_dma_pad(struct request_queue *, unsigned int);
10571080 extern int blk_queue_dma_drain(struct request_queue *q,
10581081 dma_drain_needed_fn *dma_drain_needed,
@@ -1548,6 +1571,17 @@ static inline unsigned int bio_integrity_bytes(struct blk_integrity *bi, · 489 unmodified lines
15481571 return bio_integrity_intervals(bi, sectors) * bi->tuple_size;
15491572 }
15501573
1574+/*
1575+ * Return the first bvec that contains integrity data. Only drivers that are
1576+ * limited to a single integrity segment should use this helper.
1577+ */
1578+static inline struct bio_vec *rq_integrity_vec(struct request *rq)
1579+{
1580+ if (WARN_ON_ONCE(queue_max_integrity_segments(rq->q) > 1))
1581+ return NULL;
1582+ return rq->bio->bi_integrity->bip_vec;
1583+}
1584+
15511585 #else /* CONFIG_BLK_DEV_INTEGRITY */
15521586
15531587 struct bio;
@@ -1622,6 +1656,11 @@ static inline unsigned int bio_integrity_bytes(struct blk_integrity *bi, · 68 unmodified lines
16221656 return 0;
16231657 }
16241658
1659+static inline struct bio_vec *rq_integrity_vec(struct request *rq)
1660+{
1661+ return NULL;
1662+}
1663+
16251664 #endif /* CONFIG_BLK_DEV_INTEGRITY */
16261665
16271666 struct block_device_operations {
include/linux/bpf-cgroup.h+21−0
@@ -17,6 +17,8 @@ struct bpf_map; · 16 unmodified lines
1717 struct bpf_prog;
1818 struct bpf_sock_ops_kern;
1919 struct bpf_cgroup_storage;
20+struct ctl_table;
21+struct ctl_table_header;
2022
2123 #ifdef CONFIG_CGROUP_BPF
2224
@@ -109,6 +111,12 @@ int __cgroup_bpf_run_filter_sock_ops(struct sock *sk, · 86 unmodified lines
109111 int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor,
110112 short access, enum bpf_attach_type type);
111113
114+int __cgroup_bpf_run_filter_sysctl(struct ctl_table_header *head,
115+ struct ctl_table *table, int write,
116+ void __user *buf, size_t *pcount,
117+ loff_t *ppos, void **new_buf,
118+ enum bpf_attach_type type);
119+
112120 static inline enum bpf_cgroup_storage_type cgroup_storage_type(
113121 struct bpf_map *map)
114122 {
@@ -253,6 +261,18 @@ int bpf_percpu_cgroup_storage_update(struct bpf_map *map, void *key, · 138 unmodified lines
253261 \
254262 __ret; \
255263 })
264+
265+
266+#define BPF_CGROUP_RUN_PROG_SYSCTL(head, table, write, buf, count, pos, nbuf) \
267+({ \
268+ int __ret = 0; \
269+ if (cgroup_bpf_enabled) \
270+ __ret = __cgroup_bpf_run_filter_sysctl(head, table, write, \
271+ buf, count, pos, nbuf, \
272+ BPF_CGROUP_SYSCTL); \
273+ __ret; \
274+})
275+
256276 int cgroup_bpf_prog_attach(const union bpf_attr *attr,
257277 enum bpf_prog_type ptype, struct bpf_prog *prog);
258278 int cgroup_bpf_prog_detach(const union bpf_attr *attr,
@@ -321,6 +341,7 @@ static inline int bpf_percpu_cgroup_storage_update(struct bpf_map *map, · 62 unmodified lines
321341 #define BPF_CGROUP_RUN_PROG_UDP6_SENDMSG_LOCK(sk, uaddr, t_ctx) ({ 0; })
322342 #define BPF_CGROUP_RUN_PROG_SOCK_OPS(sock_ops) ({ 0; })
323343 #define BPF_CGROUP_RUN_PROG_DEVICE_CGROUP(type,major,minor,access) ({ 0; })
344+#define BPF_CGROUP_RUN_PROG_SYSCTL(head,table,write,buf,count,pos,nbuf) ({ 0; })
324345
325346 #define for_each_cgroup_storage_type(stype) for (; false; )
326347
include/linux/bpf.h+76−10
@@ -57,6 +57,12 @@ struct bpf_map_ops { · 56 unmodified lines
5757 const struct btf *btf,
5858 const struct btf_type *key_type,
5959 const struct btf_type *value_type);
60+
61+ /* Direct value access helpers. */
62+ int (*map_direct_value_addr)(const struct bpf_map *map,
63+ u64 *imm, u32 off);
64+ int (*map_direct_value_meta)(const struct bpf_map *map,
65+ u64 imm, u32 *off);
6066 };
6167
6268 struct bpf_map {
@@ -81,7 +87,8 @@ struct bpf_map { · 18 unmodified lines
8187 struct btf *btf;
8288 u32 pages;
8389 bool unpriv_array;
84− /* 51 bytes hole */
90+ bool frozen; /* write-once */
91+ /* 48 bytes hole */
8592
8693 /* The 3rd and 4th cacheline with misc members to avoid false sharing
8794 * particularly with refcounting.
@@ -177,6 +184,7 @@ enum bpf_arg_type { · 89 unmodified lines
177184 ARG_PTR_TO_MAP_KEY, /* pointer to stack used as map key */
178185 ARG_PTR_TO_MAP_VALUE, /* pointer to stack used as map value */
179186 ARG_PTR_TO_UNINIT_MAP_VALUE, /* pointer to valid memory used to store a map value */
187+ ARG_PTR_TO_MAP_VALUE_OR_NULL, /* pointer to stack used as map value or NULL */
180188
181189 /* the following constraints used to prototype bpf_memcmp() and other
182190 * functions that access data on eBPF program stack
@@ -195,6 +203,9 @@ enum bpf_arg_type { · 12 unmodified lines
195203 ARG_ANYTHING, /* any (initialized) argument is ok */
196204 ARG_PTR_TO_SPIN_LOCK, /* pointer to bpf_spin_lock */
197205 ARG_PTR_TO_SOCK_COMMON, /* pointer to sock_common */
206+ ARG_PTR_TO_INT, /* pointer to int */
207+ ARG_PTR_TO_LONG, /* pointer to long */
208+ ARG_PTR_TO_SOCKET, /* pointer to bpf_sock (fullsock) */
198209 };
199210
200211 /* type of values returned from helper functions */
@@ -205,6 +216,7 @@ enum bpf_return_type { · 4 unmodified lines
205216 RET_PTR_TO_MAP_VALUE_OR_NULL, /* returns a pointer to map elem value or NULL */
206217 RET_PTR_TO_SOCKET_OR_NULL, /* returns a pointer to a socket or NULL */
207218 RET_PTR_TO_TCP_SOCK_OR_NULL, /* returns a pointer to a tcp_sock or NULL */
219+ RET_PTR_TO_SOCK_COMMON_OR_NULL, /* returns a pointer to a sock_common or NULL */
208220 };
209221
210222 /* eBPF function prototype used by verifier to allow BPF_CALLs from eBPF programs
@@ -262,6 +274,7 @@ enum bpf_reg_type { · 51 unmodified lines
262274 PTR_TO_SOCK_COMMON_OR_NULL, /* reg points to sock_common or NULL */
263275 PTR_TO_TCP_SOCK, /* reg points to struct tcp_sock */
264276 PTR_TO_TCP_SOCK_OR_NULL, /* reg points to struct tcp_sock or NULL */
277+ PTR_TO_TP_BUFFER, /* reg points to a writable raw tp's buffer */
265278 };
266279
267280 /* The information passed from prog-specific *_is_valid_access
@@ -351,6 +364,7 @@ struct bpf_prog_aux { · 83 unmodified lines
351364 u32 used_map_cnt;
352365 u32 max_ctx_offset;
353366 u32 max_pkt_offset;
367+ u32 max_tp_access;
354368 u32 stack_depth;
355369 u32 id;
356370 u32 func_cnt; /* used by non-func prog as the number of func progs */
@@ -420,8 +434,38 @@ struct bpf_array { · 63 unmodified lines
420434 };
421435 };
422436
437+#define BPF_COMPLEXITY_LIMIT_INSNS 1000000 /* yes. 1M insns */
423438 #define MAX_TAIL_CALL_CNT 32
424439
440+#define BPF_F_ACCESS_MASK (BPF_F_RDONLY | \
441+ BPF_F_RDONLY_PROG | \
442+ BPF_F_WRONLY | \
443+ BPF_F_WRONLY_PROG)
444+
445+#define BPF_MAP_CAN_READ BIT(0)
446+#define BPF_MAP_CAN_WRITE BIT(1)
447+
448+static inline u32 bpf_map_flags_to_cap(struct bpf_map *map)
449+{
450+ u32 access_flags = map->map_flags & (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG);
451+
452+ /* Combination of BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG is
453+ * not possible.
454+ */
455+ if (access_flags & BPF_F_RDONLY_PROG)
456+ return BPF_MAP_CAN_READ;
457+ else if (access_flags & BPF_F_WRONLY_PROG)
458+ return BPF_MAP_CAN_WRITE;
459+ else
460+ return BPF_MAP_CAN_READ | BPF_MAP_CAN_WRITE;
461+}
462+
463+static inline bool bpf_map_flags_access_ok(u32 access_flags)
464+{
465+ return (access_flags & (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG)) !=
466+ (BPF_F_RDONLY_PROG | BPF_F_WRONLY_PROG);
467+}
468+
425469 struct bpf_event_entry {
426470 struct perf_event *event;
427471 struct file *perf_file;
@@ -445,14 +489,6 @@ typedef u32 (*bpf_convert_ctx_access_t)(enum bpf_access_type type, · 17 unmodified lines
445489 u64 bpf_event_output(struct bpf_map *map, u64 flags, void *meta, u64 meta_size,
446490 void *ctx, u64 ctx_size, bpf_ctx_copy_t ctx_copy);
447491
448−int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr,
449− union bpf_attr __user *uattr);
450−int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr,
451− union bpf_attr __user *uattr);
452−int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,
453− const union bpf_attr *kattr,
454− union bpf_attr __user *uattr);
455−
456492 /* an array of programs to be executed under rcu_lock.
457493 *
458494 * Typical usage:
@@ -510,7 +546,7 @@ int bpf_prog_array_copy(struct bpf_prog_array __rcu *old_array, · 51 unmodified lines
510546 } \
511547 _out: \
512548 rcu_read_unlock(); \
513− preempt_enable_no_resched(); \
549+ preempt_enable(); \
514550 _ret; \
515551 })
516552
@@ -643,6 +679,13 @@ static inline int bpf_map_attr_numa_node(const union bpf_attr *attr) · 126 unmodified lines
643679 struct bpf_prog *bpf_prog_get_type_path(const char *name, enum bpf_prog_type type);
644680 int array_map_alloc_check(union bpf_attr *attr);
645681
682+int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr,
683+ union bpf_attr __user *uattr);
684+int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr,
685+ union bpf_attr __user *uattr);
686+int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,
687+ const union bpf_attr *kattr,
688+ union bpf_attr __user *uattr);
646689 #else /* !CONFIG_BPF_SYSCALL */
647690 static inline struct bpf_prog *bpf_prog_get(u32 ufd)
648691 {
@@ -754,6 +797,27 @@ static inline struct bpf_prog *bpf_prog_get_type_path(const char *name, · 105 unmodified lines
754797 {
755798 return ERR_PTR(-EOPNOTSUPP);
756799 }
800+
801+static inline int bpf_prog_test_run_xdp(struct bpf_prog *prog,
802+ const union bpf_attr *kattr,
803+ union bpf_attr __user *uattr)
804+{
805+ return -ENOTSUPP;
806+}
807+
808+static inline int bpf_prog_test_run_skb(struct bpf_prog *prog,
809+ const union bpf_attr *kattr,
810+ union bpf_attr __user *uattr)
811+{
812+ return -ENOTSUPP;
813+}
814+
815+static inline int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,
816+ const union bpf_attr *kattr,
817+ union bpf_attr __user *uattr)
818+{
819+ return -ENOTSUPP;
820+}
757821 #endif /* CONFIG_BPF_SYSCALL */
758822
759823 static inline struct bpf_prog *bpf_prog_get_type(u32 ufd,
@@ -929,6 +993,8 @@ extern const struct bpf_func_proto bpf_sk_redirect_map_proto; · 169 unmodified lines
929993 extern const struct bpf_func_proto bpf_spin_lock_proto;
930994 extern const struct bpf_func_proto bpf_spin_unlock_proto;
931995 extern const struct bpf_func_proto bpf_get_local_storage_proto;
996+extern const struct bpf_func_proto bpf_strtol_proto;
997+extern const struct bpf_func_proto bpf_strtoul_proto;
932998
933999 /* Shared helpers among cBPF and eBPF. */
9341000 void bpf_user_rnd_init_once(void);
include/linux/bpf_types.h+3−0
@@ -25,9 +25,11 @@ BPF_PROG_TYPE(BPF_PROG_TYPE_KPROBE, kprobe) · 24 unmodified lines
2525 BPF_PROG_TYPE(BPF_PROG_TYPE_TRACEPOINT, tracepoint)
2626 BPF_PROG_TYPE(BPF_PROG_TYPE_PERF_EVENT, perf_event)
2727 BPF_PROG_TYPE(BPF_PROG_TYPE_RAW_TRACEPOINT, raw_tracepoint)
28+BPF_PROG_TYPE(BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, raw_tracepoint_writable)
2829 #endif
2930 #ifdef CONFIG_CGROUP_BPF
3031 BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_DEVICE, cg_dev)
32+BPF_PROG_TYPE(BPF_PROG_TYPE_CGROUP_SYSCTL, cg_sysctl)
3133 #endif
3234 #ifdef CONFIG_BPF_LIRC_MODE2
3335 BPF_PROG_TYPE(BPF_PROG_TYPE_LIRC_MODE2, lirc_mode2)
@@ -59,6 +61,7 @@ BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY_OF_MAPS, array_of_maps_map_ops) · 25 unmodified lines
5961 BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops)
6062 #ifdef CONFIG_NET
6163 BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)
64+BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
6265 #if defined(CONFIG_BPF_STREAM_PARSER)
6366 BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
6467 BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKHASH, sock_hash_ops)
include/linux/bpf_verifier.h+32−0
@@ -207,6 +207,7 @@ struct bpf_verifier_state { · 206 unmodified lines
207207 struct bpf_verifier_state_list {
208208 struct bpf_verifier_state state;
209209 struct bpf_verifier_state_list *next;
210+ int miss_cnt, hit_cnt;
210211 };
211212
212213 /* Possible states for alu_state member. */
@@ -223,6 +224,10 @@ struct bpf_insn_aux_data { · 10 unmodified lines
223224 unsigned long map_state; /* pointer/poison value for maps */
224225 s32 call_imm; /* saved imm field of call insn */
225226 u32 alu_limit; /* limit for add/sub register with pointer */
227+ struct {
228+ u32 map_index; /* index into used_maps[] */
229+ u32 map_off; /* offset from value base address */
230+ };
226231 };
227232 int ctx_field_size; /* the ctx field size for load insn, maybe 0 */
228233 int sanitize_stack_off; /* stack slot to be cleared */
@@ -248,6 +253,12 @@ static inline bool bpf_verifier_log_full(const struct bpf_verifier_log *log) · 19 unmodified lines
248253 return log->len_used >= log->len_total - 1;
249254 }
250255
256+#define BPF_LOG_LEVEL1 1
257+#define BPF_LOG_LEVEL2 2
258+#define BPF_LOG_STATS 4
259+#define BPF_LOG_LEVEL (BPF_LOG_LEVEL1 | BPF_LOG_LEVEL2)
260+#define BPF_LOG_MASK (BPF_LOG_LEVEL | BPF_LOG_STATS)
261+
251262 static inline bool bpf_verifier_log_needed(const struct bpf_verifier_log *log)
252263 {
253264 return log->level && log->ubuf && !bpf_verifier_log_full(log);
@@ -274,6 +285,7 @@ struct bpf_verifier_env { · 20 unmodified lines
274285 bool strict_alignment; /* perform strict pointer alignment checks */
275286 struct bpf_verifier_state *cur_state; /* current verifier state */
276287 struct bpf_verifier_state_list **explored_states; /* search pruning optimization */
288+ struct bpf_verifier_state_list *free_list;
277289 struct bpf_map *used_maps[MAX_USED_MAPS]; /* array of map's used by eBPF program */
278290 u32 used_map_cnt; /* number of used maps */
279291 u32 id_gen; /* used to generate unique reg IDs */
@@ -283,7 +295,27 @@ struct bpf_verifier_env { · 3 unmodified lines
283295 const struct bpf_line_info *prev_linfo;
284296 struct bpf_verifier_log log;
285297 struct bpf_subprog_info subprog_info[BPF_MAX_SUBPROGS + 1];
298+ struct {
299+ int *insn_state;
300+ int *insn_stack;
301+ int cur_stack;
302+ } cfg;
286303 u32 subprog_cnt;
304+ /* number of instructions analyzed by the verifier */
305+ u32 insn_processed;
306+ /* total verification time */
307+ u64 verification_time;
308+ /* maximum number of verifier states kept in 'branching' instructions */
309+ u32 max_states_per_insn;
310+ /* total number of allocated verifier states */
311+ u32 total_states;
312+ /* some states are freed during program analysis.
313+ * this is peak number of states. this number dominates kernel
314+ * memory consumption during verification
315+ */
316+ u32 peak_states;
317+ /* longest register parentage chain walked for liveness marking */
318+ u32 longest_mark_read_walk;
287319 };
288320
289321 __printf(2, 0) void bpf_verifier_vlog(struct bpf_verifier_log *log,
include/linux/bsg-lib.h+1−15
@@ -1,24 +1,10 @@
1+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * BSG helper library
34 *
45 * Copyright (C) 2008 James Smart, Emulex Corporation
56 * Copyright (C) 2011 Red Hat, Inc. All rights reserved.
67 * Copyright (C) 2011 Mike Christie
7− *
8− * This program is free software; you can redistribute it and/or modify
9− * it under the terms of the GNU General Public License as published by
10− * the Free Software Foundation; either version 2 of the License, or
11− * (at your option) any later version.
12− *
13− * This program is distributed in the hope that it will be useful,
14− * but WITHOUT ANY WARRANTY; without even the implied warranty of
15− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16− * GNU General Public License for more details.
17− *
18− * You should have received a copy of the GNU General Public License
19− * along with this program; if not, write to the Free Software
20− * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21− *
228 */
239 #ifndef _BLK_BSG_
2410 #define _BLK_BSG_
include/linux/btf.h+1−0
@@ -51,6 +51,7 @@ bool btf_member_is_reg_int(const struct btf *btf, const struct btf_type *s, · 50 unmodified lines
5151 const struct btf_member *m,
5252 u32 expected_offset, u32 expected_size);
5353 int btf_find_spin_lock(const struct btf *btf, const struct btf_type *t);
54+bool btf_type_is_void(const struct btf_type *t);
5455
5556 #ifdef CONFIG_BPF_SYSCALL
5657 const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id);
include/linux/bvec.h+7−30
@@ -1,21 +1,8 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * bvec iterator
34 *
45 * Copyright (C) 2001 Ming Lei <ming.lei@canonical.com>
5− *
6− * This program is free software; you can redistribute it and/or modify
7− * it under the terms of the GNU General Public License version 2 as
8− * published by the Free Software Foundation.
9− *
10− * This program is distributed in the hope that it will be useful,
11− * but WITHOUT ANY WARRANTY; without even the implied warranty of
12− *
13− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14− * GNU General Public License for more details.
15− *
16− * You should have received a copy of the GNU General Public Licens
17− * along with this program; if not, write to the Free Software
18− * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-
196 */
207 #ifndef __LINUX_BVEC_ITER_H
218 #define __LINUX_BVEC_ITER_H
@@ -51,11 +38,6 @@ struct bvec_iter_all { · 29 unmodified lines
5138 unsigned done;
5239 };
5340
54−static inline struct page *bvec_nth_page(struct page *page, int idx)
55−{
56− return idx == 0 ? page : nth_page(page, idx);
57−}
58−
5941 /*
6042 * various member access, note that bio_data should of course not be used
6143 * on highmem page vectors
@@ -92,8 +74,8 @@ static inline struct page *bvec_nth_page(struct page *page, int idx) · 30 unmodified lines
9274 PAGE_SIZE - bvec_iter_offset((bvec), (iter)))
9375
9476 #define bvec_iter_page(bvec, iter) \
95− bvec_nth_page(mp_bvec_iter_page((bvec), (iter)), \
96− mp_bvec_iter_page_idx((bvec), (iter)))
77+ (mp_bvec_iter_page((bvec), (iter)) + \
78+ mp_bvec_iter_page_idx((bvec), (iter)))
9779
9880 #define bvec_iter_bvec(bvec, iter) \
9981 ((struct bio_vec) { \
@@ -157,11 +139,11 @@ static inline void bvec_advance(const struct bio_vec *bvec, · 57 unmodified lines
157139 struct bio_vec *bv = &iter_all->bv;
158140
159141 if (iter_all->done) {
160− bv->bv_page = nth_page(bv->bv_page, 1);
142+ bv->bv_page++;
161143 bv->bv_offset = 0;
162144 } else {
163− bv->bv_page = bvec->bv_page;
164− bv->bv_offset = bvec->bv_offset;
145+ bv->bv_page = bvec->bv_page + (bvec->bv_offset >> PAGE_SHIFT);
146+ bv->bv_offset = bvec->bv_offset & ~PAGE_MASK;
165147 }
166148 bv->bv_len = min_t(unsigned int, PAGE_SIZE - bv->bv_offset,
167149 bvec->bv_len - iter_all->done);
@@ -183,7 +165,7 @@ static inline void mp_bvec_last_segment(const struct bio_vec *bvec, · 15 unmodified lines
183165 unsigned total = bvec->bv_offset + bvec->bv_len;
184166 unsigned last_page = (total - 1) / PAGE_SIZE;
185167
186− seg->bv_page = bvec_nth_page(bvec->bv_page, last_page);
168+ seg->bv_page = bvec->bv_page + last_page;
187169
188170 /* the whole segment is inside the last page */
189171 if (bvec->bv_offset >= last_page * PAGE_SIZE) {
@@ -195,9 +177,4 @@ static inline void mp_bvec_last_segment(const struct bio_vec *bvec, · 5 unmodified lines
195177 }
196178 }
197179
198−#define mp_bvec_for_each_page(pg, bv, i) \
199− for (i = (bv)->bv_offset / PAGE_SIZE; \
200− (i <= (((bv)->bv_offset + (bv)->bv_len - 1) / PAGE_SIZE)) && \
201− (pg = bvec_nth_page((bv)->bv_page, i)); i += 1)
202−
203180 #endif /* __LINUX_BVEC_ITER_H */
include/linux/ceph/ceph_fs.h+6−0
@@ -436,6 +436,12 @@ union ceph_mds_request_args { · 435 unmodified lines
436436 __le64 length; /* num bytes to lock from start */
437437 __u8 wait; /* will caller wait for lock to become available? */
438438 } __attribute__ ((packed)) filelock_change;
439+ struct {
440+ __le32 mask; /* CEPH_CAP_* */
441+ __le64 snapid;
442+ __le64 parent;
443+ __le32 hash;
444+ } __attribute__ ((packed)) lookupino;
439445 } __attribute__ ((packed));
440446
441447 #define CEPH_MDS_FLAG_REPLAY 1 /* this is a replayed op */
include/linux/ceph/messenger.h+2−1
@@ -323,7 +323,8 @@ struct ceph_connection { · 322 unmodified lines
323323 };
324324
325325
326−extern const char *ceph_pr_addr(const struct sockaddr_storage *ss);
326+extern const char *ceph_pr_addr(const struct ceph_entity_addr *addr);
327+
327328 extern int ceph_parse_ips(const char *c, const char *end,
328329 struct ceph_entity_addr *addr,
329330 int max_count, int *count);
include/linux/ceph/osdmap.h+6−7
@@ -110,17 +110,16 @@ struct ceph_object_id { · 109 unmodified lines
110110 int name_len;
111111 };
112112
113+#define __CEPH_OID_INITIALIZER(oid) { .name = (oid).inline_name }
114+
115+#define CEPH_DEFINE_OID_ONSTACK(oid) \
116+ struct ceph_object_id oid = __CEPH_OID_INITIALIZER(oid)
117+
113118 static inline void ceph_oid_init(struct ceph_object_id *oid)
114119 {
115− oid->name = oid->inline_name;
116− oid->name_len = 0;
120+ *oid = (struct ceph_object_id) __CEPH_OID_INITIALIZER(*oid);
117121 }
118122
119−#define CEPH_OID_INIT_ONSTACK(oid) \
120− ({ ceph_oid_init(&oid); oid; })
121−#define CEPH_DEFINE_OID_ONSTACK(oid) \
122− struct ceph_object_id oid = CEPH_OID_INIT_ONSTACK(oid)
123−
124123 static inline bool ceph_oid_empty(const struct ceph_object_id *oid)
125124 {
126125 return oid->name == oid->inline_name && !oid->name_len;
include/linux/cgroup-defs.h+33−0
@@ -65,6 +65,12 @@ enum { · 64 unmodified lines
6565 * specified at mount time and thus is implemented here.
6666 */
6767 CGRP_CPUSET_CLONE_CHILDREN,
68+
69+ /* Control group has to be frozen. */
70+ CGRP_FREEZE,
71+
72+ /* Cgroup is frozen. */
73+ CGRP_FROZEN,
6874 };
6975
7076 /* cgroup_root->flags */
@@ -317,6 +323,25 @@ struct cgroup_rstat_cpu { · 246 unmodified lines
317323 struct cgroup *updated_next; /* NULL iff not on the list */
318324 };
319325
326+struct cgroup_freezer_state {
327+ /* Should the cgroup and its descendants be frozen. */
328+ bool freeze;
329+
330+ /* Should the cgroup actually be frozen? */
331+ int e_freeze;
332+
333+ /* Fields below are protected by css_set_lock */
334+
335+ /* Number of frozen descendant cgroups */
336+ int nr_frozen_descendants;
337+
338+ /*
339+ * Number of tasks, which are counted as frozen:
340+ * frozen, SIGSTOPped, and PTRACEd.
341+ */
342+ int nr_frozen_tasks;
343+};
344+
320345 struct cgroup {
321346 /* self css with NULL ->ss, points back to this cgroup */
322347 struct cgroup_subsys_state self;
@@ -349,6 +374,11 @@ struct cgroup { · 26 unmodified lines
349374 * Dying cgroups are cgroups which were deleted by a user,
350375 * but are still existing because someone else is holding a reference.
351376 * max_descendants is a maximum allowed number of descent cgroups.
377+ *
378+ * nr_descendants and nr_dying_descendants are protected
379+ * by cgroup_mutex and css_set_lock. It's fine to read them holding
380+ * any of cgroup_mutex and css_set_lock; for writing both locks
381+ * should be held.
352382 */
353383 int nr_descendants;
354384 int nr_dying_descendants;
@@ -448,6 +478,9 @@ struct cgroup { · 93 unmodified lines
448478 /* If there is block congestion on this cgroup. */
449479 atomic_t congestion_count;
450480
481+ /* Used to store internal freezer state */
482+ struct cgroup_freezer_state freezer;
483+
451484 /* ids of the ancestors at each level including self */
452485 int ancestor_ids[];
453486 };
include/linux/cgroup.h+43−0
@@ -881,4 +881,47 @@ static inline void put_cgroup_ns(struct cgroup_namespace *ns) · 880 unmodified lines
881881 free_cgroup_ns(ns);
882882 }
883883
884+#ifdef CONFIG_CGROUPS
885+
886+void cgroup_enter_frozen(void);
887+void cgroup_leave_frozen(bool always_leave);
888+void cgroup_update_frozen(struct cgroup *cgrp);
889+void cgroup_freeze(struct cgroup *cgrp, bool freeze);
890+void cgroup_freezer_migrate_task(struct task_struct *task, struct cgroup *src,
891+ struct cgroup *dst);
892+
893+static inline bool cgroup_task_freeze(struct task_struct *task)
894+{
895+ bool ret;
896+
897+ if (task->flags & PF_KTHREAD)
898+ return false;
899+
900+ rcu_read_lock();
901+ ret = test_bit(CGRP_FREEZE, &task_dfl_cgroup(task)->flags);
902+ rcu_read_unlock();
903+
904+ return ret;
905+}
906+
907+static inline bool cgroup_task_frozen(struct task_struct *task)
908+{
909+ return task->frozen;
910+}
911+
912+#else /* !CONFIG_CGROUPS */
913+
914+static inline void cgroup_enter_frozen(void) { }
915+static inline void cgroup_leave_frozen(bool always_leave) { }
916+static inline bool cgroup_task_freeze(struct task_struct *task)
917+{
918+ return false;
919+}
920+static inline bool cgroup_task_frozen(struct task_struct *task)
921+{
922+ return false;
923+}
924+
925+#endif /* !CONFIG_CGROUPS */
926+
884927 #endif /* _LINUX_CGROUP_H */
include/linux/clk-provider.h+53−60
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #ifndef __LINUX_CLK_PROVIDER_H
77 #define __LINUX_CLK_PROVIDER_H
88
9−#include <linux/io.h>
109 #include <linux/of.h>
1110 #include <linux/of_clk.h>
1211
@@ -24,7 +23,7 @@ · 11 unmodified lines
2423 #define CLK_SET_RATE_PARENT BIT(2) /* propagate rate change up one level */
2524 #define CLK_IGNORE_UNUSED BIT(3) /* do not gate even if unused */
2625 /* unused */
27−#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
26+ /* unused */
2827 #define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */
2928 #define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */
3029 #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */
@@ -250,6 +249,20 @@ struct clk_ops { · 219 unmodified lines
250249 void (*debug_init)(struct clk_hw *hw, struct dentry *dentry);
251250 };
252251
252+/**
253+ * struct clk_parent_data - clk parent information
254+ * @hw: parent clk_hw pointer (used for clk providers with internal clks)
255+ * @fw_name: parent name local to provider registering clk
256+ * @name: globally unique parent name (used as a fallback)
257+ * @index: parent index local to provider registering clk (if @fw_name absent)
258+ */
259+struct clk_parent_data {
260+ const struct clk_hw *hw;
261+ const char *fw_name;
262+ const char *name;
263+ int index;
264+};
265+
253266 /**
254267 * struct clk_init_data - holds init data that's common to all clocks and is
255268 * shared between the clock provider and the common clock framework.
@@ -257,13 +270,20 @@ struct clk_ops { · 1 unmodified line
257270 * @name: clock name
258271 * @ops: operations this clock supports
259272 * @parent_names: array of string names for all possible parents
273+ * @parent_data: array of parent data for all possible parents (when some
274+ * parents are external to the clk controller)
275+ * @parent_hws: array of pointers to all possible parents (when all parents
276+ * are internal to the clk controller)
260277 * @num_parents: number of possible parents
261278 * @flags: framework-level hints and quirks
262279 */
263280 struct clk_init_data {
264281 const char *name;
265282 const struct clk_ops *ops;
283+ /* Only one of the following three should be assigned */
266284 const char * const *parent_names;
285+ const struct clk_parent_data *parent_data;
286+ const struct clk_hw **parent_hws;
267287 u8 num_parents;
268288 unsigned long flags;
269289 };
@@ -307,7 +327,6 @@ struct clk_fixed_rate { · 37 unmodified lines
307327 struct clk_hw hw;
308328 unsigned long fixed_rate;
309329 unsigned long fixed_accuracy;
310− u8 flags;
311330 };
312331
313332 #define to_clk_fixed_rate(_hw) container_of(_hw, struct clk_fixed_rate, hw)
@@ -349,6 +368,9 @@ void of_fixed_clk_setup(struct device_node *np); · 35 unmodified lines
349368 * of this register, and mask of gate bits are in higher 16-bit of this
350369 * register. While setting the gate bits, higher 16-bit should also be
351370 * updated to indicate changing gate bits.
371+ * CLK_GATE_BIG_ENDIAN - by default little endian register accesses are used for
372+ * the gate register. Setting this flag makes the register accesses big
373+ * endian.
352374 */
353375 struct clk_gate {
354376 struct clk_hw hw;
@@ -362,6 +384,7 @@ struct clk_gate { · 7 unmodified lines
362384
363385 #define CLK_GATE_SET_TO_DISABLE BIT(0)
364386 #define CLK_GATE_HIWORD_MASK BIT(1)
387+#define CLK_GATE_BIG_ENDIAN BIT(2)
365388
366389 extern const struct clk_ops clk_gate_ops;
367390 struct clk *clk_register_gate(struct device *dev, const char *name,
@@ -417,6 +440,9 @@ struct clk_div_table { · 49 unmodified lines
417440 * CLK_DIVIDER_MAX_AT_ZERO - For dividers which are like CLK_DIVIDER_ONE_BASED
418441 * except when the value read from the register is zero, the divisor is
419442 * 2^width of the field.
443+ * CLK_DIVIDER_BIG_ENDIAN - By default little endian register accesses are used
444+ * for the divider register. Setting this flag makes the register accesses
445+ * big endian.
420446 */
421447 struct clk_divider {
422448 struct clk_hw hw;
@@ -438,6 +464,7 @@ struct clk_divider { · 15 unmodified lines
438464 #define CLK_DIVIDER_ROUND_CLOSEST BIT(4)
439465 #define CLK_DIVIDER_READ_ONLY BIT(5)
440466 #define CLK_DIVIDER_MAX_AT_ZERO BIT(6)
467+#define CLK_DIVIDER_BIG_ENDIAN BIT(7)
441468
442469 extern const struct clk_ops clk_divider_ops;
443470 extern const struct clk_ops clk_divider_ro_ops;
@@ -499,8 +526,13 @@ void clk_hw_unregister_divider(struct clk_hw *hw); · 55 unmodified lines
499526 * register, and mask of mux bits are in higher 16-bit of this register.
500527 * While setting the mux bits, higher 16-bit should also be updated to
501528 * indicate changing mux bits.
529+ * CLK_MUX_READ_ONLY - The mux registers can't be written, only read in the
530+ * .get_parent clk_op.
502531 * CLK_MUX_ROUND_CLOSEST - Use the parent rate that is closest to the desired
503532 * frequency.
533+ * CLK_MUX_BIG_ENDIAN - By default little endian register accesses are used for
534+ * the mux register. Setting this flag makes the register accesses big
535+ * endian.
504536 */
505537 struct clk_mux {
506538 struct clk_hw hw;
@@ -519,6 +551,7 @@ struct clk_mux { · 12 unmodified lines
519551 #define CLK_MUX_HIWORD_MASK BIT(2)
520552 #define CLK_MUX_READ_ONLY BIT(3) /* mux can't be changed */
521553 #define CLK_MUX_ROUND_CLOSEST BIT(4)
554+#define CLK_MUX_BIG_ENDIAN BIT(5)
522555
523556 extern const struct clk_ops clk_mux_ops;
524557 extern const struct clk_ops clk_mux_ro_ops;
@@ -602,6 +635,9 @@ void clk_hw_unregister_fixed_factor(struct clk_hw *hw); · 77 unmodified lines
602635 * is the value read from the register. If CLK_FRAC_DIVIDER_ZERO_BASED
603636 * is set then the numerator and denominator are both the value read
604637 * plus one.
638+ * CLK_FRAC_DIVIDER_BIG_ENDIAN - By default little endian register accesses are
639+ * used for the divider register. Setting this flag makes the register
640+ * accesses big endian.
605641 */
606642 struct clk_fractional_divider {
607643 struct clk_hw hw;
@@ -622,6 +658,7 @@ struct clk_fractional_divider { · 14 unmodified lines
622658 #define to_clk_fd(_hw) container_of(_hw, struct clk_fractional_divider, hw)
623659
624660 #define CLK_FRAC_DIVIDER_ZERO_BASED BIT(0)
661+#define CLK_FRAC_DIVIDER_BIG_ENDIAN BIT(1)
625662
626663 extern const struct clk_ops clk_fractional_divider_ops;
627664 struct clk *clk_register_fractional_divider(struct device *dev,
@@ -654,6 +691,9 @@ void clk_hw_unregister_fractional_divider(struct clk_hw *hw); · 26 unmodified lines
654691 * leaving the parent rate unmodified.
655692 * CLK_MULTIPLIER_ROUND_CLOSEST - Makes the best calculated divider to be
656693 * rounded to the closest integer instead of the down one.
694+ * CLK_MULTIPLIER_BIG_ENDIAN - By default little endian register accesses are
695+ * used for the multiplier register. Setting this flag makes the register
696+ * accesses big endian.
657697 */
658698 struct clk_multiplier {
659699 struct clk_hw hw;
@@ -668,6 +708,7 @@ struct clk_multiplier { · 8 unmodified lines
668708
669709 #define CLK_MULTIPLIER_ZERO_BYPASS BIT(0)
670710 #define CLK_MULTIPLIER_ROUND_CLOSEST BIT(1)
711+#define CLK_MULTIPLIER_BIG_ENDIAN BIT(2)
671712
672713 extern const struct clk_ops clk_multiplier_ops;
673714
@@ -712,16 +753,19 @@ struct clk_hw *clk_hw_register_composite(struct device *dev, const char *name, · 38 unmodified lines
712753 unsigned long flags);
713754 void clk_hw_unregister_composite(struct clk_hw *hw);
714755
715−/***
716− * struct clk_gpio_gate - gpio gated clock
756+/**
757+ * struct clk_gpio - gpio gated clock
717758 *
718759 * @hw: handle between common and hardware-specific interfaces
719760 * @gpiod: gpio descriptor
720761 *
721− * Clock with a gpio control for enabling and disabling the parent clock.
722− * Implements .enable, .disable and .is_enabled
762+ * Clock with a gpio control for enabling and disabling the parent clock
763+ * or switching between two parents by asserting or deasserting the gpio.
764+ *
765+ * Implements .enable, .disable and .is_enabled or
766+ * .get_parent, .set_parent and .determine_rate depending on which clk_ops
767+ * is used.
723768 */
724−
725769 struct clk_gpio {
726770 struct clk_hw hw;
727771 struct gpio_desc *gpiod;
@@ -738,16 +782,6 @@ struct clk_hw *clk_hw_register_gpio_gate(struct device *dev, const char *name, · 10 unmodified lines
738782 unsigned long flags);
739783 void clk_hw_unregister_gpio_gate(struct clk_hw *hw);
740784
741−/**
742− * struct clk_gpio_mux - gpio controlled clock multiplexer
743− *
744− * @hw: see struct clk_gpio
745− * @gpiod: gpio descriptor to select the parent of this clock multiplexer
746− *
747− * Clock with a gpio control for selecting the parent clock.
748− * Implements .get_parent, .set_parent and .determine_rate
749− */
750−
751785 extern const struct clk_ops clk_gpio_mux_ops;
752786 struct clk *clk_register_gpio_mux(struct device *dev, const char *name,
753787 const char * const *parent_names, u8 num_parents, struct gpio_desc *gpiod,
@@ -757,22 +791,12 @@ struct clk_hw *clk_hw_register_gpio_mux(struct device *dev, const char *name, · 3 unmodified lines
757791 unsigned long flags);
758792 void clk_hw_unregister_gpio_mux(struct clk_hw *hw);
759793
760−/**
761− * clk_register - allocate a new clock, register it and return an opaque cookie
762− * @dev: device that is registering this clock
763− * @hw: link to hardware-specific clock data
764− *
765− * clk_register is the primary interface for populating the clock tree with new
766− * clock nodes. It returns a pointer to the newly allocated struct clk which
767− * cannot be dereferenced by driver code but may be used in conjuction with the
768− * rest of the clock API. In the event of an error clk_register will return an
769− * error code; drivers must test for an error code after calling clk_register.
770− */
771794 struct clk *clk_register(struct device *dev, struct clk_hw *hw);
772795 struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw);
773796
774797 int __must_check clk_hw_register(struct device *dev, struct clk_hw *hw);
775798 int __must_check devm_clk_hw_register(struct device *dev, struct clk_hw *hw);
799+int __must_check of_clk_hw_register(struct device_node *node, struct clk_hw *hw);
776800
777801 void clk_unregister(struct clk *clk);
778802 void devm_clk_unregister(struct device *dev, struct clk *clk);
@@ -993,37 +1017,6 @@ static inline int of_clk_detect_critical(struct device_node *np, int index, · 214 unmodified lines
9931017 }
9941018 #endif /* CONFIG_OF */
9951019
996−/*
997− * wrap access to peripherals in accessor routines
998− * for improved portability across platforms
999− */
1000−
1001−#if IS_ENABLED(CONFIG_PPC)
1002−
1003−static inline u32 clk_readl(u32 __iomem *reg)
1004−{
1005− return ioread32be(reg);
1006−}
1007−
1008−static inline void clk_writel(u32 val, u32 __iomem *reg)
1009−{
1010− iowrite32be(val, reg);
1011−}
1012−
1013−#else /* platform dependent I/O accessors */
1014−
1015−static inline u32 clk_readl(u32 __iomem *reg)
1016−{
1017− return readl(reg);
1018−}
1019−
1020−static inline void clk_writel(u32 val, u32 __iomem *reg)
1021−{
1022− writel(val, reg);
1023−}
1024−
1025−#endif /* platform dependent I/O accessors */
1026−
10271020 void clk_gate_restore_context(struct clk_hw *hw);
10281021
10291022 #endif /* CONFIG_COMMON_CLK */
include/linux/clk.h+16−0
@@ -811,6 +811,22 @@ static inline bool clk_has_parent(struct clk *clk, struct clk *parent) · 810 unmodified lines
811811 return true;
812812 }
813813
814+static inline int clk_set_rate_range(struct clk *clk, unsigned long min,
815+ unsigned long max)
816+{
817+ return 0;
818+}
819+
820+static inline int clk_set_min_rate(struct clk *clk, unsigned long rate)
821+{
822+ return 0;
823+}
824+
825+static inline int clk_set_max_rate(struct clk *clk, unsigned long rate)
826+{
827+ return 0;
828+}
829+
814830 static inline int clk_set_parent(struct clk *clk, struct clk *parent)
815831 {
816832 return 0;
include/linux/clk/analogbits-wrpll-cln28hpc.h+79−0
@@ -0,0 +1,79 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright (C) 2018-2019 SiFive, Inc.
4+ * Wesley Terpstra
5+ * Paul Walmsley
6+ */
7+
8+#ifndef __LINUX_CLK_ANALOGBITS_WRPLL_CLN28HPC_H
9+#define __LINUX_CLK_ANALOGBITS_WRPLL_CLN28HPC_H
10+
11+#include <linux/types.h>
12+
13+/* DIVQ_VALUES: number of valid DIVQ values */
14+#define DIVQ_VALUES 6
15+
16+/*
17+ * Bit definitions for struct wrpll_cfg.flags
18+ *
19+ * WRPLL_FLAGS_BYPASS_FLAG: if set, the PLL is either in bypass, or should be
20+ * programmed to enter bypass
21+ * WRPLL_FLAGS_RESET_FLAG: if set, the PLL is in reset
22+ * WRPLL_FLAGS_INT_FEEDBACK_FLAG: if set, the PLL is configured for internal
23+ * feedback mode
24+ * WRPLL_FLAGS_EXT_FEEDBACK_FLAG: if set, the PLL is configured for external
25+ * feedback mode (not yet supported by this driver)
26+ */
27+#define WRPLL_FLAGS_BYPASS_SHIFT 0
28+#define WRPLL_FLAGS_BYPASS_MASK BIT(WRPLL_FLAGS_BYPASS_SHIFT)
29+#define WRPLL_FLAGS_RESET_SHIFT 1
30+#define WRPLL_FLAGS_RESET_MASK BIT(WRPLL_FLAGS_RESET_SHIFT)
31+#define WRPLL_FLAGS_INT_FEEDBACK_SHIFT 2
32+#define WRPLL_FLAGS_INT_FEEDBACK_MASK BIT(WRPLL_FLAGS_INT_FEEDBACK_SHIFT)
33+#define WRPLL_FLAGS_EXT_FEEDBACK_SHIFT 3
34+#define WRPLL_FLAGS_EXT_FEEDBACK_MASK BIT(WRPLL_FLAGS_EXT_FEEDBACK_SHIFT)
35+
36+/**
37+ * struct wrpll_cfg - WRPLL configuration values
38+ * @divr: reference divider value (6 bits), as presented to the PLL signals
39+ * @divf: feedback divider value (9 bits), as presented to the PLL signals
40+ * @divq: output divider value (3 bits), as presented to the PLL signals
41+ * @flags: PLL configuration flags. See above for more information
42+ * @range: PLL loop filter range. See below for more information
43+ * @output_rate_cache: cached output rates, swept across DIVQ
44+ * @parent_rate: PLL refclk rate for which values are valid
45+ * @max_r: maximum possible R divider value, given @parent_rate
46+ * @init_r: initial R divider value to start the search from
47+ *
48+ * @divr, @divq, @divq, @range represent what the PLL expects to see
49+ * on its input signals. Thus @divr and @divf are the actual divisors
50+ * minus one. @divq is a power-of-two divider; for example, 1 =
51+ * divide-by-2 and 6 = divide-by-64. 0 is an invalid @divq value.
52+ *
53+ * When initially passing a struct wrpll_cfg record, the
54+ * record should be zero-initialized with the exception of the @flags
55+ * field. The only flag bits that need to be set are either
56+ * WRPLL_FLAGS_INT_FEEDBACK or WRPLL_FLAGS_EXT_FEEDBACK.
57+ */
58+struct wrpll_cfg {
59+ u8 divr;
60+ u8 divq;
61+ u8 range;
62+ u8 flags;
63+ u16 divf;
64+/* private: */
65+ u32 output_rate_cache[DIVQ_VALUES];
66+ unsigned long parent_rate;
67+ u8 max_r;
68+ u8 init_r;
69+};
70+
71+int wrpll_configure_for_rate(struct wrpll_cfg *c, u32 target_rate,
72+ unsigned long parent_rate);
73+
74+unsigned int wrpll_calc_max_lock_us(const struct wrpll_cfg *c);
75+
76+unsigned long wrpll_calc_output_rate(const struct wrpll_cfg *c,
77+ unsigned long parent_rate);
78+
79+#endif /* __LINUX_CLK_ANALOGBITS_WRPLL_CLN28HPC_H */
include/linux/clk/at91_pmc.h+4−9
@@ -74,6 +74,8 @@ · 73 unmodified lines
7474 #define AT91_PMC_USBDIV_4 (2 << 28)
7575 #define AT91_PMC_USB96M (1 << 28) /* Divider by 2 Enable (PLLB only) */
7676
77+#define AT91_PMC_CPU_CKR 0x28 /* CPU Clock Register */
78+
7779 #define AT91_PMC_MCKR 0x30 /* Master Clock Register */
7880 #define AT91_PMC_CSS (3 << 0) /* Master Clock Selection */
7981 #define AT91_PMC_CSS_SLOW (0 << 0)
@@ -159,6 +161,7 @@ · 79 unmodified lines
159161
160162 #define AT91_PMC_FSMR 0x70 /* Fast Startup Mode Register */
161163 #define AT91_PMC_FSTT(n) BIT(n)
164+#define AT91_PMC_RTTAL BIT(16)
162165 #define AT91_PMC_RTCAL BIT(17) /* RTC Alarm Enable */
163166 #define AT91_PMC_USBAL BIT(18) /* USB Resume Enable */
164167 #define AT91_PMC_SDMMC_CD BIT(19) /* SDMMC Card Detect Enable */
@@ -187,16 +190,8 @@ · 22 unmodified lines
187190
188191 #define AT91_PMC_PCR 0x10c /* Peripheral Control Register [some SAM9 and SAMA5] */
189192 #define AT91_PMC_PCR_PID_MASK 0x3f
190−#define AT91_PMC_PCR_GCKCSS_OFFSET 8
191−#define AT91_PMC_PCR_GCKCSS_MASK (0x7 << AT91_PMC_PCR_GCKCSS_OFFSET)
192−#define AT91_PMC_PCR_GCKCSS(n) ((n) << AT91_PMC_PCR_GCKCSS_OFFSET) /* GCK Clock Source Selection */
193193 #define AT91_PMC_PCR_CMD (0x1 << 12) /* Command (read=0, write=1) */
194−#define AT91_PMC_PCR_DIV_OFFSET 16
195−#define AT91_PMC_PCR_DIV_MASK (0x3 << AT91_PMC_PCR_DIV_OFFSET)
196−#define AT91_PMC_PCR_DIV(n) ((n) << AT91_PMC_PCR_DIV_OFFSET) /* Divisor Value */
197−#define AT91_PMC_PCR_GCKDIV_OFFSET 20
198−#define AT91_PMC_PCR_GCKDIV_MASK (0xff << AT91_PMC_PCR_GCKDIV_OFFSET)
199−#define AT91_PMC_PCR_GCKDIV(n) ((n) << AT91_PMC_PCR_GCKDIV_OFFSET) /* Generated Clock Divisor Value */
194+#define AT91_PMC_PCR_GCKDIV_MASK GENMASK(27, 20)
200195 #define AT91_PMC_PCR_EN (0x1 << 28) /* Enable */
201196 #define AT91_PMC_PCR_GCKEN (0x1 << 29) /* GCK Enable */
202197
include/linux/clk/ti.h+2−0
@@ -243,6 +243,7 @@ struct ti_clk_ll_ops { · 242 unmodified lines
243243
244244 #define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
245245
246+bool omap2_clk_is_hw_omap(struct clk_hw *hw);
246247 int omap2_clk_disable_autoidle_all(void);
247248 int omap2_clk_enable_autoidle_all(void);
248249 int omap2_clk_allow_idle(struct clk *clk);
@@ -293,6 +294,7 @@ struct ti_clk_features { · 44 unmodified lines
293294 #define TI_CLK_DISABLE_CLKDM_CONTROL BIT(2)
294295 #define TI_CLK_ERRATA_I810 BIT(3)
295296 #define TI_CLK_CLKCTRL_COMPAT BIT(4)
297+#define TI_CLK_DEVICE_TYPE_GP BIT(5)
296298
297299 void ti_clk_setup_features(struct ti_clk_features *features);
298300 const struct ti_clk_features *ti_clk_get_features(void);
include/linux/compiler.h+18−17
@@ -53,23 +53,24 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 52 unmodified lines
5353 * "Define 'is'", Bill Clinton
5454 * "Define 'if'", Steven Rostedt
5555 */
56−#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
57−#define __trace_if(cond) \
58− if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
59− ({ \
60− int ______r; \
61− static struct ftrace_branch_data \
62− __aligned(4) \
63− __section("_ftrace_branch") \
64− ______f = { \
65− .func = __func__, \
66− .file = __FILE__, \
67− .line = __LINE__, \
68− }; \
69− ______r = !!(cond); \
70− ______f.miss_hit[______r]++; \
71− ______r; \
72− }))
56+#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
57+
58+#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
59+
60+#define __trace_if_value(cond) ({ \
61+ static struct ftrace_branch_data \
62+ __aligned(4) \
63+ __section("_ftrace_branch") \
64+ __if_trace = { \
65+ .func = __func__, \
66+ .file = __FILE__, \
67+ .line = __LINE__, \
68+ }; \
69+ (cond) ? \
70+ (__if_trace.miss_hit[1]++,1) : \
71+ (__if_trace.miss_hit[0]++,0); \
72+})
73+
7374 #endif /* CONFIG_PROFILE_ALL_BRANCHES */
7475
7576 #else
include/linux/compiler_types.h+1−2
@@ -140,8 +140,7 @@ struct ftrace_likely_data { · 139 unmodified lines
140140 * Do not use __always_inline here, since currently it expands to inline again
141141 * (which would break users of __always_inline).
142142 */
143−#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
144− !defined(CONFIG_OPTIMIZE_INLINING)
143+#if !defined(CONFIG_OPTIMIZE_INLINING)
145144 #define inline inline __attribute__((__always_inline__)) __gnu_inline \
146145 __maybe_unused notrace
147146 #else
include/linux/console.h+6−1
@@ -166,6 +166,11 @@ struct console { · 165 unmodified lines
166166 extern int console_set_on_cmdline;
167167 extern struct console *early_console;
168168
169+enum con_flush_mode {
170+ CONSOLE_FLUSH_PENDING,
171+ CONSOLE_REPLAY_ALL,
172+};
173+
169174 extern int add_preferred_console(char *name, int idx, char *options);
170175 extern void register_console(struct console *);
171176 extern int unregister_console(struct console *);
@@ -175,7 +180,7 @@ extern int console_trylock(void); · 3 unmodified lines
175180 extern void console_unlock(void);
176181 extern void console_conditional_schedule(void);
177182 extern void console_unblank(void);
178−extern void console_flush_on_panic(void);
183+extern void console_flush_on_panic(enum con_flush_mode mode);
179184 extern struct tty_driver *console_device(int *);
180185 extern void console_stop(struct console *);
181186 extern void console_start(struct console *);
include/linux/coresight-pmu.h+2−0
@@ -12,11 +12,13 @@ · 11 unmodified lines
1212
1313 /* ETMv3.5/PTM's ETMCR config bit */
1414 #define ETM_OPT_CYCACC 12
15+#define ETM_OPT_CTXTID 14
1516 #define ETM_OPT_TS 28
1617 #define ETM_OPT_RETSTK 29
1718
1819 /* ETMv4 CONFIGR programming bits for the ETM OPTs */
1920 #define ETM4_CFG_BIT_CYCACC 4
21+#define ETM4_CFG_BIT_CTXTID 6
2022 #define ETM4_CFG_BIT_TS 11
2123 #define ETM4_CFG_BIT_RETSTK 12
2224
include/linux/coresight.h+4−3
@@ -192,9 +192,10 @@ struct coresight_device { · 191 unmodified lines
192192 */
193193 struct coresight_ops_sink {
194194 int (*enable)(struct coresight_device *csdev, u32 mode, void *data);
195− void (*disable)(struct coresight_device *csdev);
196− void *(*alloc_buffer)(struct coresight_device *csdev, int cpu,
197− void **pages, int nr_pages, bool overwrite);
195+ int (*disable)(struct coresight_device *csdev);
196+ void *(*alloc_buffer)(struct coresight_device *csdev,
197+ struct perf_event *event, void **pages,
198+ int nr_pages, bool overwrite);
198199 void (*free_buffer)(void *config);
199200 unsigned long (*update_buffer)(struct coresight_device *csdev,
200201 struct perf_output_handle *handle,
include/linux/counter.h+510−0
@@ -0,0 +1,510 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Counter interface
4+ * Copyright (C) 2018 William Breathitt Gray
5+ */
6+#ifndef _COUNTER_H_
7+#define _COUNTER_H_
8+
9+#include <linux/counter_enum.h>
10+#include <linux/device.h>
11+#include <linux/types.h>
12+
13+enum counter_count_direction {
14+ COUNTER_COUNT_DIRECTION_FORWARD = 0,
15+ COUNTER_COUNT_DIRECTION_BACKWARD
16+};
17+extern const char *const counter_count_direction_str[2];
18+
19+enum counter_count_mode {
20+ COUNTER_COUNT_MODE_NORMAL = 0,
21+ COUNTER_COUNT_MODE_RANGE_LIMIT,
22+ COUNTER_COUNT_MODE_NON_RECYCLE,
23+ COUNTER_COUNT_MODE_MODULO_N
24+};
25+extern const char *const counter_count_mode_str[4];
26+
27+struct counter_device;
28+struct counter_signal;
29+
30+/**
31+ * struct counter_signal_ext - Counter Signal extensions
32+ * @name: attribute name
33+ * @read: read callback for this attribute; may be NULL
34+ * @write: write callback for this attribute; may be NULL
35+ * @priv: data private to the driver
36+ */
37+struct counter_signal_ext {
38+ const char *name;
39+ ssize_t (*read)(struct counter_device *counter,
40+ struct counter_signal *signal, void *priv, char *buf);
41+ ssize_t (*write)(struct counter_device *counter,
42+ struct counter_signal *signal, void *priv,
43+ const char *buf, size_t len);
44+ void *priv;
45+};
46+
47+/**
48+ * struct counter_signal - Counter Signal node
49+ * @id: unique ID used to identify signal
50+ * @name: device-specific Signal name; ideally, this should match the name
51+ * as it appears in the datasheet documentation
52+ * @ext: optional array of Counter Signal extensions
53+ * @num_ext: number of Counter Signal extensions specified in @ext
54+ * @priv: optional private data supplied by driver
55+ */
56+struct counter_signal {
57+ int id;
58+ const char *name;
59+
60+ const struct counter_signal_ext *ext;
61+ size_t num_ext;
62+
63+ void *priv;
64+};
65+
66+/**
67+ * struct counter_signal_enum_ext - Signal enum extension attribute
68+ * @items: Array of strings
69+ * @num_items: Number of items specified in @items
70+ * @set: Set callback function; may be NULL
71+ * @get: Get callback function; may be NULL
72+ *
73+ * The counter_signal_enum_ext structure can be used to implement enum style
74+ * Signal extension attributes. Enum style attributes are those which have a set
75+ * of strings that map to unsigned integer values. The Generic Counter Signal
76+ * enum extension helper code takes care of mapping between value and string, as
77+ * well as generating a "_available" file which contains a list of all available
78+ * items. The get callback is used to query the currently active item; the index
79+ * of the item within the respective items array is returned via the 'item'
80+ * parameter. The set callback is called when the attribute is updated; the
81+ * 'item' parameter contains the index of the newly activated item within the
82+ * respective items array.
83+ */
84+struct counter_signal_enum_ext {
85+ const char * const *items;
86+ size_t num_items;
87+ int (*get)(struct counter_device *counter,
88+ struct counter_signal *signal, size_t *item);
89+ int (*set)(struct counter_device *counter,
90+ struct counter_signal *signal, size_t item);
91+};
92+
93+/**
94+ * COUNTER_SIGNAL_ENUM() - Initialize Signal enum extension
95+ * @_name: Attribute name
96+ * @_e: Pointer to a counter_signal_enum_ext structure
97+ *
98+ * This should usually be used together with COUNTER_SIGNAL_ENUM_AVAILABLE()
99+ */
100+#define COUNTER_SIGNAL_ENUM(_name, _e) \
101+{ \
102+ .name = (_name), \
103+ .read = counter_signal_enum_read, \
104+ .write = counter_signal_enum_write, \
105+ .priv = (_e) \
106+}
107+
108+/**
109+ * COUNTER_SIGNAL_ENUM_AVAILABLE() - Initialize Signal enum available extension
110+ * @_name: Attribute name ("_available" will be appended to the name)
111+ * @_e: Pointer to a counter_signal_enum_ext structure
112+ *
113+ * Creates a read only attribute that lists all the available enum items in a
114+ * newline separated list. This should usually be used together with
115+ * COUNTER_SIGNAL_ENUM()
116+ */
117+#define COUNTER_SIGNAL_ENUM_AVAILABLE(_name, _e) \
118+{ \
119+ .name = (_name "_available"), \
120+ .read = counter_signal_enum_available_read, \
121+ .priv = (_e) \
122+}
123+
124+enum counter_synapse_action {
125+ COUNTER_SYNAPSE_ACTION_NONE = 0,
126+ COUNTER_SYNAPSE_ACTION_RISING_EDGE,
127+ COUNTER_SYNAPSE_ACTION_FALLING_EDGE,
128+ COUNTER_SYNAPSE_ACTION_BOTH_EDGES
129+};
130+
131+/**
132+ * struct counter_synapse - Counter Synapse node
133+ * @action: index of current action mode
134+ * @actions_list: array of available action modes
135+ * @num_actions: number of action modes specified in @actions_list
136+ * @signal: pointer to associated signal
137+ */
138+struct counter_synapse {
139+ size_t action;
140+ const enum counter_synapse_action *actions_list;
141+ size_t num_actions;
142+
143+ struct counter_signal *signal;
144+};
145+
146+struct counter_count;
147+
148+/**
149+ * struct counter_count_ext - Counter Count extension
150+ * @name: attribute name
151+ * @read: read callback for this attribute; may be NULL
152+ * @write: write callback for this attribute; may be NULL
153+ * @priv: data private to the driver
154+ */
155+struct counter_count_ext {
156+ const char *name;
157+ ssize_t (*read)(struct counter_device *counter,
158+ struct counter_count *count, void *priv, char *buf);
159+ ssize_t (*write)(struct counter_device *counter,
160+ struct counter_count *count, void *priv,
161+ const char *buf, size_t len);
162+ void *priv;
163+};
164+
165+enum counter_count_function {
166+ COUNTER_COUNT_FUNCTION_INCREASE = 0,
167+ COUNTER_COUNT_FUNCTION_DECREASE,
168+ COUNTER_COUNT_FUNCTION_PULSE_DIRECTION,
169+ COUNTER_COUNT_FUNCTION_QUADRATURE_X1_A,
170+ COUNTER_COUNT_FUNCTION_QUADRATURE_X1_B,
171+ COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A,
172+ COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B,
173+ COUNTER_COUNT_FUNCTION_QUADRATURE_X4
174+};
175+
176+/**
177+ * struct counter_count - Counter Count node
178+ * @id: unique ID used to identify Count
179+ * @name: device-specific Count name; ideally, this should match
180+ * the name as it appears in the datasheet documentation
181+ * @function: index of current function mode
182+ * @functions_list: array available function modes
183+ * @num_functions: number of function modes specified in @functions_list
184+ * @synapses: array of synapses for initialization
185+ * @num_synapses: number of synapses specified in @synapses
186+ * @ext: optional array of Counter Count extensions
187+ * @num_ext: number of Counter Count extensions specified in @ext
188+ * @priv: optional private data supplied by driver
189+ */
190+struct counter_count {
191+ int id;
192+ const char *name;
193+
194+ size_t function;
195+ const enum counter_count_function *functions_list;
196+ size_t num_functions;
197+
198+ struct counter_synapse *synapses;
199+ size_t num_synapses;
200+
201+ const struct counter_count_ext *ext;
202+ size_t num_ext;
203+
204+ void *priv;
205+};
206+
207+/**
208+ * struct counter_count_enum_ext - Count enum extension attribute
209+ * @items: Array of strings
210+ * @num_items: Number of items specified in @items
211+ * @set: Set callback function; may be NULL
212+ * @get: Get callback function; may be NULL
213+ *
214+ * The counter_count_enum_ext structure can be used to implement enum style
215+ * Count extension attributes. Enum style attributes are those which have a set
216+ * of strings that map to unsigned integer values. The Generic Counter Count
217+ * enum extension helper code takes care of mapping between value and string, as
218+ * well as generating a "_available" file which contains a list of all available
219+ * items. The get callback is used to query the currently active item; the index
220+ * of the item within the respective items array is returned via the 'item'
221+ * parameter. The set callback is called when the attribute is updated; the
222+ * 'item' parameter contains the index of the newly activated item within the
223+ * respective items array.
224+ */
225+struct counter_count_enum_ext {
226+ const char * const *items;
227+ size_t num_items;
228+ int (*get)(struct counter_device *counter, struct counter_count *count,
229+ size_t *item);
230+ int (*set)(struct counter_device *counter, struct counter_count *count,
231+ size_t item);
232+};
233+
234+/**
235+ * COUNTER_COUNT_ENUM() - Initialize Count enum extension
236+ * @_name: Attribute name
237+ * @_e: Pointer to a counter_count_enum_ext structure
238+ *
239+ * This should usually be used together with COUNTER_COUNT_ENUM_AVAILABLE()
240+ */
241+#define COUNTER_COUNT_ENUM(_name, _e) \
242+{ \
243+ .name = (_name), \
244+ .read = counter_count_enum_read, \
245+ .write = counter_count_enum_write, \
246+ .priv = (_e) \
247+}
248+
249+/**
250+ * COUNTER_COUNT_ENUM_AVAILABLE() - Initialize Count enum available extension
251+ * @_name: Attribute name ("_available" will be appended to the name)
252+ * @_e: Pointer to a counter_count_enum_ext structure
253+ *
254+ * Creates a read only attribute that lists all the available enum items in a
255+ * newline separated list. This should usually be used together with
256+ * COUNTER_COUNT_ENUM()
257+ */
258+#define COUNTER_COUNT_ENUM_AVAILABLE(_name, _e) \
259+{ \
260+ .name = (_name "_available"), \
261+ .read = counter_count_enum_available_read, \
262+ .priv = (_e) \
263+}
264+
265+/**
266+ * struct counter_device_attr_group - internal container for attribute group
267+ * @attr_group: Counter sysfs attributes group
268+ * @attr_list: list to keep track of created Counter sysfs attributes
269+ * @num_attr: number of Counter sysfs attributes
270+ */
271+struct counter_device_attr_group {
272+ struct attribute_group attr_group;
273+ struct list_head attr_list;
274+ size_t num_attr;
275+};
276+
277+/**
278+ * struct counter_device_state - internal state container for a Counter device
279+ * @id: unique ID used to identify the Counter
280+ * @dev: internal device structure
281+ * @groups_list: attribute groups list (for Signals, Counts, and ext)
282+ * @num_groups: number of attribute groups containers
283+ * @groups: Counter sysfs attribute groups (to populate @dev.groups)
284+ */
285+struct counter_device_state {
286+ int id;
287+ struct device dev;
288+ struct counter_device_attr_group *groups_list;
289+ size_t num_groups;
290+ const struct attribute_group **groups;
291+};
292+
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;
319+};
320+
321+/**
322+ * struct counter_ops - Callbacks from driver
323+ * @signal_read: optional read callback for Signal attribute. The read
324+ * 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.
329+ * @count_read: optional read callback for Count attribute. The read
330+ * 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.
335+ * @count_write: optional write callback for Count attribute. The write
336+ * 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.
340+ * @function_get: function to get the current count function mode. Returns
341+ * 0 on success and negative error code on error. The index
342+ * of the respective Count's returned function mode should
343+ * be passed back via the function parameter.
344+ * @function_set: function to set the count function mode. function is the
345+ * index of the requested function mode from the respective
346+ * Count's functions_list array.
347+ * @action_get: function to get the current action mode. Returns 0 on
348+ * success and negative error code on error. The index of
349+ * the respective Signal's returned action mode should be
350+ * passed back via the action parameter.
351+ * @action_set: function to set the action mode. action is the index of
352+ * the requested action mode from the respective Synapse's
353+ * actions_list array.
354+ */
355+struct counter_ops {
356+ int (*signal_read)(struct counter_device *counter,
357+ struct counter_signal *signal,
358+ struct counter_signal_read_value *val);
359+ int (*count_read)(struct counter_device *counter,
360+ struct counter_count *count,
361+ struct counter_count_read_value *val);
362+ int (*count_write)(struct counter_device *counter,
363+ struct counter_count *count,
364+ struct counter_count_write_value *val);
365+ int (*function_get)(struct counter_device *counter,
366+ struct counter_count *count, size_t *function);
367+ int (*function_set)(struct counter_device *counter,
368+ struct counter_count *count, size_t function);
369+ int (*action_get)(struct counter_device *counter,
370+ struct counter_count *count,
371+ struct counter_synapse *synapse, size_t *action);
372+ int (*action_set)(struct counter_device *counter,
373+ struct counter_count *count,
374+ struct counter_synapse *synapse, size_t action);
375+};
376+
377+/**
378+ * struct counter_device_ext - Counter device extension
379+ * @name: attribute name
380+ * @read: read callback for this attribute; may be NULL
381+ * @write: write callback for this attribute; may be NULL
382+ * @priv: data private to the driver
383+ */
384+struct counter_device_ext {
385+ const char *name;
386+ ssize_t (*read)(struct counter_device *counter, void *priv, char *buf);
387+ ssize_t (*write)(struct counter_device *counter, void *priv,
388+ const char *buf, size_t len);
389+ void *priv;
390+};
391+
392+/**
393+ * struct counter_device_enum_ext - Counter enum extension attribute
394+ * @items: Array of strings
395+ * @num_items: Number of items specified in @items
396+ * @set: Set callback function; may be NULL
397+ * @get: Get callback function; may be NULL
398+ *
399+ * The counter_device_enum_ext structure can be used to implement enum style
400+ * Counter extension attributes. Enum style attributes are those which have a
401+ * set of strings that map to unsigned integer values. The Generic Counter enum
402+ * extension helper code takes care of mapping between value and string, as well
403+ * as generating a "_available" file which contains a list of all available
404+ * items. The get callback is used to query the currently active item; the index
405+ * of the item within the respective items array is returned via the 'item'
406+ * parameter. The set callback is called when the attribute is updated; the
407+ * 'item' parameter contains the index of the newly activated item within the
408+ * respective items array.
409+ */
410+struct counter_device_enum_ext {
411+ const char * const *items;
412+ size_t num_items;
413+ int (*get)(struct counter_device *counter, size_t *item);
414+ int (*set)(struct counter_device *counter, size_t item);
415+};
416+
417+/**
418+ * COUNTER_DEVICE_ENUM() - Initialize Counter enum extension
419+ * @_name: Attribute name
420+ * @_e: Pointer to a counter_device_enum_ext structure
421+ *
422+ * This should usually be used together with COUNTER_DEVICE_ENUM_AVAILABLE()
423+ */
424+#define COUNTER_DEVICE_ENUM(_name, _e) \
425+{ \
426+ .name = (_name), \
427+ .read = counter_device_enum_read, \
428+ .write = counter_device_enum_write, \
429+ .priv = (_e) \
430+}
431+
432+/**
433+ * COUNTER_DEVICE_ENUM_AVAILABLE() - Initialize Counter enum available extension
434+ * @_name: Attribute name ("_available" will be appended to the name)
435+ * @_e: Pointer to a counter_device_enum_ext structure
436+ *
437+ * Creates a read only attribute that lists all the available enum items in a
438+ * newline separated list. This should usually be used together with
439+ * COUNTER_DEVICE_ENUM()
440+ */
441+#define COUNTER_DEVICE_ENUM_AVAILABLE(_name, _e) \
442+{ \
443+ .name = (_name "_available"), \
444+ .read = counter_device_enum_available_read, \
445+ .priv = (_e) \
446+}
447+
448+/**
449+ * struct counter_device - Counter data structure
450+ * @name: name of the device as it appears in the datasheet
451+ * @parent: optional parent device providing the counters
452+ * @device_state: internal device state container
453+ * @ops: callbacks from driver
454+ * @signals: array of Signals
455+ * @num_signals: number of Signals specified in @signals
456+ * @counts: array of Counts
457+ * @num_counts: number of Counts specified in @counts
458+ * @ext: optional array of Counter device extensions
459+ * @num_ext: number of Counter device extensions specified in @ext
460+ * @priv: optional private data supplied by driver
461+ */
462+struct counter_device {
463+ const char *name;
464+ struct device *parent;
465+ struct counter_device_state *device_state;
466+
467+ const struct counter_ops *ops;
468+
469+ struct counter_signal *signals;
470+ size_t num_signals;
471+ struct counter_count *counts;
472+ size_t num_counts;
473+
474+ const struct counter_device_ext *ext;
475+ size_t num_ext;
476+
477+ void *priv;
478+};
479+
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+
503+int counter_register(struct counter_device *const counter);
504+void counter_unregister(struct counter_device *const counter);
505+int devm_counter_register(struct device *dev,
506+ struct counter_device *const counter);
507+void devm_counter_unregister(struct device *dev,
508+ struct counter_device *const counter);
509+
510+#endif /* _COUNTER_H_ */
include/linux/counter_enum.h+45−0
@@ -0,0 +1,45 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Counter interface enum functions
4+ * Copyright (C) 2018 William Breathitt Gray
5+ */
6+#ifndef _COUNTER_ENUM_H_
7+#define _COUNTER_ENUM_H_
8+
9+#include <linux/types.h>
10+
11+struct counter_device;
12+struct counter_signal;
13+struct counter_count;
14+
15+ssize_t counter_signal_enum_read(struct counter_device *counter,
16+ struct counter_signal *signal, void *priv,
17+ char *buf);
18+ssize_t counter_signal_enum_write(struct counter_device *counter,
19+ struct counter_signal *signal, void *priv,
20+ const char *buf, size_t len);
21+
22+ssize_t counter_signal_enum_available_read(struct counter_device *counter,
23+ struct counter_signal *signal,
24+ void *priv, char *buf);
25+
26+ssize_t counter_count_enum_read(struct counter_device *counter,
27+ struct counter_count *count, void *priv,
28+ char *buf);
29+ssize_t counter_count_enum_write(struct counter_device *counter,
30+ struct counter_count *count, void *priv,
31+ const char *buf, size_t len);
32+
33+ssize_t counter_count_enum_available_read(struct counter_device *counter,
34+ struct counter_count *count,
35+ void *priv, char *buf);
36+
37+ssize_t counter_device_enum_read(struct counter_device *counter, void *priv,
38+ char *buf);
39+ssize_t counter_device_enum_write(struct counter_device *counter, void *priv,
40+ const char *buf, size_t len);
41+
42+ssize_t counter_device_enum_available_read(struct counter_device *counter,
43+ void *priv, char *buf);
44+
45+#endif /* _COUNTER_ENUM_H_ */
include/linux/cper.h+167−169
@@ -44,7 +44,7 @@ · 43 unmodified lines
4444 */
4545 #define CPER_REC_LEN 256
4646 /*
47− * Severity difinition for error_severity in struct cper_record_header
47+ * Severity definition for error_severity in struct cper_record_header
4848 * and section_severity in struct cper_section_descriptor
4949 */
5050 enum {
@@ -55,24 +55,21 @@ enum { · 4 unmodified lines
5555 };
5656
5757 /*
58− * Validation bits difinition for validation_bits in struct
58+ * Validation bits definition for validation_bits in struct
5959 * cper_record_header. If set, corresponding fields in struct
6060 * cper_record_header contain valid information.
61− *
62− * corresponds platform_id
6361 */
6462 #define CPER_VALID_PLATFORM_ID 0x0001
65−/* corresponds timestamp */
6663 #define CPER_VALID_TIMESTAMP 0x0002
67−/* corresponds partition_id */
6864 #define CPER_VALID_PARTITION_ID 0x0004
6965
7066 /*
7167 * Notification type used to generate error record, used in
72− * notification_type in struct cper_record_header
73− *
74− * Corrected Machine Check
68+ * notification_type in struct cper_record_header. These UUIDs are defined
69+ * in the UEFI spec v2.7, sec N.2.1.
7570 */
71+
72+/* Corrected Machine Check */
7673 #define CPER_NOTIFY_CMC \
7774 GUID_INIT(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \
7875 0xEB, 0xD4, 0xF8, 0x90)
@@ -122,14 +119,11 @@ enum { · 43 unmodified lines
122119 #define CPER_SEC_REV 0x0100
123120
124121 /*
125− * Validation bits difinition for validation_bits in struct
122+ * Validation bits definition for validation_bits in struct
126123 * cper_section_descriptor. If set, corresponding fields in struct
127124 * cper_section_descriptor contain valid information.
128− *
129− * corresponds fru_id
130125 */
131126 #define CPER_SEC_VALID_FRU_ID 0x1
132−/* corresponds fru_text */
133127 #define CPER_SEC_VALID_FRU_TEXT 0x2
134128
135129 /*
@@ -165,10 +159,11 @@ enum { · 29 unmodified lines
165159
166160 /*
167161 * Section type definitions, used in section_type field in struct
168− * cper_section_descriptor
169− *
170− * Processor Generic
162+ * cper_section_descriptor. These UUIDs are defined in the UEFI spec
163+ * v2.7, sec N.2.2.
171164 */
165+
166+/* Processor Generic */
172167 #define CPER_SEC_PROC_GENERIC \
173168 GUID_INIT(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \
174169 0x93, 0xC4, 0xF3, 0xDB)
@@ -325,220 +320,223 @@ enum { · 150 unmodified lines
325320 */
326321 #pragma pack(1)
327322
323+/* Record Header, UEFI v2.7 sec N.2.1 */
328324 struct cper_record_header {
329325 char signature[CPER_SIG_SIZE]; /* must be CPER_SIG_RECORD */
330− __u16 revision; /* must be CPER_RECORD_REV */
331− __u32 signature_end; /* must be CPER_SIG_END */
332− __u16 section_count;
333− __u32 error_severity;
334− __u32 validation_bits;
335− __u32 record_length;
336− __u64 timestamp;
326+ u16 revision; /* must be CPER_RECORD_REV */
327+ u32 signature_end; /* must be CPER_SIG_END */
328+ u16 section_count;
329+ u32 error_severity;
330+ u32 validation_bits;
331+ u32 record_length;
332+ u64 timestamp;
337333 guid_t platform_id;
338334 guid_t partition_id;
339335 guid_t creator_id;
340336 guid_t notification_type;
341− __u64 record_id;
342− __u32 flags;
343− __u64 persistence_information;
344− __u8 reserved[12]; /* must be zero */
337+ u64 record_id;
338+ u32 flags;
339+ u64 persistence_information;
340+ u8 reserved[12]; /* must be zero */
345341 };
346342
343+/* Section Descriptor, UEFI v2.7 sec N.2.2 */
347344 struct cper_section_descriptor {
348− __u32 section_offset; /* Offset in bytes of the
345+ u32 section_offset; /* Offset in bytes of the
349346 * section body from the base
350347 * of the record header */
351− __u32 section_length;
352− __u16 revision; /* must be CPER_RECORD_REV */
353− __u8 validation_bits;
354− __u8 reserved; /* must be zero */
355− __u32 flags;
348+ u32 section_length;
349+ u16 revision; /* must be CPER_RECORD_REV */
350+ u8 validation_bits;
351+ u8 reserved; /* must be zero */
352+ u32 flags;
356353 guid_t section_type;
357354 guid_t fru_id;
358− __u32 section_severity;
359− __u8 fru_text[20];
355+ u32 section_severity;
356+ u8 fru_text[20];
360357 };
361358
362−/* Generic Processor Error Section */
359+/* Generic Processor Error Section, UEFI v2.7 sec N.2.4.1 */
363360 struct cper_sec_proc_generic {
364− __u64 validation_bits;
365− __u8 proc_type;
366− __u8 proc_isa;
367− __u8 proc_error_type;
368− __u8 operation;
369− __u8 flags;
370− __u8 level;
371− __u16 reserved;
372− __u64 cpu_version;
361+ u64 validation_bits;
362+ u8 proc_type;
363+ u8 proc_isa;
364+ u8 proc_error_type;
365+ u8 operation;
366+ u8 flags;
367+ u8 level;
368+ u16 reserved;
369+ u64 cpu_version;
373370 char cpu_brand[128];
374− __u64 proc_id;
375− __u64 target_addr;
376− __u64 requestor_id;
377− __u64 responder_id;
378− __u64 ip;
371+ u64 proc_id;
372+ u64 target_addr;
373+ u64 requestor_id;
374+ u64 responder_id;
375+ u64 ip;
379376 };
380377
381−/* IA32/X64 Processor Error Section */
378+/* IA32/X64 Processor Error Section, UEFI v2.7 sec N.2.4.2 */
382379 struct cper_sec_proc_ia {
383− __u64 validation_bits;
384− __u64 lapic_id;
385− __u8 cpuid[48];
380+ u64 validation_bits;
381+ u64 lapic_id;
382+ u8 cpuid[48];
386383 };
387384
388−/* IA32/X64 Processor Error Information Structure */
385+/* IA32/X64 Processor Error Information Structure, UEFI v2.7 sec N.2.4.2.1 */
389386 struct cper_ia_err_info {
390387 guid_t err_type;
391− __u64 validation_bits;
392− __u64 check_info;
393− __u64 target_id;
394− __u64 requestor_id;
395− __u64 responder_id;
396− __u64 ip;
388+ u64 validation_bits;
389+ u64 check_info;
390+ u64 target_id;
391+ u64 requestor_id;
392+ u64 responder_id;
393+ u64 ip;
397394 };
398395
399−/* IA32/X64 Processor Context Information Structure */
396+/* IA32/X64 Processor Context Information Structure, UEFI v2.7 sec N.2.4.2.2 */
400397 struct cper_ia_proc_ctx {
401− __u16 reg_ctx_type;
402− __u16 reg_arr_size;
403− __u32 msr_addr;
404− __u64 mm_reg_addr;
398+ u16 reg_ctx_type;
399+ u16 reg_arr_size;
400+ u32 msr_addr;
401+ u64 mm_reg_addr;
405402 };
406403
407−/* ARM Processor Error Section */
404+/* ARM Processor Error Section, UEFI v2.7 sec N.2.4.4 */
408405 struct cper_sec_proc_arm {
409− __u32 validation_bits;
410− __u16 err_info_num; /* Number of Processor Error Info */
411− __u16 context_info_num; /* Number of Processor Context Info Records*/
412− __u32 section_length;
413− __u8 affinity_level;
414− __u8 reserved[3]; /* must be zero */
415− __u64 mpidr;
416− __u64 midr;
417− __u32 running_state; /* Bit 0 set - Processor running. PSCI = 0 */
418− __u32 psci_state;
406+ u32 validation_bits;
407+ u16 err_info_num; /* Number of Processor Error Info */
408+ u16 context_info_num; /* Number of Processor Context Info Records*/
409+ u32 section_length;
410+ u8 affinity_level;
411+ u8 reserved[3]; /* must be zero */
412+ u64 mpidr;
413+ u64 midr;
414+ u32 running_state; /* Bit 0 set - Processor running. PSCI = 0 */
415+ u32 psci_state;
419416 };
420417
421−/* ARM Processor Error Information Structure */
418+/* ARM Processor Error Information Structure, UEFI v2.7 sec N.2.4.4.1 */
422419 struct cper_arm_err_info {
423− __u8 version;
424− __u8 length;
425− __u16 validation_bits;
426− __u8 type;
427− __u16 multiple_error;
428− __u8 flags;
429− __u64 error_info;
430− __u64 virt_fault_addr;
431− __u64 physical_fault_addr;
420+ u8 version;
421+ u8 length;
422+ u16 validation_bits;
423+ u8 type;
424+ u16 multiple_error;
425+ u8 flags;
426+ u64 error_info;
427+ u64 virt_fault_addr;
428+ u64 physical_fault_addr;
432429 };
433430
434−/* ARM Processor Context Information Structure */
431+/* ARM Processor Context Information Structure, UEFI v2.7 sec N.2.4.4.2 */
435432 struct cper_arm_ctx_info {
436− __u16 version;
437− __u16 type;
438− __u32 size;
433+ u16 version;
434+ u16 type;
435+ u32 size;
439436 };
440437
441−/* Old Memory Error Section UEFI 2.1, 2.2 */
438+/* Old Memory Error Section, UEFI v2.1, v2.2 */
442439 struct cper_sec_mem_err_old {
443− __u64 validation_bits;
444− __u64 error_status;
445− __u64 physical_addr;
446− __u64 physical_addr_mask;
447− __u16 node;
448− __u16 card;
449− __u16 module;
450− __u16 bank;
451− __u16 device;
452− __u16 row;
453− __u16 column;
454− __u16 bit_pos;
455− __u64 requestor_id;
456− __u64 responder_id;
457− __u64 target_id;
458− __u8 error_type;
440+ u64 validation_bits;
441+ u64 error_status;
442+ u64 physical_addr;
443+ u64 physical_addr_mask;
444+ u16 node;
445+ u16 card;
446+ u16 module;
447+ u16 bank;
448+ u16 device;
449+ u16 row;
450+ u16 column;
451+ u16 bit_pos;
452+ u64 requestor_id;
453+ u64 responder_id;
454+ u64 target_id;
455+ u8 error_type;
459456 };
460457
461−/* Memory Error Section UEFI >= 2.3 */
458+/* Memory Error Section (UEFI >= v2.3), UEFI v2.7 sec N.2.5 */
462459 struct cper_sec_mem_err {
463− __u64 validation_bits;
464− __u64 error_status;
465− __u64 physical_addr;
466− __u64 physical_addr_mask;
467− __u16 node;
468− __u16 card;
469− __u16 module;
470− __u16 bank;
471− __u16 device;
472− __u16 row;
473− __u16 column;
474− __u16 bit_pos;
475− __u64 requestor_id;
476− __u64 responder_id;
477− __u64 target_id;
478− __u8 error_type;
479− __u8 reserved;
480− __u16 rank;
481− __u16 mem_array_handle; /* card handle in UEFI 2.4 */
482− __u16 mem_dev_handle; /* module handle in UEFI 2.4 */
460+ u64 validation_bits;
461+ u64 error_status;
462+ u64 physical_addr;
463+ u64 physical_addr_mask;
464+ u16 node;
465+ u16 card;
466+ u16 module;
467+ u16 bank;
468+ u16 device;
469+ u16 row;
470+ u16 column;
471+ u16 bit_pos;
472+ u64 requestor_id;
473+ u64 responder_id;
474+ u64 target_id;
475+ u8 error_type;
476+ u8 reserved;
477+ u16 rank;
478+ u16 mem_array_handle; /* "card handle" in UEFI 2.4 */
479+ u16 mem_dev_handle; /* "module handle" in UEFI 2.4 */
483480 };
484481
485482 struct cper_mem_err_compact {
486− __u64 validation_bits;
487− __u16 node;
488− __u16 card;
489− __u16 module;
490− __u16 bank;
491− __u16 device;
492− __u16 row;
493− __u16 column;
494− __u16 bit_pos;
495− __u64 requestor_id;
496− __u64 responder_id;
497− __u64 target_id;
498− __u16 rank;
499− __u16 mem_array_handle;
500− __u16 mem_dev_handle;
483+ u64 validation_bits;
484+ u16 node;
485+ u16 card;
486+ u16 module;
487+ u16 bank;
488+ u16 device;
489+ u16 row;
490+ u16 column;
491+ u16 bit_pos;
492+ u64 requestor_id;
493+ u64 responder_id;
494+ u64 target_id;
495+ u16 rank;
496+ u16 mem_array_handle;
497+ u16 mem_dev_handle;
501498 };
502499
500+/* PCI Express Error Section, UEFI v2.7 sec N.2.7 */
503501 struct cper_sec_pcie {
504− __u64 validation_bits;
505− __u32 port_type;
502+ u64 validation_bits;
503+ u32 port_type;
506504 struct {
507− __u8 minor;
508− __u8 major;
509− __u8 reserved[2];
505+ u8 minor;
506+ u8 major;
507+ u8 reserved[2];
510508 } version;
511− __u16 command;
512− __u16 status;
513− __u32 reserved;
509+ u16 command;
510+ u16 status;
511+ u32 reserved;
514512 struct {
515− __u16 vendor_id;
516− __u16 device_id;
517− __u8 class_code[3];
518− __u8 function;
519− __u8 device;
520− __u16 segment;
521− __u8 bus;
522− __u8 secondary_bus;
523− __u16 slot;
524− __u8 reserved;
513+ u16 vendor_id;
514+ u16 device_id;
515+ u8 class_code[3];
516+ u8 function;
517+ u8 device;
518+ u16 segment;
519+ u8 bus;
520+ u8 secondary_bus;
521+ u16 slot;
522+ u8 reserved;
525523 } device_id;
526524 struct {
527− __u32 lower;
528− __u32 upper;
525+ u32 lower;
526+ u32 upper;
529527 } serial_number;
530528 struct {
531− __u16 secondary_status;
532− __u16 control;
529+ u16 secondary_status;
530+ u16 control;
533531 } bridge;
534− __u8 capability[60];
535− __u8 aer_info[96];
532+ u8 capability[60];
533+ u8 aer_info[96];
536534 };
537535
538536 /* Reset to default packing */
539537 #pragma pack()
540538
541−extern const char * const cper_proc_error_type_strs[4];
539+extern const char *const cper_proc_error_type_strs[4];
542540
543541 u64 cper_next_record_id(void);
544542 const char *cper_severity_str(unsigned int);
include/linux/cpu.h+45−1
@@ -57,6 +57,8 @@ extern ssize_t cpu_show_spec_store_bypass(struct device *dev, · 56 unmodified lines
5757 struct device_attribute *attr, char *buf);
5858 extern ssize_t cpu_show_l1tf(struct device *dev,
5959 struct device_attribute *attr, char *buf);
60+extern ssize_t cpu_show_mds(struct device *dev,
61+ struct device_attribute *attr, char *buf);
6062
6163 extern __printf(4, 5)
6264 struct device *cpu_device_create(struct device *parent, void *drvdata,
@@ -137,9 +139,26 @@ static inline int disable_nonboot_cpus(void) · 74 unmodified lines
137139 return freeze_secondary_cpus(0);
138140 }
139141 extern void enable_nonboot_cpus(void);
142+
143+static inline int suspend_disable_secondary_cpus(void)
144+{
145+ int cpu = 0;
146+
147+ if (IS_ENABLED(CONFIG_PM_SLEEP_SMP_NONZERO_CPU))
148+ cpu = -1;
149+
150+ return freeze_secondary_cpus(cpu);
151+}
152+static inline void suspend_enable_secondary_cpus(void)
153+{
154+ return enable_nonboot_cpus();
155+}
156+
140157 #else /* !CONFIG_PM_SLEEP_SMP */
141158 static inline int disable_nonboot_cpus(void) { return 0; }
142159 static inline void enable_nonboot_cpus(void) {}
160+static inline int suspend_disable_secondary_cpus(void) { return 0; }
161+static inline void suspend_enable_secondary_cpus(void) { }
143162 #endif /* !CONFIG_PM_SLEEP_SMP */
144163
145164 void cpu_startup_entry(enum cpuhp_state state);
@@ -175,6 +194,7 @@ enum cpuhp_smt_control { · 29 unmodified lines
175194 CPU_SMT_DISABLED,
176195 CPU_SMT_FORCE_DISABLED,
177196 CPU_SMT_NOT_SUPPORTED,
197+ CPU_SMT_NOT_IMPLEMENTED,
178198 };
179199
180200 #if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT)
@@ -182,9 +202,33 @@ extern enum cpuhp_smt_control cpu_smt_control; · 1 unmodified line
182202 extern void cpu_smt_disable(bool force);
183203 extern void cpu_smt_check_topology(void);
184204 #else
185−# define cpu_smt_control (CPU_SMT_ENABLED)
205+# define cpu_smt_control (CPU_SMT_NOT_IMPLEMENTED)
186206 static inline void cpu_smt_disable(bool force) { }
187207 static inline void cpu_smt_check_topology(void) { }
188208 #endif
189209
210+/*
211+ * These are used for a global "mitigations=" cmdline option for toggling
212+ * optional CPU mitigations.
213+ */
214+enum cpu_mitigations {
215+ CPU_MITIGATIONS_OFF,
216+ CPU_MITIGATIONS_AUTO,
217+ CPU_MITIGATIONS_AUTO_NOSMT,
218+};
219+
220+extern enum cpu_mitigations cpu_mitigations;
221+
222+/* mitigations=off */
223+static inline bool cpu_mitigations_off(void)
224+{
225+ return cpu_mitigations == CPU_MITIGATIONS_OFF;
226+}
227+
228+/* mitigations=auto,nosmt */
229+static inline bool cpu_mitigations_auto_nosmt(void)
230+{
231+ return cpu_mitigations == CPU_MITIGATIONS_AUTO_NOSMT;
232+}
233+
190234 #endif /* _LINUX_CPU_H_ */
include/linux/cpufreq.h+21−7
@@ -42,13 +42,6 @@ enum cpufreq_table_sorting { · 41 unmodified lines
4242 CPUFREQ_TABLE_SORTED_DESCENDING
4343 };
4444
45−struct cpufreq_freqs {
46− unsigned int cpu; /* cpu nr */
47− unsigned int old;
48− unsigned int new;
49− u8 flags; /* flags of cpufreq_driver, see below. */
50−};
51−
5245 struct cpufreq_cpuinfo {
5346 unsigned int max_freq;
5447 unsigned int min_freq;
@@ -156,6 +149,13 @@ struct cpufreq_policy { · 101 unmodified lines
156149 struct thermal_cooling_device *cdev;
157150 };
158151
152+struct cpufreq_freqs {
153+ struct cpufreq_policy *policy;
154+ unsigned int old;
155+ unsigned int new;
156+ u8 flags; /* flags of cpufreq_driver, see below. */
157+};
158+
159159 /* Only for ACPI */
160160 #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */
161161 #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */
@@ -178,6 +178,11 @@ static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) · 16 unmodified lines
178178 static inline void cpufreq_cpu_put(struct cpufreq_policy *policy) { }
179179 #endif
180180
181+static inline bool policy_is_inactive(struct cpufreq_policy *policy)
182+{
183+ return cpumask_empty(policy->cpus);
184+}
185+
181186 static inline bool policy_is_shared(struct cpufreq_policy *policy)
182187 {
183188 return cpumask_weight(policy->cpus) > 1;
@@ -193,8 +198,14 @@ unsigned int cpufreq_quick_get_max(unsigned int cpu); · 9 unmodified lines
193198 void disable_cpufreq(void);
194199
195200 u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy);
201+
202+struct cpufreq_policy *cpufreq_cpu_acquire(unsigned int cpu);
203+void cpufreq_cpu_release(struct cpufreq_policy *policy);
196204 int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
205+int cpufreq_set_policy(struct cpufreq_policy *policy,
206+ struct cpufreq_policy *new_policy);
197207 void cpufreq_update_policy(unsigned int cpu);
208+void cpufreq_update_limits(unsigned int cpu);
198209 bool have_governor_per_policy(void);
199210 struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
200211 void cpufreq_enable_fast_switch(struct cpufreq_policy *policy);
@@ -322,6 +333,9 @@ struct cpufreq_driver { · 121 unmodified lines
322333 /* should be defined, if possible */
323334 unsigned int (*get)(unsigned int cpu);
324335
336+ /* Called to update policy limits on firmware notifications. */
337+ void (*update_limits)(unsigned int cpu);
338+
325339 /* optional */
326340 int (*bios_limit)(int cpu, unsigned int *limit);
327341
include/linux/cpuhotplug.h+2−0
@@ -147,6 +147,7 @@ enum cpuhp_state { · 146 unmodified lines
147147 CPUHP_AP_X86_VDSO_VMA_ONLINE,
148148 CPUHP_AP_IRQ_AFFINITY_ONLINE,
149149 CPUHP_AP_ARM_MVEBU_SYNC_CLOCKS,
150+ CPUHP_AP_X86_INTEL_EPB_ONLINE,
150151 CPUHP_AP_PERF_ONLINE,
151152 CPUHP_AP_PERF_X86_ONLINE,
152153 CPUHP_AP_PERF_X86_UNCORE_ONLINE,
@@ -170,6 +171,7 @@ enum cpuhp_state { · 17 unmodified lines
170171 CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE,
171172 CPUHP_AP_PERF_POWERPC_CORE_IMC_ONLINE,
172173 CPUHP_AP_PERF_POWERPC_THREAD_IMC_ONLINE,
174+ CPUHP_AP_PERF_POWERPC_TRACE_IMC_ONLINE,
173175 CPUHP_AP_WATCHDOG_ONLINE,
174176 CPUHP_AP_WORKQUEUE_ONLINE,
175177 CPUHP_AP_RCUTREE_ONLINE,
include/linux/cpuidle.h+1−0
@@ -83,6 +83,7 @@ struct cpuidle_device { · 82 unmodified lines
8383 unsigned int use_deepest_state:1;
8484 unsigned int poll_time_limit:1;
8585 unsigned int cpu;
86+ ktime_t next_hrtimer;
8687
8788 int last_residency;
8889 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
include/linux/cpumask.h+1−2
@@ -633,8 +633,7 @@ static inline int cpumask_parselist_user(const char __user *buf, int len, · 632 unmodified lines
633633 */
634634 static inline int cpumask_parse(const char *buf, struct cpumask *dstp)
635635 {
636− char *nl = strchr(buf, '\n');
637− unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf);
636+ unsigned int len = strchrnul(buf, '\n') - buf;
638637
639638 return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits);
640639 }
include/linux/cred.h+1−1
@@ -138,7 +138,7 @@ struct cred { · 137 unmodified lines
138138 #ifdef CONFIG_KEYS
139139 unsigned char jit_keyring; /* default keyring to attach requested
140140 * keys to */
141− struct key __rcu *session_keyring; /* keyring inherited over fork */
141+ struct key *session_keyring; /* keyring inherited over fork */
142142 struct key *process_keyring; /* keyring private to this process */
143143 struct key *thread_keyring; /* keyring private to this thread */
144144 struct key *request_key_auth; /* assumed request_key authority */
include/linux/dcache.h+3−4
@@ -176,7 +176,6 @@ struct dentry_operations { · 175 unmodified lines
176176 * typically using d_splice_alias. */
177177
178178 #define DCACHE_REFERENCED 0x00000040 /* Recently used, don't discard. */
179−#define DCACHE_RCUACCESS 0x00000080 /* Entry has ever been RCU-visible */
180179
181180 #define DCACHE_CANT_MOUNT 0x00000100
182181 #define DCACHE_GENOCIDE 0x00000200
@@ -212,11 +211,12 @@ struct dentry_operations { · 29 unmodified lines
212211
213212 #define DCACHE_MAY_FREE 0x00800000
214213 #define DCACHE_FALLTHRU 0x01000000 /* Fall through to lower layer */
215−#define DCACHE_ENCRYPTED_WITH_KEY 0x02000000 /* dir is encrypted with a valid key */
214+#define DCACHE_ENCRYPTED_NAME 0x02000000 /* Encrypted name (dir key was unavailable) */
216215 #define DCACHE_OP_REAL 0x04000000
217216
218217 #define DCACHE_PAR_LOOKUP 0x10000000 /* being looked up (with parent locked shared) */
219218 #define DCACHE_DENTRY_CURSOR 0x20000000
219+#define DCACHE_NORCU 0x40000000 /* No RCU delay for freeing */
220220
221221 extern seqlock_t rename_lock;
222222
@@ -235,7 +235,6 @@ extern void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op · 12 unmodified lines
235235 /* allocate/de-allocate */
236236 extern struct dentry * d_alloc(struct dentry *, const struct qstr *);
237237 extern struct dentry * d_alloc_anon(struct super_block *);
238−extern struct dentry * d_alloc_pseudo(struct super_block *, const struct qstr *);
239238 extern struct dentry * d_alloc_parallel(struct dentry *, const struct qstr *,
240239 wait_queue_head_t *);
241240 extern struct dentry * d_splice_alias(struct inode *, struct dentry *);
@@ -594,7 +593,7 @@ static inline struct inode *d_real_inode(const struct dentry *dentry) · 352 unmodified lines
594593 }
595594
596595 struct name_snapshot {
597− const unsigned char *name;
596+ struct qstr name;
598597 unsigned char inline_name[DNAME_INLINE_LEN];
599598 };
600599 void take_dentry_name_snapshot(struct name_snapshot *, struct dentry *);
include/linux/device-mapper.h+2−1
@@ -62,7 +62,8 @@ typedef int (*dm_clone_and_map_request_fn) (struct dm_target *ti, · 61 unmodified lines
6262 struct request *rq,
6363 union map_info *map_context,
6464 struct request **clone);
65−typedef void (*dm_release_clone_request_fn) (struct request *clone);
65+typedef void (*dm_release_clone_request_fn) (struct request *clone,
66+ union map_info *map_context);
6667
6768 /*
6869 * Returns:
include/linux/device.h+9−9
@@ -976,18 +976,14 @@ struct dev_links_info { · 975 unmodified lines
976976 * a higher-level representation of the device.
977977 */
978978 struct device {
979+ struct kobject kobj;
979980 struct device *parent;
980981
981982 struct device_private *p;
982983
983− struct kobject kobj;
984984 const char *init_name; /* initial name of the device */
985985 const struct device_type *type;
986986
987− struct mutex mutex; /* mutex to synchronize calls to
988− * its driver.
989− */
990−
991987 struct bus_type *bus; /* type of bus device is on */
992988 struct device_driver *driver; /* which driver has allocated this
993989 device */
@@ -995,6 +991,10 @@ struct device { · 1 unmodified line
995991 core doesn't touch it */
996992 void *driver_data; /* Driver data, set and get with
997993 dev_set_drvdata/dev_get_drvdata */
994+ struct mutex mutex; /* mutex to synchronize calls to
995+ * its driver.
996+ */
997+
998998 struct dev_links_info links;
999999 struct dev_pm_info power;
10001000 struct dev_pm_domain *pm_domain;
@@ -1009,9 +1009,6 @@ struct device { · 8 unmodified lines
10091009 struct list_head msi_list;
10101010 #endif
10111011
1012−#ifdef CONFIG_NUMA
1013− int numa_node; /* NUMA node this device is close to */
1014−#endif
10151012 const struct dma_map_ops *dma_ops;
10161013 u64 *dma_mask; /* dma mask (if dma'able device) */
10171014 u64 coherent_dma_mask;/* Like dma_mask, but for
@@ -1040,6 +1037,9 @@ struct device { · 22 unmodified lines
10401037 struct device_node *of_node; /* associated device tree node */
10411038 struct fwnode_handle *fwnode; /* firmware device node */
10421039
1040+#ifdef CONFIG_NUMA
1041+ int numa_node; /* NUMA node this device is close to */
1042+#endif
10431043 dev_t devt; /* dev_t, creates the sysfs "dev" */
10441044 u32 id; /* device instance */
10451045
@@ -1229,7 +1229,7 @@ static inline void device_lock_assert(struct device *dev) · 183 unmodified lines
12291229
12301230 static inline struct device_node *dev_of_node(struct device *dev)
12311231 {
1232− if (!IS_ENABLED(CONFIG_OF))
1232+ if (!IS_ENABLED(CONFIG_OF) || !dev)
12331233 return NULL;
12341234 return dev->of_node;
12351235 }
include/linux/dma-iommu.h+22−2
@@ -71,12 +71,25 @@ void iommu_dma_unmap_resource(struct device *dev, dma_addr_t handle, · 70 unmodified lines
7171 size_t size, enum dma_data_direction dir, unsigned long attrs);
7272
7373 /* The DMA API isn't _quite_ the whole story, though... */
74−void iommu_dma_map_msi_msg(int irq, struct msi_msg *msg);
74+/*
75+ * iommu_dma_prepare_msi() - Map the MSI page in the IOMMU device
76+ *
77+ * The MSI page will be stored in @desc.
78+ *
79+ * Return: 0 on success otherwise an error describing the failure.
80+ */
81+int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr);
82+
83+/* Update the MSI message if required. */
84+void iommu_dma_compose_msi_msg(struct msi_desc *desc,
85+ struct msi_msg *msg);
86+
7587 void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list);
7688
7789 #else
7890
7991 struct iommu_domain;
92+struct msi_desc;
8093 struct msi_msg;
8194 struct device;
8295
@@ -99,7 +112,14 @@ static inline void iommu_put_dma_cookie(struct iommu_domain *domain) · 16 unmodified lines
99112 {
100113 }
101114
102−static inline void iommu_dma_map_msi_msg(int irq, struct msi_msg *msg)
115+static inline int iommu_dma_prepare_msi(struct msi_desc *desc,
116+ phys_addr_t msi_addr)
117+{
118+ return 0;
119+}
120+
121+static inline void iommu_dma_compose_msi_msg(struct msi_desc *desc,
122+ struct msi_msg *msg)
103123 {
104124 }
105125
include/linux/dma-mapping.h+3−3
@@ -267,9 +267,9 @@ size_t dma_direct_max_mapping_size(struct device *dev); · 266 unmodified lines
267267
268268 static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
269269 {
270− if (dev && dev->dma_ops)
270+ if (dev->dma_ops)
271271 return dev->dma_ops;
272− return get_arch_dma_ops(dev ? dev->bus : NULL);
272+ return get_arch_dma_ops(dev->bus);
273273 }
274274
275275 static inline void set_dma_ops(struct device *dev,
@@ -650,7 +650,7 @@ static inline void dma_free_coherent(struct device *dev, size_t size, · 374 unmodified lines
650650
651651 static inline u64 dma_get_mask(struct device *dev)
652652 {
653− if (dev && dev->dma_mask && *dev->dma_mask)
653+ if (dev->dma_mask && *dev->dma_mask)
654654 return *dev->dma_mask;
655655 return DMA_BIT_MASK(32);
656656 }
include/linux/dma-noncoherent.h+6−0
@@ -72,6 +72,12 @@ static inline void arch_sync_dma_for_cpu_all(struct device *dev) · 71 unmodified lines
7272 }
7373 #endif /* CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL */
7474
75+#ifdef CONFIG_ARCH_HAS_DMA_PREP_COHERENT
7576 void arch_dma_prep_coherent(struct page *page, size_t size);
77+#else
78+static inline void arch_dma_prep_coherent(struct page *page, size_t size)
79+{
80+}
81+#endif /* CONFIG_ARCH_HAS_DMA_PREP_COHERENT */
7682
7783 #endif /* _LINUX_DMA_NONCOHERENT_H */
include/linux/dma/idma64.h+14−0
@@ -0,0 +1,14 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Definitions for the Intel integrated DMA 64-bit
4+ *
5+ * Copyright (C) 2019 Intel Corporation
6+ */
7+
8+#ifndef __LINUX_DMA_IDMA64_H__
9+#define __LINUX_DMA_IDMA64_H__
10+
11+/* Platform driver name */
12+#define LPSS_IDMA64_DRIVER_NAME "idma64"
13+
14+#endif /* __LINUX_DMA_IDMA64_H__ */
include/linux/dmi.h+2−6
@@ -102,9 +102,7 @@ const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list); · 101 unmodified lines
102102 extern const char * dmi_get_system_info(int field);
103103 extern const struct dmi_device * dmi_find_device(int type, const char *name,
104104 const struct dmi_device *from);
105−extern void dmi_scan_machine(void);
106−extern void dmi_memdev_walk(void);
107−extern void dmi_set_dump_stack_arch_desc(void);
105+extern void dmi_setup(void);
108106 extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
109107 extern int dmi_get_bios_year(void);
110108 extern int dmi_name_in_vendors(const char *str);
@@ -122,9 +120,7 @@ static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; · 11 unmodified lines
122120 static inline const char * dmi_get_system_info(int field) { return NULL; }
123121 static inline const struct dmi_device * dmi_find_device(int type, const char *name,
124122 const struct dmi_device *from) { return NULL; }
125−static inline void dmi_scan_machine(void) { return; }
126−static inline void dmi_memdev_walk(void) { }
127−static inline void dmi_set_dump_stack_arch_desc(void) { }
123+static inline void dmi_setup(void) { }
128124 static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
129125 {
130126 if (yearp)
include/linux/dns_resolver.h+2−1
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include <uapi/linux/dns_resolver.h>
2828
2929 extern int dns_query(const char *type, const char *name, size_t namelen,
30− const char *options, char **_result, time64_t *_expiry);
30+ const char *options, char **_result, time64_t *_expiry,
31+ bool invalidate);
3132
3233 #endif /* _LINUX_DNS_RESOLVER_H */
include/linux/dsa/8021q.h+76−0
@@ -0,0 +1,76 @@
1+/* SPDX-License-Identifier: GPL-2.0
2+ * Copyright (c) 2019, Vladimir Oltean <olteanv@gmail.com>
3+ */
4+
5+#ifndef _NET_DSA_8021Q_H
6+#define _NET_DSA_8021Q_H
7+
8+#include <linux/types.h>
9+
10+struct dsa_switch;
11+struct sk_buff;
12+struct net_device;
13+struct packet_type;
14+
15+#if IS_ENABLED(CONFIG_NET_DSA_TAG_8021Q)
16+
17+int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
18+ bool enabled);
19+
20+struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
21+ u16 tpid, u16 tci);
22+
23+struct sk_buff *dsa_8021q_rcv(struct sk_buff *skb, struct net_device *netdev,
24+ struct packet_type *pt, u16 *tpid, u16 *tci);
25+
26+u16 dsa_8021q_tx_vid(struct dsa_switch *ds, int port);
27+
28+u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port);
29+
30+int dsa_8021q_rx_switch_id(u16 vid);
31+
32+int dsa_8021q_rx_source_port(u16 vid);
33+
34+#else
35+
36+int dsa_port_setup_8021q_tagging(struct dsa_switch *ds, int index,
37+ bool enabled)
38+{
39+ return 0;
40+}
41+
42+struct sk_buff *dsa_8021q_xmit(struct sk_buff *skb, struct net_device *netdev,
43+ u16 tpid, u16 tci)
44+{
45+ return NULL;
46+}
47+
48+struct sk_buff *dsa_8021q_rcv(struct sk_buff *skb, struct net_device *netdev,
49+ struct packet_type *pt, u16 *tpid, u16 *tci)
50+{
51+ return NULL;
52+}
53+
54+u16 dsa_8021q_tx_vid(struct dsa_switch *ds, int port)
55+{
56+ return 0;
57+}
58+
59+u16 dsa_8021q_rx_vid(struct dsa_switch *ds, int port)
60+{
61+ return 0;
62+}
63+
64+int dsa_8021q_rx_switch_id(u16 vid)
65+{
66+ return 0;
67+}
68+
69+int dsa_8021q_rx_source_port(u16 vid)
70+{
71+ return 0;
72+}
73+
74+#endif /* IS_ENABLED(CONFIG_NET_DSA_TAG_8021Q) */
75+
76+#endif /* _NET_DSA_8021Q_H */
include/linux/dsa/sja1105.h+40−0
@@ -0,0 +1,40 @@
1+/* SPDX-License-Identifier: GPL-2.0
2+ * Copyright (c) 2019, Vladimir Oltean <olteanv@gmail.com>
3+ */
4+
5+/* Included by drivers/net/dsa/sja1105/sja1105.h and net/dsa/tag_sja1105.c */
6+
7+#ifndef _NET_DSA_SJA1105_H
8+#define _NET_DSA_SJA1105_H
9+
10+#include <linux/skbuff.h>
11+#include <linux/etherdevice.h>
12+#include <net/dsa.h>
13+
14+#define ETH_P_SJA1105 ETH_P_DSA_8021Q
15+
16+/* IEEE 802.3 Annex 57A: Slow Protocols PDUs (01:80:C2:xx:xx:xx) */
17+#define SJA1105_LINKLOCAL_FILTER_A 0x0180C2000000ull
18+#define SJA1105_LINKLOCAL_FILTER_A_MASK 0xFFFFFF000000ull
19+/* IEEE 1588 Annex F: Transport of PTP over Ethernet (01:1B:19:xx:xx:xx) */
20+#define SJA1105_LINKLOCAL_FILTER_B 0x011B19000000ull
21+#define SJA1105_LINKLOCAL_FILTER_B_MASK 0xFFFFFF000000ull
22+
23+enum sja1105_frame_type {
24+ SJA1105_FRAME_TYPE_NORMAL = 0,
25+ SJA1105_FRAME_TYPE_LINK_LOCAL,
26+};
27+
28+struct sja1105_skb_cb {
29+ enum sja1105_frame_type type;
30+};
31+
32+#define SJA1105_SKB_CB(skb) \
33+ ((struct sja1105_skb_cb *)DSA_SKB_CB_PRIV(skb))
34+
35+struct sja1105_port {
36+ struct dsa_port *dp;
37+ int mgmt_slot;
38+};
39+
40+#endif /* _NET_DSA_SJA1105_H */
include/linux/dynamic_debug.h+11−0
@@ -71,6 +71,13 @@ void __dynamic_netdev_dbg(struct _ddebug *descriptor, · 70 unmodified lines
7171 const struct net_device *dev,
7272 const char *fmt, ...);
7373
74+struct ib_device;
75+
76+extern __printf(3, 4)
77+void __dynamic_ibdev_dbg(struct _ddebug *descriptor,
78+ const struct ib_device *ibdev,
79+ const char *fmt, ...);
80+
7481 #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \
7582 static struct _ddebug __aligned(8) \
7683 __attribute__((section("__verbose"))) name = { \
@@ -154,6 +161,10 @@ void __dynamic_netdev_dbg(struct _ddebug *descriptor, · 77 unmodified lines
154161 _dynamic_func_call(fmt, __dynamic_netdev_dbg, \
155162 dev, fmt, ##__VA_ARGS__)
156163
164+#define dynamic_ibdev_dbg(dev, fmt, ...) \
165+ _dynamic_func_call(fmt, __dynamic_ibdev_dbg, \
166+ dev, fmt, ##__VA_ARGS__)
167+
157168 #define dynamic_hex_dump(prefix_str, prefix_type, rowsize, \
158169 groupsize, buf, len, ascii) \
159170 _dynamic_func_call_no_desc(__builtin_constant_p(prefix_str) ? prefix_str : "hexdump", \
include/linux/efi.h+6−1
@@ -1611,7 +1611,12 @@ efi_status_t efi_setup_gop(efi_system_table_t *sys_table_arg, · 1610 unmodified lines
16111611 struct screen_info *si, efi_guid_t *proto,
16121612 unsigned long size);
16131613
1614−bool efi_runtime_disabled(void);
1614+#ifdef CONFIG_EFI
1615+extern bool efi_runtime_disabled(void);
1616+#else
1617+static inline bool efi_runtime_disabled(void) { return true; }
1618+#endif
1619+
16151620 extern void efi_call_virt_check_flags(unsigned long flags, const char *call);
16161621 extern unsigned long efi_call_virt_save_flags(void);
16171622
include/linux/elevator.h+1−0
@@ -31,6 +31,7 @@ struct elevator_mq_ops { · 30 unmodified lines
3131 void (*exit_sched)(struct elevator_queue *);
3232 int (*init_hctx)(struct blk_mq_hw_ctx *, unsigned int);
3333 void (*exit_hctx)(struct blk_mq_hw_ctx *, unsigned int);
34+ void (*depth_updated)(struct blk_mq_hw_ctx *);
3435
3536 bool (*allow_merge)(struct request_queue *, struct request *, struct bio *);
3637 bool (*bio_merge)(struct blk_mq_hw_ctx *, struct bio *);
include/linux/etherdevice.h+13−1
@@ -33,7 +33,7 @@ struct device; · 32 unmodified lines
3333 int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr);
3434 unsigned char *arch_get_platform_mac_address(void);
3535 int nvmem_get_mac_address(struct device *dev, void *addrbuf);
36−u32 eth_get_headlen(void *data, unsigned int max_len);
36+u32 eth_get_headlen(const struct net_device *dev, void *data, unsigned int len);
3737 __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
3838 extern const struct header_ops eth_header_ops;
3939
@@ -448,6 +448,18 @@ static inline void eth_addr_dec(u8 *addr) · 408 unmodified lines
448448 u64_to_ether_addr(u, addr);
449449 }
450450
451+/**
452+ * eth_addr_inc() - Increment the given MAC address.
453+ * @addr: Pointer to a six-byte array containing Ethernet address to increment.
454+ */
455+static inline void eth_addr_inc(u8 *addr)
456+{
457+ u64 u = ether_addr_to_u64(addr);
458+
459+ u++;
460+ u64_to_ether_addr(u, addr);
461+}
462+
451463 /**
452464 * is_etherdev_addr - Tell if given Ethernet address belongs to the device.
453465 * @dev: Pointer to a device structure
include/linux/f2fs_fs.h+8−3
@@ -164,6 +164,10 @@ struct f2fs_checkpoint { · 163 unmodified lines
164164 unsigned char sit_nat_version_bitmap[1];
165165 } __packed;
166166
167+#define CP_CHKSUM_OFFSET 4092 /* default chksum offset in checkpoint */
168+#define CP_MIN_CHKSUM_OFFSET \
169+ (offsetof(struct f2fs_checkpoint, sit_nat_version_bitmap))
170+
167171 /*
168172 * For orphan inode management
169173 */
@@ -198,11 +202,12 @@ struct f2fs_extent { · 28 unmodified lines
198202 get_extra_isize(inode))
199203 #define DEF_NIDS_PER_INODE 5 /* Node IDs in an Inode */
200204 #define ADDRS_PER_INODE(inode) addrs_per_inode(inode)
201−#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */
205+#define DEF_ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */
206+#define ADDRS_PER_BLOCK(inode) addrs_per_block(inode)
202207 #define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */
203208
204209 #define ADDRS_PER_PAGE(page, inode) \
205− (IS_INODE(page) ? ADDRS_PER_INODE(inode) : ADDRS_PER_BLOCK)
210+ (IS_INODE(page) ? ADDRS_PER_INODE(inode) : ADDRS_PER_BLOCK(inode))
206211
207212 #define NODE_DIR1_BLOCK (DEF_ADDRS_PER_INODE + 1)
208213 #define NODE_DIR2_BLOCK (DEF_ADDRS_PER_INODE + 2)
@@ -267,7 +272,7 @@ struct f2fs_inode { · 58 unmodified lines
267272 } __packed;
268273
269274 struct direct_node {
270− __le32 addr[ADDRS_PER_BLOCK]; /* array of data block address */
275+ __le32 addr[DEF_ADDRS_PER_BLOCK]; /* array of data block address */
271276 } __packed;
272277
273278 struct indirect_node {
include/linux/filter.h+20−14
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #include <linux/set_memory.h>
2121 #include <linux/kallsyms.h>
2222 #include <linux/if_vlan.h>
23+#include <linux/vmalloc.h>
2324
2425 #include <net/sch_generic.h>
2526
@@ -33,6 +34,8 @@ struct bpf_prog_aux; · 7 unmodified lines
3334 struct xdp_rxq_info;
3435 struct xdp_buff;
3536 struct sock_reuseport;
37+struct ctl_table;
38+struct ctl_table_header;
3639
3740 /* ArgX, context and stack frame pointer register positions. Note,
3841 * Arg1, Arg2, Arg3, etc are used as argument mappings of function
@@ -503,7 +506,6 @@ struct bpf_prog { · 464 unmodified lines
503506 u16 pages; /* Number of allocated pages */
504507 u16 jited:1, /* Is our filter JIT'ed? */
505508 jit_requested:1,/* archs need to JIT the prog */
506− undo_set_mem:1, /* Passed set_memory_ro() checkpoint */
507509 gpl_compatible:1, /* Is filter GPL compatible? */
508510 cb_access:1, /* Is control block accessed? */
509511 dst_needed:1, /* Do we need dst entry? */
@@ -733,24 +735,15 @@ bpf_ctx_narrow_access_ok(u32 off, u32 size, u32 size_default) · 223 unmodified lines
733735
734736 static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
735737 {
736− fp->undo_set_mem = 1;
738+ set_vm_flush_reset_perms(fp);
737739 set_memory_ro((unsigned long)fp, fp->pages);
738740 }
739741
740−static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
741−{
742− if (fp->undo_set_mem)
743− set_memory_rw((unsigned long)fp, fp->pages);
744−}
745−
746742 static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr)
747743 {
744+ set_vm_flush_reset_perms(hdr);
748745 set_memory_ro((unsigned long)hdr, hdr->pages);
749−}
750−
751−static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr)
752−{
753− set_memory_rw((unsigned long)hdr, hdr->pages);
746+ set_memory_x((unsigned long)hdr, hdr->pages);
754747 }
755748
756749 static inline struct bpf_binary_header *
@@ -788,7 +781,6 @@ void __bpf_prog_free(struct bpf_prog *fp); · 31 unmodified lines
788781
789782 static inline void bpf_prog_unlock_free(struct bpf_prog *fp)
790783 {
791− bpf_prog_unlock_ro(fp);
792784 __bpf_prog_free(fp);
793785 }
794786
@@ -1177,4 +1169,18 @@ struct bpf_sock_ops_kern { · 382 unmodified lines
11771169 */
11781170 };
11791171
1172+struct bpf_sysctl_kern {
1173+ struct ctl_table_header *head;
1174+ struct ctl_table *table;
1175+ void *cur_val;
1176+ size_t cur_len;
1177+ void *new_val;
1178+ size_t new_len;
1179+ int new_updated;
1180+ int write;
1181+ loff_t *ppos;
1182+ /* Temporary "register" for indirect stores to ppos. */
1183+ u64 tmp_reg;
1184+};
1185+
11801186 #endif /* __LINUX_FILTER_H__ */
include/linux/firmware/imx/sci.h+5−0
@@ -15,4 +15,9 @@ · 14 unmodified lines
1515
1616 #include <linux/firmware/imx/svc/misc.h>
1717 #include <linux/firmware/imx/svc/pm.h>
18+
19+int imx_scu_enable_general_irq_channel(struct device *dev);
20+int imx_scu_irq_register_notifier(struct notifier_block *nb);
21+int imx_scu_irq_unregister_notifier(struct notifier_block *nb);
22+int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable);
1823 #endif /* _SC_SCI_H */
include/linux/firmware/intel/stratix10-smc.h+19−0
@@ -309,4 +309,23 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 308 unmodified lines
309309 #define INTEL_SIP_SMC_FUNCID_RSU_UPDATE 12
310310 #define INTEL_SIP_SMC_RSU_UPDATE \
311311 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_UPDATE)
312+
313+/*
314+ * Request INTEL_SIP_SMC_ECC_DBE
315+ *
316+ * Sync call used by service driver at EL1 to alert EL3 that a Double
317+ * Bit ECC error has occurred.
318+ *
319+ * Call register usage:
320+ * a0 INTEL_SIP_SMC_ECC_DBE
321+ * a1 SysManager Double Bit Error value
322+ * a2-7 not used
323+ *
324+ * Return status
325+ * a0 INTEL_SIP_SMC_STATUS_OK
326+ */
327+#define INTEL_SIP_SMC_FUNCID_ECC_DBE 13
328+#define INTEL_SIP_SMC_ECC_DBE \
329+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_ECC_DBE)
330+
312331 #endif
include/linux/firmware/trusted_foundations.h+96−0
@@ -0,0 +1,96 @@
1+/*
2+ * Copyright (c) 2013, NVIDIA Corporation.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; either version 2 of the License, or
7+ * (at your option) any later version.
8+ *
9+ * This program is distributed in the hope that it will be useful, but WITHOUT
10+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12+ * more details.
13+ */
14+
15+/*
16+ * Support for the Trusted Foundations secure monitor.
17+ *
18+ * Trusted Foundation comes active on some ARM consumer devices (most
19+ * Tegra-based devices sold on the market are concerned). Such devices can only
20+ * perform some basic operations, like setting the CPU reset vector, through
21+ * SMC calls to the secure monitor. The calls are completely specific to
22+ * Trusted Foundations, and do *not* follow the SMC calling convention or the
23+ * PSCI standard.
24+ */
25+
26+#ifndef __FIRMWARE_TRUSTED_FOUNDATIONS_H
27+#define __FIRMWARE_TRUSTED_FOUNDATIONS_H
28+
29+#include <linux/printk.h>
30+#include <linux/bug.h>
31+#include <linux/of.h>
32+#include <linux/cpu.h>
33+#include <linux/smp.h>
34+#include <linux/types.h>
35+
36+#include <asm/hardware/cache-l2x0.h>
37+#include <asm/outercache.h>
38+
39+#define TF_PM_MODE_LP0 0
40+#define TF_PM_MODE_LP1 1
41+#define TF_PM_MODE_LP1_NO_MC_CLK 2
42+#define TF_PM_MODE_LP2 3
43+#define TF_PM_MODE_LP2_NOFLUSH_L2 4
44+
45+struct trusted_foundations_platform_data {
46+ unsigned int version_major;
47+ unsigned int version_minor;
48+};
49+
50+#if IS_ENABLED(CONFIG_TRUSTED_FOUNDATIONS)
51+
52+void register_trusted_foundations(struct trusted_foundations_platform_data *pd);
53+void of_register_trusted_foundations(void);
54+bool trusted_foundations_registered(void);
55+
56+#else /* CONFIG_TRUSTED_FOUNDATIONS */
57+static inline void tf_dummy_write_sec(unsigned long val, unsigned int reg)
58+{
59+}
60+
61+static inline void register_trusted_foundations(
62+ struct trusted_foundations_platform_data *pd)
63+{
64+ /*
65+ * If the system requires TF and we cannot provide it, continue booting
66+ * but disable features that cannot be provided.
67+ */
68+ pr_err("No support for Trusted Foundations, continuing in degraded mode.\n");
69+ pr_err("Secondary processors as well as CPU PM will be disabled.\n");
70+#if IS_ENABLED(CONFIG_CACHE_L2X0)
71+ pr_err("L2X0 cache will be kept disabled.\n");
72+ outer_cache.write_sec = tf_dummy_write_sec;
73+#endif
74+#if IS_ENABLED(CONFIG_SMP)
75+ setup_max_cpus = 0;
76+#endif
77+ cpu_idle_poll_ctrl(true);
78+}
79+
80+static inline void of_register_trusted_foundations(void)
81+{
82+ /*
83+ * If we find the target should enable TF but does not support it,
84+ * fail as the system won't be able to do much anyway
85+ */
86+ if (of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations"))
87+ register_trusted_foundations(NULL);
88+}
89+
90+static inline bool trusted_foundations_registered(void)
91+{
92+ return false;
93+}
94+#endif /* CONFIG_TRUSTED_FOUNDATIONS */
95+
96+#endif
include/linux/firmware/xlnx-zynqmp.h+13−1
@@ -48,6 +48,14 @@ · 47 unmodified lines
4848 #define ZYNQMP_PM_CAPABILITY_WAKEUP 0x4U
4949 #define ZYNQMP_PM_CAPABILITY_POWER 0x8U
5050
51+/*
52+ * Firmware FPGA Manager flags
53+ * XILINX_ZYNQMP_PM_FPGA_FULL: FPGA full reconfiguration
54+ * XILINX_ZYNQMP_PM_FPGA_PARTIAL: FPGA partial reconfiguration
55+ */
56+#define XILINX_ZYNQMP_PM_FPGA_FULL 0x0U
57+#define XILINX_ZYNQMP_PM_FPGA_PARTIAL BIT(0)
58+
5159 enum pm_api_id {
5260 PM_GET_API_VERSION = 1,
5361 PM_REQUEST_NODE = 13,
@@ -56,6 +64,8 @@ enum pm_api_id { · 2 unmodified lines
5664 PM_RESET_ASSERT = 17,
5765 PM_RESET_GET_STATUS,
5866 PM_PM_INIT_FINALIZE = 21,
67+ PM_FPGA_LOAD,
68+ PM_FPGA_GET_STATUS,
5969 PM_GET_CHIPID = 24,
6070 PM_IOCTL = 34,
6171 PM_QUERY_DATA,
@@ -258,6 +268,8 @@ struct zynqmp_pm_query_data { · 196 unmodified lines
258268 struct zynqmp_eemi_ops {
259269 int (*get_api_version)(u32 *version);
260270 int (*get_chipid)(u32 *idcode, u32 *version);
271+ int (*fpga_load)(const u64 address, const u32 size, const u32 flags);
272+ int (*fpga_get_status)(u32 *value);
261273 int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out);
262274 int (*clock_enable)(u32 clock_id);
263275 int (*clock_disable)(u32 clock_id);
@@ -293,7 +305,7 @@ const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void); · 29 unmodified lines
293305 #else
294306 static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
295307 {
296− return NULL;
308+ return ERR_PTR(-ENODEV);
297309 }
298310 #endif
299311
include/linux/fs.h+16−4
@@ -165,10 +165,13 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset, · 164 unmodified lines
165165 #define FMODE_NONOTIFY ((__force fmode_t)0x4000000)
166166
167167 /* File is capable of returning -EAGAIN if I/O will block */
168−#define FMODE_NOWAIT ((__force fmode_t)0x8000000)
168+#define FMODE_NOWAIT ((__force fmode_t)0x8000000)
169+
170+/* File represents mount that needs unmounting */
171+#define FMODE_NEED_UNMOUNT ((__force fmode_t)0x10000000)
169172
170173 /* File does not contribute to nr_files count */
171−#define FMODE_NOACCOUNT ((__force fmode_t)0x20000000)
174+#define FMODE_NOACCOUNT ((__force fmode_t)0x20000000)
172175
173176 /*
174177 * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
@@ -694,7 +697,10 @@ struct inode { · 519 unmodified lines
694697 #ifdef CONFIG_IMA
695698 atomic_t i_readcount; /* struct files open RO */
696699 #endif
697− const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
700+ union {
701+ const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
702+ void (*free_inode)(struct inode *);
703+ };
698704 struct file_lock_context *i_flctx;
699705 struct address_space i_data;
700706 struct list_head i_devices;
@@ -969,7 +975,6 @@ static inline struct file *get_file(struct file *f) · 268 unmodified lines
969975 #define get_file_rcu_many(x, cnt) \
970976 atomic_long_add_unless(&(x)->f_count, (cnt), 0)
971977 #define get_file_rcu(x) get_file_rcu_many((x), 1)
972−#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
973978 #define file_count(x) atomic_long_read(&(x)->f_count)
974979
975980 #define MAX_NON_LFS ((1UL<<31) - 1)
@@ -1093,6 +1098,7 @@ struct file_lock { · 117 unmodified lines
10931098 struct {
10941099 struct list_head link; /* link in AFS vnode's pending_locks list */
10951100 int state; /* state of grant or error if -ve */
1101+ unsigned int debug_id;
10961102 } afs;
10971103 } fl_u;
10981104 } __randomize_layout;
@@ -1903,6 +1909,7 @@ extern loff_t vfs_dedupe_file_range_one(struct file *src_file, loff_t src_pos, · 804 unmodified lines
19031909 struct super_operations {
19041910 struct inode *(*alloc_inode)(struct super_block *sb);
19051911 void (*destroy_inode)(struct inode *);
1912+ void (*free_inode)(struct inode *);
19061913
19071914 void (*dirty_inode) (struct inode *, int flags);
19081915 int (*write_inode) (struct inode *, struct writeback_control *wbc);
@@ -1956,6 +1963,7 @@ struct super_operations { · 47 unmodified lines
19561963 #define S_DAX 0 /* Make all the DAX code disappear */
19571964 #endif
19581965 #define S_ENCRYPTED 16384 /* Encrypted file (using fs/crypto/) */
1966+#define S_CASEFOLD 32768 /* Casefolded file */
19591967
19601968 /*
19611969 * Note that nosuid etc flags are inode-specific: setting some file-system
@@ -1996,6 +2004,7 @@ static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags · 34 unmodified lines
19962004 #define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC)
19972005 #define IS_DAX(inode) ((inode)->i_flags & S_DAX)
19982006 #define IS_ENCRYPTED(inode) ((inode)->i_flags & S_ENCRYPTED)
2007+#define IS_CASEFOLDED(inode) ((inode)->i_flags & S_CASEFOLD)
19992008
20002009 #define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \
20012010 (inode)->i_rdev == WHITEOUT_DEV)
@@ -2785,6 +2794,9 @@ extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end, · 783 unmodified lines
27852794 int datasync);
27862795 extern int vfs_fsync(struct file *file, int datasync);
27872796
2797+extern int sync_file_range(struct file *file, loff_t offset, loff_t nbytes,
2798+ unsigned int flags);
2799+
27882800 /*
27892801 * Sync the bytes written if this was a synchronous write. Expect ki_pos
27902802 * to already be updated for the write, and will return either the amount
include/linux/fs_context.h+31−7
@@ -13,8 +13,10 @@ · 12 unmodified lines
1313 #define _LINUX_FS_CONTEXT_H
1414
1515 #include <linux/kernel.h>
16+#include <linux/refcount.h>
1617 #include <linux/errno.h>
1718 #include <linux/security.h>
19+#include <linux/mutex.h>
1820
1921 struct cred;
2022 struct dentry;
@@ -34,6 +36,19 @@ enum fs_context_purpose { · 13 unmodified lines
3436 FS_CONTEXT_FOR_RECONFIGURE, /* Superblock reconfiguration (remount) */
3537 };
3638
39+/*
40+ * Userspace usage phase for fsopen/fspick.
41+ */
42+enum fs_context_phase {
43+ FS_CONTEXT_CREATE_PARAMS, /* Loading params for sb creation */
44+ FS_CONTEXT_CREATING, /* A superblock is being created */
45+ FS_CONTEXT_AWAITING_MOUNT, /* Superblock created, awaiting fsmount() */
46+ FS_CONTEXT_AWAITING_RECONF, /* Awaiting initialisation for reconfiguration */
47+ FS_CONTEXT_RECONF_PARAMS, /* Loading params for reconfiguration */
48+ FS_CONTEXT_RECONFIGURING, /* Reconfiguring the superblock */
49+ FS_CONTEXT_FAILED, /* Failed to correctly transition a context */
50+};
51+
3752 /*
3853 * Type of parameter value.
3954 */
@@ -74,12 +89,14 @@ struct fs_parameter { · 34 unmodified lines
7489 */
7590 struct fs_context {
7691 const struct fs_context_operations *ops;
92+ struct mutex uapi_mutex; /* Userspace access mutex */
7793 struct file_system_type *fs_type;
7894 void *fs_private; /* The filesystem's context */
7995 struct dentry *root; /* The root and superblock */
8096 struct user_namespace *user_ns; /* The user namespace for this mount */
8197 struct net *net_ns; /* The network namespace for this mount */
8298 const struct cred *cred; /* The mounter's credentials */
99+ struct fc_log *log; /* Logging buffer */
83100 const char *source; /* The source name (eg. dev path) */
84101 const char *subtype; /* The subtype to set on the superblock */
85102 void *security; /* Linux S&M options */
@@ -88,6 +105,7 @@ struct fs_context { · 2 unmodified lines
88105 unsigned int sb_flags_mask; /* Superblock flags that were changed */
89106 unsigned int lsm_flags; /* Information flags from the fs to the LSM */
90107 enum fs_context_purpose purpose:8;
108+ enum fs_context_phase phase:8; /* The phase the context is in */
91109 bool need_free:1; /* Need to call ops->free() */
92110 bool global:1; /* Goes into &init_user_ns */
93111 };
@@ -135,15 +153,21 @@ extern int vfs_get_super(struct fs_context *fc, · 41 unmodified lines
135153
136154 extern const struct file_operations fscontext_fops;
137155
138−#ifdef CONFIG_PRINTK
156+/*
157+ * Mount error, warning and informational message logging. This structure is
158+ * shareable between a mount and a subordinate mount.
159+ */
160+struct fc_log {
161+ refcount_t usage;
162+ u8 head; /* Insertion index in buffer[] */
163+ u8 tail; /* Removal index in buffer[] */
164+ u8 need_free; /* Mask of kfree'able items in buffer[] */
165+ struct module *owner; /* Owner module for strings that don't then need freeing */
166+ char *buffer[8];
167+};
168+
139169 extern __attribute__((format(printf, 2, 3)))
140170 void logfc(struct fs_context *fc, const char *fmt, ...);
141−#else
142−static inline __attribute__((format(printf, 2, 3)))
143−void logfc(struct fs_context *fc, const char *fmt, ...)
144−{
145−}
146−#endif
147171
148172 /**
149173 * infof - Store supplementary informational message
include/linux/fscrypt.h+63−22
@@ -33,6 +33,7 @@ struct fscrypt_name { · 32 unmodified lines
3333 u32 hash;
3434 u32 minor_hash;
3535 struct fscrypt_str crypto_buf;
36+ bool is_ciphertext_name;
3637 };
3738
3839 #define FSTR_INIT(n, l) { .name = n, .len = l }
@@ -79,7 +80,8 @@ struct fscrypt_ctx { · 40 unmodified lines
7980
8081 static inline bool fscrypt_has_encryption_key(const struct inode *inode)
8182 {
82− return (inode->i_crypt_info != NULL);
83+ /* pairs with cmpxchg_release() in fscrypt_get_encryption_info() */
84+ return READ_ONCE(inode->i_crypt_info) != NULL;
8385 }
8486
8587 static inline bool fscrypt_dummy_context_enabled(struct inode *inode)
@@ -88,9 +90,21 @@ static inline bool fscrypt_dummy_context_enabled(struct inode *inode) · 2 unmodified lines
8890 inode->i_sb->s_cop->dummy_context(inode);
8991 }
9092
93+/*
94+ * When d_splice_alias() moves a directory's encrypted alias to its decrypted
95+ * alias as a result of the encryption key being added, DCACHE_ENCRYPTED_NAME
96+ * must be cleared. Note that we don't have to support arbitrary moves of this
97+ * flag because fscrypt doesn't allow encrypted aliases to be the source or
98+ * target of a rename().
99+ */
100+static inline void fscrypt_handle_d_move(struct dentry *dentry)
101+{
102+ dentry->d_flags &= ~DCACHE_ENCRYPTED_NAME;
103+}
104+
91105 /* crypto.c */
92106 extern void fscrypt_enqueue_decrypt_work(struct work_struct *);
93−extern struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *, gfp_t);
107+extern struct fscrypt_ctx *fscrypt_get_ctx(gfp_t);
94108 extern void fscrypt_release_ctx(struct fscrypt_ctx *);
95109 extern struct page *fscrypt_encrypt_page(const struct inode *, struct page *,
96110 unsigned int, unsigned int,
@@ -114,6 +128,7 @@ extern int fscrypt_inherit_context(struct inode *, struct inode *, · 17 unmodified lines
114128 /* keyinfo.c */
115129 extern int fscrypt_get_encryption_info(struct inode *);
116130 extern void fscrypt_put_encryption_info(struct inode *);
131+extern void fscrypt_free_inode(struct inode *);
117132
118133 /* fname.c */
119134 extern int fscrypt_setup_filename(struct inode *, const struct qstr *,
@@ -214,13 +229,15 @@ extern int fscrypt_zeroout_range(const struct inode *, pgoff_t, sector_t, · 94 unmodified lines
214229
215230 /* hooks.c */
216231 extern int fscrypt_file_open(struct inode *inode, struct file *filp);
217−extern int __fscrypt_prepare_link(struct inode *inode, struct inode *dir);
232+extern int __fscrypt_prepare_link(struct inode *inode, struct inode *dir,
233+ struct dentry *dentry);
218234 extern int __fscrypt_prepare_rename(struct inode *old_dir,
219235 struct dentry *old_dentry,
220236 struct inode *new_dir,
221237 struct dentry *new_dentry,
222238 unsigned int flags);
223−extern int __fscrypt_prepare_lookup(struct inode *dir, struct dentry *dentry);
239+extern int __fscrypt_prepare_lookup(struct inode *dir, struct dentry *dentry,
240+ struct fscrypt_name *fname);
224241 extern int __fscrypt_prepare_symlink(struct inode *dir, unsigned int len,
225242 unsigned int max_len,
226243 struct fscrypt_str *disk_link);
@@ -230,6 +247,11 @@ extern int __fscrypt_encrypt_symlink(struct inode *inode, const char *target, · 3 unmodified lines
230247 extern const char *fscrypt_get_symlink(struct inode *inode, const void *caddr,
231248 unsigned int max_size,
232249 struct delayed_call *done);
250+static inline void fscrypt_set_ops(struct super_block *sb,
251+ const struct fscrypt_operations *s_cop)
252+{
253+ sb->s_cop = s_cop;
254+}
233255 #else /* !CONFIG_FS_ENCRYPTION */
234256
235257 static inline bool fscrypt_has_encryption_key(const struct inode *inode)
@@ -242,13 +264,16 @@ static inline bool fscrypt_dummy_context_enabled(struct inode *inode) · 6 unmodified lines
242264 return false;
243265 }
244266
267+static inline void fscrypt_handle_d_move(struct dentry *dentry)
268+{
269+}
270+
245271 /* crypto.c */
246272 static inline void fscrypt_enqueue_decrypt_work(struct work_struct *work)
247273 {
248274 }
249275
250−static inline struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode,
251− gfp_t gfp_flags)
276+static inline struct fscrypt_ctx *fscrypt_get_ctx(gfp_t gfp_flags)
252277 {
253278 return ERR_PTR(-EOPNOTSUPP);
254279 }
@@ -322,6 +347,10 @@ static inline void fscrypt_put_encryption_info(struct inode *inode) · 67 unmodified lines
322347 return;
323348 }
324349
350+static inline void fscrypt_free_inode(struct inode *inode)
351+{
352+}
353+
325354 /* fname.c */
326355 static inline int fscrypt_setup_filename(struct inode *dir,
327356 const struct qstr *iname,
@@ -330,7 +359,7 @@ static inline int fscrypt_setup_filename(struct inode *dir, · 2 unmodified lines
330359 if (IS_ENCRYPTED(dir))
331360 return -EOPNOTSUPP;
332361
333− memset(fname, 0, sizeof(struct fscrypt_name));
362+ memset(fname, 0, sizeof(*fname));
334363 fname->usr_fname = iname;
335364 fname->disk_name.name = (unsigned char *)iname->name;
336365 fname->disk_name.len = iname->len;
@@ -401,8 +430,8 @@ static inline int fscrypt_file_open(struct inode *inode, struct file *filp) · 64 unmodified lines
401430 return 0;
402431 }
403432
404−static inline int __fscrypt_prepare_link(struct inode *inode,
405− struct inode *dir)
433+static inline int __fscrypt_prepare_link(struct inode *inode, struct inode *dir,
434+ struct dentry *dentry)
406435 {
407436 return -EOPNOTSUPP;
408437 }
@@ -417,7 +446,8 @@ static inline int __fscrypt_prepare_rename(struct inode *old_dir, · 8 unmodified lines
417446 }
418447
419448 static inline int __fscrypt_prepare_lookup(struct inode *dir,
420− struct dentry *dentry)
449+ struct dentry *dentry,
450+ struct fscrypt_name *fname)
421451 {
422452 return -EOPNOTSUPP;
423453 }
@@ -446,6 +476,12 @@ static inline const char *fscrypt_get_symlink(struct inode *inode, · 22 unmodified lines
446476 {
447477 return ERR_PTR(-EOPNOTSUPP);
448478 }
479+
480+static inline void fscrypt_set_ops(struct super_block *sb,
481+ const struct fscrypt_operations *s_cop)
482+{
483+}
484+
449485 #endif /* !CONFIG_FS_ENCRYPTION */
450486
451487 /**
@@ -497,7 +533,7 @@ static inline int fscrypt_prepare_link(struct dentry *old_dentry, · 45 unmodified lines
497533 struct dentry *dentry)
498534 {
499535 if (IS_ENCRYPTED(dir))
500− return __fscrypt_prepare_link(d_inode(old_dentry), dir);
536+ return __fscrypt_prepare_link(d_inode(old_dentry), dir, dentry);
501537 return 0;
502538 }
503539
@@ -538,27 +574,32 @@ static inline int fscrypt_prepare_rename(struct inode *old_dir, · 34 unmodified lines
538574 * fscrypt_prepare_lookup - prepare to lookup a name in a possibly-encrypted directory
539575 * @dir: directory being searched
540576 * @dentry: filename being looked up
541− * @flags: lookup flags
577+ * @fname: (output) the name to use to search the on-disk directory
542578 *
543− * Prepare for ->lookup() in a directory which may be encrypted. Lookups can be
544− * done with or without the directory's encryption key; without the key,
579+ * Prepare for ->lookup() in a directory which may be encrypted by determining
580+ * the name that will actually be used to search the directory on-disk. Lookups
581+ * can be done with or without the directory's encryption key; without the key,
545582 * filenames are presented in encrypted form. Therefore, we'll try to set up
546583 * the directory's encryption key, but even without it the lookup can continue.
547584 *
548− * To allow invalidating stale dentries if the directory's encryption key is
549− * added later, we also install a custom ->d_revalidate() method and use the
550− * DCACHE_ENCRYPTED_WITH_KEY flag to indicate whether a given dentry is a
551− * plaintext name (flag set) or a ciphertext name (flag cleared).
585+ * This also installs a custom ->d_revalidate() method which will invalidate the
586+ * dentry if it was created without the key and the key is later added.
552587 *
553− * Return: 0 on success, -errno if a problem occurred while setting up the
554− * encryption key
588+ * Return: 0 on success; -ENOENT if key is unavailable but the filename isn't a
589+ * correctly formed encoded ciphertext name, so a negative dentry should be
590+ * created; or another -errno code.
555591 */
556592 static inline int fscrypt_prepare_lookup(struct inode *dir,
557593 struct dentry *dentry,
558− unsigned int flags)
594+ struct fscrypt_name *fname)
559595 {
560596 if (IS_ENCRYPTED(dir))
561− return __fscrypt_prepare_lookup(dir, dentry);
597+ return __fscrypt_prepare_lookup(dir, dentry, fname);
598+
599+ memset(fname, 0, sizeof(*fname));
600+ fname->usr_fname = &dentry->d_name;
601+ fname->disk_name.name = (unsigned char *)dentry->d_name.name;
602+ fname->disk_name.len = dentry->d_name.len;
562603 return 0;
563604 }
564605
include/linux/fsl/ftm.h+88−0
@@ -0,0 +1,88 @@
1+// SPDX-License-Identifier: GPL-2.0
2+#ifndef __FSL_FTM_H__
3+#define __FSL_FTM_H__
4+
5+#define FTM_SC 0x0 /* Status And Control */
6+#define FTM_CNT 0x4 /* Counter */
7+#define FTM_MOD 0x8 /* Modulo */
8+
9+#define FTM_CNTIN 0x4C /* Counter Initial Value */
10+#define FTM_STATUS 0x50 /* Capture And Compare Status */
11+#define FTM_MODE 0x54 /* Features Mode Selection */
12+#define FTM_SYNC 0x58 /* Synchronization */
13+#define FTM_OUTINIT 0x5C /* Initial State For Channels Output */
14+#define FTM_OUTMASK 0x60 /* Output Mask */
15+#define FTM_COMBINE 0x64 /* Function For Linked Channels */
16+#define FTM_DEADTIME 0x68 /* Deadtime Insertion Control */
17+#define FTM_EXTTRIG 0x6C /* FTM External Trigger */
18+#define FTM_POL 0x70 /* Channels Polarity */
19+#define FTM_FMS 0x74 /* Fault Mode Status */
20+#define FTM_FILTER 0x78 /* Input Capture Filter Control */
21+#define FTM_FLTCTRL 0x7C /* Fault Control */
22+#define FTM_QDCTRL 0x80 /* Quadrature Decoder Control And Status */
23+#define FTM_CONF 0x84 /* Configuration */
24+#define FTM_FLTPOL 0x88 /* FTM Fault Input Polarity */
25+#define FTM_SYNCONF 0x8C /* Synchronization Configuration */
26+#define FTM_INVCTRL 0x90 /* FTM Inverting Control */
27+#define FTM_SWOCTRL 0x94 /* FTM Software Output Control */
28+#define FTM_PWMLOAD 0x98 /* FTM PWM Load */
29+
30+#define FTM_SC_CLK_MASK_SHIFT 3
31+#define FTM_SC_CLK_MASK (3 << FTM_SC_CLK_MASK_SHIFT)
32+#define FTM_SC_TOF 0x80
33+#define FTM_SC_TOIE 0x40
34+#define FTM_SC_CPWMS 0x20
35+#define FTM_SC_CLKS 0x18
36+#define FTM_SC_PS_1 0x0
37+#define FTM_SC_PS_2 0x1
38+#define FTM_SC_PS_4 0x2
39+#define FTM_SC_PS_8 0x3
40+#define FTM_SC_PS_16 0x4
41+#define FTM_SC_PS_32 0x5
42+#define FTM_SC_PS_64 0x6
43+#define FTM_SC_PS_128 0x7
44+#define FTM_SC_PS_MASK 0x7
45+
46+#define FTM_MODE_FAULTIE 0x80
47+#define FTM_MODE_FAULTM 0x60
48+#define FTM_MODE_CAPTEST 0x10
49+#define FTM_MODE_PWMSYNC 0x8
50+#define FTM_MODE_WPDIS 0x4
51+#define FTM_MODE_INIT 0x2
52+#define FTM_MODE_FTMEN 0x1
53+
54+/* NXP Errata: The PHAFLTREN and PHBFLTREN bits are tide to zero internally
55+ * and these bits cannot be set. Flextimer cannot use Filter in
56+ * Quadrature Decoder Mode.
57+ * https://community.nxp.com/thread/467648#comment-1010319
58+ */
59+#define FTM_QDCTRL_PHAFLTREN 0x80
60+#define FTM_QDCTRL_PHBFLTREN 0x40
61+#define FTM_QDCTRL_PHAPOL 0x20
62+#define FTM_QDCTRL_PHBPOL 0x10
63+#define FTM_QDCTRL_QUADMODE 0x8
64+#define FTM_QDCTRL_QUADDIR 0x4
65+#define FTM_QDCTRL_TOFDIR 0x2
66+#define FTM_QDCTRL_QUADEN 0x1
67+
68+#define FTM_FMS_FAULTF 0x80
69+#define FTM_FMS_WPEN 0x40
70+#define FTM_FMS_FAULTIN 0x10
71+#define FTM_FMS_FAULTF3 0x8
72+#define FTM_FMS_FAULTF2 0x4
73+#define FTM_FMS_FAULTF1 0x2
74+#define FTM_FMS_FAULTF0 0x1
75+
76+#define FTM_CSC_BASE 0xC
77+#define FTM_CSC_MSB 0x20
78+#define FTM_CSC_MSA 0x10
79+#define FTM_CSC_ELSB 0x8
80+#define FTM_CSC_ELSA 0x4
81+#define FTM_CSC(_channel) (FTM_CSC_BASE + ((_channel) * 8))
82+
83+#define FTM_CV_BASE 0x10
84+#define FTM_CV(_channel) (FTM_CV_BASE + ((_channel) * 8))
85+
86+#define FTM_PS_MAX 7
87+
88+#endif
include/linux/fsnotify.h+4−37
@@ -27,7 +27,7 @@ static inline int fsnotify_dirent(struct inode *dir, struct dentry *dentry, · 26 unmodified lines
2727 __u32 mask)
2828 {
2929 return fsnotify(dir, mask, d_inode(dentry), FSNOTIFY_EVENT_INODE,
30− dentry->d_name.name, 0);
30+ &dentry->d_name, 0);
3131 }
3232
3333 /* Notify this dentry's parent about a child's events. */
@@ -102,7 +102,7 @@ static inline void fsnotify_link_count(struct inode *inode) · 68 unmodified lines
102102 * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir
103103 */
104104 static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
105− const unsigned char *old_name,
105+ const struct qstr *old_name,
106106 int isdir, struct inode *target,
107107 struct dentry *moved)
108108 {
@@ -111,7 +111,7 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, · 2 unmodified lines
111111 __u32 old_dir_mask = FS_MOVED_FROM;
112112 __u32 new_dir_mask = FS_MOVED_TO;
113113 __u32 mask = FS_MOVE_SELF;
114− const unsigned char *new_name = moved->d_name.name;
114+ const struct qstr *new_name = &moved->d_name;
115115
116116 if (old_dir == new_dir)
117117 old_dir_mask |= FS_DN_RENAME;
@@ -151,39 +151,6 @@ static inline void fsnotify_vfsmount_delete(struct vfsmount *mnt) · 33 unmodified lines
151151 __fsnotify_vfsmount_delete(mnt);
152152 }
153153
154−/*
155− * fsnotify_nameremove - a filename was removed from a directory
156− *
157− * This is mostly called under parent vfs inode lock so name and
158− * dentry->d_parent should be stable. However there are some corner cases where
159− * inode lock is not held. So to be on the safe side and be reselient to future
160− * callers and out of tree users of d_delete(), we do not assume that d_parent
161− * and d_name are stable and we use dget_parent() and
162− * take_dentry_name_snapshot() to grab stable references.
163− */
164−static inline void fsnotify_nameremove(struct dentry *dentry, int isdir)
165−{
166− struct dentry *parent;
167− struct name_snapshot name;
168− __u32 mask = FS_DELETE;
169−
170− /* d_delete() of pseudo inode? (e.g. __ns_get_path() playing tricks) */
171− if (IS_ROOT(dentry))
172− return;
173−
174− if (isdir)
175− mask |= FS_ISDIR;
176−
177− parent = dget_parent(dentry);
178− take_dentry_name_snapshot(&name, dentry);
179−
180− fsnotify(d_inode(parent), mask, d_inode(dentry), FSNOTIFY_EVENT_INODE,
181− name.name, 0);
182−
183− release_dentry_name_snapshot(&name);
184− dput(parent);
185−}
186−
187154 /*
188155 * fsnotify_inoderemove - an inode is going away
189156 */
@@ -218,7 +185,7 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct · 28 unmodified lines
218185 fsnotify_link_count(inode);
219186 audit_inode_child(dir, new_dentry, AUDIT_TYPE_CHILD_CREATE);
220187
221− fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, new_dentry->d_name.name, 0);
188+ fsnotify(dir, FS_CREATE, inode, FSNOTIFY_EVENT_INODE, &new_dentry->d_name, 0);
222189 }
223190
224191 /*
include/linux/fsnotify_backend.h+7−3
@@ -117,7 +117,7 @@ struct fsnotify_ops { · 116 unmodified lines
117117 int (*handle_event)(struct fsnotify_group *group,
118118 struct inode *inode,
119119 u32 mask, const void *data, int data_type,
120− const unsigned char *file_name, u32 cookie,
120+ const struct qstr *file_name, u32 cookie,
121121 struct fsnotify_iter_info *iter_info);
122122 void (*free_group_priv)(struct fsnotify_group *group);
123123 void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group);
@@ -350,11 +350,12 @@ struct fsnotify_mark { · 226 unmodified lines
350350
351351 /* main fsnotify call to send events */
352352 extern int fsnotify(struct inode *to_tell, __u32 mask, const void *data, int data_is,
353− const unsigned char *name, u32 cookie);
353+ const struct qstr *name, u32 cookie);
354354 extern int __fsnotify_parent(const struct path *path, struct dentry *dentry, __u32 mask);
355355 extern void __fsnotify_inode_delete(struct inode *inode);
356356 extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt);
357357 extern void fsnotify_sb_delete(struct super_block *sb);
358+extern void fsnotify_nameremove(struct dentry *dentry, int isdir);
358359 extern u32 fsnotify_get_cookie(void);
359360
360361 static inline int fsnotify_inode_watches_children(struct inode *inode)
@@ -505,7 +506,7 @@ static inline void fsnotify_init_event(struct fsnotify_event *event, · 144 unmodified lines
505506 #else
506507
507508 static inline int fsnotify(struct inode *to_tell, __u32 mask, const void *data, int data_is,
508− const unsigned char *name, u32 cookie)
509+ const struct qstr *name, u32 cookie)
509510 {
510511 return 0;
511512 }
@@ -524,6 +525,9 @@ static inline void __fsnotify_vfsmount_delete(struct vfsmount *mnt) · 12 unmodified lines
524525 static inline void fsnotify_sb_delete(struct super_block *sb)
525526 {}
526527
528+static inline void fsnotify_nameremove(struct dentry *dentry, int isdir)
529+{}
530+
527531 static inline void fsnotify_update_flags(struct dentry *dentry)
528532 {}
529533
include/linux/ftrace.h+6−14
@@ -241,21 +241,11 @@ static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { · 240 unmodified lines
241241
242242 #ifdef CONFIG_STACK_TRACER
243243
244−#define STACK_TRACE_ENTRIES 500
245−
246−struct stack_trace;
247−
248−extern unsigned stack_trace_index[];
249−extern struct stack_trace stack_trace_max;
250−extern unsigned long stack_trace_max_size;
251−extern arch_spinlock_t stack_trace_max_lock;
252−
253244 extern int stack_tracer_enabled;
254−void stack_trace_print(void);
255−int
256−stack_trace_sysctl(struct ctl_table *table, int write,
257− void __user *buffer, size_t *lenp,
258− loff_t *ppos);
245+
246+int stack_trace_sysctl(struct ctl_table *table, int write,
247+ void __user *buffer, size_t *lenp,
248+ loff_t *ppos);
259249
260250 /* DO NOT MODIFY THIS VARIABLE DIRECTLY! */
261251 DECLARE_PER_CPU(int, disable_stack_tracer);
@@ -751,6 +741,8 @@ struct ftrace_graph_ret { · 489 unmodified lines
751741 typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */
752742 typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */
753743
744+extern int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace);
745+
754746 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
755747
756748 struct fgraph_ops {
include/linux/genhd.h+14−6
@@ -150,6 +150,13 @@ enum { · 149 unmodified lines
150150 DISK_EVENT_EJECT_REQUEST = 1 << 1, /* eject requested */
151151 };
152152
153+enum {
154+ /* Poll even if events_poll_msecs is unset */
155+ DISK_EVENT_FLAG_POLL = 1 << 0,
156+ /* Forward events to udev */
157+ DISK_EVENT_FLAG_UEVENT = 1 << 1,
158+};
159+
153160 struct disk_part_tbl {
154161 struct rcu_head rcu_head;
155162 int len;
@@ -184,8 +191,8 @@ struct gendisk { · 28 unmodified lines
184191 char disk_name[DISK_NAME_LEN]; /* name of major driver */
185192 char *(*devnode)(struct gendisk *gd, umode_t *mode);
186193
187− unsigned int events; /* supported events */
188− unsigned int async_events; /* async events, subset of all */
194+ unsigned short events; /* supported events */
195+ unsigned short event_flags; /* flags related to event processing */
189196
190197 /* Array of pointers to partitions indexed by partno.
191198 * Protected with matching bdev lock but stat and other
@@ -610,6 +617,7 @@ struct unixware_disklabel { · 418 unmodified lines
610617
611618 extern int blk_alloc_devt(struct hd_struct *part, dev_t *devt);
612619 extern void blk_free_devt(dev_t devt);
620+extern void blk_invalidate_devt(dev_t devt);
613621 extern dev_t blk_lookup_devt(const char *name, int partno);
614622 extern char *disk_name (struct gendisk *hd, int partno, char *buf);
615623
@@ -714,7 +722,7 @@ static inline void hd_free_part(struct hd_struct *part) · 98 unmodified lines
714722 */
715723 static inline sector_t part_nr_sects_read(struct hd_struct *part)
716724 {
717−#if BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_SMP)
725+#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
718726 sector_t nr_sects;
719727 unsigned seq;
720728 do {
@@ -722,7 +730,7 @@ static inline sector_t part_nr_sects_read(struct hd_struct *part) · 1 unmodified line
722730 nr_sects = part->nr_sects;
723731 } while (read_seqcount_retry(&part->nr_sects_seq, seq));
724732 return nr_sects;
725−#elif BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_PREEMPT)
733+#elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT)
726734 sector_t nr_sects;
727735
728736 preempt_disable();
@@ -741,11 +749,11 @@ static inline sector_t part_nr_sects_read(struct hd_struct *part) · 12 unmodified lines
741749 */
742750 static inline void part_nr_sects_write(struct hd_struct *part, sector_t size)
743751 {
744−#if BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_SMP)
752+#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
745753 write_seqcount_begin(&part->nr_sects_seq);
746754 part->nr_sects = size;
747755 write_seqcount_end(&part->nr_sects_seq);
748−#elif BITS_PER_LONG==32 && defined(CONFIG_LBDAF) && defined(CONFIG_PREEMPT)
756+#elif BITS_PER_LONG==32 && defined(CONFIG_PREEMPT)
749757 preempt_disable();
750758 part->nr_sects = size;
751759 preempt_enable();
include/linux/genl_magic_func.h+2−2
@@ -233,7 +233,6 @@ const char *CONCAT_(GENL_MAGIC_FAMILY, _genl_cmd_to_str)(__u8 cmd) · 232 unmodified lines
233233 { \
234234 handler \
235235 .cmd = op_name, \
236− .policy = CONCAT_(GENL_MAGIC_FAMILY, _tla_nl_policy), \
237236 },
238237
239238 #define ZZZ_genl_ops CONCAT_(GENL_MAGIC_FAMILY, _genl_ops)
@@ -290,7 +289,8 @@ static struct genl_family ZZZ_genl_family __ro_after_init = { · 50 unmodified lines
290289 #ifdef GENL_MAGIC_FAMILY_HDRSZ
291290 .hdrsize = NLA_ALIGN(GENL_MAGIC_FAMILY_HDRSZ),
292291 #endif
293− .maxattr = ARRAY_SIZE(drbd_tla_nl_policy)-1,
292+ .maxattr = ARRAY_SIZE(CONCAT_(GENL_MAGIC_FAMILY, _tla_nl_policy))-1,
293+ .policy = CONCAT_(GENL_MAGIC_FAMILY, _tla_nl_policy),
294294 .ops = ZZZ_genl_ops,
295295 .n_ops = ARRAY_SIZE(ZZZ_genl_ops),
296296 .mcgrps = ZZZ_genl_mcgrps,
include/linux/gfp.h+2−2
@@ -585,12 +585,12 @@ static inline bool pm_suspended_storage(void) · 584 unmodified lines
585585 }
586586 #endif /* CONFIG_PM_SLEEP */
587587
588−#if (defined(CONFIG_MEMORY_ISOLATION) && defined(CONFIG_COMPACTION)) || defined(CONFIG_CMA)
588+#ifdef CONFIG_CONTIG_ALLOC
589589 /* The below functions must be run on a range from a single zone. */
590590 extern int alloc_contig_range(unsigned long start, unsigned long end,
591591 unsigned migratetype, gfp_t gfp_mask);
592−extern void free_contig_range(unsigned long pfn, unsigned nr_pages);
593592 #endif
593+void free_contig_range(unsigned long pfn, unsigned int nr_pages);
594594
595595 #ifdef CONFIG_CMA
596596 /* CMA stuff */
include/linux/gpio/driver.h+12−6
@@ -227,9 +227,10 @@ struct gpio_irq_chip { · 226 unmodified lines
227227 * @reg_dat: data (in) register for generic GPIO
228228 * @reg_set: output set register (out=high) for generic GPIO
229229 * @reg_clr: output clear register (out=low) for generic GPIO
230− * @reg_dir: direction setting register for generic GPIO
231− * @bgpio_dir_inverted: indicates that the direction register is inverted
232− * (gpiolib private state variable)
230+ * @reg_dir_out: direction out setting register for generic GPIO
231+ * @reg_dir_in: direction in setting register for generic GPIO
232+ * @bgpio_dir_unreadable: indicates that the direction register(s) cannot
233+ * be read and we need to rely on out internal state tracking.
233234 * @bgpio_bits: number of register bits used for a generic GPIO i.e.
234235 * <register width> * 8
235236 * @bgpio_lock: used to lock chip->bgpio_data. Also, this is needed to keep
@@ -237,7 +238,8 @@ struct gpio_irq_chip { · 1 unmodified line
237238 * @bgpio_data: shadowed data register for generic GPIO to clear/set bits
238239 * safely.
239240 * @bgpio_dir: shadowed direction register for generic GPIO to clear/set
240− * direction safely.
241+ * direction safely. A "1" in this word means the line is set as
242+ * output.
241243 *
242244 * A gpio_chip can help platforms abstract various sources of GPIOs so
243245 * they can all be accessed through a common programing interface.
@@ -298,8 +300,9 @@ struct gpio_chip { · 54 unmodified lines
298300 void __iomem *reg_dat;
299301 void __iomem *reg_set;
300302 void __iomem *reg_clr;
301− void __iomem *reg_dir;
302− bool bgpio_dir_inverted;
303+ void __iomem *reg_dir_out;
304+ void __iomem *reg_dir_in;
305+ bool bgpio_dir_unreadable;
303306 int bgpio_bits;
304307 spinlock_t bgpio_lock;
305308 unsigned long bgpio_data;
@@ -614,6 +617,9 @@ struct gpio_desc *gpiochip_request_own_desc(struct gpio_chip *chip, u16 hwnum, · 308 unmodified lines
614617 enum gpiod_flags flags);
615618 void gpiochip_free_own_desc(struct gpio_desc *desc);
616619
620+void devprop_gpiochip_set_names(struct gpio_chip *chip,
621+ const struct fwnode_handle *fwnode);
622+
617623 #else /* CONFIG_GPIOLIB */
618624
619625 static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc)
include/linux/gpio/machine.h+14−12
@@ -6,14 +6,16 @@ · 5 unmodified lines
66 #include <linux/list.h>
77
88 enum gpio_lookup_flags {
9− GPIO_ACTIVE_HIGH = (0 << 0),
10− GPIO_ACTIVE_LOW = (1 << 0),
11− GPIO_OPEN_DRAIN = (1 << 1),
12− GPIO_OPEN_SOURCE = (1 << 2),
13− GPIO_PERSISTENT = (0 << 3),
14− GPIO_TRANSITORY = (1 << 3),
15− GPIO_PULL_UP = (1 << 4),
16− GPIO_PULL_DOWN = (1 << 5),
9+ GPIO_ACTIVE_HIGH = (0 << 0),
10+ GPIO_ACTIVE_LOW = (1 << 0),
11+ GPIO_OPEN_DRAIN = (1 << 1),
12+ GPIO_OPEN_SOURCE = (1 << 2),
13+ GPIO_PERSISTENT = (0 << 3),
14+ GPIO_TRANSITORY = (1 << 3),
15+ GPIO_PULL_UP = (1 << 4),
16+ GPIO_PULL_DOWN = (1 << 5),
17+
18+ GPIO_LOOKUP_FLAGS_DEFAULT = GPIO_ACTIVE_HIGH | GPIO_PERSISTENT,
1719 };
1820
1921 /**
@@ -22,7 +24,7 @@ enum gpio_lookup_flags { · 2 unmodified lines
2224 * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO
2325 * @con_id: name of the GPIO from the device's point of view
2426 * @idx: index of the GPIO in case several GPIOs share the same name
25− * @flags: mask of GPIO_* values
27+ * @flags: bitmask of gpio_lookup_flags GPIO_* values
2628 *
2729 * gpiod_lookup is a lookup table for associating GPIOs to specific devices and
2830 * functions using platform data.
@@ -32,7 +34,7 @@ struct gpiod_lookup { · 3 unmodified lines
3234 u16 chip_hwnum;
3335 const char *con_id;
3436 unsigned int idx;
35− enum gpio_lookup_flags flags;
37+ unsigned long flags;
3638 };
3739
3840 struct gpiod_lookup_table {
@@ -46,7 +48,7 @@ struct gpiod_lookup_table { · 7 unmodified lines
4648 * @chip_label: name of the chip the GPIO belongs to
4749 * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO
4850 * @line_name: consumer name for the hogged line
49− * @lflags: mask of GPIO lookup flags
51+ * @lflags: bitmask of gpio_lookup_flags GPIO_* values
5052 * @dflags: GPIO flags used to specify the direction and value
5153 */
5254 struct gpiod_hog {
@@ -54,7 +56,7 @@ struct gpiod_hog { · 1 unmodified line
5456 const char *chip_label;
5557 u16 chip_hwnum;
5658 const char *line_name;
57− enum gpio_lookup_flags lflags;
59+ unsigned long lflags;
5860 int dflags;
5961 };
6062
include/linux/hid.h+3−1
@@ -382,6 +382,7 @@ struct hid_item { · 381 unmodified lines
382382 #define HID_GROUP_WACOM 0x0101
383383 #define HID_GROUP_LOGITECH_DJ_DEVICE 0x0102
384384 #define HID_GROUP_STEAM 0x0103
385+#define HID_GROUP_LOGITECH_27MHZ_DEVICE 0x0104
385386
386387 /*
387388 * HID protocol status
@@ -417,6 +418,7 @@ struct hid_global { · 29 unmodified lines
417418
418419 struct hid_local {
419420 unsigned usage[HID_MAX_USAGES]; /* usage array */
421+ u8 usage_size[HID_MAX_USAGES]; /* usage size array */
420422 unsigned collection_index[HID_MAX_USAGES]; /* collection index array */
421423 unsigned usage_index;
422424 unsigned usage_minimum;
@@ -893,7 +895,7 @@ struct hid_field *hidinput_get_led_field(struct hid_device *hid); · 470 unmodified lines
893895 unsigned int hidinput_count_leds(struct hid_device *hid);
894896 __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code);
895897 void hid_output_report(struct hid_report *report, __u8 *data);
896−void __hid_request(struct hid_device *hid, struct hid_report *rep, int reqtype);
898+int __hid_request(struct hid_device *hid, struct hid_report *rep, int reqtype);
897899 u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags);
898900 struct hid_device *hid_allocate_device(void);
899901 struct hid_report *hid_register_report(struct hid_device *device,
include/linux/hmm.h+250−60
@@ -77,8 +77,34 @@ · 76 unmodified lines
7777 #include <linux/migrate.h>
7878 #include <linux/memremap.h>
7979 #include <linux/completion.h>
80+#include <linux/mmu_notifier.h>
8081
81−struct hmm;
82+
83+/*
84+ * struct hmm - HMM per mm struct
85+ *
86+ * @mm: mm struct this HMM struct is bound to
87+ * @lock: lock protecting ranges list
88+ * @ranges: list of range being snapshotted
89+ * @mirrors: list of mirrors for this mm
90+ * @mmu_notifier: mmu notifier to track updates to CPU page table
91+ * @mirrors_sem: read/write semaphore protecting the mirrors list
92+ * @wq: wait queue for user waiting on a range invalidation
93+ * @notifiers: count of active mmu notifiers
94+ * @dead: is the mm dead ?
95+ */
96+struct hmm {
97+ struct mm_struct *mm;
98+ struct kref kref;
99+ struct mutex lock;
100+ struct list_head ranges;
101+ struct list_head mirrors;
102+ struct mmu_notifier mmu_notifier;
103+ struct rw_semaphore mirrors_sem;
104+ wait_queue_head_t wq;
105+ long notifiers;
106+ bool dead;
107+};
82108
83109 /*
84110 * hmm_pfn_flag_e - HMM flag enums
@@ -131,6 +157,7 @@ enum hmm_pfn_value_e { · 46 unmodified lines
131157 /*
132158 * struct hmm_range - track invalidation lock on virtual address range
133159 *
160+ * @hmm: the core HMM structure this range is active against
134161 * @vma: the vm area struct for the range
135162 * @list: all range lock are on a list
136163 * @start: range virtual start address (inclusive)
@@ -138,10 +165,13 @@ enum hmm_pfn_value_e { · 1 unmodified line
138165 * @pfns: array of pfns (big enough for the range)
139166 * @flags: pfn flags to match device driver page table
140167 * @values: pfn value for some special case (none, special, error, ...)
168+ * @default_flags: default flags for the range (write, read, ... see hmm doc)
169+ * @pfn_flags_mask: allows to mask pfn flags so that only default_flags matter
141170 * @pfn_shifts: pfn shift value (should be <= PAGE_SHIFT)
142171 * @valid: pfns array did not change since it has been fill by an HMM function
143172 */
144173 struct hmm_range {
174+ struct hmm *hmm;
145175 struct vm_area_struct *vma;
146176 struct list_head list;
147177 unsigned long start;
@@ -149,41 +179,96 @@ struct hmm_range { · 1 unmodified line
149179 uint64_t *pfns;
150180 const uint64_t *flags;
151181 const uint64_t *values;
182+ uint64_t default_flags;
183+ uint64_t pfn_flags_mask;
184+ uint8_t page_shift;
152185 uint8_t pfn_shift;
153186 bool valid;
154187 };
155188
156189 /*
157− * hmm_pfn_to_page() - return struct page pointed to by a valid HMM pfn
158− * @range: range use to decode HMM pfn value
159− * @pfn: HMM pfn value to get corresponding struct page from
160− * Returns: struct page pointer if pfn is a valid HMM pfn, NULL otherwise
190+ * hmm_range_page_shift() - return the page shift for the range
191+ * @range: range being queried
192+ * Returns: page shift (page size = 1 << page shift) for the range
193+ */
194+static inline unsigned hmm_range_page_shift(const struct hmm_range *range)
195+{
196+ return range->page_shift;
197+}
198+
199+/*
200+ * hmm_range_page_size() - return the page size for the range
201+ * @range: range being queried
202+ * Returns: page size for the range in bytes
203+ */
204+static inline unsigned long hmm_range_page_size(const struct hmm_range *range)
205+{
206+ return 1UL << hmm_range_page_shift(range);
207+}
208+
209+/*
210+ * hmm_range_wait_until_valid() - wait for range to be valid
211+ * @range: range affected by invalidation to wait on
212+ * @timeout: time out for wait in ms (ie abort wait after that period of time)
213+ * Returns: true if the range is valid, false otherwise.
214+ */
215+static inline bool hmm_range_wait_until_valid(struct hmm_range *range,
216+ unsigned long timeout)
217+{
218+ /* Check if mm is dead ? */
219+ if (range->hmm == NULL || range->hmm->dead || range->hmm->mm == NULL) {
220+ range->valid = false;
221+ return false;
222+ }
223+ if (range->valid)
224+ return true;
225+ wait_event_timeout(range->hmm->wq, range->valid || range->hmm->dead,
226+ msecs_to_jiffies(timeout));
227+ /* Return current valid status just in case we get lucky */
228+ return range->valid;
229+}
230+
231+/*
232+ * hmm_range_valid() - test if a range is valid or not
233+ * @range: range
234+ * Returns: true if the range is valid, false otherwise.
235+ */
236+static inline bool hmm_range_valid(struct hmm_range *range)
237+{
238+ return range->valid;
239+}
240+
241+/*
242+ * hmm_device_entry_to_page() - return struct page pointed to by a device entry
243+ * @range: range use to decode device entry value
244+ * @entry: device entry value to get corresponding struct page from
245+ * Returns: struct page pointer if entry is a valid, NULL otherwise
161246 *
162− * If the HMM pfn is valid (ie valid flag set) then return the struct page
163− * matching the pfn value stored in the HMM pfn. Otherwise return NULL.
247+ * If the device entry is valid (ie valid flag set) then return the struct page
248+ * matching the entry value. Otherwise return NULL.
164249 */
165−static inline struct page *hmm_pfn_to_page(const struct hmm_range *range,
166− uint64_t pfn)
250+static inline struct page *hmm_device_entry_to_page(const struct hmm_range *range,
251+ uint64_t entry)
167252 {
168− if (pfn == range->values[HMM_PFN_NONE])
253+ if (entry == range->values[HMM_PFN_NONE])
169254 return NULL;
170− if (pfn == range->values[HMM_PFN_ERROR])
255+ if (entry == range->values[HMM_PFN_ERROR])
171256 return NULL;
172− if (pfn == range->values[HMM_PFN_SPECIAL])
257+ if (entry == range->values[HMM_PFN_SPECIAL])
173258 return NULL;
174− if (!(pfn & range->flags[HMM_PFN_VALID]))
259+ if (!(entry & range->flags[HMM_PFN_VALID]))
175260 return NULL;
176− return pfn_to_page(pfn >> range->pfn_shift);
261+ return pfn_to_page(entry >> range->pfn_shift);
177262 }
178263
179264 /*
180− * hmm_pfn_to_pfn() - return pfn value store in a HMM pfn
181− * @range: range use to decode HMM pfn value
182− * @pfn: HMM pfn value to extract pfn from
183− * Returns: pfn value if HMM pfn is valid, -1UL otherwise
265+ * hmm_device_entry_to_pfn() - return pfn value store in a device entry
266+ * @range: range use to decode device entry value
267+ * @entry: device entry to extract pfn from
268+ * Returns: pfn value if device entry is valid, -1UL otherwise
184269 */
185−static inline unsigned long hmm_pfn_to_pfn(const struct hmm_range *range,
186− uint64_t pfn)
270+static inline unsigned long
271+hmm_device_entry_to_pfn(const struct hmm_range *range, uint64_t pfn)
187272 {
188273 if (pfn == range->values[HMM_PFN_NONE])
189274 return -1UL;
@@ -197,31 +282,66 @@ static inline unsigned long hmm_pfn_to_pfn(const struct hmm_range *range, · 7 unmodified lines
197282 }
198283
199284 /*
200− * hmm_pfn_from_page() - create a valid HMM pfn value from struct page
285+ * hmm_device_entry_from_page() - create a valid device entry for a page
201286 * @range: range use to encode HMM pfn value
202− * @page: struct page pointer for which to create the HMM pfn
203− * Returns: valid HMM pfn for the page
287+ * @page: page for which to create the device entry
288+ * Returns: valid device entry for the page
204289 */
205−static inline uint64_t hmm_pfn_from_page(const struct hmm_range *range,
206− struct page *page)
290+static inline uint64_t hmm_device_entry_from_page(const struct hmm_range *range,
291+ struct page *page)
207292 {
208293 return (page_to_pfn(page) << range->pfn_shift) |
209294 range->flags[HMM_PFN_VALID];
210295 }
211296
212297 /*
213− * hmm_pfn_from_pfn() - create a valid HMM pfn value from pfn
298+ * hmm_device_entry_from_pfn() - create a valid device entry value from pfn
214299 * @range: range use to encode HMM pfn value
215− * @pfn: pfn value for which to create the HMM pfn
216− * Returns: valid HMM pfn for the pfn
300+ * @pfn: pfn value for which to create the device entry
301+ * Returns: valid device entry for the pfn
217302 */
218−static inline uint64_t hmm_pfn_from_pfn(const struct hmm_range *range,
219− unsigned long pfn)
303+static inline uint64_t hmm_device_entry_from_pfn(const struct hmm_range *range,
304+ unsigned long pfn)
220305 {
221306 return (pfn << range->pfn_shift) |
222307 range->flags[HMM_PFN_VALID];
223308 }
224309
310+/*
311+ * Old API:
312+ * hmm_pfn_to_page()
313+ * hmm_pfn_to_pfn()
314+ * hmm_pfn_from_page()
315+ * hmm_pfn_from_pfn()
316+ *
317+ * This are the OLD API please use new API, it is here to avoid cross-tree
318+ * merge painfullness ie we convert things to new API in stages.
319+ */
320+static inline struct page *hmm_pfn_to_page(const struct hmm_range *range,
321+ uint64_t pfn)
322+{
323+ return hmm_device_entry_to_page(range, pfn);
324+}
325+
326+static inline unsigned long hmm_pfn_to_pfn(const struct hmm_range *range,
327+ uint64_t pfn)
328+{
329+ return hmm_device_entry_to_pfn(range, pfn);
330+}
331+
332+static inline uint64_t hmm_pfn_from_page(const struct hmm_range *range,
333+ struct page *page)
334+{
335+ return hmm_device_entry_from_page(range, page);
336+}
337+
338+static inline uint64_t hmm_pfn_from_pfn(const struct hmm_range *range,
339+ unsigned long pfn)
340+{
341+ return hmm_device_entry_from_pfn(range, pfn);
342+}
343+
344+
225345
226346 #if IS_ENABLED(CONFIG_HMM_MIRROR)
227347 /*
@@ -353,43 +473,113 @@ struct hmm_mirror { · 125 unmodified lines
353473 int hmm_mirror_register(struct hmm_mirror *mirror, struct mm_struct *mm);
354474 void hmm_mirror_unregister(struct hmm_mirror *mirror);
355475
356−
357476 /*
358− * To snapshot the CPU page table, call hmm_vma_get_pfns(), then take a device
359− * driver lock that serializes device page table updates, then call
360− * hmm_vma_range_done(), to check if the snapshot is still valid. The same
361− * device driver page table update lock must also be used in the
362− * hmm_mirror_ops.sync_cpu_device_pagetables() callback, so that CPU page
363− * table invalidation serializes on it.
364− *
365− * YOU MUST CALL hmm_vma_range_done() ONCE AND ONLY ONCE EACH TIME YOU CALL
366− * hmm_vma_get_pfns() WITHOUT ERROR !
367− *
368− * IF YOU DO NOT FOLLOW THE ABOVE RULE THE SNAPSHOT CONTENT MIGHT BE INVALID !
477+ * hmm_mirror_mm_is_alive() - test if mm is still alive
478+ * @mirror: the HMM mm mirror for which we want to lock the mmap_sem
479+ * Returns: false if the mm is dead, true otherwise
480+ *
481+ * This is an optimization it will not accurately always return -EINVAL if the
482+ * mm is dead ie there can be false negative (process is being kill but HMM is
483+ * not yet inform of that). It is only intented to be use to optimize out case
484+ * where driver is about to do something time consuming and it would be better
485+ * to skip it if the mm is dead.
369486 */
370−int hmm_vma_get_pfns(struct hmm_range *range);
371−bool hmm_vma_range_done(struct hmm_range *range);
487+static inline bool hmm_mirror_mm_is_alive(struct hmm_mirror *mirror)
488+{
489+ struct mm_struct *mm;
490+
491+ if (!mirror || !mirror->hmm)
492+ return false;
493+ mm = READ_ONCE(mirror->hmm->mm);
494+ if (mirror->hmm->dead || !mm)
495+ return false;
496+
497+ return true;
498+}
372499
373500
374501 /*
375− * Fault memory on behalf of device driver. Unlike handle_mm_fault(), this will
376− * not migrate any device memory back to system memory. The HMM pfn array will
377− * be updated with the fault result and current snapshot of the CPU page table
378− * for the range.
379− *
380− * The mmap_sem must be taken in read mode before entering and it might be
381− * dropped by the function if the block argument is false. In that case, the
382− * function returns -EAGAIN.
383− *
384− * Return value does not reflect if the fault was successful for every single
385− * address or not. Therefore, the caller must to inspect the HMM pfn array to
386− * determine fault status for each address.
387− *
388− * Trying to fault inside an invalid vma will result in -EINVAL.
502+ * Please see Documentation/vm/hmm.rst for how to use the range API.
503+ */
504+int hmm_range_register(struct hmm_range *range,
505+ struct mm_struct *mm,
506+ unsigned long start,
507+ unsigned long end,
508+ unsigned page_shift);
509+void hmm_range_unregister(struct hmm_range *range);
510+long hmm_range_snapshot(struct hmm_range *range);
511+long hmm_range_fault(struct hmm_range *range, bool block);
512+long hmm_range_dma_map(struct hmm_range *range,
513+ struct device *device,
514+ dma_addr_t *daddrs,
515+ bool block);
516+long hmm_range_dma_unmap(struct hmm_range *range,
517+ struct vm_area_struct *vma,
518+ struct device *device,
519+ dma_addr_t *daddrs,
520+ bool dirty);
521+
522+/*
523+ * HMM_RANGE_DEFAULT_TIMEOUT - default timeout (ms) when waiting for a range
389524 *
390− * See the function description in mm/hmm.c for further documentation.
525+ * When waiting for mmu notifiers we need some kind of time out otherwise we
526+ * could potentialy wait for ever, 1000ms ie 1s sounds like a long time to
527+ * wait already.
391528 */
392−int hmm_vma_fault(struct hmm_range *range, bool block);
529+#define HMM_RANGE_DEFAULT_TIMEOUT 1000
530+
531+/* This is a temporary helper to avoid merge conflict between trees. */
532+static inline bool hmm_vma_range_done(struct hmm_range *range)
533+{
534+ bool ret = hmm_range_valid(range);
535+
536+ hmm_range_unregister(range);
537+ return ret;
538+}
539+
540+/* This is a temporary helper to avoid merge conflict between trees. */
541+static inline int hmm_vma_fault(struct hmm_range *range, bool block)
542+{
543+ long ret;
544+
545+ /*
546+ * With the old API the driver must set each individual entries with
547+ * the requested flags (valid, write, ...). So here we set the mask to
548+ * keep intact the entries provided by the driver and zero out the
549+ * default_flags.
550+ */
551+ range->default_flags = 0;
552+ range->pfn_flags_mask = -1UL;
553+
554+ ret = hmm_range_register(range, range->vma->vm_mm,
555+ range->start, range->end,
556+ PAGE_SHIFT);
557+ if (ret)
558+ return (int)ret;
559+
560+ if (!hmm_range_wait_until_valid(range, HMM_RANGE_DEFAULT_TIMEOUT)) {
561+ /*
562+ * The mmap_sem was taken by driver we release it here and
563+ * returns -EAGAIN which correspond to mmap_sem have been
564+ * drop in the old API.
565+ */
566+ up_read(&range->vma->vm_mm->mmap_sem);
567+ return -EAGAIN;
568+ }
569+
570+ ret = hmm_range_fault(range, block);
571+ if (ret <= 0) {
572+ if (ret == -EBUSY || !ret) {
573+ /* Same as above drop mmap_sem to match old API. */
574+ up_read(&range->vma->vm_mm->mmap_sem);
575+ ret = -EBUSY;
576+ } else if (ret == -EAGAIN)
577+ ret = -EBUSY;
578+ hmm_range_unregister(range);
579+ return ret;
580+ }
581+ return 0;
582+}
393583
394584 /* Below are for HMM internal use only! Not to be used by device driver! */
395585 void hmm_mm_destroy(struct mm_struct *mm);
include/linux/huge_mm.h+2−4
@@ -47,10 +47,8 @@ extern bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr, · 46 unmodified lines
4747 extern int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
4848 unsigned long addr, pgprot_t newprot,
4949 int prot_numa);
50−vm_fault_t vmf_insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,
51− pmd_t *pmd, pfn_t pfn, bool write);
52−vm_fault_t vmf_insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
53− pud_t *pud, pfn_t pfn, bool write);
50+vm_fault_t vmf_insert_pfn_pmd(struct vm_fault *vmf, pfn_t pfn, bool write);
51+vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, pfn_t pfn, bool write);
5452 enum transparent_hugepage_flag {
5553 TRANSPARENT_HUGEPAGE_FLAG,
5654 TRANSPARENT_HUGEPAGE_REQ_MADV_FLAG,
include/linux/hugetlb.h+1−3
@@ -123,9 +123,7 @@ void move_hugetlb_state(struct page *oldpage, struct page *newpage, int reason); · 122 unmodified lines
123123 void free_huge_page(struct page *page);
124124 void hugetlb_fix_reserve_counts(struct inode *inode);
125125 extern struct mutex *hugetlb_fault_mutex_table;
126−u32 hugetlb_fault_mutex_hash(struct hstate *h, struct mm_struct *mm,
127− struct vm_area_struct *vma,
128− struct address_space *mapping,
126+u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping,
129127 pgoff_t idx, unsigned long address);
130128
131129 pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud);
include/linux/hwmon.h+18−0
@@ -40,6 +40,11 @@ enum hwmon_chip_attributes { · 39 unmodified lines
4040 hwmon_chip_register_tz,
4141 hwmon_chip_update_interval,
4242 hwmon_chip_alarms,
43+ hwmon_chip_samples,
44+ hwmon_chip_curr_samples,
45+ hwmon_chip_in_samples,
46+ hwmon_chip_power_samples,
47+ hwmon_chip_temp_samples,
4348 };
4449
4550 #define HWMON_C_TEMP_RESET_HISTORY BIT(hwmon_chip_temp_reset_history)
@@ -49,6 +54,11 @@ enum hwmon_chip_attributes { · 3 unmodified lines
4954 #define HWMON_C_REGISTER_TZ BIT(hwmon_chip_register_tz)
5055 #define HWMON_C_UPDATE_INTERVAL BIT(hwmon_chip_update_interval)
5156 #define HWMON_C_ALARMS BIT(hwmon_chip_alarms)
57+#define HWMON_C_SAMPLES BIT(hwmon_chip_samples)
58+#define HWMON_C_CURR_SAMPLES BIT(hwmon_chip_curr_samples)
59+#define HWMON_C_IN_SAMPLES BIT(hwmon_chip_in_samples)
60+#define HWMON_C_POWER_SAMPLES BIT(hwmon_chip_power_samples)
61+#define HWMON_C_TEMP_SAMPLES BIT(hwmon_chip_temp_samples)
5262
5363 enum hwmon_temp_attributes {
5464 hwmon_temp_input = 0,
@@ -365,6 +375,14 @@ struct hwmon_channel_info { · 310 unmodified lines
365375 const u32 *config;
366376 };
367377
378+#define HWMON_CHANNEL_INFO(stype, ...) \
379+ (&(struct hwmon_channel_info) { \
380+ .type = hwmon_##stype, \
381+ .config = (u32 []) { \
382+ __VA_ARGS__, 0 \
383+ } \
384+ })
385+
368386 /**
369387 * Chip configuration
370388 * @ops: Pointer to hwmon operations.
include/linux/hyperv.h+6−1
@@ -141,6 +141,11 @@ struct hv_ring_buffer_info { · 140 unmodified lines
141141
142142 u32 ring_datasize; /* < ring_size */
143143 u32 priv_read_index;
144+ /*
145+ * The ring buffer mutex lock. This lock prevents the ring buffer from
146+ * being freed while the ring buffer is being accessed.
147+ */
148+ struct mutex ring_buffer_mutex;
144149 };
145150
146151
@@ -1206,7 +1211,7 @@ struct hv_ring_buffer_debug_info { · 1059 unmodified lines
12061211 };
12071212
12081213
1209−int hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info,
1214+int hv_ringbuffer_get_debuginfo(struct hv_ring_buffer_info *ring_info,
12101215 struct hv_ring_buffer_debug_info *debug_info);
12111216
12121217 /* Vmbus interface */
include/linux/i2c-algo-bit.h+1−0
@@ -33,6 +33,7 @@ struct i2c_algo_bit_data { · 32 unmodified lines
3333 minimum 5 us for standard-mode I2C and SMBus,
3434 maximum 50 us for SMBus */
3535 int timeout; /* in jiffies */
36+ bool can_do_atomic; /* callbacks don't sleep, we can be atomic */
3637 };
3738
3839 int i2c_bit_add_bus(struct i2c_adapter *);
include/linux/i2c.h+30−14
@@ -469,6 +469,9 @@ extern int i2c_probe_func_quick_read(struct i2c_adapter *, unsigned short addr); · 468 unmodified lines
469469 extern struct i2c_client *
470470 i2c_new_dummy(struct i2c_adapter *adap, u16 address);
471471
472+extern struct i2c_client *
473+devm_i2c_new_dummy_device(struct device *dev, struct i2c_adapter *adap, u16 address);
474+
472475 extern struct i2c_client *
473476 i2c_new_secondary_device(struct i2c_client *client,
474477 const char *name,
@@ -499,9 +502,13 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info, · 24 unmodified lines
499502 * @master_xfer: Issue a set of i2c transactions to the given I2C adapter
500503 * defined by the msgs array, with num messages available to transfer via
501504 * the adapter specified by adap.
505+ * @master_xfer_atomic: same as @master_xfer. Yet, only using atomic context
506+ * so e.g. PMICs can be accessed very late before shutdown. Optional.
502507 * @smbus_xfer: Issue smbus transactions to the given I2C adapter. If this
503508 * is not present, then the bus layer will try and convert the SMBus calls
504509 * into I2C transfers instead.
510+ * @smbus_xfer_atomic: same as @smbus_xfer. Yet, only using atomic context
511+ * so e.g. PMICs can be accessed very late before shutdown. Optional.
505512 * @functionality: Return the flags that this algorithm/adapter pair supports
506513 * from the I2C_FUNC_* flags.
507514 * @reg_slave: Register given client to I2C slave mode of this adapter
@@ -512,25 +519,33 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info, · 4 unmodified lines
512519 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
513520 * to name two of the most common.
514521 *
515− * The return codes from the @master_xfer field should indicate the type of
516− * error code that occurred during the transfer, as documented in the kernel
517− * Documentation file Documentation/i2c/fault-codes.
522+ * The return codes from the @master_xfer{_atomic} fields should indicate the
523+ * type of error code that occurred during the transfer, as documented in the
524+ * Kernel Documentation file Documentation/i2c/fault-codes.
518525 */
519526 struct i2c_algorithm {
520− /* If an adapter algorithm can't do I2C-level access, set master_xfer
521− to NULL. If an adapter algorithm can do SMBus access, set
522− smbus_xfer. If set to NULL, the SMBus protocol is simulated
523− using common I2C messages */
524− /* master_xfer should return the number of messages successfully
525− processed, or a negative value on error */
527+ /*
528+ * If an adapter algorithm can't do I2C-level access, set master_xfer
529+ * to NULL. If an adapter algorithm can do SMBus access, set
530+ * smbus_xfer. If set to NULL, the SMBus protocol is simulated
531+ * using common I2C messages.
532+ *
533+ * master_xfer should return the number of messages successfully
534+ * processed, or a negative value on error
535+ */
526536 int (*master_xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs,
527537 int num);
528− int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,
529− unsigned short flags, char read_write,
530− u8 command, int size, union i2c_smbus_data *data);
538+ int (*master_xfer_atomic)(struct i2c_adapter *adap,
539+ struct i2c_msg *msgs, int num);
540+ int (*smbus_xfer)(struct i2c_adapter *adap, u16 addr,
541+ unsigned short flags, char read_write,
542+ u8 command, int size, union i2c_smbus_data *data);
543+ int (*smbus_xfer_atomic)(struct i2c_adapter *adap, u16 addr,
544+ unsigned short flags, char read_write,
545+ u8 command, int size, union i2c_smbus_data *data);
531546
532547 /* To determine what the adapter supports */
533− u32 (*functionality) (struct i2c_adapter *);
548+ u32 (*functionality)(struct i2c_adapter *adap);
534549
535550 #if IS_ENABLED(CONFIG_I2C_SLAVE)
536551 int (*reg_slave)(struct i2c_client *client);
@@ -682,7 +697,8 @@ struct i2c_adapter { · 145 unmodified lines
682697 int retries;
683698 struct device dev; /* the adapter device */
684699 unsigned long locked_flags; /* owned by the I2C core */
685−#define I2C_ALF_IS_SUSPENDED 0
700+#define I2C_ALF_IS_SUSPENDED 0
701+#define I2C_ALF_SUSPEND_REPORTED 1
686702
687703 int nr;
688704 char name[48];
include/linux/ieee80211.h+9−5
@@ -1557,7 +1557,7 @@ struct ieee80211_vht_operation { · 1556 unmodified lines
15571557 * struct ieee80211_he_cap_elem - HE capabilities element
15581558 *
15591559 * This structure is the "HE capabilities element" fixed fields as
1560− * described in P802.11ax_D3.0 section 9.4.2.237.2 and 9.4.2.237.3
1560+ * described in P802.11ax_D4.0 section 9.4.2.242.2 and 9.4.2.242.3
15611561 */
15621562 struct ieee80211_he_cap_elem {
15631563 u8 mac_cap_info[6];
@@ -1619,12 +1619,12 @@ struct ieee80211_he_mcs_nss_supp { · 55 unmodified lines
16191619 * struct ieee80211_he_operation - HE capabilities element
16201620 *
16211621 * This structure is the "HE operation element" fields as
1622− * described in P802.11ax_D3.0 section 9.4.2.238
1622+ * described in P802.11ax_D4.0 section 9.4.2.243
16231623 */
16241624 struct ieee80211_he_operation {
16251625 __le32 he_oper_params;
16261626 __le16 he_mcs_nss_set;
1627− /* Optional 0,1,3 or 4 bytes: depends on @he_oper_params */
1627+ /* Optional 0,1,3,4,5,7 or 8 bytes: depends on @he_oper_params */
16281628 u8 optional[0];
16291629 } __packed;
16301630
@@ -1632,7 +1632,7 @@ struct ieee80211_he_operation { · 1 unmodified line
16321632 * struct ieee80211_he_mu_edca_param_ac_rec - MU AC Parameter Record field
16331633 *
16341634 * This structure is the "MU AC Parameter Record" fields as
1635− * described in P802.11ax_D2.0 section 9.4.2.240
1635+ * described in P802.11ax_D4.0 section 9.4.2.245
16361636 */
16371637 struct ieee80211_he_mu_edca_param_ac_rec {
16381638 u8 aifsn;
@@ -1644,7 +1644,7 @@ struct ieee80211_he_mu_edca_param_ac_rec { · 5 unmodified lines
16441644 * struct ieee80211_mu_edca_param_set - MU EDCA Parameter Set element
16451645 *
16461646 * This structure is the "MU EDCA Parameter Set element" fields as
1647− * described in P802.11ax_D2.0 section 9.4.2.240
1647+ * described in P802.11ax_D4.0 section 9.4.2.245
16481648 */
16491649 struct ieee80211_mu_edca_param_set {
16501650 u8 mu_qos_info;
@@ -2026,6 +2026,7 @@ ieee80211_he_ppe_size(u8 ppe_thres_hdr, const u8 *phy_cap_info) · 375 unmodified lines
20262026 #define IEEE80211_HE_OPERATION_VHT_OPER_INFO 0x00004000
20272027 #define IEEE80211_HE_OPERATION_CO_HOSTED_BSS 0x00008000
20282028 #define IEEE80211_HE_OPERATION_ER_SU_DISABLE 0x00010000
2029+#define IEEE80211_HE_OPERATION_6GHZ_OP_INFO 0x00020000
20292030 #define IEEE80211_HE_OPERATION_BSS_COLOR_MASK 0x3f000000
20302031 #define IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET 24
20312032 #define IEEE80211_HE_OPERATION_PARTIAL_BSS_COLOR 0x40000000
@@ -2056,6 +2057,8 @@ ieee80211_he_oper_size(const u8 *he_oper_ie) · 24 unmodified lines
20562057 oper_len += 3;
20572058 if (he_oper_params & IEEE80211_HE_OPERATION_CO_HOSTED_BSS)
20582059 oper_len++;
2060+ if (he_oper_params & IEEE80211_HE_OPERATION_6GHZ_OP_INFO)
2061+ oper_len += 4;
20592062
20602063 /* Add the first byte (extension ID) to the total length */
20612064 oper_len++;
@@ -2487,6 +2490,7 @@ enum ieee80211_eid_ext { · 425 unmodified lines
24872490 WLAN_EID_EXT_HE_MU_EDCA = 38,
24882491 WLAN_EID_EXT_MAX_CHANNEL_SWITCH_TIME = 52,
24892492 WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION = 55,
2493+ WLAN_EID_EXT_NON_INHERITANCE = 56,
24902494 };
24912495
24922496 /* Action category code */
include/linux/if_bridge.h+0−3
@@ -56,9 +56,6 @@ struct br_ip_list { · 55 unmodified lines
5656
5757 extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
5858
59−typedef int br_should_route_hook_t(struct sk_buff *skb);
60−extern br_should_route_hook_t __rcu *br_should_route_hook;
61−
6259 #if IS_ENABLED(CONFIG_BRIDGE) && IS_ENABLED(CONFIG_BRIDGE_IGMP_SNOOPING)
6360 int br_multicast_list_adjacent(struct net_device *dev,
6461 struct list_head *br_ip_list);
include/linux/iio/adc/ad_sigma_delta.h+1−0
@@ -69,6 +69,7 @@ struct ad_sigma_delta { · 68 unmodified lines
6969 bool irq_dis;
7070
7171 bool bus_locked;
72+ bool keep_cs_asserted;
7273
7374 uint8_t comm;
7475
include/linux/iio/consumer.h+14−0
@@ -290,6 +290,20 @@ int iio_read_max_channel_raw(struct iio_channel *chan, int *val); · 289 unmodified lines
290290 int iio_read_avail_channel_raw(struct iio_channel *chan,
291291 const int **vals, int *length);
292292
293+/**
294+ * iio_read_avail_channel_attribute() - read available channel attribute values
295+ * @chan: The channel being queried.
296+ * @vals: Available values read back.
297+ * @type: Type of values read back.
298+ * @length: Number of entries in vals.
299+ * @attribute: info attribute to be read back.
300+ *
301+ * Returns an error code, IIO_AVAIL_RANGE or IIO_AVAIL_LIST.
302+ */
303+int iio_read_avail_channel_attribute(struct iio_channel *chan,
304+ const int **vals, int *type, int *length,
305+ enum iio_chan_info_enum attribute);
306+
293307 /**
294308 * iio_get_channel_type() - get the type of a channel
295309 * @channel: The channel being queried.
include/linux/iio/driver.h+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #ifndef _IIO_INKERN_H_
1212 #define _IIO_INKERN_H_
1313
14+struct iio_dev;
1415 struct iio_map;
1516
1617 /**
include/linux/iio/frequency/ad9523.h+4−4
@@ -129,8 +129,8 @@ enum cpole1_capacitor { · 128 unmodified lines
129129 * @pll2_ndiv_b_cnt: PLL2 Feedback N-divider, B Counter, range 0..63.
130130 * @pll2_freq_doubler_en: PLL2 frequency doubler enable.
131131 * @pll2_r2_div: PLL2 R2 divider, range 0..31.
132− * @pll2_vco_diff_m1: VCO1 divider, range 3..5.
133− * @pll2_vco_diff_m2: VCO2 divider, range 3..5.
132+ * @pll2_vco_div_m1: VCO1 divider, range 3..5.
133+ * @pll2_vco_div_m2: VCO2 divider, range 3..5.
134134 * @rpole2: PLL2 loop filter Rpole resistor value.
135135 * @rzero: PLL2 loop filter Rzero resistor value.
136136 * @cpole1: PLL2 loop filter Cpole capacitor value.
@@ -176,8 +176,8 @@ struct ad9523_platform_data { · 39 unmodified lines
176176 unsigned char pll2_ndiv_b_cnt;
177177 bool pll2_freq_doubler_en;
178178 unsigned char pll2_r2_div;
179− unsigned char pll2_vco_diff_m1; /* 3..5 */
180− unsigned char pll2_vco_diff_m2; /* 3..5 */
179+ unsigned char pll2_vco_div_m1; /* 3..5 */
180+ unsigned char pll2_vco_div_m2; /* 3..5 */
181181
182182 /* Loop Filter PLL2 */
183183 enum rpole2_resistor rpole2;
include/linux/iio/gyro/itg3200.h+1−0
@@ -104,6 +104,7 @@ · 103 unmodified lines
104104 struct itg3200 {
105105 struct i2c_client *i2c;
106106 struct iio_trigger *trig;
107+ struct iio_mount_matrix orientation;
107108 };
108109
109110 enum ITG3200_SCAN_INDEX {
include/linux/iio/iio.h+2−2
@@ -130,8 +130,8 @@ struct iio_mount_matrix { · 129 unmodified lines
130130
131131 ssize_t iio_show_mount_matrix(struct iio_dev *indio_dev, uintptr_t priv,
132132 const struct iio_chan_spec *chan, char *buf);
133−int of_iio_read_mount_matrix(const struct device *dev, const char *propname,
134− struct iio_mount_matrix *matrix);
133+int iio_read_mount_matrix(struct device *dev, const char *propname,
134+ struct iio_mount_matrix *matrix);
135135
136136 typedef const struct iio_mount_matrix *
137137 (iio_get_mount_matrix_t)(const struct iio_dev *indio_dev,
include/linux/iio/imu/adis.h+14−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #define ADIS_REG_PAGE_ID 0x00
2222
2323 struct adis;
24+struct adis_burst;
2425
2526 /**
2627 * struct adis_data - ADIS chip variant specific data
@@ -57,6 +58,7 @@ struct adis { · 30 unmodified lines
5758 struct iio_trigger *trig;
5859
5960 const struct adis_data *data;
61+ struct adis_burst *burst;
6062
6163 struct mutex txrx_lock;
6264 struct spi_message msg;
@@ -232,6 +234,18 @@ int adis_single_conversion(struct iio_dev *indio_dev, · 169 unmodified lines
232234
233235 #ifdef CONFIG_IIO_ADIS_LIB_BUFFER
234236
237+/**
238+ * struct adis_burst - ADIS data for burst transfers
239+ * @en burst mode enabled
240+ * @reg_cmd register command that triggers burst
241+ * @extra_len extra length to account in the SPI RX buffer
242+ */
243+struct adis_burst {
244+ bool en;
245+ unsigned int reg_cmd;
246+ unsigned int extra_len;
247+};
248+
235249 int adis_setup_buffer_and_trigger(struct adis *adis,
236250 struct iio_dev *indio_dev, irqreturn_t (*trigger_handler)(int, void *));
237251 void adis_cleanup_buffer_and_trigger(struct adis *adis,
include/linux/iio/timer/stm32-timer-trigger.h+10−1
@@ -73,6 +73,15 @@ · 72 unmodified lines
7373
7474 #define TIM17_OC1 "tim17_oc1"
7575
76+#if IS_REACHABLE(CONFIG_IIO_STM32_TIMER_TRIGGER)
7677 bool is_stm32_timer_trigger(struct iio_trigger *trig);
77−
78+#else
79+static inline bool is_stm32_timer_trigger(struct iio_trigger *trig)
80+{
81+#if IS_ENABLED(CONFIG_IIO_STM32_TIMER_TRIGGER)
82+ pr_warn_once("stm32-timer-trigger not linked in\n");
83+#endif
84+ return false;
85+}
86+#endif
7887 #endif
include/linux/ima.h+1−1
@@ -31,7 +31,7 @@ extern void ima_post_path_mknod(struct dentry *dentry); · 30 unmodified lines
3131 extern void ima_add_kexec_buffer(struct kimage *image);
3232 #endif
3333
34−#if defined(CONFIG_X86) && defined(CONFIG_EFI)
34+#if (defined(CONFIG_X86) && defined(CONFIG_EFI)) || defined(CONFIG_S390)
3535 extern bool arch_ima_get_secureboot(void);
3636 extern const char * const *arch_get_ima_policy(void);
3737 #else
include/linux/inetdevice.h+14−0
@@ -237,6 +237,20 @@ static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev) · 236 unmodified lines
237237 return rtnl_dereference(dev->ip_ptr);
238238 }
239239
240+/* called with rcu_read_lock or rtnl held */
241+static inline bool ip_ignore_linkdown(const struct net_device *dev)
242+{
243+ struct in_device *in_dev;
244+ bool rc = false;
245+
246+ in_dev = rcu_dereference_rtnl(dev->ip_ptr);
247+ if (in_dev &&
248+ IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN(in_dev))
249+ rc = true;
250+
251+ return rc;
252+}
253+
240254 static inline struct neigh_parms *__in_dev_arp_parms_get_rcu(const struct net_device *dev)
241255 {
242256 struct in_device *in_dev = __in_dev_get_rcu(dev);
include/linux/intel-iommu.h+12−1
@@ -489,9 +489,11 @@ struct dmar_domain { · 488 unmodified lines
489489 /* Domain ids per IOMMU. Use u16 since
490490 * domain ids are 16 bit wide according
491491 * to VT-d spec, section 9.3 */
492+ unsigned int auxd_refcnt; /* Refcount of auxiliary attaching */
492493
493494 bool has_iotlb_device;
494495 struct list_head devices; /* all devices' list */
496+ struct list_head auxd; /* link to device's auxiliary list */
495497 struct iova_domain iovad; /* iova's that belong to this domain */
496498
497499 struct dma_pte *pgd; /* virtual address */
@@ -510,6 +512,11 @@ struct dmar_domain { · 12 unmodified lines
510512 2 == 1GiB, 3 == 512GiB, 4 == 1TiB */
511513 u64 max_addr; /* maximum mapped address */
512514
515+ int default_pasid; /*
516+ * The default pasid used for non-SVM
517+ * traffic on mediated devices.
518+ */
519+
513520 struct iommu_domain domain; /* generic domain data structure for
514521 iommu core */
515522 };
@@ -559,6 +566,9 @@ struct device_domain_info { · 43 unmodified lines
559566 struct list_head link; /* link to domain siblings */
560567 struct list_head global; /* link to global list */
561568 struct list_head table; /* link to pasid table */
569+ struct list_head auxiliary_domains; /* auxiliary domains
570+ * attached to this device
571+ */
562572 u8 bus; /* PCI bus number */
563573 u8 devfn; /* PCI devfn number */
564574 u16 pfsid; /* SRIOV physical function source ID */
@@ -568,6 +578,7 @@ struct device_domain_info { · 3 unmodified lines
568578 u8 pri_enabled:1;
569579 u8 ats_supported:1;
570580 u8 ats_enabled:1;
581+ u8 auxd_enabled:1; /* Multiple domains per device */
571582 u8 ats_qdep;
572583 struct device *dev; /* it's NULL for PCIe-to-PCI bridge */
573584 struct intel_iommu *iommu; /* IOMMU used by this device */
@@ -650,6 +661,7 @@ struct intel_iommu *domain_get_iommu(struct dmar_domain *domain); · 76 unmodified lines
650661 int for_each_device_domain(int (*fn)(struct device_domain_info *info,
651662 void *data), void *data);
652663 void iommu_flush_write_buffer(struct intel_iommu *iommu);
664+int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct device *dev);
653665
654666 #ifdef CONFIG_INTEL_IOMMU_SVM
655667 int intel_svm_init(struct intel_iommu *iommu);
@@ -679,7 +691,6 @@ struct intel_svm { · 23 unmodified lines
679691 struct list_head list;
680692 };
681693
682−extern int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct intel_svm_dev *sdev);
683694 extern struct intel_iommu *intel_svm_device_to_iommu(struct device *dev);
684695 #endif
685696
include/linux/intel-ish-client-if.h+112−0
@@ -0,0 +1,112 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Intel ISH client Interface definitions
4+ *
5+ * Copyright (c) 2019, Intel Corporation.
6+ */
7+
8+#ifndef _INTEL_ISH_CLIENT_IF_H_
9+#define _INTEL_ISH_CLIENT_IF_H_
10+
11+struct ishtp_cl_device;
12+struct ishtp_device;
13+struct ishtp_cl;
14+struct ishtp_fw_client;
15+
16+/* Client state */
17+enum cl_state {
18+ ISHTP_CL_INITIALIZING = 0,
19+ ISHTP_CL_CONNECTING,
20+ ISHTP_CL_CONNECTED,
21+ ISHTP_CL_DISCONNECTING,
22+ ISHTP_CL_DISCONNECTED
23+};
24+
25+/**
26+ * struct ishtp_cl_device - ISHTP device handle
27+ * @driver: driver instance on a bus
28+ * @name: Name of the device for probe
29+ * @probe: driver callback for device probe
30+ * @remove: driver callback on device removal
31+ *
32+ * Client drivers defines to get probed/removed for ISHTP client device.
33+ */
34+struct ishtp_cl_driver {
35+ struct device_driver driver;
36+ const char *name;
37+ const guid_t *guid;
38+ int (*probe)(struct ishtp_cl_device *dev);
39+ int (*remove)(struct ishtp_cl_device *dev);
40+ int (*reset)(struct ishtp_cl_device *dev);
41+ const struct dev_pm_ops *pm;
42+};
43+
44+/**
45+ * struct ishtp_msg_data - ISHTP message data struct
46+ * @size: Size of data in the *data
47+ * @data: Pointer to data
48+ */
49+struct ishtp_msg_data {
50+ uint32_t size;
51+ unsigned char *data;
52+};
53+
54+/*
55+ * struct ishtp_cl_rb - request block structure
56+ * @list: Link to list members
57+ * @cl: ISHTP client instance
58+ * @buffer: message header
59+ * @buf_idx: Index into buffer
60+ * @read_time: unused at this time
61+ */
62+struct ishtp_cl_rb {
63+ struct list_head list;
64+ struct ishtp_cl *cl;
65+ struct ishtp_msg_data buffer;
66+ unsigned long buf_idx;
67+ unsigned long read_time;
68+};
69+
70+int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
71+ struct module *owner);
72+void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);
73+int ishtp_register_event_cb(struct ishtp_cl_device *device,
74+ void (*read_cb)(struct ishtp_cl_device *));
75+
76+/* Get the device * from ishtp device instance */
77+struct device *ishtp_device(struct ishtp_cl_device *cl_device);
78+/* Trace interface for clients */
79+void *ishtp_trace_callback(struct ishtp_cl_device *cl_device);
80+/* Get device pointer of PCI device for DMA acces */
81+struct device *ishtp_get_pci_device(struct ishtp_cl_device *cl_device);
82+
83+struct ishtp_cl *ishtp_cl_allocate(struct ishtp_cl_device *cl_device);
84+void ishtp_cl_free(struct ishtp_cl *cl);
85+int ishtp_cl_link(struct ishtp_cl *cl);
86+void ishtp_cl_unlink(struct ishtp_cl *cl);
87+int ishtp_cl_disconnect(struct ishtp_cl *cl);
88+int ishtp_cl_connect(struct ishtp_cl *cl);
89+int ishtp_cl_send(struct ishtp_cl *cl, uint8_t *buf, size_t length);
90+int ishtp_cl_flush_queues(struct ishtp_cl *cl);
91+int ishtp_cl_io_rb_recycle(struct ishtp_cl_rb *rb);
92+bool ishtp_cl_tx_empty(struct ishtp_cl *cl);
93+struct ishtp_cl_rb *ishtp_cl_rx_get_rb(struct ishtp_cl *cl);
94+void *ishtp_get_client_data(struct ishtp_cl *cl);
95+void ishtp_set_client_data(struct ishtp_cl *cl, void *data);
96+struct ishtp_device *ishtp_get_ishtp_device(struct ishtp_cl *cl);
97+void ishtp_set_tx_ring_size(struct ishtp_cl *cl, int size);
98+void ishtp_set_rx_ring_size(struct ishtp_cl *cl, int size);
99+void ishtp_set_connection_state(struct ishtp_cl *cl, int state);
100+void ishtp_cl_set_fw_client_id(struct ishtp_cl *cl, int fw_client_id);
101+
102+void ishtp_put_device(struct ishtp_cl_device *cl_dev);
103+void ishtp_get_device(struct ishtp_cl_device *cl_dev);
104+void ishtp_set_drvdata(struct ishtp_cl_device *cl_device, void *data);
105+void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device);
106+int ishtp_register_event_cb(struct ishtp_cl_device *device,
107+ void (*read_cb)(struct ishtp_cl_device *));
108+struct ishtp_fw_client *ishtp_fw_cl_get_client(struct ishtp_device *dev,
109+ const guid_t *uuid);
110+int ishtp_get_fw_client_id(struct ishtp_fw_client *fw_client);
111+int ish_hw_reset(struct ishtp_device *dev);
112+#endif /* _INTEL_ISH_CLIENT_IF_H_ */
include/linux/interrupt.h+0−25
@@ -668,31 +668,6 @@ extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu); · 667 unmodified lines
668668 extern void tasklet_init(struct tasklet_struct *t,
669669 void (*func)(unsigned long), unsigned long data);
670670
671−struct tasklet_hrtimer {
672− struct hrtimer timer;
673− struct tasklet_struct tasklet;
674− enum hrtimer_restart (*function)(struct hrtimer *);
675−};
676−
677−extern void
678−tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
679− enum hrtimer_restart (*function)(struct hrtimer *),
680− clockid_t which_clock, enum hrtimer_mode mode);
681−
682−static inline
683−void tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time,
684− const enum hrtimer_mode mode)
685−{
686− hrtimer_start(&ttimer->timer, time, mode);
687−}
688−
689−static inline
690−void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer)
691−{
692− hrtimer_cancel(&ttimer->timer);
693− tasklet_kill(&ttimer->tasklet);
694−}
695−
696671 /*
697672 * Autoprobing for irqs:
698673 *
include/linux/iomap.h+17−5
@@ -53,6 +53,8 @@ struct vm_fault; · 52 unmodified lines
5353 */
5454 #define IOMAP_NULL_ADDR -1ULL /* addr is not valid */
5555
56+struct iomap_page_ops;
57+
5658 struct iomap {
5759 u64 addr; /* disk offset of mapping, bytes */
5860 loff_t offset; /* file offset of mapping, bytes */
@@ -63,12 +65,22 @@ struct iomap { · 4 unmodified lines
6365 struct dax_device *dax_dev; /* dax_dev for dax operations */
6466 void *inline_data;
6567 void *private; /* filesystem private */
68+ const struct iomap_page_ops *page_ops;
69+};
6670
67− /*
68− * Called when finished processing a page in the mapping returned in
69− * this iomap. At least for now this is only supported in the buffered
70− * write path.
71− */
71+/*
72+ * When a filesystem sets page_ops in an iomap mapping it returns, page_prepare
73+ * and page_done will be called for each page written to. This only applies to
74+ * buffered writes as unbuffered writes will not typically have pages
75+ * associated with them.
76+ *
77+ * When page_prepare succeeds, page_done will always be called to do any
78+ * cleanup work necessary. In that page_done call, @page will be NULL if the
79+ * associated page could not be obtained.
80+ */
81+struct iomap_page_ops {
82+ int (*page_prepare)(struct inode *inode, loff_t pos, unsigned len,
83+ struct iomap *iomap);
7284 void (*page_done)(struct inode *inode, loff_t pos, unsigned copied,
7385 struct page *page, struct iomap *iomap);
7486 };
include/linux/iommu.h+144−0
@@ -48,6 +48,7 @@ struct bus_type; · 47 unmodified lines
4848 struct device;
4949 struct iommu_domain;
5050 struct notifier_block;
51+struct iommu_sva;
5152
5253 /* iommu fault flags */
5354 #define IOMMU_FAULT_READ 0x0
@@ -55,6 +56,8 @@ struct notifier_block; · 1 unmodified line
5556
5657 typedef int (*iommu_fault_handler_t)(struct iommu_domain *,
5758 struct device *, unsigned long, int, void *);
59+typedef int (*iommu_mm_exit_handler_t)(struct device *dev, struct iommu_sva *,
60+ void *);
5861
5962 struct iommu_domain_geometry {
6063 dma_addr_t aperture_start; /* First address that can be mapped */
@@ -156,6 +159,33 @@ struct iommu_resv_region { · 95 unmodified lines
156159 enum iommu_resv_type type;
157160 };
158161
162+/* Per device IOMMU features */
163+enum iommu_dev_features {
164+ IOMMU_DEV_FEAT_AUX, /* Aux-domain feature */
165+ IOMMU_DEV_FEAT_SVA, /* Shared Virtual Addresses */
166+};
167+
168+#define IOMMU_PASID_INVALID (-1U)
169+
170+/**
171+ * struct iommu_sva_ops - device driver callbacks for an SVA context
172+ *
173+ * @mm_exit: called when the mm is about to be torn down by exit_mmap. After
174+ * @mm_exit returns, the device must not issue any more transaction
175+ * with the PASID given as argument.
176+ *
177+ * The @mm_exit handler is allowed to sleep. Be careful about the
178+ * locks taken in @mm_exit, because they might lead to deadlocks if
179+ * they are also held when dropping references to the mm. Consider the
180+ * following call chain:
181+ * mutex_lock(A); mmput(mm) -> exit_mm() -> @mm_exit() -> mutex_lock(A)
182+ * Using mmput_async() prevents this scenario.
183+ *
184+ */
185+struct iommu_sva_ops {
186+ iommu_mm_exit_handler_t mm_exit;
187+};
188+
159189 #ifdef CONFIG_IOMMU_API
160190
161191 /**
@@ -186,6 +216,14 @@ struct iommu_resv_region { · 24 unmodified lines
186216 * @of_xlate: add OF master IDs to iommu grouping
187217 * @is_attach_deferred: Check if domain attach should be deferred from iommu
188218 * driver init to device driver init (default no)
219+ * @dev_has/enable/disable_feat: per device entries to check/enable/disable
220+ * iommu specific features.
221+ * @dev_feat_enabled: check enabled feature
222+ * @aux_attach/detach_dev: aux-domain specific attach/detach entries.
223+ * @aux_get_pasid: get the pasid given an aux-domain
224+ * @sva_bind: Bind process address space to device
225+ * @sva_unbind: Unbind process address space from device
226+ * @sva_get_pasid: Get PASID associated to a SVA handle
189227 * @pgsize_bitmap: bitmap of all possible supported page sizes
190228 */
191229 struct iommu_ops {
@@ -230,6 +268,22 @@ struct iommu_ops { · 38 unmodified lines
230268 int (*of_xlate)(struct device *dev, struct of_phandle_args *args);
231269 bool (*is_attach_deferred)(struct iommu_domain *domain, struct device *dev);
232270
271+ /* Per device IOMMU features */
272+ bool (*dev_has_feat)(struct device *dev, enum iommu_dev_features f);
273+ bool (*dev_feat_enabled)(struct device *dev, enum iommu_dev_features f);
274+ int (*dev_enable_feat)(struct device *dev, enum iommu_dev_features f);
275+ int (*dev_disable_feat)(struct device *dev, enum iommu_dev_features f);
276+
277+ /* Aux-domain specific attach/detach entries */
278+ int (*aux_attach_dev)(struct iommu_domain *domain, struct device *dev);
279+ void (*aux_detach_dev)(struct iommu_domain *domain, struct device *dev);
280+ int (*aux_get_pasid)(struct iommu_domain *domain, struct device *dev);
281+
282+ struct iommu_sva *(*sva_bind)(struct device *dev, struct mm_struct *mm,
283+ void *drvdata);
284+ void (*sva_unbind)(struct iommu_sva *handle);
285+ int (*sva_get_pasid)(struct iommu_sva *handle);
286+
233287 unsigned long pgsize_bitmap;
234288 };
235289
@@ -392,10 +446,22 @@ struct iommu_fwspec { · 156 unmodified lines
392446 const struct iommu_ops *ops;
393447 struct fwnode_handle *iommu_fwnode;
394448 void *iommu_priv;
449+ u32 flags;
395450 unsigned int num_ids;
396451 u32 ids[1];
397452 };
398453
454+/* ATS is supported */
455+#define IOMMU_FWSPEC_PCI_RC_ATS (1 << 0)
456+
457+/**
458+ * struct iommu_sva - handle to a device-mm bond
459+ */
460+struct iommu_sva {
461+ struct device *dev;
462+ const struct iommu_sva_ops *ops;
463+};
464+
399465 int iommu_fwspec_init(struct device *dev, struct fwnode_handle *iommu_fwnode,
400466 const struct iommu_ops *ops);
401467 void iommu_fwspec_free(struct device *dev);
@@ -416,6 +482,22 @@ static inline void dev_iommu_fwspec_set(struct device *dev, · 14 unmodified lines
416482 int iommu_probe_device(struct device *dev);
417483 void iommu_release_device(struct device *dev);
418484
485+bool iommu_dev_has_feature(struct device *dev, enum iommu_dev_features f);
486+int iommu_dev_enable_feature(struct device *dev, enum iommu_dev_features f);
487+int iommu_dev_disable_feature(struct device *dev, enum iommu_dev_features f);
488+bool iommu_dev_feature_enabled(struct device *dev, enum iommu_dev_features f);
489+int iommu_aux_attach_device(struct iommu_domain *domain, struct device *dev);
490+void iommu_aux_detach_device(struct iommu_domain *domain, struct device *dev);
491+int iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev);
492+
493+struct iommu_sva *iommu_sva_bind_device(struct device *dev,
494+ struct mm_struct *mm,
495+ void *drvdata);
496+void iommu_sva_unbind_device(struct iommu_sva *handle);
497+int iommu_sva_set_ops(struct iommu_sva *handle,
498+ const struct iommu_sva_ops *ops);
499+int iommu_sva_get_pasid(struct iommu_sva *handle);
500+
419501 #else /* CONFIG_IOMMU_API */
420502
421503 struct iommu_ops {};
@@ -700,6 +782,68 @@ const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode) · 278 unmodified lines
700782 return NULL;
701783 }
702784
785+static inline bool
786+iommu_dev_has_feature(struct device *dev, enum iommu_dev_features feat)
787+{
788+ return false;
789+}
790+
791+static inline bool
792+iommu_dev_feature_enabled(struct device *dev, enum iommu_dev_features feat)
793+{
794+ return false;
795+}
796+
797+static inline int
798+iommu_dev_enable_feature(struct device *dev, enum iommu_dev_features feat)
799+{
800+ return -ENODEV;
801+}
802+
803+static inline int
804+iommu_dev_disable_feature(struct device *dev, enum iommu_dev_features feat)
805+{
806+ return -ENODEV;
807+}
808+
809+static inline int
810+iommu_aux_attach_device(struct iommu_domain *domain, struct device *dev)
811+{
812+ return -ENODEV;
813+}
814+
815+static inline void
816+iommu_aux_detach_device(struct iommu_domain *domain, struct device *dev)
817+{
818+}
819+
820+static inline int
821+iommu_aux_get_pasid(struct iommu_domain *domain, struct device *dev)
822+{
823+ return -ENODEV;
824+}
825+
826+static inline struct iommu_sva *
827+iommu_sva_bind_device(struct device *dev, struct mm_struct *mm, void *drvdata)
828+{
829+ return NULL;
830+}
831+
832+static inline void iommu_sva_unbind_device(struct iommu_sva *handle)
833+{
834+}
835+
836+static inline int iommu_sva_set_ops(struct iommu_sva *handle,
837+ const struct iommu_sva_ops *ops)
838+{
839+ return -EINVAL;
840+}
841+
842+static inline int iommu_sva_get_pasid(struct iommu_sva *handle)
843+{
844+ return IOMMU_PASID_INVALID;
845+}
846+
703847 #endif /* CONFIG_IOMMU_API */
704848
705849 #ifdef CONFIG_IOMMU_DEBUGFS
include/linux/iova.h+8−8
@@ -76,6 +76,14 @@ struct iova_domain { · 75 unmodified lines
7676 unsigned long start_pfn; /* Lower limit for this domain */
7777 unsigned long dma_32bit_pfn;
7878 unsigned long max32_alloc_size; /* Size of last failed allocation */
79+ struct iova_fq __percpu *fq; /* Flush Queue */
80+
81+ atomic64_t fq_flush_start_cnt; /* Number of TLB flushes that
82+ have been started */
83+
84+ atomic64_t fq_flush_finish_cnt; /* Number of TLB flushes that
85+ have been finished */
86+
7987 struct iova anchor; /* rbtree lookup anchor */
8088 struct iova_rcache rcaches[IOVA_RANGE_CACHE_MAX_SIZE]; /* IOVA range caches */
8189
@@ -85,14 +93,6 @@ struct iova_domain { · 3 unmodified lines
8593 iova_entry_dtor entry_dtor; /* IOMMU driver specific destructor for
8694 iova entry */
8795
88− struct iova_fq __percpu *fq; /* Flush Queue */
89−
90− atomic64_t fq_flush_start_cnt; /* Number of TLB flushes that
91− have been started */
92−
93− atomic64_t fq_flush_finish_cnt; /* Number of TLB flushes that
94− have been finished */
95−
9696 struct timer_list fq_timer; /* Timer to regularily empty the
9797 flush-queues */
9898 atomic_t fq_timer_on; /* 1 when timer is active, 0
include/linux/ipc_namespace.h+1−0
@@ -19,6 +19,7 @@ struct ipc_ids { · 18 unmodified lines
1919 struct rw_semaphore rwsem;
2020 struct idr ipcs_idr;
2121 int max_idx;
22+ int last_idx; /* For wrap around detection */
2223 #ifdef CONFIG_CHECKPOINT_RESTORE
2324 int next_id;
2425 #endif
include/linux/irq.h+2−0
@@ -625,6 +625,8 @@ extern int irq_chip_set_wake_parent(struct irq_data *data, unsigned int on); · 624 unmodified lines
625625 extern int irq_chip_set_vcpu_affinity_parent(struct irq_data *data,
626626 void *vcpu_info);
627627 extern int irq_chip_set_type_parent(struct irq_data *data, unsigned int type);
628+extern int irq_chip_request_resources_parent(struct irq_data *data);
629+extern void irq_chip_release_resources_parent(struct irq_data *data);
628630 #endif
629631
630632 /* Handling of unhandled and spurious interrupts: */
include/linux/irqchip/arm-gic-v3.h+6−6
@@ -165,7 +165,7 @@ · 164 unmodified lines
165165 #define GICR_PROPBASER_nCnB GIC_BASER_CACHEABILITY(GICR_PROPBASER, INNER, nCnB)
166166 #define GICR_PROPBASER_nC GIC_BASER_CACHEABILITY(GICR_PROPBASER, INNER, nC)
167167 #define GICR_PROPBASER_RaWt GIC_BASER_CACHEABILITY(GICR_PROPBASER, INNER, RaWt)
168−#define GICR_PROPBASER_RaWb GIC_BASER_CACHEABILITY(GICR_PROPBASER, INNER, RaWt)
168+#define GICR_PROPBASER_RaWb GIC_BASER_CACHEABILITY(GICR_PROPBASER, INNER, RaWb)
169169 #define GICR_PROPBASER_WaWt GIC_BASER_CACHEABILITY(GICR_PROPBASER, INNER, WaWt)
170170 #define GICR_PROPBASER_WaWb GIC_BASER_CACHEABILITY(GICR_PROPBASER, INNER, WaWb)
171171 #define GICR_PROPBASER_RaWaWt GIC_BASER_CACHEABILITY(GICR_PROPBASER, INNER, RaWaWt)
@@ -192,7 +192,7 @@ · 20 unmodified lines
192192 #define GICR_PENDBASER_nCnB GIC_BASER_CACHEABILITY(GICR_PENDBASER, INNER, nCnB)
193193 #define GICR_PENDBASER_nC GIC_BASER_CACHEABILITY(GICR_PENDBASER, INNER, nC)
194194 #define GICR_PENDBASER_RaWt GIC_BASER_CACHEABILITY(GICR_PENDBASER, INNER, RaWt)
195−#define GICR_PENDBASER_RaWb GIC_BASER_CACHEABILITY(GICR_PENDBASER, INNER, RaWt)
195+#define GICR_PENDBASER_RaWb GIC_BASER_CACHEABILITY(GICR_PENDBASER, INNER, RaWb)
196196 #define GICR_PENDBASER_WaWt GIC_BASER_CACHEABILITY(GICR_PENDBASER, INNER, WaWt)
197197 #define GICR_PENDBASER_WaWb GIC_BASER_CACHEABILITY(GICR_PENDBASER, INNER, WaWb)
198198 #define GICR_PENDBASER_RaWaWt GIC_BASER_CACHEABILITY(GICR_PENDBASER, INNER, RaWaWt)
@@ -251,7 +251,7 @@ · 52 unmodified lines
251251 #define GICR_VPROPBASER_nCnB GIC_BASER_CACHEABILITY(GICR_VPROPBASER, INNER, nCnB)
252252 #define GICR_VPROPBASER_nC GIC_BASER_CACHEABILITY(GICR_VPROPBASER, INNER, nC)
253253 #define GICR_VPROPBASER_RaWt GIC_BASER_CACHEABILITY(GICR_VPROPBASER, INNER, RaWt)
254−#define GICR_VPROPBASER_RaWb GIC_BASER_CACHEABILITY(GICR_VPROPBASER, INNER, RaWt)
254+#define GICR_VPROPBASER_RaWb GIC_BASER_CACHEABILITY(GICR_VPROPBASER, INNER, RaWb)
255255 #define GICR_VPROPBASER_WaWt GIC_BASER_CACHEABILITY(GICR_VPROPBASER, INNER, WaWt)
256256 #define GICR_VPROPBASER_WaWb GIC_BASER_CACHEABILITY(GICR_VPROPBASER, INNER, WaWb)
257257 #define GICR_VPROPBASER_RaWaWt GIC_BASER_CACHEABILITY(GICR_VPROPBASER, INNER, RaWaWt)
@@ -277,7 +277,7 @@ · 19 unmodified lines
277277 #define GICR_VPENDBASER_nCnB GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, nCnB)
278278 #define GICR_VPENDBASER_nC GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, nC)
279279 #define GICR_VPENDBASER_RaWt GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, RaWt)
280−#define GICR_VPENDBASER_RaWb GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, RaWt)
280+#define GICR_VPENDBASER_RaWb GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, RaWb)
281281 #define GICR_VPENDBASER_WaWt GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, WaWt)
282282 #define GICR_VPENDBASER_WaWb GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, WaWb)
283283 #define GICR_VPENDBASER_RaWaWt GIC_BASER_CACHEABILITY(GICR_VPENDBASER, INNER, RaWaWt)
@@ -351,7 +351,7 @@ · 67 unmodified lines
351351 #define GITS_CBASER_nCnB GIC_BASER_CACHEABILITY(GITS_CBASER, INNER, nCnB)
352352 #define GITS_CBASER_nC GIC_BASER_CACHEABILITY(GITS_CBASER, INNER, nC)
353353 #define GITS_CBASER_RaWt GIC_BASER_CACHEABILITY(GITS_CBASER, INNER, RaWt)
354−#define GITS_CBASER_RaWb GIC_BASER_CACHEABILITY(GITS_CBASER, INNER, RaWt)
354+#define GITS_CBASER_RaWb GIC_BASER_CACHEABILITY(GITS_CBASER, INNER, RaWb)
355355 #define GITS_CBASER_WaWt GIC_BASER_CACHEABILITY(GITS_CBASER, INNER, WaWt)
356356 #define GITS_CBASER_WaWb GIC_BASER_CACHEABILITY(GITS_CBASER, INNER, WaWb)
357357 #define GITS_CBASER_RaWaWt GIC_BASER_CACHEABILITY(GITS_CBASER, INNER, RaWaWt)
@@ -377,7 +377,7 @@ · 19 unmodified lines
377377 #define GITS_BASER_nCnB GIC_BASER_CACHEABILITY(GITS_BASER, INNER, nCnB)
378378 #define GITS_BASER_nC GIC_BASER_CACHEABILITY(GITS_BASER, INNER, nC)
379379 #define GITS_BASER_RaWt GIC_BASER_CACHEABILITY(GITS_BASER, INNER, RaWt)
380−#define GITS_BASER_RaWb GIC_BASER_CACHEABILITY(GITS_BASER, INNER, RaWt)
380+#define GITS_BASER_RaWb GIC_BASER_CACHEABILITY(GITS_BASER, INNER, RaWb)
381381 #define GITS_BASER_WaWt GIC_BASER_CACHEABILITY(GITS_BASER, INNER, WaWt)
382382 #define GITS_BASER_WaWb GIC_BASER_CACHEABILITY(GITS_BASER, INNER, WaWb)
383383 #define GITS_BASER_RaWaWt GIC_BASER_CACHEABILITY(GITS_BASER, INNER, RaWaWt)
include/linux/irqchip/irq-ixp4xx.h+12−0
@@ -0,0 +1,12 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __IRQ_IXP4XX_H
3+#define __IRQ_IXP4XX_H
4+
5+#include <linux/ioport.h>
6+struct irq_domain;
7+
8+void ixp4xx_irq_init(resource_size_t irqbase,
9+ bool is_356);
10+struct irq_domain *ixp4xx_get_irq_domain(void);
11+
12+#endif /* __IRQ_IXP4XX_H */
include/linux/irqdomain.h+1−0
@@ -82,6 +82,7 @@ enum irq_domain_bus_token { · 81 unmodified lines
8282 DOMAIN_BUS_NEXUS,
8383 DOMAIN_BUS_IPI,
8484 DOMAIN_BUS_FSL_MC_MSI,
85+ DOMAIN_BUS_TI_SCI_INTA_MSI,
8586 };
8687
8788 /**
include/linux/jbd2.h+5−4
@@ -1318,7 +1318,7 @@ extern void __wait_on_journal (journal_t *); · 1317 unmodified lines
13181318
13191319 /* Transaction cache support */
13201320 extern void jbd2_journal_destroy_transaction_cache(void);
1321−extern int jbd2_journal_init_transaction_cache(void);
1321+extern int __init jbd2_journal_init_transaction_cache(void);
13221322 extern void jbd2_journal_free_transaction(transaction_t *);
13231323
13241324 /*
@@ -1446,8 +1446,10 @@ static inline void jbd2_free_inode(struct jbd2_inode *jinode) · 121 unmodified lines
14461446 /* Primary revoke support */
14471447 #define JOURNAL_REVOKE_DEFAULT_HASH 256
14481448 extern int jbd2_journal_init_revoke(journal_t *, int);
1449−extern void jbd2_journal_destroy_revoke_caches(void);
1450−extern int jbd2_journal_init_revoke_caches(void);
1449+extern void jbd2_journal_destroy_revoke_record_cache(void);
1450+extern void jbd2_journal_destroy_revoke_table_cache(void);
1451+extern int __init jbd2_journal_init_revoke_record_cache(void);
1452+extern int __init jbd2_journal_init_revoke_table_cache(void);
14511453
14521454 extern void jbd2_journal_destroy_revoke(journal_t *);
14531455 extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *);
@@ -1606,7 +1608,6 @@ static inline u32 jbd2_chksum(journal_t *journal, u32 crc, · 152 unmodified lines
16061608 JBD_MAX_CHECKSUM_SIZE);
16071609
16081610 desc.shash.tfm = journal->j_chksum_driver;
1609− desc.shash.flags = 0;
16101611 *(u32 *)desc.ctx = crc;
16111612
16121613 err = crypto_shash_update(&desc.shash, address, length);
include/linux/jiffies.h+1−0
@@ -297,6 +297,7 @@ static inline u64 jiffies_to_nsecs(const unsigned long j) · 296 unmodified lines
297297 }
298298
299299 extern u64 jiffies64_to_nsecs(u64 j);
300+extern u64 jiffies64_to_msecs(u64 j);
300301
301302 extern unsigned long __msecs_to_jiffies(const unsigned int m);
302303 #if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ)
include/linux/jump_label_ratelimit.h+61−3
@@ -12,21 +12,79 @@ struct static_key_deferred { · 11 unmodified lines
1212 struct delayed_work work;
1313 };
1414
15−extern void static_key_slow_dec_deferred(struct static_key_deferred *key);
16−extern void static_key_deferred_flush(struct static_key_deferred *key);
15+struct static_key_true_deferred {
16+ struct static_key_true key;
17+ unsigned long timeout;
18+ struct delayed_work work;
19+};
20+
21+struct static_key_false_deferred {
22+ struct static_key_false key;
23+ unsigned long timeout;
24+ struct delayed_work work;
25+};
26+
27+#define static_key_slow_dec_deferred(x) \
28+ __static_key_slow_dec_deferred(&(x)->key, &(x)->work, (x)->timeout)
29+#define static_branch_slow_dec_deferred(x) \
30+ __static_key_slow_dec_deferred(&(x)->key.key, &(x)->work, (x)->timeout)
31+
32+#define static_key_deferred_flush(x) \
33+ __static_key_deferred_flush((x), &(x)->work)
34+
35+extern void
36+__static_key_slow_dec_deferred(struct static_key *key,
37+ struct delayed_work *work,
38+ unsigned long timeout);
39+extern void __static_key_deferred_flush(void *key, struct delayed_work *work);
1740 extern void
1841 jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
1942
43+extern void jump_label_update_timeout(struct work_struct *work);
44+
45+#define DEFINE_STATIC_KEY_DEFERRED_TRUE(name, rl) \
46+ struct static_key_true_deferred name = { \
47+ .key = { STATIC_KEY_INIT_TRUE }, \
48+ .timeout = (rl), \
49+ .work = __DELAYED_WORK_INITIALIZER((name).work, \
50+ jump_label_update_timeout, \
51+ 0), \
52+ }
53+
54+#define DEFINE_STATIC_KEY_DEFERRED_FALSE(name, rl) \
55+ struct static_key_false_deferred name = { \
56+ .key = { STATIC_KEY_INIT_FALSE }, \
57+ .timeout = (rl), \
58+ .work = __DELAYED_WORK_INITIALIZER((name).work, \
59+ jump_label_update_timeout, \
60+ 0), \
61+ }
62+
63+#define static_branch_deferred_inc(x) static_branch_inc(&(x)->key)
64+
2065 #else /* !CONFIG_JUMP_LABEL */
2166 struct static_key_deferred {
2267 struct static_key key;
2368 };
69+struct static_key_true_deferred {
70+ struct static_key_true key;
71+};
72+struct static_key_false_deferred {
73+ struct static_key_false key;
74+};
75+#define DEFINE_STATIC_KEY_DEFERRED_TRUE(name, rl) \
76+ struct static_key_true_deferred name = { STATIC_KEY_TRUE_INIT }
77+#define DEFINE_STATIC_KEY_DEFERRED_FALSE(name, rl) \
78+ struct static_key_false_deferred name = { STATIC_KEY_FALSE_INIT }
79+
80+#define static_branch_slow_dec_deferred(x) static_branch_dec(&(x)->key)
81+
2482 static inline void static_key_slow_dec_deferred(struct static_key_deferred *key)
2583 {
2684 STATIC_KEY_CHECK_USE(key);
2785 static_key_slow_dec(&key->key);
2886 }
29−static inline void static_key_deferred_flush(struct static_key_deferred *key)
87+static inline void static_key_deferred_flush(void *key)
3088 {
3189 STATIC_KEY_CHECK_USE(key);
3290 }
include/linux/kernel.h+3−12
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <asm/byteorder.h>
1818 #include <asm/div64.h>
1919 #include <uapi/linux/kernel.h>
20+#include <asm/div64.h>
2021
2122 #define STACK_MAGIC 0xdeadbeef
2223
@@ -175,18 +176,7 @@ · 152 unmodified lines
175176 #define _RET_IP_ (unsigned long)__builtin_return_address(0)
176177 #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
177178
178−#ifdef CONFIG_LBDAF
179−# define sector_div(a, b) do_div(a, b)
180−#else
181−# define sector_div(n, b)( \
182−{ \
183− int _res; \
184− _res = (n) % (b); \
185− (n) /= (b); \
186− _res; \
187−} \
188−)
189−#endif
179+#define sector_div(a, b) do_div(a, b)
190180
191181 /**
192182 * upper_32_bits - return bits 32-63 of a number
@@ -494,6 +484,7 @@ extern int __kernel_text_address(unsigned long addr); · 301 unmodified lines
494484 extern int kernel_text_address(unsigned long addr);
495485 extern int func_ptr_is_kernel_text(void *ptr);
496486
487+u64 int_pow(u64 base, unsigned int exp);
497488 unsigned long int_sqrt(unsigned long);
498489
499490 #if BITS_PER_LONG < 64
include/linux/kernfs.h+14−1
@@ -64,7 +64,7 @@ enum kernfs_root_flag { · 63 unmodified lines
6464 KERNFS_ROOT_CREATE_DEACTIVATED = 0x0001,
6565
6666 /*
67− * For regular flies, if the opener has CAP_DAC_OVERRIDE, open(2)
67+ * For regular files, if the opener has CAP_DAC_OVERRIDE, open(2)
6868 * succeeds regardless of the RW permissions. sysfs had an extra
6969 * layer of enforcement where open(2) fails with -EACCES regardless
7070 * of CAP_DAC_OVERRIDE if the permission doesn't have the
@@ -371,6 +371,11 @@ __poll_t kernfs_generic_poll(struct kernfs_open_file *of, · 300 unmodified lines
371371 struct poll_table_struct *pt);
372372 void kernfs_notify(struct kernfs_node *kn);
373373
374+int kernfs_xattr_get(struct kernfs_node *kn, const char *name,
375+ void *value, size_t size);
376+int kernfs_xattr_set(struct kernfs_node *kn, const char *name,
377+ const void *value, size_t size, int flags);
378+
374379 const void *kernfs_super_ns(struct super_block *sb);
375380 int kernfs_get_tree(struct fs_context *fc);
376381 void kernfs_free_fs_context(struct fs_context *fc);
@@ -473,6 +478,14 @@ static inline int kernfs_setattr(struct kernfs_node *kn, · 96 unmodified lines
473478
474479 static inline void kernfs_notify(struct kernfs_node *kn) { }
475480
481+static inline int kernfs_xattr_get(struct kernfs_node *kn, const char *name,
482+ void *value, size_t size)
483+{ return -ENOSYS; }
484+
485+static inline int kernfs_xattr_set(struct kernfs_node *kn, const char *name,
486+ const void *value, size_t size, int flags)
487+{ return -ENOSYS; }
488+
476489 static inline const void *kernfs_super_ns(struct super_block *sb)
477490 { return NULL; }
478491
include/linux/kobject.h+2−1
@@ -139,7 +139,8 @@ static inline bool kobject_has_children(struct kobject *kobj) · 138 unmodified lines
139139 struct kobj_type {
140140 void (*release)(struct kobject *kobj);
141141 const struct sysfs_ops *sysfs_ops;
142− struct attribute **default_attrs;
142+ struct attribute **default_attrs; /* use default_groups instead */
143+ const struct attribute_group **default_groups;
143144 const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj);
144145 const void *(*namespace)(struct kobject *kobj);
145146 void (*get_ownership)(struct kobject *kobj, kuid_t *uid, kgid_t *gid);
include/linux/kprobes.h+1−0
@@ -173,6 +173,7 @@ struct kretprobe_instance { · 172 unmodified lines
173173 struct kretprobe *rp;
174174 kprobe_opcode_t *ret_addr;
175175 struct task_struct *task;
176+ void *fp;
176177 char data[0];
177178 };
178179
include/linux/kthread.h+2−1
@@ -4,7 +4,6 @@ · 3 unmodified lines
44 /* Simple interface for creating and stopping kernel threads without mess. */
55 #include <linux/err.h>
66 #include <linux/sched.h>
7−#include <linux/cgroup.h>
87
98 __printf(4, 5)
109 struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
@@ -198,6 +197,8 @@ bool kthread_cancel_delayed_work_sync(struct kthread_delayed_work *work); · 187 unmodified lines
198197
199198 void kthread_destroy_worker(struct kthread_worker *worker);
200199
200+struct cgroup_subsys_state;
201+
201202 #ifdef CONFIG_BLK_CGROUP
202203 void kthread_associate_blkcg(struct cgroup_subsys_state *css);
203204 struct cgroup_subsys_state *kthread_blkcg(void);
include/linux/kvm_host.h+54−4
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/irqbypass.h>
2929 #include <linux/swait.h>
3030 #include <linux/refcount.h>
31+#include <linux/nospec.h>
3132 #include <asm/signal.h>
3233
3334 #include <linux/kvm.h>
@@ -226,6 +227,32 @@ enum { · 192 unmodified lines
226227 READING_SHADOW_PAGE_TABLES,
227228 };
228229
230+#define KVM_UNMAPPED_PAGE ((void *) 0x500 + POISON_POINTER_DELTA)
231+
232+struct kvm_host_map {
233+ /*
234+ * Only valid if the 'pfn' is managed by the host kernel (i.e. There is
235+ * a 'struct page' for it. When using mem= kernel parameter some memory
236+ * can be used as guest memory but they are not managed by host
237+ * kernel).
238+ * If 'pfn' is not managed by the host kernel, this field is
239+ * initialized to KVM_UNMAPPED_PAGE.
240+ */
241+ struct page *page;
242+ void *hva;
243+ kvm_pfn_t pfn;
244+ kvm_pfn_t gfn;
245+};
246+
247+/*
248+ * Used to check if the mapping is valid or not. Never use 'kvm_host_map'
249+ * directly to check for that.
250+ */
251+static inline bool kvm_vcpu_mapped(struct kvm_host_map *map)
252+{
253+ return !!map->hva;
254+}
255+
229256 /*
230257 * Sometimes a large or cross-page mmio needs to be broken up into separate
231258 * exits for userspace servicing.
@@ -513,10 +540,10 @@ static inline struct kvm_io_bus *kvm_get_bus(struct kvm *kvm, enum kvm_bus idx) · 281 unmodified lines
513540
514541 static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)
515542 {
516− /* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu, in case
517− * the caller has read kvm->online_vcpus before (as is the case
518− * for kvm_for_each_vcpu, for example).
519− */
543+ int num_vcpus = atomic_read(&kvm->online_vcpus);
544+ i = array_index_nospec(i, num_vcpus);
545+
546+ /* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu. */
520547 smp_rmb();
521548 return kvm->vcpus[i];
522549 }
@@ -600,6 +627,7 @@ void kvm_put_kvm(struct kvm *kvm); · 77 unmodified lines
600627
601628 static inline struct kvm_memslots *__kvm_memslots(struct kvm *kvm, int as_id)
602629 {
630+ as_id = array_index_nospec(as_id, KVM_ADDRESS_SPACE_NUM);
603631 return srcu_dereference_check(kvm->memslots[as_id], &kvm->srcu,
604632 lockdep_is_held(&kvm->slots_lock) ||
605633 !refcount_read(&kvm->users_count));
@@ -731,7 +759,9 @@ struct kvm_memslots *kvm_vcpu_memslots(struct kvm_vcpu *vcpu); · 125 unmodified lines
731759 struct kvm_memory_slot *kvm_vcpu_gfn_to_memslot(struct kvm_vcpu *vcpu, gfn_t gfn);
732760 kvm_pfn_t kvm_vcpu_gfn_to_pfn_atomic(struct kvm_vcpu *vcpu, gfn_t gfn);
733761 kvm_pfn_t kvm_vcpu_gfn_to_pfn(struct kvm_vcpu *vcpu, gfn_t gfn);
762+int kvm_vcpu_map(struct kvm_vcpu *vcpu, gpa_t gpa, struct kvm_host_map *map);
734763 struct page *kvm_vcpu_gfn_to_page(struct kvm_vcpu *vcpu, gfn_t gfn);
764+void kvm_vcpu_unmap(struct kvm_vcpu *vcpu, struct kvm_host_map *map, bool dirty);
735765 unsigned long kvm_vcpu_gfn_to_hva(struct kvm_vcpu *vcpu, gfn_t gfn);
736766 unsigned long kvm_vcpu_gfn_to_hva_prot(struct kvm_vcpu *vcpu, gfn_t gfn, bool *writable);
737767 int kvm_vcpu_read_guest_page(struct kvm_vcpu *vcpu, gfn_t gfn, void *data, int offset,
@@ -1240,11 +1270,21 @@ struct kvm_device_ops { · 502 unmodified lines
12401270 */
12411271 void (*destroy)(struct kvm_device *dev);
12421272
1273+ /*
1274+ * Release is an alternative method to free the device. It is
1275+ * called when the device file descriptor is closed. Once
1276+ * release is called, the destroy method will not be called
1277+ * anymore as the device is removed from the device list of
1278+ * the VM. kvm->lock is held.
1279+ */
1280+ void (*release)(struct kvm_device *dev);
1281+
12431282 int (*set_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
12441283 int (*get_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
12451284 int (*has_attr)(struct kvm_device *dev, struct kvm_device_attr *attr);
12461285 long (*ioctl)(struct kvm_device *dev, unsigned int ioctl,
12471286 unsigned long arg);
1287+ int (*mmap)(struct kvm_device *dev, struct vm_area_struct *vma);
12481288 };
12491289
12501290 void kvm_device_get(struct kvm_device *dev);
@@ -1305,6 +1345,16 @@ static inline bool vcpu_valid_wakeup(struct kvm_vcpu *vcpu) · 54 unmodified lines
13051345 }
13061346 #endif /* CONFIG_HAVE_KVM_INVALID_WAKEUPS */
13071347
1348+#ifdef CONFIG_HAVE_KVM_NO_POLL
1349+/* Callback that tells if we must not poll */
1350+bool kvm_arch_no_poll(struct kvm_vcpu *vcpu);
1351+#else
1352+static inline bool kvm_arch_no_poll(struct kvm_vcpu *vcpu)
1353+{
1354+ return false;
1355+}
1356+#endif /* CONFIG_HAVE_KVM_NO_POLL */
1357+
13081358 #ifdef CONFIG_HAVE_KVM_VCPU_ASYNC_IOCTL
13091359 long kvm_arch_vcpu_async_ioctl(struct file *filp,
13101360 unsigned int ioctl, unsigned long arg);
include/linux/latencytop.h+2−2
@@ -36,7 +36,7 @@ account_scheduler_latency(struct task_struct *task, int usecs, int inter) · 35 unmodified lines
3636 __account_scheduler_latency(task, usecs, inter);
3737 }
3838
39−void clear_all_latency_tracing(struct task_struct *p);
39+void clear_tsk_latency_tracing(struct task_struct *p);
4040
4141 extern int sysctl_latencytop(struct ctl_table *table, int write,
4242 void __user *buffer, size_t *lenp, loff_t *ppos);
@@ -48,7 +48,7 @@ account_scheduler_latency(struct task_struct *task, int usecs, int inter) · 5 unmodified lines
4848 {
4949 }
5050
51−static inline void clear_all_latency_tracing(struct task_struct *p)
51+static inline void clear_tsk_latency_tracing(struct task_struct *p)
5252 {
5353 }
5454
include/linux/lightnvm.h+2−0
@@ -358,6 +358,7 @@ struct nvm_geo { · 357 unmodified lines
358358 u16 csecs; /* sector size */
359359 u16 sos; /* out-of-band area size */
360360 bool ext; /* metadata in extended data buffer */
361+ u32 mdts; /* Max data transfer size*/
361362
362363 /* device write constrains */
363364 u32 ws_min; /* minimum write size */
@@ -427,6 +428,7 @@ struct nvm_dev { · 63 unmodified lines
427428 char name[DISK_NAME_LEN];
428429 void *private_data;
429430
431+ struct kref ref;
430432 void *rmap;
431433
432434 struct mutex mlock;
include/linux/list.h+36−1
@@ -150,6 +150,23 @@ static inline void list_replace_init(struct list_head *old, · 149 unmodified lines
150150 INIT_LIST_HEAD(old);
151151 }
152152
153+/**
154+ * list_swap - replace entry1 with entry2 and re-add entry1 at entry2's position
155+ * @entry1: the location to place entry2
156+ * @entry2: the location to place entry1
157+ */
158+static inline void list_swap(struct list_head *entry1,
159+ struct list_head *entry2)
160+{
161+ struct list_head *pos = entry2->prev;
162+
163+ list_del(entry2);
164+ list_replace(entry1, entry2);
165+ if (pos == entry1)
166+ pos = entry2;
167+ list_add(entry1, pos);
168+}
169+
153170 /**
154171 * list_del_init - deletes entry from list and reinitialize it.
155172 * @entry: the element to delete from the list.
@@ -270,6 +287,24 @@ static inline void list_rotate_left(struct list_head *head) · 114 unmodified lines
270287 }
271288 }
272289
290+/**
291+ * list_rotate_to_front() - Rotate list to specific item.
292+ * @list: The desired new front of the list.
293+ * @head: The head of the list.
294+ *
295+ * Rotates list so that @list becomes the new front of the list.
296+ */
297+static inline void list_rotate_to_front(struct list_head *list,
298+ struct list_head *head)
299+{
300+ /*
301+ * Deletes the list head from the list denoted by @head and
302+ * places it as the tail of @list, this effectively rotates the
303+ * list so that @list is at the front.
304+ */
305+ list_move_tail(head, list);
306+}
307+
273308 /**
274309 * list_is_singular - tests whether a list has just one entry.
275310 * @head: the list to test.
@@ -754,7 +789,7 @@ static inline void hlist_add_behind(struct hlist_node *n, · 478 unmodified lines
754789 struct hlist_node *prev)
755790 {
756791 n->next = prev->next;
757− WRITE_ONCE(prev->next, n);
792+ prev->next = n;
758793 n->pprev = &prev->next;
759794
760795 if (n->next)
include/linux/list_bl.h+26−0
@@ -86,6 +86,32 @@ static inline void hlist_bl_add_head(struct hlist_bl_node *n, · 85 unmodified lines
8686 hlist_bl_set_first(h, n);
8787 }
8888
89+static inline void hlist_bl_add_before(struct hlist_bl_node *n,
90+ struct hlist_bl_node *next)
91+{
92+ struct hlist_bl_node **pprev = next->pprev;
93+
94+ n->pprev = pprev;
95+ n->next = next;
96+ next->pprev = &n->next;
97+
98+ /* pprev may be `first`, so be careful not to lose the lock bit */
99+ WRITE_ONCE(*pprev,
100+ (struct hlist_bl_node *)
101+ ((uintptr_t)n | ((uintptr_t)*pprev & LIST_BL_LOCKMASK)));
102+}
103+
104+static inline void hlist_bl_add_behind(struct hlist_bl_node *n,
105+ struct hlist_bl_node *prev)
106+{
107+ n->next = prev->next;
108+ n->pprev = &prev->next;
109+ prev->next = n;
110+
111+ if (n->next)
112+ n->next->pprev = &n->next;
113+}
114+
89115 static inline void __hlist_bl_del(struct hlist_bl_node *n)
90116 {
91117 struct hlist_bl_node *next = n->next;
include/linux/list_sort.h+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66
77 struct list_head;
88
9+__attribute__((nonnull(2,3)))
910 void list_sort(void *priv, struct list_head *head,
1011 int (*cmp)(void *priv, struct list_head *a,
1112 struct list_head *b));
include/linux/livepatch.h+0−3
@@ -86,7 +86,6 @@ struct klp_func { · 85 unmodified lines
8686 struct list_head node;
8787 struct list_head stack_node;
8888 unsigned long old_size, new_size;
89− bool kobj_added;
9089 bool nop;
9190 bool patched;
9291 bool transition;
@@ -141,7 +140,6 @@ struct klp_object { · 48 unmodified lines
141140 struct list_head func_list;
142141 struct list_head node;
143142 struct module *mod;
144− bool kobj_added;
145143 bool dynamic;
146144 bool patched;
147145 };
@@ -170,7 +168,6 @@ struct klp_patch { · 22 unmodified lines
170168 struct list_head list;
171169 struct kobject kobj;
172170 struct list_head obj_list;
173− bool kobj_added;
174171 bool enabled;
175172 bool forced;
176173 struct work_struct free_work;
include/linux/lockd/bind.h+2−1
@@ -46,6 +46,7 @@ struct nlmclnt_initdata { · 45 unmodified lines
4646 int noresvport;
4747 struct net *net;
4848 const struct nlmclnt_operations *nlmclnt_ops;
49+ const struct cred *cred;
4950 };
5051
5152 /*
@@ -75,7 +76,7 @@ struct nlmclnt_operations { · 23 unmodified lines
7576 };
7677
7778 extern int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl, void *data);
78−extern int lockd_up(struct net *net);
79+extern int lockd_up(struct net *net, const struct cred *cred);
7980 extern void lockd_down(struct net *net);
8081
8182 #endif /* LINUX_LOCKD_BIND_H */
include/linux/lockd/lockd.h+3−1
@@ -70,6 +70,7 @@ struct nlm_host { · 69 unmodified lines
7070 struct nsm_handle *h_nsmhandle; /* NSM status handle */
7171 char *h_addrbuf; /* address eyecatcher */
7272 struct net *net; /* host net */
73+ const struct cred *h_cred;
7374 char nodename[UNX_MAXNODENAME + 1];
7475 const struct nlmclnt_operations *h_nlmclnt_ops; /* Callback ops for NLM users */
7576 };
@@ -229,7 +230,8 @@ struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap, · 153 unmodified lines
229230 const u32 version,
230231 const char *hostname,
231232 int noresvport,
232− struct net *net);
233+ struct net *net,
234+ const struct cred *cred);
233235 void nlmclnt_release_host(struct nlm_host *);
234236 struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp,
235237 const char *hostname,
include/linux/lockdep.h+8−3
@@ -66,6 +66,11 @@ struct lock_class_key { · 65 unmodified lines
6666
6767 extern struct lock_class_key __lockdep_no_validate__;
6868
69+struct lock_trace {
70+ unsigned int nr_entries;
71+ unsigned int offset;
72+};
73+
6974 #define LOCKSTAT_POINTS 4
7075
7176 /*
@@ -100,7 +105,7 @@ struct lock_class { · 28 unmodified lines
100105 * IRQ/softirq usage tracking bits:
101106 */
102107 unsigned long usage_mask;
103− struct stack_trace usage_traces[XXX_LOCK_USAGE_STATES];
108+ struct lock_trace usage_traces[XXX_LOCK_USAGE_STATES];
104109
105110 /*
106111 * Generation counter, when doing certain classes of graph walking,
@@ -188,7 +193,7 @@ struct lock_list { · 81 unmodified lines
188193 struct list_head entry;
189194 struct lock_class *class;
190195 struct lock_class *links_to;
191− struct stack_trace trace;
196+ struct lock_trace trace;
192197 int distance;
193198
194199 /*
@@ -471,7 +476,7 @@ struct pin_cookie { }; · 276 unmodified lines
471476
472477 #define NIL_COOKIE (struct pin_cookie){ }
473478
474−#define lockdep_pin_lock(l) ({ struct pin_cookie cookie; cookie; })
479+#define lockdep_pin_lock(l) ({ struct pin_cookie cookie = { }; cookie; })
475480 #define lockdep_repin_lock(l, c) do { (void)(l); (void)(c); } while (0)
476481 #define lockdep_unpin_lock(l, c) do { (void)(l); (void)(c); } while (0)
477482
include/linux/lsm_hooks.h+100−89
@@ -127,7 +127,6 @@ · 126 unmodified lines
127127 * options cleanly (a filesystem may modify the data e.g. with strsep()).
128128 * This also allows the original mount data to be stripped of security-
129129 * specific options to avoid having to make filesystems aware of them.
130− * @type the type of filesystem being mounted.
131130 * @orig the original mount data copied from userspace.
132131 * @copy copied data which will be passed to the security module.
133132 * Returns 0 if the copy was successful.
@@ -160,6 +159,10 @@ · 26 unmodified lines
160159 * Parse a string of security data filling in the opts structure
161160 * @options string containing all mount options known by the LSM
162161 * @opts binary data structure usable by the LSM
162+ * @move_mount:
163+ * Check permission before a mount is moved.
164+ * @from_path indicates the mount that is going to be moved.
165+ * @to_path indicates the mountpoint that will be mounted upon.
163166 * @dentry_init_security:
164167 * Compute a context for a dentry as the inode is not yet available
165168 * since NFSv4 has no label backed by an EA anyway.
@@ -320,10 +323,11 @@ · 154 unmodified lines
320323 * @new_dentry contains the dentry structure of the new link.
321324 * Return 0 if permission is granted.
322325 * @path_chmod:
323− * Check for permission to change DAC's permission of a file or directory.
324− * @dentry contains the dentry structure.
325− * @mnt contains the vfsmnt structure.
326− * @mode contains DAC's mode.
326+ * Check for permission to change a mode of the file @path. The new
327+ * mode is specified in @mode.
328+ * @path contains the path structure of the file to change the mode.
329+ * @mode contains the new DAC's permission, which is a bitmask of
330+ * constants from <include/uapi/linux/stat.h>
327331 * Return 0 if permission is granted.
328332 * @path_chown:
329333 * Check for permission to change owner/group of a file or directory.
@@ -445,6 +449,15 @@ · 115 unmodified lines
445449 * to abort the copy up. Note that the caller is responsible for reading
446450 * and writing the xattrs as this hook is merely a filter.
447451 *
452+ * Security hooks for kernfs node operations
453+ *
454+ * @kernfs_init_security:
455+ * Initialize the security context of a newly created kernfs node based
456+ * on its own and its parent's attributes.
457+ *
458+ * @kn_dir the parent kernfs node
459+ * @kn the new child kernfs node
460+ *
448461 * Security hooks for file operations
449462 *
450463 * @file_permission:
@@ -502,7 +515,7 @@ · 51 unmodified lines
502515 * Return 0 if permission is granted.
503516 * @file_lock:
504517 * Check permission before performing file locking operations.
505− * Note: this hook mediates both flock and fcntl style locks.
518+ * Note the hook mediates both flock and fcntl style locks.
506519 * @file contains the file structure.
507520 * @cmd contains the posix-translated lock operation to perform
508521 * (e.g. F_RDLCK, F_WRLCK).
@@ -645,12 +658,12 @@ · 136 unmodified lines
645658 * @p contains the task_struct of process.
646659 * @nice contains the new nice value.
647660 * Return 0 if permission is granted.
648− * @task_setioprio
661+ * @task_setioprio:
649662 * Check permission before setting the ioprio value of @p to @ioprio.
650663 * @p contains the task_struct of process.
651664 * @ioprio contains the new ioprio value
652665 * Return 0 if permission is granted.
653− * @task_getioprio
666+ * @task_getioprio:
654667 * Check permission before getting the ioprio value of @p.
655668 * @p contains the task_struct of process.
656669 * Return 0 if permission is granted.
@@ -672,17 +685,15 @@ · 15 unmodified lines
672685 * Return 0 if permission is granted.
673686 * @task_setscheduler:
674687 * Check permission before setting scheduling policy and/or parameters of
675− * process @p based on @policy and @lp.
688+ * process @p.
676689 * @p contains the task_struct for process.
677− * @policy contains the scheduling policy.
678− * @lp contains the scheduling parameters.
679690 * Return 0 if permission is granted.
680691 * @task_getscheduler:
681692 * Check permission before obtaining scheduling information for process
682693 * @p.
683694 * @p contains the task_struct for process.
684695 * Return 0 if permission is granted.
685− * @task_movememory
696+ * @task_movememory:
686697 * Check permission before moving memory owned by process @p.
687698 * @p contains the task_struct for process.
688699 * Return 0 if permission is granted.
@@ -769,9 +780,9 @@ · 80 unmodified lines
769780 * socket structure, but rather, the socket security information is stored
770781 * in the associated inode. Typically, the inode alloc_security hook will
771782 * allocate and and attach security information to
772− * sock->inode->i_security. This hook may be used to update the
773− * sock->inode->i_security field with additional information that wasn't
774− * available when the inode was allocated.
783+ * SOCK_INODE(sock)->i_security. This hook may be used to update the
784+ * SOCK_INODE(sock)->i_security field with additional information that
785+ * wasn't available when the inode was allocated.
775786 * @sock contains the newly created socket structure.
776787 * @family contains the requested protocol family.
777788 * @type contains the requested communications type.
@@ -876,13 +887,13 @@ · 98 unmodified lines
876887 * @socket_getpeersec_dgram:
877888 * This hook allows the security module to provide peer socket security
878889 * state for udp sockets on a per-packet basis to userspace via
879− * getsockopt SO_GETPEERSEC. The application must first have indicated
880− * the IP_PASSSEC option via getsockopt. It can then retrieve the
890+ * getsockopt SO_GETPEERSEC. The application must first have indicated
891+ * the IP_PASSSEC option via getsockopt. It can then retrieve the
881892 * security state returned by this hook for a packet via the SCM_SECURITY
882893 * ancillary message type.
883− * @skb is the skbuff for the packet being queried
884− * @secdata is a pointer to a buffer in which to copy the security data
885− * @seclen is the maximum length for @secdata
894+ * @sock contains the peer socket. May be NULL.
895+ * @skb is the sk_buff for the packet being queried. May be NULL.
896+ * @secid pointer to store the secid of the packet.
886897 * Return 0 on success, error on failure.
887898 * @sk_alloc_security:
888899 * Allocate and attach a security structure to the sk->sk_security field,
@@ -906,9 +917,9 @@ · 17 unmodified lines
906917 * @secmark_relabel_packet:
907918 * check if the process should be allowed to relabel packets to
908919 * the given secid
909− * @security_secmark_refcount_inc
920+ * @secmark_refcount_inc:
910921 * tells the LSM to increment the number of secmark labeling rules loaded
911− * @security_secmark_refcount_dec
922+ * @secmark_refcount_dec:
912923 * tells the LSM to decrement the number of secmark labeling rules loaded
913924 * @req_classify_flow:
914925 * Sets the flow's sid to the openreq sid.
@@ -1113,41 +1124,41 @@ · 198 unmodified lines
11131124 *
11141125 * @msg_queue_alloc_security:
11151126 * Allocate and attach a security structure to the
1116− * msq->q_perm.security field. The security field is initialized to
1127+ * @perm->security field. The security field is initialized to
11171128 * NULL when the structure is first created.
1118− * @msq contains the message queue structure to be modified.
1129+ * @perm contains the IPC permissions of the message queue.
11191130 * Return 0 if operation was successful and permission is granted.
11201131 * @msg_queue_free_security:
1121− * Deallocate security structure for this message queue.
1122− * @msq contains the message queue structure to be modified.
1132+ * Deallocate security field @perm->security for the message queue.
1133+ * @perm contains the IPC permissions of the message queue.
11231134 * @msg_queue_associate:
11241135 * Check permission when a message queue is requested through the
1125− * msgget system call. This hook is only called when returning the
1136+ * msgget system call. This hook is only called when returning the
11261137 * message queue identifier for an existing message queue, not when a
11271138 * new message queue is created.
1128− * @msq contains the message queue to act upon.
1139+ * @perm contains the IPC permissions of the message queue.
11291140 * @msqflg contains the operation control flags.
11301141 * Return 0 if permission is granted.
11311142 * @msg_queue_msgctl:
11321143 * Check permission when a message control operation specified by @cmd
1133− * is to be performed on the message queue @msq.
1134− * The @msq may be NULL, e.g. for IPC_INFO or MSG_INFO.
1135− * @msq contains the message queue to act upon. May be NULL.
1144+ * is to be performed on the message queue with permissions @perm.
1145+ * The @perm may be NULL, e.g. for IPC_INFO or MSG_INFO.
1146+ * @perm contains the IPC permissions of the msg queue. May be NULL.
11361147 * @cmd contains the operation to be performed.
11371148 * Return 0 if permission is granted.
11381149 * @msg_queue_msgsnd:
11391150 * Check permission before a message, @msg, is enqueued on the message
1140− * queue, @msq.
1141− * @msq contains the message queue to send message to.
1151+ * queue with permissions @perm.
1152+ * @perm contains the IPC permissions of the message queue.
11421153 * @msg contains the message to be enqueued.
11431154 * @msqflg contains operational flags.
11441155 * Return 0 if permission is granted.
11451156 * @msg_queue_msgrcv:
11461157 * Check permission before a message, @msg, is removed from the message
1147− * queue, @msq. The @target task structure contains a pointer to the
1158+ * queue. The @target task structure contains a pointer to the
11481159 * process that will be receiving the message (not equal to the current
11491160 * process when inline receives are being performed).
1150− * @msq contains the message queue to retrieve message from.
1161+ * @perm contains the IPC permissions of the message queue.
11511162 * @msg contains the message destination.
11521163 * @target contains the task structure for recipient process.
11531164 * @type contains the type of message requested.
@@ -1157,34 +1168,34 @@ · 3 unmodified lines
11571168 * Security hooks for System V Shared Memory Segments
11581169 *
11591170 * @shm_alloc_security:
1160− * Allocate and attach a security structure to the shp->shm_perm.security
1161− * field. The security field is initialized to NULL when the structure is
1171+ * Allocate and attach a security structure to the @perm->security
1172+ * field. The security field is initialized to NULL when the structure is
11621173 * first created.
1163− * @shp contains the shared memory structure to be modified.
1174+ * @perm contains the IPC permissions of the shared memory structure.
11641175 * Return 0 if operation was successful and permission is granted.
11651176 * @shm_free_security:
1166− * Deallocate the security struct for this memory segment.
1167− * @shp contains the shared memory structure to be modified.
1177+ * Deallocate the security structure @perm->security for the memory segment.
1178+ * @perm contains the IPC permissions of the shared memory structure.
11681179 * @shm_associate:
11691180 * Check permission when a shared memory region is requested through the
1170− * shmget system call. This hook is only called when returning the shared
1181+ * shmget system call. This hook is only called when returning the shared
11711182 * memory region identifier for an existing region, not when a new shared
11721183 * memory region is created.
1173− * @shp contains the shared memory structure to be modified.
1184+ * @perm contains the IPC permissions of the shared memory structure.
11741185 * @shmflg contains the operation control flags.
11751186 * Return 0 if permission is granted.
11761187 * @shm_shmctl:
11771188 * Check permission when a shared memory control operation specified by
1178− * @cmd is to be performed on the shared memory region @shp.
1179− * The @shp may be NULL, e.g. for IPC_INFO or SHM_INFO.
1180− * @shp contains shared memory structure to be modified.
1189+ * @cmd is to be performed on the shared memory region with permissions @perm.
1190+ * The @perm may be NULL, e.g. for IPC_INFO or SHM_INFO.
1191+ * @perm contains the IPC permissions of the shared memory structure.
11811192 * @cmd contains the operation to be performed.
11821193 * Return 0 if permission is granted.
11831194 * @shm_shmat:
11841195 * Check permissions prior to allowing the shmat system call to attach the
1185− * shared memory segment @shp to the data segment of the calling process.
1186− * The attaching address is specified by @shmaddr.
1187− * @shp contains the shared memory structure to be modified.
1196+ * shared memory segment with permissions @perm to the data segment of the
1197+ * calling process. The attaching address is specified by @shmaddr.
1198+ * @perm contains the IPC permissions of the shared memory structure.
11881199 * @shmaddr contains the address to attach memory region to.
11891200 * @shmflg contains the operational flags.
11901201 * Return 0 if permission is granted.
@@ -1192,34 +1203,34 @@ · 1 unmodified line
11921203 * Security hooks for System V Semaphores
11931204 *
11941205 * @sem_alloc_security:
1195− * Allocate and attach a security structure to the sma->sem_perm.security
1196− * field. The security field is initialized to NULL when the structure is
1206+ * Allocate and attach a security structure to the @perm->security
1207+ * field. The security field is initialized to NULL when the structure is
11971208 * first created.
1198− * @sma contains the semaphore structure
1209+ * @perm contains the IPC permissions of the semaphore.
11991210 * Return 0 if operation was successful and permission is granted.
12001211 * @sem_free_security:
1201− * deallocate security struct for this semaphore
1202− * @sma contains the semaphore structure.
1212+ * Deallocate security structure @perm->security for the semaphore.
1213+ * @perm contains the IPC permissions of the semaphore.
12031214 * @sem_associate:
12041215 * Check permission when a semaphore is requested through the semget
1205− * system call. This hook is only called when returning the semaphore
1216+ * system call. This hook is only called when returning the semaphore
12061217 * identifier for an existing semaphore, not when a new one must be
12071218 * created.
1208− * @sma contains the semaphore structure.
1219+ * @perm contains the IPC permissions of the semaphore.
12091220 * @semflg contains the operation control flags.
12101221 * Return 0 if permission is granted.
12111222 * @sem_semctl:
12121223 * Check permission when a semaphore operation specified by @cmd is to be
1213− * performed on the semaphore @sma. The @sma may be NULL, e.g. for
1224+ * performed on the semaphore. The @perm may be NULL, e.g. for
12141225 * IPC_INFO or SEM_INFO.
1215− * @sma contains the semaphore structure. May be NULL.
1226+ * @perm contains the IPC permissions of the semaphore. May be NULL.
12161227 * @cmd contains the operation to be performed.
12171228 * Return 0 if permission is granted.
12181229 * @sem_semop:
12191230 * Check permissions before performing operations on members of the
1220− * semaphore set @sma. If the @alter flag is nonzero, the semaphore set
1231+ * semaphore set. If the @alter flag is nonzero, the semaphore set
12211232 * may be modified.
1222− * @sma contains the semaphore structure.
1233+ * @perm contains the IPC permissions of the semaphore.
12231234 * @sops contains the operations to perform.
12241235 * @nsops contains the number of operations to perform.
12251236 * @alter contains the flag indicating whether changes are to be made.
@@ -1292,13 +1303,12 @@ · 66 unmodified lines
12921303 * Check permission before accessing the kernel message ring or changing
12931304 * logging to the console.
12941305 * See the syslog(2) manual page for an explanation of the @type values.
1295− * @type contains the type of action.
1296− * @from_file indicates the context of action (if it came from /proc).
1306+ * @type contains the SYSLOG_ACTION_* constant from <include/linux/syslog.h>
12971307 * Return 0 if permission is granted.
12981308 * @settime:
12991309 * Check permission to change the system time.
1300− * struct timespec64 is defined in include/linux/time64.h and timezone
1301− * is defined in include/linux/time.h
1310+ * struct timespec64 is defined in <include/linux/time64.h> and timezone
1311+ * is defined in <include/linux/time.h>
13021312 * @ts contains new time
13031313 * @tz contains new timezone
13041314 * Return 0 if permission is granted.
@@ -1340,7 +1350,7 @@ · 35 unmodified lines
13401350 * @audit_rule_init:
13411351 * Allocate and initialize an LSM audit rule structure.
13421352 * @field contains the required Audit action.
1343− * Fields flags are defined in include/linux/audit.h
1353+ * Fields flags are defined in <include/linux/audit.h>
13441354 * @op contains the operator the rule uses.
13451355 * @rulestr contains the context where the rule will be applied to.
13461356 * @lsmrule contains a pointer to receive the result.
@@ -1348,9 +1358,9 @@ · 1 unmodified line
13481358 * -EINVAL in case of an invalid rule.
13491359 *
13501360 * @audit_rule_known:
1351− * Specifies whether given @rule contains any fields related to
1361+ * Specifies whether given @krule contains any fields related to
13521362 * current LSM.
1353− * @rule contains the audit rule of interest.
1363+ * @krule contains the audit rule of interest.
13541364 * Return 1 in case of relation found, 0 otherwise.
13551365 *
13561366 * @audit_rule_match:
@@ -1359,13 +1369,13 @@ · 2 unmodified lines
13591369 * @secid contains the security id in question.
13601370 * @field contains the field which relates to current LSM.
13611371 * @op contains the operator that will be used for matching.
1362− * @rule points to the audit rule that will be checked against.
1372+ * @lrule points to the audit rule that will be checked against.
13631373 * Return 1 if secid matches the rule, 0 if it does not, -ERRNO on failure.
13641374 *
13651375 * @audit_rule_free:
13661376 * Deallocate the LSM audit rule structure previously allocated by
13671377 * audit_rule_init.
1368− * @rule contains the allocated rule
1378+ * @lsmrule contains the allocated rule
13691379 *
13701380 * @inode_invalidate_secctx:
13711381 * Notify the security module that it must revalidate the security context
@@ -1378,9 +1388,7 @@ · 6 unmodified lines
13781388 * this hook to initialize the security context in its incore inode to the
13791389 * value provided by the server for the file when the server returned the
13801390 * file's attributes to the client.
1381− *
13821391 * Must be called with inode->i_mutex locked.
1383− *
13841392 * @inode we wish to set the security context of.
13851393 * @ctx contains the string which we wish to set in the inode.
13861394 * @ctxlen contains the length of @ctx.
@@ -1393,9 +1401,7 @@ · 6 unmodified lines
13931401 * this hook to change the security context in its incore inode and on the
13941402 * backing filesystem to a value provided by the client on a SETATTR
13951403 * operation.
1396− *
13971404 * Must be called with inode->i_mutex locked.
1398− *
13991405 * @dentry contains the inode we wish to set the security context of.
14001406 * @ctx contains the string which we wish to set in the inode.
14011407 * @ctxlen contains the length of @ctx.
@@ -1403,7 +1409,6 @@ · 1 unmodified line
14031409 * @inode_getsecctx:
14041410 * On success, returns 0 and fills out @ctx and @ctxlen with the security
14051411 * context for the given @inode.
1406− *
14071412 * @inode we wish to get the security context of.
14081413 * @ctx is a pointer in which to place the allocated security context.
14091414 * @ctxlen points to the place to put the length of @ctx.
@@ -1501,6 +1506,7 @@ union security_list_options { · 91 unmodified lines
15011506 unsigned long *set_kern_flags);
15021507 int (*sb_add_mnt_opt)(const char *option, const char *val, int len,
15031508 void **mnt_opts);
1509+ int (*move_mount)(const struct path *from_path, const struct path *to_path);
15041510 int (*dentry_init_security)(struct dentry *dentry, int mode,
15051511 const struct qstr *name, void **ctx,
15061512 u32 *ctxlen);
@@ -1578,6 +1584,9 @@ union security_list_options { · 71 unmodified lines
15781584 int (*inode_copy_up)(struct dentry *src, struct cred **new);
15791585 int (*inode_copy_up_xattr)(const char *name);
15801586
1587+ int (*kernfs_init_security)(struct kernfs_node *kn_dir,
1588+ struct kernfs_node *kn);
1589+
15811590 int (*file_permission)(struct file *file, int mask);
15821591 int (*file_alloc_security)(struct file *file);
15831592 void (*file_free_security)(struct file *file);
@@ -1640,28 +1649,28 @@ union security_list_options { · 56 unmodified lines
16401649 int (*msg_msg_alloc_security)(struct msg_msg *msg);
16411650 void (*msg_msg_free_security)(struct msg_msg *msg);
16421651
1643− int (*msg_queue_alloc_security)(struct kern_ipc_perm *msq);
1644− void (*msg_queue_free_security)(struct kern_ipc_perm *msq);
1645− int (*msg_queue_associate)(struct kern_ipc_perm *msq, int msqflg);
1646− int (*msg_queue_msgctl)(struct kern_ipc_perm *msq, int cmd);
1647− int (*msg_queue_msgsnd)(struct kern_ipc_perm *msq, struct msg_msg *msg,
1652+ int (*msg_queue_alloc_security)(struct kern_ipc_perm *perm);
1653+ void (*msg_queue_free_security)(struct kern_ipc_perm *perm);
1654+ int (*msg_queue_associate)(struct kern_ipc_perm *perm, int msqflg);
1655+ int (*msg_queue_msgctl)(struct kern_ipc_perm *perm, int cmd);
1656+ int (*msg_queue_msgsnd)(struct kern_ipc_perm *perm, struct msg_msg *msg,
16481657 int msqflg);
1649− int (*msg_queue_msgrcv)(struct kern_ipc_perm *msq, struct msg_msg *msg,
1658+ int (*msg_queue_msgrcv)(struct kern_ipc_perm *perm, struct msg_msg *msg,
16501659 struct task_struct *target, long type,
16511660 int mode);
16521661
1653− int (*shm_alloc_security)(struct kern_ipc_perm *shp);
1654− void (*shm_free_security)(struct kern_ipc_perm *shp);
1655− int (*shm_associate)(struct kern_ipc_perm *shp, int shmflg);
1656− int (*shm_shmctl)(struct kern_ipc_perm *shp, int cmd);
1657− int (*shm_shmat)(struct kern_ipc_perm *shp, char __user *shmaddr,
1662+ int (*shm_alloc_security)(struct kern_ipc_perm *perm);
1663+ void (*shm_free_security)(struct kern_ipc_perm *perm);
1664+ int (*shm_associate)(struct kern_ipc_perm *perm, int shmflg);
1665+ int (*shm_shmctl)(struct kern_ipc_perm *perm, int cmd);
1666+ int (*shm_shmat)(struct kern_ipc_perm *perm, char __user *shmaddr,
16581667 int shmflg);
16591668
1660− int (*sem_alloc_security)(struct kern_ipc_perm *sma);
1661− void (*sem_free_security)(struct kern_ipc_perm *sma);
1662− int (*sem_associate)(struct kern_ipc_perm *sma, int semflg);
1663− int (*sem_semctl)(struct kern_ipc_perm *sma, int cmd);
1664− int (*sem_semop)(struct kern_ipc_perm *sma, struct sembuf *sops,
1669+ int (*sem_alloc_security)(struct kern_ipc_perm *perm);
1670+ void (*sem_free_security)(struct kern_ipc_perm *perm);
1671+ int (*sem_associate)(struct kern_ipc_perm *perm, int semflg);
1672+ int (*sem_semctl)(struct kern_ipc_perm *perm, int cmd);
1673+ int (*sem_semop)(struct kern_ipc_perm *perm, struct sembuf *sops,
16651674 unsigned nsops, int alter);
16661675
16671676 int (*netlink_send)(struct sock *sk, struct sk_buff *skb);
@@ -1835,6 +1844,7 @@ struct security_hook_heads { · 167 unmodified lines
18351844 struct hlist_head sb_set_mnt_opts;
18361845 struct hlist_head sb_clone_mnt_opts;
18371846 struct hlist_head sb_add_mnt_opt;
1847+ struct hlist_head move_mount;
18381848 struct hlist_head dentry_init_security;
18391849 struct hlist_head dentry_create_files_as;
18401850 #ifdef CONFIG_SECURITY_PATH
@@ -1879,6 +1889,7 @@ struct security_hook_heads { · 38 unmodified lines
18791889 struct hlist_head inode_getsecid;
18801890 struct hlist_head inode_copy_up;
18811891 struct hlist_head inode_copy_up_xattr;
1892+ struct hlist_head kernfs_init_security;
18821893 struct hlist_head file_permission;
18831894 struct hlist_head file_alloc_security;
18841895 struct hlist_head file_free_security;
include/linux/marvell_phy.h+1−0
@@ -34,5 +34,6 @@ · 33 unmodified lines
3434 /* struct phy_device dev_flags definitions */
3535 #define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001
3636 #define MARVELL_PHY_M1118_DNS323_LEDS 0x00000002
37+#define MARVELL_PHY_LED0_LINK_LED1_ACTIVE 0x00000004
3738
3839 #endif /* _MARVELL_PHY_H */
include/linux/math64.h+13−0
@@ -284,4 +284,17 @@ static inline u64 mul_u64_u32_div(u64 a, u32 mul, u32 divisor) · 283 unmodified lines
284284 #define DIV64_U64_ROUND_UP(ll, d) \
285285 ({ u64 _tmp = (d); div64_u64((ll) + _tmp - 1, _tmp); })
286286
287+/**
288+ * DIV64_U64_ROUND_CLOSEST - unsigned 64bit divide with 64bit divisor rounded to nearest integer
289+ * @dividend: unsigned 64bit dividend
290+ * @divisor: unsigned 64bit divisor
291+ *
292+ * Divide unsigned 64bit dividend by unsigned 64bit divisor
293+ * and round to closest integer.
294+ *
295+ * Return: dividend / divisor rounded to nearest integer
296+ */
297+#define DIV64_U64_ROUND_CLOSEST(dividend, divisor) \
298+ ({ u64 _tmp = (divisor); div64_u64((dividend) + _tmp / 2, _tmp); })
299+
287300 #endif /* _LINUX_MATH64_H */
include/linux/mdev.h+24−11
@@ -15,6 +15,20 @@ · 14 unmodified lines
1515
1616 struct mdev_device;
1717
18+/*
19+ * Called by the parent device driver to set the device which represents
20+ * this mdev in iommu protection scope. By default, the iommu device is
21+ * NULL, that indicates using vendor defined isolation.
22+ *
23+ * @dev: the mediated device that iommu will isolate.
24+ * @iommu_device: a pci device which represents the iommu for @dev.
25+ *
26+ * Return 0 for success, otherwise negative error value.
27+ */
28+int mdev_set_iommu_device(struct device *dev, struct device *iommu_device);
29+
30+struct device *mdev_get_iommu_device(struct device *dev);
31+
1832 /**
1933 * struct mdev_parent_ops - Structure to be registered for each parent device to
2034 * register the device to mdev module.
@@ -118,21 +132,20 @@ struct mdev_driver { · 97 unmodified lines
118132
119133 #define to_mdev_driver(drv) container_of(drv, struct mdev_driver, driver)
120134
121−extern void *mdev_get_drvdata(struct mdev_device *mdev);
122−extern void mdev_set_drvdata(struct mdev_device *mdev, void *data);
123−extern const guid_t *mdev_uuid(struct mdev_device *mdev);
135+void *mdev_get_drvdata(struct mdev_device *mdev);
136+void mdev_set_drvdata(struct mdev_device *mdev, void *data);
137+const guid_t *mdev_uuid(struct mdev_device *mdev);
124138
125139 extern struct bus_type mdev_bus_type;
126140
127−extern int mdev_register_device(struct device *dev,
128− const struct mdev_parent_ops *ops);
129−extern void mdev_unregister_device(struct device *dev);
141+int mdev_register_device(struct device *dev, const struct mdev_parent_ops *ops);
142+void mdev_unregister_device(struct device *dev);
130143
131−extern int mdev_register_driver(struct mdev_driver *drv, struct module *owner);
132−extern void mdev_unregister_driver(struct mdev_driver *drv);
144+int mdev_register_driver(struct mdev_driver *drv, struct module *owner);
145+void mdev_unregister_driver(struct mdev_driver *drv);
133146
134−extern struct device *mdev_parent_dev(struct mdev_device *mdev);
135−extern struct device *mdev_dev(struct mdev_device *mdev);
136−extern struct mdev_device *mdev_from_dev(struct device *dev);
147+struct device *mdev_parent_dev(struct mdev_device *mdev);
148+struct device *mdev_dev(struct mdev_device *mdev);
149+struct mdev_device *mdev_from_dev(struct device *dev);
137150
138151 #endif /* MDEV_H */
include/linux/mdio.h+2−1
@@ -39,7 +39,8 @@ struct mdio_device { · 38 unmodified lines
3939 /* Bus address of the MDIO device (0-31) */
4040 int addr;
4141 int flags;
42− struct gpio_desc *reset;
42+ struct gpio_desc *reset_gpio;
43+ struct reset_control *reset_ctrl;
4344 unsigned int reset_assert_delay;
4445 unsigned int reset_deassert_delay;
4546 };
include/linux/mei_cl_bus.h+3−0
@@ -1,4 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright (c) 2013-2016, Intel Corporation. All rights reserved.
4+ */
25 #ifndef _LINUX_MEI_CL_BUS_H
36 #define _LINUX_MEI_CL_BUS_H
47
include/linux/memblock.h+43−1
@@ -96,13 +96,14 @@ struct memblock { · 95 unmodified lines
9696 extern struct memblock memblock;
9797 extern int memblock_debug;
9898
99−#ifdef CONFIG_ARCH_DISCARD_MEMBLOCK
99+#ifndef CONFIG_ARCH_KEEP_MEMBLOCK
100100 #define __init_memblock __meminit
101101 #define __initdata_memblock __meminitdata
102102 void memblock_discard(void);
103103 #else
104104 #define __init_memblock
105105 #define __initdata_memblock
106+static inline void memblock_discard(void) {}
106107 #endif
107108
108109 #define memblock_dbg(fmt, ...) \
@@ -240,6 +241,47 @@ void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, · 131 unmodified lines
240241 i >= 0; __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid))
241242 #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
242243
244+#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
245+void __next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone,
246+ unsigned long *out_spfn,
247+ unsigned long *out_epfn);
248+/**
249+ * for_each_free_mem_range_in_zone - iterate through zone specific free
250+ * memblock areas
251+ * @i: u64 used as loop variable
252+ * @zone: zone in which all of the memory blocks reside
253+ * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
254+ * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
255+ *
256+ * Walks over free (memory && !reserved) areas of memblock in a specific
257+ * zone. Available once memblock and an empty zone is initialized. The main
258+ * assumption is that the zone start, end, and pgdat have been associated.
259+ * This way we can use the zone to determine NUMA node, and if a given part
260+ * of the memblock is valid for the zone.
261+ */
262+#define for_each_free_mem_pfn_range_in_zone(i, zone, p_start, p_end) \
263+ for (i = 0, \
264+ __next_mem_pfn_range_in_zone(&i, zone, p_start, p_end); \
265+ i != U64_MAX; \
266+ __next_mem_pfn_range_in_zone(&i, zone, p_start, p_end))
267+
268+/**
269+ * for_each_free_mem_range_in_zone_from - iterate through zone specific
270+ * free memblock areas from a given point
271+ * @i: u64 used as loop variable
272+ * @zone: zone in which all of the memory blocks reside
273+ * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
274+ * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
275+ *
276+ * Walks over free (memory && !reserved) areas of memblock in a specific
277+ * zone, continuing from current position. Available as soon as memblock is
278+ * initialized.
279+ */
280+#define for_each_free_mem_pfn_range_in_zone_from(i, zone, p_start, p_end) \
281+ for (; i != U64_MAX; \
282+ __next_mem_pfn_range_in_zone(&i, zone, p_start, p_end))
283+#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
284+
243285 /**
244286 * for_each_free_mem_range - iterate through free memblock areas
245287 * @i: u64 used as loop variable
include/linux/memcontrol.h+58−84
@@ -94,8 +94,8 @@ enum mem_cgroup_events_target { · 93 unmodified lines
9494 MEM_CGROUP_NTARGETS,
9595 };
9696
97−struct mem_cgroup_stat_cpu {
98− long count[MEMCG_NR_STAT];
97+struct memcg_vmstats_percpu {
98+ long stat[MEMCG_NR_STAT];
9999 unsigned long events[NR_VM_EVENT_ITEMS];
100100 unsigned long nr_page_events;
101101 unsigned long targets[MEM_CGROUP_NTARGETS];
@@ -128,6 +128,7 @@ struct mem_cgroup_per_node { · 26 unmodified lines
128128
129129 struct lruvec_stat __percpu *lruvec_stat_cpu;
130130 atomic_long_t lruvec_stat[NR_VM_NODE_STAT_ITEMS];
131+ atomic_long_t lruvec_stat_local[NR_VM_NODE_STAT_ITEMS];
131132
132133 unsigned long lru_zone_size[MAX_NR_ZONES][NR_LRU_LISTS];
133134
@@ -274,13 +275,17 @@ struct mem_cgroup { · 140 unmodified lines
274275 struct task_struct *move_lock_task;
275276
276277 /* memory.stat */
277− struct mem_cgroup_stat_cpu __percpu *stat_cpu;
278+ struct memcg_vmstats_percpu __percpu *vmstats_percpu;
278279
279280 MEMCG_PADDING(_pad2_);
280281
281− atomic_long_t stat[MEMCG_NR_STAT];
282− atomic_long_t events[NR_VM_EVENT_ITEMS];
283− atomic_long_t memory_events[MEMCG_NR_MEMORY_EVENTS];
282+ atomic_long_t vmstats[MEMCG_NR_STAT];
283+ atomic_long_t vmstats_local[MEMCG_NR_STAT];
284+
285+ atomic_long_t vmevents[NR_VM_EVENT_ITEMS];
286+ atomic_long_t vmevents_local[NR_VM_EVENT_ITEMS];
287+
288+ atomic_long_t memory_events[MEMCG_NR_MEMORY_EVENTS];
284289
285290 unsigned long socket_pressure;
286291
@@ -501,22 +506,6 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); · 214 unmodified lines
501506 void mem_cgroup_update_lru_size(struct lruvec *lruvec, enum lru_list lru,
502507 int zid, int nr_pages);
503508
504−unsigned long mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg,
505− int nid, unsigned int lru_mask);
506−
507−static inline
508−unsigned long mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru)
509−{
510− struct mem_cgroup_per_node *mz;
511− unsigned long nr_pages = 0;
512− int zid;
513−
514− mz = container_of(lruvec, struct mem_cgroup_per_node, lruvec);
515− for (zid = 0; zid < MAX_NR_ZONES; zid++)
516− nr_pages += mz->lru_zone_size[zid][lru];
517− return nr_pages;
518−}
519−
520509 static inline
521510 unsigned long mem_cgroup_get_zone_lru_size(struct lruvec *lruvec,
522511 enum lru_list lru, int zone_idx)
@@ -570,10 +559,9 @@ void unlock_page_memcg(struct page *page); · 47 unmodified lines
570559 * idx can be of type enum memcg_stat_item or node_stat_item.
571560 * Keep in sync with memcg_exact_page_state().
572561 */
573−static inline unsigned long memcg_page_state(struct mem_cgroup *memcg,
574− int idx)
562+static inline unsigned long memcg_page_state(struct mem_cgroup *memcg, int idx)
575563 {
576− long x = atomic_long_read(&memcg->stat[idx]);
564+ long x = atomic_long_read(&memcg->vmstats[idx]);
577565 #ifdef CONFIG_SMP
578566 if (x < 0)
579567 x = 0;
@@ -581,23 +569,23 @@ static inline unsigned long memcg_page_state(struct mem_cgroup *memcg, · 1 unmodified line
581569 return x;
582570 }
583571
584−/* idx can be of type enum memcg_stat_item or node_stat_item */
585−static inline void __mod_memcg_state(struct mem_cgroup *memcg,
586− int idx, int val)
572+/*
573+ * idx can be of type enum memcg_stat_item or node_stat_item.
574+ * Keep in sync with memcg_exact_page_state().
575+ */
576+static inline unsigned long memcg_page_state_local(struct mem_cgroup *memcg,
577+ int idx)
587578 {
588− long x;
589−
590− if (mem_cgroup_disabled())
591− return;
592−
593− x = val + __this_cpu_read(memcg->stat_cpu->count[idx]);
594− if (unlikely(abs(x) > MEMCG_CHARGE_BATCH)) {
595− atomic_long_add(x, &memcg->stat[idx]);
579+ long x = atomic_long_read(&memcg->vmstats_local[idx]);
580+#ifdef CONFIG_SMP
581+ if (x < 0)
596582 x = 0;
597− }
598− __this_cpu_write(memcg->stat_cpu->count[idx], x);
583+#endif
584+ return x;
599585 }
600586
587+void __mod_memcg_state(struct mem_cgroup *memcg, int idx, int val);
588+
601589 /* idx can be of type enum memcg_stat_item or node_stat_item */
602590 static inline void mod_memcg_state(struct mem_cgroup *memcg,
603591 int idx, int val)
@@ -658,32 +646,27 @@ static inline unsigned long lruvec_page_state(struct lruvec *lruvec, · 54 unmodified lines
658646 return x;
659647 }
660648
661−static inline void __mod_lruvec_state(struct lruvec *lruvec,
662− enum node_stat_item idx, int val)
649+static inline unsigned long lruvec_page_state_local(struct lruvec *lruvec,
650+ enum node_stat_item idx)
663651 {
664652 struct mem_cgroup_per_node *pn;
665653 long x;
666654
667− /* Update node */
668− __mod_node_page_state(lruvec_pgdat(lruvec), idx, val);
669−
670655 if (mem_cgroup_disabled())
671− return;
656+ return node_page_state(lruvec_pgdat(lruvec), idx);
672657
673658 pn = container_of(lruvec, struct mem_cgroup_per_node, lruvec);
674−
675− /* Update memcg */
676− __mod_memcg_state(pn->memcg, idx, val);
677−
678− /* Update lruvec */
679− x = val + __this_cpu_read(pn->lruvec_stat_cpu->count[idx]);
680− if (unlikely(abs(x) > MEMCG_CHARGE_BATCH)) {
681− atomic_long_add(x, &pn->lruvec_stat[idx]);
659+ x = atomic_long_read(&pn->lruvec_stat_local[idx]);
660+#ifdef CONFIG_SMP
661+ if (x < 0)
682662 x = 0;
683− }
684− __this_cpu_write(pn->lruvec_stat_cpu->count[idx], x);
663+#endif
664+ return x;
685665 }
686666
667+void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx,
668+ int val);
669+
687670 static inline void mod_lruvec_state(struct lruvec *lruvec,
688671 enum node_stat_item idx, int val)
689672 {
@@ -724,22 +707,8 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, · 34 unmodified lines
724707 gfp_t gfp_mask,
725708 unsigned long *total_scanned);
726709
727−static inline void __count_memcg_events(struct mem_cgroup *memcg,
728− enum vm_event_item idx,
729− unsigned long count)
730−{
731− unsigned long x;
732−
733− if (mem_cgroup_disabled())
734− return;
735−
736− x = count + __this_cpu_read(memcg->stat_cpu->events[idx]);
737− if (unlikely(x > MEMCG_CHARGE_BATCH)) {
738− atomic_long_add(x, &memcg->events[idx]);
739− x = 0;
740− }
741− __this_cpu_write(memcg->stat_cpu->events[idx], x);
742−}
710+void __count_memcg_events(struct mem_cgroup *memcg, enum vm_event_item idx,
711+ unsigned long count);
743712
744713 static inline void count_memcg_events(struct mem_cgroup *memcg,
745714 enum vm_event_item idx,
@@ -960,11 +929,6 @@ static inline bool mem_cgroup_online(struct mem_cgroup *memcg) · 214 unmodified lines
960929 return true;
961930 }
962931
963−static inline unsigned long
964−mem_cgroup_get_lru_size(struct lruvec *lruvec, enum lru_list lru)
965−{
966− return 0;
967−}
968932 static inline
969933 unsigned long mem_cgroup_get_zone_lru_size(struct lruvec *lruvec,
970934 enum lru_list lru, int zone_idx)
@@ -972,13 +936,6 @@ unsigned long mem_cgroup_get_zone_lru_size(struct lruvec *lruvec, · 1 unmodified line
972936 return 0;
973937 }
974938
975−static inline unsigned long
976−mem_cgroup_node_nr_lru_pages(struct mem_cgroup *memcg,
977− int nid, unsigned int lru_mask)
978−{
979− return 0;
980−}
981−
982939 static inline unsigned long mem_cgroup_get_max(struct mem_cgroup *memcg)
983940 {
984941 return 0;
@@ -1039,8 +996,13 @@ static inline void mem_cgroup_print_oom_group(struct mem_cgroup *memcg) · 54 unmodified lines
1039996 {
1040997 }
1041998
1042−static inline unsigned long memcg_page_state(struct mem_cgroup *memcg,
1043− int idx)
999+static inline unsigned long memcg_page_state(struct mem_cgroup *memcg, int idx)
1000+{
1001+ return 0;
1002+}
1003+
1004+static inline unsigned long memcg_page_state_local(struct mem_cgroup *memcg,
1005+ int idx)
10441006 {
10451007 return 0;
10461008 }
@@ -1075,6 +1037,12 @@ static inline unsigned long lruvec_page_state(struct lruvec *lruvec, · 28 unmodified lines
10751037 return node_page_state(lruvec_pgdat(lruvec), idx);
10761038 }
10771039
1040+static inline unsigned long lruvec_page_state_local(struct lruvec *lruvec,
1041+ enum node_stat_item idx)
1042+{
1043+ return node_page_state(lruvec_pgdat(lruvec), idx);
1044+}
1045+
10781046 static inline void __mod_lruvec_state(struct lruvec *lruvec,
10791047 enum node_stat_item idx, int val)
10801048 {
@@ -1117,6 +1085,12 @@ static inline void count_memcg_events(struct mem_cgroup *memcg, · 36 unmodified lines
11171085 {
11181086 }
11191087
1088+static inline void __count_memcg_events(struct mem_cgroup *memcg,
1089+ enum vm_event_item idx,
1090+ unsigned long count)
1091+{
1092+}
1093+
11201094 static inline void count_memcg_page_event(struct page *page,
11211095 int idx)
11221096 {
include/linux/memory.h+1−1
@@ -113,7 +113,7 @@ extern int register_memory_isolate_notifier(struct notifier_block *nb); · 112 unmodified lines
113113 extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
114114 int hotplug_memory_register(int nid, struct mem_section *section);
115115 #ifdef CONFIG_MEMORY_HOTREMOVE
116−extern int unregister_memory_section(struct mem_section *);
116+extern void unregister_memory_section(struct mem_section *);
117117 #endif
118118 extern int memory_dev_init(void);
119119 extern int memory_notify(unsigned long val, void *v);
include/linux/memory_hotplug.h+30−12
@@ -53,6 +53,16 @@ enum { · 52 unmodified lines
5353 MMOP_ONLINE_MOVABLE,
5454 };
5555
56+/*
57+ * Restrictions for the memory hotplug:
58+ * flags: MHP_ flags
59+ * altmap: alternative allocator for memmap array
60+ */
61+struct mhp_restrictions {
62+ unsigned long flags;
63+ struct vmem_altmap *altmap;
64+};
65+
5666 /*
5767 * Zone resizing functions
5868 *
@@ -87,7 +97,8 @@ extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); · 28 unmodified lines
8797 extern int online_pages(unsigned long, unsigned long, int);
8898 extern int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn,
8999 unsigned long *valid_start, unsigned long *valid_end);
90−extern void __offline_isolated_pages(unsigned long, unsigned long);
100+extern unsigned long __offline_isolated_pages(unsigned long start_pfn,
101+ unsigned long end_pfn);
91102
92103 typedef void (*online_page_callback_t)(struct page *page, unsigned int order);
93104
@@ -100,6 +111,8 @@ extern void __online_page_free(struct page *page); · 6 unmodified lines
100111
101112 extern int try_online_node(int nid);
102113
114+extern int arch_add_memory(int nid, u64 start, u64 size,
115+ struct mhp_restrictions *restrictions);
103116 extern u64 max_mem_size;
104117
105118 extern bool memhp_auto_online;
@@ -111,26 +124,33 @@ static inline bool movable_node_is_enabled(void) · 5 unmodified lines
111124 }
112125
113126 #ifdef CONFIG_MEMORY_HOTREMOVE
114−extern int arch_remove_memory(int nid, u64 start, u64 size,
115− struct vmem_altmap *altmap);
116−extern int __remove_pages(struct zone *zone, unsigned long start_pfn,
117− unsigned long nr_pages, struct vmem_altmap *altmap);
127+extern void arch_remove_memory(int nid, u64 start, u64 size,
128+ struct vmem_altmap *altmap);
129+extern void __remove_pages(struct zone *zone, unsigned long start_pfn,
130+ unsigned long nr_pages, struct vmem_altmap *altmap);
118131 #endif /* CONFIG_MEMORY_HOTREMOVE */
119132
133+/*
134+ * Do we want sysfs memblock files created. This will allow userspace to online
135+ * and offline memory explicitly. Lack of this bit means that the caller has to
136+ * call move_pfn_range_to_zone to finish the initialization.
137+ */
138+
139+#define MHP_MEMBLOCK_API (1<<0)
140+
120141 /* reasonably generic interface to expand the physical pages */
121142 extern int __add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages,
122− struct vmem_altmap *altmap, bool want_memblock);
143+ struct mhp_restrictions *restrictions);
123144
124145 #ifndef CONFIG_ARCH_HAS_ADD_PAGES
125146 static inline int add_pages(int nid, unsigned long start_pfn,
126− unsigned long nr_pages, struct vmem_altmap *altmap,
127− bool want_memblock)
147+ unsigned long nr_pages, struct mhp_restrictions *restrictions)
128148 {
129− return __add_pages(nid, start_pfn, nr_pages, altmap, want_memblock);
149+ return __add_pages(nid, start_pfn, nr_pages, restrictions);
130150 }
131151 #else /* ARCH_HAS_ADD_PAGES */
132152 int add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages,
133− struct vmem_altmap *altmap, bool want_memblock);
153+ struct mhp_restrictions *restrictions);
134154 #endif /* ARCH_HAS_ADD_PAGES */
135155
136156 #ifdef CONFIG_NUMA
@@ -331,8 +351,6 @@ extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn, · 194 unmodified lines
331351 extern int __add_memory(int nid, u64 start, u64 size);
332352 extern int add_memory(int nid, u64 start, u64 size);
333353 extern int add_memory_resource(int nid, struct resource *resource);
334−extern int arch_add_memory(int nid, u64 start, u64 size,
335− struct vmem_altmap *altmap, bool want_memblock);
336354 extern void move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn,
337355 unsigned long nr_pages, struct vmem_altmap *altmap);
338356 extern bool is_memblock_offlined(struct memory_block *mem);
include/linux/mfd/altera-sysmgr.h+29−0
@@ -0,0 +1,29 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright (C) 2018-2019 Intel Corporation
4+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
5+ * Copyright (C) 2012 Linaro Ltd.
6+ */
7+
8+#ifndef __LINUX_MFD_ALTERA_SYSMGR_H__
9+#define __LINUX_MFD_ALTERA_SYSMGR_H__
10+
11+#include <linux/err.h>
12+#include <linux/errno.h>
13+#include <linux/firmware/intel/stratix10-smc.h>
14+
15+struct device_node;
16+
17+#ifdef CONFIG_MFD_ALTERA_SYSMGR
18+struct regmap *altr_sysmgr_regmap_lookup_by_phandle(struct device_node *np,
19+ const char *property);
20+#else
21+static inline struct regmap *
22+altr_sysmgr_regmap_lookup_by_phandle(struct device_node *np,
23+ const char *property)
24+{
25+ return ERR_PTR(-ENOTSUPP);
26+}
27+#endif
28+
29+#endif /* __LINUX_MFD_ALTERA_SYSMGR_H__ */
include/linux/mfd/cros_ec.h+5−0
@@ -23,7 +23,10 @@ · 22 unmodified lines
2323 #include <linux/mutex.h>
2424
2525 #define CROS_EC_DEV_NAME "cros_ec"
26+#define CROS_EC_DEV_FP_NAME "cros_fp"
2627 #define CROS_EC_DEV_PD_NAME "cros_pd"
28+#define CROS_EC_DEV_TP_NAME "cros_tp"
29+#define CROS_EC_DEV_ISH_NAME "cros_ish"
2730
2831 /*
2932 * The EC is unresponsive for a time after a reboot command. Add a
@@ -120,6 +123,7 @@ struct cros_ec_command { · 90 unmodified lines
120123 * @pkt_xfer: Send packet to EC and get response.
121124 * @lock: One transaction at a time.
122125 * @mkbp_event_supported: True if this EC supports the MKBP event protocol.
126+ * @host_sleep_v1: True if this EC supports the sleep v1 command.
123127 * @event_notifier: Interrupt event notifier for transport devices.
124128 * @event_data: Raw payload transferred with the MKBP event.
125129 * @event_size: Size in bytes of the event data.
@@ -153,6 +157,7 @@ struct cros_ec_device { · 27 unmodified lines
153157 struct cros_ec_command *msg);
154158 struct mutex lock;
155159 bool mkbp_event_supported;
160+ bool host_sleep_v1;
156161 struct blocking_notifier_head event_notifier;
157162
158163 struct ec_response_get_next_event_v1 event_data;
include/linux/mfd/cros_ec_commands.h+90−1
@@ -840,7 +840,7 @@ enum ec_feature_code { · 839 unmodified lines
840840 * (Common Smart Battery System Interface Specification)
841841 */
842842 EC_FEATURE_SMART_BATTERY = 18,
843− /* EC can dectect when the host hangs. */
843+ /* EC can detect when the host hangs. */
844844 EC_FEATURE_HANG_DETECT = 19,
845845 /* Report power information, for pit only */
846846 EC_FEATURE_PMU = 20,
@@ -852,10 +852,42 @@ enum ec_feature_code { · 5 unmodified lines
852852 EC_FEATURE_USB_MUX = 23,
853853 /* Motion Sensor code has an internal software FIFO */
854854 EC_FEATURE_MOTION_SENSE_FIFO = 24,
855+ /* Support temporary secure vstore */
856+ EC_FEATURE_VSTORE = 25,
857+ /* EC decides on USB-C SS mux state, muxes configured by host */
858+ EC_FEATURE_USBC_SS_MUX_VIRTUAL = 26,
855859 /* EC has RTC feature that can be controlled by host commands */
856860 EC_FEATURE_RTC = 27,
861+ /* The MCU exposes a Fingerprint sensor */
862+ EC_FEATURE_FINGERPRINT = 28,
863+ /* The MCU exposes a Touchpad */
864+ EC_FEATURE_TOUCHPAD = 29,
865+ /* The MCU has RWSIG task enabled */
866+ EC_FEATURE_RWSIG = 30,
867+ /* EC has device events support */
868+ EC_FEATURE_DEVICE_EVENT = 31,
869+ /* EC supports the unified wake masks for LPC/eSPI systems */
870+ EC_FEATURE_UNIFIED_WAKE_MASKS = 32,
871+ /* EC supports 64-bit host events */
872+ EC_FEATURE_HOST_EVENT64 = 33,
873+ /* EC runs code in RAM (not in place, a.k.a. XIP) */
874+ EC_FEATURE_EXEC_IN_RAM = 34,
857875 /* EC supports CEC commands */
858876 EC_FEATURE_CEC = 35,
877+ /* EC supports tight sensor timestamping. */
878+ EC_FEATURE_MOTION_SENSE_TIGHT_TIMESTAMPS = 36,
879+ /*
880+ * EC supports tablet mode detection aligned to Chrome and allows
881+ * setting of threshold by host command using
882+ * MOTIONSENSE_CMD_TABLET_MODE_LID_ANGLE.
883+ */
884+ EC_FEATURE_REFINED_TABLET_MODE_HYSTERESIS = 37,
885+ /* EC supports audio codec. */
886+ EC_FEATURE_AUDIO_CODEC = 38,
887+ /* EC Supports SCP. */
888+ EC_FEATURE_SCP = 39,
889+ /* The MCU is an Integrated Sensor Hub */
890+ EC_FEATURE_ISH = 40,
859891 };
860892
861893 #define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32))
@@ -2729,6 +2761,63 @@ struct ec_params_host_sleep_event { · 1867 unmodified lines
27292761 uint8_t sleep_event;
27302762 } __packed;
27312763
2764+/*
2765+ * Use a default timeout value (CONFIG_SLEEP_TIMEOUT_MS) for detecting sleep
2766+ * transition failures
2767+ */
2768+#define EC_HOST_SLEEP_TIMEOUT_DEFAULT 0
2769+
2770+/* Disable timeout detection for this sleep transition */
2771+#define EC_HOST_SLEEP_TIMEOUT_INFINITE 0xFFFF
2772+
2773+struct ec_params_host_sleep_event_v1 {
2774+ /* The type of sleep being entered or exited. */
2775+ uint8_t sleep_event;
2776+
2777+ /* Padding */
2778+ uint8_t reserved;
2779+ union {
2780+ /* Parameters that apply for suspend messages. */
2781+ struct {
2782+ /*
2783+ * The timeout in milliseconds between when this message
2784+ * is received and when the EC will declare sleep
2785+ * transition failure if the sleep signal is not
2786+ * asserted.
2787+ */
2788+ uint16_t sleep_timeout_ms;
2789+ } suspend_params;
2790+
2791+ /* No parameters for non-suspend messages. */
2792+ };
2793+} __packed;
2794+
2795+/* A timeout occurred when this bit is set */
2796+#define EC_HOST_RESUME_SLEEP_TIMEOUT 0x80000000
2797+
2798+/*
2799+ * The mask defining which bits correspond to the number of sleep transitions,
2800+ * as well as the maximum number of suspend line transitions that will be
2801+ * reported back to the host.
2802+ */
2803+#define EC_HOST_RESUME_SLEEP_TRANSITIONS_MASK 0x7FFFFFFF
2804+
2805+struct ec_response_host_sleep_event_v1 {
2806+ union {
2807+ /* Response fields that apply for resume messages. */
2808+ struct {
2809+ /*
2810+ * The number of sleep power signal transitions that
2811+ * occurred since the suspend message. The high bit
2812+ * indicates a timeout occurred.
2813+ */
2814+ uint32_t sleep_transitions;
2815+ } resume_response;
2816+
2817+ /* No response fields for non-resume messages. */
2818+ };
2819+} __packed;
2820+
27322821 /*****************************************************************************/
27332822 /* Smart battery pass-through */
27342823
include/linux/mfd/da9063/core.h+1−6
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Definitions for DA9063 MFD driver
34 *
@@ -5,12 +6,6 @@ · 1 unmodified line
56 *
67 * Author: Michal Hajduk, Dialog Semiconductor
78 * Author: Krystian Garbaciak, Dialog Semiconductor
8− *
9− * This program is free software; you can redistribute it and/or modify it
10− * under the terms of the GNU General Public License as published by the
11− * Free Software Foundation; either version 2 of the License, or (at your
12− * option) any later version.
13− *
149 */
1510
1611 #ifndef __MFD_DA9063_CORE_H__
include/linux/mfd/da9063/registers.h+4−9
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Registers definition for DA9063 modules
34 *
@@ -5,12 +6,6 @@ · 1 unmodified line
56 *
67 * Author: Michal Hajduk, Dialog Semiconductor
78 * Author: Krystian Garbaciak, Dialog Semiconductor
8− *
9− * This program is free software; you can redistribute it and/or modify it
10− * under the terms of the GNU General Public License as published by the
11− * Free Software Foundation; either version 2 of the License, or (at your
12− * option) any later version.
13− *
149 */
1510
1611 #ifndef _DA9063_REG_H
@@ -215,9 +210,9 @@ · 198 unmodified lines
215210
216211 /* DA9063 Configuration registers */
217212 /* OTP */
218−#define DA9063_REG_OPT_COUNT 0x101
219−#define DA9063_REG_OPT_ADDR 0x102
220−#define DA9063_REG_OPT_DATA 0x103
213+#define DA9063_REG_OTP_CONT 0x101
214+#define DA9063_REG_OTP_ADDR 0x102
215+#define DA9063_REG_OTP_DATA 0x103
221216
222217 /* Customer Trim and Configuration */
223218 #define DA9063_REG_T_OFFSET 0x104
include/linux/mfd/max77620.h+3−2
@@ -136,8 +136,8 @@ · 135 unmodified lines
136136 #define MAX77620_FPS_PERIOD_MIN_US 40
137137 #define MAX20024_FPS_PERIOD_MIN_US 20
138138
139−#define MAX77620_FPS_PERIOD_MAX_US 2560
140−#define MAX20024_FPS_PERIOD_MAX_US 5120
139+#define MAX20024_FPS_PERIOD_MAX_US 2560
140+#define MAX77620_FPS_PERIOD_MAX_US 5120
141141
142142 #define MAX77620_REG_FPS_GPIO1 0x54
143143 #define MAX77620_REG_FPS_GPIO2 0x55
@@ -324,6 +324,7 @@ enum max77620_fps_src { · 180 unmodified lines
324324 enum max77620_chip_id {
325325 MAX77620,
326326 MAX20024,
327+ MAX77663,
327328 };
328329
329330 struct max77620_chip {
include/linux/mfd/max77650.h+59−0
@@ -0,0 +1,59 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright (C) 2018 BayLibre SAS
4+ * Author: Bartosz Golaszewski <bgolaszewski@baylibre.com>
5+ *
6+ * Common definitions for MAXIM 77650/77651 charger/power-supply.
7+ */
8+
9+#ifndef MAX77650_H
10+#define MAX77650_H
11+
12+#include <linux/bits.h>
13+
14+#define MAX77650_REG_INT_GLBL 0x00
15+#define MAX77650_REG_INT_CHG 0x01
16+#define MAX77650_REG_STAT_CHG_A 0x02
17+#define MAX77650_REG_STAT_CHG_B 0x03
18+#define MAX77650_REG_ERCFLAG 0x04
19+#define MAX77650_REG_STAT_GLBL 0x05
20+#define MAX77650_REG_INTM_GLBL 0x06
21+#define MAX77650_REG_INTM_CHG 0x07
22+#define MAX77650_REG_CNFG_GLBL 0x10
23+#define MAX77650_REG_CID 0x11
24+#define MAX77650_REG_CNFG_GPIO 0x12
25+#define MAX77650_REG_CNFG_CHG_A 0x18
26+#define MAX77650_REG_CNFG_CHG_B 0x19
27+#define MAX77650_REG_CNFG_CHG_C 0x1a
28+#define MAX77650_REG_CNFG_CHG_D 0x1b
29+#define MAX77650_REG_CNFG_CHG_E 0x1c
30+#define MAX77650_REG_CNFG_CHG_F 0x1d
31+#define MAX77650_REG_CNFG_CHG_G 0x1e
32+#define MAX77650_REG_CNFG_CHG_H 0x1f
33+#define MAX77650_REG_CNFG_CHG_I 0x20
34+#define MAX77650_REG_CNFG_SBB_TOP 0x28
35+#define MAX77650_REG_CNFG_SBB0_A 0x29
36+#define MAX77650_REG_CNFG_SBB0_B 0x2a
37+#define MAX77650_REG_CNFG_SBB1_A 0x2b
38+#define MAX77650_REG_CNFG_SBB1_B 0x2c
39+#define MAX77650_REG_CNFG_SBB2_A 0x2d
40+#define MAX77650_REG_CNFG_SBB2_B 0x2e
41+#define MAX77650_REG_CNFG_LDO_A 0x38
42+#define MAX77650_REG_CNFG_LDO_B 0x39
43+#define MAX77650_REG_CNFG_LED0_A 0x40
44+#define MAX77650_REG_CNFG_LED1_A 0x41
45+#define MAX77650_REG_CNFG_LED2_A 0x42
46+#define MAX77650_REG_CNFG_LED0_B 0x43
47+#define MAX77650_REG_CNFG_LED1_B 0x44
48+#define MAX77650_REG_CNFG_LED2_B 0x45
49+#define MAX77650_REG_CNFG_LED_TOP 0x46
50+
51+#define MAX77650_CID_MASK GENMASK(3, 0)
52+#define MAX77650_CID_BITS(_reg) (_reg & MAX77650_CID_MASK)
53+
54+#define MAX77650_CID_77650A 0x03
55+#define MAX77650_CID_77650C 0x0a
56+#define MAX77650_CID_77651A 0x06
57+#define MAX77650_CID_77651B 0x08
58+
59+#endif /* MAX77650_H */
include/linux/mfd/palmas.h+0−1
@@ -553,7 +553,6 @@ struct palmas_pmic { · 552 unmodified lines
553553 struct palmas *palmas;
554554 struct device *dev;
555555 struct regulator_desc desc[PALMAS_NUM_REGS];
556− struct regulator_dev *rdev[PALMAS_NUM_REGS];
557556 struct mutex mutex;
558557
559558 int smps123;
include/linux/mfd/stmfx.h+123−0
@@ -0,0 +1,123 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright (C) 2019 STMicroelectronics
4+ * Author(s): Amelie Delaunay <amelie.delaunay@st.com>.
5+ */
6+
7+#ifndef MFD_STMFX_H
8+#define MFX_STMFX_H
9+
10+#include <linux/regmap.h>
11+
12+/* General */
13+#define STMFX_REG_CHIP_ID 0x00 /* R */
14+#define STMFX_REG_FW_VERSION_MSB 0x01 /* R */
15+#define STMFX_REG_FW_VERSION_LSB 0x02 /* R */
16+#define STMFX_REG_SYS_CTRL 0x40 /* RW */
17+/* IRQ output management */
18+#define STMFX_REG_IRQ_OUT_PIN 0x41 /* RW */
19+#define STMFX_REG_IRQ_SRC_EN 0x42 /* RW */
20+#define STMFX_REG_IRQ_PENDING 0x08 /* R */
21+#define STMFX_REG_IRQ_ACK 0x44 /* RW */
22+/* GPIO management */
23+#define STMFX_REG_IRQ_GPI_PENDING1 0x0C /* R */
24+#define STMFX_REG_IRQ_GPI_PENDING2 0x0D /* R */
25+#define STMFX_REG_IRQ_GPI_PENDING3 0x0E /* R */
26+#define STMFX_REG_GPIO_STATE1 0x10 /* R */
27+#define STMFX_REG_GPIO_STATE2 0x11 /* R */
28+#define STMFX_REG_GPIO_STATE3 0x12 /* R */
29+#define STMFX_REG_IRQ_GPI_SRC1 0x48 /* RW */
30+#define STMFX_REG_IRQ_GPI_SRC2 0x49 /* RW */
31+#define STMFX_REG_IRQ_GPI_SRC3 0x4A /* RW */
32+#define STMFX_REG_IRQ_GPI_EVT1 0x4C /* RW */
33+#define STMFX_REG_IRQ_GPI_EVT2 0x4D /* RW */
34+#define STMFX_REG_IRQ_GPI_EVT3 0x4E /* RW */
35+#define STMFX_REG_IRQ_GPI_TYPE1 0x50 /* RW */
36+#define STMFX_REG_IRQ_GPI_TYPE2 0x51 /* RW */
37+#define STMFX_REG_IRQ_GPI_TYPE3 0x52 /* RW */
38+#define STMFX_REG_IRQ_GPI_ACK1 0x54 /* RW */
39+#define STMFX_REG_IRQ_GPI_ACK2 0x55 /* RW */
40+#define STMFX_REG_IRQ_GPI_ACK3 0x56 /* RW */
41+#define STMFX_REG_GPIO_DIR1 0x60 /* RW */
42+#define STMFX_REG_GPIO_DIR2 0x61 /* RW */
43+#define STMFX_REG_GPIO_DIR3 0x62 /* RW */
44+#define STMFX_REG_GPIO_TYPE1 0x64 /* RW */
45+#define STMFX_REG_GPIO_TYPE2 0x65 /* RW */
46+#define STMFX_REG_GPIO_TYPE3 0x66 /* RW */
47+#define STMFX_REG_GPIO_PUPD1 0x68 /* RW */
48+#define STMFX_REG_GPIO_PUPD2 0x69 /* RW */
49+#define STMFX_REG_GPIO_PUPD3 0x6A /* RW */
50+#define STMFX_REG_GPO_SET1 0x6C /* RW */
51+#define STMFX_REG_GPO_SET2 0x6D /* RW */
52+#define STMFX_REG_GPO_SET3 0x6E /* RW */
53+#define STMFX_REG_GPO_CLR1 0x70 /* RW */
54+#define STMFX_REG_GPO_CLR2 0x71 /* RW */
55+#define STMFX_REG_GPO_CLR3 0x72 /* RW */
56+
57+#define STMFX_REG_MAX 0xB0
58+
59+/* MFX boot time is around 10ms, so after reset, we have to wait this delay */
60+#define STMFX_BOOT_TIME_MS 10
61+
62+/* STMFX_REG_CHIP_ID bitfields */
63+#define STMFX_REG_CHIP_ID_MASK GENMASK(7, 0)
64+
65+/* STMFX_REG_SYS_CTRL bitfields */
66+#define STMFX_REG_SYS_CTRL_GPIO_EN BIT(0)
67+#define STMFX_REG_SYS_CTRL_TS_EN BIT(1)
68+#define STMFX_REG_SYS_CTRL_IDD_EN BIT(2)
69+#define STMFX_REG_SYS_CTRL_ALTGPIO_EN BIT(3)
70+#define STMFX_REG_SYS_CTRL_SWRST BIT(7)
71+
72+/* STMFX_REG_IRQ_OUT_PIN bitfields */
73+#define STMFX_REG_IRQ_OUT_PIN_TYPE BIT(0) /* 0-OD 1-PP */
74+#define STMFX_REG_IRQ_OUT_PIN_POL BIT(1) /* 0-active LOW 1-active HIGH */
75+
76+/* STMFX_REG_IRQ_(SRC_EN/PENDING/ACK) bit shift */
77+enum stmfx_irqs {
78+ STMFX_REG_IRQ_SRC_EN_GPIO = 0,
79+ STMFX_REG_IRQ_SRC_EN_IDD,
80+ STMFX_REG_IRQ_SRC_EN_ERROR,
81+ STMFX_REG_IRQ_SRC_EN_TS_DET,
82+ STMFX_REG_IRQ_SRC_EN_TS_NE,
83+ STMFX_REG_IRQ_SRC_EN_TS_TH,
84+ STMFX_REG_IRQ_SRC_EN_TS_FULL,
85+ STMFX_REG_IRQ_SRC_EN_TS_OVF,
86+ STMFX_REG_IRQ_SRC_MAX,
87+};
88+
89+enum stmfx_functions {
90+ STMFX_FUNC_GPIO = BIT(0), /* GPIO[15:0] */
91+ STMFX_FUNC_ALTGPIO_LOW = BIT(1), /* aGPIO[3:0] */
92+ STMFX_FUNC_ALTGPIO_HIGH = BIT(2), /* aGPIO[7:4] */
93+ STMFX_FUNC_TS = BIT(3),
94+ STMFX_FUNC_IDD = BIT(4),
95+};
96+
97+/**
98+ * struct stmfx_ddata - STMFX MFD structure
99+ * @device: device reference used for logs
100+ * @map: register map
101+ * @vdd: STMFX power supply
102+ * @irq_domain: IRQ domain
103+ * @lock: IRQ bus lock
104+ * @irq_src: cache of IRQ_SRC_EN register for bus_lock
105+ * @bkp_sysctrl: backup of SYS_CTRL register for suspend/resume
106+ * @bkp_irqoutpin: backup of IRQ_OUT_PIN register for suspend/resume
107+ */
108+struct stmfx {
109+ struct device *dev;
110+ struct regmap *map;
111+ struct regulator *vdd;
112+ struct irq_domain *irq_domain;
113+ struct mutex lock; /* IRQ bus lock */
114+ u8 irq_src;
115+#ifdef CONFIG_PM
116+ u8 bkp_sysctrl;
117+ u8 bkp_irqoutpin;
118+#endif
119+};
120+
121+int stmfx_function_enable(struct stmfx *stmfx, u32 func);
122+int stmfx_function_disable(struct stmfx *stmfx, u32 func);
123+#endif
include/linux/mfd/syscon/atmel-matrix.h+1−5
@@ -1,12 +1,8 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Copyright (C) 2014 Atmel Corporation.
34 *
45 * Memory Controllers (MATRIX, EBI) - System peripherals registers.
5− *
6− * This program is free software; you can redistribute it and/or modify
7− * it under the terms of the GNU General Public License as published by
8− * the Free Software Foundation; either version 2 of the License, or
9− * (at your option) any later version.
106 */
117
128 #ifndef _LINUX_MFD_SYSCON_ATMEL_MATRIX_H
include/linux/mfd/syscon/atmel-mc.h+1−5
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Copyright (C) 2005 Ivan Kokshaysky
34 * Copyright (C) SAN People
@@ -5,11 +6,6 @@ · 1 unmodified line
56 * Memory Controllers (MC, EBI, SMC, SDRAMC, BFC) - System peripherals
67 * registers.
78 * Based on AT91RM9200 datasheet revision E.
8− *
9− * This program is free software; you can redistribute it and/or modify
10− * it under the terms of the GNU General Public License as published by
11− * the Free Software Foundation; either version 2 of the License, or
12− * (at your option) any later version.
139 */
1410
1511 #ifndef _LINUX_MFD_SYSCON_ATMEL_MC_H_
include/linux/mfd/syscon/atmel-smc.h+1−4
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * Atmel SMC (Static Memory Controller) register offsets and bit definitions.
34 *
@@ -5,10 +6,6 @@ · 1 unmodified line
56 * Copyright (C) 2014 Free Electrons
67 *
78 * Author: Boris Brezillon <boris.brezillon@free-electrons.com>
8− *
9− * This program is free software; you can redistribute it and/or modify
10− * it under the terms of the GNU General Public License version 2 as
11− * published by the Free Software Foundation.
129 */
1310
1411 #ifndef _LINUX_MFD_SYSCON_ATMEL_SMC_H_
include/linux/mfd/syscon/atmel-st.h+1−5
@@ -1,14 +1,10 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Copyright (C) 2005 Ivan Kokshaysky
34 * Copyright (C) SAN People
45 *
56 * System Timer (ST) - System peripherals registers.
67 * Based on AT91RM9200 datasheet revision E.
7− *
8− * This program is free software; you can redistribute it and/or modify
9− * it under the terms of the GNU General Public License as published by
10− * the Free Software Foundation; either version 2 of the License, or
11− * (at your option) any later version.
128 */
139
1410 #ifndef _LINUX_MFD_SYSCON_ATMEL_ST_H
include/linux/mfd/syscon/imx6q-iomuxc-gpr.h+9−0
@@ -410,6 +410,15 @@ · 409 unmodified lines
410410 #define IMX6SX_GPR1_FEC_CLOCK_PAD_DIR_MASK (0x3 << 17)
411411 #define IMX6SX_GPR1_FEC_CLOCK_MUX_SEL_EXT (0x3 << 13)
412412
413+#define IMX6SX_GPR2_MQS_OVERSAMPLE_MASK (0x1 << 26)
414+#define IMX6SX_GPR2_MQS_OVERSAMPLE_SHIFT (26)
415+#define IMX6SX_GPR2_MQS_EN_MASK (0x1 << 25)
416+#define IMX6SX_GPR2_MQS_EN_SHIFT (25)
417+#define IMX6SX_GPR2_MQS_SW_RST_MASK (0x1 << 24)
418+#define IMX6SX_GPR2_MQS_SW_RST_SHIFT (24)
419+#define IMX6SX_GPR2_MQS_CLK_DIV_MASK (0xFF << 16)
420+#define IMX6SX_GPR2_MQS_CLK_DIV_SHIFT (16)
421+
413422 #define IMX6SX_GPR4_FEC_ENET1_STOP_REQ (0x1 << 3)
414423 #define IMX6SX_GPR4_FEC_ENET2_STOP_REQ (0x1 << 4)
415424
include/linux/mfd/ti-lmu-register.h+0−44
@@ -15,50 +15,6 @@ · 14 unmodified lines
1515
1616 #include <linux/bitops.h>
1717
18−/* LM3532 */
19−#define LM3532_REG_OUTPUT_CFG 0x10
20−#define LM3532_ILED1_CFG_MASK 0x03
21−#define LM3532_ILED2_CFG_MASK 0x0C
22−#define LM3532_ILED3_CFG_MASK 0x30
23−#define LM3532_ILED1_CFG_SHIFT 0
24−#define LM3532_ILED2_CFG_SHIFT 2
25−#define LM3532_ILED3_CFG_SHIFT 4
26−
27−#define LM3532_REG_RAMPUP 0x12
28−#define LM3532_REG_RAMPDN LM3532_REG_RAMPUP
29−#define LM3532_RAMPUP_MASK 0x07
30−#define LM3532_RAMPUP_SHIFT 0
31−#define LM3532_RAMPDN_MASK 0x38
32−#define LM3532_RAMPDN_SHIFT 3
33−
34−#define LM3532_REG_ENABLE 0x1D
35−
36−#define LM3532_REG_PWM_A_CFG 0x13
37−#define LM3532_PWM_A_MASK 0x05 /* zone 0 */
38−#define LM3532_PWM_ZONE_0 BIT(2)
39−
40−#define LM3532_REG_PWM_B_CFG 0x14
41−#define LM3532_PWM_B_MASK 0x09 /* zone 1 */
42−#define LM3532_PWM_ZONE_1 BIT(3)
43−
44−#define LM3532_REG_PWM_C_CFG 0x15
45−#define LM3532_PWM_C_MASK 0x11 /* zone 2 */
46−#define LM3532_PWM_ZONE_2 BIT(4)
47−
48−#define LM3532_REG_ZONE_CFG_A 0x16
49−#define LM3532_REG_ZONE_CFG_B 0x18
50−#define LM3532_REG_ZONE_CFG_C 0x1A
51−#define LM3532_ZONE_MASK (BIT(2) | BIT(3) | BIT(4))
52−#define LM3532_ZONE_0 0
53−#define LM3532_ZONE_1 BIT(2)
54−#define LM3532_ZONE_2 BIT(3)
55−
56−#define LM3532_REG_BRT_A 0x70 /* zone 0 */
57−#define LM3532_REG_BRT_B 0x76 /* zone 1 */
58−#define LM3532_REG_BRT_C 0x7C /* zone 2 */
59−
60−#define LM3532_MAX_REG 0x7E
61−
6218 /* LM3631 */
6319 #define LM3631_REG_DEVCTRL 0x00
6420 #define LM3631_LCD_EN_MASK BIT(1)
include/linux/mfd/ti-lmu.h+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 #define LMU_EVENT_MONITOR_DONE 0x01
2323
2424 enum ti_lmu_id {
25− LM3532,
2625 LM3631,
2726 LM3632,
2827 LM3633,
include/linux/mfd/wm831x/regulator.h+1−1
@@ -1213,6 +1213,6 @@ · 1212 unmodified lines
12131213 #define WM831X_LDO1_OK_WIDTH 1 /* LDO1_OK */
12141214
12151215 #define WM831X_ISINK_MAX_ISEL 55
1216−extern int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1];
1216+extern const unsigned int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1];
12171217
12181218 #endif
include/linux/mfd/wm8400-private.h+0−8
@@ -923,12 +923,4 @@ struct wm8400 { · 922 unmodified lines
923923 #define WM8400_LINE_CMP_VTHD_SHIFT 0 /* LINE_CMP_VTHD - [3:0] */
924924 #define WM8400_LINE_CMP_VTHD_WIDTH 4 /* LINE_CMP_VTHD - [3:0] */
925925
926−int wm8400_block_read(struct wm8400 *wm8400, u8 reg, int count, u16 *data);
927−
928−static inline int wm8400_set_bits(struct wm8400 *wm8400, u8 reg,
929− u16 mask, u16 val)
930−{
931− return regmap_update_bits(wm8400->regmap, reg, mask, val);
932−}
933−
934926 #endif
include/linux/mlx5/cq.h+1−1
@@ -170,7 +170,7 @@ static inline void mlx5_cq_arm(struct mlx5_core_cq *cq, u32 cmd, · 169 unmodified lines
170170 doorbell[0] = cpu_to_be32(sn << 28 | cmd | ci);
171171 doorbell[1] = cpu_to_be32(cq->cqn);
172172
173− mlx5_write64(doorbell, uar_page + MLX5_CQ_DOORBELL, NULL);
173+ mlx5_write64(doorbell, uar_page + MLX5_CQ_DOORBELL);
174174 }
175175
176176 static inline void mlx5_cq_hold(struct mlx5_core_cq *cq)
include/linux/mlx5/device.h+10−1
@@ -361,6 +361,7 @@ enum { · 360 unmodified lines
361361
362362 enum {
363363 MLX5_GENERAL_SUBTYPE_DELAY_DROP_TIMEOUT = 0x1,
364+ MLX5_GENERAL_SUBTYPE_PCI_POWER_CHANGE_EVENT = 0x5,
364365 };
365366
366367 enum {
@@ -1001,7 +1002,8 @@ enum { · 634 unmodified lines
10011002 MLX5_MATCH_OUTER_HEADERS = 1 << 0,
10021003 MLX5_MATCH_MISC_PARAMETERS = 1 << 1,
10031004 MLX5_MATCH_INNER_HEADERS = 1 << 2,
1004−
1005+ MLX5_MATCH_MISC_PARAMETERS_2 = 1 << 3,
1006+ MLX5_MATCH_MISC_PARAMETERS_3 = 1 << 4,
10051007 };
10061008
10071009 enum {
@@ -1045,6 +1047,7 @@ enum mlx5_mpls_supported_fields { · 37 unmodified lines
10451047 };
10461048
10471049 enum mlx5_flex_parser_protos {
1050+ MLX5_FLEX_PROTO_GENEVE = 1 << 3,
10481051 MLX5_FLEX_PROTO_CW_MPLS_GRE = 1 << 4,
10491052 MLX5_FLEX_PROTO_CW_MPLS_UDP = 1 << 5,
10501053 };
@@ -1166,6 +1169,12 @@ enum mlx5_qcam_feature_groups { · 115 unmodified lines
11661169 #define MLX5_CAP_FLOWTABLE_SNIFFER_TX_MAX(mdev, cap) \
11671170 MLX5_CAP_FLOWTABLE_MAX(mdev, flow_table_properties_nic_transmit_sniffer.cap)
11681171
1172+#define MLX5_CAP_FLOWTABLE_RDMA_RX(mdev, cap) \
1173+ MLX5_CAP_FLOWTABLE(mdev, flow_table_properties_nic_receive_rdma.cap)
1174+
1175+#define MLX5_CAP_FLOWTABLE_RDMA_RX_MAX(mdev, cap) \
1176+ MLX5_CAP_FLOWTABLE_MAX(mdev, flow_table_properties_nic_receive_rdma.cap)
1177+
11691178 #define MLX5_CAP_ESW_FLOWTABLE(mdev, cap) \
11701179 MLX5_GET(flow_table_eswitch_cap, \
11711180 mdev->caps.hca_cur[MLX5_CAP_ESWITCH_FLOW_TABLE], cap)
include/linux/mlx5/doorbell.h+9−30
@@ -36,46 +36,25 @@ · 35 unmodified lines
3636 #define MLX5_BF_OFFSET 0x800
3737 #define MLX5_CQ_DOORBELL 0x20
3838
39−#if BITS_PER_LONG == 64
4039 /* Assume that we can just write a 64-bit doorbell atomically. s390
4140 * actually doesn't have writeq() but S/390 systems don't even have
4241 * PCI so we won't worry about it.
42+ *
43+ * Note that the write is not atomic on 32-bit systems! In contrast to 64-bit
44+ * ones, it requires proper locking. mlx5_write64 doesn't do any locking, so use
45+ * it at your own discretion, protected by some kind of lock on 32 bits.
46+ *
47+ * TODO: use write{q,l}_relaxed()
4348 */
4449
45−#define MLX5_DECLARE_DOORBELL_LOCK(name)
46−#define MLX5_INIT_DOORBELL_LOCK(ptr) do { } while (0)
47−#define MLX5_GET_DOORBELL_LOCK(ptr) (NULL)
48−
49−static inline void mlx5_write64(__be32 val[2], void __iomem *dest,
50− spinlock_t *doorbell_lock)
50+static inline void mlx5_write64(__be32 val[2], void __iomem *dest)
5151 {
52+#if BITS_PER_LONG == 64
5253 __raw_writeq(*(u64 *)val, dest);
53−}
54−
5554 #else
56−
57−/* Just fall back to a spinlock to protect the doorbell if
58− * BITS_PER_LONG is 32 -- there's no portable way to do atomic 64-bit
59− * MMIO writes.
60− */
61−
62−#define MLX5_DECLARE_DOORBELL_LOCK(name) spinlock_t name;
63−#define MLX5_INIT_DOORBELL_LOCK(ptr) spin_lock_init(ptr)
64−#define MLX5_GET_DOORBELL_LOCK(ptr) (ptr)
65−
66−static inline void mlx5_write64(__be32 val[2], void __iomem *dest,
67− spinlock_t *doorbell_lock)
68−{
69− unsigned long flags;
70−
71− if (doorbell_lock)
72− spin_lock_irqsave(doorbell_lock, flags);
7355 __raw_writel((__force u32) val[0], dest);
7456 __raw_writel((__force u32) val[1], dest + 4);
75− if (doorbell_lock)
76− spin_unlock_irqrestore(doorbell_lock, flags);
77−}
78−
7957 #endif
58+}
8059
8160 #endif /* MLX5_DOORBELL_H */
include/linux/mlx5/driver.h+11−3
@@ -56,7 +56,6 @@ · 55 unmodified lines
5656
5757 enum {
5858 MLX5_BOARD_ID_LEN = 64,
59− MLX5_MAX_NAME_LEN = 16,
6059 };
6160
6261 enum {
@@ -133,6 +132,7 @@ enum { · 70 unmodified lines
133132 MLX5_REG_MTRC_CONF = 0x9041,
134133 MLX5_REG_MTRC_STDB = 0x9042,
135134 MLX5_REG_MTRC_CTRL = 0x9043,
135+ MLX5_REG_MPEIN = 0x9050,
136136 MLX5_REG_MPCNT = 0x9051,
137137 MLX5_REG_MTPPS = 0x9053,
138138 MLX5_REG_MTPPSE = 0x9054,
@@ -512,8 +512,13 @@ struct mlx5_rl_table { · 373 unmodified lines
512512 struct mlx5_rl_entry *rl_entry;
513513 };
514514
515+struct mlx5_core_roce {
516+ struct mlx5_flow_table *ft;
517+ struct mlx5_flow_group *fg;
518+ struct mlx5_flow_handle *allow_rule;
519+};
520+
515521 struct mlx5_priv {
516− char name[MLX5_MAX_NAME_LEN];
517522 struct mlx5_eq_table *eq_table;
518523
519524 /* pages stuff */
@@ -566,6 +571,7 @@ struct mlx5_priv { · 46 unmodified lines
566571 struct mlx5_lag *lag;
567572 struct mlx5_devcom *devcom;
568573 unsigned long pci_dev_data;
574+ struct mlx5_core_roce roce;
569575 struct mlx5_fc_stats fc_stats;
570576 struct mlx5_rl_table rl_table;
571577
@@ -642,6 +648,7 @@ struct mlx5_fw_tracer; · 70 unmodified lines
642648 struct mlx5_vxlan;
643649
644650 struct mlx5_core_dev {
651+ struct device *device;
645652 struct pci_dev *pdev;
646653 /* sync pci state */
647654 struct mutex pci_status_mutex;
@@ -662,6 +669,7 @@ struct mlx5_core_dev { · 14 unmodified lines
662669 u64 sys_image_guid;
663670 phys_addr_t iseg_base;
664671 struct mlx5_init_seg __iomem *iseg;
672+ phys_addr_t bar_addr;
665673 enum mlx5_device_state state;
666674 /* sync interface state */
667675 struct mutex intf_state_mutex;
@@ -681,7 +689,6 @@ struct mlx5_core_dev { · 13 unmodified lines
681689 #endif
682690 struct mlx5_clock clock;
683691 struct mlx5_ib_clock_info *clock_info;
684− struct page *clock_info_page;
685692 struct mlx5_fw_tracer *tracer;
686693 };
687694
@@ -887,6 +894,7 @@ void mlx5_cmd_mbox_status(void *out, u8 *status, u32 *syndrome); · 199 unmodified lines
887894 int mlx5_core_get_caps(struct mlx5_core_dev *dev, enum mlx5_cap_type cap_type);
888895 int mlx5_cmd_alloc_uar(struct mlx5_core_dev *dev, u32 *uarn);
889896 int mlx5_cmd_free_uar(struct mlx5_core_dev *dev, u32 uarn);
897+void mlx5_health_flush(struct mlx5_core_dev *dev);
890898 void mlx5_health_cleanup(struct mlx5_core_dev *dev);
891899 int mlx5_health_init(struct mlx5_core_dev *dev);
892900 void mlx5_start_health_poll(struct mlx5_core_dev *dev);
include/linux/mlx5/eswitch.h+1−1
@@ -35,7 +35,7 @@ struct mlx5_eswitch_rep_if { · 34 unmodified lines
3535 void (*unload)(struct mlx5_eswitch_rep *rep);
3636 void *(*get_proto_dev)(struct mlx5_eswitch_rep *rep);
3737 void *priv;
38− u8 state;
38+ atomic_t state;
3939 };
4040
4141 struct mlx5_eswitch_rep {
include/linux/mlx5/fs.h+7−0
@@ -73,6 +73,13 @@ enum mlx5_flow_namespace_type { · 72 unmodified lines
7373 MLX5_FLOW_NAMESPACE_SNIFFER_RX,
7474 MLX5_FLOW_NAMESPACE_SNIFFER_TX,
7575 MLX5_FLOW_NAMESPACE_EGRESS,
76+ MLX5_FLOW_NAMESPACE_RDMA_RX,
77+};
78+
79+enum {
80+ FDB_BYPASS_PATH,
81+ FDB_FAST_PATH,
82+ FDB_SLOW_PATH,
7683 };
7784
7885 struct mlx5_flow_table;
include/linux/mlx5/mlx5_ifc.h+168−17
@@ -80,6 +80,19 @@ enum { · 79 unmodified lines
8080 MLX5_SHARED_RESOURCE_UID = 0xffff,
8181 };
8282
83+enum {
84+ MLX5_OBJ_TYPE_SW_ICM = 0x0008,
85+};
86+
87+enum {
88+ MLX5_GENERAL_OBJ_TYPES_CAP_SW_ICM = (1ULL << MLX5_OBJ_TYPE_SW_ICM),
89+ MLX5_GENERAL_OBJ_TYPES_CAP_GENEVE_TLV_OPT = (1ULL << 11),
90+};
91+
92+enum {
93+ MLX5_OBJ_TYPE_GENEVE_TLV_OPT = 0x000b,
94+};
95+
8396 enum {
8497 MLX5_CMD_OP_QUERY_HCA_CAP = 0x100,
8598 MLX5_CMD_OP_QUERY_ADAPTER = 0x101,
@@ -299,7 +312,11 @@ struct mlx5_ifc_flow_table_fields_supported_bits { · 213 unmodified lines
299312 u8 outer_gre_protocol[0x1];
300313 u8 outer_gre_key[0x1];
301314 u8 outer_vxlan_vni[0x1];
302− u8 reserved_at_1a[0x5];
315+ u8 outer_geneve_vni[0x1];
316+ u8 outer_geneve_oam[0x1];
317+ u8 outer_geneve_protocol_type[0x1];
318+ u8 outer_geneve_opt_len[0x1];
319+ u8 reserved_at_1e[0x1];
303320 u8 source_eswitch_port[0x1];
304321
305322 u8 inner_dmac[0x1];
@@ -327,7 +344,8 @@ struct mlx5_ifc_flow_table_fields_supported_bits { · 21 unmodified lines
327344 u8 inner_tcp_flags[0x1];
328345 u8 reserved_at_37[0x9];
329346
330− u8 reserved_at_40[0x5];
347+ u8 geneve_tlv_option_0_data[0x1];
348+ u8 reserved_at_41[0x4];
331349 u8 outer_first_mpls_over_udp[0x4];
332350 u8 outer_first_mpls_over_gre[0x4];
333351 u8 inner_first_mpls[0x4];
@@ -357,11 +375,14 @@ struct mlx5_ifc_flow_table_prop_layout_bits { · 23 unmodified lines
357375 u8 pop_vlan_2[0x1];
358376 u8 push_vlan_2[0x1];
359377 u8 reformat_and_vlan_action[0x1];
360− u8 reserved_at_10[0x2];
378+ u8 reserved_at_10[0x1];
379+ u8 sw_owner[0x1];
361380 u8 reformat_l3_tunnel_to_l2[0x1];
362381 u8 reformat_l2_to_l3_tunnel[0x1];
363382 u8 reformat_and_modify_action[0x1];
364− u8 reserved_at_15[0xb];
383+ u8 reserved_at_15[0x2];
384+ u8 table_miss_action_domain[0x1];
385+ u8 reserved_at_18[0x8];
365386 u8 reserved_at_20[0x2];
366387 u8 log_max_ft_size[0x6];
367388 u8 log_max_modify_header_context[0x8];
@@ -469,7 +490,9 @@ struct mlx5_ifc_fte_match_set_misc_bits { · 101 unmodified lines
469490 u8 vxlan_vni[0x18];
470491 u8 reserved_at_b8[0x8];
471492
472− u8 reserved_at_c0[0x20];
493+ u8 geneve_vni[0x18];
494+ u8 reserved_at_d8[0x7];
495+ u8 geneve_oam[0x1];
473496
474497 u8 reserved_at_e0[0xc];
475498 u8 outer_ipv6_flow_label[0x14];
@@ -477,7 +500,11 @@ struct mlx5_ifc_fte_match_set_misc_bits { · 1 unmodified line
477500 u8 reserved_at_100[0xc];
478501 u8 inner_ipv6_flow_label[0x14];
479502
480− u8 reserved_at_120[0x28];
503+ u8 reserved_at_120[0xa];
504+ u8 geneve_opt_len[0x6];
505+ u8 geneve_protocol_type[0x10];
506+
507+ u8 reserved_at_140[0x8];
481508 u8 bth_dst_qp[0x18];
482509 u8 reserved_at_160[0x20];
483510 u8 outer_esp_spi[0x20];
@@ -507,6 +534,12 @@ struct mlx5_ifc_fte_match_set_misc2_bits { · 23 unmodified lines
507534 u8 reserved_at_1a0[0x60];
508535 };
509536
537+struct mlx5_ifc_fte_match_set_misc3_bits {
538+ u8 reserved_at_0[0x120];
539+ u8 geneve_tlv_option_0_data[0x20];
540+ u8 reserved_at_140[0xc0];
541+};
542+
510543 struct mlx5_ifc_cmd_pas_bits {
511544 u8 pa_h[0x20];
512545
@@ -589,7 +622,7 @@ struct mlx5_ifc_flow_table_nic_cap_bits { · 76 unmodified lines
589622
590623 struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_receive;
591624
592− u8 reserved_at_400[0x200];
625+ struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_receive_rdma;
593626
594627 struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_receive_sniffer;
595628
@@ -770,7 +803,19 @@ struct mlx5_ifc_device_mem_cap_bits { · 174 unmodified lines
770803
771804 u8 max_memic_size[0x20];
772805
773− u8 reserved_at_c0[0x740];
806+ u8 steering_sw_icm_start_address[0x40];
807+
808+ u8 reserved_at_100[0x8];
809+ u8 log_header_modify_sw_icm_size[0x8];
810+ u8 reserved_at_110[0x2];
811+ u8 log_sw_icm_alloc_granularity[0x6];
812+ u8 log_steering_sw_icm_size[0x8];
813+
814+ u8 reserved_at_120[0x20];
815+
816+ u8 header_modify_sw_icm_start_address[0x40];
817+
818+ u8 reserved_at_180[0x680];
774819 };
775820
776821 enum {
@@ -919,6 +964,7 @@ enum { · 142 unmodified lines
919964
920965 enum {
921966 MLX5_UCTX_CAP_RAW_TX = 1UL << 0,
967+ MLX5_UCTX_CAP_INTERNAL_DEV_RES = 1UL << 1,
922968 };
923969
924970 struct mlx5_ifc_cmd_hca_cap_bits {
@@ -929,7 +975,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 4 unmodified lines
929975
930976 u8 log_max_srq_sz[0x8];
931977 u8 log_max_qp_sz[0x8];
932− u8 reserved_at_90[0xb];
978+ u8 reserved_at_90[0x8];
979+ u8 prio_tag_required[0x1];
980+ u8 reserved_at_99[0x2];
933981 u8 log_max_qp[0x5];
934982
935983 u8 reserved_at_a0[0xb];
@@ -1211,7 +1259,11 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 275 unmodified lines
12111259 u8 num_of_uars_per_page[0x20];
12121260
12131261 u8 flex_parser_protocols[0x20];
1214− u8 reserved_at_560[0x20];
1262+
1263+ u8 max_geneve_tlv_options[0x8];
1264+ u8 reserved_at_568[0x3];
1265+ u8 max_geneve_tlv_option_data_len[0x5];
1266+ u8 reserved_at_570[0x10];
12151267
12161268 u8 reserved_at_580[0x3c];
12171269 u8 mini_cqe_resp_stride_index[0x1];
@@ -1247,7 +1299,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 29 unmodified lines
12471299
12481300 u8 uctx_cap[0x20];
12491301
1250− u8 reserved_at_6c0[0x140];
1302+ u8 reserved_at_6c0[0x4];
1303+ u8 flex_parser_id_geneve_tlv_option_0[0x4];
1304+ u8 reserved_at_6c8[0x138];
12511305 };
12521306
12531307 enum mlx5_flow_destination_type {
@@ -1260,6 +1314,12 @@ enum mlx5_flow_destination_type { · 6 unmodified lines
12601314 MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM = 0x101,
12611315 };
12621316
1317+enum mlx5_flow_table_miss_action {
1318+ MLX5_FLOW_TABLE_MISS_ACTION_DEF,
1319+ MLX5_FLOW_TABLE_MISS_ACTION_FWD,
1320+ MLX5_FLOW_TABLE_MISS_ACTION_SWITCH_DOMAIN,
1321+};
1322+
12631323 struct mlx5_ifc_dest_format_struct_bits {
12641324 u8 destination_type[0x8];
12651325 u8 destination_id[0x18];
@@ -1299,7 +1359,9 @@ struct mlx5_ifc_fte_match_param_bits { · 33 unmodified lines
12991359
13001360 struct mlx5_ifc_fte_match_set_misc2_bits misc_parameters_2;
13011361
1302− u8 reserved_at_800[0x800];
1362+ struct mlx5_ifc_fte_match_set_misc3_bits misc_parameters_3;
1363+
1364+ u8 reserved_at_a00[0x600];
13031365 };
13041366
13051367 enum {
@@ -2920,6 +2982,7 @@ enum { · 1614 unmodified lines
29202982 MLX5_MKC_ACCESS_MODE_MTT = 0x1,
29212983 MLX5_MKC_ACCESS_MODE_KLMS = 0x2,
29222984 MLX5_MKC_ACCESS_MODE_KSM = 0x3,
2985+ MLX5_MKC_ACCESS_MODE_SW_ICM = 0x4,
29232986 MLX5_MKC_ACCESS_MODE_MEMIC = 0x5,
29242987 };
29252988
@@ -4807,6 +4870,7 @@ enum { · 1881 unmodified lines
48074870 MLX5_QUERY_FLOW_GROUP_OUT_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS = 0x1,
48084871 MLX5_QUERY_FLOW_GROUP_OUT_MATCH_CRITERIA_ENABLE_INNER_HEADERS = 0x2,
48094872 MLX5_QUERY_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS_2 = 0x3,
4873+ MLX5_QUERY_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS_3 = 0x4,
48104874 };
48114875
48124876 struct mlx5_ifc_query_flow_group_out_bits {
@@ -5110,6 +5174,7 @@ enum { · 297 unmodified lines
51105174 MLX5_ACTION_IN_FIELD_OUT_DIPV6_31_0 = 0x14,
51115175 MLX5_ACTION_IN_FIELD_OUT_SIPV4 = 0x15,
51125176 MLX5_ACTION_IN_FIELD_OUT_DIPV4 = 0x16,
5177+ MLX5_ACTION_IN_FIELD_OUT_FIRST_VID = 0x17,
51135178 MLX5_ACTION_IN_FIELD_OUT_IPV6_HOPLIMIT = 0x47,
51145179 };
51155180
@@ -6874,14 +6939,14 @@ struct mlx5_ifc_create_tis_in_bits { · 1758 unmodified lines
68746939
68756940 struct mlx5_ifc_create_tir_out_bits {
68766941 u8 status[0x8];
6877− u8 reserved_at_8[0x18];
6942+ u8 icm_address_63_40[0x18];
68786943
68796944 u8 syndrome[0x20];
68806945
6881− u8 reserved_at_40[0x8];
6946+ u8 icm_address_39_32[0x8];
68826947 u8 tirn[0x18];
68836948
6884− u8 reserved_at_60[0x20];
6949+ u8 icm_address_31_0[0x20];
68856950 };
68866951
68876952 struct mlx5_ifc_create_tir_in_bits {
@@ -7279,7 +7344,7 @@ struct mlx5_ifc_create_eq_out_bits { · 391 unmodified lines
72797344
72807345 struct mlx5_ifc_create_eq_in_bits {
72817346 u8 opcode[0x10];
7282− u8 reserved_at_10[0x10];
7347+ u8 uid[0x10];
72837348
72847349 u8 reserved_at_20[0x10];
72857350 u8 op_mod[0x10];
@@ -8026,6 +8091,52 @@ struct mlx5_ifc_ppcnt_reg_bits { · 740 unmodified lines
80268091 union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits counter_set;
80278092 };
80288093
8094+struct mlx5_ifc_mpein_reg_bits {
8095+ u8 reserved_at_0[0x2];
8096+ u8 depth[0x6];
8097+ u8 pcie_index[0x8];
8098+ u8 node[0x8];
8099+ u8 reserved_at_18[0x8];
8100+
8101+ u8 capability_mask[0x20];
8102+
8103+ u8 reserved_at_40[0x8];
8104+ u8 link_width_enabled[0x8];
8105+ u8 link_speed_enabled[0x10];
8106+
8107+ u8 lane0_physical_position[0x8];
8108+ u8 link_width_active[0x8];
8109+ u8 link_speed_active[0x10];
8110+
8111+ u8 num_of_pfs[0x10];
8112+ u8 num_of_vfs[0x10];
8113+
8114+ u8 bdf0[0x10];
8115+ u8 reserved_at_b0[0x10];
8116+
8117+ u8 max_read_request_size[0x4];
8118+ u8 max_payload_size[0x4];
8119+ u8 reserved_at_c8[0x5];
8120+ u8 pwr_status[0x3];
8121+ u8 port_type[0x4];
8122+ u8 reserved_at_d4[0xb];
8123+ u8 lane_reversal[0x1];
8124+
8125+ u8 reserved_at_e0[0x14];
8126+ u8 pci_power[0xc];
8127+
8128+ u8 reserved_at_100[0x20];
8129+
8130+ u8 device_status[0x10];
8131+ u8 port_state[0x8];
8132+ u8 reserved_at_138[0x8];
8133+
8134+ u8 reserved_at_140[0x10];
8135+ u8 receiver_detect_result[0x10];
8136+
8137+ u8 reserved_at_160[0x20];
8138+};
8139+
80298140 struct mlx5_ifc_mpcnt_reg_bits {
80308141 u8 reserved_at_0[0x8];
80318142 u8 pcie_index[0x8];
@@ -8345,7 +8456,9 @@ struct mlx5_ifc_pcam_reg_bits { · 313 unmodified lines
83458456 };
83468457
83478458 struct mlx5_ifc_mcam_enhanced_features_bits {
8348− u8 reserved_at_0[0x74];
8459+ u8 reserved_at_0[0x6e];
8460+ u8 pci_status_and_power[0x1];
8461+ u8 reserved_at_6f[0x5];
83498462 u8 mark_tx_action_cnp[0x1];
83508463 u8 mark_tx_action_cqe[0x1];
83518464 u8 dynamic_tx_overflow[0x1];
@@ -8953,6 +9066,7 @@ union mlx5_ifc_ports_control_registers_document_bits { · 601 unmodified lines
89539066 struct mlx5_ifc_pmtu_reg_bits pmtu_reg;
89549067 struct mlx5_ifc_ppad_reg_bits ppad_reg;
89559068 struct mlx5_ifc_ppcnt_reg_bits ppcnt_reg;
9069+ struct mlx5_ifc_mpein_reg_bits mpein_reg;
89569070 struct mlx5_ifc_mpcnt_reg_bits mpcnt_reg;
89579071 struct mlx5_ifc_pplm_reg_bits pplm_reg;
89589072 struct mlx5_ifc_pplr_reg_bits pplr_reg;
@@ -9442,6 +9556,33 @@ struct mlx5_ifc_uctx_bits { · 483 unmodified lines
94429556 u8 reserved_at_20[0x160];
94439557 };
94449558
9559+struct mlx5_ifc_sw_icm_bits {
9560+ u8 modify_field_select[0x40];
9561+
9562+ u8 reserved_at_40[0x18];
9563+ u8 log_sw_icm_size[0x8];
9564+
9565+ u8 reserved_at_60[0x20];
9566+
9567+ u8 sw_icm_start_addr[0x40];
9568+
9569+ u8 reserved_at_c0[0x140];
9570+};
9571+
9572+struct mlx5_ifc_geneve_tlv_option_bits {
9573+ u8 modify_field_select[0x40];
9574+
9575+ u8 reserved_at_40[0x18];
9576+ u8 geneve_option_fte_index[0x8];
9577+
9578+ u8 option_class[0x10];
9579+ u8 option_type[0x8];
9580+ u8 reserved_at_78[0x3];
9581+ u8 option_data_length[0x5];
9582+
9583+ u8 reserved_at_80[0x180];
9584+};
9585+
94459586 struct mlx5_ifc_create_umem_in_bits {
94469587 u8 opcode[0x10];
94479588 u8 uid[0x10];
@@ -9479,6 +9620,16 @@ struct mlx5_ifc_destroy_uctx_in_bits { · 31 unmodified lines
94799620 u8 reserved_at_60[0x20];
94809621 };
94819622
9623+struct mlx5_ifc_create_sw_icm_in_bits {
9624+ struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
9625+ struct mlx5_ifc_sw_icm_bits sw_icm;
9626+};
9627+
9628+struct mlx5_ifc_create_geneve_tlv_option_in_bits {
9629+ struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
9630+ struct mlx5_ifc_geneve_tlv_option_bits geneve_tlv_opt;
9631+};
9632+
94829633 struct mlx5_ifc_mtrc_string_db_param_bits {
94839634 u8 string_db_base_address[0x20];
94849635
include/linux/mlx5/port.h+1−0
@@ -60,6 +60,7 @@ enum mlx5_an_status { · 59 unmodified lines
6060 #define MLX5_I2C_ADDR_LOW 0x50
6161 #define MLX5_I2C_ADDR_HIGH 0x51
6262 #define MLX5_EEPROM_PAGE_LENGTH 256
63+#define MLX5_EEPROM_HIGH_PAGE_LENGTH 128
6364
6465 enum mlx5e_link_mode {
6566 MLX5E_1000BASE_CX_SGMII = 0,
include/linux/mlx5/qp.h+1−0
@@ -395,6 +395,7 @@ struct mlx5_wqe_signature_seg { · 394 unmodified lines
395395
396396 struct mlx5_wqe_inline_seg {
397397 __be32 byte_count;
398+ __be32 data[0];
398399 };
399400
400401 enum mlx5_sig_type {
include/linux/mlx5/transobj.h+3−0
@@ -50,6 +50,9 @@ int mlx5_core_query_sq(struct mlx5_core_dev *dev, u32 sqn, u32 *out); · 49 unmodified lines
5050 int mlx5_core_query_sq_state(struct mlx5_core_dev *dev, u32 sqn, u8 *state);
5151 int mlx5_core_create_tir(struct mlx5_core_dev *dev, u32 *in, int inlen,
5252 u32 *tirn);
53+int mlx5_core_create_tir_out(struct mlx5_core_dev *dev,
54+ u32 *in, int inlen,
55+ u32 *out, int outlen);
5356 int mlx5_core_modify_tir(struct mlx5_core_dev *dev, u32 tirn, u32 *in,
5457 int inlen);
5558 void mlx5_core_destroy_tir(struct mlx5_core_dev *dev, u32 tirn);
include/linux/mlx5/vport.h+0−4
@@ -118,10 +118,6 @@ int mlx5_modify_nic_vport_promisc(struct mlx5_core_dev *mdev, · 117 unmodified lines
118118 int promisc_uc,
119119 int promisc_mc,
120120 int promisc_all);
121−int mlx5_query_nic_vport_vlans(struct mlx5_core_dev *dev,
122− u16 vport,
123− u16 vlans[],
124− int *size);
125121 int mlx5_modify_nic_vport_vlans(struct mlx5_core_dev *dev,
126122 u16 vlans[],
127123 int list_size);
include/linux/mm.h+102−33
@@ -124,10 +124,45 @@ extern int mmap_rnd_compat_bits __read_mostly; · 123 unmodified lines
124124
125125 /*
126126 * On some architectures it is expensive to call memset() for small sizes.
127− * Those architectures should provide their own implementation of "struct page"
128− * zeroing by defining this macro in <asm/pgtable.h>.
127+ * If an architecture decides to implement their own version of
128+ * mm_zero_struct_page they should wrap the defines below in a #ifndef and
129+ * define their own version of this macro in <asm/pgtable.h>
129130 */
130−#ifndef mm_zero_struct_page
131+#if BITS_PER_LONG == 64
132+/* This function must be updated when the size of struct page grows above 80
133+ * or reduces below 56. The idea that compiler optimizes out switch()
134+ * statement, and only leaves move/store instructions. Also the compiler can
135+ * combine write statments if they are both assignments and can be reordered,
136+ * this can result in several of the writes here being dropped.
137+ */
138+#define mm_zero_struct_page(pp) __mm_zero_struct_page(pp)
139+static inline void __mm_zero_struct_page(struct page *page)
140+{
141+ unsigned long *_pp = (void *)page;
142+
143+ /* Check that struct page is either 56, 64, 72, or 80 bytes */
144+ BUILD_BUG_ON(sizeof(struct page) & 7);
145+ BUILD_BUG_ON(sizeof(struct page) < 56);
146+ BUILD_BUG_ON(sizeof(struct page) > 80);
147+
148+ switch (sizeof(struct page)) {
149+ case 80:
150+ _pp[9] = 0; /* fallthrough */
151+ case 72:
152+ _pp[8] = 0; /* fallthrough */
153+ case 64:
154+ _pp[7] = 0; /* fallthrough */
155+ case 56:
156+ _pp[6] = 0;
157+ _pp[5] = 0;
158+ _pp[4] = 0;
159+ _pp[3] = 0;
160+ _pp[2] = 0;
161+ _pp[1] = 0;
162+ _pp[0] = 0;
163+ }
164+}
165+#else
131166 #define mm_zero_struct_page(pp) ((void)memset((pp), 0, sizeof(struct page)))
132167 #endif
133168
@@ -501,9 +536,6 @@ static inline void vma_set_anonymous(struct vm_area_struct *vma) · 367 unmodified lines
501536 struct mmu_gather;
502537 struct inode;
503538
504−#define page_private(page) ((page)->private)
505−#define set_page_private(page, v) ((page)->private = (v))
506−
507539 #if !defined(__HAVE_ARCH_PTE_DEVMAP) || !defined(CONFIG_TRANSPARENT_HUGEPAGE)
508540 static inline int pmd_devmap(pmd_t pmd)
509541 {
@@ -1007,6 +1039,30 @@ static inline void put_page(struct page *page) · 497 unmodified lines
10071039 __put_page(page);
10081040 }
10091041
1042+/**
1043+ * put_user_page() - release a gup-pinned page
1044+ * @page: pointer to page to be released
1045+ *
1046+ * Pages that were pinned via get_user_pages*() must be released via
1047+ * either put_user_page(), or one of the put_user_pages*() routines
1048+ * below. This is so that eventually, pages that are pinned via
1049+ * get_user_pages*() can be separately tracked and uniquely handled. In
1050+ * particular, interactions with RDMA and filesystems need special
1051+ * handling.
1052+ *
1053+ * put_user_page() and put_page() are not interchangeable, despite this early
1054+ * implementation that makes them look the same. put_user_page() calls must
1055+ * be perfectly matched up with get_user_page() calls.
1056+ */
1057+static inline void put_user_page(struct page *page)
1058+{
1059+ put_page(page);
1060+}
1061+
1062+void put_user_pages_dirty(struct page **pages, unsigned long npages);
1063+void put_user_pages_dirty_lock(struct page **pages, unsigned long npages);
1064+void put_user_pages(struct page **pages, unsigned long npages);
1065+
10101066 #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
10111067 #define SECTION_IN_PAGE_FLAGS
10121068 #endif
@@ -1505,21 +1561,8 @@ long get_user_pages_locked(unsigned long start, unsigned long nr_pages, · 492 unmodified lines
15051561 long get_user_pages_unlocked(unsigned long start, unsigned long nr_pages,
15061562 struct page **pages, unsigned int gup_flags);
15071563
1508−#if defined(CONFIG_FS_DAX) || defined(CONFIG_CMA)
1509−long get_user_pages_longterm(unsigned long start, unsigned long nr_pages,
1510− unsigned int gup_flags, struct page **pages,
1511− struct vm_area_struct **vmas);
1512−#else
1513−static inline long get_user_pages_longterm(unsigned long start,
1514− unsigned long nr_pages, unsigned int gup_flags,
1515− struct page **pages, struct vm_area_struct **vmas)
1516−{
1517− return get_user_pages(start, nr_pages, gup_flags, pages, vmas);
1518−}
1519−#endif /* CONFIG_FS_DAX */
1520−
1521−int get_user_pages_fast(unsigned long start, int nr_pages, int write,
1522− struct page **pages);
1564+int get_user_pages_fast(unsigned long start, int nr_pages,
1565+ unsigned int gup_flags, struct page **pages);
15231566
15241567 /* Container for pinned pfns / pages */
15251568 struct frame_vector {
@@ -2533,6 +2576,10 @@ struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); · 1007 unmodified lines
25332576 int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
25342577 unsigned long pfn, unsigned long size, pgprot_t);
25352578 int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
2579+int vm_map_pages(struct vm_area_struct *vma, struct page **pages,
2580+ unsigned long num);
2581+int vm_map_pages_zero(struct vm_area_struct *vma, struct page **pages,
2582+ unsigned long num);
25362583 vm_fault_t vmf_insert_pfn(struct vm_area_struct *vma, unsigned long addr,
25372584 unsigned long pfn);
25382585 vm_fault_t vmf_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr,
@@ -2583,6 +2630,34 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, · 44 unmodified lines
25832630 #define FOLL_REMOTE 0x2000 /* we are working on non-current tsk/mm */
25842631 #define FOLL_COW 0x4000 /* internal GUP flag */
25852632 #define FOLL_ANON 0x8000 /* don't do file mappings */
2633+#define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite: see below */
2634+
2635+/*
2636+ * NOTE on FOLL_LONGTERM:
2637+ *
2638+ * FOLL_LONGTERM indicates that the page will be held for an indefinite time
2639+ * period _often_ under userspace control. This is contrasted with
2640+ * iov_iter_get_pages() where usages which are transient.
2641+ *
2642+ * FIXME: For pages which are part of a filesystem, mappings are subject to the
2643+ * lifetime enforced by the filesystem and we need guarantees that longterm
2644+ * users like RDMA and V4L2 only establish mappings which coordinate usage with
2645+ * the filesystem. Ideas for this coordination include revoking the longterm
2646+ * pin, delaying writeback, bounce buffer page writeback, etc. As FS DAX was
2647+ * added after the problem with filesystems was found FS DAX VMAs are
2648+ * specifically failed. Filesystem pages are still subject to bugs and use of
2649+ * FOLL_LONGTERM should be avoided on those pages.
2650+ *
2651+ * FIXME: Also NOTE that FOLL_LONGTERM is not supported in every GUP call.
2652+ * Currently only get_user_pages() and get_user_pages_fast() support this flag
2653+ * and calls to get_user_pages_[un]locked are specifically not allowed. This
2654+ * is due to an incompatibility with the FS DAX check and
2655+ * FAULT_FLAG_ALLOW_RETRY
2656+ *
2657+ * In the CMA case: longterm pins in a CMA region would unnecessarily fragment
2658+ * that region. And so CMA attempts to migrate the page before pinning when
2659+ * FOLL_LONGTERM is specified.
2660+ */
25862661
25872662 static inline int vm_fault_to_errno(vm_fault_t vm_fault, int foll_flags)
25882663 {
@@ -2610,37 +2685,31 @@ static inline void kernel_poison_pages(struct page *page, int numpages, · 21 unmodified lines
26102685 int enable) { }
26112686 #endif
26122687
2613−#ifdef CONFIG_DEBUG_PAGEALLOC
26142688 extern bool _debug_pagealloc_enabled;
2615−extern void __kernel_map_pages(struct page *page, int numpages, int enable);
26162689
26172690 static inline bool debug_pagealloc_enabled(void)
26182691 {
2619− return _debug_pagealloc_enabled;
2692+ return IS_ENABLED(CONFIG_DEBUG_PAGEALLOC) && _debug_pagealloc_enabled;
26202693 }
26212694
2695+#if defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_ARCH_HAS_SET_DIRECT_MAP)
2696+extern void __kernel_map_pages(struct page *page, int numpages, int enable);
2697+
26222698 static inline void
26232699 kernel_map_pages(struct page *page, int numpages, int enable)
26242700 {
2625− if (!debug_pagealloc_enabled())
2626− return;
2627−
26282701 __kernel_map_pages(page, numpages, enable);
26292702 }
26302703 #ifdef CONFIG_HIBERNATION
26312704 extern bool kernel_page_present(struct page *page);
26322705 #endif /* CONFIG_HIBERNATION */
2633−#else /* CONFIG_DEBUG_PAGEALLOC */
2706+#else /* CONFIG_DEBUG_PAGEALLOC || CONFIG_ARCH_HAS_SET_DIRECT_MAP */
26342707 static inline void
26352708 kernel_map_pages(struct page *page, int numpages, int enable) {}
26362709 #ifdef CONFIG_HIBERNATION
26372710 static inline bool kernel_page_present(struct page *page) { return true; }
26382711 #endif /* CONFIG_HIBERNATION */
2639−static inline bool debug_pagealloc_enabled(void)
2640−{
2641− return false;
2642−}
2643−#endif /* CONFIG_DEBUG_PAGEALLOC */
2712+#endif /* CONFIG_DEBUG_PAGEALLOC || CONFIG_ARCH_HAS_SET_DIRECT_MAP */
26442713
26452714 #ifdef __HAVE_ARCH_GATE_AREA
26462715 extern struct vm_area_struct *get_gate_vma(struct mm_struct *mm);
include/linux/mm_inline.h+1−1
@@ -29,7 +29,7 @@ static __always_inline void __update_lru_size(struct lruvec *lruvec, · 28 unmodified lines
2929 {
3030 struct pglist_data *pgdat = lruvec_pgdat(lruvec);
3131
32− __mod_node_page_state(pgdat, NR_LRU_BASE + lru, nr_pages);
32+ __mod_lruvec_state(lruvec, NR_LRU_BASE + lru, nr_pages);
3333 __mod_zone_page_state(&pgdat->node_zones[zid],
3434 NR_ZONE_LRU_BASE + lru, nr_pages);
3535 }
include/linux/mm_types.h+4−1
@@ -103,7 +103,7 @@ struct page { · 102 unmodified lines
103103 };
104104 struct { /* slab, slob and slub */
105105 union {
106− struct list_head slab_list; /* uses lru */
106+ struct list_head slab_list;
107107 struct { /* Partial pages */
108108 struct page *next;
109109 #ifdef CONFIG_64BIT
@@ -220,6 +220,9 @@ struct page { · 110 unmodified lines
220220 #define PAGE_FRAG_CACHE_MAX_SIZE __ALIGN_MASK(32768, ~PAGE_MASK)
221221 #define PAGE_FRAG_CACHE_MAX_ORDER get_order(PAGE_FRAG_CACHE_MAX_SIZE)
222222
223+#define page_private(page) ((page)->private)
224+#define set_page_private(page, v) ((page)->private = (v))
225+
223226 struct page_frag_cache {
224227 void * va;
225228 #if (PAGE_SIZE < PAGE_FRAG_CACHE_MAX_SIZE)
include/linux/mmc/sdio_func.h+12−0
@@ -111,6 +111,18 @@ struct sdio_driver { · 110 unmodified lines
111111 extern int sdio_register_driver(struct sdio_driver *);
112112 extern void sdio_unregister_driver(struct sdio_driver *);
113113
114+/**
115+ * module_sdio_driver() - Helper macro for registering a SDIO driver
116+ * @__sdio_driver: sdio_driver struct
117+ *
118+ * Helper macro for SDIO drivers which do not do anything special in module
119+ * init/exit. This eliminates a lot of boilerplate. Each module may only
120+ * use this macro once, and calling it replaces module_init() and module_exit()
121+ */
122+#define module_sdio_driver(__sdio_driver) \
123+ module_driver(__sdio_driver, sdio_register_driver, \
124+ sdio_unregister_driver)
125+
114126 /*
115127 * SDIO I/O operations
116128 */
include/linux/mmc/sdio_ids.h+2−0
@@ -59,6 +59,8 @@ · 58 unmodified lines
5959 #define SDIO_DEVICE_ID_MARVELL_8797_F0 0x9128
6060 #define SDIO_DEVICE_ID_MARVELL_8887WLAN 0x9134
6161
62+#define SDIO_VENDOR_ID_MEDIATEK 0x037a
63+
6264 #define SDIO_VENDOR_ID_SIANO 0x039a
6365 #define SDIO_DEVICE_ID_SIANO_NOVA_B0 0x0201
6466 #define SDIO_DEVICE_ID_SIANO_NICE 0x0202
include/linux/mmu_notifier.h+59−4
@@ -10,6 +10,36 @@ · 9 unmodified lines
1010 struct mmu_notifier;
1111 struct mmu_notifier_ops;
1212
13+/**
14+ * enum mmu_notifier_event - reason for the mmu notifier callback
15+ * @MMU_NOTIFY_UNMAP: either munmap() that unmap the range or a mremap() that
16+ * move the range
17+ *
18+ * @MMU_NOTIFY_CLEAR: clear page table entry (many reasons for this like
19+ * madvise() or replacing a page by another one, ...).
20+ *
21+ * @MMU_NOTIFY_PROTECTION_VMA: update is due to protection change for the range
22+ * ie using the vma access permission (vm_page_prot) to update the whole range
23+ * is enough no need to inspect changes to the CPU page table (mprotect()
24+ * syscall)
25+ *
26+ * @MMU_NOTIFY_PROTECTION_PAGE: update is due to change in read/write flag for
27+ * pages in the range so to mirror those changes the user must inspect the CPU
28+ * page table (from the end callback).
29+ *
30+ * @MMU_NOTIFY_SOFT_DIRTY: soft dirty accounting (still same page and same
31+ * access flags). User should soft dirty the page in the end callback to make
32+ * sure that anyone relying on soft dirtyness catch pages that might be written
33+ * through non CPU mappings.
34+ */
35+enum mmu_notifier_event {
36+ MMU_NOTIFY_UNMAP = 0,
37+ MMU_NOTIFY_CLEAR,
38+ MMU_NOTIFY_PROTECTION_VMA,
39+ MMU_NOTIFY_PROTECTION_PAGE,
40+ MMU_NOTIFY_SOFT_DIRTY,
41+};
42+
1343 #ifdef CONFIG_MMU_NOTIFIER
1444
1545 /*
@@ -25,11 +55,15 @@ struct mmu_notifier_mm { · 9 unmodified lines
2555 spinlock_t lock;
2656 };
2757
58+#define MMU_NOTIFIER_RANGE_BLOCKABLE (1 << 0)
59+
2860 struct mmu_notifier_range {
61+ struct vm_area_struct *vma;
2962 struct mm_struct *mm;
3063 unsigned long start;
3164 unsigned long end;
32− bool blockable;
65+ unsigned flags;
66+ enum mmu_notifier_event event;
3367 };
3468
3569 struct mmu_notifier_ops {
@@ -225,6 +259,14 @@ extern void __mmu_notifier_invalidate_range_end(struct mmu_notifier_range *r, · 189 unmodified lines
225259 bool only_end);
226260 extern void __mmu_notifier_invalidate_range(struct mm_struct *mm,
227261 unsigned long start, unsigned long end);
262+extern bool
263+mmu_notifier_range_update_to_read_only(const struct mmu_notifier_range *range);
264+
265+static inline bool
266+mmu_notifier_range_blockable(const struct mmu_notifier_range *range)
267+{
268+ return (range->flags & MMU_NOTIFIER_RANGE_BLOCKABLE);
269+}
228270
229271 static inline void mmu_notifier_release(struct mm_struct *mm)
230272 {
@@ -269,7 +311,7 @@ static inline void · 38 unmodified lines
269311 mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range)
270312 {
271313 if (mm_has_notifiers(range->mm)) {
272− range->blockable = true;
314+ range->flags |= MMU_NOTIFIER_RANGE_BLOCKABLE;
273315 __mmu_notifier_invalidate_range_start(range);
274316 }
275317 }
@@ -278,7 +320,7 @@ static inline int · 2 unmodified lines
278320 mmu_notifier_invalidate_range_start_nonblock(struct mmu_notifier_range *range)
279321 {
280322 if (mm_has_notifiers(range->mm)) {
281− range->blockable = false;
323+ range->flags &= ~MMU_NOTIFIER_RANGE_BLOCKABLE;
282324 return __mmu_notifier_invalidate_range_start(range);
283325 }
284326 return 0;
@@ -318,13 +360,19 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) · 33 unmodified lines
318360
319361
320362 static inline void mmu_notifier_range_init(struct mmu_notifier_range *range,
363+ enum mmu_notifier_event event,
364+ unsigned flags,
365+ struct vm_area_struct *vma,
321366 struct mm_struct *mm,
322367 unsigned long start,
323368 unsigned long end)
324369 {
370+ range->vma = vma;
371+ range->event = event;
325372 range->mm = mm;
326373 range->start = start;
327374 range->end = end;
375+ range->flags = flags;
328376 }
329377
330378 #define ptep_clear_flush_young_notify(__vma, __address, __ptep) \
@@ -452,9 +500,14 @@ static inline void _mmu_notifier_range_init(struct mmu_notifier_range *range, · 121 unmodified lines
452500 range->end = end;
453501 }
454502
455−#define mmu_notifier_range_init(range, mm, start, end) \
503+#define mmu_notifier_range_init(range,event,flags,vma,mm,start,end) \
456504 _mmu_notifier_range_init(range, start, end)
457505
506+static inline bool
507+mmu_notifier_range_blockable(const struct mmu_notifier_range *range)
508+{
509+ return true;
510+}
458511
459512 static inline int mm_has_notifiers(struct mm_struct *mm)
460513 {
@@ -517,6 +570,8 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) · 56 unmodified lines
517570 {
518571 }
519572
573+#define mmu_notifier_range_update_to_read_only(r) false
574+
520575 #define ptep_clear_flush_young_notify ptep_clear_flush_young
521576 #define pmdp_clear_flush_young_notify pmdp_clear_flush_young
522577 #define ptep_clear_young_notify ptep_test_and_clear_young
include/linux/mmzone.h+59−5
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818 #include <linux/pageblock-flags.h>
1919 #include <linux/page-flags-layout.h>
2020 #include <linux/atomic.h>
21+#include <linux/mm_types.h>
22+#include <linux/page-flags.h>
2123 #include <asm/page.h>
2224
2325 /* Free memory management - zoned buddy allocator. */
@@ -98,6 +100,62 @@ struct free_area { · 74 unmodified lines
98100 unsigned long nr_free;
99101 };
100102
103+/* Used for pages not on another list */
104+static inline void add_to_free_area(struct page *page, struct free_area *area,
105+ int migratetype)
106+{
107+ list_add(&page->lru, &area->free_list[migratetype]);
108+ area->nr_free++;
109+}
110+
111+/* Used for pages not on another list */
112+static inline void add_to_free_area_tail(struct page *page, struct free_area *area,
113+ int migratetype)
114+{
115+ list_add_tail(&page->lru, &area->free_list[migratetype]);
116+ area->nr_free++;
117+}
118+
119+#ifdef CONFIG_SHUFFLE_PAGE_ALLOCATOR
120+/* Used to preserve page allocation order entropy */
121+void add_to_free_area_random(struct page *page, struct free_area *area,
122+ int migratetype);
123+#else
124+static inline void add_to_free_area_random(struct page *page,
125+ struct free_area *area, int migratetype)
126+{
127+ add_to_free_area(page, area, migratetype);
128+}
129+#endif
130+
131+/* Used for pages which are on another list */
132+static inline void move_to_free_area(struct page *page, struct free_area *area,
133+ int migratetype)
134+{
135+ list_move(&page->lru, &area->free_list[migratetype]);
136+}
137+
138+static inline struct page *get_page_from_free_area(struct free_area *area,
139+ int migratetype)
140+{
141+ return list_first_entry_or_null(&area->free_list[migratetype],
142+ struct page, lru);
143+}
144+
145+static inline void del_page_from_free_area(struct page *page,
146+ struct free_area *area)
147+{
148+ list_del(&page->lru);
149+ __ClearPageBuddy(page);
150+ set_page_private(page, 0);
151+ area->nr_free--;
152+}
153+
154+static inline bool free_area_empty(struct free_area *area, int migratetype)
155+{
156+ return list_empty(&area->free_list[migratetype]);
157+}
158+
101159 struct pglist_data;
102160
103161 /*
@@ -247,11 +305,6 @@ struct lruvec { · 143 unmodified lines
247305 #endif
248306 };
249307
250−/* Mask used at gathering information at once (see memcontrol.c) */
251−#define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE))
252−#define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON))
253−#define LRU_ALL ((1 << NR_LRU_LISTS) - 1)
254−
255308 /* Isolate unmapped file */
256309 #define ISOLATE_UNMAPPED ((__force isolate_mode_t)0x2)
257310 /* Isolate for asynchronous migration */
@@ -1276,6 +1329,7 @@ void sparse_init(void); · 1018 unmodified lines
12761329 #else
12771330 #define sparse_init() do {} while (0)
12781331 #define sparse_index_init(_sec, _nid) do {} while (0)
1332+#define pfn_present pfn_valid
12791333 #endif /* CONFIG_SPARSEMEM */
12801334
12811335 /*
include/linux/module.h+24−0
@@ -253,6 +253,7 @@ extern typeof(name) __mod_##type##__##name##_device_table \ · 252 unmodified lines
253253 #define MODULE_VERSION(_version) MODULE_INFO(version, _version)
254254 #else
255255 #define MODULE_VERSION(_version) \
256+ MODULE_INFO(version, _version); \
256257 static struct module_version_attribute ___modver_attr = { \
257258 .mattr = { \
258259 .attr = { \
@@ -331,6 +332,7 @@ struct mod_kallsyms { · 72 unmodified lines
331332 Elf_Sym *symtab;
332333 unsigned int num_symtab;
333334 char *strtab;
335+ char *typetab;
334336 };
335337
336338 #ifdef CONFIG_LIVEPATCH
@@ -676,6 +678,7 @@ static inline bool is_livepatch_module(struct module *mod) · 339 unmodified lines
676678 #endif /* CONFIG_LIVEPATCH */
677679
678680 bool is_module_sig_enforced(void);
681+void set_module_sig_enforced(void);
679682
680683 #else /* !CONFIG_MODULES... */
681684
@@ -709,6 +712,23 @@ static inline bool is_module_text_address(unsigned long addr) · 27 unmodified lines
709712 return false;
710713 }
711714
715+static inline bool within_module_core(unsigned long addr,
716+ const struct module *mod)
717+{
718+ return false;
719+}
720+
721+static inline bool within_module_init(unsigned long addr,
722+ const struct module *mod)
723+{
724+ return false;
725+}
726+
727+static inline bool within_module(unsigned long addr, const struct module *mod)
728+{
729+ return false;
730+}
731+
712732 /* Get/put a kernel symbol (calls should be symmetric) */
713733 #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
714734 #define symbol_put(x) do { } while (0)
@@ -796,6 +816,10 @@ static inline bool is_module_sig_enforced(void) · 81 unmodified lines
796816 return false;
797817 }
798818
819+static inline void set_module_sig_enforced(void)
820+{
821+}
822+
799823 /* Dereference module function descriptor */
800824 static inline
801825 void *dereference_module_function_descriptor(struct module *mod, void *ptr)
include/linux/moduleparam.h+5−7
@@ -10,23 +10,21 @@ · 9 unmodified lines
1010 module name. */
1111 #ifdef MODULE
1212 #define MODULE_PARAM_PREFIX /* empty */
13+#define __MODULE_INFO_PREFIX /* empty */
1314 #else
1415 #define MODULE_PARAM_PREFIX KBUILD_MODNAME "."
16+/* We cannot use MODULE_PARAM_PREFIX because some modules override it. */
17+#define __MODULE_INFO_PREFIX KBUILD_MODNAME "."
1518 #endif
1619
1720 /* Chosen so that structs with an unsigned long line up. */
1821 #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long))
1922
20−#ifdef MODULE
2123 #define __MODULE_INFO(tag, name, info) \
2224 static const char __UNIQUE_ID(name)[] \
2325 __used __attribute__((section(".modinfo"), unused, aligned(1))) \
24− = __stringify(tag) "=" info
25−#else /* !MODULE */
26−/* This struct is here for syntactic coherency, it is not used */
27−#define __MODULE_INFO(tag, name, info) \
28− struct __UNIQUE_ID(name) {}
29−#endif
26+ = __MODULE_INFO_PREFIX __stringify(tag) "=" info
27+
3028 #define __MODULE_PARM_TYPE(name, _type) \
3129 __MODULE_INFO(parmtype, name##type, #name ":" _type)
3230
include/linux/mount.h+2−0
@@ -87,6 +87,8 @@ extern bool mnt_may_suid(struct vfsmount *mnt); · 86 unmodified lines
8787
8888 struct path;
8989 extern struct vfsmount *clone_private_mount(const struct path *path);
90+extern int __mnt_want_write(struct vfsmount *);
91+extern void __mnt_drop_write(struct vfsmount *);
9092
9193 struct file_system_type;
9294 extern struct vfsmount *fc_mount(struct fs_context *fc);
include/linux/msi.h+36−18
@@ -47,6 +47,14 @@ struct fsl_mc_msi_desc { · 46 unmodified lines
4747 u16 msi_index;
4848 };
4949
50+/**
51+ * ti_sci_inta_msi_desc - TISCI based INTA specific msi descriptor data
52+ * @dev_index: TISCI device index
53+ */
54+struct ti_sci_inta_msi_desc {
55+ u16 dev_index;
56+};
57+
5058 /**
5159 * struct msi_desc - Descriptor structure for MSI based interrupts
5260 * @list: List head for management
@@ -68,6 +76,7 @@ struct fsl_mc_msi_desc { · 15 unmodified lines
6876 * @mask_base: [PCI MSI-X] Mask register base address
6977 * @platform: [platform] Platform device specific msi descriptor data
7078 * @fsl_mc: [fsl-mc] FSL MC device specific msi descriptor data
79+ * @inta: [INTA] TISCI based INTA specific msi descriptor data
7180 */
7281 struct msi_desc {
7382 /* Shared device/bus type independent data */
@@ -77,6 +86,9 @@ struct msi_desc { · 3 unmodified lines
7786 struct device *dev;
7887 struct msi_msg msg;
7988 struct irq_affinity_desc *affinity;
89+#ifdef CONFIG_IRQ_MSI_IOMMU
90+ const void *iommu_cookie;
91+#endif
8092
8193 union {
8294 /* PCI MSI/X specific data */
@@ -106,6 +118,7 @@ struct msi_desc { · 23 unmodified lines
106118 */
107119 struct platform_msi_desc platform;
108120 struct fsl_mc_msi_desc fsl_mc;
121+ struct ti_sci_inta_msi_desc inta;
109122 };
110123 };
111124
@@ -119,6 +132,29 @@ struct msi_desc { · 7 unmodified lines
119132 #define for_each_msi_entry_safe(desc, tmp, dev) \
120133 list_for_each_entry_safe((desc), (tmp), dev_to_msi_list((dev)), list)
121134
135+#ifdef CONFIG_IRQ_MSI_IOMMU
136+static inline const void *msi_desc_get_iommu_cookie(struct msi_desc *desc)
137+{
138+ return desc->iommu_cookie;
139+}
140+
141+static inline void msi_desc_set_iommu_cookie(struct msi_desc *desc,
142+ const void *iommu_cookie)
143+{
144+ desc->iommu_cookie = iommu_cookie;
145+}
146+#else
147+static inline const void *msi_desc_get_iommu_cookie(struct msi_desc *desc)
148+{
149+ return NULL;
150+}
151+
152+static inline void msi_desc_set_iommu_cookie(struct msi_desc *desc,
153+ const void *iommu_cookie)
154+{
155+}
156+#endif
157+
122158 #ifdef CONFIG_PCI_MSI
123159 #define first_pci_msi_entry(pdev) first_msi_entry(&(pdev)->dev)
124160 #define for_each_pci_msi_entry(desc, pdev) \
@@ -148,24 +184,6 @@ u32 __pci_msi_desc_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); · 23 unmodified lines
148184 void pci_msi_mask_irq(struct irq_data *data);
149185 void pci_msi_unmask_irq(struct irq_data *data);
150186
151−/* Conversion helpers. Should be removed after merging */
152−static inline void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
153−{
154− __pci_write_msi_msg(entry, msg);
155−}
156−static inline void write_msi_msg(int irq, struct msi_msg *msg)
157−{
158− pci_write_msi_msg(irq, msg);
159−}
160−static inline void mask_msi_irq(struct irq_data *data)
161−{
162− pci_msi_mask_irq(data);
163−}
164−static inline void unmask_msi_irq(struct irq_data *data)
165−{
166− pci_msi_unmask_irq(data);
167−}
168−
169187 /*
170188 * The arch hooks to setup up msi irqs. Those functions are
171189 * implemented as weak symbols so that they /can/ be overriden by
include/linux/mtd/bbm.h+1−13
@@ -93,10 +93,7 @@ struct nand_bbt_descr { · 92 unmodified lines
9393 #define NAND_BBT_WRITE 0x00002000
9494 /* Read and write back block contents when writing bbt */
9595 #define NAND_BBT_SAVECONTENT 0x00004000
96−/* Search good / bad pattern on the first and the second page */
97−#define NAND_BBT_SCAN2NDPAGE 0x00008000
98−/* Search good / bad pattern on the last page of the eraseblock */
99−#define NAND_BBT_SCANLASTPAGE 0x00010000
96+
10097 /*
10198 * Use a flash based bad block table. By default, OOB identifier is saved in
10299 * OOB area. This option is passed to the default bad block table function.
@@ -123,13 +120,6 @@ struct nand_bbt_descr { · 20 unmodified lines
123120 /* The maximum number of blocks to scan for a bbt */
124121 #define NAND_BBT_SCAN_MAXBLOCKS 4
125122
126−/*
127− * Constants for oob configuration
128− */
129−#define NAND_SMALL_BADBLOCK_POS 5
130−#define NAND_LARGE_BADBLOCK_POS 0
131−#define ONENAND_BADBLOCK_POS 0
132−
133123 /*
134124 * Bad block scanning errors
135125 */
@@ -140,7 +130,6 @@ struct nand_bbt_descr { · 4 unmodified lines
140130 /**
141131 * struct bbm_info - [GENERIC] Bad Block Table data structure
142132 * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry
143− * @badblockpos: [INTERN] position of the bad block marker in the oob area
144133 * @options: options for this descriptor
145134 * @bbt: [INTERN] bad block table pointer
146135 * @isbad_bbt: function to determine if a block is bad
@@ -150,7 +139,6 @@ struct nand_bbt_descr { · 3 unmodified lines
150139 */
151140 struct bbm_info {
152141 int bbt_erase_shift;
153− int badblockpos;
154142 int options;
155143
156144 uint8_t *bbt;
include/linux/mtd/nand.h+31−1
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * @oobsize: OOB area size
2020 * @pages_per_eraseblock: number of pages per eraseblock
2121 * @eraseblocks_per_lun: number of eraseblocks per LUN (Logical Unit Number)
22+ * @max_bad_eraseblocks_per_lun: maximum number of eraseblocks per LUN
2223 * @planes_per_lun: number of planes per LUN
2324 * @luns_per_target: number of LUN per target (target is a synonym for die)
2425 * @ntargets: total number of targets exposed by the NAND device
@@ -29,18 +30,20 @@ struct nand_memory_organization { · 4 unmodified lines
2930 unsigned int oobsize;
3031 unsigned int pages_per_eraseblock;
3132 unsigned int eraseblocks_per_lun;
33+ unsigned int max_bad_eraseblocks_per_lun;
3234 unsigned int planes_per_lun;
3335 unsigned int luns_per_target;
3436 unsigned int ntargets;
3537 };
3638
37−#define NAND_MEMORG(bpc, ps, os, ppe, epl, ppl, lpt, nt) \
39+#define NAND_MEMORG(bpc, ps, os, ppe, epl, mbb, ppl, lpt, nt) \
3840 { \
3941 .bits_per_cell = (bpc), \
4042 .pagesize = (ps), \
4143 .oobsize = (os), \
4244 .pages_per_eraseblock = (ppe), \
4345 .eraseblocks_per_lun = (epl), \
46+ .max_bad_eraseblocks_per_lun = (mbb), \
4447 .planes_per_lun = (ppl), \
4548 .luns_per_target = (lpt), \
4649 .ntargets = (nt), \
@@ -268,6 +271,20 @@ nanddev_pages_per_eraseblock(const struct nand_device *nand) · 221 unmodified lines
268271 return nand->memorg.pages_per_eraseblock;
269272 }
270273
274+/**
275+ * nanddev_pages_per_target() - Get the number of pages per target
276+ * @nand: NAND device
277+ *
278+ * Return: the number of pages per target.
279+ */
280+static inline unsigned int
281+nanddev_pages_per_target(const struct nand_device *nand)
282+{
283+ return nand->memorg.pages_per_eraseblock *
284+ nand->memorg.eraseblocks_per_lun *
285+ nand->memorg.luns_per_target;
286+}
287+
271288 /**
272289 * nanddev_per_page_oobsize() - Get NAND erase block size
273290 * @nand: NAND device
@@ -291,6 +308,18 @@ nanddev_eraseblocks_per_lun(const struct nand_device *nand) · 17 unmodified lines
291308 return nand->memorg.eraseblocks_per_lun;
292309 }
293310
311+/**
312+ * nanddev_eraseblocks_per_target() - Get the number of eraseblocks per target
313+ * @nand: NAND device
314+ *
315+ * Return: the number of eraseblocks per target.
316+ */
317+static inline unsigned int
318+nanddev_eraseblocks_per_target(const struct nand_device *nand)
319+{
320+ return nand->memorg.eraseblocks_per_lun * nand->memorg.luns_per_target;
321+}
322+
294323 /**
295324 * nanddev_target_size() - Get the total size provided by a single target/die
296325 * @nand: NAND device
@@ -729,5 +758,6 @@ static inline bool nanddev_bbt_is_initialized(struct nand_device *nand) · 432 unmodified lines
729758
730759 /* MTD -> NAND helper functions. */
731760 int nanddev_mtd_erase(struct mtd_info *mtd, struct erase_info *einfo);
761+int nanddev_mtd_max_bad_blocks(struct mtd_info *mtd, loff_t offs, size_t len);
732762
733763 #endif /* __LINUX_MTD_NAND_H */
include/linux/mtd/nand_bch.h+3−3
@@ -15,7 +15,7 @@ struct mtd_info; · 14 unmodified lines
1515 struct nand_chip;
1616 struct nand_bch_control;
1717
18−#if defined(CONFIG_MTD_NAND_ECC_BCH)
18+#if IS_ENABLED(CONFIG_MTD_NAND_ECC_SW_BCH)
1919
2020 static inline int mtd_nand_has_bch(void) { return 1; }
2121
@@ -39,7 +39,7 @@ struct nand_bch_control *nand_bch_init(struct mtd_info *mtd); · 17 unmodified lines
3939 */
4040 void nand_bch_free(struct nand_bch_control *nbc);
4141
42−#else /* !CONFIG_MTD_NAND_ECC_BCH */
42+#else /* !CONFIG_MTD_NAND_ECC_SW_BCH */
4343
4444 static inline int mtd_nand_has_bch(void) { return 0; }
4545
@@ -64,6 +64,6 @@ static inline struct nand_bch_control *nand_bch_init(struct mtd_info *mtd) · 18 unmodified lines
6464
6565 static inline void nand_bch_free(struct nand_bch_control *nbc) {}
6666
67−#endif /* CONFIG_MTD_NAND_ECC_BCH */
67+#endif /* CONFIG_MTD_NAND_ECC_SW_BCH */
6868
6969 #endif /* __MTD_NAND_BCH_H__ */
include/linux/mtd/onenand.h+3−0
@@ -94,6 +94,7 @@ struct onenand_chip { · 93 unmodified lines
9494 unsigned int technology;
9595 unsigned int density_mask;
9696 unsigned int options;
97+ unsigned int badblockpos;
9798
9899 unsigned int erase_shift;
99100 unsigned int page_shift;
@@ -188,6 +189,8 @@ struct onenand_chip { · 88 unmodified lines
188189 /* Check byte access in OneNAND */
189190 #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
190191
192+#define ONENAND_BADBLOCK_POS 0
193+
191194 /*
192195 * Options bits
193196 */
include/linux/mtd/rawnand.h+73−49
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #include <linux/mtd/flashchip.h>
2121 #include <linux/mtd/bbm.h>
2222 #include <linux/mtd/jedec.h>
23+#include <linux/mtd/nand.h>
2324 #include <linux/mtd/onfi.h>
2425 #include <linux/mutex.h>
2526 #include <linux/of.h>
@@ -168,6 +169,21 @@ enum nand_ecc_algo { · 142 unmodified lines
168169 /* Macros to identify the above */
169170 #define NAND_HAS_SUBPAGE_READ(chip) ((chip->options & NAND_SUBPAGE_READ))
170171
172+/*
173+ * There are different places where the manufacturer stores the factory bad
174+ * block markers.
175+ *
176+ * Position within the block: Each of these pages needs to be checked for a
177+ * bad block marking pattern.
178+ */
179+#define NAND_BBM_FIRSTPAGE 0x01000000
180+#define NAND_BBM_SECONDPAGE 0x02000000
181+#define NAND_BBM_LASTPAGE 0x04000000
182+
183+/* Position within the OOB data of the page */
184+#define NAND_BBM_POS_SMALL 5
185+#define NAND_BBM_POS_LARGE 0
186+
171187 /* Non chip related options */
172188 /* This option skips the bbt scan during initialization. */
173189 #define NAND_SKIP_BBTSCAN 0x00010000
@@ -805,7 +821,7 @@ struct nand_op_parser_pattern { · 631 unmodified lines
805821 #define NAND_OP_PARSER_PATTERN(_exec, ...) \
806822 { \
807823 .exec = _exec, \
808− .elems = (struct nand_op_parser_pattern_elem[]) { __VA_ARGS__ }, \
824+ .elems = (const struct nand_op_parser_pattern_elem[]) { __VA_ARGS__ }, \
809825 .nelems = sizeof((struct nand_op_parser_pattern_elem[]) { __VA_ARGS__ }) / \
810826 sizeof(struct nand_op_parser_pattern_elem), \
811827 }
@@ -831,7 +847,7 @@ struct nand_op_parser { · 19 unmodified lines
831847
832848 #define NAND_OP_PARSER(...) \
833849 { \
834− .patterns = (struct nand_op_parser_pattern[]) { __VA_ARGS__ }, \
850+ .patterns = (const struct nand_op_parser_pattern[]) { __VA_ARGS__ }, \
835851 .npatterns = sizeof((struct nand_op_parser_pattern[]) { __VA_ARGS__ }) / \
836852 sizeof(struct nand_op_parser_pattern), \
837853 }
@@ -860,6 +876,7 @@ struct nand_operation { · 22 unmodified lines
860876 int nand_op_parser_exec_op(struct nand_chip *chip,
861877 const struct nand_op_parser *parser,
862878 const struct nand_operation *op, bool check_only);
879+
863880 /**
864881 * struct nand_controller_ops - Controller operations
865882 *
@@ -962,7 +979,7 @@ struct nand_legacy { · 96 unmodified lines
962979
963980 /**
964981 * struct nand_chip - NAND Private Flash Chip Data
965− * @mtd: MTD device registered to the MTD framework
982+ * @base: Inherit from the generic NAND device
966983 * @legacy: All legacy fields/hooks. If you develop a new driver,
967984 * don't even try to use any of these fields/hooks, and if
968985 * you're modifying an existing driver that is using those
@@ -990,37 +1007,26 @@ struct nand_legacy { · 21 unmodified lines
9901007 * @badblockbits: [INTERN] minimum number of set bits in a good block's
9911008 * bad block marker position; i.e., BBM == 11110111b is
9921009 * not bad when badblockbits == 7
993− * @bits_per_cell: [INTERN] number of bits per cell. i.e., 1 means SLC.
994− * @ecc_strength_ds: [INTERN] ECC correctability from the datasheet.
995− * Minimum amount of bit errors per @ecc_step_ds guaranteed
996− * to be correctable. If unknown, set to zero.
997− * @ecc_step_ds: [INTERN] ECC step required by the @ecc_strength_ds,
998− * also from the datasheet. It is the recommended ECC step
999− * size, if known; if unknown, set to zero.
10001010 * @onfi_timing_mode_default: [INTERN] default ONFI timing mode. This field is
10011011 * set to the actually used ONFI mode if the chip is
10021012 * ONFI compliant or deduced from the datasheet if
10031013 * the NAND chip is not ONFI compliant.
1004− * @numchips: [INTERN] number of physical chips
1005− * @chipsize: [INTERN] the size of one chip for multichip arrays
10061014 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
10071015 * @data_buf: [INTERN] buffer for data, size is (page size + oobsize).
1008− * @pagebuf: [INTERN] holds the pagenumber which is currently in
1009− * data_buf.
1010− * @pagebuf_bitflips: [INTERN] holds the bitflip count for the page which is
1011− * currently in data_buf.
1016+ * @pagecache: Structure containing page cache related fields
1017+ * @pagecache.bitflips: Number of bitflips of the cached page
1018+ * @pagecache.page: Page number currently in the cache. -1 means no page is
1019+ * currently cached
10121020 * @subpagesize: [INTERN] holds the subpagesize
10131021 * @id: [INTERN] holds NAND ID
10141022 * @parameters: [INTERN] holds generic parameters under an easily
10151023 * readable form.
1016− * @max_bb_per_die: [INTERN] the max number of bad blocks each die of a
1017− * this nand device will encounter their life times.
1018− * @blocks_per_die: [INTERN] The number of PEBs in a die
10191024 * @data_interface: [INTERN] NAND interface timing information
10201025 * @cur_cs: currently selected target. -1 means no target selected,
10211026 * otherwise we should always have cur_cs >= 0 &&
1022− * cur_cs < numchips. NAND Controller drivers should not
1023− * modify this value, but they're allowed to read it.
1027+ * cur_cs < nanddev_ntargets(). NAND Controller drivers
1028+ * should not modify this value, but they're allowed to
1029+ * read it.
10241030 * @read_retries: [INTERN] the number of read retry modes supported
10251031 * @lock: lock protecting the suspended field. Also used to
10261032 * serialize accesses to the NAND device.
@@ -1041,7 +1047,7 @@ struct nand_legacy { · 14 unmodified lines
10411047 */
10421048
10431049 struct nand_chip {
1044− struct mtd_info mtd;
1050+ struct nand_device base;
10451051
10461052 struct nand_legacy legacy;
10471053
@@ -1054,24 +1060,21 @@ struct nand_chip { · 6 unmodified lines
10541060 int phys_erase_shift;
10551061 int bbt_erase_shift;
10561062 int chip_shift;
1057− int numchips;
1058− uint64_t chipsize;
10591063 int pagemask;
10601064 u8 *data_buf;
1061− int pagebuf;
1062− unsigned int pagebuf_bitflips;
1065+
1066+ struct {
1067+ unsigned int bitflips;
1068+ int page;
1069+ } pagecache;
1070+
10631071 int subpagesize;
1064− uint8_t bits_per_cell;
1065− uint16_t ecc_strength_ds;
1066− uint16_t ecc_step_ds;
10671072 int onfi_timing_mode_default;
1068− int badblockpos;
1073+ unsigned int badblockpos;
10691074 int badblockbits;
10701075
10711076 struct nand_id id;
10721077 struct nand_parameters parameters;
1073− u16 max_bb_per_die;
1074− u32 blocks_per_die;
10751078
10761079 struct nand_data_interface data_interface;
10771080
@@ -1105,25 +1108,14 @@ struct nand_chip { · 27 unmodified lines
11051108 extern const struct mtd_ooblayout_ops nand_ooblayout_sp_ops;
11061109 extern const struct mtd_ooblayout_ops nand_ooblayout_lp_ops;
11071110
1108−static inline void nand_set_flash_node(struct nand_chip *chip,
1109− struct device_node *np)
1110−{
1111− mtd_set_of_node(&chip->mtd, np);
1112−}
1113−
1114−static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
1115−{
1116− return mtd_get_of_node(&chip->mtd);
1117−}
1118−
11191111 static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)
11201112 {
1121− return container_of(mtd, struct nand_chip, mtd);
1113+ return container_of(mtd, struct nand_chip, base.mtd);
11221114 }
11231115
11241116 static inline struct mtd_info *nand_to_mtd(struct nand_chip *chip)
11251117 {
1126− return &chip->mtd;
1118+ return &chip->base.mtd;
11271119 }
11281120
11291121 static inline void *nand_get_controller_data(struct nand_chip *chip)
@@ -1147,6 +1139,17 @@ static inline void *nand_get_manufacturer_data(struct nand_chip *chip) · 17 unmodified lines
11471139 return chip->manufacturer.priv;
11481140 }
11491141
1142+static inline void nand_set_flash_node(struct nand_chip *chip,
1143+ struct device_node *np)
1144+{
1145+ mtd_set_of_node(nand_to_mtd(chip), np);
1146+}
1147+
1148+static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
1149+{
1150+ return mtd_get_of_node(nand_to_mtd(chip));
1151+}
1152+
11501153 /*
11511154 * A helper for defining older NAND chips where the second ID byte fully
11521155 * defined the chip, including the geometry (chip size, eraseblock size, page
@@ -1180,9 +1183,9 @@ static inline void *nand_get_manufacturer_data(struct nand_chip *chip) · 27 unmodified lines
11801183 * @name: a human-readable name of the NAND chip
11811184 * @dev_id: the device ID (the second byte of the full chip ID array)
11821185 * @mfr_id: manufecturer ID part of the full chip ID array (refers the same
1183− * memory address as @id[0])
1186+ * memory address as ``id[0]``)
11841187 * @dev_id: device ID part of the full chip ID array (refers the same memory
1185− * address as @id[1])
1188+ * address as ``id[1]``)
11861189 * @id: full device ID array
11871190 * @pagesize: size of the NAND page in bytes; if 0, then the real page size (as
11881191 * well as the eraseblock size) is determined from the extended NAND
@@ -1235,9 +1238,9 @@ int nand_create_bbt(struct nand_chip *chip); · 46 unmodified lines
12351238 */
12361239 static inline bool nand_is_slc(struct nand_chip *chip)
12371240 {
1238− WARN(chip->bits_per_cell == 0,
1241+ WARN(nanddev_bits_per_cell(&chip->base) == 0,
12391242 "chip->bits_per_cell is used uninitialized\n");
1240− return chip->bits_per_cell == 1;
1243+ return nanddev_bits_per_cell(&chip->base) == 1;
12411244 }
12421245
12431246 /**
@@ -1348,4 +1351,25 @@ int nand_gpio_waitrdy(struct nand_chip *chip, struct gpio_desc *gpiod, · 104 unmodified lines
13481351 void nand_select_target(struct nand_chip *chip, unsigned int cs);
13491352 void nand_deselect_target(struct nand_chip *chip);
13501353
1354+/**
1355+ * nand_get_data_buf() - Get the internal page buffer
1356+ * @chip: NAND chip object
1357+ *
1358+ * Returns the pre-allocated page buffer after invalidating the cache. This
1359+ * function should be used by drivers that do not want to allocate their own
1360+ * bounce buffer and still need such a buffer for specific operations (most
1361+ * commonly when reading OOB data only).
1362+ *
1363+ * Be careful to never call this function in the write/write_oob path, because
1364+ * the core may have placed the data to be written out in this buffer.
1365+ *
1366+ * Return: pointer to the page cache buffer
1367+ */
1368+static inline void *nand_get_data_buf(struct nand_chip *chip)
1369+{
1370+ chip->pagecache.page = -1;
1371+
1372+ return chip->data_buf;
1373+}
1374+
13511375 #endif /* __LINUX_MTD_RAWNAND_H */
include/linux/mtd/spinand.h+7−0
@@ -302,6 +302,11 @@ struct spinand_info { · 301 unmodified lines
302302 __VA_ARGS__ \
303303 }
304304
305+struct spinand_dirmap {
306+ struct spi_mem_dirmap_desc *wdesc;
307+ struct spi_mem_dirmap_desc *rdesc;
308+};
309+
305310 /**
306311 * struct spinand_device - SPI NAND device instance
307312 * @base: NAND device instance
@@ -341,6 +346,8 @@ struct spinand_device { · 33 unmodified lines
341346 const struct spi_mem_op *update_cache;
342347 } op_templates;
343348
349+ struct spinand_dirmap *dirmaps;
350+
344351 int (*select_target)(struct spinand_device *spinand,
345352 unsigned int target);
346353 unsigned int cur_target;
include/linux/net.h+2−0
@@ -161,6 +161,8 @@ struct proto_ops { · 160 unmodified lines
161161 int (*compat_ioctl) (struct socket *sock, unsigned int cmd,
162162 unsigned long arg);
163163 #endif
164+ int (*gettstamp) (struct socket *sock, void __user *userstamp,
165+ bool timeval, bool time32);
164166 int (*listen) (struct socket *sock, int len);
165167 int (*shutdown) (struct socket *sock, int flags);
166168 int (*setsockopt)(struct socket *sock, int level,
include/linux/netdevice.h+51−47
@@ -194,8 +194,8 @@ struct net_device_stats { · 193 unmodified lines
194194
195195 #ifdef CONFIG_RPS
196196 #include <linux/static_key.h>
197−extern struct static_key rps_needed;
198−extern struct static_key rfs_needed;
197+extern struct static_key_false rps_needed;
198+extern struct static_key_false rfs_needed;
199199 #endif
200200
201201 struct neighbour;
@@ -914,34 +914,13 @@ struct xfrmdev_ops { · 712 unmodified lines
914914 };
915915 #endif
916916
917−#if IS_ENABLED(CONFIG_TLS_DEVICE)
918−enum tls_offload_ctx_dir {
919− TLS_OFFLOAD_CTX_DIR_RX,
920− TLS_OFFLOAD_CTX_DIR_TX,
921−};
922−
923−struct tls_crypto_info;
924−struct tls_context;
925−
926−struct tlsdev_ops {
927− int (*tls_dev_add)(struct net_device *netdev, struct sock *sk,
928− enum tls_offload_ctx_dir direction,
929− struct tls_crypto_info *crypto_info,
930− u32 start_offload_tcp_sn);
931− void (*tls_dev_del)(struct net_device *netdev,
932− struct tls_context *ctx,
933− enum tls_offload_ctx_dir direction);
934− void (*tls_dev_resync_rx)(struct net_device *netdev,
935− struct sock *sk, u32 seq, u64 rcd_sn);
936−};
937−#endif
938−
939917 struct dev_ifalias {
940918 struct rcu_head rcuhead;
941919 char ifalias[];
942920 };
943921
944922 struct devlink;
923+struct tlsdev_ops;
945924
946925 /*
947926 * This structure defines the management hooks for network devices.
@@ -986,8 +965,7 @@ struct devlink; · 38 unmodified lines
986965 * those the driver believes to be appropriate.
987966 *
988967 * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb,
989− * struct net_device *sb_dev,
990− * select_queue_fallback_t fallback);
968+ * struct net_device *sb_dev);
991969 * Called to decide which queue to use when device supports multiple
992970 * transmit queues.
993971 *
@@ -1251,8 +1229,8 @@ struct devlink; · 257 unmodified lines
12511229 * that got dropped are freed/returned via xdp_return_frame().
12521230 * Returns negative number, means general error invoking ndo, meaning
12531231 * no frames were xmit'ed and core-caller will free all frames.
1254− * struct devlink *(*ndo_get_devlink)(struct net_device *dev);
1255− * Get devlink instance associated with a given netdev.
1232+ * struct devlink_port *(*ndo_get_devlink_port)(struct net_device *dev);
1233+ * Get devlink port instance associated with a given netdev.
12561234 * Called with a reference on the netdevice and devlink locks only,
12571235 * rtnl_lock is not held.
12581236 */
@@ -1268,8 +1246,7 @@ struct net_device_ops { · 9 unmodified lines
12681246 netdev_features_t features);
12691247 u16 (*ndo_select_queue)(struct net_device *dev,
12701248 struct sk_buff *skb,
1271− struct net_device *sb_dev,
1272− select_queue_fallback_t fallback);
1249+ struct net_device *sb_dev);
12731250 void (*ndo_change_rx_flags)(struct net_device *dev,
12741251 int flags);
12751252 void (*ndo_set_rx_mode)(struct net_device *dev);
@@ -1453,7 +1430,7 @@ struct net_device_ops { · 177 unmodified lines
14531430 u32 flags);
14541431 int (*ndo_xsk_async_xmit)(struct net_device *dev,
14551432 u32 queue_id);
1456− struct devlink * (*ndo_get_devlink)(struct net_device *dev);
1433+ struct devlink_port * (*ndo_get_devlink_port)(struct net_device *dev);
14571434 };
14581435
14591436 /**
@@ -1500,6 +1477,7 @@ struct net_device_ops { · 40 unmodified lines
15001477 * @IFF_FAILOVER: device is a failover master device
15011478 * @IFF_FAILOVER_SLAVE: device is lower dev of a failover master device
15021479 * @IFF_L3MDEV_RX_HANDLER: only invoke the rx handler of L3 master device
1480+ * @IFF_LIVE_RENAME_OK: rename is allowed while device is up and running
15031481 */
15041482 enum netdev_priv_flags {
15051483 IFF_802_1Q_VLAN = 1<<0,
@@ -1532,6 +1510,7 @@ enum netdev_priv_flags { · 26 unmodified lines
15321510 IFF_FAILOVER = 1<<27,
15331511 IFF_FAILOVER_SLAVE = 1<<28,
15341512 IFF_L3MDEV_RX_HANDLER = 1<<29,
1513+ IFF_LIVE_RENAME_OK = 1<<30,
15351514 };
15361515
15371516 #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -1563,6 +1542,7 @@ enum netdev_priv_flags { · 25 unmodified lines
15631542 #define IFF_FAILOVER IFF_FAILOVER
15641543 #define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE
15651544 #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER
1545+#define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK
15661546
15671547 /**
15681548 * struct net_device - The DEVICE structure.
@@ -2152,9 +2132,11 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, · 583 unmodified lines
21522132 &qdisc_xmit_lock_key); \
21532133 }
21542134
2155−struct netdev_queue *netdev_pick_tx(struct net_device *dev,
2156− struct sk_buff *skb,
2157− struct net_device *sb_dev);
2135+u16 netdev_pick_tx(struct net_device *dev, struct sk_buff *skb,
2136+ struct net_device *sb_dev);
2137+struct netdev_queue *netdev_core_pick_tx(struct net_device *dev,
2138+ struct sk_buff *skb,
2139+ struct net_device *sb_dev);
21582140
21592141 /* returns the headroom that the master device needs to take in account
21602142 * when forwarding to this dev
@@ -2639,11 +2621,9 @@ void dev_close_many(struct list_head *head, bool unlink); · 478 unmodified lines
26392621 void dev_disable_lro(struct net_device *dev);
26402622 int dev_loopback_xmit(struct net *net, struct sock *sk, struct sk_buff *newskb);
26412623 u16 dev_pick_tx_zero(struct net_device *dev, struct sk_buff *skb,
2642− struct net_device *sb_dev,
2643− select_queue_fallback_t fallback);
2624+ struct net_device *sb_dev);
26442625 u16 dev_pick_tx_cpu_id(struct net_device *dev, struct sk_buff *skb,
2645− struct net_device *sb_dev,
2646− select_queue_fallback_t fallback);
2626+ struct net_device *sb_dev);
26472627 int dev_queue_xmit(struct sk_buff *skb);
26482628 int dev_queue_xmit_accel(struct sk_buff *skb, struct net_device *sb_dev);
26492629 int dev_direct_xmit(struct sk_buff *skb, u16 queue_id);
@@ -2661,14 +2641,6 @@ void netdev_freemem(struct net_device *dev); · 11 unmodified lines
26612641 void synchronize_net(void);
26622642 int init_dummy_netdev(struct net_device *dev);
26632643
2664−DECLARE_PER_CPU(int, xmit_recursion);
2665−#define XMIT_RECURSION_LIMIT 10
2666−
2667−static inline int dev_recursion_level(void)
2668−{
2669− return this_cpu_read(xmit_recursion);
2670−}
2671−
26722644 struct net_device *dev_get_by_index(struct net *net, int ifindex);
26732645 struct net_device *__dev_get_by_index(struct net *net, int ifindex);
26742646 struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
@@ -3017,6 +2989,11 @@ struct softnet_data { · 342 unmodified lines
30172989 #ifdef CONFIG_XFRM_OFFLOAD
30182990 struct sk_buff_head xfrm_backlog;
30192991 #endif
2992+ /* written and read only by owning cpu: */
2993+ struct {
2994+ u16 recursion;
2995+ u8 more;
2996+ } xmit;
30202997 #ifdef CONFIG_RPS
30212998 /* input_queue_head should be written by cpu owning this struct,
30222999 * and only read by other cpus. Worth using a cache line.
@@ -3052,6 +3029,28 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd, · 29 unmodified lines
30523029
30533030 DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
30543031
3032+static inline int dev_recursion_level(void)
3033+{
3034+ return this_cpu_read(softnet_data.xmit.recursion);
3035+}
3036+
3037+#define XMIT_RECURSION_LIMIT 10
3038+static inline bool dev_xmit_recursion(void)
3039+{
3040+ return unlikely(__this_cpu_read(softnet_data.xmit.recursion) >
3041+ XMIT_RECURSION_LIMIT);
3042+}
3043+
3044+static inline void dev_xmit_recursion_inc(void)
3045+{
3046+ __this_cpu_inc(softnet_data.xmit.recursion);
3047+}
3048+
3049+static inline void dev_xmit_recursion_dec(void)
3050+{
3051+ __this_cpu_dec(softnet_data.xmit.recursion);
3052+}
3053+
30553054 void __netif_schedule(struct Qdisc *q);
30563055 void netif_schedule_queue(struct netdev_queue *txq);
30573056
@@ -4407,10 +4406,15 @@ static inline netdev_tx_t __netdev_start_xmit(const struct net_device_ops *ops, · 1349 unmodified lines
44074406 struct sk_buff *skb, struct net_device *dev,
44084407 bool more)
44094408 {
4410− skb->xmit_more = more ? 1 : 0;
4409+ __this_cpu_write(softnet_data.xmit.more, more);
44114410 return ops->ndo_start_xmit(skb, dev);
44124411 }
44134412
4413+static inline bool netdev_xmit_more(void)
4414+{
4415+ return __this_cpu_read(softnet_data.xmit.more);
4416+}
4417+
44144418 static inline netdev_tx_t netdev_start_xmit(struct sk_buff *skb, struct net_device *dev,
44154419 struct netdev_queue *txq, bool more)
44164420 {
include/linux/netfilter.h+17−1
@@ -24,20 +24,36 @@ static inline int NF_DROP_GETERR(int verdict) · 23 unmodified lines
2424 static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1,
2525 const union nf_inet_addr *a2)
2626 {
27+#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
28+ const unsigned long *ul1 = (const unsigned long *)a1;
29+ const unsigned long *ul2 = (const unsigned long *)a2;
30+
31+ return ((ul1[0] ^ ul2[0]) | (ul1[1] ^ ul2[1])) == 0UL;
32+#else
2733 return a1->all[0] == a2->all[0] &&
2834 a1->all[1] == a2->all[1] &&
2935 a1->all[2] == a2->all[2] &&
3036 a1->all[3] == a2->all[3];
37+#endif
3138 }
3239
3340 static inline void nf_inet_addr_mask(const union nf_inet_addr *a1,
3441 union nf_inet_addr *result,
3542 const union nf_inet_addr *mask)
3643 {
44+#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
45+ const unsigned long *ua = (const unsigned long *)a1;
46+ unsigned long *ur = (unsigned long *)result;
47+ const unsigned long *um = (const unsigned long *)mask;
48+
49+ ur[0] = ua[0] & um[0];
50+ ur[1] = ua[1] & um[1];
51+#else
3752 result->all[0] = a1->all[0] & mask->all[0];
3853 result->all[1] = a1->all[1] & mask->all[1];
3954 result->all[2] = a1->all[2] & mask->all[2];
4055 result->all[3] = a1->all[3] & mask->all[3];
56+#endif
4157 }
4258
4359 int netfilter_init(void);
@@ -360,7 +376,7 @@ extern struct nf_nat_hook __rcu *nf_nat_hook; · 316 unmodified lines
360376 static inline void
361377 nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
362378 {
363−#ifdef CONFIG_NF_NAT_NEEDED
379+#if IS_ENABLED(CONFIG_NF_NAT)
364380 struct nf_nat_hook *nat_hook;
365381
366382 rcu_read_lock();
include/linux/netfilter/ipset/ip_set.h+4−7
@@ -401,33 +401,30 @@ ip_set_get_h16(const struct nlattr *attr) · 400 unmodified lines
401401 return ntohs(nla_get_be16(attr));
402402 }
403403
404−#define ipset_nest_start(skb, attr) nla_nest_start(skb, attr | NLA_F_NESTED)
405−#define ipset_nest_end(skb, start) nla_nest_end(skb, start)
406−
407404 static inline int nla_put_ipaddr4(struct sk_buff *skb, int type, __be32 ipaddr)
408405 {
409− struct nlattr *__nested = ipset_nest_start(skb, type);
406+ struct nlattr *__nested = nla_nest_start(skb, type);
410407 int ret;
411408
412409 if (!__nested)
413410 return -EMSGSIZE;
414411 ret = nla_put_in_addr(skb, IPSET_ATTR_IPADDR_IPV4, ipaddr);
415412 if (!ret)
416− ipset_nest_end(skb, __nested);
413+ nla_nest_end(skb, __nested);
417414 return ret;
418415 }
419416
420417 static inline int nla_put_ipaddr6(struct sk_buff *skb, int type,
421418 const struct in6_addr *ipaddrptr)
422419 {
423− struct nlattr *__nested = ipset_nest_start(skb, type);
420+ struct nlattr *__nested = nla_nest_start(skb, type);
424421 int ret;
425422
426423 if (!__nested)
427424 return -EMSGSIZE;
428425 ret = nla_put_in6_addr(skb, IPSET_ATTR_IPADDR_IPV6, ipaddrptr);
429426 if (!ret)
430− ipset_nest_end(skb, __nested);
427+ nla_nest_end(skb, __nested);
431428 return ret;
432429 }
433430
include/linux/netfilter/nfnetlink_osf.h+8−3
@@ -21,13 +21,18 @@ struct nf_osf_finger { · 20 unmodified lines
2121 struct nf_osf_user_finger finger;
2222 };
2323
24+struct nf_osf_data {
25+ const char *genre;
26+ const char *version;
27+};
28+
2429 bool nf_osf_match(const struct sk_buff *skb, u_int8_t family,
2530 int hooknum, struct net_device *in, struct net_device *out,
2631 const struct nf_osf_info *info, struct net *net,
2732 const struct list_head *nf_osf_fingers);
2833
29−const char *nf_osf_find(const struct sk_buff *skb,
30− const struct list_head *nf_osf_fingers,
31− const int ttl_check);
34+bool nf_osf_find(const struct sk_buff *skb,
35+ const struct list_head *nf_osf_fingers,
36+ const int ttl_check, struct nf_osf_data *data);
3237
3338 #endif /* _NFOSF_H */
include/linux/netfilter/x_tables.h+0−1
@@ -317,7 +317,6 @@ struct xt_table_info *xt_replace_table(struct xt_table *table, · 316 unmodified lines
317317 int *error);
318318
319319 struct xt_match *xt_find_match(u8 af, const char *name, u8 revision);
320−struct xt_target *xt_find_target(u8 af, const char *name, u8 revision);
321320 struct xt_match *xt_request_find_match(u8 af, const char *name, u8 revision);
322321 struct xt_target *xt_request_find_target(u8 af, const char *name, u8 revision);
323322 int xt_find_revision(u8 af, const char *name, u8 revision, int target,
include/linux/netfilter_ipv6.h+15−0
@@ -87,6 +87,21 @@ static inline int nf_ip6_route(struct net *net, struct dst_entry **dst, · 86 unmodified lines
8787 }
8888
8989 int ip6_route_me_harder(struct net *net, struct sk_buff *skb);
90+
91+static inline int nf_ip6_route_me_harder(struct net *net, struct sk_buff *skb)
92+{
93+#if IS_MODULE(CONFIG_IPV6)
94+ const struct nf_ipv6_ops *v6_ops = nf_get_ipv6_ops();
95+
96+ if (!v6_ops)
97+ return -EHOSTUNREACH;
98+
99+ return v6_ops->route_me_harder(net, skb);
100+#else
101+ return ip6_route_me_harder(net, skb);
102+#endif
103+}
104+
90105 __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
91106 unsigned int dataoff, u_int8_t protocol);
92107
include/linux/nfs_fs.h+0−1
@@ -76,7 +76,6 @@ struct nfs_open_context { · 75 unmodified lines
7676 fmode_t mode;
7777
7878 unsigned long flags;
79−#define NFS_CONTEXT_ERROR_WRITE (0)
8079 #define NFS_CONTEXT_RESEND_WRITES (1)
8180 #define NFS_CONTEXT_BAD (2)
8281 #define NFS_CONTEXT_UNLOCK (3)
include/linux/nfs_fs_sb.h+13−0
@@ -139,6 +139,16 @@ struct nfs_server { · 138 unmodified lines
139139 struct nfs_iostats __percpu *io_stats; /* I/O statistics */
140140 atomic_long_t writeback; /* number of writeback pages */
141141 int flags; /* various flags */
142+
143+/* The following are for internal use only. Also see uapi/linux/nfs_mount.h */
144+#define NFS_MOUNT_LOOKUP_CACHE_NONEG 0x10000
145+#define NFS_MOUNT_LOOKUP_CACHE_NONE 0x20000
146+#define NFS_MOUNT_NORESVPORT 0x40000
147+#define NFS_MOUNT_LEGACY_INTERFACE 0x80000
148+#define NFS_MOUNT_LOCAL_FLOCK 0x100000
149+#define NFS_MOUNT_LOCAL_FCNTL 0x200000
150+#define NFS_MOUNT_SOFTERR 0x400000
151+
142152 unsigned int caps; /* server capabilities */
143153 unsigned int rsize; /* read size */
144154 unsigned int rpages; /* read size (in pages) */
@@ -231,6 +241,9 @@ struct nfs_server { · 86 unmodified lines
231241
232242 /* XDR related information */
233243 unsigned int read_hdrsize;
244+
245+ /* User namespace info */
246+ const struct cred *cred;
234247 };
235248
236249 /* Server capabilities */
include/linux/nfs_page.h+9−3
@@ -42,7 +42,6 @@ struct nfs_inode; · 41 unmodified lines
4242 struct nfs_page {
4343 struct list_head wb_list; /* Defines state of page: */
4444 struct page *wb_page; /* page to read in/write out */
45− struct nfs_open_context *wb_context; /* File state context info */
4645 struct nfs_lock_context *wb_lock_context; /* lock context info */
4746 pgoff_t wb_index; /* Offset >> PAGE_SHIFT */
4847 unsigned int wb_offset, /* Offset & ~PAGE_MASK */
@@ -53,6 +52,7 @@ struct nfs_page { · 4 unmodified lines
5352 struct nfs_write_verifier wb_verf; /* Commit cookie */
5453 struct nfs_page *wb_this_page; /* list of reqs for this page */
5554 struct nfs_page *wb_head; /* head pointer for req list */
55+ unsigned short wb_nio; /* Number of I/O attempts */
5656 };
5757
5858 struct nfs_pageio_descriptor;
@@ -87,7 +87,6 @@ struct nfs_pgio_mirror { · 28 unmodified lines
8787 };
8888
8989 struct nfs_pageio_descriptor {
90− unsigned char pg_moreio : 1;
9190 struct inode *pg_inode;
9291 const struct nfs_pageio_ops *pg_ops;
9392 const struct nfs_rw_ops *pg_rw_ops;
@@ -105,6 +104,8 @@ struct nfs_pageio_descriptor { · 11 unmodified lines
105104 struct nfs_pgio_mirror pg_mirrors_static[1];
106105 struct nfs_pgio_mirror *pg_mirrors_dynamic;
107106 u32 pg_mirror_idx; /* current mirror */
107+ unsigned short pg_maxretrans;
108+ unsigned char pg_moreio : 1;
108109 };
109110
110111 /* arbitrarily selected limit to number of mirrors */
@@ -114,7 +115,6 @@ struct nfs_pageio_descriptor { · 3 unmodified lines
114115
115116 extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx,
116117 struct page *page,
117− struct nfs_page *last,
118118 unsigned int offset,
119119 unsigned int count);
120120 extern void nfs_release_request(struct nfs_page *);
@@ -199,4 +199,10 @@ loff_t req_offset(struct nfs_page *req) · 78 unmodified lines
199199 return (((loff_t)req->wb_index) << PAGE_SHIFT) + req->wb_offset;
200200 }
201201
202+static inline struct nfs_open_context *
203+nfs_req_openctx(struct nfs_page *req)
204+{
205+ return req->wb_lock_context->open_context;
206+}
207+
202208 #endif /* _LINUX_NFS_PAGE_H */
include/linux/node.h+71−0
@@ -17,14 +17,81 @@ · 16 unmodified lines
1717
1818 #include <linux/device.h>
1919 #include <linux/cpumask.h>
20+#include <linux/list.h>
2021 #include <linux/workqueue.h>
2122
23+/**
24+ * struct node_hmem_attrs - heterogeneous memory performance attributes
25+ *
26+ * @read_bandwidth: Read bandwidth in MB/s
27+ * @write_bandwidth: Write bandwidth in MB/s
28+ * @read_latency: Read latency in nanoseconds
29+ * @write_latency: Write latency in nanoseconds
30+ */
31+struct node_hmem_attrs {
32+ unsigned int read_bandwidth;
33+ unsigned int write_bandwidth;
34+ unsigned int read_latency;
35+ unsigned int write_latency;
36+};
37+
38+enum cache_indexing {
39+ NODE_CACHE_DIRECT_MAP,
40+ NODE_CACHE_INDEXED,
41+ NODE_CACHE_OTHER,
42+};
43+
44+enum cache_write_policy {
45+ NODE_CACHE_WRITE_BACK,
46+ NODE_CACHE_WRITE_THROUGH,
47+ NODE_CACHE_WRITE_OTHER,
48+};
49+
50+/**
51+ * struct node_cache_attrs - system memory caching attributes
52+ *
53+ * @indexing: The ways memory blocks may be placed in cache
54+ * @write_policy: Write back or write through policy
55+ * @size: Total size of cache in bytes
56+ * @line_size: Number of bytes fetched on a cache miss
57+ * @level: The cache hierarchy level
58+ */
59+struct node_cache_attrs {
60+ enum cache_indexing indexing;
61+ enum cache_write_policy write_policy;
62+ u64 size;
63+ u16 line_size;
64+ u8 level;
65+};
66+
67+#ifdef CONFIG_HMEM_REPORTING
68+void node_add_cache(unsigned int nid, struct node_cache_attrs *cache_attrs);
69+void node_set_perf_attrs(unsigned int nid, struct node_hmem_attrs *hmem_attrs,
70+ unsigned access);
71+#else
72+static inline void node_add_cache(unsigned int nid,
73+ struct node_cache_attrs *cache_attrs)
74+{
75+}
76+
77+static inline void node_set_perf_attrs(unsigned int nid,
78+ struct node_hmem_attrs *hmem_attrs,
79+ unsigned access)
80+{
81+}
82+#endif
83+
2284 struct node {
2385 struct device dev;
86+ struct list_head access_list;
2487
2588 #if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_HUGETLBFS)
2689 struct work_struct node_work;
2790 #endif
91+#ifdef CONFIG_HMEM_REPORTING
92+ struct list_head cache_attrs;
93+ struct device *cache_dev;
94+#endif
2895 };
2996
3097 struct memory_block;
@@ -75,6 +142,10 @@ extern int register_mem_sect_under_node(struct memory_block *mem_blk, · 44 unmodified lines
75142 extern int unregister_mem_sect_under_nodes(struct memory_block *mem_blk,
76143 unsigned long phys_index);
77144
145+extern int register_memory_node_under_compute_node(unsigned int mem_nid,
146+ unsigned int cpu_nid,
147+ unsigned access);
148+
78149 #ifdef CONFIG_HUGETLBFS
79150 extern void register_hugetlbfs_with_node(node_registration_func_t doregister,
80151 node_registration_func_t unregister);
include/linux/nvme-fc-driver.h+0−6
@@ -17,12 +17,6 @@ · 16 unmodified lines
1717
1818
1919
20−/* FC Port role bitmask - can merge with FC Port Roles in fc transport */
21−#define FC_PORT_ROLE_NVME_INITIATOR 0x10
22−#define FC_PORT_ROLE_NVME_TARGET 0x20
23−#define FC_PORT_ROLE_NVME_DISCOVERY 0x40
24−
25−
2620 /**
2721 * struct nvme_fc_port_info - port-specific ids and FC connection-specific
2822 * data element used during NVME Host role
include/linux/nvme-rdma.h+1−1
@@ -77,7 +77,7 @@ struct nvme_rdma_cm_rep { · 76 unmodified lines
7777 * struct nvme_rdma_cm_rej - rdma connect reject
7878 *
7979 * @recfmt: format of the RDMA Private Data
80− * @fsts: error status for the associated connect request
80+ * @sts: error status for the associated connect request
8181 */
8282 struct nvme_rdma_cm_rej {
8383 __le16 recfmt;
include/linux/nvme.h+2−2
@@ -1246,9 +1246,9 @@ enum { · 1245 unmodified lines
12461246 NVME_SC_FW_NEEDS_SUBSYS_RESET = 0x110,
12471247 NVME_SC_FW_NEEDS_RESET = 0x111,
12481248 NVME_SC_FW_NEEDS_MAX_TIME = 0x112,
1249− NVME_SC_FW_ACIVATE_PROHIBITED = 0x113,
1249+ NVME_SC_FW_ACTIVATE_PROHIBITED = 0x113,
12501250 NVME_SC_OVERLAPPING_RANGE = 0x114,
1251− NVME_SC_NS_INSUFFICENT_CAP = 0x115,
1251+ NVME_SC_NS_INSUFFICIENT_CAP = 0x115,
12521252 NVME_SC_NS_ID_UNAVAILABLE = 0x116,
12531253 NVME_SC_NS_ALREADY_ATTACHED = 0x118,
12541254 NVME_SC_NS_IS_PRIVATE = 0x119,
include/linux/nvmem-consumer.h+7−0
@@ -61,6 +61,7 @@ void nvmem_cell_put(struct nvmem_cell *cell); · 60 unmodified lines
6161 void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell);
6262 void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len);
6363 int nvmem_cell_write(struct nvmem_cell *cell, void *buf, size_t len);
64+int nvmem_cell_read_u16(struct device *dev, const char *cell_id, u16 *val);
6465 int nvmem_cell_read_u32(struct device *dev, const char *cell_id, u32 *val);
6566
6667 /* direct nvmem device read/write interface */
@@ -122,6 +123,12 @@ static inline int nvmem_cell_write(struct nvmem_cell *cell, · 55 unmodified lines
122123 return -EOPNOTSUPP;
123124 }
124125
126+static inline int nvmem_cell_read_u16(struct device *dev,
127+ const char *cell_id, u16 *val)
128+{
129+ return -EOPNOTSUPP;
130+}
131+
125132 static inline int nvmem_cell_read_u32(struct device *dev,
126133 const char *cell_id, u32 *val)
127134 {
include/linux/of.h+4−3
@@ -234,8 +234,8 @@ extern struct device_node *of_find_all_nodes(struct device_node *prev); · 233 unmodified lines
234234 static inline u64 of_read_number(const __be32 *cell, int size)
235235 {
236236 u64 r = 0;
237− while (size--)
238− r = (r << 32) | be32_to_cpu(*(cell++));
237+ for (; size--; cell++)
238+ r = (r << 32) | be32_to_cpu(*cell);
239239 return r;
240240 }
241241
@@ -1449,7 +1449,8 @@ int of_overlay_notifier_unregister(struct notifier_block *nb); · 1207 unmodified lines
14491449
14501450 #else
14511451
1452−static inline int of_overlay_fdt_apply(void *overlay_fdt, int *ovcs_id)
1452+static inline int of_overlay_fdt_apply(void *overlay_fdt, u32 overlay_fdt_size,
1453+ int *ovcs_id)
14531454 {
14541455 return -ENOTSUPP;
14551456 }
include/linux/oid_registry.h+18−0
@@ -93,6 +93,24 @@ enum OID { · 92 unmodified lines
9393 OID_authorityKeyIdentifier, /* 2.5.29.35 */
9494 OID_extKeyUsage, /* 2.5.29.37 */
9595
96+ /* EC-RDSA */
97+ OID_gostCPSignA, /* 1.2.643.2.2.35.1 */
98+ OID_gostCPSignB, /* 1.2.643.2.2.35.2 */
99+ OID_gostCPSignC, /* 1.2.643.2.2.35.3 */
100+ OID_gost2012PKey256, /* 1.2.643.7.1.1.1.1 */
101+ OID_gost2012PKey512, /* 1.2.643.7.1.1.1.2 */
102+ OID_gost2012Digest256, /* 1.2.643.7.1.1.2.2 */
103+ OID_gost2012Digest512, /* 1.2.643.7.1.1.2.3 */
104+ OID_gost2012Signature256, /* 1.2.643.7.1.1.3.2 */
105+ OID_gost2012Signature512, /* 1.2.643.7.1.1.3.3 */
106+ OID_gostTC26Sign256A, /* 1.2.643.7.1.2.1.1.1 */
107+ OID_gostTC26Sign256B, /* 1.2.643.7.1.2.1.1.2 */
108+ OID_gostTC26Sign256C, /* 1.2.643.7.1.2.1.1.3 */
109+ OID_gostTC26Sign256D, /* 1.2.643.7.1.2.1.1.4 */
110+ OID_gostTC26Sign512A, /* 1.2.643.7.1.2.1.2.1 */
111+ OID_gostTC26Sign512B, /* 1.2.643.7.1.2.1.2.2 */
112+ OID_gostTC26Sign512C, /* 1.2.643.7.1.2.1.2.3 */
113+
96114 OID__NR
97115 };
98116
include/linux/overflow.h+15−5
@@ -36,6 +36,12 @@ · 35 unmodified lines
3636 #define type_max(T) ((T)((__type_half_max(T) - 1) + __type_half_max(T)))
3737 #define type_min(T) ((T)((T)-type_max(T)-(T)1))
3838
39+/*
40+ * Avoids triggering -Wtype-limits compilation warning,
41+ * while using unsigned data types to check a < 0.
42+ */
43+#define is_non_negative(a) ((a) > 0 || (a) == 0)
44+#define is_negative(a) (!(is_non_negative(a)))
3945
4046 #ifdef COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW
4147 /*
@@ -227,10 +233,10 @@ · 185 unmodified lines
227233 typeof(d) _d = d; \
228234 u64 _a_full = _a; \
229235 unsigned int _to_shift = \
230− _s >= 0 && _s < 8 * sizeof(*d) ? _s : 0; \
236+ is_non_negative(_s) && _s < 8 * sizeof(*d) ? _s : 0; \
231237 *_d = (_a_full << _to_shift); \
232− (_to_shift != _s || *_d < 0 || _a < 0 || \
233− (*_d >> _to_shift) != _a); \
238+ (_to_shift != _s || is_negative(*_d) || is_negative(_a) || \
239+ (*_d >> _to_shift) != _a); \
234240 })
235241
236242 /**
@@ -278,11 +284,15 @@ static inline __must_check size_t array3_size(size_t a, size_t b, size_t c) · 41 unmodified lines
278284 return bytes;
279285 }
280286
281−static inline __must_check size_t __ab_c_size(size_t n, size_t size, size_t c)
287+/*
288+ * Compute a*b+c, returning SIZE_MAX on overflow. Internal helper for
289+ * struct_size() below.
290+ */
291+static inline __must_check size_t __ab_c_size(size_t a, size_t b, size_t c)
282292 {
283293 size_t bytes;
284294
285− if (check_mul_overflow(n, size, &bytes))
295+ if (check_mul_overflow(a, b, &bytes))
286296 return SIZE_MAX;
287297 if (check_add_overflow(bytes, c, &bytes))
288298 return SIZE_MAX;
include/linux/packing.h+49−0
@@ -0,0 +1,49 @@
1+/* SPDX-License-Identifier: BSD-3-Clause
2+ * Copyright (c) 2016-2018, NXP Semiconductors
3+ * Copyright (c) 2018-2019, Vladimir Oltean <olteanv@gmail.com>
4+ */
5+#ifndef _LINUX_PACKING_H
6+#define _LINUX_PACKING_H
7+
8+#include <linux/types.h>
9+#include <linux/bitops.h>
10+
11+#define QUIRK_MSB_ON_THE_RIGHT BIT(0)
12+#define QUIRK_LITTLE_ENDIAN BIT(1)
13+#define QUIRK_LSW32_IS_FIRST BIT(2)
14+
15+enum packing_op {
16+ PACK,
17+ UNPACK,
18+};
19+
20+/**
21+ * packing - Convert numbers (currently u64) between a packed and an unpacked
22+ * format. Unpacked means laid out in memory in the CPU's native
23+ * understanding of integers, while packed means anything else that
24+ * requires translation.
25+ *
26+ * @pbuf: Pointer to a buffer holding the packed value.
27+ * @uval: Pointer to an u64 holding the unpacked value.
28+ * @startbit: The index (in logical notation, compensated for quirks) where
29+ * the packed value starts within pbuf. Must be larger than, or
30+ * equal to, endbit.
31+ * @endbit: The index (in logical notation, compensated for quirks) where
32+ * the packed value ends within pbuf. Must be smaller than, or equal
33+ * to, startbit.
34+ * @op: If PACK, then uval will be treated as const pointer and copied (packed)
35+ * into pbuf, between startbit and endbit.
36+ * If UNPACK, then pbuf will be treated as const pointer and the logical
37+ * value between startbit and endbit will be copied (unpacked) to uval.
38+ * @quirks: A bit mask of QUIRK_LITTLE_ENDIAN, QUIRK_LSW32_IS_FIRST and
39+ * QUIRK_MSB_ON_THE_RIGHT.
40+ *
41+ * Return: 0 on success, EINVAL or ERANGE if called incorrectly. Assuming
42+ * correct usage, return code may be discarded.
43+ * If op is PACK, pbuf is modified.
44+ * If op is UNPACK, uval is modified.
45+ */
46+int packing(void *pbuf, u64 *uval, int startbit, int endbit, size_t pbuflen,
47+ enum packing_op op, u8 quirks);
48+
49+#endif
include/linux/pagemap.h+14−12
@@ -333,6 +333,19 @@ static inline struct page *grab_cache_page_nowait(struct address_space *mapping, · 332 unmodified lines
333333 mapping_gfp_mask(mapping));
334334 }
335335
336+static inline struct page *find_subpage(struct page *page, pgoff_t offset)
337+{
338+ unsigned long mask;
339+
340+ if (PageHuge(page))
341+ return page;
342+
343+ VM_BUG_ON_PAGE(PageTail(page), page);
344+
345+ mask = (1UL << compound_order(page)) - 1;
346+ return page + (offset & mask);
347+}
348+
336349 struct page *find_get_entry(struct address_space *mapping, pgoff_t offset);
337350 struct page *find_lock_entry(struct address_space *mapping, pgoff_t offset);
338351 unsigned find_get_entries(struct address_space *mapping, pgoff_t start,
@@ -360,9 +373,6 @@ static inline unsigned find_get_pages_tag(struct address_space *mapping, · 21 unmodified lines
360373 return find_get_pages_range_tag(mapping, index, (pgoff_t)-1, tag,
361374 nr_pages, pages);
362375 }
363−unsigned find_get_entries_tag(struct address_space *mapping, pgoff_t start,
364− xa_mark_t tag, unsigned int nr_entries,
365− struct page **entries, pgoff_t *indices);
366376
367377 struct page *grab_cache_page_write_begin(struct address_space *mapping,
368378 pgoff_t index, unsigned flags);
@@ -527,15 +537,7 @@ static inline int wait_on_page_locked_killable(struct page *page) · 158 unmodified lines
527537
528538 extern void put_and_wait_on_page_locked(struct page *page);
529539
530−/*
531− * Wait for a page to complete writeback
532− */
533−static inline void wait_on_page_writeback(struct page *page)
534−{
535− if (PageWriteback(page))
536− wait_on_page_bit(page, PG_writeback);
537−}
538−
540+void wait_on_page_writeback(struct page *page);
539541 extern void end_page_writeback(struct page *page);
540542 void wait_for_stable_page(struct page *page);
541543
include/linux/pci-ecam.h+1−0
@@ -56,6 +56,7 @@ extern struct pci_ecam_ops thunder_pem_ecam_ops; /* Cavium ThunderX 1.x & 2.x */ · 55 unmodified lines
5656 extern struct pci_ecam_ops pci_thunder_ecam_ops; /* Cavium ThunderX 1.x */
5757 extern struct pci_ecam_ops xgene_v1_pcie_ecam_ops; /* APM X-Gene PCIe v1 */
5858 extern struct pci_ecam_ops xgene_v2_pcie_ecam_ops; /* APM X-Gene PCIe v2.x */
59+extern struct pci_ecam_ops al_pcie_ops; /* Amazon Annapurna Labs PCIe */
5960 #endif
6061
6162 #ifdef CONFIG_PCI_HOST_COMMON
include/linux/pci-epc.h+2−0
@@ -109,6 +109,7 @@ struct pci_epc { · 108 unmodified lines
109109 * @reserved_bar: bitmap to indicate reserved BAR unavailable to function driver
110110 * @bar_fixed_64bit: bitmap to indicate fixed 64bit BARs
111111 * @bar_fixed_size: Array specifying the size supported by each BAR
112+ * @align: alignment size required for BAR buffer allocation
112113 */
113114 struct pci_epc_features {
114115 unsigned int linkup_notifier : 1;
@@ -117,6 +118,7 @@ struct pci_epc_features { · 2 unmodified lines
117118 u8 reserved_bar;
118119 u8 bar_fixed_64bit;
119120 u64 bar_fixed_size[BAR_5 + 1];
121+ size_t align;
120122 };
121123
122124 #define to_pci_epc(device) container_of((device), struct pci_epc, dev)
include/linux/pci-epf.h+2−1
@@ -149,7 +149,8 @@ void pci_epf_destroy(struct pci_epf *epf); · 148 unmodified lines
149149 int __pci_epf_register_driver(struct pci_epf_driver *driver,
150150 struct module *owner);
151151 void pci_epf_unregister_driver(struct pci_epf_driver *driver);
152−void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar);
152+void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar,
153+ size_t align);
153154 void pci_epf_free_space(struct pci_epf *epf, void *addr, enum pci_barno bar);
154155 int pci_epf_bind(struct pci_epf *epf);
155156 void pci_epf_unbind(struct pci_epf *epf);
include/linux/pci.h+27−16
@@ -348,6 +348,8 @@ struct pci_dev { · 347 unmodified lines
348348 unsigned int hotplug_user_indicators:1; /* SlotCtl indicators
349349 controlled exclusively by
350350 user sysfs */
351+ unsigned int clear_retrain_link:1; /* Need to clear Retrain Link
352+ bit manually */
351353 unsigned int d3_delay; /* D3->D0 transition time in ms */
352354 unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */
353355
@@ -490,6 +492,7 @@ struct pci_host_bridge { · 136 unmodified lines
490492 void *sysdata;
491493 int busnr;
492494 struct list_head windows; /* resource_entry */
495+ struct list_head dma_ranges; /* dma ranges resource list */
493496 u8 (*swizzle_irq)(struct pci_dev *, u8 *); /* Platform IRQ swizzler */
494497 int (*map_irq)(const struct pci_dev *, u8, u8);
495498 void (*release_fn)(struct pci_host_bridge *);
@@ -596,6 +599,11 @@ struct pci_bus { · 100 unmodified lines
596599
597600 #define to_pci_bus(n) container_of(n, struct pci_bus, dev)
598601
602+static inline u16 pci_dev_id(struct pci_dev *dev)
603+{
604+ return PCI_DEVID(dev->bus->number, dev->devfn);
605+}
606+
599607 /*
600608 * Returns true if the PCI bus is root (behind host-PCI bridge),
601609 * false otherwise
@@ -1233,7 +1241,6 @@ int __must_check pci_request_regions(struct pci_dev *, const char *); · 631 unmodified lines
12331241 int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *);
12341242 void pci_release_regions(struct pci_dev *);
12351243 int __must_check pci_request_region(struct pci_dev *, int, const char *);
1236−int __must_check pci_request_region_exclusive(struct pci_dev *, int, const char *);
12371244 void pci_release_region(struct pci_dev *, int);
12381245 int pci_request_selected_regions(struct pci_dev *, int, const char *);
12391246 int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *);
@@ -1521,21 +1528,6 @@ static inline void pcie_ecrc_get_policy(char *str) { } · 281 unmodified lines
15211528
15221529 bool pci_ats_disabled(void);
15231530
1524−#ifdef CONFIG_PCI_ATS
1525−/* Address Translation Service */
1526−void pci_ats_init(struct pci_dev *dev);
1527−int pci_enable_ats(struct pci_dev *dev, int ps);
1528−void pci_disable_ats(struct pci_dev *dev);
1529−int pci_ats_queue_depth(struct pci_dev *dev);
1530−int pci_ats_page_aligned(struct pci_dev *dev);
1531−#else
1532−static inline void pci_ats_init(struct pci_dev *d) { }
1533−static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }
1534−static inline void pci_disable_ats(struct pci_dev *d) { }
1535−static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; }
1536−static inline int pci_ats_page_aligned(struct pci_dev *dev) { return 0; }
1537−#endif
1538−
15391531 #ifdef CONFIG_PCIE_PTM
15401532 int pci_enable_ptm(struct pci_dev *dev, u8 *granularity);
15411533 #else
@@ -1728,8 +1720,24 @@ static inline int pci_irqd_intx_xlate(struct irq_domain *d, · 186 unmodified lines
17281720 static inline const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
17291721 struct pci_dev *dev)
17301722 { return NULL; }
1723+static inline bool pci_ats_disabled(void) { return true; }
17311724 #endif /* CONFIG_PCI */
17321725
1726+#ifdef CONFIG_PCI_ATS
1727+/* Address Translation Service */
1728+void pci_ats_init(struct pci_dev *dev);
1729+int pci_enable_ats(struct pci_dev *dev, int ps);
1730+void pci_disable_ats(struct pci_dev *dev);
1731+int pci_ats_queue_depth(struct pci_dev *dev);
1732+int pci_ats_page_aligned(struct pci_dev *dev);
1733+#else
1734+static inline void pci_ats_init(struct pci_dev *d) { }
1735+static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }
1736+static inline void pci_disable_ats(struct pci_dev *d) { }
1737+static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; }
1738+static inline int pci_ats_page_aligned(struct pci_dev *dev) { return 0; }
1739+#endif
1740+
17331741 /* Include architecture-dependent settings and functions */
17341742
17351743 #include <asm/pci.h>
@@ -2363,4 +2371,7 @@ void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type); · 627 unmodified lines
23632371 #define pci_info(pdev, fmt, arg...) dev_info(&(pdev)->dev, fmt, ##arg)
23642372 #define pci_dbg(pdev, fmt, arg...) dev_dbg(&(pdev)->dev, fmt, ##arg)
23652373
2374+#define pci_notice_ratelimited(pdev, fmt, arg...) \
2375+ dev_notice_ratelimited(&(pdev)->dev, fmt, ##arg)
2376+
23662377 #endif /* LINUX_PCI_H */
include/linux/pci_hotplug.h+56−10
@@ -124,26 +124,72 @@ struct hpp_type2 { · 123 unmodified lines
124124 u32 sec_unc_err_mask_or;
125125 };
126126
127−struct hotplug_params {
128− struct hpp_type0 *t0; /* Type0: NULL if not available */
129− struct hpp_type1 *t1; /* Type1: NULL if not available */
130− struct hpp_type2 *t2; /* Type2: NULL if not available */
131− struct hpp_type0 type0_data;
132− struct hpp_type1 type1_data;
133− struct hpp_type2 type2_data;
127+/*
128+ * _HPX PCI Express Setting Record (Type 3)
129+ */
130+struct hpx_type3 {
131+ u16 device_type;
132+ u16 function_type;
133+ u16 config_space_location;
134+ u16 pci_exp_cap_id;
135+ u16 pci_exp_cap_ver;
136+ u16 pci_exp_vendor_id;
137+ u16 dvsec_id;
138+ u16 dvsec_rev;
139+ u16 match_offset;
140+ u32 match_mask_and;
141+ u32 match_value;
142+ u16 reg_offset;
143+ u32 reg_mask_and;
144+ u32 reg_mask_or;
145+};
146+
147+struct hotplug_program_ops {
148+ void (*program_type0)(struct pci_dev *dev, struct hpp_type0 *hpp);
149+ void (*program_type1)(struct pci_dev *dev, struct hpp_type1 *hpp);
150+ void (*program_type2)(struct pci_dev *dev, struct hpp_type2 *hpp);
151+ void (*program_type3)(struct pci_dev *dev, struct hpx_type3 *hpp);
152+};
153+
154+enum hpx_type3_dev_type {
155+ HPX_TYPE_ENDPOINT = BIT(0),
156+ HPX_TYPE_LEG_END = BIT(1),
157+ HPX_TYPE_RC_END = BIT(2),
158+ HPX_TYPE_RC_EC = BIT(3),
159+ HPX_TYPE_ROOT_PORT = BIT(4),
160+ HPX_TYPE_UPSTREAM = BIT(5),
161+ HPX_TYPE_DOWNSTREAM = BIT(6),
162+ HPX_TYPE_PCI_BRIDGE = BIT(7),
163+ HPX_TYPE_PCIE_BRIDGE = BIT(8),
164+};
165+
166+enum hpx_type3_fn_type {
167+ HPX_FN_NORMAL = BIT(0),
168+ HPX_FN_SRIOV_PHYS = BIT(1),
169+ HPX_FN_SRIOV_VIRT = BIT(2),
170+};
171+
172+enum hpx_type3_cfg_loc {
173+ HPX_CFG_PCICFG = 0,
174+ HPX_CFG_PCIE_CAP = 1,
175+ HPX_CFG_PCIE_CAP_EXT = 2,
176+ HPX_CFG_VEND_CAP = 3,
177+ HPX_CFG_DVSEC = 4,
178+ HPX_CFG_MAX,
134179 };
135180
136181 #ifdef CONFIG_ACPI
137182 #include <linux/acpi.h>
138−int pci_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp);
183+int pci_acpi_program_hp_params(struct pci_dev *dev,
184+ const struct hotplug_program_ops *hp_ops);
139185 bool pciehp_is_native(struct pci_dev *bridge);
140186 int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge);
141187 bool shpchp_is_native(struct pci_dev *bridge);
142188 int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle);
143189 int acpi_pci_detect_ejectable(acpi_handle handle);
144190 #else
145−static inline int pci_get_hp_params(struct pci_dev *dev,
146− struct hotplug_params *hpp)
191+static inline int pci_acpi_program_hp_params(struct pci_dev *dev,
192+ const struct hotplug_program_ops *hp_ops)
147193 {
148194 return -ENODEV;
149195 }
include/linux/percpu.h+3−9
@@ -26,16 +26,10 @@ · 25 unmodified lines
2626 #define PCPU_MIN_ALLOC_SHIFT 2
2727 #define PCPU_MIN_ALLOC_SIZE (1 << PCPU_MIN_ALLOC_SHIFT)
2828
29−/* number of bits per page, used to trigger a scan if blocks are > PAGE_SIZE */
30−#define PCPU_BITS_PER_PAGE (PAGE_SIZE >> PCPU_MIN_ALLOC_SHIFT)
31−
3229 /*
33− * This determines the size of each metadata block. There are several subtle
34− * constraints around this constant. The reserved region must be a multiple of
35− * PCPU_BITMAP_BLOCK_SIZE. Additionally, PCPU_BITMAP_BLOCK_SIZE must be a
36− * multiple of PAGE_SIZE or PAGE_SIZE must be a multiple of
37− * PCPU_BITMAP_BLOCK_SIZE to align with the populated page map. The unit_size
38− * also has to be a multiple of PCPU_BITMAP_BLOCK_SIZE to ensure full blocks.
30+ * The PCPU_BITMAP_BLOCK_SIZE must be the same size as PAGE_SIZE as the
31+ * updating of hints is used to manage the nr_empty_pop_pages in both
32+ * the chunk and globally.
3933 */
4034 #define PCPU_BITMAP_BLOCK_SIZE PAGE_SIZE
4135 #define PCPU_BITMAP_BLOCK_BITS (PCPU_BITMAP_BLOCK_SIZE >> \
include/linux/perf_event.h+15−6
@@ -30,6 +30,7 @@ struct perf_guest_info_callbacks { · 29 unmodified lines
3030 int (*is_in_guest)(void);
3131 int (*is_user_mode)(void);
3232 unsigned long (*get_guest_ip)(void);
33+ void (*handle_intel_pt_intr)(void);
3334 };
3435
3536 #ifdef CONFIG_HAVE_HW_BREAKPOINT
@@ -240,7 +241,6 @@ struct perf_event; · 204 unmodified lines
240241 #define PERF_PMU_CAP_NO_INTERRUPT 0x01
241242 #define PERF_PMU_CAP_NO_NMI 0x02
242243 #define PERF_PMU_CAP_AUX_NO_SG 0x04
243−#define PERF_PMU_CAP_AUX_SW_DOUBLEBUF 0x08
244244 #define PERF_PMU_CAP_EXCLUSIVE 0x10
245245 #define PERF_PMU_CAP_ITRACE 0x20
246246 #define PERF_PMU_CAP_HETEROGENEOUS_CPUS 0x40
@@ -464,7 +464,7 @@ enum perf_addr_filter_action_t { · 217 unmodified lines
464464 /**
465465 * struct perf_addr_filter - address range filter definition
466466 * @entry: event's filter list linkage
467− * @inode: object file's inode for file-based filters
467+ * @path: object file's path for file-based filters
468468 * @offset: filter range offset
469469 * @size: filter range size (size==0 means single address trigger)
470470 * @action: filter/start/stop
@@ -888,6 +888,9 @@ extern void perf_sched_cb_dec(struct pmu *pmu); · 417 unmodified lines
888888 extern void perf_sched_cb_inc(struct pmu *pmu);
889889 extern int perf_event_task_disable(void);
890890 extern int perf_event_task_enable(void);
891+
892+extern void perf_pmu_resched(struct pmu *pmu);
893+
891894 extern int perf_event_refresh(struct perf_event *event, int refresh);
892895 extern void perf_event_update_userpage(struct perf_event *event);
893896 extern int perf_event_release_kernel(struct perf_event *event);
@@ -1055,12 +1058,18 @@ static inline void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned lo · 161 unmodified lines
10551058 #endif
10561059
10571060 /*
1058− * Take a snapshot of the regs. Skip ip and frame pointer to
1059− * the nth caller. We only need a few of the regs:
1061+ * When generating a perf sample in-line, instead of from an interrupt /
1062+ * exception, we lack a pt_regs. This is typically used from software events
1063+ * like: SW_CONTEXT_SWITCHES, SW_MIGRATIONS and the tie-in with tracepoints.
1064+ *
1065+ * We typically don't need a full set, but (for x86) do require:
10601066 * - ip for PERF_SAMPLE_IP
10611067 * - cs for user_mode() tests
1062− * - bp for callchains
1063− * - eflags, for future purposes, just in case
1068+ * - sp for PERF_SAMPLE_CALLCHAIN
1069+ * - eflags for MISC bits and CALLCHAIN (see: perf_hw_regs())
1070+ *
1071+ * NOTE: assumes @regs is otherwise already 0 filled; this is important for
1072+ * things like PERF_SAMPLE_REGS_INTR.
10641073 */
10651074 static inline void perf_fetch_caller_regs(struct pt_regs *regs)
10661075 {
include/linux/phy.h+6−8
@@ -308,13 +308,7 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr); · 307 unmodified lines
308308 *
309309 * HALTED: PHY is up, but no polling or interrupts are done. Or
310310 * PHY is in an error state.
311− *
312− * - phy_start moves to RESUMING
313− *
314− * RESUMING: PHY was halted, but now wants to run again.
315− * - If we are forcing, or aneg is done, timer moves to RUNNING
316− * - If aneg is not done, timer moves to AN
317− * - phy_stop moves to HALTED
311+ * - phy_start moves to UP
318312 */
319313 enum phy_state {
320314 PHY_DOWN = 0,
@@ -324,7 +318,6 @@ enum phy_state { · 3 unmodified lines
324318 PHY_RUNNING,
325319 PHY_NOLINK,
326320 PHY_FORCING,
327− PHY_RESUMING
328321 };
329322
330323 /**
@@ -345,6 +338,7 @@ struct phy_c45_device_ids { · 14 unmodified lines
345338 * is_c45: Set to true if this phy uses clause 45 addressing.
346339 * is_internal: Set to true if this phy is internal to a MAC.
347340 * is_pseudo_fixed_link: Set to true if this phy is an Ethernet switch, etc.
341+ * is_gigabit_capable: Set to true if PHY supports 1000Mbps
348342 * has_fixups: Set to true if this phy has fixups/quirks.
349343 * suspended: Set to true if this phy has been suspended successfully.
350344 * sysfs_links: Internal boolean tracking sysfs symbolic links setup/removal.
@@ -382,6 +376,7 @@ struct phy_device { · 31 unmodified lines
382376 unsigned is_c45:1;
383377 unsigned is_internal:1;
384378 unsigned is_pseudo_fixed_link:1;
379+ unsigned is_gigabit_capable:1;
385380 unsigned has_fixups:1;
386381 unsigned suspended:1;
387382 unsigned sysfs_links:1;
@@ -390,6 +385,7 @@ struct phy_device { · 2 unmodified lines
390385 unsigned autoneg:1;
391386 /* The most recently read link state */
392387 unsigned link:1;
388+ unsigned autoneg_complete:1;
393389
394390 /* Interrupts are enabled */
395391 unsigned interrupts:1;
@@ -1075,6 +1071,7 @@ void phy_attached_info(struct phy_device *phydev); · 679 unmodified lines
10751071
10761072 /* Clause 22 PHY */
10771073 int genphy_config_init(struct phy_device *phydev);
1074+int genphy_read_abilities(struct phy_device *phydev);
10781075 int genphy_setup_forced(struct phy_device *phydev);
10791076 int genphy_restart_aneg(struct phy_device *phydev);
10801077 int genphy_config_eee_advert(struct phy_device *phydev);
@@ -1150,6 +1147,7 @@ void phy_request_interrupt(struct phy_device *phydev); · 69 unmodified lines
11501147 void phy_print_status(struct phy_device *phydev);
11511148 int phy_set_max_speed(struct phy_device *phydev, u32 max_speed);
11521149 void phy_remove_link_mode(struct phy_device *phydev, u32 link_mode);
1150+void phy_advertise_supported(struct phy_device *phydev);
11531151 void phy_support_sym_pause(struct phy_device *phydev);
11541152 void phy_support_asym_pause(struct phy_device *phydev);
11551153 void phy_set_sym_pause(struct phy_device *phydev, bool rx, bool tx,
include/linux/phy/phy.h+2−0
@@ -64,6 +64,7 @@ union phy_configure_opts { · 63 unmodified lines
6464 * @set_mode: set the mode of the phy
6565 * @reset: resetting the phy
6666 * @calibrate: calibrate the phy
67+ * @release: ops to be performed while the consumer relinquishes the PHY
6768 * @owner: the module owner containing the ops
6869 */
6970 struct phy_ops {
@@ -105,6 +106,7 @@ struct phy_ops { · 35 unmodified lines
105106 union phy_configure_opts *opts);
106107 int (*reset)(struct phy *phy);
107108 int (*calibrate)(struct phy *phy);
109+ void (*release)(struct phy *phy);
108110 struct module *owner;
109111 };
110112
include/linux/pid.h+2−0
@@ -66,6 +66,8 @@ struct pid · 65 unmodified lines
6666
6767 extern struct pid init_struct_pid;
6868
69+extern const struct file_operations pidfd_fops;
70+
6971 static inline struct pid *get_pid(struct pid *pid)
7072 {
7173 if (pid)
include/linux/pipe_fs_i.h+1−0
@@ -176,6 +176,7 @@ void free_pipe_info(struct pipe_inode_info *); · 175 unmodified lines
176176 bool generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
177177 int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
178178 int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
179+int generic_pipe_buf_nosteal(struct pipe_inode_info *, struct pipe_buffer *);
179180 void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
180181 void pipe_buf_mark_unmergeable(struct pipe_buffer *buf);
181182
include/linux/platform_data/ads7828.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Copyright (c) 2012 Savoir-faire Linux Inc.
55 * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
66 *
7− * For further information, see the Documentation/hwmon/ads7828 file.
7+ * For further information, see the Documentation/hwmon/ads7828.rst file.
88 *
99 * This program is free software; you can redistribute it and/or modify
1010 * it under the terms of the GNU General Public License version 2 as
include/linux/platform_data/ds620.h+1−1
@@ -14,7 +14,7 @@ struct ds620_platform_data { · 13 unmodified lines
1414 * 1 = PO_LOW
1515 * 2 = PO_HIGH
1616 *
17− * (see Documentation/hwmon/ds620)
17+ * (see Documentation/hwmon/ds620.rst)
1818 */
1919 int pomode;
2020 };
include/linux/platform_data/elm.h+1−1
@@ -60,6 +60,6 @@ static inline int elm_config(struct device *dev, enum bch_ecc bch_type, · 59 unmodified lines
6060 {
6161 return -ENOSYS;
6262 }
63−#endif /* CONFIG_MTD_NAND_ECC_BCH */
63+#endif /* CONFIG_MTD_NAND_OMAP_BCH */
6464
6565 #endif /* __ELM_H */
include/linux/platform_data/eth-ep93xx.h+10−0
@@ -0,0 +1,10 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _LINUX_PLATFORM_DATA_ETH_EP93XX
3+#define _LINUX_PLATFORM_DATA_ETH_EP93XX
4+
5+struct ep93xx_eth_data {
6+ unsigned char dev_addr[6];
7+ unsigned char phy_id;
8+};
9+
10+#endif
include/linux/platform_data/gpio-omap.h+0−2
@@ -200,8 +200,6 @@ struct omap_gpio_platform_data { · 199 unmodified lines
200200 bool is_mpuio; /* whether the bank is of type MPUIO */
201201 u32 non_wakeup_gpios;
202202
203− u32 quirks; /* Version specific quirks mask */
204−
205203 struct omap_gpio_reg_offs *regs;
206204
207205 /* Return context loss count due to PM states changing */
include/linux/platform_data/ina2xx.h+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 * it under the terms of the GNU General Public License version 2 as
88 * published by the Free Software Foundation.
99 *
10− * For further information, see the Documentation/hwmon/ina2xx file.
10+ * For further information, see the Documentation/hwmon/ina2xx.rst file.
1111 */
1212
1313 /**
include/linux/platform_data/keypad-ep93xx.h+2−2
@@ -9,8 +9,7 @@ struct matrix_keymap_data; · 8 unmodified lines
99 #define EP93XX_KEYPAD_DIAG_MODE (1<<1) /* diagnostic mode */
1010 #define EP93XX_KEYPAD_BACK_DRIVE (1<<2) /* back driving mode */
1111 #define EP93XX_KEYPAD_TEST_MODE (1<<3) /* scan only column 0 */
12−#define EP93XX_KEYPAD_KDIV (1<<4) /* 1/4 clock or 1/16 clock */
13−#define EP93XX_KEYPAD_AUTOREPEAT (1<<5) /* enable key autorepeat */
12+#define EP93XX_KEYPAD_AUTOREPEAT (1<<4) /* enable key autorepeat */
1413
1514 /**
1615 * struct ep93xx_keypad_platform_data - platform specific device structure
@@ -24,6 +23,7 @@ struct ep93xx_keypad_platform_data { · 7 unmodified lines
2423 unsigned int debounce;
2524 unsigned int prescale;
2625 unsigned int flags;
26+ unsigned int clk_rate;
2727 };
2828
2929 #define EP93XX_MATRIX_ROWS (8)
include/linux/platform_data/lm3630a_bl.h+4−0
@@ -38,9 +38,11 @@ enum lm3630a_ledb_ctrl { · 37 unmodified lines
3838
3939 #define LM3630A_MAX_BRIGHTNESS 255
4040 /*
41+ *@leda_label : optional led a label.
4142 *@leda_init_brt : led a init brightness. 4~255
4243 *@leda_max_brt : led a max brightness. 4~255
4344 *@leda_ctrl : led a disable, enable linear, enable exponential
45+ *@ledb_label : optional led b label.
4446 *@ledb_init_brt : led b init brightness. 4~255
4547 *@ledb_max_brt : led b max brightness. 4~255
4648 *@ledb_ctrl : led b disable, enable linear, enable exponential
@@ -50,10 +52,12 @@ enum lm3630a_ledb_ctrl { · 3 unmodified lines
5052 struct lm3630a_platform_data {
5153
5254 /* led a config. */
55+ const char *leda_label;
5356 int leda_init_brt;
5457 int leda_max_brt;
5558 enum lm3630a_leda_ctrl leda_ctrl;
5659 /* led b config. */
60+ const char *ledb_label;
5761 int ledb_init_brt;
5862 int ledb_max_brt;
5963 enum lm3630a_ledb_ctrl ledb_ctrl;
include/linux/platform_data/macb.h+0−9
@@ -12,19 +12,10 @@ · 11 unmodified lines
1212
1313 /**
1414 * struct macb_platform_data - platform data for MACB Ethernet
15− * @phy_mask: phy mask passed when register the MDIO bus
16− * within the driver
17− * @phy_irq_pin: PHY IRQ
18− * @is_rmii: using RMII interface?
19− * @rev_eth_addr: reverse Ethernet address byte order
2015 * @pclk: platform clock
2116 * @hclk: AHB clock
2217 */
2318 struct macb_platform_data {
24− u32 phy_mask;
25− int phy_irq_pin;
26− u8 is_rmii;
27− u8 rev_eth_addr;
2819 struct clk *pclk;
2920 struct clk *hclk;
3021 };
include/linux/platform_data/max197.h+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 * it under the terms of the GNU General Public License version 2 as
99 * published by the Free Software Foundation.
1010 *
11− * For further information, see the Documentation/hwmon/max197 file.
11+ * For further information, see the Documentation/hwmon/max197.rst file.
1212 */
1313
1414 #ifndef _PDATA_MAX197_H
include/linux/platform_data/mv88e6xxx.h+1−0
@@ -13,6 +13,7 @@ struct dsa_mv88e6xxx_pdata { · 12 unmodified lines
1313 unsigned int enabled_ports;
1414 struct net_device *netdev;
1515 u32 eeprom_len;
16+ int irq;
1617 };
1718
1819 #endif
include/linux/platform_data/ntc_thermistor.h+1−1
@@ -42,7 +42,7 @@ struct ntc_thermistor_platform_data { · 41 unmodified lines
4242 * read_uV()
4343 *
4444 * How to setup pullup_ohm, pulldown_ohm, and connect is
45− * described at Documentation/hwmon/ntc_thermistor
45+ * described at Documentation/hwmon/ntc_thermistor.rst
4646 *
4747 * pullup/down_ohm: 0 for infinite / not-connected
4848 *
include/linux/platform_data/pca954x.h+0−48
@@ -1,48 +0,0 @@
1−/*
2− *
3− * pca954x.h - I2C multiplexer/switch support
4− *
5− * Copyright (c) 2008-2009 Rodolfo Giometti <giometti@linux.it>
6− * Copyright (c) 2008-2009 Eurotech S.p.A. <info@eurotech.it>
7− * Michael Lawnick <michael.lawnick.ext@nsn.com>
8− *
9− * This program is free software; you can redistribute it and/or modify
10− * it under the terms of the GNU General Public License as published by
11− * the Free Software Foundation; either version 2 of the License, or
12− * (at your option) any later version.
13− *
14− * This program is distributed in the hope that it will be useful,
15− * but WITHOUT ANY WARRANTY; without even the implied warranty of
16− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17− * GNU General Public License for more details.
18− *
19− * You should have received a copy of the GNU General Public License
20− * along with this program; if not, write to the Free Software
21− * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22− */
23−
24−
25−#ifndef _LINUX_I2C_PCA954X_H
26−#define _LINUX_I2C_PCA954X_H
27−
28−/* Platform data for the PCA954x I2C multiplexers */
29−
30−/* Per channel initialisation data:
31− * @adap_id: bus number for the adapter. 0 = don't care
32− * @deselect_on_exit: set this entry to 1, if your H/W needs deselection
33− * of this channel after transaction.
34− *
35− */
36−struct pca954x_platform_mode {
37− int adap_id;
38− unsigned int deselect_on_exit:1;
39− unsigned int class;
40−};
41−
42−/* Per mux/switch data, used with i2c_register_board_info */
43−struct pca954x_platform_data {
44− struct pca954x_platform_mode *modes;
45− int num_modes;
46−};
47−
48−#endif /* _LINUX_I2C_PCA954X_H */
include/linux/platform_data/pm33xx.h+5−0
@@ -51,6 +51,11 @@ struct am33xx_pm_platform_data { · 50 unmodified lines
5151 unsigned long args);
5252 struct am33xx_pm_sram_addr *(*get_sram_addrs)(void);
5353 void __iomem *(*get_rtc_base_addr)(void);
54+ void (*save_context)(void);
55+ void (*restore_context)(void);
56+ void (*prepare_rtc_suspend)(void);
57+ void (*prepare_rtc_resume)(void);
58+ int (*check_off_mode_enable)(void);
5459 };
5560
5661 struct am33xx_pm_sram_data {
include/linux/platform_data/spi-ep93xx.h+0−4
@@ -6,13 +6,9 @@ struct spi_device; · 5 unmodified lines
66
77 /**
88 * struct ep93xx_spi_info - EP93xx specific SPI descriptor
9− * @chipselect: array of gpio numbers to use as chip selects
10− * @num_chipselect: ARRAY_SIZE(chipselect)
119 * @use_dma: use DMA for the transfers
1210 */
1311 struct ep93xx_spi_info {
14− int *chipselect;
15− int num_chipselect;
1612 bool use_dma;
1713 };
1814
include/linux/platform_data/ti-sysc.h+7−2
@@ -46,8 +46,13 @@ struct sysc_regbits { · 45 unmodified lines
4646 s8 emufree_shift;
4747 };
4848
49−#define SYSC_QUIRK_LEGACY_IDLE BIT(8)
50−#define SYSC_QUIRK_RESET_STATUS BIT(7)
49+#define SYSC_QUIRK_SWSUP_MSTANDBY BIT(13)
50+#define SYSC_QUIRK_SWSUP_SIDLE_ACT BIT(12)
51+#define SYSC_QUIRK_SWSUP_SIDLE BIT(11)
52+#define SYSC_QUIRK_EXT_OPT_CLOCK BIT(10)
53+#define SYSC_QUIRK_LEGACY_IDLE BIT(9)
54+#define SYSC_QUIRK_RESET_STATUS BIT(8)
55+#define SYSC_QUIRK_NO_IDLE BIT(7)
5156 #define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6)
5257 #define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5)
5358 #define SYSC_QUIRK_OPT_CLKS_NEEDED BIT(4)
include/linux/platform_data/timer-ixp4xx.h+11−0
@@ -0,0 +1,11 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __TIMER_IXP4XX_H
3+#define __TIMER_IXP4XX_H
4+
5+#include <linux/ioport.h>
6+
7+void __init ixp4xx_timer_setup(resource_size_t timerbase,
8+ int timer_irq,
9+ unsigned int timer_freq);
10+
11+#endif
include/linux/platform_data/wilco-ec.h+2−20
@@ -14,10 +14,6 @@ · 13 unmodified lines
1414 /* Message flags for using the mailbox() interface */
1515 #define WILCO_EC_FLAG_NO_RESPONSE BIT(0) /* EC does not respond */
1616 #define WILCO_EC_FLAG_EXTENDED_DATA BIT(1) /* EC returns 256 data bytes */
17−#define WILCO_EC_FLAG_RAW_REQUEST BIT(2) /* Do not trim request data */
18−#define WILCO_EC_FLAG_RAW_RESPONSE BIT(3) /* Do not trim response data */
19−#define WILCO_EC_FLAG_RAW (WILCO_EC_FLAG_RAW_REQUEST | \
20− WILCO_EC_FLAG_RAW_RESPONSE)
2117
2218 /* Normal commands have a maximum 32 bytes of data */
2319 #define EC_MAILBOX_DATA_SIZE 32
@@ -56,10 +52,7 @@ struct wilco_ec_device { · 32 unmodified lines
5652 * @mailbox_id: Mailbox identifier, specifies the command set.
5753 * @mailbox_version: Mailbox interface version %EC_MAILBOX_VERSION
5854 * @reserved: Set to zero.
59− * @data_size: Length of request, data + last 2 bytes of the header.
60− * @command: Mailbox command code, unique for each mailbox_id set.
61− * @reserved_raw: Set to zero for most commands, but is used by
62− * some command types and for raw commands.
55+ * @data_size: Length of following data.
6356 */
6457 struct wilco_ec_request {
6558 u8 struct_version;
@@ -68,8 +61,6 @@ struct wilco_ec_request { · 2 unmodified lines
6861 u8 mailbox_version;
6962 u8 reserved;
7063 u16 data_size;
71− u8 command;
72− u8 reserved_raw;
7364 } __packed;
7465
7566 /**
@@ -79,8 +70,6 @@ struct wilco_ec_request { · 3 unmodified lines
7970 * @result: Result code from the EC. Non-zero indicates an error.
8071 * @data_size: Length of the response data buffer.
8172 * @reserved: Set to zero.
82− * @mbox0: EC returned data at offset 0 is unused (always 0) so this byte
83− * is treated as part of the header instead of the data.
8473 * @data: Response data buffer. Max size is %EC_MAILBOX_DATA_SIZE_EXTENDED.
8574 */
8675 struct wilco_ec_response {
@@ -89,7 +78,6 @@ struct wilco_ec_response { · 2 unmodified lines
8978 u16 result;
9079 u16 data_size;
9180 u8 reserved[2];
92− u8 mbox0;
9381 u8 data[0];
9482 } __packed;
9583
@@ -111,21 +99,15 @@ enum wilco_ec_msg_type { · 15 unmodified lines
11199 * struct wilco_ec_message - Request and response message.
112100 * @type: Mailbox message type.
113101 * @flags: Message flags, e.g. %WILCO_EC_FLAG_NO_RESPONSE.
114− * @command: Mailbox command code.
115− * @result: Result code from the EC. Non-zero indicates an error.
116102 * @request_size: Number of bytes to send to the EC.
117103 * @request_data: Buffer containing the request data.
118− * @response_size: Number of bytes expected from the EC.
119− * This is 32 by default and 256 if the flag
120− * is set for %WILCO_EC_FLAG_EXTENDED_DATA
104+ * @response_size: Number of bytes to read from EC.
121105 * @response_data: Buffer containing the response data, should be
122106 * response_size bytes and allocated by caller.
123107 */
124108 struct wilco_ec_message {
125109 enum wilco_ec_msg_type type;
126110 u8 flags;
127− u8 command;
128− u8 result;
129111 size_t request_size;
130112 void *request_data;
131113 size_t response_size;
include/linux/platform_data/x86/asus-wmi.h+1−0
@@ -67,6 +67,7 @@ · 66 unmodified lines
6767 /* Input */
6868 #define ASUS_WMI_DEVID_TOUCHPAD 0x00100011
6969 #define ASUS_WMI_DEVID_TOUCHPAD_LED 0x00100012
70+#define ASUS_WMI_DEVID_FNLOCK 0x00100023
7071
7172 /* Fan, Thermal */
7273 #define ASUS_WMI_DEVID_THERMAL_CTRL 0x00110011
include/linux/platform_data/xilinx-ll-temac.h+32−0
@@ -0,0 +1,32 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __LINUX_XILINX_LL_TEMAC_H
3+#define __LINUX_XILINX_LL_TEMAC_H
4+
5+#include <linux/if_ether.h>
6+#include <linux/phy.h>
7+
8+struct ll_temac_platform_data {
9+ bool txcsum; /* Enable/disable TX checksum */
10+ bool rxcsum; /* Enable/disable RX checksum */
11+ u8 mac_addr[ETH_ALEN]; /* MAC address (6 bytes) */
12+ /* Clock frequency for input to MDIO clock generator */
13+ u32 mdio_clk_freq;
14+ unsigned long long mdio_bus_id; /* Unique id for MDIO bus */
15+ int phy_addr; /* Address of the PHY to connect to */
16+ phy_interface_t phy_interface; /* PHY interface mode */
17+ bool reg_little_endian; /* Little endian TEMAC register access */
18+ bool dma_little_endian; /* Little endian DMA register access */
19+ /* Pre-initialized mutex to use for synchronizing indirect
20+ * register access. When using both interfaces of a single
21+ * TEMAC IP block, the same mutex should be passed here, as
22+ * they share the same DCR bus bridge.
23+ */
24+ struct mutex *indirect_mutex;
25+ /* DMA channel control setup */
26+ u8 tx_irq_timeout; /* TX Interrupt Delay Time-out */
27+ u8 tx_irq_count; /* TX Interrupt Coalescing Threshold Count */
28+ u8 rx_irq_timeout; /* RX Interrupt Delay Time-out */
29+ u8 rx_irq_count; /* RX Interrupt Coalescing Threshold Count */
30+};
31+
32+#endif /* __LINUX_XILINX_LL_TEMAC_H */
include/linux/platform_data/xtalk-bridge.h+22−0
@@ -0,0 +1,22 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * SGI PCI Xtalk Bridge
4+ */
5+
6+#ifndef PLATFORM_DATA_XTALK_BRIDGE_H
7+#define PLATFORM_DATA_XTALK_BRIDGE_H
8+
9+#include <asm/sn/types.h>
10+
11+struct xtalk_bridge_platform_data {
12+ struct resource mem;
13+ struct resource io;
14+ unsigned long bridge_addr;
15+ unsigned long intr_addr;
16+ unsigned long mem_offset;
17+ unsigned long io_offset;
18+ nasid_t nasid;
19+ int masterwid;
20+};
21+
22+#endif /* PLATFORM_DATA_XTALK_BRIDGE_H */
include/linux/plist.h+2−2
@@ -231,7 +231,7 @@ static inline int plist_node_empty(const struct plist_node *node) · 230 unmodified lines
231231 * @type: the type of the struct this is embedded in
232232 * @member: the name of the list_head within the struct
233233 */
234−#ifdef CONFIG_DEBUG_PI_LIST
234+#ifdef CONFIG_DEBUG_PLIST
235235 # define plist_first_entry(head, type, member) \
236236 ({ \
237237 WARN_ON(plist_head_empty(head)); \
@@ -248,7 +248,7 @@ static inline int plist_node_empty(const struct plist_node *node) · 10 unmodified lines
248248 * @type: the type of the struct this is embedded in
249249 * @member: the name of the list_head within the struct
250250 */
251−#ifdef CONFIG_DEBUG_PI_LIST
251+#ifdef CONFIG_DEBUG_PLIST
252252 # define plist_last_entry(head, type, member) \
253253 ({ \
254254 WARN_ON(plist_head_empty(head)); \
include/linux/pm_domain.h+25−1
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/of.h>
1717 #include <linux/notifier.h>
1818 #include <linux/spinlock.h>
19+#include <linux/cpumask.h>
1920
2021 /*
2122 * Flags to control the behaviour of a genpd.
@@ -42,11 +43,26 @@ · 20 unmodified lines
4243 * GENPD_FLAG_ACTIVE_WAKEUP: Instructs genpd to keep the PM domain powered
4344 * on, in case any of its attached devices is used
4445 * in the wakeup path to serve system wakeups.
46+ *
47+ * GENPD_FLAG_CPU_DOMAIN: Instructs genpd that it should expect to get
48+ * devices attached, which may belong to CPUs or
49+ * possibly have subdomains with CPUs attached.
50+ * This flag enables the genpd backend driver to
51+ * deploy idle power management support for CPUs
52+ * and groups of CPUs. Note that, the backend
53+ * driver must then comply with the so called,
54+ * last-man-standing algorithm, for the CPUs in the
55+ * PM domain.
56+ *
57+ * GENPD_FLAG_RPM_ALWAYS_ON: Instructs genpd to always keep the PM domain
58+ * powered on except for system suspend.
4559 */
4660 #define GENPD_FLAG_PM_CLK (1U << 0)
4761 #define GENPD_FLAG_IRQ_SAFE (1U << 1)
4862 #define GENPD_FLAG_ALWAYS_ON (1U << 2)
4963 #define GENPD_FLAG_ACTIVE_WAKEUP (1U << 3)
64+#define GENPD_FLAG_CPU_DOMAIN (1U << 4)
65+#define GENPD_FLAG_RPM_ALWAYS_ON (1U << 5)
5066
5167 enum gpd_status {
5268 GPD_STATE_ACTIVE = 0, /* PM domain is active */
@@ -69,6 +85,7 @@ struct genpd_power_state { · 16 unmodified lines
6985 s64 residency_ns;
7086 struct fwnode_handle *fwnode;
7187 ktime_t idle_time;
88+ void *data;
7289 };
7390
7491 struct genpd_lock_ops;
@@ -93,6 +110,7 @@ struct generic_pm_domain { · 18 unmodified lines
93110 unsigned int suspended_count; /* System suspend device counter */
94111 unsigned int prepared_count; /* Suspend counter of prepared devices */
95112 unsigned int performance_state; /* Aggregated max performance state */
113+ cpumask_var_t cpus; /* A cpumask of the attached CPUs */
96114 int (*power_off)(struct generic_pm_domain *domain);
97115 int (*power_on)(struct generic_pm_domain *domain);
98116 struct opp_table *opp_table; /* OPP table of the genpd */
@@ -104,15 +122,17 @@ struct generic_pm_domain { · 5 unmodified lines
104122 s64 max_off_time_ns; /* Maximum allowed "suspended" time. */
105123 bool max_off_time_changed;
106124 bool cached_power_down_ok;
125+ bool cached_power_down_state_idx;
107126 int (*attach_dev)(struct generic_pm_domain *domain,
108127 struct device *dev);
109128 void (*detach_dev)(struct generic_pm_domain *domain,
110129 struct device *dev);
111130 unsigned int flags; /* Bit field of configs for genpd */
112131 struct genpd_power_state *states;
132+ void (*free_states)(struct genpd_power_state *states,
133+ unsigned int state_count);
113134 unsigned int state_count; /* number of states */
114135 unsigned int state_idx; /* state that genpd will go to when off */
115− void *free; /* Free the state that was allocated for default */
116136 ktime_t on_time;
117137 ktime_t accounting_time;
118138 const struct genpd_lock_ops *lock_ops;
@@ -159,6 +179,7 @@ struct generic_pm_domain_data { · 40 unmodified lines
159179 struct pm_domain_data base;
160180 struct gpd_timing_data td;
161181 struct notifier_block nb;
182+ int cpu;
162183 unsigned int performance_state;
163184 void *data;
164185 };
@@ -187,6 +208,9 @@ int dev_pm_genpd_set_performance_state(struct device *dev, unsigned int state); · 22 unmodified lines
187208
188209 extern struct dev_power_governor simple_qos_governor;
189210 extern struct dev_power_governor pm_domain_always_on_gov;
211+#ifdef CONFIG_CPU_IDLE
212+extern struct dev_power_governor pm_domain_cpu_gov;
213+#endif
190214 #else
191215
192216 static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev)
include/linux/pm_opp.h+8−0
@@ -102,6 +102,8 @@ struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, · 101 unmodified lines
102102
103103 struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
104104 unsigned long *freq);
105+struct dev_pm_opp *dev_pm_opp_find_freq_ceil_by_volt(struct device *dev,
106+ unsigned long u_volt);
105107
106108 struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
107109 unsigned long *freq);
@@ -207,6 +209,12 @@ static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev, · 99 unmodified lines
207209 return ERR_PTR(-ENOTSUPP);
208210 }
209211
212+static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil_by_volt(struct device *dev,
213+ unsigned long u_volt)
214+{
215+ return ERR_PTR(-ENOTSUPP);
216+}
217+
210218 static inline struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
211219 unsigned long *freq)
212220 {
include/linux/poll.h+4−0
@@ -16,7 +16,11 @@ · 15 unmodified lines
1616 extern struct ctl_table epoll_table[]; /* for sysctl */
1717 /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating
1818 additional memory. */
19+#ifdef __clang__
20+#define MAX_STACK_ALLOC 768
21+#else
1922 #define MAX_STACK_ALLOC 832
23+#endif
2024 #define FRONTEND_STACK_ALLOC 256
2125 #define SELECT_STACK_ALLOC FRONTEND_STACK_ALLOC
2226 #define POLL_STACK_ALLOC FRONTEND_STACK_ALLOC
include/linux/power_supply.h+9−2
@@ -40,11 +40,15 @@ enum { · 39 unmodified lines
4040 POWER_SUPPLY_STATUS_FULL,
4141 };
4242
43+/* What algorithm is the charger using? */
4344 enum {
4445 POWER_SUPPLY_CHARGE_TYPE_UNKNOWN = 0,
4546 POWER_SUPPLY_CHARGE_TYPE_NONE,
46− POWER_SUPPLY_CHARGE_TYPE_TRICKLE,
47− POWER_SUPPLY_CHARGE_TYPE_FAST,
47+ POWER_SUPPLY_CHARGE_TYPE_TRICKLE, /* slow speed */
48+ POWER_SUPPLY_CHARGE_TYPE_FAST, /* fast speed */
49+ POWER_SUPPLY_CHARGE_TYPE_STANDARD, /* normal speed */
50+ POWER_SUPPLY_CHARGE_TYPE_ADAPTIVE, /* dynamically adjusted speed */
51+ POWER_SUPPLY_CHARGE_TYPE_CUSTOM, /* use CHARGE_CONTROL_* props */
4852 };
4953
5054 enum {
@@ -57,6 +61,7 @@ enum { · 6 unmodified lines
5761 POWER_SUPPLY_HEALTH_COLD,
5862 POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE,
5963 POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,
64+ POWER_SUPPLY_HEALTH_OVERCURRENT,
6065 };
6166
6267 enum {
@@ -121,6 +126,8 @@ enum power_supply_property { · 58 unmodified lines
121126 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
122127 POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT,
123128 POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
129+ POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD, /* in percents! */
130+ POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD, /* in percents! */
124131 POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT,
125132 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
126133 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
include/linux/pps-gpio.h+3−2
@@ -23,10 +23,11 @@ · 22 unmodified lines
2323 #define _PPS_GPIO_H
2424
2525 struct pps_gpio_platform_data {
26+ struct gpio_desc *gpio_pin;
27+ struct gpio_desc *echo_pin;
2628 bool assert_falling_edge;
2729 bool capture_clear;
28− unsigned int gpio_pin;
29− const char *gpio_label;
30+ unsigned int echo_active_ms;
3031 };
3132
3233 #endif /* _PPS_GPIO_H */
include/linux/printk.h+4−2
@@ -82,6 +82,8 @@ static inline void console_verbose(void) · 81 unmodified lines
8282 extern char devkmsg_log_str[];
8383 struct ctl_table;
8484
85+extern int suppress_printk;
86+
8587 struct va_format {
8688 const char *fmt;
8789 va_list *va;
@@ -347,7 +349,7 @@ extern int kptr_restrict; · 259 unmodified lines
347349 #ifdef CONFIG_PRINTK
348350 #define printk_once(fmt, ...) \
349351 ({ \
350− static bool __print_once __read_mostly; \
352+ static bool __section(.data.once) __print_once; \
351353 bool __ret_print_once = !__print_once; \
352354 \
353355 if (!__print_once) { \
@@ -358,7 +360,7 @@ extern int kptr_restrict; · 4 unmodified lines
358360 })
359361 #define printk_deferred_once(fmt, ...) \
360362 ({ \
361− static bool __print_once __read_mostly; \
363+ static bool __section(.data.once) __print_once; \
362364 bool __ret_print_once = !__print_once; \
363365 \
364366 if (!__print_once) { \
include/linux/property.h+18−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #ifndef _LINUX_PROPERTY_H_
1414 #define _LINUX_PROPERTY_H_
1515
16+#include <linux/bits.h>
1617 #include <linux/fwnode.h>
1718 #include <linux/types.h>
1819
@@ -304,6 +305,23 @@ struct fwnode_handle * · 285 unmodified lines
304305 fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port,
305306 u32 endpoint);
306307
308+/*
309+ * Fwnode lookup flags
310+ *
311+ * @FWNODE_GRAPH_ENDPOINT_NEXT: In the case of no exact match, look for the
312+ * closest endpoint ID greater than the specified
313+ * one.
314+ * @FWNODE_GRAPH_DEVICE_DISABLED: That the device to which the remote
315+ * endpoint of the given endpoint belongs to,
316+ * may be disabled.
317+ */
318+#define FWNODE_GRAPH_ENDPOINT_NEXT BIT(0)
319+#define FWNODE_GRAPH_DEVICE_DISABLED BIT(1)
320+
321+struct fwnode_handle *
322+fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
323+ u32 port, u32 endpoint, unsigned long flags);
324+
307325 #define fwnode_graph_for_each_endpoint(fwnode, child) \
308326 for (child = NULL; \
309327 (child = fwnode_graph_get_next_endpoint(fwnode, child)); )
include/linux/psi.h+9−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 #include <linux/jump_label.h>
55 #include <linux/psi_types.h>
66 #include <linux/sched.h>
7+#include <linux/poll.h>
78
89 struct seq_file;
910 struct css_set;
@@ -11,6 +12,7 @@ struct css_set; · 1 unmodified line
1112 #ifdef CONFIG_PSI
1213
1314 extern struct static_key_false psi_disabled;
15+extern struct psi_group psi_system;
1416
1517 void psi_init(void);
1618
@@ -26,6 +28,13 @@ int psi_show(struct seq_file *s, struct psi_group *group, enum psi_res res); · 9 unmodified lines
2628 int psi_cgroup_alloc(struct cgroup *cgrp);
2729 void psi_cgroup_free(struct cgroup *cgrp);
2830 void cgroup_move_task(struct task_struct *p, struct css_set *to);
31+
32+struct psi_trigger *psi_trigger_create(struct psi_group *group,
33+ char *buf, size_t nbytes, enum psi_res res);
34+void psi_trigger_replace(void **trigger_ptr, struct psi_trigger *t);
35+
36+__poll_t psi_trigger_poll(void **trigger_ptr, struct file *file,
37+ poll_table *wait);
2938 #endif
3039
3140 #else /* CONFIG_PSI */
include/linux/psi_types.h+93−12
@@ -1,8 +1,11 @@
11 #ifndef _LINUX_PSI_TYPES_H
22 #define _LINUX_PSI_TYPES_H
33
4+#include <linux/kthread.h>
45 #include <linux/seqlock.h>
56 #include <linux/types.h>
7+#include <linux/kref.h>
8+#include <linux/wait.h>
69
710 #ifdef CONFIG_PSI
811
@@ -11,7 +14,7 @@ enum psi_task_count { · 2 unmodified lines
1114 NR_IOWAIT,
1215 NR_MEMSTALL,
1316 NR_RUNNING,
14− NR_PSI_TASK_COUNTS,
17+ NR_PSI_TASK_COUNTS = 3,
1518 };
1619
1720 /* Task state bitmasks */
@@ -24,7 +27,7 @@ enum psi_res { · 6 unmodified lines
2427 PSI_IO,
2528 PSI_MEM,
2629 PSI_CPU,
27− NR_PSI_RESOURCES,
30+ NR_PSI_RESOURCES = 3,
2831 };
2932
3033 /*
@@ -41,7 +44,13 @@ enum psi_states { · 10 unmodified lines
4144 PSI_CPU_SOME,
4245 /* Only per-CPU, to weigh the CPU in the global average: */
4346 PSI_NONIDLE,
44− NR_PSI_STATES,
47+ NR_PSI_STATES = 6,
48+};
49+
50+enum psi_aggregators {
51+ PSI_AVGS = 0,
52+ PSI_POLL,
53+ NR_PSI_AGGREGATORS,
4554 };
4655
4756 struct psi_group_cpu {
@@ -53,6 +62,9 @@ struct psi_group_cpu { · 5 unmodified lines
5362 /* States of the tasks belonging to this group */
5463 unsigned int tasks[NR_PSI_TASK_COUNTS];
5564
65+ /* Aggregate pressure state derived from the tasks */
66+ u32 state_mask;
67+
5668 /* Period time sampling buckets for each state of interest (ns) */
5769 u32 times[NR_PSI_STATES];
5870
@@ -62,25 +74,94 @@ struct psi_group_cpu { · 3 unmodified lines
6274 /* 2nd cacheline updated by the aggregator */
6375
6476 /* Delta detection against the sampling buckets */
65− u32 times_prev[NR_PSI_STATES] ____cacheline_aligned_in_smp;
77+ u32 times_prev[NR_PSI_AGGREGATORS][NR_PSI_STATES]
78+ ____cacheline_aligned_in_smp;
79+};
80+
81+/* PSI growth tracking window */
82+struct psi_window {
83+ /* Window size in ns */
84+ u64 size;
85+
86+ /* Start time of the current window in ns */
87+ u64 start_time;
88+
89+ /* Value at the start of the window */
90+ u64 start_value;
91+
92+ /* Value growth in the previous window */
93+ u64 prev_growth;
94+};
95+
96+struct psi_trigger {
97+ /* PSI state being monitored by the trigger */
98+ enum psi_states state;
99+
100+ /* User-spacified threshold in ns */
101+ u64 threshold;
102+
103+ /* List node inside triggers list */
104+ struct list_head node;
105+
106+ /* Backpointer needed during trigger destruction */
107+ struct psi_group *group;
108+
109+ /* Wait queue for polling */
110+ wait_queue_head_t event_wait;
111+
112+ /* Pending event flag */
113+ int event;
114+
115+ /* Tracking window */
116+ struct psi_window win;
117+
118+ /*
119+ * Time last event was generated. Used for rate-limiting
120+ * events to one per window
121+ */
122+ u64 last_event_time;
123+
124+ /* Refcounting to prevent premature destruction */
125+ struct kref refcount;
66126 };
67127
68128 struct psi_group {
69− /* Protects data updated during an aggregation */
70− struct mutex stat_lock;
129+ /* Protects data used by the aggregator */
130+ struct mutex avgs_lock;
71131
72132 /* Per-cpu task state & time tracking */
73133 struct psi_group_cpu __percpu *pcpu;
74134
75− /* Periodic aggregation state */
76− u64 total_prev[NR_PSI_STATES - 1];
77− u64 last_update;
78− u64 next_update;
79− struct delayed_work clock_work;
135+ /* Running pressure averages */
136+ u64 avg_total[NR_PSI_STATES - 1];
137+ u64 avg_last_update;
138+ u64 avg_next_update;
139+
140+ /* Aggregator work control */
141+ struct delayed_work avgs_work;
80142
81143 /* Total stall times and sampled pressure averages */
82− u64 total[NR_PSI_STATES - 1];
144+ u64 total[NR_PSI_AGGREGATORS][NR_PSI_STATES - 1];
83145 unsigned long avg[NR_PSI_STATES - 1][3];
146+
147+ /* Monitor work control */
148+ atomic_t poll_scheduled;
149+ struct kthread_worker __rcu *poll_kworker;
150+ struct kthread_delayed_work poll_work;
151+
152+ /* Protects data used by the monitor */
153+ struct mutex trigger_lock;
154+
155+ /* Configured polling triggers */
156+ struct list_head triggers;
157+ u32 nr_triggers[NR_PSI_STATES - 1];
158+ u32 poll_states;
159+ u64 poll_min_period;
160+
161+ /* Total stall times at the start of monitor activation */
162+ u64 polling_total[NR_PSI_STATES - 1];
163+ u64 polling_next_update;
164+ u64 polling_until;
84165 };
85166
86167 #else /* CONFIG_PSI */
include/linux/psp-sev.h+1−2
@@ -5,8 +5,7 @@ · 4 unmodified lines
55 *
66 * Author: Brijesh Singh <brijesh.singh@amd.com>
77 *
8− * SEV spec 0.14 is available at:
9− * http://support.amd.com/TechDocs/55766_SEV-KM API_Specification.pdf
8+ * SEV API spec is available at https://developer.amd.com/sev
109 *
1110 * This program is free software; you can redistribute it and/or modify
1211 * it under the terms of the GNU General Public License version 2 as
include/linux/pwm.h+0−5
@@ -596,7 +596,6 @@ static inline void pwm_remove_table(struct pwm_lookup *table, size_t num) · 595 unmodified lines
596596 #ifdef CONFIG_PWM_SYSFS
597597 void pwmchip_sysfs_export(struct pwm_chip *chip);
598598 void pwmchip_sysfs_unexport(struct pwm_chip *chip);
599−void pwmchip_sysfs_unexport_children(struct pwm_chip *chip);
600599 #else
601600 static inline void pwmchip_sysfs_export(struct pwm_chip *chip)
602601 {
@@ -605,10 +604,6 @@ static inline void pwmchip_sysfs_export(struct pwm_chip *chip) · 2 unmodified lines
605604 static inline void pwmchip_sysfs_unexport(struct pwm_chip *chip)
606605 {
607606 }
608−
609−static inline void pwmchip_sysfs_unexport_children(struct pwm_chip *chip)
610−{
611−}
612607 #endif /* CONFIG_PWM_SYSFS */
613608
614609 #endif /* __LINUX_PWM_H */
include/linux/qcom-geni-se.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
1+/* SPDX-License-Identifier: GPL-2.0 */
22 /*
33 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
44 */
include/linux/qed/qed_if.h+0−2
@@ -1338,7 +1338,6 @@ static inline u16 qed_sb_update_sb_idx(struct qed_sb_info *sb_info) · 1337 unmodified lines
13381338 }
13391339
13401340 /* Let SB update */
1341− mmiowb();
13421341 return rc;
13431342 }
13441343
@@ -1374,7 +1373,6 @@ static inline void qed_sb_ack(struct qed_sb_info *sb_info, · 29 unmodified lines
13741373 /* Both segments (interrupts & acks) are written to same place address;
13751374 * Need to guarantee all commands will be received (in-order) by HW.
13761375 */
1377− mmiowb();
13781376 barrier();
13791377 }
13801378
include/linux/random.h+2−1
@@ -20,7 +20,7 @@ struct random_ready_callback { · 19 unmodified lines
2020
2121 extern void add_device_randomness(const void *, unsigned int);
2222
23−#if defined(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) && !defined(__CHECKER__)
23+#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__)
2424 static inline void add_latent_entropy(void)
2525 {
2626 add_device_randomness((const void *)&latent_entropy,
@@ -36,6 +36,7 @@ extern void add_interrupt_randomness(int irq, int irq_flags) __latent_entropy; · 9 unmodified lines
3636
3737 extern void get_random_bytes(void *buf, int nbytes);
3838 extern int wait_for_random_bytes(void);
39+extern int __init rand_initialize(void);
3940 extern bool rng_is_initialized(void);
4041 extern int add_random_ready_callback(struct random_ready_callback *rdy);
4142 extern void del_random_ready_callback(struct random_ready_callback *rdy);
include/linux/rcupdate.h+4−2
@@ -878,9 +878,11 @@ static inline void rcu_head_init(struct rcu_head *rhp) · 877 unmodified lines
878878 static inline bool
879879 rcu_head_after_call_rcu(struct rcu_head *rhp, rcu_callback_t f)
880880 {
881− if (READ_ONCE(rhp->func) == f)
881+ rcu_callback_t func = READ_ONCE(rhp->func);
882+
883+ if (func == f)
882884 return true;
883− WARN_ON_ONCE(READ_ONCE(rhp->func) != (rcu_callback_t)~0L);
885+ WARN_ON_ONCE(func != (rcu_callback_t)~0L);
884886 return false;
885887 }
886888
include/linux/rcuwait.h+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 * awoken.
1919 */
2020 struct rcuwait {
21− struct task_struct *task;
21+ struct task_struct __rcu *task;
2222 };
2323
2424 #define __RCUWAIT_INITIALIZER(name) \
include/linux/reboot.h+2−0
@@ -14,6 +14,7 @@ struct device; · 13 unmodified lines
1414 #define SYS_POWER_OFF 0x0003 /* Notify of system power off */
1515
1616 enum reboot_mode {
17+ REBOOT_UNDEFINED = -1,
1718 REBOOT_COLD = 0,
1819 REBOOT_WARM,
1920 REBOOT_HARD,
@@ -21,6 +22,7 @@ enum reboot_mode { · 1 unmodified line
2122 REBOOT_GPIO,
2223 };
2324 extern enum reboot_mode reboot_mode;
25+extern enum reboot_mode panic_reboot_mode;
2426
2527 enum reboot_type {
2628 BOOT_TRIPLE = 't',
include/linux/regulator/consumer.h+5−0
@@ -478,6 +478,11 @@ static inline int regulator_is_supported_voltage(struct regulator *regulator, · 477 unmodified lines
478478 return 0;
479479 }
480480
481+static inline unsigned int regulator_get_linear_step(struct regulator *regulator)
482+{
483+ return 0;
484+}
485+
481486 static inline int regulator_set_current_limit(struct regulator *regulator,
482487 int min_uA, int max_uA)
483488 {
include/linux/reset.h+2−0
@@ -2,6 +2,8 @@ · 1 unmodified line
22 #ifndef _LINUX_RESET_H_
33 #define _LINUX_RESET_H_
44
5+#include <linux/err.h>
6+#include <linux/errno.h>
57 #include <linux/types.h>
68
79 struct device;
include/linux/rhashtable-types.h+0−2
@@ -48,7 +48,6 @@ typedef int (*rht_obj_cmpfn_t)(struct rhashtable_compare_arg *arg, · 47 unmodified lines
4848 * @head_offset: Offset of rhash_head in struct to be hashed
4949 * @max_size: Maximum size while expanding
5050 * @min_size: Minimum size while shrinking
51− * @locks_mul: Number of bucket locks to allocate per cpu (default: 32)
5251 * @automatic_shrinking: Enable automatic shrinking of tables
5352 * @hashfn: Hash function (default: jhash2 if !(key_len % 4), or jhash)
5453 * @obj_hashfn: Function to hash object
@@ -62,7 +61,6 @@ struct rhashtable_params { · 7 unmodified lines
6261 unsigned int max_size;
6362 u16 min_size;
6463 bool automatic_shrinking;
65− u8 locks_mul;
6664 rht_hashfn_t hashfn;
6765 rht_obj_hashfn_t obj_hashfn;
6866 rht_obj_cmpfn_t obj_cmpfn;
include/linux/rhashtable.h+235−123
@@ -24,12 +24,27 @@ · 23 unmodified lines
2424 #include <linux/list_nulls.h>
2525 #include <linux/workqueue.h>
2626 #include <linux/rculist.h>
27+#include <linux/bit_spinlock.h>
2728
2829 #include <linux/rhashtable-types.h>
2930 /*
31+ * Objects in an rhashtable have an embedded struct rhash_head
32+ * which is linked into as hash chain from the hash table - or one
33+ * of two or more hash tables when the rhashtable is being resized.
3034 * The end of the chain is marked with a special nulls marks which has
31− * the least significant bit set.
35+ * the least significant bit set but otherwise stores the address of
36+ * the hash bucket. This allows us to be be sure we've found the end
37+ * of the right list.
38+ * The value stored in the hash bucket has BIT(0) used as a lock bit.
39+ * This bit must be atomically set before any changes are made to
40+ * the chain. To avoid dereferencing this pointer without clearing
41+ * the bit first, we use an opaque 'struct rhash_lock_head *' for the
42+ * pointer stored in the bucket. This struct needs to be defined so
43+ * that rcu_dereference() works on it, but it has no content so a
44+ * cast is needed for it to be useful. This ensures it isn't
45+ * used by mistake with clearing the lock bit first.
3246 */
47+struct rhash_lock_head {};
3348
3449 /* Maximum chain length before rehash
3550 *
@@ -52,8 +67,6 @@ · 16 unmodified lines
5267 * @nest: Number of bits of first-level nested table.
5368 * @rehash: Current bucket being rehashed
5469 * @hash_rnd: Random seed to fold into hash
55− * @locks_mask: Mask to apply before accessing locks[]
56− * @locks: Array of spinlocks protecting individual buckets
5770 * @walkers: List of active walkers
5871 * @rcu: RCU structure for freeing the table
5972 * @future_tbl: Table under construction during rehashing
@@ -63,31 +76,34 @@ · 3 unmodified lines
6376 struct bucket_table {
6477 unsigned int size;
6578 unsigned int nest;
66− unsigned int rehash;
6779 u32 hash_rnd;
68− unsigned int locks_mask;
69− spinlock_t *locks;
7080 struct list_head walkers;
7181 struct rcu_head rcu;
7282
7383 struct bucket_table __rcu *future_tbl;
7484
75− struct rhash_head __rcu *buckets[] ____cacheline_aligned_in_smp;
85+ struct lockdep_map dep_map;
86+
87+ struct rhash_lock_head __rcu *buckets[] ____cacheline_aligned_in_smp;
7688 };
7789
7890 /*
7991 * NULLS_MARKER() expects a hash value with the low
8092 * bits mostly likely to be significant, and it discards
8193 * the msb.
82− * We git it an address, in which the bottom 2 bits are
94+ * We give it an address, in which the bottom bit is
8395 * always 0, and the msb might be significant.
8496 * So we shift the address down one bit to align with
8597 * expectations and avoid losing a significant bit.
98+ *
99+ * We never store the NULLS_MARKER in the hash table
100+ * itself as we need the lsb for locking.
101+ * Instead we store a NULL
86102 */
87103 #define RHT_NULLS_MARKER(ptr) \
88104 ((void *)NULLS_MARKER(((unsigned long) (ptr)) >> 1))
89105 #define INIT_RHT_NULLS_HEAD(ptr) \
90− ((ptr) = RHT_NULLS_MARKER(&(ptr)))
106+ ((ptr) = NULL)
91107
92108 static inline bool rht_is_a_nulls(const struct rhash_head *ptr)
93109 {
@@ -207,25 +223,6 @@ static inline bool rht_grow_above_max(const struct rhashtable *ht, · 113 unmodified lines
207223 return atomic_read(&ht->nelems) >= ht->max_elems;
208224 }
209225
210−/* The bucket lock is selected based on the hash and protects mutations
211− * on a group of hash buckets.
212− *
213− * A maximum of tbl->size/2 bucket locks is allocated. This ensures that
214− * a single lock always covers both buckets which may both contains
215− * entries which link to the same bucket of the old table during resizing.
216− * This allows to simplify the locking as locking the bucket in both
217− * tables during resize always guarantee protection.
218− *
219− * IMPORTANT: When holding the bucket lock of both the old and new table
220− * during expansions and shrinking, the old bucket lock must always be
221− * acquired first.
222− */
223−static inline spinlock_t *rht_bucket_lock(const struct bucket_table *tbl,
224− unsigned int hash)
225−{
226− return &tbl->locks[hash & tbl->locks_mask];
227−}
228−
229226 #ifdef CONFIG_PROVE_LOCKING
230227 int lockdep_rht_mutex_is_held(struct rhashtable *ht);
231228 int lockdep_rht_bucket_is_held(const struct bucket_table *tbl, u32 hash);
@@ -264,11 +261,13 @@ void rhashtable_free_and_destroy(struct rhashtable *ht, · 32 unmodified lines
264261 void *arg);
265262 void rhashtable_destroy(struct rhashtable *ht);
266263
267−struct rhash_head __rcu **rht_bucket_nested(const struct bucket_table *tbl,
268− unsigned int hash);
269−struct rhash_head __rcu **rht_bucket_nested_insert(struct rhashtable *ht,
270− struct bucket_table *tbl,
264+struct rhash_lock_head __rcu **rht_bucket_nested(const struct bucket_table *tbl,
265+ unsigned int hash);
266+struct rhash_lock_head __rcu **__rht_bucket_nested(const struct bucket_table *tbl,
271267 unsigned int hash);
268+struct rhash_lock_head __rcu **rht_bucket_nested_insert(struct rhashtable *ht,
269+ struct bucket_table *tbl,
270+ unsigned int hash);
272271
273272 #define rht_dereference(p, ht) \
274273 rcu_dereference_protected(p, lockdep_rht_mutex_is_held(ht))
@@ -285,37 +284,136 @@ struct rhash_head __rcu **rht_bucket_nested_insert(struct rhashtable *ht, · 10 unmodified lines
285284 #define rht_entry(tpos, pos, member) \
286285 ({ tpos = container_of(pos, typeof(*tpos), member); 1; })
287286
288−static inline struct rhash_head __rcu *const *rht_bucket(
287+static inline struct rhash_lock_head __rcu *const *rht_bucket(
289288 const struct bucket_table *tbl, unsigned int hash)
290289 {
291290 return unlikely(tbl->nest) ? rht_bucket_nested(tbl, hash) :
292291 &tbl->buckets[hash];
293292 }
294293
295−static inline struct rhash_head __rcu **rht_bucket_var(
294+static inline struct rhash_lock_head __rcu **rht_bucket_var(
296295 struct bucket_table *tbl, unsigned int hash)
297296 {
298− return unlikely(tbl->nest) ? rht_bucket_nested(tbl, hash) :
297+ return unlikely(tbl->nest) ? __rht_bucket_nested(tbl, hash) :
299298 &tbl->buckets[hash];
300299 }
301300
302−static inline struct rhash_head __rcu **rht_bucket_insert(
301+static inline struct rhash_lock_head __rcu **rht_bucket_insert(
303302 struct rhashtable *ht, struct bucket_table *tbl, unsigned int hash)
304303 {
305304 return unlikely(tbl->nest) ? rht_bucket_nested_insert(ht, tbl, hash) :
306305 &tbl->buckets[hash];
307306 }
308307
308+/*
309+ * We lock a bucket by setting BIT(0) in the pointer - this is always
310+ * zero in real pointers. The NULLS mark is never stored in the bucket,
311+ * rather we store NULL if the bucket is empty.
312+ * bit_spin_locks do not handle contention well, but the whole point
313+ * of the hashtable design is to achieve minimum per-bucket contention.
314+ * A nested hash table might not have a bucket pointer. In that case
315+ * we cannot get a lock. For remove and replace the bucket cannot be
316+ * interesting and doesn't need locking.
317+ * For insert we allocate the bucket if this is the last bucket_table,
318+ * and then take the lock.
319+ * Sometimes we unlock a bucket by writing a new pointer there. In that
320+ * case we don't need to unlock, but we do need to reset state such as
321+ * local_bh. For that we have rht_assign_unlock(). As rcu_assign_pointer()
322+ * provides the same release semantics that bit_spin_unlock() provides,
323+ * this is safe.
324+ * When we write to a bucket without unlocking, we use rht_assign_locked().
325+ */
326+
327+static inline void rht_lock(struct bucket_table *tbl,
328+ struct rhash_lock_head **bkt)
329+{
330+ local_bh_disable();
331+ bit_spin_lock(0, (unsigned long *)bkt);
332+ lock_map_acquire(&tbl->dep_map);
333+}
334+
335+static inline void rht_lock_nested(struct bucket_table *tbl,
336+ struct rhash_lock_head **bucket,
337+ unsigned int subclass)
338+{
339+ local_bh_disable();
340+ bit_spin_lock(0, (unsigned long *)bucket);
341+ lock_acquire_exclusive(&tbl->dep_map, subclass, 0, NULL, _THIS_IP_);
342+}
343+
344+static inline void rht_unlock(struct bucket_table *tbl,
345+ struct rhash_lock_head **bkt)
346+{
347+ lock_map_release(&tbl->dep_map);
348+ bit_spin_unlock(0, (unsigned long *)bkt);
349+ local_bh_enable();
350+}
351+
352+/*
353+ * Where 'bkt' is a bucket and might be locked:
354+ * rht_ptr() dereferences that pointer and clears the lock bit.
355+ * rht_ptr_exclusive() dereferences in a context where exclusive
356+ * access is guaranteed, such as when destroying the table.
357+ */
358+static inline struct rhash_head *rht_ptr(
359+ struct rhash_lock_head __rcu * const *bkt,
360+ struct bucket_table *tbl,
361+ unsigned int hash)
362+{
363+ const struct rhash_lock_head *p =
364+ rht_dereference_bucket_rcu(*bkt, tbl, hash);
365+
366+ if ((((unsigned long)p) & ~BIT(0)) == 0)
367+ return RHT_NULLS_MARKER(bkt);
368+ return (void *)(((unsigned long)p) & ~BIT(0));
369+}
370+
371+static inline struct rhash_head *rht_ptr_exclusive(
372+ struct rhash_lock_head __rcu * const *bkt)
373+{
374+ const struct rhash_lock_head *p =
375+ rcu_dereference_protected(*bkt, 1);
376+
377+ if (!p)
378+ return RHT_NULLS_MARKER(bkt);
379+ return (void *)(((unsigned long)p) & ~BIT(0));
380+}
381+
382+static inline void rht_assign_locked(struct rhash_lock_head __rcu **bkt,
383+ struct rhash_head *obj)
384+{
385+ struct rhash_head __rcu **p = (struct rhash_head __rcu **)bkt;
386+
387+ if (rht_is_a_nulls(obj))
388+ obj = NULL;
389+ rcu_assign_pointer(*p, (void *)((unsigned long)obj | BIT(0)));
390+}
391+
392+static inline void rht_assign_unlock(struct bucket_table *tbl,
393+ struct rhash_lock_head __rcu **bkt,
394+ struct rhash_head *obj)
395+{
396+ struct rhash_head __rcu **p = (struct rhash_head __rcu **)bkt;
397+
398+ if (rht_is_a_nulls(obj))
399+ obj = NULL;
400+ lock_map_release(&tbl->dep_map);
401+ rcu_assign_pointer(*p, obj);
402+ preempt_enable();
403+ __release(bitlock);
404+ local_bh_enable();
405+}
406+
309407 /**
310− * rht_for_each_continue - continue iterating over hash chain
408+ * rht_for_each_from - iterate over hash chain from given head
311409 * @pos: the &struct rhash_head to use as a loop cursor.
312− * @head: the previous &struct rhash_head to continue from
410+ * @head: the &struct rhash_head to start from
313411 * @tbl: the &struct bucket_table
314412 * @hash: the hash value / bucket index
315413 */
316−#define rht_for_each_continue(pos, head, tbl, hash) \
317− for (pos = rht_dereference_bucket(head, tbl, hash); \
318− !rht_is_a_nulls(pos); \
414+#define rht_for_each_from(pos, head, tbl, hash) \
415+ for (pos = head; \
416+ !rht_is_a_nulls(pos); \
319417 pos = rht_dereference_bucket((pos)->next, tbl, hash))
320418
321419 /**
@@ -325,19 +423,20 @@ static inline struct rhash_head __rcu **rht_bucket_insert( · 3 unmodified lines
325423 * @hash: the hash value / bucket index
326424 */
327425 #define rht_for_each(pos, tbl, hash) \
328− rht_for_each_continue(pos, *rht_bucket(tbl, hash), tbl, hash)
426+ rht_for_each_from(pos, rht_ptr(rht_bucket(tbl, hash), tbl, hash), \
427+ tbl, hash)
329428
330429 /**
331− * rht_for_each_entry_continue - continue iterating over hash chain
430+ * rht_for_each_entry_from - iterate over hash chain from given head
332431 * @tpos: the type * to use as a loop cursor.
333432 * @pos: the &struct rhash_head to use as a loop cursor.
334− * @head: the previous &struct rhash_head to continue from
433+ * @head: the &struct rhash_head to start from
335434 * @tbl: the &struct bucket_table
336435 * @hash: the hash value / bucket index
337436 * @member: name of the &struct rhash_head within the hashable struct.
338437 */
339−#define rht_for_each_entry_continue(tpos, pos, head, tbl, hash, member) \
340− for (pos = rht_dereference_bucket(head, tbl, hash); \
438+#define rht_for_each_entry_from(tpos, pos, head, tbl, hash, member) \
439+ for (pos = head; \
341440 (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \
342441 pos = rht_dereference_bucket((pos)->next, tbl, hash))
343442
@@ -350,8 +449,9 @@ static inline struct rhash_head __rcu **rht_bucket_insert( · 6 unmodified lines
350449 * @member: name of the &struct rhash_head within the hashable struct.
351450 */
352451 #define rht_for_each_entry(tpos, pos, tbl, hash, member) \
353− rht_for_each_entry_continue(tpos, pos, *rht_bucket(tbl, hash), \
354− tbl, hash, member)
452+ rht_for_each_entry_from(tpos, pos, \
453+ rht_ptr(rht_bucket(tbl, hash), tbl, hash), \
454+ tbl, hash, member)
355455
356456 /**
357457 * rht_for_each_entry_safe - safely iterate over hash chain of given type
@@ -366,7 +466,7 @@ static inline struct rhash_head __rcu **rht_bucket_insert( · 8 unmodified lines
366466 * remove the loop cursor from the list.
367467 */
368468 #define rht_for_each_entry_safe(tpos, pos, next, tbl, hash, member) \
369− for (pos = rht_dereference_bucket(*rht_bucket(tbl, hash), tbl, hash), \
469+ for (pos = rht_ptr(rht_bucket(tbl, hash), tbl, hash), \
370470 next = !rht_is_a_nulls(pos) ? \
371471 rht_dereference_bucket(pos->next, tbl, hash) : NULL; \
372472 (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \
@@ -375,9 +475,9 @@ static inline struct rhash_head __rcu **rht_bucket_insert( · 2 unmodified lines
375475 rht_dereference_bucket(pos->next, tbl, hash) : NULL)
376476
377477 /**
378− * rht_for_each_rcu_continue - continue iterating over rcu hash chain
478+ * rht_for_each_rcu_from - iterate over rcu hash chain from given head
379479 * @pos: the &struct rhash_head to use as a loop cursor.
380− * @head: the previous &struct rhash_head to continue from
480+ * @head: the &struct rhash_head to start from
381481 * @tbl: the &struct bucket_table
382482 * @hash: the hash value / bucket index
383483 *
@@ -385,9 +485,9 @@ static inline struct rhash_head __rcu **rht_bucket_insert( · 1 unmodified line
385485 * the _rcu mutation primitives such as rhashtable_insert() as long as the
386486 * traversal is guarded by rcu_read_lock().
387487 */
388−#define rht_for_each_rcu_continue(pos, head, tbl, hash) \
488+#define rht_for_each_rcu_from(pos, head, tbl, hash) \
389489 for (({barrier(); }), \
390− pos = rht_dereference_bucket_rcu(head, tbl, hash); \
490+ pos = head; \
391491 !rht_is_a_nulls(pos); \
392492 pos = rcu_dereference_raw(pos->next))
393493
@@ -401,14 +501,17 @@ static inline struct rhash_head __rcu **rht_bucket_insert( · 7 unmodified lines
401501 * the _rcu mutation primitives such as rhashtable_insert() as long as the
402502 * traversal is guarded by rcu_read_lock().
403503 */
404−#define rht_for_each_rcu(pos, tbl, hash) \
405− rht_for_each_rcu_continue(pos, *rht_bucket(tbl, hash), tbl, hash)
504+#define rht_for_each_rcu(pos, tbl, hash) \
505+ for (({barrier(); }), \
506+ pos = rht_ptr(rht_bucket(tbl, hash), tbl, hash); \
507+ !rht_is_a_nulls(pos); \
508+ pos = rcu_dereference_raw(pos->next))
406509
407510 /**
408− * rht_for_each_entry_rcu_continue - continue iterating over rcu hash chain
511+ * rht_for_each_entry_rcu_from - iterated over rcu hash chain from given head
409512 * @tpos: the type * to use as a loop cursor.
410513 * @pos: the &struct rhash_head to use as a loop cursor.
411− * @head: the previous &struct rhash_head to continue from
514+ * @head: the &struct rhash_head to start from
412515 * @tbl: the &struct bucket_table
413516 * @hash: the hash value / bucket index
414517 * @member: name of the &struct rhash_head within the hashable struct.
@@ -417,9 +520,9 @@ static inline struct rhash_head __rcu **rht_bucket_insert( · 2 unmodified lines
417520 * the _rcu mutation primitives such as rhashtable_insert() as long as the
418521 * traversal is guarded by rcu_read_lock().
419522 */
420−#define rht_for_each_entry_rcu_continue(tpos, pos, head, tbl, hash, member) \
523+#define rht_for_each_entry_rcu_from(tpos, pos, head, tbl, hash, member) \
421524 for (({barrier(); }), \
422− pos = rht_dereference_bucket_rcu(head, tbl, hash); \
525+ pos = head; \
423526 (!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \
424527 pos = rht_dereference_bucket_rcu(pos->next, tbl, hash))
425528
@@ -436,8 +539,10 @@ static inline struct rhash_head __rcu **rht_bucket_insert( · 10 unmodified lines
436539 * traversal is guarded by rcu_read_lock().
437540 */
438541 #define rht_for_each_entry_rcu(tpos, pos, tbl, hash, member) \
439− rht_for_each_entry_rcu_continue(tpos, pos, *rht_bucket(tbl, hash), \
440− tbl, hash, member)
542+ rht_for_each_entry_rcu_from(tpos, pos, \
543+ rht_ptr(rht_bucket(tbl, hash), \
544+ tbl, hash), \
545+ tbl, hash, member)
441546
442547 /**
443548 * rhl_for_each_rcu - iterate over rcu hash table list
@@ -482,7 +587,7 @@ static inline struct rhash_head *__rhashtable_lookup( · 38 unmodified lines
482587 .ht = ht,
483588 .key = key,
484589 };
485− struct rhash_head __rcu * const *head;
590+ struct rhash_lock_head __rcu * const *bkt;
486591 struct bucket_table *tbl;
487592 struct rhash_head *he;
488593 unsigned int hash;
@@ -490,9 +595,9 @@ static inline struct rhash_head *__rhashtable_lookup( · 1 unmodified line
490595 tbl = rht_dereference_rcu(ht->tbl, ht);
491596 restart:
492597 hash = rht_key_hashfn(ht, tbl, key, params);
493− head = rht_bucket(tbl, hash);
598+ bkt = rht_bucket(tbl, hash);
494599 do {
495− rht_for_each_rcu_continue(he, *head, tbl, hash) {
600+ rht_for_each_rcu_from(he, rht_ptr(bkt, tbl, hash), tbl, hash) {
496601 if (params.obj_cmpfn ?
497602 params.obj_cmpfn(&arg, rht_obj(ht, he)) :
498603 rhashtable_compare(&arg, rht_obj(ht, he)))
@@ -502,7 +607,7 @@ restart: · 3 unmodified lines
502607 /* An object might have been moved to a different hash chain,
503608 * while we walk along it - better check and retry.
504609 */
505− } while (he != RHT_NULLS_MARKER(head));
610+ } while (he != RHT_NULLS_MARKER(bkt));
506611
507612 /* Ensure we see any new tables. */
508613 smp_rmb();
@@ -598,10 +703,10 @@ static inline void *__rhashtable_insert_fast( · 89 unmodified lines
598703 .ht = ht,
599704 .key = key,
600705 };
706+ struct rhash_lock_head __rcu **bkt;
601707 struct rhash_head __rcu **pprev;
602708 struct bucket_table *tbl;
603709 struct rhash_head *head;
604− spinlock_t *lock;
605710 unsigned int hash;
606711 int elasticity;
607712 void *data;
@@ -610,23 +715,22 @@ static inline void *__rhashtable_insert_fast( · 2 unmodified lines
610715
611716 tbl = rht_dereference_rcu(ht->tbl, ht);
612717 hash = rht_head_hashfn(ht, tbl, obj, params);
613− lock = rht_bucket_lock(tbl, hash);
614− spin_lock_bh(lock);
718+ elasticity = RHT_ELASTICITY;
719+ bkt = rht_bucket_insert(ht, tbl, hash);
720+ data = ERR_PTR(-ENOMEM);
721+ if (!bkt)
722+ goto out;
723+ pprev = NULL;
724+ rht_lock(tbl, bkt);
615725
616726 if (unlikely(rcu_access_pointer(tbl->future_tbl))) {
617727 slow_path:
618− spin_unlock_bh(lock);
728+ rht_unlock(tbl, bkt);
619729 rcu_read_unlock();
620730 return rhashtable_insert_slow(ht, key, obj);
621731 }
622732
623− elasticity = RHT_ELASTICITY;
624− pprev = rht_bucket_insert(ht, tbl, hash);
625− data = ERR_PTR(-ENOMEM);
626− if (!pprev)
627− goto out;
628−
629− rht_for_each_continue(head, *pprev, tbl, hash) {
733+ rht_for_each_from(head, rht_ptr(bkt, tbl, hash), tbl, hash) {
630734 struct rhlist_head *plist;
631735 struct rhlist_head *list;
632736
@@ -642,7 +746,7 @@ slow_path: · 9 unmodified lines
642746 data = rht_obj(ht, head);
643747
644748 if (!rhlist)
645− goto out;
749+ goto out_unlock;
646750
647751
648752 list = container_of(obj, struct rhlist_head, rhead);
@@ -651,9 +755,13 @@ slow_path: · 2 unmodified lines
651755 RCU_INIT_POINTER(list->next, plist);
652756 head = rht_dereference_bucket(head->next, tbl, hash);
653757 RCU_INIT_POINTER(list->rhead.next, head);
654− rcu_assign_pointer(*pprev, obj);
655−
656− goto good;
758+ if (pprev) {
759+ rcu_assign_pointer(*pprev, obj);
760+ rht_unlock(tbl, bkt);
761+ } else
762+ rht_assign_unlock(tbl, bkt, obj);
763+ data = NULL;
764+ goto out;
657765 }
658766
659767 if (elasticity <= 0)
@@ -661,12 +769,13 @@ slow_path: · 1 unmodified line
661769
662770 data = ERR_PTR(-E2BIG);
663771 if (unlikely(rht_grow_above_max(ht, tbl)))
664− goto out;
772+ goto out_unlock;
665773
666774 if (unlikely(rht_grow_above_100(ht, tbl)))
667775 goto slow_path;
668776
669− head = rht_dereference_bucket(*pprev, tbl, hash);
777+ /* Inserting at head of list makes unlocking free. */
778+ head = rht_ptr(bkt, tbl, hash);
670779
671780 RCU_INIT_POINTER(obj->next, head);
672781 if (rhlist) {
@@ -676,20 +785,21 @@ slow_path: · 3 unmodified lines
676785 RCU_INIT_POINTER(list->next, NULL);
677786 }
678787
679− rcu_assign_pointer(*pprev, obj);
680−
681788 atomic_inc(&ht->nelems);
789+ rht_assign_unlock(tbl, bkt, obj);
790+
682791 if (rht_grow_above_75(ht, tbl))
683792 schedule_work(&ht->run_work);
684793
685−good:
686794 data = NULL;
687−
688795 out:
689− spin_unlock_bh(lock);
690796 rcu_read_unlock();
691797
692798 return data;
799+
800+out_unlock:
801+ rht_unlock(tbl, bkt);
802+ goto out;
693803 }
694804
695805 /**
@@ -698,9 +808,9 @@ out: · 2 unmodified lines
698808 * @obj: pointer to hash head inside object
699809 * @params: hash table parameters
700810 *
701− * Will take a per bucket spinlock to protect against mutual mutations
811+ * Will take the per bucket bitlock to protect against mutual mutations
702812 * on the same bucket. Multiple insertions may occur in parallel unless
703− * they map to the same bucket lock.
813+ * they map to the same bucket.
704814 *
705815 * It is safe to call this function from atomic context.
706816 *
@@ -727,9 +837,9 @@ static inline int rhashtable_insert_fast( · 20 unmodified lines
727837 * @list: pointer to hash list head inside object
728838 * @params: hash table parameters
729839 *
730− * Will take a per bucket spinlock to protect against mutual mutations
840+ * Will take the per bucket bitlock to protect against mutual mutations
731841 * on the same bucket. Multiple insertions may occur in parallel unless
732− * they map to the same bucket lock.
842+ * they map to the same bucket.
733843 *
734844 * It is safe to call this function from atomic context.
735845 *
@@ -750,9 +860,9 @@ static inline int rhltable_insert_key( · 14 unmodified lines
750860 * @list: pointer to hash list head inside object
751861 * @params: hash table parameters
752862 *
753− * Will take a per bucket spinlock to protect against mutual mutations
863+ * Will take the per bucket bitlock to protect against mutual mutations
754864 * on the same bucket. Multiple insertions may occur in parallel unless
755− * they map to the same bucket lock.
865+ * they map to the same bucket.
756866 *
757867 * It is safe to call this function from atomic context.
758868 *
@@ -776,12 +886,6 @@ static inline int rhltable_insert( · 17 unmodified lines
776886 * @obj: pointer to hash head inside object
777887 * @params: hash table parameters
778888 *
779− * Locks down the bucket chain in both the old and new table if a resize
780− * is in progress to ensure that writers can't remove from the old table
781− * and can't insert to the new table during the atomic operation of search
782− * and insertion. Searches for duplicates in both the old and new table if
783− * a resize is in progress.
784− *
785889 * This lookup function may only be used for fixed key hash table (key_len
786890 * parameter set). It will BUG() if used inappropriately.
787891 *
@@ -837,12 +941,6 @@ static inline void *rhashtable_lookup_get_insert_fast( · 49 unmodified lines
837941 * @obj: pointer to hash head inside object
838942 * @params: hash table parameters
839943 *
840− * Locks down the bucket chain in both the old and new table if a resize
841− * is in progress to ensure that writers can't remove from the old table
842− * and can't insert to the new table during the atomic operation of search
843− * and insertion. Searches for duplicates in both the old and new table if
844− * a resize is in progress.
845− *
846944 * Lookups may occur in parallel with hashtable mutations and resizing.
847945 *
848946 * Will trigger an automatic deferred table resizing if residency in the
@@ -891,19 +989,20 @@ static inline int __rhashtable_remove_fast_one( · 42 unmodified lines
891989 struct rhash_head *obj, const struct rhashtable_params params,
892990 bool rhlist)
893991 {
992+ struct rhash_lock_head __rcu **bkt;
894993 struct rhash_head __rcu **pprev;
895994 struct rhash_head *he;
896− spinlock_t * lock;
897995 unsigned int hash;
898996 int err = -ENOENT;
899997
900998 hash = rht_head_hashfn(ht, tbl, obj, params);
901− lock = rht_bucket_lock(tbl, hash);
902−
903− spin_lock_bh(lock);
999+ bkt = rht_bucket_var(tbl, hash);
1000+ if (!bkt)
1001+ return -ENOENT;
1002+ pprev = NULL;
1003+ rht_lock(tbl, bkt);
9041004
905− pprev = rht_bucket_var(tbl, hash);
906− rht_for_each_continue(he, *pprev, tbl, hash) {
1005+ rht_for_each_from(he, rht_ptr(bkt, tbl, hash), tbl, hash) {
9071006 struct rhlist_head *list;
9081007
9091008 list = container_of(he, struct rhlist_head, rhead);
@@ -943,12 +1042,17 @@ static inline int __rhashtable_remove_fast_one( · 33 unmodified lines
9431042 }
9441043 }
9451044
946− rcu_assign_pointer(*pprev, obj);
947− break;
1045+ if (pprev) {
1046+ rcu_assign_pointer(*pprev, obj);
1047+ rht_unlock(tbl, bkt);
1048+ } else {
1049+ rht_assign_unlock(tbl, bkt, obj);
1050+ }
1051+ goto unlocked;
9481052 }
9491053
950− spin_unlock_bh(lock);
951−
1054+ rht_unlock(tbl, bkt);
1055+unlocked:
9521056 if (err > 0) {
9531057 atomic_dec(&ht->nelems);
9541058 if (unlikely(ht->p.automatic_shrinking &&
@@ -1037,9 +1141,9 @@ static inline int __rhashtable_replace_fast( · 82 unmodified lines
10371141 struct rhash_head *obj_old, struct rhash_head *obj_new,
10381142 const struct rhashtable_params params)
10391143 {
1144+ struct rhash_lock_head __rcu **bkt;
10401145 struct rhash_head __rcu **pprev;
10411146 struct rhash_head *he;
1042− spinlock_t *lock;
10431147 unsigned int hash;
10441148 int err = -ENOENT;
10451149
@@ -1050,25 +1154,33 @@ static inline int __rhashtable_replace_fast( · 4 unmodified lines
10501154 if (hash != rht_head_hashfn(ht, tbl, obj_new, params))
10511155 return -EINVAL;
10521156
1053− lock = rht_bucket_lock(tbl, hash);
1157+ bkt = rht_bucket_var(tbl, hash);
1158+ if (!bkt)
1159+ return -ENOENT;
10541160
1055− spin_lock_bh(lock);
1161+ pprev = NULL;
1162+ rht_lock(tbl, bkt);
10561163
1057− pprev = rht_bucket_var(tbl, hash);
1058− rht_for_each_continue(he, *pprev, tbl, hash) {
1164+ rht_for_each_from(he, rht_ptr(bkt, tbl, hash), tbl, hash) {
10591165 if (he != obj_old) {
10601166 pprev = &he->next;
10611167 continue;
10621168 }
10631169
10641170 rcu_assign_pointer(obj_new->next, obj_old->next);
1065− rcu_assign_pointer(*pprev, obj_new);
1171+ if (pprev) {
1172+ rcu_assign_pointer(*pprev, obj_new);
1173+ rht_unlock(tbl, bkt);
1174+ } else {
1175+ rht_assign_unlock(tbl, bkt, obj_new);
1176+ }
10661177 err = 0;
1067− break;
1178+ goto unlocked;
10681179 }
10691180
1070− spin_unlock_bh(lock);
1181+ rht_unlock(tbl, bkt);
10711182
1183+unlocked:
10721184 return err;
10731185 }
10741186
include/linux/rtc.h+3−3
@@ -79,8 +79,6 @@ struct rtc_class_ops { · 78 unmodified lines
7979 int (*read_alarm)(struct device *, struct rtc_wkalrm *);
8080 int (*set_alarm)(struct device *, struct rtc_wkalrm *);
8181 int (*proc)(struct device *, struct seq_file *);
82− int (*set_mmss64)(struct device *, time64_t secs);
83− int (*set_mmss)(struct device *, unsigned long secs);
8482 int (*alarm_irq_enable)(struct device *, unsigned int enabled);
8583 int (*read_offset)(struct device *, long *offset);
8684 int (*set_offset)(struct device *, long offset);
@@ -162,9 +160,11 @@ struct rtc_device { · 75 unmodified lines
162160 #define to_rtc_device(d) container_of(d, struct rtc_device, dev)
163161
164162 /* useful timestamps */
165−#define RTC_TIMESTAMP_BEGIN_1900 -2208989361LL /* 1900-01-01 00:00:00 */
163+#define RTC_TIMESTAMP_BEGIN_1900 -2208988800LL /* 1900-01-01 00:00:00 */
166164 #define RTC_TIMESTAMP_BEGIN_2000 946684800LL /* 2000-01-01 00:00:00 */
165+#define RTC_TIMESTAMP_END_2063 2966371199LL /* 2063-12-31 23:59:59 */
167166 #define RTC_TIMESTAMP_END_2099 4102444799LL /* 2099-12-31 23:59:59 */
167+#define RTC_TIMESTAMP_END_9999 253402300799LL /* 9999-12-31 23:59:59 */
168168
169169 extern struct rtc_device *devm_rtc_device_register(struct device *dev,
170170 const char *name,
include/linux/rtc/ds1685.h+0−2
@@ -48,8 +48,6 @@ struct ds1685_priv { · 47 unmodified lines
4848 u32 regstep;
4949 resource_size_t baseaddr;
5050 size_t size;
51− spinlock_t lock;
52− struct work_struct work;
5351 int irq_num;
5452 bool bcd_mode;
5553 bool no_irq;
include/linux/rtc/rtc-omap.h+7−0
@@ -0,0 +1,7 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+
3+#ifndef _LINUX_RTCOMAP_H_
4+#define _LINUX_RTCOMAP_H_
5+
6+int omap_rtc_power_off_program(struct device *dev);
7+#endif /* _LINUX_RTCOMAP_H_ */
include/linux/rwsem-spinlock.h+0−47
@@ -1,47 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−/* rwsem-spinlock.h: fallback C implementation
3− *
4− * Copyright (c) 2001 David Howells (dhowells@redhat.com).
5− * - Derived partially from ideas by Andrea Arcangeli <andrea@suse.de>
6− * - Derived also from comments by Linus
7− */
8−
9−#ifndef _LINUX_RWSEM_SPINLOCK_H
10−#define _LINUX_RWSEM_SPINLOCK_H
11−
12−#ifndef _LINUX_RWSEM_H
13−#error "please don't include linux/rwsem-spinlock.h directly, use linux/rwsem.h instead"
14−#endif
15−
16−#ifdef __KERNEL__
17−/*
18− * the rw-semaphore definition
19− * - if count is 0 then there are no active readers or writers
20− * - if count is +ve then that is the number of active readers
21− * - if count is -1 then there is one active writer
22− * - if wait_list is not empty, then there are processes waiting for the semaphore
23− */
24−struct rw_semaphore {
25− __s32 count;
26− raw_spinlock_t wait_lock;
27− struct list_head wait_list;
28−#ifdef CONFIG_DEBUG_LOCK_ALLOC
29− struct lockdep_map dep_map;
30−#endif
31−};
32−
33−#define RWSEM_UNLOCKED_VALUE 0x00000000
34−
35−extern void __down_read(struct rw_semaphore *sem);
36−extern int __must_check __down_read_killable(struct rw_semaphore *sem);
37−extern int __down_read_trylock(struct rw_semaphore *sem);
38−extern void __down_write(struct rw_semaphore *sem);
39−extern int __must_check __down_write_killable(struct rw_semaphore *sem);
40−extern int __down_write_trylock(struct rw_semaphore *sem);
41−extern void __up_read(struct rw_semaphore *sem);
42−extern void __up_write(struct rw_semaphore *sem);
43−extern void __downgrade_write(struct rw_semaphore *sem);
44−extern int rwsem_is_locked(struct rw_semaphore *sem);
45−
46−#endif /* __KERNEL__ */
47−#endif /* _LINUX_RWSEM_SPINLOCK_H */
include/linux/rwsem.h+16−21
@@ -20,25 +20,30 @@ · 19 unmodified lines
2020 #include <linux/osq_lock.h>
2121 #endif
2222
23−struct rw_semaphore;
24−
25−#ifdef CONFIG_RWSEM_GENERIC_SPINLOCK
26−#include <linux/rwsem-spinlock.h> /* use a generic implementation */
27−#define __RWSEM_INIT_COUNT(name) .count = RWSEM_UNLOCKED_VALUE
28−#else
29−/* All arch specific implementations share the same struct */
23+/*
24+ * For an uncontended rwsem, count and owner are the only fields a task
25+ * needs to touch when acquiring the rwsem. So they are put next to each
26+ * other to increase the chance that they will share the same cacheline.
27+ *
28+ * In a contended rwsem, the owner is likely the most frequently accessed
29+ * field in the structure as the optimistic waiter that holds the osq lock
30+ * will spin on owner. For an embedded rwsem, other hot fields in the
31+ * containing structure should be moved further away from the rwsem to
32+ * reduce the chance that they will share the same cacheline causing
33+ * cacheline bouncing problem.
34+ */
3035 struct rw_semaphore {
3136 atomic_long_t count;
32− struct list_head wait_list;
33− raw_spinlock_t wait_lock;
3437 #ifdef CONFIG_RWSEM_SPIN_ON_OWNER
35− struct optimistic_spin_queue osq; /* spinner MCS lock */
3638 /*
3739 * Write owner. Used as a speculative check to see
3840 * if the owner is running on the cpu.
3941 */
4042 struct task_struct *owner;
43+ struct optimistic_spin_queue osq; /* spinner MCS lock */
4144 #endif
45+ raw_spinlock_t wait_lock;
46+ struct list_head wait_list;
4247 #ifdef CONFIG_DEBUG_LOCK_ALLOC
4348 struct lockdep_map dep_map;
4449 #endif
@@ -50,24 +55,14 @@ struct rw_semaphore { · 5 unmodified lines
5055 */
5156 #define RWSEM_OWNER_UNKNOWN ((struct task_struct *)-2L)
5257
53−extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
54−extern struct rw_semaphore *rwsem_down_read_failed_killable(struct rw_semaphore *sem);
55−extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
56−extern struct rw_semaphore *rwsem_down_write_failed_killable(struct rw_semaphore *sem);
57−extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *);
58−extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
59−
60−/* Include the arch specific part */
61−#include <asm/rwsem.h>
62−
6358 /* In all implementations count != 0 means locked */
6459 static inline int rwsem_is_locked(struct rw_semaphore *sem)
6560 {
6661 return atomic_long_read(&sem->count) != 0;
6762 }
6863
64+#define RWSEM_UNLOCKED_VALUE 0L
6965 #define __RWSEM_INIT_COUNT(name) .count = ATOMIC_LONG_INIT(RWSEM_UNLOCKED_VALUE)
70−#endif
7166
7267 /* Common initializer macros and functions */
7368
include/linux/scatterlist.h+5−5
@@ -340,11 +340,11 @@ int sg_alloc_table_chained(struct sg_table *table, int nents, · 339 unmodified lines
340340 * sg page iterator
341341 *
342342 * Iterates over sg entries page-by-page. On each successful iteration, you
343− * can call sg_page_iter_page(@piter) to get the current page and its dma
344− * address. @piter->sg will point to the sg holding this page and
345− * @piter->sg_pgoffset to the page's page offset within the sg. The iteration
346− * will stop either when a maximum number of sg entries was reached or a
347− * terminating sg (sg_last(sg) == true) was reached.
343+ * can call sg_page_iter_page(@piter) to get the current page.
344+ * @piter->sg will point to the sg holding this page and @piter->sg_pgoffset to
345+ * the page's page offset within the sg. The iteration will stop either when a
346+ * maximum number of sg entries was reached or a terminating sg
347+ * (sg_last(sg) == true) was reached.
348348 */
349349 struct sg_page_iter {
350350 struct scatterlist *sg; /* sg holding the page */
include/linux/sched.h+2−5
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include <linux/latencytop.h>
2727 #include <linux/sched/prio.h>
2828 #include <linux/signal_types.h>
29−#include <linux/psi_types.h>
3029 #include <linux/mm_types_task.h>
3130 #include <linux/task_io_accounting.h>
3231 #include <linux/rseq.h>
@@ -726,6 +725,8 @@ struct task_struct { · 693 unmodified lines
726725 #ifdef CONFIG_CGROUPS
727726 /* disallow userland-initiated cgroup migration */
728727 unsigned no_cgroup_migration:1;
728+ /* task is frozen/stopped (used by the cgroup freezer) */
729+ unsigned frozen:1;
729730 #endif
730731 #ifdef CONFIG_BLK_CGROUP
731732 /* to be used once the psi infrastructure lands upstream. */
@@ -1057,7 +1058,6 @@ struct task_struct { · 325 unmodified lines
10571058
10581059 #ifdef CONFIG_RSEQ
10591060 struct rseq __user *rseq;
1060− u32 rseq_len;
10611061 u32 rseq_sig;
10621062 /*
10631063 * RmW on rseq_event_mask must be performed atomically
@@ -1855,12 +1855,10 @@ static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) · 791 unmodified lines
18551855 {
18561856 if (clone_flags & CLONE_THREAD) {
18571857 t->rseq = NULL;
1858− t->rseq_len = 0;
18591858 t->rseq_sig = 0;
18601859 t->rseq_event_mask = 0;
18611860 } else {
18621861 t->rseq = current->rseq;
1863− t->rseq_len = current->rseq_len;
18641862 t->rseq_sig = current->rseq_sig;
18651863 t->rseq_event_mask = current->rseq_event_mask;
18661864 }
@@ -1869,7 +1867,6 @@ static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) · 2 unmodified lines
18691867 static inline void rseq_execve(struct task_struct *t)
18701868 {
18711869 t->rseq = NULL;
1872− t->rseq_len = 0;
18731870 t->rseq_sig = 0;
18741871 t->rseq_event_mask = 0;
18751872 }
include/linux/sched/jobctl.h+2−0
@@ -18,6 +18,7 @@ struct task_struct; · 17 unmodified lines
1818 #define JOBCTL_TRAP_NOTIFY_BIT 20 /* trap for NOTIFY */
1919 #define JOBCTL_TRAPPING_BIT 21 /* switching to TRACED */
2020 #define JOBCTL_LISTENING_BIT 22 /* ptracer is listening for events */
21+#define JOBCTL_TRAP_FREEZE_BIT 23 /* trap for cgroup freezer */
2122
2223 #define JOBCTL_STOP_DEQUEUED (1UL << JOBCTL_STOP_DEQUEUED_BIT)
2324 #define JOBCTL_STOP_PENDING (1UL << JOBCTL_STOP_PENDING_BIT)
@@ -26,6 +27,7 @@ struct task_struct; · 2 unmodified lines
2627 #define JOBCTL_TRAP_NOTIFY (1UL << JOBCTL_TRAP_NOTIFY_BIT)
2728 #define JOBCTL_TRAPPING (1UL << JOBCTL_TRAPPING_BIT)
2829 #define JOBCTL_LISTENING (1UL << JOBCTL_LISTENING_BIT)
30+#define JOBCTL_TRAP_FREEZE (1UL << JOBCTL_TRAP_FREEZE_BIT)
2931
3032 #define JOBCTL_TRAP_MASK (JOBCTL_TRAP_STOP | JOBCTL_TRAP_NOTIFY)
3133 #define JOBCTL_PENDING_MASK (JOBCTL_STOP_PENDING | JOBCTL_TRAP_MASK)
include/linux/sched/mm.h+21−0
@@ -49,6 +49,27 @@ static inline void mmdrop(struct mm_struct *mm) · 48 unmodified lines
4949 __mmdrop(mm);
5050 }
5151
52+/*
53+ * This has to be called after a get_task_mm()/mmget_not_zero()
54+ * followed by taking the mmap_sem for writing before modifying the
55+ * vmas or anything the coredump pretends not to change from under it.
56+ *
57+ * NOTE: find_extend_vma() called from GUP context is the only place
58+ * that can modify the "mm" (notably the vm_start/end) under mmap_sem
59+ * for reading and outside the context of the process, so it is also
60+ * the only case that holds the mmap_sem for reading that must call
61+ * this function. Generally if the mmap_sem is hold for reading
62+ * there's no need of this check after get_task_mm()/mmget_not_zero().
63+ *
64+ * This function can be obsoleted and the check can be removed, after
65+ * the coredump code will hold the mmap_sem for writing before
66+ * invoking the ->core_dump methods.
67+ */
68+static inline bool mmget_still_valid(struct mm_struct *mm)
69+{
70+ return likely(!mm->core_state);
71+}
72+
5273 /**
5374 * mmget() - Pin the address space associated with a &struct mm_struct.
5475 * @mm: The address space to pin.
include/linux/sched/signal.h+26−25
@@ -271,17 +271,18 @@ static inline int signal_group_exit(const struct signal_struct *sig) · 270 unmodified lines
271271 extern void flush_signals(struct task_struct *);
272272 extern void ignore_signals(struct task_struct *);
273273 extern void flush_signal_handlers(struct task_struct *, int force_default);
274−extern int dequeue_signal(struct task_struct *tsk, sigset_t *mask, kernel_siginfo_t *info);
274+extern int dequeue_signal(struct task_struct *task,
275+ sigset_t *mask, kernel_siginfo_t *info);
275276
276277 static inline int kernel_dequeue_signal(void)
277278 {
278− struct task_struct *tsk = current;
279+ struct task_struct *task = current;
279280 kernel_siginfo_t __info;
280281 int ret;
281282
282− spin_lock_irq(&tsk->sighand->siglock);
283− ret = dequeue_signal(tsk, &tsk->blocked, &__info);
284− spin_unlock_irq(&tsk->sighand->siglock);
283+ spin_lock_irq(&task->sighand->siglock);
284+ ret = dequeue_signal(task, &task->blocked, &__info);
285+ spin_unlock_irq(&task->sighand->siglock);
285286
286287 return ret;
287288 }
@@ -419,18 +420,18 @@ static inline void set_restore_sigmask(void) · 131 unmodified lines
419420 WARN_ON(!test_thread_flag(TIF_SIGPENDING));
420421 }
421422
422−static inline void clear_tsk_restore_sigmask(struct task_struct *tsk)
423+static inline void clear_tsk_restore_sigmask(struct task_struct *task)
423424 {
424− clear_tsk_thread_flag(tsk, TIF_RESTORE_SIGMASK);
425+ clear_tsk_thread_flag(task, TIF_RESTORE_SIGMASK);
425426 }
426427
427428 static inline void clear_restore_sigmask(void)
428429 {
429430 clear_thread_flag(TIF_RESTORE_SIGMASK);
430431 }
431−static inline bool test_tsk_restore_sigmask(struct task_struct *tsk)
432+static inline bool test_tsk_restore_sigmask(struct task_struct *task)
432433 {
433− return test_tsk_thread_flag(tsk, TIF_RESTORE_SIGMASK);
434+ return test_tsk_thread_flag(task, TIF_RESTORE_SIGMASK);
434435 }
435436 static inline bool test_restore_sigmask(void)
436437 {
@@ -449,9 +450,9 @@ static inline void set_restore_sigmask(void) · 12 unmodified lines
449450 current->restore_sigmask = true;
450451 WARN_ON(!test_thread_flag(TIF_SIGPENDING));
451452 }
452−static inline void clear_tsk_restore_sigmask(struct task_struct *tsk)
453+static inline void clear_tsk_restore_sigmask(struct task_struct *task)
453454 {
454− tsk->restore_sigmask = false;
455+ task->restore_sigmask = false;
455456 }
456457 static inline void clear_restore_sigmask(void)
457458 {
@@ -461,9 +462,9 @@ static inline bool test_restore_sigmask(void) · 3 unmodified lines
461462 {
462463 return current->restore_sigmask;
463464 }
464−static inline bool test_tsk_restore_sigmask(struct task_struct *tsk)
465+static inline bool test_tsk_restore_sigmask(struct task_struct *task)
465466 {
466− return tsk->restore_sigmask;
467+ return task->restore_sigmask;
467468 }
468469 static inline bool test_and_clear_restore_sigmask(void)
469470 {
@@ -617,9 +618,9 @@ static inline struct pid *task_session(struct task_struct *task) · 147 unmodified lines
617618 return task->signal->pids[PIDTYPE_SID];
618619 }
619620
620−static inline int get_nr_threads(struct task_struct *tsk)
621+static inline int get_nr_threads(struct task_struct *task)
621622 {
622− return tsk->signal->nr_threads;
623+ return task->signal->nr_threads;
623624 }
624625
625626 static inline bool thread_group_leader(struct task_struct *p)
@@ -658,35 +659,35 @@ static inline int thread_group_empty(struct task_struct *p) · 32 unmodified lines
658659 #define delay_group_leader(p) \
659660 (thread_group_leader(p) && !thread_group_empty(p))
660661
661−extern struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
662+extern struct sighand_struct *__lock_task_sighand(struct task_struct *task,
662663 unsigned long *flags);
663664
664−static inline struct sighand_struct *lock_task_sighand(struct task_struct *tsk,
665+static inline struct sighand_struct *lock_task_sighand(struct task_struct *task,
665666 unsigned long *flags)
666667 {
667668 struct sighand_struct *ret;
668669
669− ret = __lock_task_sighand(tsk, flags);
670− (void)__cond_lock(&tsk->sighand->siglock, ret);
670+ ret = __lock_task_sighand(task, flags);
671+ (void)__cond_lock(&task->sighand->siglock, ret);
671672 return ret;
672673 }
673674
674−static inline void unlock_task_sighand(struct task_struct *tsk,
675+static inline void unlock_task_sighand(struct task_struct *task,
675676 unsigned long *flags)
676677 {
677− spin_unlock_irqrestore(&tsk->sighand->siglock, *flags);
678+ spin_unlock_irqrestore(&task->sighand->siglock, *flags);
678679 }
679680
680−static inline unsigned long task_rlimit(const struct task_struct *tsk,
681+static inline unsigned long task_rlimit(const struct task_struct *task,
681682 unsigned int limit)
682683 {
683− return READ_ONCE(tsk->signal->rlim[limit].rlim_cur);
684+ return READ_ONCE(task->signal->rlim[limit].rlim_cur);
684685 }
685686
686−static inline unsigned long task_rlimit_max(const struct task_struct *tsk,
687+static inline unsigned long task_rlimit_max(const struct task_struct *task,
687688 unsigned int limit)
688689 {
689− return READ_ONCE(tsk->signal->rlim[limit].rlim_max);
690+ return READ_ONCE(task->signal->rlim[limit].rlim_max);
690691 }
691692
692693 static inline unsigned long rlimit(unsigned int limit)
include/linux/sched/task.h+1−0
@@ -76,6 +76,7 @@ extern void exit_itimers(struct signal_struct *); · 75 unmodified lines
7676 extern long _do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *, unsigned long);
7777 extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
7878 struct task_struct *fork_idle(int);
79+struct mm_struct *copy_init_mm(void);
7980 extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
8081 extern long kernel_wait4(pid_t, int __user *, int, struct rusage *);
8182
include/linux/sched/topology.h+2−2
@@ -76,8 +76,8 @@ struct sched_domain_shared { · 75 unmodified lines
7676
7777 struct sched_domain {
7878 /* These fields must be setup */
79− struct sched_domain *parent; /* top domain must be null terminated */
80− struct sched_domain *child; /* bottom domain must be null terminated */
79+ struct sched_domain __rcu *parent; /* top domain must be null terminated */
80+ struct sched_domain __rcu *child; /* bottom domain must be null terminated */
8181 struct sched_group *groups; /* the balancing groups of the domain */
8282 unsigned long min_interval; /* Minimum balance interval ms */
8383 unsigned long max_interval; /* Maximum balance interval ms */
include/linux/sched/user.h+7−0
@@ -31,6 +31,13 @@ struct user_struct { · 30 unmodified lines
3131 atomic_long_t pipe_bufs; /* how many pages are allocated in pipe buffers */
3232
3333 #ifdef CONFIG_KEYS
34+ /*
35+ * These pointers can only change from NULL to a non-NULL value once.
36+ * Writes are protected by key_user_keyring_mutex.
37+ * Unlocked readers should use READ_ONCE() unless they know that
38+ * install_user_keyrings() has been called successfully (which sets
39+ * these members to non-NULL values, preventing further modifications).
40+ */
3441 struct key *uid_keyring; /* UID specific keyring */
3542 struct key *session_keyring; /* UID's default session keyring */
3643 #endif
include/linux/security.h+16−0
@@ -51,6 +51,7 @@ struct fown_struct; · 50 unmodified lines
5151 struct file_operations;
5252 struct msg_msg;
5353 struct xattr;
54+struct kernfs_node;
5455 struct xfrm_sec_ctx;
5556 struct mm_struct;
5657 struct fs_context;
@@ -250,6 +251,7 @@ int security_sb_clone_mnt_opts(const struct super_block *oldsb, · 193 unmodified lines
250251 unsigned long *set_kern_flags);
251252 int security_add_mnt_opt(const char *option, const char *val,
252253 int len, void **mnt_opts);
254+int security_move_mount(const struct path *from_path, const struct path *to_path);
253255 int security_dentry_init_security(struct dentry *dentry, int mode,
254256 const struct qstr *name, void **ctx,
255257 u32 *ctxlen);
@@ -299,6 +301,8 @@ int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer · 43 unmodified lines
299301 void security_inode_getsecid(struct inode *inode, u32 *secid);
300302 int security_inode_copy_up(struct dentry *src, struct cred **new);
301303 int security_inode_copy_up_xattr(const char *name);
304+int security_kernfs_init_security(struct kernfs_node *kn_dir,
305+ struct kernfs_node *kn);
302306 int security_file_permission(struct file *file, int mask);
303307 int security_file_alloc(struct file *file);
304308 void security_file_free(struct file *file);
@@ -611,6 +615,12 @@ static inline int security_add_mnt_opt(const char *option, const char *val, · 306 unmodified lines
611615 return 0;
612616 }
613617
618+static inline int security_move_mount(const struct path *from_path,
619+ const struct path *to_path)
620+{
621+ return 0;
622+}
623+
614624 static inline int security_inode_alloc(struct inode *inode)
615625 {
616626 return 0;
@@ -801,6 +811,12 @@ static inline int security_inode_copy_up(struct dentry *src, struct cred **new) · 184 unmodified lines
801811 return 0;
802812 }
803813
814+static inline int security_kernfs_init_security(struct kernfs_node *kn_dir,
815+ struct kernfs_node *kn)
816+{
817+ return 0;
818+}
819+
804820 static inline int security_inode_copy_up_xattr(const char *name)
805821 {
806822 return -EOPNOTSUPP;
include/linux/sed-opal.h+1−9
@@ -1,18 +1,10 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * Copyright © 2016 Intel Corporation
34 *
45 * Authors:
56 * Rafael Antognolli <rafael.antognolli@intel.com>
67 * Scott Bauer <scott.bauer@intel.com>
7− *
8− * This program is free software; you can redistribute it and/or modify it
9− * under the terms and conditions of the GNU General Public License,
10− * version 2, as published by the Free Software Foundation.
11− *
12− * This program is distributed in the hope it will be useful, but WITHOUT
13− * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14− * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15− * more details.
168 */
179
1810 #ifndef LINUX_OPAL_H
include/linux/selection.h+4−3
@@ -11,13 +11,14 @@ · 10 unmodified lines
1111 #include <linux/tiocl.h>
1212 #include <linux/vt_buffer.h>
1313
14−struct tty_struct;
15−
1614 extern struct vc_data *sel_cons;
1715 struct tty_struct;
1816
1917 extern void clear_selection(void);
20−extern int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *tty);
18+extern int set_selection_user(const struct tiocl_selection __user *sel,
19+ struct tty_struct *tty);
20+extern int set_selection_kernel(struct tiocl_selection *v,
21+ struct tty_struct *tty);
2122 extern int paste_selection(struct tty_struct *tty);
2223 extern int sel_loadlut(char __user *p);
2324 extern int mouse_reporting(void);
include/linux/serial_core.h+1−1
@@ -45,7 +45,7 @@ struct device; · 44 unmodified lines
4545
4646 /*
4747 * This structure describes all the operations that can be done on the
48− * physical hardware. See Documentation/serial/driver for details.
48+ * physical hardware. See Documentation/serial/driver.rst for details.
4949 */
5050 struct uart_ops {
5151 unsigned int (*tx_empty)(struct uart_port *);
include/linux/set_memory.h+11−0
@@ -17,6 +17,17 @@ static inline int set_memory_x(unsigned long addr, int numpages) { return 0; } · 16 unmodified lines
1717 static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
1818 #endif
1919
20+#ifndef CONFIG_ARCH_HAS_SET_DIRECT_MAP
21+static inline int set_direct_map_invalid_noflush(struct page *page)
22+{
23+ return 0;
24+}
25+static inline int set_direct_map_default_noflush(struct page *page)
26+{
27+ return 0;
28+}
29+#endif
30+
2031 #ifndef set_mce_nospec
2132 static inline int set_mce_nospec(unsigned long pfn)
2233 {
include/linux/shmem_fs.h+1−0
@@ -21,6 +21,7 @@ struct shmem_inode_info { · 20 unmodified lines
2121 struct list_head swaplist; /* chain of maybes on swap */
2222 struct shared_policy policy; /* NUMA memory alloc policy */
2323 struct simple_xattrs xattrs; /* list of xattrs */
24+ atomic_t stop_eviction; /* hold when working on inode */
2425 struct inode vfs_inode;
2526 };
2627
include/linux/siphash.h+5−0
@@ -21,6 +21,11 @@ typedef struct { · 20 unmodified lines
2121 u64 key[2];
2222 } siphash_key_t;
2323
24+static inline bool siphash_key_is_zero(const siphash_key_t *key)
25+{
26+ return !(key->key[0] | key->key[1]);
27+}
28+
2429 u64 __siphash_aligned(const void *data, size_t len, const siphash_key_t *key);
2530 #ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
2631 u64 __siphash_unaligned(const void *data, size_t len, const siphash_key_t *key);
include/linux/skbuff.h+28−20
@@ -657,7 +657,6 @@ typedef unsigned char *sk_buff_data_t; · 656 unmodified lines
657657 * @tc_index: Traffic control index
658658 * @hash: the packet hash
659659 * @queue_mapping: Queue mapping for multiqueue devices
660− * @xmit_more: More SKBs are pending for this queue
661660 * @pfmemalloc: skbuff was allocated from PFMEMALLOC reserves
662661 * @active_extensions: active extensions (skb_ext_id types)
663662 * @ndisc_nodetype: router type (from link layer)
@@ -764,7 +763,6 @@ struct sk_buff { · 100 unmodified lines
764763 fclone:2,
765764 peeked:1,
766765 head_frag:1,
767− xmit_more:1,
768766 pfmemalloc:1;
769767 #ifdef CONFIG_SKB_EXTENSIONS
770768 __u8 active_extensions;
@@ -1044,6 +1042,8 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t priority, int flags, · 273 unmodified lines
10441042 int node);
10451043 struct sk_buff *__build_skb(void *data, unsigned int frag_size);
10461044 struct sk_buff *build_skb(void *data, unsigned int frag_size);
1045+struct sk_buff *build_skb_around(struct sk_buff *skb,
1046+ void *data, unsigned int frag_size);
10471047
10481048 /**
10491049 * alloc_skb - allocate a network buffer
@@ -1258,11 +1258,19 @@ void skb_flow_dissector_init(struct flow_dissector *flow_dissector, · 208 unmodified lines
12581258 unsigned int key_count);
12591259
12601260 #ifdef CONFIG_NET
1261+int skb_flow_dissector_prog_query(const union bpf_attr *attr,
1262+ union bpf_attr __user *uattr);
12611263 int skb_flow_dissector_bpf_prog_attach(const union bpf_attr *attr,
12621264 struct bpf_prog *prog);
12631265
12641266 int skb_flow_dissector_bpf_prog_detach(const union bpf_attr *attr);
12651267 #else
1268+static inline int skb_flow_dissector_prog_query(const union bpf_attr *attr,
1269+ union bpf_attr __user *uattr)
1270+{
1271+ return -EOPNOTSUPP;
1272+}
1273+
12661274 static inline int skb_flow_dissector_bpf_prog_attach(const union bpf_attr *attr,
12671275 struct bpf_prog *prog)
12681276 {
@@ -1275,12 +1283,12 @@ static inline int skb_flow_dissector_bpf_prog_detach(const union bpf_attr *attr) · 6 unmodified lines
12751283 }
12761284 #endif
12771285
1278−struct bpf_flow_keys;
1279−bool __skb_flow_bpf_dissect(struct bpf_prog *prog,
1280− const struct sk_buff *skb,
1281− struct flow_dissector *flow_dissector,
1282− struct bpf_flow_keys *flow_keys);
1283−bool __skb_flow_dissect(const struct sk_buff *skb,
1286+struct bpf_flow_dissector;
1287+bool bpf_flow_dissect(struct bpf_prog *prog, struct bpf_flow_dissector *ctx,
1288+ __be16 proto, int nhoff, int hlen);
1289+
1290+bool __skb_flow_dissect(const struct net *net,
1291+ const struct sk_buff *skb,
12841292 struct flow_dissector *flow_dissector,
12851293 void *target_container,
12861294 void *data, __be16 proto, int nhoff, int hlen,
@@ -1290,8 +1298,8 @@ static inline bool skb_flow_dissect(const struct sk_buff *skb, · 3 unmodified lines
12901298 struct flow_dissector *flow_dissector,
12911299 void *target_container, unsigned int flags)
12921300 {
1293− return __skb_flow_dissect(skb, flow_dissector, target_container,
1294− NULL, 0, 0, 0, flags);
1301+ return __skb_flow_dissect(NULL, skb, flow_dissector,
1302+ target_container, NULL, 0, 0, 0, flags);
12951303 }
12961304
12971305 static inline bool skb_flow_dissect_flow_keys(const struct sk_buff *skb,
@@ -1299,18 +1307,19 @@ static inline bool skb_flow_dissect_flow_keys(const struct sk_buff *skb, · 1 unmodified line
12991307 unsigned int flags)
13001308 {
13011309 memset(flow, 0, sizeof(*flow));
1302− return __skb_flow_dissect(skb, &flow_keys_dissector, flow,
1303− NULL, 0, 0, 0, flags);
1310+ return __skb_flow_dissect(NULL, skb, &flow_keys_dissector,
1311+ flow, NULL, 0, 0, 0, flags);
13041312 }
13051313
13061314 static inline bool
1307−skb_flow_dissect_flow_keys_basic(const struct sk_buff *skb,
1315+skb_flow_dissect_flow_keys_basic(const struct net *net,
1316+ const struct sk_buff *skb,
13081317 struct flow_keys_basic *flow, void *data,
13091318 __be16 proto, int nhoff, int hlen,
13101319 unsigned int flags)
13111320 {
13121321 memset(flow, 0, sizeof(*flow));
1313− return __skb_flow_dissect(skb, &flow_keys_basic_dissector, flow,
1322+ return __skb_flow_dissect(net, skb, &flow_keys_basic_dissector, flow,
13141323 data, proto, nhoff, hlen, flags);
13151324 }
13161325
@@ -2102,8 +2111,6 @@ void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, · 785 unmodified lines
21022111 void skb_coalesce_rx_frag(struct sk_buff *skb, int i, int size,
21032112 unsigned int truesize);
21042113
2105−#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags)
2106−#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb))
21072114 #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb))
21082115
21092116 #ifdef NET_SKBUFF_DATA_USES_OFFSET
@@ -2490,7 +2497,8 @@ static inline void skb_probe_transport_header(struct sk_buff *skb) · 380 unmodified lines
24902497 if (skb_transport_header_was_set(skb))
24912498 return;
24922499
2493− if (skb_flow_dissect_flow_keys_basic(skb, &keys, NULL, 0, 0, 0, 0))
2500+ if (skb_flow_dissect_flow_keys_basic(NULL, skb, &keys,
2501+ NULL, 0, 0, 0, 0))
24942502 skb_set_transport_header(skb, keys.control.thoff);
24952503 }
24962504
@@ -3372,17 +3380,17 @@ struct sk_buff *__skb_try_recv_from_queue(struct sock *sk, · 875 unmodified lines
33723380 unsigned int flags,
33733381 void (*destructor)(struct sock *sk,
33743382 struct sk_buff *skb),
3375− int *peeked, int *off, int *err,
3383+ int *off, int *err,
33763384 struct sk_buff **last);
33773385 struct sk_buff *__skb_try_recv_datagram(struct sock *sk, unsigned flags,
33783386 void (*destructor)(struct sock *sk,
33793387 struct sk_buff *skb),
3380− int *peeked, int *off, int *err,
3388+ int *off, int *err,
33813389 struct sk_buff **last);
33823390 struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags,
33833391 void (*destructor)(struct sock *sk,
33843392 struct sk_buff *skb),
3385− int *peeked, int *off, int *err);
3393+ int *off, int *err);
33863394 struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
33873395 int *err);
33883396 __poll_t datagram_poll(struct file *file, struct socket *sock,
include/linux/slab_def.h+0−3
@@ -61,9 +61,6 @@ struct kmem_cache { · 60 unmodified lines
6161 atomic_t allocmiss;
6262 atomic_t freehit;
6363 atomic_t freemiss;
64−#ifdef CONFIG_DEBUG_SLAB_LEAK
65− atomic_t store_user_clean;
66−#endif
6764
6865 /*
6966 * If debugging is enabled, then the allocator can add additional
include/linux/smpboot.h+1−1
@@ -29,7 +29,7 @@ struct smpboot_thread_data; · 28 unmodified lines
2929 * @thread_comm: The base name of the thread
3030 */
3131 struct smp_hotplug_thread {
32− struct task_struct __percpu **store;
32+ struct task_struct * __percpu *store;
3333 struct list_head list;
3434 int (*thread_should_run)(unsigned int cpu);
3535 void (*thread_fn)(unsigned int cpu);
include/linux/soc/cirrus/ep93xx.h+37−0
@@ -0,0 +1,37 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _SOC_EP93XX_H
3+#define _SOC_EP93XX_H
4+
5+struct platform_device;
6+
7+#define EP93XX_CHIP_REV_D0 3
8+#define EP93XX_CHIP_REV_D1 4
9+#define EP93XX_CHIP_REV_E0 5
10+#define EP93XX_CHIP_REV_E1 6
11+#define EP93XX_CHIP_REV_E2 7
12+
13+#ifdef CONFIG_ARCH_EP93XX
14+int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);
15+void ep93xx_pwm_release_gpio(struct platform_device *pdev);
16+int ep93xx_ide_acquire_gpio(struct platform_device *pdev);
17+void ep93xx_ide_release_gpio(struct platform_device *pdev);
18+int ep93xx_keypad_acquire_gpio(struct platform_device *pdev);
19+void ep93xx_keypad_release_gpio(struct platform_device *pdev);
20+int ep93xx_i2s_acquire(void);
21+void ep93xx_i2s_release(void);
22+unsigned int ep93xx_chip_revision(void);
23+
24+#else
25+static inline int ep93xx_pwm_acquire_gpio(struct platform_device *pdev) { return 0; }
26+static inline void ep93xx_pwm_release_gpio(struct platform_device *pdev) {}
27+static inline int ep93xx_ide_acquire_gpio(struct platform_device *pdev) { return 0; }
28+static inline void ep93xx_ide_release_gpio(struct platform_device *pdev) {}
29+static inline int ep93xx_keypad_acquire_gpio(struct platform_device *pdev) { return 0; }
30+static inline void ep93xx_keypad_release_gpio(struct platform_device *pdev) {}
31+static inline int ep93xx_i2s_acquire(void) { return 0; }
32+static inline void ep93xx_i2s_release(void) {}
33+static inline unsigned int ep93xx_chip_revision(void) { return 0; }
34+
35+#endif
36+
37+#endif
include/linux/soc/ixp4xx/npe.h+38−0
@@ -0,0 +1,38 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef __IXP4XX_NPE_H
3+#define __IXP4XX_NPE_H
4+
5+#include <linux/kernel.h>
6+
7+extern const char *npe_names[];
8+
9+struct npe_regs {
10+ u32 exec_addr, exec_data, exec_status_cmd, exec_count;
11+ u32 action_points[4];
12+ u32 watchpoint_fifo, watch_count;
13+ u32 profile_count;
14+ u32 messaging_status, messaging_control;
15+ u32 mailbox_status, /*messaging_*/ in_out_fifo;
16+};
17+
18+struct npe {
19+ struct npe_regs __iomem *regs;
20+ int id;
21+ int valid;
22+};
23+
24+
25+static inline const char *npe_name(struct npe *npe)
26+{
27+ return npe_names[npe->id];
28+}
29+
30+int npe_running(struct npe *npe);
31+int npe_send_message(struct npe *npe, const void *msg, const char *what);
32+int npe_recv_message(struct npe *npe, void *msg, const char *what);
33+int npe_send_recv_message(struct npe *npe, void *msg, const char *what);
34+int npe_load_firmware(struct npe *npe, const char *name, struct device *dev);
35+struct npe *npe_request(unsigned id);
36+void npe_release(struct npe *npe);
37+
38+#endif /* __IXP4XX_NPE_H */
include/linux/soc/ixp4xx/qmgr.h+91−0
@@ -0,0 +1,91 @@
1+/*
2+ * Copyright (C) 2007 Krzysztof Halasa <khc@pm.waw.pl>
3+ *
4+ * This program is free software; you can redistribute it and/or modify it
5+ * under the terms of version 2 of the GNU General Public License
6+ * as published by the Free Software Foundation.
7+ */
8+
9+#ifndef IXP4XX_QMGR_H
10+#define IXP4XX_QMGR_H
11+
12+#include <linux/io.h>
13+#include <linux/kernel.h>
14+
15+#define DEBUG_QMGR 0
16+
17+#define HALF_QUEUES 32
18+#define QUEUES 64
19+#define MAX_QUEUE_LENGTH 4 /* in dwords */
20+
21+#define QUEUE_STAT1_EMPTY 1 /* queue status bits */
22+#define QUEUE_STAT1_NEARLY_EMPTY 2
23+#define QUEUE_STAT1_NEARLY_FULL 4
24+#define QUEUE_STAT1_FULL 8
25+#define QUEUE_STAT2_UNDERFLOW 1
26+#define QUEUE_STAT2_OVERFLOW 2
27+
28+#define QUEUE_WATERMARK_0_ENTRIES 0
29+#define QUEUE_WATERMARK_1_ENTRY 1
30+#define QUEUE_WATERMARK_2_ENTRIES 2
31+#define QUEUE_WATERMARK_4_ENTRIES 3
32+#define QUEUE_WATERMARK_8_ENTRIES 4
33+#define QUEUE_WATERMARK_16_ENTRIES 5
34+#define QUEUE_WATERMARK_32_ENTRIES 6
35+#define QUEUE_WATERMARK_64_ENTRIES 7
36+
37+/* queue interrupt request conditions */
38+#define QUEUE_IRQ_SRC_EMPTY 0
39+#define QUEUE_IRQ_SRC_NEARLY_EMPTY 1
40+#define QUEUE_IRQ_SRC_NEARLY_FULL 2
41+#define QUEUE_IRQ_SRC_FULL 3
42+#define QUEUE_IRQ_SRC_NOT_EMPTY 4
43+#define QUEUE_IRQ_SRC_NOT_NEARLY_EMPTY 5
44+#define QUEUE_IRQ_SRC_NOT_NEARLY_FULL 6
45+#define QUEUE_IRQ_SRC_NOT_FULL 7
46+
47+struct qmgr_regs {
48+ u32 acc[QUEUES][MAX_QUEUE_LENGTH]; /* 0x000 - 0x3FF */
49+ u32 stat1[4]; /* 0x400 - 0x40F */
50+ u32 stat2[2]; /* 0x410 - 0x417 */
51+ u32 statne_h; /* 0x418 - queue nearly empty */
52+ u32 statf_h; /* 0x41C - queue full */
53+ u32 irqsrc[4]; /* 0x420 - 0x42F IRC source */
54+ u32 irqen[2]; /* 0x430 - 0x437 IRQ enabled */
55+ u32 irqstat[2]; /* 0x438 - 0x43F - IRQ access only */
56+ u32 reserved[1776];
57+ u32 sram[2048]; /* 0x2000 - 0x3FFF - config and buffer */
58+};
59+
60+void qmgr_put_entry(unsigned int queue, u32 val);
61+u32 qmgr_get_entry(unsigned int queue);
62+int qmgr_stat_empty(unsigned int queue);
63+int qmgr_stat_below_low_watermark(unsigned int queue);
64+int qmgr_stat_full(unsigned int queue);
65+int qmgr_stat_overflow(unsigned int queue);
66+void qmgr_release_queue(unsigned int queue);
67+void qmgr_set_irq(unsigned int queue, int src,
68+ void (*handler)(void *pdev), void *pdev);
69+void qmgr_enable_irq(unsigned int queue);
70+void qmgr_disable_irq(unsigned int queue);
71+
72+/* request_ and release_queue() must be called from non-IRQ context */
73+
74+#if DEBUG_QMGR
75+extern char qmgr_queue_descs[QUEUES][32];
76+
77+int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
78+ unsigned int nearly_empty_watermark,
79+ unsigned int nearly_full_watermark,
80+ const char *desc_format, const char* name);
81+#else
82+int __qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
83+ unsigned int nearly_empty_watermark,
84+ unsigned int nearly_full_watermark);
85+#define qmgr_request_queue(queue, len, nearly_empty_watermark, \
86+ nearly_full_watermark, desc_format, name) \
87+ __qmgr_request_queue(queue, len, nearly_empty_watermark, \
88+ nearly_full_watermark)
89+#endif
90+
91+#endif
include/linux/soc/ti/ti_sci_inta_msi.h+23−0
@@ -0,0 +1,23 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Texas Instruments' K3 TI SCI INTA MSI helper
4+ *
5+ * Copyright (C) 2018-2019 Texas Instruments Incorporated - http://www.ti.com/
6+ * Lokesh Vutla <lokeshvutla@ti.com>
7+ */
8+
9+#ifndef __INCLUDE_LINUX_TI_SCI_INTA_MSI_H
10+#define __INCLUDE_LINUX_TI_SCI_INTA_MSI_H
11+
12+#include <linux/msi.h>
13+#include <linux/soc/ti/ti_sci_protocol.h>
14+
15+struct irq_domain
16+*ti_sci_inta_msi_create_irq_domain(struct fwnode_handle *fwnode,
17+ struct msi_domain_info *info,
18+ struct irq_domain *parent);
19+int ti_sci_inta_msi_domain_alloc_irqs(struct device *dev,
20+ struct ti_sci_resource *res);
21+unsigned int ti_sci_inta_msi_get_virq(struct device *dev, u32 index);
22+void ti_sci_inta_msi_domain_free_irqs(struct device *dev);
23+#endif /* __INCLUDE_LINUX_IRQCHIP_TI_SCI_INTA_H */
include/linux/soc/ti/ti_sci_protocol.h+124−0
@@ -192,15 +192,68 @@ struct ti_sci_clk_ops { · 191 unmodified lines
192192 u64 *current_freq);
193193 };
194194
195+/**
196+ * struct ti_sci_rm_core_ops - Resource management core operations
197+ * @get_range: Get a range of resources belonging to ti sci host.
198+ * @get_rage_from_shost: Get a range of resources belonging to
199+ * specified host id.
200+ * - s_host: Host processing entity to which the
201+ * resources are allocated
202+ *
203+ * NOTE: for these functions, all the parameters are consolidated and defined
204+ * as below:
205+ * - handle: Pointer to TISCI handle as retrieved by *ti_sci_get_handle
206+ * - dev_id: TISCI device ID.
207+ * - subtype: Resource assignment subtype that is being requested
208+ * from the given device.
209+ * - range_start: Start index of the resource range
210+ * - range_end: Number of resources in the range
211+ */
212+struct ti_sci_rm_core_ops {
213+ int (*get_range)(const struct ti_sci_handle *handle, u32 dev_id,
214+ u8 subtype, u16 *range_start, u16 *range_num);
215+ int (*get_range_from_shost)(const struct ti_sci_handle *handle,
216+ u32 dev_id, u8 subtype, u8 s_host,
217+ u16 *range_start, u16 *range_num);
218+};
219+
220+/**
221+ * struct ti_sci_rm_irq_ops: IRQ management operations
222+ * @set_irq: Set an IRQ route between the requested source
223+ * and destination
224+ * @set_event_map: Set an Event based peripheral irq to Interrupt
225+ * Aggregator.
226+ * @free_irq: Free an an IRQ route between the requested source
227+ * destination.
228+ * @free_event_map: Free an event based peripheral irq to Interrupt
229+ * Aggregator.
230+ */
231+struct ti_sci_rm_irq_ops {
232+ int (*set_irq)(const struct ti_sci_handle *handle, u16 src_id,
233+ u16 src_index, u16 dst_id, u16 dst_host_irq);
234+ int (*set_event_map)(const struct ti_sci_handle *handle, u16 src_id,
235+ u16 src_index, u16 ia_id, u16 vint,
236+ u16 global_event, u8 vint_status_bit);
237+ int (*free_irq)(const struct ti_sci_handle *handle, u16 src_id,
238+ u16 src_index, u16 dst_id, u16 dst_host_irq);
239+ int (*free_event_map)(const struct ti_sci_handle *handle, u16 src_id,
240+ u16 src_index, u16 ia_id, u16 vint,
241+ u16 global_event, u8 vint_status_bit);
242+};
243+
195244 /**
196245 * struct ti_sci_ops - Function support for TI SCI
197246 * @dev_ops: Device specific operations
198247 * @clk_ops: Clock specific operations
248+ * @rm_core_ops: Resource management core operations.
249+ * @rm_irq_ops: IRQ management specific operations
199250 */
200251 struct ti_sci_ops {
201252 struct ti_sci_core_ops core_ops;
202253 struct ti_sci_dev_ops dev_ops;
203254 struct ti_sci_clk_ops clk_ops;
255+ struct ti_sci_rm_core_ops rm_core_ops;
256+ struct ti_sci_rm_irq_ops rm_irq_ops;
204257 };
205258
206259 /**
@@ -213,10 +266,47 @@ struct ti_sci_handle { · 6 unmodified lines
213266 struct ti_sci_ops ops;
214267 };
215268
269+#define TI_SCI_RESOURCE_NULL 0xffff
270+
271+/**
272+ * struct ti_sci_resource_desc - Description of TI SCI resource instance range.
273+ * @start: Start index of the resource.
274+ * @num: Number of resources.
275+ * @res_map: Bitmap to manage the allocation of these resources.
276+ */
277+struct ti_sci_resource_desc {
278+ u16 start;
279+ u16 num;
280+ unsigned long *res_map;
281+};
282+
283+/**
284+ * struct ti_sci_resource - Structure representing a resource assigned
285+ * to a device.
286+ * @sets: Number of sets available from this resource type
287+ * @lock: Lock to guard the res map in each set.
288+ * @desc: Array of resource descriptors.
289+ */
290+struct ti_sci_resource {
291+ u16 sets;
292+ raw_spinlock_t lock;
293+ struct ti_sci_resource_desc *desc;
294+};
295+
216296 #if IS_ENABLED(CONFIG_TI_SCI_PROTOCOL)
217297 const struct ti_sci_handle *ti_sci_get_handle(struct device *dev);
218298 int ti_sci_put_handle(const struct ti_sci_handle *handle);
219299 const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev);
300+const struct ti_sci_handle *ti_sci_get_by_phandle(struct device_node *np,
301+ const char *property);
302+const struct ti_sci_handle *devm_ti_sci_get_by_phandle(struct device *dev,
303+ const char *property);
304+u16 ti_sci_get_free_resource(struct ti_sci_resource *res);
305+void ti_sci_release_resource(struct ti_sci_resource *res, u16 id);
306+u32 ti_sci_get_num_resources(struct ti_sci_resource *res);
307+struct ti_sci_resource *
308+devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
309+ struct device *dev, u32 dev_id, char *of_prop);
220310
221311 #else /* CONFIG_TI_SCI_PROTOCOL */
222312
@@ -236,6 +326,40 @@ const struct ti_sci_handle *devm_ti_sci_get_handle(struct device *dev) · 13 unmodified lines
236326 return ERR_PTR(-EINVAL);
237327 }
238328
329+static inline
330+const struct ti_sci_handle *ti_sci_get_by_phandle(struct device_node *np,
331+ const char *property)
332+{
333+ return ERR_PTR(-EINVAL);
334+}
335+
336+static inline
337+const struct ti_sci_handle *devm_ti_sci_get_by_phandle(struct device *dev,
338+ const char *property)
339+{
340+ return ERR_PTR(-EINVAL);
341+}
342+
343+static inline u16 ti_sci_get_free_resource(struct ti_sci_resource *res)
344+{
345+ return TI_SCI_RESOURCE_NULL;
346+}
347+
348+static inline void ti_sci_release_resource(struct ti_sci_resource *res, u16 id)
349+{
350+}
351+
352+static inline u32 ti_sci_get_num_resources(struct ti_sci_resource *res)
353+{
354+ return 0;
355+}
356+
357+static inline struct ti_sci_resource *
358+devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
359+ struct device *dev, u32 dev_id, char *of_prop)
360+{
361+ return ERR_PTR(-EINVAL);
362+}
239363 #endif /* CONFIG_TI_SCI_PROTOCOL */
240364
241365 #endif /* __TISCI_PROTOCOL_H */
include/linux/soundwire/sdw.h+8−8
@@ -1,5 +1,5 @@
1−// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2−// Copyright(c) 2015-17 Intel Corporation.
1+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2+/* Copyright(c) 2015-17 Intel Corporation. */
33
44 #ifndef __SOUNDWIRE_H
55 #define __SOUNDWIRE_H
@@ -36,7 +36,7 @@ struct sdw_slave; · 30 unmodified lines
3636 #define SDW_FRAME_CTRL_BITS 48
3737 #define SDW_MAX_DEVICES 11
3838
39−#define SDW_VALID_PORT_RANGE(n) (n <= 14 && n >= 1)
39+#define SDW_VALID_PORT_RANGE(n) ((n) <= 14 && (n) >= 1)
4040
4141 #define SDW_DAI_ID_RANGE_START 100
4242 #define SDW_DAI_ID_RANGE_END 200
@@ -470,14 +470,14 @@ struct sdw_bus_params { · 427 unmodified lines
470470 struct sdw_slave_ops {
471471 int (*read_prop)(struct sdw_slave *sdw);
472472 int (*interrupt_callback)(struct sdw_slave *slave,
473− struct sdw_slave_intr_status *status);
473+ struct sdw_slave_intr_status *status);
474474 int (*update_status)(struct sdw_slave *slave,
475− enum sdw_slave_status status);
475+ enum sdw_slave_status status);
476476 int (*bus_config)(struct sdw_slave *slave,
477− struct sdw_bus_params *params);
477+ struct sdw_bus_params *params);
478478 int (*port_prep)(struct sdw_slave *slave,
479− struct sdw_prepare_ch *prepare_ch,
480− enum sdw_port_prep_ops pre_ops);
479+ struct sdw_prepare_ch *prepare_ch,
480+ enum sdw_port_prep_ops pre_ops);
481481 };
482482
483483 /**
include/linux/soundwire/sdw_intel.h+3−3
@@ -1,5 +1,5 @@
1−// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2−// Copyright(c) 2015-17 Intel Corporation.
1+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2+/* Copyright(c) 2015-17 Intel Corporation. */
33
44 #ifndef __SDW_INTEL_H
55 #define __SDW_INTEL_H
@@ -11,7 +11,7 @@ · 5 unmodified lines
1111 */
1212 struct sdw_intel_ops {
1313 int (*config_stream)(void *arg, void *substream,
14− void *dai, void *hw_params, int stream_num);
14+ void *dai, void *hw_params, int stream_num);
1515 };
1616
1717 /**
include/linux/soundwire/sdw_registers.h+2−3
@@ -1,5 +1,5 @@
1−// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2−// Copyright(c) 2015-17 Intel Corporation.
1+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2+/* Copyright(c) 2015-17 Intel Corporation. */
33
44 #ifndef __SDW_REGISTERS_H
55 #define __SDW_REGISTERS_H
@@ -73,7 +73,6 @@ · 67 unmodified lines
7373 #define SDW_SCP_INTSTAT2_SCP3_CASCADE BIT(7)
7474 #define SDW_SCP_INTSTAT2_PORT4_10 GENMASK(6, 0)
7575
76−
7776 #define SDW_SCP_INTSTAT3 0x43
7877 #define SDW_SCP_INTSTAT3_PORT11_14 GENMASK(3, 0)
7978
include/linux/soundwire/sdw_type.h+3−3
@@ -1,5 +1,5 @@
1−// SPDX-License-Identifier: GPL-2.0
2−// Copyright(c) 2015-17 Intel Corporation.
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/* Copyright(c) 2015-17 Intel Corporation. */
33
44 #ifndef __SOUNDWIRE_TYPES_H
55 #define __SOUNDWIRE_TYPES_H
@@ -11,7 +11,7 @@ extern struct bus_type sdw_bus_type; · 5 unmodified lines
1111 #define sdw_register_driver(drv) \
1212 __sdw_register_driver(drv, THIS_MODULE)
1313
14−int __sdw_register_driver(struct sdw_driver *drv, struct module *);
14+int __sdw_register_driver(struct sdw_driver *drv, struct module *owner);
1515 void sdw_unregister_driver(struct sdw_driver *drv);
1616
1717 int sdw_slave_modalias(const struct sdw_slave *slave, char *buf, size_t size);
include/linux/spi/pxa2xx_spi.h+1−0
@@ -25,6 +25,7 @@ struct dma_chan; · 24 unmodified lines
2525 struct pxa2xx_spi_controller {
2626 u16 num_chipselect;
2727 u8 enable_dma;
28+ u8 dma_burst_size;
2829 bool is_slave;
2930
3031 /* DMA engine specific config */
include/linux/spi/spi-mem.h+12−0
@@ -295,6 +295,10 @@ int spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr, · 294 unmodified lines
295295 void spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr,
296296 const struct spi_mem_op *op,
297297 struct sg_table *sg);
298+
299+bool spi_mem_default_supports_op(struct spi_mem *mem,
300+ const struct spi_mem_op *op);
301+
298302 #else
299303 static inline int
300304 spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr,
@@ -310,6 +314,14 @@ spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr, · 9 unmodified lines
310314 struct sg_table *sg)
311315 {
312316 }
317+
318+static inline
319+bool spi_mem_default_supports_op(struct spi_mem *mem,
320+ const struct spi_mem_op *op)
321+{
322+ return false;
323+}
324+
313325 #endif /* CONFIG_SPI_MEM */
314326
315327 int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op);
include/linux/spi/spi.h+19−5
@@ -143,7 +143,7 @@ struct spi_device { · 142 unmodified lines
143143 u32 max_speed_hz;
144144 u8 chip_select;
145145 u8 bits_per_word;
146− u16 mode;
146+ u32 mode;
147147 #define SPI_CPHA 0x01 /* clock phase */
148148 #define SPI_CPOL 0x02 /* clock polarity */
149149 #define SPI_MODE_0 (0|0) /* (original MicroWire) */
@@ -330,6 +330,9 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) · 180 unmodified lines
330330 * must fail if an unrecognized or unsupported mode is requested.
331331 * It's always safe to call this unless transfers are pending on
332332 * the device whose settings are being modified.
333+ * @set_cs_timing: optional hook for SPI devices to request SPI master
334+ * controller for configuring specific CS setup time, hold time and inactive
335+ * delay interms of clock counts
333336 * @transfer: adds a message to the controller's transfer queue.
334337 * @cleanup: frees controller-specific state
335338 * @can_dma: determine whether this controller supports DMA
@@ -363,6 +366,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) · 27 unmodified lines
363366 * @unprepare_transfer_hardware: there are currently no more messages on the
364367 * queue so the subsystem notifies the driver that it may relax the
365368 * hardware by issuing this call
369+ *
366370 * @set_cs: set the logic level of the chip select line. May be called
367371 * from interrupt context.
368372 * @prepare_message: set up the controller to transfer a single message,
@@ -439,13 +443,12 @@ struct spi_controller { · 70 unmodified lines
439443 u16 dma_alignment;
440444
441445 /* spi_device.mode flags understood by this controller driver */
442− u16 mode_bits;
446+ u32 mode_bits;
443447
444448 /* bitmask of supported bits_per_word for transfers */
445449 u32 bits_per_word_mask;
446450 #define SPI_BPW_MASK(bits) BIT((bits) - 1)
447−#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0U : (BIT(bits) - 1))
448−#define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1))
451+#define SPI_BPW_RANGE_MASK(min, max) GENMASK((max) - 1, (min) - 1)
449452
450453 /* limits on transfer speed */
451454 u32 min_speed_hz;
@@ -489,6 +492,17 @@ struct spi_controller { · 37 unmodified lines
489492 */
490493 int (*setup)(struct spi_device *spi);
491494
495+ /*
496+ * set_cs_timing() method is for SPI controllers that supports
497+ * configuring CS timing.
498+ *
499+ * This hook allows SPI client drivers to request SPI controllers
500+ * to configure specific CS timing through spi_set_cs_timing() after
501+ * spi_setup().
502+ */
503+ void (*set_cs_timing)(struct spi_device *spi, u8 setup_clk_cycles,
504+ u8 hold_clk_cycles, u8 inactive_clk_cycles);
505+
492506 /* bidirectional bulk transfers
493507 *
494508 * + The transfer() method may not sleep; its main role is
@@ -1277,7 +1291,7 @@ struct spi_board_info { · 782 unmodified lines
12771291 /* mode becomes spi_device.mode, and is essential for chips
12781292 * where the default of SPI_CS_HIGH = 0 is wrong.
12791293 */
1280− u16 mode;
1294+ u32 mode;
12811295
12821296 /* ... may need additional spi_device chip config data here.
12831297 * avoid stuff protocol drivers can set; but include stuff
include/linux/spi/spi_bitbang.h+1−0
@@ -44,6 +44,7 @@ extern int spi_bitbang_setup_transfer(struct spi_device *spi, · 43 unmodified lines
4444
4545 /* start or stop queue processing */
4646 extern int spi_bitbang_start(struct spi_bitbang *spi);
47+extern int spi_bitbang_init(struct spi_bitbang *spi);
4748 extern void spi_bitbang_stop(struct spi_bitbang *spi);
4849
4950 #endif /* __SPI_BITBANG_H */
include/linux/spinlock.h+10−1
@@ -57,6 +57,7 @@ · 56 unmodified lines
5757 #include <linux/stringify.h>
5858 #include <linux/bottom_half.h>
5959 #include <asm/barrier.h>
60+#include <asm/mmiowb.h>
6061
6162
6263 /*
@@ -178,6 +179,7 @@ static inline void do_raw_spin_lock(raw_spinlock_t *lock) __acquires(lock) · 115 unmodified lines
178179 {
179180 __acquire(lock);
180181 arch_spin_lock(&lock->raw_lock);
182+ mmiowb_spin_lock();
181183 }
182184
183185 #ifndef arch_spin_lock_flags
@@ -189,15 +191,22 @@ do_raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long *flags) __acquires(lo · 5 unmodified lines
189191 {
190192 __acquire(lock);
191193 arch_spin_lock_flags(&lock->raw_lock, *flags);
194+ mmiowb_spin_lock();
192195 }
193196
194197 static inline int do_raw_spin_trylock(raw_spinlock_t *lock)
195198 {
196− return arch_spin_trylock(&(lock)->raw_lock);
199+ int ret = arch_spin_trylock(&(lock)->raw_lock);
200+
201+ if (ret)
202+ mmiowb_spin_lock();
203+
204+ return ret;
197205 }
198206
199207 static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock)
200208 {
209+ mmiowb_spin_unlock();
201210 arch_spin_unlock(&lock->raw_lock);
202211 __release(lock);
203212 }
include/linux/srcu.h+1−35
@@ -56,45 +56,11 @@ struct srcu_struct { }; · 55 unmodified lines
5656
5757 void call_srcu(struct srcu_struct *ssp, struct rcu_head *head,
5858 void (*func)(struct rcu_head *head));
59−void _cleanup_srcu_struct(struct srcu_struct *ssp, bool quiesced);
59+void cleanup_srcu_struct(struct srcu_struct *ssp);
6060 int __srcu_read_lock(struct srcu_struct *ssp) __acquires(ssp);
6161 void __srcu_read_unlock(struct srcu_struct *ssp, int idx) __releases(ssp);
6262 void synchronize_srcu(struct srcu_struct *ssp);
6363
64−/**
65− * cleanup_srcu_struct - deconstruct a sleep-RCU structure
66− * @ssp: structure to clean up.
67− *
68− * Must invoke this after you are finished using a given srcu_struct that
69− * was initialized via init_srcu_struct(), else you leak memory.
70− */
71−static inline void cleanup_srcu_struct(struct srcu_struct *ssp)
72−{
73− _cleanup_srcu_struct(ssp, false);
74−}
75−
76−/**
77− * cleanup_srcu_struct_quiesced - deconstruct a quiesced sleep-RCU structure
78− * @ssp: structure to clean up.
79− *
80− * Must invoke this after you are finished using a given srcu_struct that
81− * was initialized via init_srcu_struct(), else you leak memory. Also,
82− * all grace-period processing must have completed.
83− *
84− * "Completed" means that the last synchronize_srcu() and
85− * synchronize_srcu_expedited() calls must have returned before the call
86− * to cleanup_srcu_struct_quiesced(). It also means that the callback
87− * from the last call_srcu() must have been invoked before the call to
88− * cleanup_srcu_struct_quiesced(), but you can use srcu_barrier() to help
89− * with this last. Violating these rules will get you a WARN_ON() splat
90− * (with high probability, anyway), and will also cause the srcu_struct
91− * to be leaked.
92− */
93−static inline void cleanup_srcu_struct_quiesced(struct srcu_struct *ssp)
94−{
95− _cleanup_srcu_struct(ssp, true);
96−}
97−
9864 #ifdef CONFIG_DEBUG_LOCK_ALLOC
9965
10066 /**
include/linux/stackdepot.h+4−4
@@ -23,10 +23,10 @@ · 22 unmodified lines
2323
2424 typedef u32 depot_stack_handle_t;
2525
26−struct stack_trace;
26+depot_stack_handle_t stack_depot_save(unsigned long *entries,
27+ unsigned int nr_entries, gfp_t gfp_flags);
2728
28−depot_stack_handle_t depot_save_stack(struct stack_trace *trace, gfp_t flags);
29−
30−void depot_fetch_stack(depot_stack_handle_t handle, struct stack_trace *trace);
29+unsigned int stack_depot_fetch(depot_stack_handle_t handle,
30+ unsigned long **entries);
3131
3232 #endif
include/linux/stacktrace.h+65−16
@@ -3,11 +3,64 @@ · 2 unmodified lines
33 #define __LINUX_STACKTRACE_H
44
55 #include <linux/types.h>
6+#include <asm/errno.h>
67
78 struct task_struct;
89 struct pt_regs;
910
1011 #ifdef CONFIG_STACKTRACE
12+void stack_trace_print(unsigned long *trace, unsigned int nr_entries,
13+ int spaces);
14+int stack_trace_snprint(char *buf, size_t size, unsigned long *entries,
15+ unsigned int nr_entries, int spaces);
16+unsigned int stack_trace_save(unsigned long *store, unsigned int size,
17+ unsigned int skipnr);
18+unsigned int stack_trace_save_tsk(struct task_struct *task,
19+ unsigned long *store, unsigned int size,
20+ unsigned int skipnr);
21+unsigned int stack_trace_save_regs(struct pt_regs *regs, unsigned long *store,
22+ unsigned int size, unsigned int skipnr);
23+unsigned int stack_trace_save_user(unsigned long *store, unsigned int size);
24+
25+/* Internal interfaces. Do not use in generic code */
26+#ifdef CONFIG_ARCH_STACKWALK
27+
28+/**
29+ * stack_trace_consume_fn - Callback for arch_stack_walk()
30+ * @cookie: Caller supplied pointer handed back by arch_stack_walk()
31+ * @addr: The stack entry address to consume
32+ * @reliable: True when the stack entry is reliable. Required by
33+ * some printk based consumers.
34+ *
35+ * Return: True, if the entry was consumed or skipped
36+ * False, if there is no space left to store
37+ */
38+typedef bool (*stack_trace_consume_fn)(void *cookie, unsigned long addr,
39+ bool reliable);
40+/**
41+ * arch_stack_walk - Architecture specific function to walk the stack
42+ * @consume_entry: Callback which is invoked by the architecture code for
43+ * each entry.
44+ * @cookie: Caller supplied pointer which is handed back to
45+ * @consume_entry
46+ * @task: Pointer to a task struct, can be NULL
47+ * @regs: Pointer to registers, can be NULL
48+ *
49+ * ============ ======= ============================================
50+ * task regs
51+ * ============ ======= ============================================
52+ * task NULL Stack trace from task (can be current)
53+ * current regs Stack trace starting on regs->stackpointer
54+ * ============ ======= ============================================
55+ */
56+void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie,
57+ struct task_struct *task, struct pt_regs *regs);
58+int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry, void *cookie,
59+ struct task_struct *task);
60+void arch_stack_walk_user(stack_trace_consume_fn consume_entry, void *cookie,
61+ const struct pt_regs *regs);
62+
63+#else /* CONFIG_ARCH_STACKWALK */
1164 struct stack_trace {
1265 unsigned int nr_entries, max_entries;
1366 unsigned long *entries;
@@ -21,24 +74,20 @@ extern void save_stack_trace_tsk(struct task_struct *tsk, · 7 unmodified lines
2174 struct stack_trace *trace);
2275 extern int save_stack_trace_tsk_reliable(struct task_struct *tsk,
2376 struct stack_trace *trace);
24−
25−extern void print_stack_trace(struct stack_trace *trace, int spaces);
26−extern int snprint_stack_trace(char *buf, size_t size,
27− struct stack_trace *trace, int spaces);
28−
29−#ifdef CONFIG_USER_STACKTRACE_SUPPORT
3077 extern void save_stack_trace_user(struct stack_trace *trace);
78+#endif /* !CONFIG_ARCH_STACKWALK */
79+#endif /* CONFIG_STACKTRACE */
80+
81+#if defined(CONFIG_STACKTRACE) && defined(CONFIG_HAVE_RELIABLE_STACKTRACE)
82+int stack_trace_save_tsk_reliable(struct task_struct *tsk, unsigned long *store,
83+ unsigned int size);
3184 #else
32−# define save_stack_trace_user(trace) do { } while (0)
85+static inline int stack_trace_save_tsk_reliable(struct task_struct *tsk,
86+ unsigned long *store,
87+ unsigned int size)
88+{
89+ return -ENOSYS;
90+}
3391 #endif
3492
35−#else /* !CONFIG_STACKTRACE */
36−# define save_stack_trace(trace) do { } while (0)
37−# define save_stack_trace_tsk(tsk, trace) do { } while (0)
38−# define save_stack_trace_user(trace) do { } while (0)
39−# define print_stack_trace(trace, spaces) do { } while (0)
40−# define snprint_stack_trace(buf, size, trace, spaces) do { } while (0)
41−# define save_stack_trace_tsk_reliable(tsk, trace) ({ -ENOSYS; })
42−#endif /* CONFIG_STACKTRACE */
43−
4493 #endif /* __LINUX_STACKTRACE_H */
include/linux/string.h+4−0
@@ -31,6 +31,10 @@ size_t strlcpy(char *, const char *, size_t); · 30 unmodified lines
3131 #ifndef __HAVE_ARCH_STRSCPY
3232 ssize_t strscpy(char *, const char *, size_t);
3333 #endif
34+
35+/* Wraps calls to strscpy()/memset(), no arch specific code required */
36+ssize_t strscpy_pad(char *dest, const char *src, size_t count);
37+
3438 #ifndef __HAVE_ARCH_STRCAT
3539 extern char * strcat(char *, const char *);
3640 #endif
include/linux/sunrpc/clnt.h+4−0
@@ -50,6 +50,7 @@ struct rpc_clnt { · 49 unmodified lines
5050 struct rpc_iostats * cl_metrics; /* per-client statistics */
5151
5252 unsigned int cl_softrtry : 1,/* soft timeouts */
53+ cl_softerr : 1,/* Timeouts return errors */
5354 cl_discrtry : 1,/* disconnect before retry */
5455 cl_noretranstimeo: 1,/* No retransmit timeouts */
5556 cl_autobind : 1,/* use getport() */
@@ -71,6 +72,7 @@ struct rpc_clnt { · 15 unmodified lines
7172 struct dentry *cl_debugfs; /* debugfs directory */
7273 #endif
7374 struct rpc_xprt_iter cl_xpi;
75+ const struct cred *cl_cred;
7476 };
7577
7678 /*
@@ -125,6 +127,7 @@ struct rpc_create_args { · 48 unmodified lines
125127 unsigned long flags;
126128 char *client_name;
127129 struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */
130+ const struct cred *cred;
128131 };
129132
130133 struct rpc_add_xprt_test {
@@ -144,6 +147,7 @@ struct rpc_add_xprt_test { · 13 unmodified lines
144147 #define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7)
145148 #define RPC_CLNT_CREATE_NO_IDLE_TIMEOUT (1UL << 8)
146149 #define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9)
150+#define RPC_CLNT_CREATE_SOFTERR (1UL << 10)
147151
148152 struct rpc_clnt *rpc_create(struct rpc_create_args *args);
149153 struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
include/linux/sunrpc/sched.h+15−5
@@ -35,7 +35,6 @@ struct rpc_wait { · 34 unmodified lines
3535 struct list_head list; /* wait queue links */
3636 struct list_head links; /* Links to related tasks */
3737 struct list_head timer_list; /* Timer list */
38− unsigned long expires;
3938 };
4039
4140 /*
@@ -62,6 +61,8 @@ struct rpc_task { · 20 unmodified lines
6261 struct rpc_wait tk_wait; /* RPC wait */
6362 } u;
6463
64+ int tk_rpc_status; /* Result of last RPC operation */
65+
6566 /*
6667 * RPC call state
6768 */
@@ -125,7 +126,6 @@ struct rpc_task_setup { · 57 unmodified lines
125126 #define RPC_CALL_MAJORSEEN 0x0020 /* major timeout seen */
126127 #define RPC_TASK_ROOTCREDS 0x0040 /* force root creds */
127128 #define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */
128−#define RPC_TASK_KILLED 0x0100 /* task was killed */
129129 #define RPC_TASK_SOFT 0x0200 /* Use soft timeouts */
130130 #define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */
131131 #define RPC_TASK_SENT 0x0800 /* message was sent */
@@ -135,7 +135,6 @@ struct rpc_task_setup { · 3 unmodified lines
135135
136136 #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC)
137137 #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
138−#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED)
139138 #define RPC_IS_SOFT(t) ((t)->tk_flags & (RPC_TASK_SOFT|RPC_TASK_TIMEOUT))
140139 #define RPC_IS_SOFTCONN(t) ((t)->tk_flags & RPC_TASK_SOFTCONN)
141140 #define RPC_WAS_SENT(t) ((t)->tk_flags & RPC_TASK_SENT)
@@ -146,6 +145,7 @@ struct rpc_task_setup { · 4 unmodified lines
146145 #define RPC_TASK_NEED_XMIT 3
147146 #define RPC_TASK_NEED_RECV 4
148147 #define RPC_TASK_MSG_PIN_WAIT 5
148+#define RPC_TASK_SIGNALLED 6
149149
150150 #define RPC_IS_RUNNING(t) test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
151151 #define rpc_set_running(t) set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)
@@ -169,6 +169,8 @@ struct rpc_task_setup { · 17 unmodified lines
169169
170170 #define RPC_IS_ACTIVATED(t) test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate)
171171
172+#define RPC_SIGNALLED(t) test_bit(RPC_TASK_SIGNALLED, &(t)->tk_runstate)
173+
172174 /*
173175 * Task priorities.
174176 * Note: if you change these, you must also change
@@ -183,7 +185,6 @@ struct rpc_task_setup { · 8 unmodified lines
183185 struct rpc_timer {
184186 struct timer_list timer;
185187 struct list_head list;
186− unsigned long expires;
187188 };
188189
189190 /*
@@ -217,6 +218,7 @@ struct rpc_task *rpc_run_task(const struct rpc_task_setup *); · 27 unmodified lines
217218 struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req);
218219 void rpc_put_task(struct rpc_task *);
219220 void rpc_put_task_async(struct rpc_task *);
221+void rpc_signal_task(struct rpc_task *);
220222 void rpc_exit_task(struct rpc_task *);
221223 void rpc_exit(struct rpc_task *, int);
222224 void rpc_release_calldata(const struct rpc_call_ops *, void *);
@@ -225,11 +227,19 @@ void rpc_execute(struct rpc_task *); · 2 unmodified lines
225227 void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *);
226228 void rpc_init_wait_queue(struct rpc_wait_queue *, const char *);
227229 void rpc_destroy_wait_queue(struct rpc_wait_queue *);
230+unsigned long rpc_task_timeout(const struct rpc_task *task);
231+void rpc_sleep_on_timeout(struct rpc_wait_queue *queue,
232+ struct rpc_task *task,
233+ rpc_action action,
234+ unsigned long timeout);
228235 void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *,
229236 rpc_action action);
237+void rpc_sleep_on_priority_timeout(struct rpc_wait_queue *queue,
238+ struct rpc_task *task,
239+ unsigned long timeout,
240+ int priority);
230241 void rpc_sleep_on_priority(struct rpc_wait_queue *,
231242 struct rpc_task *,
232− rpc_action action,
233243 int priority);
234244 void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq,
235245 struct rpc_wait_queue *queue,
include/linux/sunrpc/svc.h+33−0
@@ -271,6 +271,7 @@ struct svc_rqst { · 270 unmodified lines
271271 #define RQ_VICTIM (5) /* about to be shut down */
272272 #define RQ_BUSY (6) /* request is busy */
273273 #define RQ_DATA (7) /* request has data */
274+#define RQ_AUTHERR (8) /* Request status is auth error */
274275 unsigned long rq_flags; /* flags field */
275276 ktime_t rq_qtime; /* enqueue time */
276277
@@ -382,6 +383,16 @@ struct svc_deferred_req { · 105 unmodified lines
382383 __be32 args[0];
383384 };
384385
386+struct svc_process_info {
387+ union {
388+ int (*dispatch)(struct svc_rqst *, __be32 *);
389+ struct {
390+ unsigned int lovers;
391+ unsigned int hivers;
392+ } mismatch;
393+ };
394+};
395+
385396 /*
386397 * List of RPC programs on the same transport endpoint
387398 */
@@ -396,6 +407,14 @@ struct svc_program { · 8 unmodified lines
396407 char * pg_class; /* class name: services sharing authentication */
397408 struct svc_stat * pg_stats; /* rpc statistics */
398409 int (*pg_authenticate)(struct svc_rqst *);
410+ __be32 (*pg_init_request)(struct svc_rqst *,
411+ const struct svc_program *,
412+ struct svc_process_info *);
413+ int (*pg_rpcbind_set)(struct net *net,
414+ const struct svc_program *,
415+ u32 version, int family,
416+ unsigned short proto,
417+ unsigned short port);
399418 };
400419
401420 /*
@@ -504,6 +523,20 @@ unsigned int svc_fill_write_vector(struct svc_rqst *rqstp, · 102 unmodified lines
504523 char *svc_fill_symlink_pathname(struct svc_rqst *rqstp,
505524 struct kvec *first, void *p,
506525 size_t total);
526+__be32 svc_return_autherr(struct svc_rqst *rqstp, __be32 auth_err);
527+__be32 svc_generic_init_request(struct svc_rqst *rqstp,
528+ const struct svc_program *progp,
529+ struct svc_process_info *procinfo);
530+int svc_generic_rpcbind_set(struct net *net,
531+ const struct svc_program *progp,
532+ u32 version, int family,
533+ unsigned short proto,
534+ unsigned short port);
535+int svc_rpcbind_set_version(struct net *net,
536+ const struct svc_program *progp,
537+ u32 version, int family,
538+ unsigned short proto,
539+ unsigned short port);
507540
508541 #define RPC_MAX_ADDRBUFLEN (63U)
509542
include/linux/sunrpc/svc_xprt.h+3−1
@@ -86,6 +86,7 @@ struct svc_xprt { · 85 unmodified lines
8686 struct list_head xpt_users; /* callbacks on free */
8787
8888 struct net *xpt_net;
89+ const struct cred *xpt_cred;
8990 struct rpc_xprt *xpt_bc_xprt; /* NFSv4.1 backchannel */
9091 struct rpc_xprt_switch *xpt_bc_xps; /* NFSv4.1 backchannel */
9192 };
@@ -119,7 +120,8 @@ void svc_unreg_xprt_class(struct svc_xprt_class *); · 27 unmodified lines
119120 void svc_xprt_init(struct net *, struct svc_xprt_class *, struct svc_xprt *,
120121 struct svc_serv *);
121122 int svc_create_xprt(struct svc_serv *, const char *, struct net *,
122− const int, const unsigned short, int);
123+ const int, const unsigned short, int,
124+ const struct cred *);
123125 void svc_xprt_do_enqueue(struct svc_xprt *xprt);
124126 void svc_xprt_enqueue(struct svc_xprt *xprt);
125127 void svc_xprt_put(struct svc_xprt *xprt);
include/linux/sunrpc/svcsock.h+2−1
@@ -59,7 +59,8 @@ void svc_drop(struct svc_rqst *); · 58 unmodified lines
5959 void svc_sock_update_bufs(struct svc_serv *serv);
6060 bool svc_alien_sock(struct net *net, int fd);
6161 int svc_addsock(struct svc_serv *serv, const int fd,
62− char *name_return, const size_t len);
62+ char *name_return, const size_t len,
63+ const struct cred *cred);
6364 void svc_init_xprt_sock(void);
6465 void svc_cleanup_xprt_sock(void);
6566 struct svc_xprt *svc_sock_create(struct svc_serv *serv, int prot);
include/linux/sunrpc/xprt.h+3−3
@@ -143,7 +143,7 @@ struct rpc_xprt_ops { · 142 unmodified lines
143143 void (*buf_free)(struct rpc_task *task);
144144 void (*prepare_request)(struct rpc_rqst *req);
145145 int (*send_request)(struct rpc_rqst *req);
146− void (*set_retrans_timeout)(struct rpc_task *task);
146+ void (*wait_for_reply_request)(struct rpc_task *task);
147147 void (*timer)(struct rpc_xprt *xprt, struct rpc_task *task);
148148 void (*release_request)(struct rpc_task *task);
149149 void (*close)(struct rpc_xprt *xprt);
@@ -378,8 +378,8 @@ xprt_disable_swap(struct rpc_xprt *xprt) · 228 unmodified lines
378378 int xprt_register_transport(struct xprt_class *type);
379379 int xprt_unregister_transport(struct xprt_class *type);
380380 int xprt_load_transport(const char *);
381−void xprt_set_retrans_timeout_def(struct rpc_task *task);
382−void xprt_set_retrans_timeout_rtt(struct rpc_task *task);
381+void xprt_wait_for_reply_request_def(struct rpc_task *task);
382+void xprt_wait_for_reply_request_rtt(struct rpc_task *task);
383383 void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status);
384384 void xprt_wait_for_buffer_space(struct rpc_xprt *xprt);
385385 bool xprt_write_space(struct rpc_xprt *xprt);
include/linux/suspend.h+3−0
@@ -425,6 +425,7 @@ void restore_processor_state(void); · 424 unmodified lines
425425 /* kernel/power/main.c */
426426 extern int register_pm_notifier(struct notifier_block *nb);
427427 extern int unregister_pm_notifier(struct notifier_block *nb);
428+extern void ksys_sync_helper(void);
428429
429430 #define pm_notifier(fn, pri) { \
430431 static struct notifier_block fn##_nb = \
@@ -462,6 +463,8 @@ static inline int unregister_pm_notifier(struct notifier_block *nb) · 31 unmodified lines
462463 return 0;
463464 }
464465
466+static inline void ksys_sync_helper(void) {}
467+
465468 #define pm_notifier(fn, pri) do { (void)(fn); } while (0)
466469
467470 static inline bool pm_wakeup_pending(void) { return false; }
include/linux/switchtec.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 #include <linux/cdev.h>
2121
2222 #define SWITCHTEC_MRPC_PAYLOAD_SIZE 1024
23−#define SWITCHTEC_MAX_PFF_CSR 48
23+#define SWITCHTEC_MAX_PFF_CSR 255
2424
2525 #define SWITCHTEC_EVENT_OCCURRED BIT(0)
2626 #define SWITCHTEC_EVENT_CLEAR BIT(0)
include/linux/syscalls.h+9−0
@@ -985,6 +985,15 @@ asmlinkage long sys_statx(int dfd, const char __user *path, unsigned flags, · 984 unmodified lines
985985 unsigned mask, struct statx __user *buffer);
986986 asmlinkage long sys_rseq(struct rseq __user *rseq, uint32_t rseq_len,
987987 int flags, uint32_t sig);
988+asmlinkage long sys_open_tree(int dfd, const char __user *path, unsigned flags);
989+asmlinkage long sys_move_mount(int from_dfd, const char __user *from_path,
990+ int to_dfd, const char __user *to_path,
991+ unsigned int ms_flags);
992+asmlinkage long sys_fsopen(const char __user *fs_name, unsigned int flags);
993+asmlinkage long sys_fsconfig(int fs_fd, unsigned int cmd, const char __user *key,
994+ const void __user *value, int aux);
995+asmlinkage long sys_fsmount(int fs_fd, unsigned int flags, unsigned int ms_flags);
996+asmlinkage long sys_fspick(int dfd, const char __user *path, unsigned int flags);
988997 asmlinkage long sys_pidfd_send_signal(int pidfd, int sig,
989998 siginfo_t __user *info,
990999 unsigned int flags);
include/linux/thermal.h+16−3
@@ -442,11 +442,16 @@ void thermal_zone_device_update(struct thermal_zone_device *, · 441 unmodified lines
442442 enum thermal_notify_event);
443443 void thermal_zone_set_trips(struct thermal_zone_device *);
444444
445−struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
446− const struct thermal_cooling_device_ops *);
445+struct thermal_cooling_device *thermal_cooling_device_register(const char *,
446+ void *, const struct thermal_cooling_device_ops *);
447447 struct thermal_cooling_device *
448−thermal_of_cooling_device_register(struct device_node *np, char *, void *,
448+thermal_of_cooling_device_register(struct device_node *np, const char *, void *,
449449 const struct thermal_cooling_device_ops *);
450+struct thermal_cooling_device *
451+devm_thermal_of_cooling_device_register(struct device *dev,
452+ struct device_node *np,
453+ char *type, void *devdata,
454+ const struct thermal_cooling_device_ops *ops);
450455 void thermal_cooling_device_unregister(struct thermal_cooling_device *);
451456 struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name);
452457 int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
@@ -503,6 +508,14 @@ static inline struct thermal_cooling_device * · 50 unmodified lines
503508 thermal_of_cooling_device_register(struct device_node *np,
504509 char *type, void *devdata, const struct thermal_cooling_device_ops *ops)
505510 { return ERR_PTR(-ENODEV); }
511+static inline struct thermal_cooling_device *
512+devm_thermal_of_cooling_device_register(struct device *dev,
513+ struct device_node *np,
514+ char *type, void *devdata,
515+ const struct thermal_cooling_device_ops *ops)
516+{
517+ return ERR_PTR(-ENODEV);
518+}
506519 static inline void thermal_cooling_device_unregister(
507520 struct thermal_cooling_device *cdev)
508521 { }
include/linux/thunderbolt.h+8−0
@@ -181,6 +181,8 @@ void tb_unregister_property_dir(const char *key, struct tb_property_dir *dir); · 180 unmodified lines
181181 * @device_name: Name of the device (or %NULL if not known)
182182 * @is_unplugged: The XDomain is unplugged
183183 * @resume: The XDomain is being resumed
184+ * @needs_uuid: If the XDomain does not have @remote_uuid it will be
185+ * queried first
184186 * @transmit_path: HopID which the remote end expects us to transmit
185187 * @transmit_ring: Local ring (hop) where outgoing packets are pushed
186188 * @receive_path: HopID which we expect the remote end to transmit
@@ -189,6 +191,9 @@ void tb_unregister_property_dir(const char *key, struct tb_property_dir *dir); · 2 unmodified lines
189191 * @properties: Properties exported by the remote domain
190192 * @property_block_gen: Generation of @properties
191193 * @properties_lock: Lock protecting @properties.
194+ * @get_uuid_work: Work used to retrieve @remote_uuid
195+ * @uuid_retries: Number of times left @remote_uuid is requested before
196+ * giving up
192197 * @get_properties_work: Work used to get remote domain properties
193198 * @properties_retries: Number of times left to read properties
194199 * @properties_changed_work: Work used to notify the remote domain that
@@ -220,6 +225,7 @@ struct tb_xdomain { · 25 unmodified lines
220225 const char *device_name;
221226 bool is_unplugged;
222227 bool resume;
228+ bool needs_uuid;
223229 u16 transmit_path;
224230 u16 transmit_ring;
225231 u16 receive_path;
@@ -227,6 +233,8 @@ struct tb_xdomain { · 1 unmodified line
227233 struct ida service_ids;
228234 struct tb_property_dir *properties;
229235 u32 property_block_gen;
236+ struct delayed_work get_uuid_work;
237+ int uuid_retries;
230238 struct delayed_work get_properties_work;
231239 int properties_retries;
232240 struct delayed_work properties_changed_work;
include/linux/ti-emif-sram.h+3−0
@@ -55,6 +55,7 @@ struct ti_emif_pm_data { · 54 unmodified lines
5555 struct ti_emif_pm_functions {
5656 u32 save_context;
5757 u32 restore_context;
58+ u32 run_hw_leveling;
5859 u32 enter_sr;
5960 u32 exit_sr;
6061 u32 abort_sr;
@@ -126,6 +127,8 @@ static inline void ti_emif_asm_offsets(void) · 65 unmodified lines
126127 offsetof(struct ti_emif_pm_functions, save_context));
127128 DEFINE(EMIF_PM_RESTORE_CONTEXT_OFFSET,
128129 offsetof(struct ti_emif_pm_functions, restore_context));
130+ DEFINE(EMIF_PM_RUN_HW_LEVELING,
131+ offsetof(struct ti_emif_pm_functions, run_hw_leveling));
129132 DEFINE(EMIF_PM_ENTER_SR_OFFSET,
130133 offsetof(struct ti_emif_pm_functions, enter_sr));
131134 DEFINE(EMIF_PM_EXIT_SR_OFFSET,
include/linux/tick.h+12−1
@@ -68,6 +68,12 @@ extern void tick_broadcast_control(enum tick_broadcast_mode mode); · 67 unmodified lines
6868 static inline void tick_broadcast_control(enum tick_broadcast_mode mode) { }
6969 #endif /* BROADCAST */
7070
71+#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_HOTPLUG_CPU)
72+extern void tick_offline_cpu(unsigned int cpu);
73+#else
74+static inline void tick_offline_cpu(unsigned int cpu) { }
75+#endif
76+
7177 #ifdef CONFIG_GENERIC_CLOCKEVENTS
7278 extern int tick_broadcast_oneshot_control(enum tick_broadcast_state state);
7379 #else
@@ -122,6 +128,7 @@ extern void tick_nohz_idle_enter(void); · 48 unmodified lines
122128 extern void tick_nohz_idle_exit(void);
123129 extern void tick_nohz_irq_exit(void);
124130 extern bool tick_nohz_idle_got_tick(void);
131+extern ktime_t tick_nohz_get_next_hrtimer(void);
125132 extern ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next);
126133 extern unsigned long tick_nohz_get_idle_calls(void);
127134 extern unsigned long tick_nohz_get_idle_calls_cpu(int cpu);
@@ -145,7 +152,11 @@ static inline void tick_nohz_idle_restart_tick(void) { } · 17 unmodified lines
145152 static inline void tick_nohz_idle_enter(void) { }
146153 static inline void tick_nohz_idle_exit(void) { }
147154 static inline bool tick_nohz_idle_got_tick(void) { return false; }
148−
155+static inline ktime_t tick_nohz_get_next_hrtimer(void)
156+{
157+ /* Next wake up is the tick period, assume it starts now */
158+ return ktime_add(ktime_get(), TICK_NSEC);
159+}
149160 static inline ktime_t tick_nohz_get_sleep_length(ktime_t *delta_next)
150161 {
151162 *delta_next = TICK_NSEC;
include/linux/time64.h+21−0
@@ -33,6 +33,17 @@ struct itimerspec64 { · 32 unmodified lines
3333 #define KTIME_MAX ((s64)~((u64)1 << 63))
3434 #define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
3535
36+/*
37+ * Limits for settimeofday():
38+ *
39+ * To prevent setting the time close to the wraparound point time setting
40+ * is limited so a reasonable uptime can be accomodated. Uptime of 30 years
41+ * should be really sufficient, which means the cutoff is 2232. At that
42+ * point the cutoff is just a small part of the larger problem.
43+ */
44+#define TIME_UPTIME_SEC_MAX (30LL * 365 * 24 *3600)
45+#define TIME_SETTOD_SEC_MAX (KTIME_SEC_MAX - TIME_UPTIME_SEC_MAX)
46+
3647 static inline int timespec64_equal(const struct timespec64 *a,
3748 const struct timespec64 *b)
3849 {
@@ -100,6 +111,16 @@ static inline bool timespec64_valid_strict(const struct timespec64 *ts) · 61 unmodified lines
100111 return true;
101112 }
102113
114+static inline bool timespec64_valid_settod(const struct timespec64 *ts)
115+{
116+ if (!timespec64_valid(ts))
117+ return false;
118+ /* Disallow values which cause overflow issues vs. CLOCK_REALTIME */
119+ if ((unsigned long long)ts->tv_sec >= TIME_SETTOD_SEC_MAX)
120+ return false;
121+ return true;
122+}
123+
103124 /**
104125 * timespec64_to_ns - Convert timespec64 to nanoseconds
105126 * @ts: pointer to the timespec64 variable to be converted
include/linux/tracepoint-defs.h+1−0
@@ -45,6 +45,7 @@ struct bpf_raw_event_map { · 44 unmodified lines
4545 struct tracepoint *tp;
4646 void *bpf_func;
4747 u32 num_args;
48+ u32 writable_size;
4849 } __aligned(32);
4950
5051 #endif
include/linux/tracepoint.h+15−0
@@ -548,4 +548,19 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) · 547 unmodified lines
548548
549549 #define TRACE_EVENT_PERF_PERM(event, expr...)
550550
551+#define DECLARE_EVENT_NOP(name, proto, args) \
552+ static inline void trace_##name(proto) \
553+ { } \
554+ static inline bool trace_##name##_enabled(void) \
555+ { \
556+ return false; \
557+ }
558+
559+#define TRACE_EVENT_NOP(name, proto, args, struct, assign, print) \
560+ DECLARE_EVENT_NOP(name, PARAMS(proto), PARAMS(args))
561+
562+#define DECLARE_EVENT_CLASS_NOP(name, proto, args, tstruct, assign, print)
563+#define DEFINE_EVENT_NOP(template, name, proto, args) \
564+ DECLARE_EVENT_NOP(name, PARAMS(proto), PARAMS(args))
565+
551566 #endif /* ifdef TRACE_EVENT (see note above) */
include/linux/types.h+0−5
@@ -127,13 +127,8 @@ typedef s64 int64_t; · 126 unmodified lines
127127 *
128128 * blkcnt_t is the type of the inode's block count.
129129 */
130−#ifdef CONFIG_LBDAF
131130 typedef u64 sector_t;
132131 typedef u64 blkcnt_t;
133−#else
134−typedef unsigned long sector_t;
135−typedef unsigned long blkcnt_t;
136−#endif
137132
138133 /*
139134 * The type of an index into the pagecache.
include/linux/uaccess.h+2−0
@@ -268,6 +268,8 @@ extern long strncpy_from_unsafe(char *dst, const void *unsafe_addr, long count); · 267 unmodified lines
268268 #define user_access_end() do { } while (0)
269269 #define unsafe_get_user(x, ptr, err) do { if (unlikely(__get_user(x, ptr))) goto err; } while (0)
270270 #define unsafe_put_user(x, ptr, err) do { if (unlikely(__put_user(x, ptr))) goto err; } while (0)
271+static inline unsigned long user_access_save(void) { return 0UL; }
272+static inline void user_access_restore(unsigned long flags) { }
271273 #endif
272274
273275 #ifdef CONFIG_HARDENED_USERCOPY
include/linux/uio.h+1−1
@@ -60,7 +60,7 @@ struct iov_iter { · 59 unmodified lines
6060
6161 static inline enum iter_type iov_iter_type(const struct iov_iter *i)
6262 {
63− return i->type & ~(READ | WRITE);
63+ return i->type & ~(READ | WRITE | ITER_BVEC_FLAG_NO_REF);
6464 }
6565
6666 static inline bool iter_is_iovec(const struct iov_iter *i)
include/linux/unicode.h+30−0
@@ -0,0 +1,30 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _LINUX_UNICODE_H
3+#define _LINUX_UNICODE_H
4+
5+#include <linux/init.h>
6+#include <linux/dcache.h>
7+
8+struct unicode_map {
9+ const char *charset;
10+ int version;
11+};
12+
13+int utf8_validate(const struct unicode_map *um, const struct qstr *str);
14+
15+int utf8_strncmp(const struct unicode_map *um,
16+ const struct qstr *s1, const struct qstr *s2);
17+
18+int utf8_strncasecmp(const struct unicode_map *um,
19+ const struct qstr *s1, const struct qstr *s2);
20+
21+int utf8_normalize(const struct unicode_map *um, const struct qstr *str,
22+ unsigned char *dest, size_t dlen);
23+
24+int utf8_casefold(const struct unicode_map *um, const struct qstr *str,
25+ unsigned char *dest, size_t dlen);
26+
27+struct unicode_map *utf8_load(const char *version);
28+void utf8_unload(struct unicode_map *um);
29+
30+#endif /* _LINUX_UNICODE_H */
include/linux/uprobes.h+5−0
@@ -115,6 +115,7 @@ struct uprobes_state { · 114 unmodified lines
115115 struct xol_area *xol_area;
116116 };
117117
118+extern void __init uprobes_init(void);
118119 extern int set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
119120 extern int set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr);
120121 extern bool is_swbp_insn(uprobe_opcode_t *insn);
@@ -154,6 +155,10 @@ extern void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, · 33 unmodified lines
154155 struct uprobes_state {
155156 };
156157
158+static inline void uprobes_init(void)
159+{
160+}
161+
157162 #define uprobe_get_trap_addr(regs) instruction_pointer(regs)
158163
159164 static inline int
include/linux/usb.h+1−3
@@ -200,7 +200,6 @@ usb_find_last_int_out_endpoint(struct usb_host_interface *alt, · 199 unmodified lines
200200 * @dev: driver model's view of this device
201201 * @usb_dev: if an interface is bound to the USB major, this will point
202202 * to the sysfs representation for that device.
203− * @pm_usage_cnt: PM usage counter for this interface
204203 * @reset_ws: Used for scheduling resets from atomic context.
205204 * @resetting_device: USB core reset the device, so use alt setting 0 as
206205 * current; needs bandwidth alloc after reset.
@@ -257,7 +256,6 @@ struct usb_interface { · 50 unmodified lines
257256
258257 struct device dev; /* interface specific device info */
259258 struct device *usb_dev;
260− atomic_t pm_usage_cnt; /* usage counter for autosuspend */
261259 struct work_struct reset_ws; /* for resets in atomic context */
262260 };
263261 #define to_usb_interface(d) container_of(d, struct usb_interface, dev)
@@ -1545,10 +1543,10 @@ typedef void (*usb_complete_t)(struct urb *); · 1281 unmodified lines
15451543 struct urb {
15461544 /* private: usb core and host controller only fields in the urb */
15471545 struct kref kref; /* reference count of the URB */
1546+ int unlinked; /* unlink error code */
15481547 void *hcpriv; /* private data for host controller */
15491548 atomic_t use_count; /* concurrent submissions counter */
15501549 atomic_t reject; /* submissions will fail */
1551− int unlinked; /* unlink error code */
15521550
15531551 /* public: documented fields in the urb that can be used by drivers */
15541552 struct list_head urb_list; /* list head for use by the urb's
include/linux/usb/ch9.h+8−0
@@ -36,6 +36,14 @@ · 35 unmodified lines
3636 #include <linux/device.h>
3737 #include <uapi/linux/usb/ch9.h>
3838
39+/**
40+ * usb_ep_type_string() - Returns human readable-name of the endpoint type.
41+ * @ep_type: The endpoint type to return human-readable name for. If it's not
42+ * any of the types: USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT},
43+ * usually got by usb_endpoint_type(), the string 'unknown' will be returned.
44+ */
45+extern const char *usb_ep_type_string(int ep_type);
46+
3947 /**
4048 * usb_speed_string() - Returns human readable-name of the speed.
4149 * @speed: The speed to return human-readable name for. If it's not
include/linux/usb/hcd.h+6−0
@@ -98,6 +98,7 @@ struct usb_hcd { · 97 unmodified lines
9898 #ifdef CONFIG_PM
9999 struct work_struct wakeup_work; /* for remote wakeup */
100100 #endif
101+ struct work_struct died_work; /* for when the device dies */
101102
102103 /*
103104 * hardware info/state
@@ -652,11 +653,16 @@ extern wait_queue_head_t usb_kill_urb_queue; · 548 unmodified lines
652653 #define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN))
653654
654655 #ifdef CONFIG_PM
656+extern unsigned usb_wakeup_enabled_descendants(struct usb_device *udev);
655657 extern void usb_root_hub_lost_power(struct usb_device *rhdev);
656658 extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg);
657659 extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg);
658660 extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd);
659661 #else
662+static inline unsigned usb_wakeup_enabled_descendants(struct usb_device *udev)
663+{
664+ return 0;
665+}
660666 static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd)
661667 {
662668 return;
include/linux/usb/serial.h+1−7
@@ -23,11 +23,9 @@ · 22 unmodified lines
2323 /* The maximum number of ports one device can grab at once */
2424 #define MAX_NUM_PORTS 16
2525
26−/* parity check flag */
27−#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
28−
2926 /* USB serial flags */
3027 #define USB_SERIAL_WRITE_BUSY 0
28+#define USB_SERIAL_THROTTLED 1
3129
3230 /**
3331 * usb_serial_port: structure for the specific ports of a device.
@@ -67,8 +65,6 @@ · 33 unmodified lines
6765 * @flags: usb serial port flags
6866 * @write_wait: a wait_queue_head_t used by the port.
6967 * @work: work queue entry for the line discipline waking up.
70− * @throttled: nonzero if the read urb is inactive to throttle the device
71− * @throttle_req: nonzero if the tty wants to throttle us
7268 * @dev: pointer to the serial device
7369 *
7470 * This structure is used by the usb-serial core and drivers for the specific
@@ -115,8 +111,6 @@ struct usb_serial_port { · 40 unmodified lines
115111 unsigned long flags;
116112 wait_queue_head_t write_wait;
117113 struct work_struct work;
118− char throttled;
119− char throttle_req;
120114 unsigned long sysrq; /* sysrq timeout */
121115 struct device dev;
122116 };
include/linux/usb/tcpm.h+7−6
@@ -121,10 +121,10 @@ struct tcpc_config { · 120 unmodified lines
121121 * with partner.
122122 * @set_pd_rx: Called to enable or disable reception of PD messages
123123 * @set_roles: Called to set power and data roles
124− * @start_drp_toggling:
125− * Optional; if supported by hardware, called to start DRP
126− * toggling. DRP toggling is stopped automatically if
127− * a connection is established.
124+ * @start_toggling:
125+ * Optional; if supported by hardware, called to start dual-role
126+ * toggling or single-role connection detection. Toggling stops
127+ * automatically if a connection is established.
128128 * @try_role: Optional; called to set a preferred role
129129 * @pd_transmit:Called to transmit PD message
130130 * @mux: Pointer to multiplexer data
@@ -147,8 +147,9 @@ struct tcpc_dev { · 16 unmodified lines
147147 int (*set_pd_rx)(struct tcpc_dev *dev, bool on);
148148 int (*set_roles)(struct tcpc_dev *dev, bool attached,
149149 enum typec_role role, enum typec_data_role data);
150− int (*start_drp_toggling)(struct tcpc_dev *dev,
151− enum typec_cc_status cc);
150+ int (*start_toggling)(struct tcpc_dev *dev,
151+ enum typec_port_type port_type,
152+ enum typec_cc_status cc);
152153 int (*try_role)(struct tcpc_dev *dev, int role);
153154 int (*pd_transmit)(struct tcpc_dev *dev, enum tcpm_transmit_type type,
154155 const struct pd_message *msg);
include/linux/usb/typec_dp.h+5−0
@@ -5,6 +5,11 @@ · 4 unmodified lines
55 #include <linux/usb/typec_altmode.h>
66
77 #define USB_TYPEC_DP_SID 0xff01
8+/* USB IF has not assigned a Standard ID (SID) for VirtualLink,
9+ * so the manufacturers of VirtualLink adapters use their Vendor
10+ * IDs as the SVID.
11+ */
12+#define USB_TYPEC_NVIDIA_VLINK_SID 0x955 /* NVIDIA VirtualLink */
813 #define USB_TYPEC_DP_MODE 1
914
1015 /*
include/linux/userfaultfd_k.h+2−0
@@ -28,6 +28,8 @@ · 27 unmodified lines
2828 #define UFFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK)
2929 #define UFFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS)
3030
31+extern int sysctl_unprivileged_userfaultfd;
32+
3133 extern vm_fault_t handle_userfault(struct vm_fault *vmf, unsigned long reason);
3234
3335 extern ssize_t mcopy_atomic(struct mm_struct *dst_mm, unsigned long dst_start,
include/linux/virtio.h+0−17
@@ -90,23 +90,6 @@ dma_addr_t virtqueue_get_desc_addr(struct virtqueue *vq); · 89 unmodified lines
9090 dma_addr_t virtqueue_get_avail_addr(struct virtqueue *vq);
9191 dma_addr_t virtqueue_get_used_addr(struct virtqueue *vq);
9292
93−/*
94− * Legacy accessors -- in almost all cases, these are the wrong functions
95− * to use.
96− */
97−static inline void *virtqueue_get_desc(struct virtqueue *vq)
98−{
99− return virtqueue_get_vring(vq)->desc;
100−}
101−static inline void *virtqueue_get_avail(struct virtqueue *vq)
102−{
103− return virtqueue_get_vring(vq)->avail;
104−}
105−static inline void *virtqueue_get_used(struct virtqueue *vq)
106−{
107− return virtqueue_get_vring(vq)->used;
108−}
109−
11093 /**
11194 * virtio_device - representation of a device using virtio
11295 * @index: unique position on the virtio bus
include/linux/vmalloc.h+20−1
@@ -21,6 +21,11 @@ struct notifier_block; /* in notifier.h */ · 20 unmodified lines
2121 #define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */
2222 #define VM_NO_GUARD 0x00000040 /* don't add guard page */
2323 #define VM_KASAN 0x00000080 /* has allocated kasan shadow memory */
24+/*
25+ * Memory with VM_FLUSH_RESET_PERMS cannot be freed in an interrupt or with
26+ * vfree_atomic().
27+ */
28+#define VM_FLUSH_RESET_PERMS 0x00000100 /* Reset direct map and flush TLB on unmap */
2429 /* bits [20..32] reserved for arch specific ioremap internals */
2530
2631 /*
@@ -45,12 +50,16 @@ struct vm_struct { · 18 unmodified lines
4550 struct vmap_area {
4651 unsigned long va_start;
4752 unsigned long va_end;
53+
54+ /*
55+ * Largest available free size in subtree.
56+ */
57+ unsigned long subtree_max_size;
4858 unsigned long flags;
4959 struct rb_node rb_node; /* address sorted rbtree */
5060 struct list_head list; /* address sorted list */
5161 struct llist_node purge_list; /* "lazy purge" list */
5262 struct vm_struct *vm;
53− struct rcu_head rcu_head;
5463 };
5564
5665 /*
@@ -142,6 +151,13 @@ extern int map_kernel_range_noflush(unsigned long start, unsigned long size, · 85 unmodified lines
142151 pgprot_t prot, struct page **pages);
143152 extern void unmap_kernel_range_noflush(unsigned long addr, unsigned long size);
144153 extern void unmap_kernel_range(unsigned long addr, unsigned long size);
154+static inline void set_vm_flush_reset_perms(void *addr)
155+{
156+ struct vm_struct *vm = find_vm_area(addr);
157+
158+ if (vm)
159+ vm->flags |= VM_FLUSH_RESET_PERMS;
160+}
145161 #else
146162 static inline int
147163 map_kernel_range_noflush(unsigned long start, unsigned long size,
@@ -157,6 +173,9 @@ static inline void · 9 unmodified lines
157173 unmap_kernel_range(unsigned long addr, unsigned long size)
158174 {
159175 }
176+static inline void set_vm_flush_reset_perms(void *addr)
177+{
178+}
160179 #endif
161180
162181 /* Allocate/destroy a 'vmalloc' VM area. */
include/linux/vmstat.h+1−1
@@ -26,7 +26,7 @@ struct reclaim_stat { · 25 unmodified lines
2626 unsigned nr_congested;
2727 unsigned nr_writeback;
2828 unsigned nr_immediate;
29− unsigned nr_activate;
29+ unsigned nr_activate[2];
3030 unsigned nr_ref_keep;
3131 unsigned nr_unmap_fail;
3232 };
include/linux/vmw_vmci_defs.h+18−17
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #define _VMW_VMCI_DEF_H_
1818
1919 #include <linux/atomic.h>
20+#include <linux/bits.h>
2021
2122 /* Register offsets. */
2223 #define VMCI_STATUS_ADDR 0x00
@@ -33,27 +34,27 @@ · 10 unmodified lines
3334 #define VMCI_MAX_DEVICES 1
3435
3536 /* Status register bits. */
36−#define VMCI_STATUS_INT_ON 0x1
37+#define VMCI_STATUS_INT_ON BIT(0)
3738
3839 /* Control register bits. */
39−#define VMCI_CONTROL_RESET 0x1
40−#define VMCI_CONTROL_INT_ENABLE 0x2
41−#define VMCI_CONTROL_INT_DISABLE 0x4
40+#define VMCI_CONTROL_RESET BIT(0)
41+#define VMCI_CONTROL_INT_ENABLE BIT(1)
42+#define VMCI_CONTROL_INT_DISABLE BIT(2)
4243
4344 /* Capabilities register bits. */
44−#define VMCI_CAPS_HYPERCALL 0x1
45−#define VMCI_CAPS_GUESTCALL 0x2
46−#define VMCI_CAPS_DATAGRAM 0x4
47−#define VMCI_CAPS_NOTIFICATIONS 0x8
48−#define VMCI_CAPS_PPN64 0x10
45+#define VMCI_CAPS_HYPERCALL BIT(0)
46+#define VMCI_CAPS_GUESTCALL BIT(1)
47+#define VMCI_CAPS_DATAGRAM BIT(2)
48+#define VMCI_CAPS_NOTIFICATIONS BIT(3)
49+#define VMCI_CAPS_PPN64 BIT(4)
4950
5051 /* Interrupt Cause register bits. */
51−#define VMCI_ICR_DATAGRAM 0x1
52−#define VMCI_ICR_NOTIFICATION 0x2
52+#define VMCI_ICR_DATAGRAM BIT(0)
53+#define VMCI_ICR_NOTIFICATION BIT(1)
5354
5455 /* Interrupt Mask register bits. */
55−#define VMCI_IMR_DATAGRAM 0x1
56−#define VMCI_IMR_NOTIFICATION 0x2
56+#define VMCI_IMR_DATAGRAM BIT(0)
57+#define VMCI_IMR_NOTIFICATION BIT(1)
5758
5859 /* Maximum MSI/MSI-X interrupt vectors in the device. */
5960 #define VMCI_MAX_INTRS 2
@@ -463,9 +464,9 @@ struct vmci_datagram { · 403 unmodified lines
463464 * datagram callback is invoked in a delayed context (not interrupt context).
464465 */
465466 #define VMCI_FLAG_DG_NONE 0
466−#define VMCI_FLAG_WELLKNOWN_DG_HND 0x1
467−#define VMCI_FLAG_ANYCID_DG_HND 0x2
468−#define VMCI_FLAG_DG_DELAYED_CB 0x4
467+#define VMCI_FLAG_WELLKNOWN_DG_HND BIT(0)
468+#define VMCI_FLAG_ANYCID_DG_HND BIT(1)
469+#define VMCI_FLAG_DG_DELAYED_CB BIT(2)
469470
470471 /*
471472 * Maximum supported size of a VMCI datagram for routable datagrams.
@@ -694,7 +695,7 @@ struct vmci_qp_detach_msg { · 222 unmodified lines
694695 };
695696
696697 /* VMCI Doorbell API. */
697−#define VMCI_FLAG_DELAYED_CB 0x01
698+#define VMCI_FLAG_DELAYED_CB BIT(0)
698699
699700 typedef void (*vmci_callback) (void *client_data);
700701
include/linux/wait.h+1−1
@@ -101,7 +101,7 @@ init_waitqueue_func_entry(struct wait_queue_entry *wq_entry, wait_queue_func_t f · 100 unmodified lines
101101 * lead to sporadic and non-obvious failure.
102102 *
103103 * Use either while holding wait_queue_head::lock or when used for wakeups
104− * with an extra smp_mb() like:
104+ * with an extra smp_mb() like::
105105 *
106106 * CPU0 - waker CPU1 - waiter
107107 *
include/linux/wait_bit.h+13−0
@@ -305,6 +305,19 @@ do { \ · 304 unmodified lines
305305 __ret; \
306306 })
307307
308+#define __wait_var_event_interruptible(var, condition) \
309+ ___wait_var_event(var, condition, TASK_INTERRUPTIBLE, 0, 0, \
310+ schedule())
311+
312+#define wait_var_event_interruptible(var, condition) \
313+({ \
314+ int __ret = 0; \
315+ might_sleep(); \
316+ if (!(condition)) \
317+ __ret = __wait_var_event_interruptible(var, condition); \
318+ __ret; \
319+})
320+
308321 /**
309322 * clear_and_wake_up_bit - clear a bit and wake up anyone waiting on that bit
310323 *

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