History

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

We haven't done any backmerge for a while due to the merge window, and it starts to become an issue for komeda. Let's bring 5.4-rc1 in.

Maxime Ripard committed 7 years ago

Commit 4092de12 parents a00d17e 54ecb8f12131 files · +705887 −314962Browse files

Showing the changes to include/linux (367 of 12131 files). Show all

Unified · Split

367 files
  1. include/linux/acpi.h +15 −51
  2. include/linux/alarmtimer.h +2 −1
  3. include/linux/amd-iommu.h +12 −0
  4. include/linux/arch_topology.h +26 −0
  5. include/linux/audit.h +7 −14
  6. include/linux/backing-dev-defs.h +23 −0
  7. include/linux/backing-dev.h +5 −0
  8. include/linux/backlight.h +8 −0
  9. include/linux/bitmap.h +23 −0
  10. include/linux/blk-cgroup.h +5 −2
  11. include/linux/blk-mq.h +17 −3
  12. include/linux/blk_types.h +10 −1
  13. include/linux/blkdev.h +55 −24
  14. include/linux/bpf.h +9 −7
  15. include/linux/bpf_types.h +1 −0
  16. include/linux/bpf_verifier.h +1 −0
  17. include/linux/bug.h +5 −0
  18. include/linux/can/can-ml.h +68 −0
  19. include/linux/can/core.h +9 −2
  20. include/linux/can/dev.h +2 −1
  21. include/linux/can/platform/rcar_can.h +0 −18
  22. include/linux/can/rx-offload.h +9 −4
  23. include/linux/can/skb.h +1 −1
  24. include/linux/ccp.h +2 −0
  25. include/linux/ceph/buffer.h +2 −1
  26. include/linux/ceph/libceph.h +1 −0
  27. include/linux/ceph/messenger.h +1 −0
  28. include/linux/ceph/mon_client.h +1 −0
  29. include/linux/ceph/osd_client.h +2 −0
  30. include/linux/cgroup.h +1 −0
  31. include/linux/clk-provider.h +3 −1
  32. include/linux/clk.h +11 −7
  33. include/linux/clk/clk-conf.h +5 −0
  34. include/linux/compaction.h +17 −5
  35. include/linux/compiler.h +4 −4
  36. include/linux/compiler_types.h +30 −7
  37. include/linux/connector.h +0 −1
  38. include/linux/container.h +5 −0
  39. include/linux/cpu.h +3 −1
  40. include/linux/cpufreq.h +2 −2
  41. include/linux/cpuidle.h +23 −4
  42. include/linux/cpuidle_haltpoll.h +16 −0
  43. include/linux/cpumask.h +39 −16
  44. include/linux/cpuset.h +9 −4
  45. include/linux/crash_dump.h +14 −0
  46. include/linux/cred.h +7 −2
  47. include/linux/dcache.h +1 −1
  48. include/linux/devfreq-event.h +6 −0
  49. include/linux/device.h +255 −7
  50. include/linux/dim.h +0 −56
  51. include/linux/dma-contiguous.h +1 −4
  52. include/linux/dma-mapping.h +16 −27
  53. include/linux/dma-noncoherent.h +19 −5
  54. include/linux/edac.h +5 −5
  55. include/linux/edma.h +0 −29
  56. include/linux/efi.h +5 −9
  57. include/linux/elevator.h +8 −1
  58. include/linux/error-injection.h +3 −3
  59. include/linux/export.h +78 −32
  60. include/linux/exportfs.h +1 −1
  61. include/linux/extable.h +2 −0
  62. include/linux/f2fs_fs.h +9 −1
  63. include/linux/filter.h +13 −0
  64. include/linux/fips.h +7 −0
  65. include/linux/firmware/imx/dsp.h +67 −0
  66. include/linux/firmware/intel/stratix10-smc.h +45 −6
  67. include/linux/firmware/intel/stratix10-svc-client.h +10 −1
  68. include/linux/fpga/altera-pr-ip-core.h +1 −1
  69. include/linux/fs.h +73 −0
  70. include/linux/fs_context.h +15 −2
  71. include/linux/fscrypt.h +52 −3
  72. include/linux/fsnotify_backend.h +2 −0
  73. include/linux/fsverity.h +211 −0
  74. include/linux/fwnode.h +5 −4
  75. include/linux/gpio.h +0 −37
  76. include/linux/gpio/consumer.h +137 −62
  77. include/linux/gpio/driver.h +144 −34
  78. include/linux/greybus.h +152 −0
  79. include/linux/greybus/bundle.h +92 −0
  80. include/linux/greybus/connection.h +131 −0
  81. include/linux/greybus/control.h +60 −0
  82. include/linux/greybus/greybus_id.h +27 −0
  83. include/linux/greybus/greybus_manifest.h +181 −0
  84. include/linux/greybus/greybus_protocols.h +2178 −0
  85. include/linux/greybus/hd.h +85 −0
  86. include/linux/greybus/interface.h +85 −0
  87. include/linux/greybus/manifest.h +17 −0
  88. include/linux/greybus/module.h +36 −0
  89. include/linux/greybus/operation.h +229 −0
  90. include/linux/greybus/svc.h +106 −0
  91. include/linux/hid.h +23 −20
  92. include/linux/hmm.h +20 −159
  93. include/linux/hrtimer.h +44 −4
  94. include/linux/huge_mm.h +15 −1
  95. include/linux/hugetlb.h +1 −1
  96. include/linux/hyperv.h +44 −1
  97. include/linux/i2c.h +2 −2
  98. include/linux/i3c/device.h +4 −0
  99. include/linux/i3c/master.h +5 −0
  100. include/linux/idle_inject.h +4 −4
  101. include/linux/ieee80211.h +61 −2
  102. include/linux/if_pppox.h +3 −0
  103. include/linux/if_rmnet.h +2 −2
  104. include/linux/iio/common/cros_ec_sensors_core.h +28 −3
  105. include/linux/iio/common/st_sensors.h +19 −47
  106. include/linux/iio/common/st_sensors_i2c.h +2 −2
  107. include/linux/iio/common/st_sensors_spi.h +2 −2
  108. include/linux/iio/imu/adis.h +2 −0
  109. include/linux/ima.h +9 −0
  110. include/linux/init_task.h +0 −11
  111. include/linux/input.h +26 −0
  112. include/linux/input/bu21013.h +0 −34
  113. include/linux/input/elan-i2c-ids.h +1 −1
  114. include/linux/intel-iommu.h +2 −3
  115. include/linux/intel_th.h +79 −0
  116. include/linux/interconnect-provider.h +5 −2
  117. include/linux/interconnect.h +5 −0
  118. include/linux/interrupt.h +5 −0
  119. include/linux/interval_tree_generic.h +2 −20
  120. include/linux/io-pgtable.h +44 −22
  121. include/linux/ioc4.h +0 −184
  122. include/linux/iomap.h +7 −3
  123. include/linux/iommu.h +88 −20
  124. include/linux/ioport.h +2 −0
  125. include/linux/iova.h +6 −0
  126. include/linux/irqchip/arm-gic-v3.h +29 −1
  127. include/linux/irqchip/irq-partition-percpu.h +5 −0
  128. include/linux/irqdomain.h +3 −3
  129. include/linux/jbd2.h +0 −2
  130. include/linux/kernel.h +22 −1
  131. include/linux/kexec.h +27 −2
  132. include/linux/key.h +17 −5
  133. include/linux/kgdb.h +2 −0
  134. include/linux/khugepaged.h +12 −0
  135. include/linux/kvm_host.h +4 −2
  136. include/linux/led-class-flash.h +10 −5
  137. include/linux/leds.h +90 −10
  138. include/linux/libnvdimm.h +6 −3
  139. include/linux/lightnvm.h +3 −5
  140. include/linux/lockdep.h +4 −7
  141. include/linux/logic_pio.h +1 −0
  142. include/linux/lsm_hooks.h +21 −1
  143. include/linux/mailbox/mtk-cmdq-mailbox.h +3 −0
  144. include/linux/mdio.h +11 −0
  145. include/linux/mem_encrypt.h +1 −14
  146. include/linux/memcontrol.h +73 −8
  147. include/linux/memory.h +3 −4
  148. include/linux/memremap.h +3 −2
  149. include/linux/mfd/aat2870.h +0 −1
  150. include/linux/mfd/cros_ec.h +0 −292
  151. include/linux/mfd/da9063/pdata.h +0 −60
  152. include/linux/mfd/intel_soc_pmic_mrfld.h +81 −0
  153. include/linux/mfd/mt6397/core.h +11 −0
  154. include/linux/mfd/syscon.h +6 −0
  155. include/linux/migrate.h +19 −101
  156. include/linux/mlx5/device.h +19 −2
  157. include/linux/mlx5/driver.h +33 −11
  158. include/linux/mlx5/eswitch.h +7 −2
  159. include/linux/mlx5/fs.h +23 −17
  160. include/linux/mlx5/mlx5_ifc.h +271 −54
  161. include/linux/mm.h +37 −50
  162. include/linux/mm_types.h +22 −10
  163. include/linux/mm_types_task.h +4 −0
  164. include/linux/mmc/host.h +12 −0
  165. include/linux/mmu_notifier.h +52 −7
  166. include/linux/mmzone.h +14 −5
  167. include/linux/mod_devicetable.h +1 −0
  168. include/linux/module.h +2 −3
  169. include/linux/module_signature.h +46 −0
  170. include/linux/moxtet.h +109 −0
  171. include/linux/mtd/mtd.h +3 −0
  172. include/linux/mtd/nand.h +1 −1
  173. include/linux/mtd/sharpsl.h +5 −0
  174. include/linux/mtd/spi-nor.h +209 −82
  175. include/linux/mtd/super.h +3 −3
  176. include/linux/mutex.h +3 −22
  177. include/linux/namei.h +18 −45
  178. include/linux/netdevice.h +17 −3
  179. include/linux/netfilter.h +2 −2
  180. include/linux/netfilter/ipset/ip_set.h +234 −4
  181. include/linux/netfilter/ipset/ip_set_comment.h +0 −73
  182. include/linux/netfilter/ipset/ip_set_counter.h +0 −84
  183. include/linux/netfilter/ipset/ip_set_getport.h +5 −1
  184. include/linux/netfilter/ipset/ip_set_skbinfo.h +0 −42
  185. include/linux/netfilter/ipset/ip_set_timeout.h +0 −77
  186. include/linux/netfilter/nf_conntrack_amanda.h +4 −0
  187. include/linux/netfilter/nf_conntrack_common.h +20 −0
  188. include/linux/netfilter/nf_conntrack_dccp.h +0 −3
  189. include/linux/netfilter/nf_conntrack_ftp.h +5 −3
  190. include/linux/netfilter/nf_conntrack_h323.h +5 −6
  191. include/linux/netfilter/nf_conntrack_h323_asn1.h +3 −2
  192. include/linux/netfilter/nf_conntrack_h323_types.h +5 −0
  193. include/linux/netfilter/nf_conntrack_irc.h +3 −2
  194. include/linux/netfilter/nf_conntrack_pptp.h +5 −7
  195. include/linux/netfilter/nf_conntrack_proto_gre.h +0 −2
  196. include/linux/netfilter/nf_conntrack_sane.h +0 −4
  197. include/linux/netfilter/nf_conntrack_sip.h +2 −4
  198. include/linux/netfilter/nf_conntrack_snmp.h +3 −0
  199. include/linux/netfilter/nf_conntrack_tftp.h +5 −0
  200. include/linux/netfilter/x_tables.h +1 −1
  201. include/linux/netfilter/xt_hashlimit.h +0 −11
  202. include/linux/netfilter/xt_physdev.h +0 −8
  203. include/linux/netfilter_bridge.h +7 −0
  204. include/linux/netfilter_bridge/ebt_802_3.h +0 −12
  205. include/linux/netfilter_bridge/ebtables.h +1 −0
  206. include/linux/netfilter_ipv4/ip_tables.h +1 −4
  207. include/linux/netfilter_ipv6.h +20 −8
  208. include/linux/netfilter_ipv6/ip6_tables.h +2 −16
  209. include/linux/nfs_fs.h +3 −0
  210. include/linux/nvme-fc-driver.h +2 −0
  211. include/linux/nvme.h +4 −1
  212. include/linux/of.h +1 −1
  213. include/linux/of_gpio.h +0 −11
  214. include/linux/omap-dma.h +0 −2
  215. include/linux/omap-dmaengine.h +0 −18
  216. include/linux/omap-iommu.h +15 −0
  217. include/linux/oxu210hp.h +0 −8
  218. include/linux/padata.h +13 −16
  219. include/linux/page-flags-layout.h +11 −7
  220. include/linux/page-flags.h +4 −0
  221. include/linux/page_ext.h +1 −0
  222. include/linux/pagemap.h +10 −0
  223. include/linux/pagewalk.h +66 −0
  224. include/linux/pci-aspm.h +0 −36
  225. include/linux/pci-p2pdma.h +24 −4
  226. include/linux/pci.h +51 −84
  227. include/linux/pci_hotplug.h +0 −100
  228. include/linux/pci_ids.h +8 −1
  229. include/linux/percpu.h +1 −1
  230. include/linux/perf_event.h +14 −0
  231. include/linux/phy.h +13 −2
  232. include/linux/phy_fixed.h +1 −0
  233. include/linux/pid.h +4 −0
  234. include/linux/pinctrl/consumer.h +6 −0
  235. include/linux/platform_data/cros_ec_chardev.h +38 −0
  236. include/linux/platform_data/cros_ec_commands.h +12 −0
  237. include/linux/platform_data/cros_ec_proto.h +319 −0
  238. include/linux/platform_data/db8500_thermal.h +0 −29
  239. include/linux/platform_data/dma-iop32x.h +110 −0
  240. include/linux/platform_data/dwc3-omap.h +0 −43
  241. include/linux/platform_data/eth-netx.h +0 −13
  242. include/linux/platform_data/gpio-htc-egpio.h +0 −3
  243. include/linux/platform_data/iommu-omap.h +4 −0
  244. include/linux/platform_data/keypad-w90p910.h +0 −16
  245. include/linux/platform_data/leds-kirkwood-netxbig.h +0 −54
  246. include/linux/platform_data/nxp-nci.h +0 −19
  247. include/linux/platform_data/pinctrl-single.h +6 −0
  248. include/linux/platform_data/sc18is602.h +1 −1
  249. include/linux/platform_data/sgi-w1.h +13 −0
  250. include/linux/platform_data/spi-nuc900.h +0 −29
  251. include/linux/platform_data/ti-sysc.h +6 −2
  252. include/linux/platform_data/video-nuc900fb.h +0 −79
  253. include/linux/platform_data/x86/asus-wmi.h +6 −2
  254. include/linux/platform_device.h +5 −1
  255. include/linux/pm.h +0 −4
  256. include/linux/pm_domain.h +8 −8
  257. include/linux/pm_opp.h +10 −2
  258. include/linux/pm_qos.h +0 −6
  259. include/linux/pm_wakeup.h +8 −13
  260. include/linux/posix-timers.h +117 −14
  261. include/linux/preempt.h +3 −3
  262. include/linux/printk.h +15 −7
  263. include/linux/property.h +4 −0
  264. include/linux/psci.h +2 −2
  265. include/linux/pwm.h +2 −2
  266. include/linux/qcom_scm.h +5 −4
  267. include/linux/qed/qed_if.h +30 −1
  268. include/linux/qed/qed_rdma_if.h +1 −1
  269. include/linux/quicklist.h +0 −94
  270. include/linux/quotaops.h +1 −1
  271. include/linux/ramfs.h +2 −4
  272. include/linux/random.h +1 −0
  273. include/linux/rbtree_augmented.h +67 −21
  274. include/linux/rcu_segcblist.h +9 −0
  275. include/linux/rcu_sync.h +1 −3
  276. include/linux/rculist.h +29 −7
  277. include/linux/rcupdate.h +9 −2
  278. include/linux/rcutiny.h +1 −1
  279. include/linux/rcutree.h +1 −1
  280. include/linux/rcuwait.h +4 −16
  281. include/linux/regulator/consumer.h +13 −0
  282. include/linux/regulator/mt6358-regulator.h +56 −0
  283. include/linux/root_dev.h +1 −0
  284. include/linux/rwsem.h +10 −0
  285. include/linux/sched.h +33 −31
  286. include/linux/sched/cputime.h +7 −5
  287. include/linux/sched/deadline.h +8 −0
  288. include/linux/sched/mm.h +5 −5
  289. include/linux/sched/numa_balancing.h +2 −2
  290. include/linux/sched/signal.h +3 −11
  291. include/linux/sched/task.h +6 −2
  292. include/linux/sched/topology.h +10 −0
  293. include/linux/sched/types.h +23 −0
  294. include/linux/scmi_protocol.h +37 −9
  295. include/linux/security.h +67 −2
  296. include/linux/sha256.h +0 −28
  297. include/linux/shmem_fs.h +2 −1
  298. include/linux/shrinker.h +6 −1
  299. include/linux/signal.h +14 −1
  300. include/linux/skbuff.h +117 −50
  301. include/linux/skmsg.h +7 −1
  302. include/linux/slab.h +0 −62
  303. include/linux/soc/mediatek/mtk-cmdq.h +7 −10
  304. include/linux/soc/nxp/lpc32xx-misc.h +33 −0
  305. include/linux/soc/samsung/exynos-chipid.h +52 −0
  306. include/linux/soc/ti/ti_sci_protocol.h +3 −0
  307. include/linux/socket.h +3 −0
  308. include/linux/sort.h +5 −0
  309. include/linux/soundwire/sdw.h +18 −2
  310. include/linux/soundwire/sdw_intel.h +1 −0
  311. include/linux/spinlock.h +1 −1
  312. include/linux/spinlock_api_smp.h +1 −1
  313. include/linux/stacktrace.h +2 −2
  314. include/linux/stmmac.h +4 −0
  315. include/linux/string.h +3 −2
  316. include/linux/sunrpc/cache.h +4 −3
  317. include/linux/sunrpc/sched.h +0 −4
  318. include/linux/sunrpc/svc_rdma.h +3 −3
  319. include/linux/sunrpc/xdr.h +1 −1
  320. include/linux/sunrpc/xprt.h +1 −0
  321. include/linux/sunrpc/xprtrdma.h +2 −2
  322. include/linux/suspend.h +3 −1
  323. include/linux/swap.h +2 −0
  324. include/linux/swiotlb.h +6 −2
  325. include/linux/sys_soc.h +1 −0
  326. include/linux/syscalls.h +19 −0
  327. include/linux/sysfs.h +9 −0
  328. include/linux/t10-pi.h +0 −14
  329. include/linux/tcp.h +2 −0
  330. include/linux/thermal.h +2 −2
  331. include/linux/thread_info.h +1 −1
  332. include/linux/thunderbolt.h +2 −0
  333. include/linux/time64.h +2 −0
  334. include/linux/timekeeper_internal.h +5 −0
  335. include/linux/timer.h +1 −1
  336. include/linux/timeriomem-rng.h +5 −0
  337. include/linux/timerqueue.h +16 −7
  338. include/linux/tnum.h +6 −0
  339. include/linux/topology.h +15 −0
  340. include/linux/torture.h +1 −1
  341. include/linux/trace_events.h +1 −0
  342. include/linux/uaccess.h +11 −10
  343. include/linux/usb.h +7 −2
  344. include/linux/usb/association.h +0 −151
  345. include/linux/usb/ch9.h +27 −0
  346. include/linux/usb/gadget.h +3 −0
  347. include/linux/usb/hcd.h +10 −0
  348. include/linux/usb/role.h +37 −0
  349. include/linux/usb/samsung_usb_phy.h +0 −17
  350. include/linux/usb/usb338x.h +25 −10
  351. include/linux/usb/wusb-wa.h +0 −304
  352. include/linux/usb/wusb.h +0 −362
  353. include/linux/uwb.h +0 −817
  354. include/linux/uwb/debug-cmd.h +0 −57
  355. include/linux/uwb/spec.h +0 −767
  356. include/linux/uwb/umc.h +0 −192
  357. include/linux/uwb/whci.h +0 −102
  358. include/linux/verification.h +10 −0
  359. include/linux/vermagic.h +2 −0
  360. include/linux/virtio_vsock.h +3 −1
  361. include/linux/vmalloc.h +15 −7
  362. include/linux/w1.h +5 −0
  363. include/linux/wait.h +15 −2
  364. include/linux/wimax/debug.h +3 −17
  365. include/linux/workqueue.h +4 −0
  366. include/linux/writeback.h +2 −0
  367. include/linux/zpool.h +3 −0
include/linux/acpi.h+15−51
@@ -643,6 +643,12 @@ bool acpi_gtdt_c3stop(int type); · 642 unmodified lines
643643 int acpi_arch_timer_mem_init(struct arch_timer_mem *timer_mem, int *timer_count);
644644 #endif
645645
646+#ifndef ACPI_HAVE_ARCH_SET_ROOT_POINTER
647+static inline void acpi_arch_set_root_pointer(u64 addr)
648+{
649+}
650+#endif
651+
646652 #ifndef ACPI_HAVE_ARCH_GET_ROOT_POINTER
647653 static inline u64 acpi_arch_get_root_pointer(void)
648654 {
@@ -931,6 +937,8 @@ int acpi_subsys_suspend_noirq(struct device *dev); · 282 unmodified lines
931937 int acpi_subsys_suspend(struct device *dev);
932938 int acpi_subsys_freeze(struct device *dev);
933939 int acpi_subsys_poweroff(struct device *dev);
940+void acpi_ec_mark_gpe_for_wake(void);
941+void acpi_ec_set_gpe_wake_mask(u8 action);
934942 #else
935943 static inline int acpi_subsys_prepare(struct device *dev) { return 0; }
936944 static inline void acpi_subsys_complete(struct device *dev) {}
@@ -939,6 +947,8 @@ static inline int acpi_subsys_suspend_noirq(struct device *dev) { return 0; } · 2 unmodified lines
939947 static inline int acpi_subsys_suspend(struct device *dev) { return 0; }
940948 static inline int acpi_subsys_freeze(struct device *dev) { return 0; }
941949 static inline int acpi_subsys_poweroff(struct device *dev) { return 0; }
950+static inline void acpi_ec_mark_gpe_for_wake(void) {}
951+static inline void acpi_ec_set_gpe_wake_mask(u8 action) {}
942952 #endif
943953
944954 #ifdef CONFIG_ACPI
@@ -994,62 +1004,11 @@ void __acpi_handle_debug(struct _ddebug *descriptor, acpi_handle handle, const c · 49 unmodified lines
9941004 #endif
9951005 #endif
9961006
997−struct acpi_gpio_params {
998− unsigned int crs_entry_index;
999− unsigned int line_index;
1000− bool active_low;
1001−};
1002−
1003−struct acpi_gpio_mapping {
1004− const char *name;
1005− const struct acpi_gpio_params *data;
1006− unsigned int size;
1007−
1008−/* Ignore IoRestriction field */
1009−#define ACPI_GPIO_QUIRK_NO_IO_RESTRICTION BIT(0)
1010−/*
1011− * When ACPI GPIO mapping table is in use the index parameter inside it
1012− * refers to the GPIO resource in _CRS method. That index has no
1013− * distinction of actual type of the resource. When consumer wants to
1014− * get GpioIo type explicitly, this quirk may be used.
1015− */
1016−#define ACPI_GPIO_QUIRK_ONLY_GPIOIO BIT(1)
1017−
1018− unsigned int quirks;
1019−};
1020−
10211007 #if defined(CONFIG_ACPI) && defined(CONFIG_GPIOLIB)
1022−int acpi_dev_add_driver_gpios(struct acpi_device *adev,
1023− const struct acpi_gpio_mapping *gpios);
1024−
1025−static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev)
1026−{
1027− if (adev)
1028− adev->driver_gpios = NULL;
1029−}
1030−
1031−int devm_acpi_dev_add_driver_gpios(struct device *dev,
1032− const struct acpi_gpio_mapping *gpios);
1033−void devm_acpi_dev_remove_driver_gpios(struct device *dev);
1034−
10351008 bool acpi_gpio_get_irq_resource(struct acpi_resource *ares,
10361009 struct acpi_resource_gpio **agpio);
10371010 int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index);
10381011 #else
1039−static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
1040− const struct acpi_gpio_mapping *gpios)
1041−{
1042− return -ENXIO;
1043−}
1044−static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) {}
1045−
1046−static inline int devm_acpi_dev_add_driver_gpios(struct device *dev,
1047− const struct acpi_gpio_mapping *gpios)
1048−{
1049− return -ENXIO;
1050−}
1051−static inline void devm_acpi_dev_remove_driver_gpios(struct device *dev) {}
1052−
10531012 static inline bool acpi_gpio_get_irq_resource(struct acpi_resource *ares,
10541013 struct acpi_resource_gpio **agpio)
10551014 {
@@ -1302,11 +1261,16 @@ static inline int lpit_read_residency_count_address(u64 *address) · 246 unmodified lines
13021261 #endif
13031262
13041263 #ifdef CONFIG_ACPI_PPTT
1264+int acpi_pptt_cpu_is_thread(unsigned int cpu);
13051265 int find_acpi_cpu_topology(unsigned int cpu, int level);
13061266 int find_acpi_cpu_topology_package(unsigned int cpu);
13071267 int find_acpi_cpu_topology_hetero_id(unsigned int cpu);
13081268 int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
13091269 #else
1270+static inline int acpi_pptt_cpu_is_thread(unsigned int cpu)
1271+{
1272+ return -EINVAL;
1273+}
13101274 static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
13111275 {
13121276 return -EINVAL;
include/linux/alarmtimer.h+2−1
@@ -5,7 +5,8 @@ · 4 unmodified lines
55 #include <linux/time.h>
66 #include <linux/hrtimer.h>
77 #include <linux/timerqueue.h>
8−#include <linux/rtc.h>
8+
9+struct rtc_device;
910
1011 enum alarmtimer_type {
1112 ALARM_REALTIME,
include/linux/amd-iommu.h+12−0
@@ -184,6 +184,9 @@ extern int amd_iommu_register_ga_log_notifier(int (*notifier)(u32)); · 183 unmodified lines
184184 extern int
185185 amd_iommu_update_ga(int cpu, bool is_run, void *data);
186186
187+extern int amd_iommu_activate_guest_mode(void *data);
188+extern int amd_iommu_deactivate_guest_mode(void *data);
189+
187190 #else /* defined(CONFIG_AMD_IOMMU) && defined(CONFIG_IRQ_REMAP) */
188191
189192 static inline int
@@ -198,6 +201,15 @@ amd_iommu_update_ga(int cpu, bool is_run, void *data) · 8 unmodified lines
198201 return 0;
199202 }
200203
204+static inline int amd_iommu_activate_guest_mode(void *data)
205+{
206+ return 0;
207+}
208+
209+static inline int amd_iommu_deactivate_guest_mode(void *data)
210+{
211+ return 0;
212+}
201213 #endif /* defined(CONFIG_AMD_IOMMU) && defined(CONFIG_IRQ_REMAP) */
202214
203215 #endif /* _ASM_X86_AMD_IOMMU_H */
include/linux/arch_topology.h+26−0
@@ -33,4 +33,30 @@ unsigned long topology_get_freq_scale(int cpu) · 32 unmodified lines
3333 return per_cpu(freq_scale, cpu);
3434 }
3535
36+struct cpu_topology {
37+ int thread_id;
38+ int core_id;
39+ int package_id;
40+ int llc_id;
41+ cpumask_t thread_sibling;
42+ cpumask_t core_sibling;
43+ cpumask_t llc_sibling;
44+};
45+
46+#ifdef CONFIG_GENERIC_ARCH_TOPOLOGY
47+extern struct cpu_topology cpu_topology[NR_CPUS];
48+
49+#define topology_physical_package_id(cpu) (cpu_topology[cpu].package_id)
50+#define topology_core_id(cpu) (cpu_topology[cpu].core_id)
51+#define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling)
52+#define topology_sibling_cpumask(cpu) (&cpu_topology[cpu].thread_sibling)
53+#define topology_llc_cpumask(cpu) (&cpu_topology[cpu].llc_sibling)
54+void init_cpu_topology(void);
55+void store_cpu_topology(unsigned int cpuid);
56+const struct cpumask *cpu_coregroup_mask(int cpu);
57+void update_siblings_masks(unsigned int cpu);
58+void remove_cpu_topology(unsigned int cpuid);
59+void reset_cpu_topology(void);
60+#endif
61+
3662 #endif /* _LINUX_ARCH_TOPOLOGY_H_ */
include/linux/audit.h+7−14
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111
1212 #include <linux/sched.h>
1313 #include <linux/ptrace.h>
14−#include <linux/namei.h> /* LOOKUP_* */
1514 #include <uapi/linux/audit.h>
1615
1716 #define AUDIT_INO_UNSET ((unsigned long)-1)
@@ -252,6 +251,10 @@ static inline int audit_signal_info(int sig, struct task_struct *t) · 234 unmodified lines
252251 #define audit_is_compat(arch) false
253252 #endif
254253
254+#define AUDIT_INODE_PARENT 1 /* dentry represents the parent */
255+#define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */
256+#define AUDIT_INODE_NOEVAL 4 /* audit record incomplete */
257+
255258 #ifdef CONFIG_AUDITSYSCALL
256259 #include <asm/syscall.h> /* for syscall_get_arch() */
257260
@@ -265,9 +268,6 @@ extern void __audit_syscall_exit(int ret_success, long ret_value); · 7 unmodified lines
265268 extern struct filename *__audit_reusename(const __user char *uptr);
266269 extern void __audit_getname(struct filename *name);
267270
268−#define AUDIT_INODE_PARENT 1 /* dentry represents the parent */
269−#define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */
270−#define AUDIT_INODE_NOEVAL 4 /* audit record incomplete */
271271 extern void __audit_inode(struct filename *name, const struct dentry *dentry,
272272 unsigned int flags);
273273 extern void __audit_file(const struct file *);
@@ -328,16 +328,9 @@ static inline void audit_getname(struct filename *name) · 54 unmodified lines
328328 }
329329 static inline void audit_inode(struct filename *name,
330330 const struct dentry *dentry,
331− unsigned int flags) {
332− if (unlikely(!audit_dummy_context())) {
333− unsigned int aflags = 0;
334−
335− if (flags & LOOKUP_PARENT)
336− aflags |= AUDIT_INODE_PARENT;
337− if (flags & LOOKUP_NO_EVAL)
338− aflags |= AUDIT_INODE_NOEVAL;
331+ unsigned int aflags) {
332+ if (unlikely(!audit_dummy_context()))
339333 __audit_inode(name, dentry, aflags);
340− }
341334 }
342335 static inline void audit_file(struct file *file)
343336 {
@@ -561,7 +554,7 @@ static inline void __audit_inode_child(struct inode *parent, · 217 unmodified lines
561554 { }
562555 static inline void audit_inode(struct filename *name,
563556 const struct dentry *dentry,
564− unsigned int parent)
557+ unsigned int aflags)
565558 { }
566559 static inline void audit_file(struct file *file)
567560 {
include/linux/backing-dev-defs.h+23−0
@@ -63,10 +63,31 @@ enum wb_reason { · 62 unmodified lines
6363 * so it has a mismatch name.
6464 */
6565 WB_REASON_FORKER_THREAD,
66+ WB_REASON_FOREIGN_FLUSH,
6667
6768 WB_REASON_MAX,
6869 };
6970
71+struct wb_completion {
72+ atomic_t cnt;
73+ wait_queue_head_t *waitq;
74+};
75+
76+#define __WB_COMPLETION_INIT(_waitq) \
77+ (struct wb_completion){ .cnt = ATOMIC_INIT(1), .waitq = (_waitq) }
78+
79+/*
80+ * If one wants to wait for one or more wb_writeback_works, each work's
81+ * ->done should be set to a wb_completion defined using the following
82+ * macro. Once all work items are issued with wb_queue_work(), the caller
83+ * can wait for the completion of all using wb_wait_for_completion(). Work
84+ * items which are waited upon aren't freed automatically on completion.
85+ */
86+#define WB_COMPLETION_INIT(bdi) __WB_COMPLETION_INIT(&(bdi)->wb_waitq)
87+
88+#define DEFINE_WB_COMPLETION(cmpl, bdi) \
89+ struct wb_completion cmpl = WB_COMPLETION_INIT(bdi)
90+
7091 /*
7192 * For cgroup writeback, multiple wb's may map to the same blkcg. Those
7293 * wb's can operate mostly independently but should share the congested
@@ -165,6 +186,8 @@ struct bdi_writeback { · 92 unmodified lines
165186 };
166187
167188 struct backing_dev_info {
189+ u64 id;
190+ struct rb_node rb_node; /* keyed by ->id */
168191 struct list_head bdi_list;
169192 unsigned long ra_pages; /* max readahead in PAGE_SIZE units */
170193 unsigned long io_pages; /* max allowed IO size */
include/linux/backing-dev.h+5−0
@@ -24,6 +24,7 @@ static inline struct backing_dev_info *bdi_get(struct backing_dev_info *bdi) · 23 unmodified lines
2424 return bdi;
2525 }
2626
27+struct backing_dev_info *bdi_get_by_id(u64 id);
2728 void bdi_put(struct backing_dev_info *bdi);
2829
2930 __printf(2, 3)
@@ -44,6 +45,8 @@ void wb_start_background_writeback(struct bdi_writeback *wb); · 14 unmodified lines
4445 void wb_workfn(struct work_struct *work);
4546 void wb_wakeup_delayed(struct bdi_writeback *wb);
4647
48+void wb_wait_for_completion(struct wb_completion *done);
49+
4750 extern spinlock_t bdi_lock;
4851 extern struct list_head bdi_list;
4952
@@ -227,6 +230,8 @@ static inline int bdi_sched_wait(void *word) · 177 unmodified lines
227230 struct bdi_writeback_congested *
228231 wb_congested_get_create(struct backing_dev_info *bdi, int blkcg_id, gfp_t gfp);
229232 void wb_congested_put(struct bdi_writeback_congested *congested);
233+struct bdi_writeback *wb_get_lookup(struct backing_dev_info *bdi,
234+ struct cgroup_subsys_state *memcg_css);
230235 struct bdi_writeback *wb_get_create(struct backing_dev_info *bdi,
231236 struct cgroup_subsys_state *memcg_css,
232237 gfp_t gfp);
include/linux/backlight.h+8−0
@@ -46,6 +46,12 @@ enum backlight_notification { · 45 unmodified lines
4646 BACKLIGHT_UNREGISTERED,
4747 };
4848
49+enum backlight_scale {
50+ BACKLIGHT_SCALE_UNKNOWN = 0,
51+ BACKLIGHT_SCALE_LINEAR,
52+ BACKLIGHT_SCALE_NON_LINEAR,
53+};
54+
4955 struct backlight_device;
5056 struct fb_info;
5157
@@ -80,6 +86,8 @@ struct backlight_properties { · 28 unmodified lines
8086 enum backlight_type type;
8187 /* Flags used to signal drivers of state changes */
8288 unsigned int state;
89+ /* Type of the brightness scale (linear, non-linear, ...) */
90+ enum backlight_scale scale;
8391
8492 #define BL_CORE_SUSPENDED (1 << 0) /* backlight is suspended */
8593 #define BL_CORE_FBBLANK (1 << 1) /* backlight is under an fb blank event */
include/linux/bitmap.h+23−0
@@ -120,6 +120,10 @@ extern int __bitmap_empty(const unsigned long *bitmap, unsigned int nbits); · 119 unmodified lines
120120 extern int __bitmap_full(const unsigned long *bitmap, unsigned int nbits);
121121 extern int __bitmap_equal(const unsigned long *bitmap1,
122122 const unsigned long *bitmap2, unsigned int nbits);
123+extern bool __pure __bitmap_or_equal(const unsigned long *src1,
124+ const unsigned long *src2,
125+ const unsigned long *src3,
126+ unsigned int nbits);
123127 extern void __bitmap_complement(unsigned long *dst, const unsigned long *src,
124128 unsigned int nbits);
125129 extern void __bitmap_shift_right(unsigned long *dst, const unsigned long *src,
@@ -321,6 +325,25 @@ static inline int bitmap_equal(const unsigned long *src1, · 195 unmodified lines
321325 return __bitmap_equal(src1, src2, nbits);
322326 }
323327
328+/**
329+ * bitmap_or_equal - Check whether the or of two bitnaps is equal to a third
330+ * @src1: Pointer to bitmap 1
331+ * @src2: Pointer to bitmap 2 will be or'ed with bitmap 1
332+ * @src3: Pointer to bitmap 3. Compare to the result of *@src1 | *@src2
333+ *
334+ * Returns: True if (*@src1 | *@src2) == *@src3, false otherwise
335+ */
336+static inline bool bitmap_or_equal(const unsigned long *src1,
337+ const unsigned long *src2,
338+ const unsigned long *src3,
339+ unsigned int nbits)
340+{
341+ if (!small_const_nbits(nbits))
342+ return __bitmap_or_equal(src1, src2, src3, nbits);
343+
344+ return !(((*src1 | *src2) ^ *src3) & BITMAP_LAST_WORD_MASK(nbits));
345+}
346+
324347 static inline int bitmap_intersects(const unsigned long *src1,
325348 const unsigned long *src2, unsigned int nbits)
326349 {
include/linux/blk-cgroup.h+5−2
@@ -149,7 +149,8 @@ typedef struct blkcg_policy_data *(blkcg_pol_alloc_cpd_fn)(gfp_t gfp); · 148 unmodified lines
149149 typedef void (blkcg_pol_init_cpd_fn)(struct blkcg_policy_data *cpd);
150150 typedef void (blkcg_pol_free_cpd_fn)(struct blkcg_policy_data *cpd);
151151 typedef void (blkcg_pol_bind_cpd_fn)(struct blkcg_policy_data *cpd);
152−typedef struct blkg_policy_data *(blkcg_pol_alloc_pd_fn)(gfp_t gfp, int node);
152+typedef struct blkg_policy_data *(blkcg_pol_alloc_pd_fn)(gfp_t gfp,
153+ struct request_queue *q, struct blkcg *blkcg);
153154 typedef void (blkcg_pol_init_pd_fn)(struct blkg_policy_data *pd);
154155 typedef void (blkcg_pol_online_pd_fn)(struct blkg_policy_data *pd);
155156 typedef void (blkcg_pol_offline_pd_fn)(struct blkg_policy_data *pd);
@@ -181,6 +182,7 @@ struct blkcg_policy { · 25 unmodified lines
181182
182183 extern struct blkcg blkcg_root;
183184 extern struct cgroup_subsys_state * const blkcg_root_css;
185+extern bool blkcg_debug_stats;
184186
185187 struct blkcg_gq *blkg_lookup_slowpath(struct blkcg *blkcg,
186188 struct request_queue *q, bool update_hint);
@@ -232,6 +234,7 @@ struct blkg_conf_ctx { · 45 unmodified lines
232234 char *body;
233235 };
234236
237+struct gendisk *blkcg_conf_get_disk(char **inputp);
235238 int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
236239 char *input, struct blkg_conf_ctx *ctx);
237240 void blkg_conf_finish(struct blkg_conf_ctx *ctx);
@@ -374,7 +377,7 @@ static inline struct blkcg_gq *__blkg_lookup(struct blkcg *blkcg, · 136 unmodified lines
374377 * @q: request_queue of interest
375378 *
376379 * Lookup blkg for the @blkcg - @q pair. This function should be called
377− * under RCU read loc.
380+ * under RCU read lock.
378381 */
379382 static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg,
380383 struct request_queue *q)
include/linux/blk-mq.h+17−3
@@ -140,6 +140,7 @@ typedef int (poll_fn)(struct blk_mq_hw_ctx *); · 139 unmodified lines
140140 typedef int (map_queues_fn)(struct blk_mq_tag_set *set);
141141 typedef bool (busy_fn)(struct request_queue *);
142142 typedef void (complete_fn)(struct request *);
143+typedef void (cleanup_rq_fn)(struct request *);
143144
144145
145146 struct blk_mq_ops {
@@ -200,6 +201,12 @@ struct blk_mq_ops { · 54 unmodified lines
200201 /* Called from inside blk_get_request() */
201202 void (*initialize_rq_fn)(struct request *rq);
202203
204+ /*
205+ * Called before freeing one request which isn't completed yet,
206+ * and usually for freeing the driver private data
207+ */
208+ cleanup_rq_fn *cleanup_rq;
209+
203210 /*
204211 * If set, returns whether or not this queue currently is busy
205212 */
@@ -241,12 +248,12 @@ enum { · 35 unmodified lines
241248
242249 struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *);
243250 struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
244− struct request_queue *q);
251+ struct request_queue *q,
252+ bool elevator_init);
245253 struct request_queue *blk_mq_init_sq_queue(struct blk_mq_tag_set *set,
246254 const struct blk_mq_ops *ops,
247255 unsigned int queue_depth,
248256 unsigned int set_flags);
249−int blk_mq_register_dev(struct device *, struct request_queue *);
250257 void blk_mq_unregister_dev(struct device *, struct request_queue *);
251258
252259 int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set);
@@ -296,6 +303,7 @@ static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag) · 43 unmodified lines
296303
297304
298305 int blk_mq_request_started(struct request *rq);
306+int blk_mq_request_completed(struct request *rq);
299307 void blk_mq_start_request(struct request *rq);
300308 void blk_mq_end_request(struct request *rq, blk_status_t error);
301309 void __blk_mq_end_request(struct request *rq, blk_status_t error);
@@ -304,7 +312,6 @@ void blk_mq_requeue_request(struct request *rq, bool kick_requeue_list); · 2 unmodified lines
304312 void blk_mq_kick_requeue_list(struct request_queue *q);
305313 void blk_mq_delay_kick_requeue_list(struct request_queue *q, unsigned long msecs);
306314 bool blk_mq_complete_request(struct request *rq);
307−void blk_mq_complete_request_sync(struct request *rq);
308315 bool blk_mq_bio_list_merge(struct request_queue *q, struct list_head *list,
309316 struct bio *bio, unsigned int nr_segs);
310317 bool blk_mq_queue_stopped(struct request_queue *q);
@@ -321,6 +328,7 @@ bool blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async); · 10 unmodified lines
321328 void blk_mq_run_hw_queues(struct request_queue *q, bool async);
322329 void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
323330 busy_tag_iter_fn *fn, void *priv);
331+void blk_mq_tagset_wait_completed_request(struct blk_mq_tag_set *tagset);
324332 void blk_mq_freeze_queue(struct request_queue *q);
325333 void blk_mq_unfreeze_queue(struct request_queue *q);
326334 void blk_freeze_queue_start(struct request_queue *q);
@@ -366,4 +374,10 @@ static inline blk_qc_t request_to_qc_t(struct blk_mq_hw_ctx *hctx, · 39 unmodified lines
366374 BLK_QC_T_INTERNAL;
367375 }
368376
377+static inline void blk_mq_cleanup_rq(struct request *rq)
378+{
379+ if (rq->q->mq_ops->cleanup_rq)
380+ rq->q->mq_ops->cleanup_rq(rq);
381+}
382+
369383 #endif
include/linux/blk_types.h+10−1
@@ -169,6 +169,9 @@ struct bio { · 168 unmodified lines
169169 */
170170 struct blkcg_gq *bi_blkg;
171171 struct bio_issue bi_issue;
172+#ifdef CONFIG_BLK_CGROUP_IOCOST
173+ u64 bi_iocost_cost;
174+#endif
172175 #endif
173176 union {
174177 #if defined(CONFIG_BLK_DEV_INTEGRITY)
@@ -209,6 +212,7 @@ enum { · 34 unmodified lines
209212 BIO_BOUNCED, /* bio is a bounce bio */
210213 BIO_USER_MAPPED, /* contains user pages */
211214 BIO_NULL_MAPPED, /* contains invalid user pages */
215+ BIO_WORKINGSET, /* contains userspace workingset pages */
212216 BIO_QUIET, /* Make BIO Quiet */
213217 BIO_CHAIN, /* chained bio, ->bi_remaining in effect */
214218 BIO_REFFED, /* bio has elevated ->bi_cnt */
@@ -282,6 +286,8 @@ enum req_opf { · 67 unmodified lines
282286 REQ_OP_ZONE_RESET = 6,
283287 /* write the same sector many times */
284288 REQ_OP_WRITE_SAME = 7,
289+ /* reset all the zone present on the device */
290+ REQ_OP_ZONE_RESET_ALL = 8,
285291 /* write the zero filled sector many times */
286292 REQ_OP_WRITE_ZEROES = 9,
287293
@@ -311,6 +317,7 @@ enum req_flag_bits { · 23 unmodified lines
311317 __REQ_RAHEAD, /* read ahead, can fail anytime */
312318 __REQ_BACKGROUND, /* background IO */
313319 __REQ_NOWAIT, /* Don't wait if request will block */
320+ __REQ_NOWAIT_INLINE, /* Return would-block error inline */
314321 /*
315322 * When a shared kthread needs to issue a bio for a cgroup, doing
316323 * so synchronously can lead to priority inversions as the kthread
@@ -345,6 +352,7 @@ enum req_flag_bits { · 28 unmodified lines
345352 #define REQ_RAHEAD (1ULL << __REQ_RAHEAD)
346353 #define REQ_BACKGROUND (1ULL << __REQ_BACKGROUND)
347354 #define REQ_NOWAIT (1ULL << __REQ_NOWAIT)
355+#define REQ_NOWAIT_INLINE (1ULL << __REQ_NOWAIT_INLINE)
348356 #define REQ_CGROUP_PUNT (1ULL << __REQ_CGROUP_PUNT)
349357
350358 #define REQ_NOUNMAP (1ULL << __REQ_NOUNMAP)
@@ -418,12 +426,13 @@ static inline int op_stat_group(unsigned int op) · 67 unmodified lines
418426
419427 typedef unsigned int blk_qc_t;
420428 #define BLK_QC_T_NONE -1U
429+#define BLK_QC_T_EAGAIN -2U
421430 #define BLK_QC_T_SHIFT 16
422431 #define BLK_QC_T_INTERNAL (1U << 31)
423432
424433 static inline bool blk_qc_t_valid(blk_qc_t cookie)
425434 {
426− return cookie != BLK_QC_T_NONE;
435+ return cookie != BLK_QC_T_NONE && cookie != BLK_QC_T_EAGAIN;
427436 }
428437
429438 static inline unsigned int blk_qc_t_to_queue_num(blk_qc_t cookie)
include/linux/blkdev.h+55−24
@@ -194,7 +194,11 @@ struct request { · 193 unmodified lines
194194
195195 struct gendisk *rq_disk;
196196 struct hd_struct *part;
197− /* Time that I/O was submitted to the kernel. */
197+#ifdef CONFIG_BLK_RQ_ALLOC_TIME
198+ /* Time that the first bio started allocating this request. */
199+ u64 alloc_time_ns;
200+#endif
201+ /* Time that this request was allocated for this IO. */
198202 u64 start_time_ns;
199203 /* Time that I/O was submitted to the device. */
200204 u64 io_start_time_ns;
@@ -202,9 +206,12 @@ struct request { · 1 unmodified line
202206 #ifdef CONFIG_BLK_WBT
203207 unsigned short wbt_flags;
204208 #endif
205−#ifdef CONFIG_BLK_DEV_THROTTLING_LOW
206− unsigned short throtl_size;
207−#endif
209+ /*
210+ * rq sectors used for blk stats. It has the same value
211+ * with blk_rq_sectors(rq), except that it never be zeroed
212+ * by completion.
213+ */
214+ unsigned short stats_sectors;
208215
209216 /*
210217 * Number of scatter-gather DMA addr+len pairs after
@@ -391,10 +398,6 @@ static inline int blkdev_reset_zones_ioctl(struct block_device *bdev, · 180 unmodified lines
391398 #endif /* CONFIG_BLK_DEV_ZONED */
392399
393400 struct request_queue {
394− /*
395− * Together with queue_head for cacheline sharing
396− */
397− struct list_head queue_head;
398401 struct request *last_merge;
399402 struct elevator_queue *elevator;
400403
@@ -496,6 +499,8 @@ struct request_queue { · 95 unmodified lines
496499
497500 struct queue_limits limits;
498501
502+ unsigned int required_elevator_features;
503+
499504 #ifdef CONFIG_BLK_DEV_ZONED
500505 /*
501506 * Zoned block device information for request dispatch control.
@@ -539,6 +544,7 @@ struct request_queue { · 37 unmodified lines
539544 struct delayed_work requeue_work;
540545
541546 struct mutex sysfs_lock;
547+ struct mutex sysfs_dir_lock;
542548
543549 /*
544550 * for reusing dead hctx instance in case of updating
@@ -611,6 +617,8 @@ struct request_queue { · 66 unmodified lines
611617 #define QUEUE_FLAG_SCSI_PASSTHROUGH 23 /* queue supports SCSI commands */
612618 #define QUEUE_FLAG_QUIESCED 24 /* queue has been quiesced */
613619 #define QUEUE_FLAG_PCI_P2PDMA 25 /* device supports PCI p2p requests */
620+#define QUEUE_FLAG_ZONE_RESETALL 26 /* supports Zone Reset All */
621+#define QUEUE_FLAG_RQ_ALLOC_TIME 27 /* record rq->alloc_time_ns */
614622
615623 #define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
616624 (1 << QUEUE_FLAG_SAME_COMP))
@@ -630,6 +638,8 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q); · 13 unmodified lines
630638 #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
631639 #define blk_queue_add_random(q) test_bit(QUEUE_FLAG_ADD_RANDOM, &(q)->queue_flags)
632640 #define blk_queue_discard(q) test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags)
641+#define blk_queue_zone_resetall(q) \
642+ test_bit(QUEUE_FLAG_ZONE_RESETALL, &(q)->queue_flags)
633643 #define blk_queue_secure_erase(q) \
634644 (test_bit(QUEUE_FLAG_SECERASE, &(q)->queue_flags))
635645 #define blk_queue_dax(q) test_bit(QUEUE_FLAG_DAX, &(q)->queue_flags)
@@ -637,6 +647,12 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q); · 1 unmodified line
637647 test_bit(QUEUE_FLAG_SCSI_PASSTHROUGH, &(q)->queue_flags)
638648 #define blk_queue_pci_p2pdma(q) \
639649 test_bit(QUEUE_FLAG_PCI_P2PDMA, &(q)->queue_flags)
650+#ifdef CONFIG_BLK_RQ_ALLOC_TIME
651+#define blk_queue_rq_alloc_time(q) \
652+ test_bit(QUEUE_FLAG_RQ_ALLOC_TIME, &(q)->queue_flags)
653+#else
654+#define blk_queue_rq_alloc_time(q) false
655+#endif
640656
641657 #define blk_noretry_request(rq) \
642658 ((rq)->cmd_flags & (REQ_FAILFAST_DEV|REQ_FAILFAST_TRANSPORT| \
@@ -644,6 +660,7 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q); · 1 unmodified line
644660 #define blk_queue_quiesced(q) test_bit(QUEUE_FLAG_QUIESCED, &(q)->queue_flags)
645661 #define blk_queue_pm_only(q) atomic_read(&(q)->pm_only)
646662 #define blk_queue_fua(q) test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags)
663+#define blk_queue_registered(q) test_bit(QUEUE_FLAG_REGISTERED, &(q)->queue_flags)
647664
648665 extern void blk_set_pm_only(struct request_queue *q);
649666 extern void blk_clear_pm_only(struct request_queue *q);
@@ -903,6 +920,7 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev) · 253 unmodified lines
903920 * blk_rq_err_bytes() : bytes left till the next error boundary
904921 * blk_rq_sectors() : sectors left in the entire request
905922 * blk_rq_cur_sectors() : sectors left in the current segment
923+ * blk_rq_stats_sectors() : sectors of the entire request used for stats
906924 */
907925 static inline sector_t blk_rq_pos(const struct request *rq)
908926 {
@@ -931,6 +949,11 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq) · 22 unmodified lines
931949 return blk_rq_cur_bytes(rq) >> SECTOR_SHIFT;
932950 }
933951
952+static inline unsigned int blk_rq_stats_sectors(const struct request *rq)
953+{
954+ return rq->stats_sectors;
955+}
956+
934957 #ifdef CONFIG_BLK_DEV_ZONED
935958 static inline unsigned int blk_rq_zone_no(struct request *rq)
936959 {
@@ -1085,6 +1108,10 @@ extern void blk_queue_dma_alignment(struct request_queue *, int); · 148 unmodified lines
10851108 extern void blk_queue_update_dma_alignment(struct request_queue *, int);
10861109 extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
10871110 extern void blk_queue_write_cache(struct request_queue *q, bool enabled, bool fua);
1111+extern void blk_queue_required_elevator_features(struct request_queue *q,
1112+ unsigned int features);
1113+extern bool blk_queue_can_use_dma_map_merging(struct request_queue *q,
1114+ struct device *dev);
10881115
10891116 /*
10901117 * Number of physical segments as sent to the device.
@@ -1232,42 +1259,42 @@ enum blk_default_limits { · 141 unmodified lines
12321259 BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL,
12331260 };
12341261
1235−static inline unsigned long queue_segment_boundary(struct request_queue *q)
1262+static inline unsigned long queue_segment_boundary(const struct request_queue *q)
12361263 {
12371264 return q->limits.seg_boundary_mask;
12381265 }
12391266
1240−static inline unsigned long queue_virt_boundary(struct request_queue *q)
1267+static inline unsigned long queue_virt_boundary(const struct request_queue *q)
12411268 {
12421269 return q->limits.virt_boundary_mask;
12431270 }
12441271
1245−static inline unsigned int queue_max_sectors(struct request_queue *q)
1272+static inline unsigned int queue_max_sectors(const struct request_queue *q)
12461273 {
12471274 return q->limits.max_sectors;
12481275 }
12491276
1250−static inline unsigned int queue_max_hw_sectors(struct request_queue *q)
1277+static inline unsigned int queue_max_hw_sectors(const struct request_queue *q)
12511278 {
12521279 return q->limits.max_hw_sectors;
12531280 }
12541281
1255−static inline unsigned short queue_max_segments(struct request_queue *q)
1282+static inline unsigned short queue_max_segments(const struct request_queue *q)
12561283 {
12571284 return q->limits.max_segments;
12581285 }
12591286
1260−static inline unsigned short queue_max_discard_segments(struct request_queue *q)
1287+static inline unsigned short queue_max_discard_segments(const struct request_queue *q)
12611288 {
12621289 return q->limits.max_discard_segments;
12631290 }
12641291
1265−static inline unsigned int queue_max_segment_size(struct request_queue *q)
1292+static inline unsigned int queue_max_segment_size(const struct request_queue *q)
12661293 {
12671294 return q->limits.max_segment_size;
12681295 }
12691296
1270−static inline unsigned short queue_logical_block_size(struct request_queue *q)
1297+static inline unsigned short queue_logical_block_size(const struct request_queue *q)
12711298 {
12721299 int retval = 512;
12731300
@@ -1282,7 +1309,7 @@ static inline unsigned short bdev_logical_block_size(struct block_device *bdev) · 8 unmodified lines
12821309 return queue_logical_block_size(bdev_get_queue(bdev));
12831310 }
12841311
1285−static inline unsigned int queue_physical_block_size(struct request_queue *q)
1312+static inline unsigned int queue_physical_block_size(const struct request_queue *q)
12861313 {
12871314 return q->limits.physical_block_size;
12881315 }
@@ -1292,7 +1319,7 @@ static inline unsigned int bdev_physical_block_size(struct block_device *bdev) · 3 unmodified lines
12921319 return queue_physical_block_size(bdev_get_queue(bdev));
12931320 }
12941321
1295−static inline unsigned int queue_io_min(struct request_queue *q)
1322+static inline unsigned int queue_io_min(const struct request_queue *q)
12961323 {
12971324 return q->limits.io_min;
12981325 }
@@ -1302,7 +1329,7 @@ static inline int bdev_io_min(struct block_device *bdev) · 3 unmodified lines
13021329 return queue_io_min(bdev_get_queue(bdev));
13031330 }
13041331
1305−static inline unsigned int queue_io_opt(struct request_queue *q)
1332+static inline unsigned int queue_io_opt(const struct request_queue *q)
13061333 {
13071334 return q->limits.io_opt;
13081335 }
@@ -1312,7 +1339,7 @@ static inline int bdev_io_opt(struct block_device *bdev) · 3 unmodified lines
13121339 return queue_io_opt(bdev_get_queue(bdev));
13131340 }
13141341
1315−static inline int queue_alignment_offset(struct request_queue *q)
1342+static inline int queue_alignment_offset(const struct request_queue *q)
13161343 {
13171344 if (q->limits.misaligned)
13181345 return -1;
@@ -1342,7 +1369,7 @@ static inline int bdev_alignment_offset(struct block_device *bdev) · 23 unmodified lines
13421369 return q->limits.alignment_offset;
13431370 }
13441371
1345−static inline int queue_discard_alignment(struct request_queue *q)
1372+static inline int queue_discard_alignment(const struct request_queue *q)
13461373 {
13471374 if (q->limits.discard_misaligned)
13481375 return -1;
@@ -1432,7 +1459,7 @@ static inline sector_t bdev_zone_sectors(struct block_device *bdev) · 83 unmodified lines
14321459 return 0;
14331460 }
14341461
1435−static inline int queue_dma_alignment(struct request_queue *q)
1462+static inline int queue_dma_alignment(const struct request_queue *q)
14361463 {
14371464 return q ? q->dma_alignment : 511;
14381465 }
@@ -1497,10 +1524,14 @@ struct blk_integrity_iter { · 58 unmodified lines
14971524 };
14981525
14991526 typedef blk_status_t (integrity_processing_fn) (struct blk_integrity_iter *);
1527+typedef void (integrity_prepare_fn) (struct request *);
1528+typedef void (integrity_complete_fn) (struct request *, unsigned int);
15001529
15011530 struct blk_integrity_profile {
15021531 integrity_processing_fn *generate_fn;
15031532 integrity_processing_fn *verify_fn;
1533+ integrity_prepare_fn *prepare_fn;
1534+ integrity_complete_fn *complete_fn;
15041535 const char *name;
15051536 };
15061537
@@ -1543,7 +1574,7 @@ static inline void blk_queue_max_integrity_segments(struct request_queue *q, · 36 unmodified lines
15431574 }
15441575
15451576 static inline unsigned short
1546−queue_max_integrity_segments(struct request_queue *q)
1577+queue_max_integrity_segments(const struct request_queue *q)
15471578 {
15481579 return q->limits.max_integrity_segments;
15491580 }
@@ -1626,7 +1657,7 @@ static inline void blk_queue_max_integrity_segments(struct request_queue *q, · 76 unmodified lines
16261657 unsigned int segs)
16271658 {
16281659 }
1629−static inline unsigned short queue_max_integrity_segments(struct request_queue *q)
1660+static inline unsigned short queue_max_integrity_segments(const struct request_queue *q)
16301661 {
16311662 return 0;
16321663 }
include/linux/bpf.h+9−7
@@ -24,6 +24,9 @@ struct seq_file; · 23 unmodified lines
2424 struct btf;
2525 struct btf_type;
2626
27+extern struct idr btf_idr;
28+extern spinlock_t btf_idr_lock;
29+
2730 /* map is generic key/value storage optionally accesible by eBPF programs */
2831 struct bpf_map_ops {
2932 /* funcs callable from userspace (via syscall) */
@@ -647,6 +650,8 @@ void bpf_map_free_id(struct bpf_map *map, bool do_idr_lock); · 617 unmodified lines
647650 struct bpf_map *bpf_map_get_with_uref(u32 ufd);
648651 struct bpf_map *__bpf_map_get(struct fd f);
649652 struct bpf_map * __must_check bpf_map_inc(struct bpf_map *map, bool uref);
653+struct bpf_map * __must_check bpf_map_inc_not_zero(struct bpf_map *map,
654+ bool uref);
650655 void bpf_map_put_with_uref(struct bpf_map *map);
651656 void bpf_map_put(struct bpf_map *map);
652657 int bpf_map_charge_memlock(struct bpf_map *map, u32 pages);
@@ -713,7 +718,7 @@ struct xdp_buff; · 60 unmodified lines
713718 struct sk_buff;
714719
715720 struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key);
716−void __dev_map_insert_ctx(struct bpf_map *map, u32 index);
721+struct bpf_dtab_netdev *__dev_map_hash_lookup_elem(struct bpf_map *map, u32 key);
717722 void __dev_map_flush(struct bpf_map *map);
718723 int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,
719724 struct net_device *dev_rx);
@@ -721,7 +726,6 @@ int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb, · 1 unmodified line
721726 struct bpf_prog *xdp_prog);
722727
723728 struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key);
724−void __cpu_map_insert_ctx(struct bpf_map *map, u32 index);
725729 void __cpu_map_flush(struct bpf_map *map);
726730 int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_buff *xdp,
727731 struct net_device *dev_rx);
@@ -801,8 +805,10 @@ static inline struct net_device *__dev_map_lookup_elem(struct bpf_map *map, · 73 unmodified lines
801805 return NULL;
802806 }
803807
804−static inline void __dev_map_insert_ctx(struct bpf_map *map, u32 index)
808+static inline struct net_device *__dev_map_hash_lookup_elem(struct bpf_map *map,
809+ u32 key)
805810 {
811+ return NULL;
806812 }
807813
808814 static inline void __dev_map_flush(struct bpf_map *map)
@@ -834,10 +840,6 @@ struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key) · 25 unmodified lines
834840 return NULL;
835841 }
836842
837−static inline void __cpu_map_insert_ctx(struct bpf_map *map, u32 index)
838−{
839−}
840−
841843 static inline void __cpu_map_flush(struct bpf_map *map)
842844 {
843845 }
include/linux/bpf_types.h+1−0
@@ -62,6 +62,7 @@ BPF_MAP_TYPE(BPF_MAP_TYPE_ARRAY_OF_MAPS, array_of_maps_map_ops) · 61 unmodified lines
6262 BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops)
6363 #ifdef CONFIG_NET
6464 BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)
65+BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP_HASH, dev_map_hash_ops)
6566 BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
6667 #if defined(CONFIG_BPF_STREAM_PARSER)
6768 BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)
include/linux/bpf_verifier.h+1−0
@@ -355,6 +355,7 @@ struct bpf_verifier_env { · 354 unmodified lines
355355 struct bpf_verifier_stack_elem *head; /* stack of verifier states to be processed */
356356 int stack_size; /* number of states to be processed */
357357 bool strict_alignment; /* perform strict pointer alignment checks */
358+ bool test_state_freq; /* test verifier with different pruning frequency */
358359 struct bpf_verifier_state *cur_state; /* current verifier state */
359360 struct bpf_verifier_state_list **explored_states; /* search pruning optimization */
360361 struct bpf_verifier_state_list *free_list;
include/linux/bug.h+5−0
@@ -47,6 +47,11 @@ void generic_bug_clear_once(void); · 46 unmodified lines
4747
4848 #else /* !CONFIG_GENERIC_BUG */
4949
50+static inline void *find_bug(unsigned long bugaddr)
51+{
52+ return NULL;
53+}
54+
5055 static inline enum bug_trap_type report_bug(unsigned long bug_addr,
5156 struct pt_regs *regs)
5257 {
include/linux/can/can-ml.h+68−0
@@ -0,0 +1,68 @@
1+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2+/* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
3+ * Copyright (c) 2017 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
4+ *
5+ * All rights reserved.
6+ *
7+ * Redistribution and use in source and binary forms, with or without
8+ * modification, are permitted provided that the following conditions
9+ * are met:
10+ * 1. Redistributions of source code must retain the above copyright
11+ * notice, this list of conditions and the following disclaimer.
12+ * 2. Redistributions in binary form must reproduce the above copyright
13+ * notice, this list of conditions and the following disclaimer in the
14+ * documentation and/or other materials provided with the distribution.
15+ * 3. Neither the name of Volkswagen nor the names of its contributors
16+ * may be used to endorse or promote products derived from this software
17+ * without specific prior written permission.
18+ *
19+ * Alternatively, provided that this notice is retained in full, this
20+ * software may be distributed under the terms of the GNU General
21+ * Public License ("GPL") version 2, in which case the provisions of the
22+ * GPL apply INSTEAD OF those given above.
23+ *
24+ * The provided data structures and external interfaces from this code
25+ * are not restricted to be used by modules with a GPL compatible license.
26+ *
27+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
38+ * DAMAGE.
39+ *
40+ */
41+
42+#ifndef CAN_ML_H
43+#define CAN_ML_H
44+
45+#include <linux/can.h>
46+#include <linux/list.h>
47+
48+#define CAN_SFF_RCV_ARRAY_SZ (1 << CAN_SFF_ID_BITS)
49+#define CAN_EFF_RCV_HASH_BITS 10
50+#define CAN_EFF_RCV_ARRAY_SZ (1 << CAN_EFF_RCV_HASH_BITS)
51+
52+enum { RX_ERR, RX_ALL, RX_FIL, RX_INV, RX_MAX };
53+
54+struct can_dev_rcv_lists {
55+ struct hlist_head rx[RX_MAX];
56+ struct hlist_head rx_sff[CAN_SFF_RCV_ARRAY_SZ];
57+ struct hlist_head rx_eff[CAN_EFF_RCV_ARRAY_SZ];
58+ int entries;
59+};
60+
61+struct can_ml_priv {
62+ struct can_dev_rcv_lists dev_rcv_lists;
63+#ifdef CAN_J1939
64+ struct j1939_priv *j1939_priv;
65+#endif
66+};
67+
68+#endif /* CAN_ML_H */
include/linux/can/core.h+9−2
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
22 /*
33 * linux/can/core.h
44 *
@@ -41,6 +41,14 @@ struct can_proto { · 36 unmodified lines
4141 struct proto *prot;
4242 };
4343
44+/* required_size
45+ * macro to find the minimum size of a struct
46+ * that includes a requested member
47+ */
48+#define CAN_REQUIRED_SIZE(struct_type, member) \
49+ (offsetof(typeof(struct_type), member) + \
50+ sizeof(((typeof(struct_type) *)(NULL))->member))
51+
4452 /* function prototypes for the CAN networklayer core (af_can.c) */
4553
4654 extern int can_proto_register(const struct can_proto *cp);
@@ -57,6 +65,5 @@ extern void can_rx_unregister(struct net *net, struct net_device *dev, · 10 unmodified lines
5765 void *data);
5866
5967 extern int can_send(struct sk_buff *skb, int loop);
60−extern int can_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
6168
6269 #endif /* !_CAN_CORE_H */
include/linux/can/dev.h+2−1
@@ -169,7 +169,8 @@ void can_change_state(struct net_device *dev, struct can_frame *cf, · 168 unmodified lines
169169
170170 void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
171171 unsigned int idx);
172−struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 *len_ptr);
172+struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx,
173+ u8 *len_ptr);
173174 unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx);
174175 void can_free_echo_skb(struct net_device *dev, unsigned int idx);
175176
include/linux/can/platform/rcar_can.h+0−18
@@ -1,18 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef _CAN_PLATFORM_RCAR_CAN_H_
3−#define _CAN_PLATFORM_RCAR_CAN_H_
4−
5−#include <linux/types.h>
6−
7−/* Clock Select Register settings */
8−enum CLKR {
9− CLKR_CLKP1 = 0, /* Peripheral clock (clkp1) */
10− CLKR_CLKP2 = 1, /* Peripheral clock (clkp2) */
11− CLKR_CLKEXT = 3 /* Externally input clock */
12−};
13−
14−struct rcar_can_platform_data {
15− enum CLKR clock_select; /* Clock source select */
16−};
17−
18−#endif /* !_CAN_PLATFORM_RCAR_CAN_H_ */
include/linux/can/rx-offload.h+9−4
@@ -15,7 +15,8 @@ · 14 unmodified lines
1515 struct can_rx_offload {
1616 struct net_device *dev;
1717
18− unsigned int (*mailbox_read)(struct can_rx_offload *offload, struct can_frame *cf,
18+ unsigned int (*mailbox_read)(struct can_rx_offload *offload,
19+ struct can_frame *cf,
1920 u32 *timestamp, unsigned int mb);
2021
2122 struct sk_buff_head skb_queue;
@@ -29,9 +30,13 @@ struct can_rx_offload { · 7 unmodified lines
2930 bool inc;
3031 };
3132
32−int can_rx_offload_add_timestamp(struct net_device *dev, struct can_rx_offload *offload);
33−int can_rx_offload_add_fifo(struct net_device *dev, struct can_rx_offload *offload, unsigned int weight);
34−int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload, u64 reg);
33+int can_rx_offload_add_timestamp(struct net_device *dev,
34+ struct can_rx_offload *offload);
35+int can_rx_offload_add_fifo(struct net_device *dev,
36+ struct can_rx_offload *offload,
37+ unsigned int weight);
38+int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload,
39+ u64 reg);
3540 int can_rx_offload_irq_offload_fifo(struct can_rx_offload *offload);
3641 int can_rx_offload_queue_sorted(struct can_rx_offload *offload,
3742 struct sk_buff *skb, u32 timestamp);
include/linux/can/skb.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
22 /*
33 * linux/can/skb.h
44 *
include/linux/ccp.h+2−0
@@ -170,6 +170,8 @@ struct ccp_aes_engine { · 169 unmodified lines
170170 enum ccp_aes_mode mode;
171171 enum ccp_aes_action action;
172172
173+ u32 authsize;
174+
173175 struct scatterlist *key;
174176 u32 key_len; /* In bytes */
175177
include/linux/ceph/buffer.h+2−1
@@ -30,7 +30,8 @@ static inline struct ceph_buffer *ceph_buffer_get(struct ceph_buffer *b) · 29 unmodified lines
3030
3131 static inline void ceph_buffer_put(struct ceph_buffer *b)
3232 {
33− kref_put(&b->kref, ceph_buffer_release);
33+ if (b)
34+ kref_put(&b->kref, ceph_buffer_release);
3435 }
3536
3637 extern int ceph_decode_buffer(struct ceph_buffer **b, void **p, void *end);
include/linux/ceph/libceph.h+1−0
@@ -293,6 +293,7 @@ struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private); · 292 unmodified lines
293293 struct ceph_entity_addr *ceph_client_addr(struct ceph_client *client);
294294 u64 ceph_client_gid(struct ceph_client *client);
295295 extern void ceph_destroy_client(struct ceph_client *client);
296+extern void ceph_reset_client_addr(struct ceph_client *client);
296297 extern int __ceph_open_session(struct ceph_client *client,
297298 unsigned long started);
298299 extern int ceph_open_session(struct ceph_client *client);
include/linux/ceph/messenger.h+1−0
@@ -337,6 +337,7 @@ extern void ceph_msgr_flush(void); · 336 unmodified lines
337337 extern void ceph_messenger_init(struct ceph_messenger *msgr,
338338 struct ceph_entity_addr *myaddr);
339339 extern void ceph_messenger_fini(struct ceph_messenger *msgr);
340+extern void ceph_messenger_reset_nonce(struct ceph_messenger *msgr);
340341
341342 extern void ceph_con_init(struct ceph_connection *con, void *private,
342343 const struct ceph_connection_operations *ops,
include/linux/ceph/mon_client.h+1−0
@@ -109,6 +109,7 @@ extern int ceph_monmap_contains(struct ceph_monmap *m, · 108 unmodified lines
109109
110110 extern int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl);
111111 extern void ceph_monc_stop(struct ceph_mon_client *monc);
112+extern void ceph_monc_reopen_session(struct ceph_mon_client *monc);
112113
113114 enum {
114115 CEPH_SUB_MONMAP = 0,
include/linux/ceph/osd_client.h+2−0
@@ -381,6 +381,7 @@ extern void ceph_osdc_cleanup(void); · 380 unmodified lines
381381 extern int ceph_osdc_init(struct ceph_osd_client *osdc,
382382 struct ceph_client *client);
383383 extern void ceph_osdc_stop(struct ceph_osd_client *osdc);
384+extern void ceph_osdc_reopen_osds(struct ceph_osd_client *osdc);
384385
385386 extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc,
386387 struct ceph_msg *msg);
@@ -388,6 +389,7 @@ extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, · 1 unmodified line
388389 struct ceph_msg *msg);
389390 void ceph_osdc_update_epoch_barrier(struct ceph_osd_client *osdc, u32 eb);
390391 void ceph_osdc_abort_requests(struct ceph_osd_client *osdc, int err);
392+void ceph_osdc_clear_abort_err(struct ceph_osd_client *osdc);
391393
392394 #define osd_req_op_data(oreq, whch, typ, fld) \
393395 ({ \
include/linux/cgroup.h+1−0
@@ -150,6 +150,7 @@ struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset, · 149 unmodified lines
150150 struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset,
151151 struct cgroup_subsys_state **dst_cssp);
152152
153+void cgroup_enable_task_cg_lists(void);
153154 void css_task_iter_start(struct cgroup_subsys_state *css, unsigned int flags,
154155 struct css_task_iter *it);
155156 struct task_struct *css_task_iter_next(struct css_task_iter *it);
include/linux/clk-provider.h+3−1
@@ -299,7 +299,8 @@ struct clk_init_data { · 298 unmodified lines
299299 * into the clk API
300300 *
301301 * @init: pointer to struct clk_init_data that contains the init data shared
302− * with the common clock framework.
302+ * with the common clock framework. This pointer will be set to NULL once
303+ * a clk_register() variant is called on this clk_hw pointer.
303304 */
304305 struct clk_hw {
305306 struct clk_core *core;
@@ -817,6 +818,7 @@ unsigned int clk_hw_get_num_parents(const struct clk_hw *hw); · 511 unmodified lines
817818 struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw);
818819 struct clk_hw *clk_hw_get_parent_by_index(const struct clk_hw *hw,
819820 unsigned int index);
821+int clk_hw_set_parent(struct clk_hw *hw, struct clk_hw *new_parent);
820822 unsigned int __clk_get_enable_count(struct clk *clk);
821823 unsigned long clk_hw_get_rate(const struct clk_hw *hw);
822824 unsigned long __clk_get_flags(struct clk *clk);
include/linux/clk.h+11−7
@@ -239,7 +239,8 @@ static inline int clk_prepare(struct clk *clk) · 238 unmodified lines
239239 return 0;
240240 }
241241
242−static inline int __must_check clk_bulk_prepare(int num_clks, struct clk_bulk_data *clks)
242+static inline int __must_check
243+clk_bulk_prepare(int num_clks, const struct clk_bulk_data *clks)
243244 {
244245 might_sleep();
245246 return 0;
@@ -263,7 +264,8 @@ static inline void clk_unprepare(struct clk *clk) · 17 unmodified lines
263264 {
264265 might_sleep();
265266 }
266−static inline void clk_bulk_unprepare(int num_clks, struct clk_bulk_data *clks)
267+static inline void clk_bulk_unprepare(int num_clks,
268+ const struct clk_bulk_data *clks)
267269 {
268270 might_sleep();
269271 }
@@ -359,6 +361,7 @@ int __must_check devm_clk_bulk_get(struct device *dev, int num_clks, · 89 unmodified lines
359361 /**
360362 * devm_clk_bulk_get_optional - managed get multiple optional consumer clocks
361363 * @dev: device for clock "consumer"
364+ * @num_clks: the number of clk_bulk_data
362365 * @clks: pointer to the clk_bulk_data table of consumer
363366 *
364367 * Behaves the same as devm_clk_bulk_get() except where there is no clock
@@ -819,7 +822,8 @@ static inline int clk_enable(struct clk *clk) · 454 unmodified lines
819822 return 0;
820823 }
821824
822−static inline int __must_check clk_bulk_enable(int num_clks, struct clk_bulk_data *clks)
825+static inline int __must_check clk_bulk_enable(int num_clks,
826+ const struct clk_bulk_data *clks)
823827 {
824828 return 0;
825829 }
@@ -828,7 +832,7 @@ static inline void clk_disable(struct clk *clk) {} · 2 unmodified lines
828832
829833
830834 static inline void clk_bulk_disable(int num_clks,
831− struct clk_bulk_data *clks) {}
835+ const struct clk_bulk_data *clks) {}
832836
833837 static inline unsigned long clk_get_rate(struct clk *clk)
834838 {
@@ -917,8 +921,8 @@ static inline void clk_disable_unprepare(struct clk *clk) · 82 unmodified lines
917921 clk_unprepare(clk);
918922 }
919923
920−static inline int __must_check clk_bulk_prepare_enable(int num_clks,
921− struct clk_bulk_data *clks)
924+static inline int __must_check
925+clk_bulk_prepare_enable(int num_clks, const struct clk_bulk_data *clks)
922926 {
923927 int ret;
924928
@@ -933,7 +937,7 @@ static inline int __must_check clk_bulk_prepare_enable(int num_clks, · 8 unmodified lines
933937 }
934938
935939 static inline void clk_bulk_disable_unprepare(int num_clks,
936− struct clk_bulk_data *clks)
940+ const struct clk_bulk_data *clks)
937941 {
938942 clk_bulk_disable(num_clks, clks);
939943 clk_bulk_unprepare(num_clks, clks);
include/linux/clk/clk-conf.h+5−0
@@ -4,6 +4,9 @@ · 3 unmodified lines
44 * Sylwester Nawrocki <s.nawrocki@samsung.com>
55 */
66
7+#ifndef __CLK_CONF_H
8+#define __CLK_CONF_H
9+
710 #include <linux/types.h>
811
912 struct device_node;
@@ -17,3 +20,5 @@ static inline int of_clk_set_defaults(struct device_node *node, · 7 unmodified lines
1720 return 0;
1821 }
1922 #endif
23+
24+#endif /* __CLK_CONF_H */
include/linux/compaction.h+17−5
@@ -129,11 +129,8 @@ static inline bool compaction_failed(enum compact_result result) · 128 unmodified lines
129129 return false;
130130 }
131131
132−/*
133− * Compaction has backed off for some reason. It might be throttling or
134− * lock contention. Retrying is still worthwhile.
135− */
136−static inline bool compaction_withdrawn(enum compact_result result)
132+/* Compaction needs reclaim to be performed first, so it can continue. */
133+static inline bool compaction_needs_reclaim(enum compact_result result)
137134 {
138135 /*
139136 * Compaction backed off due to watermark checks for order-0
@@ -142,6 +139,16 @@ static inline bool compaction_withdrawn(enum compact_result result) · 2 unmodified lines
142139 if (result == COMPACT_SKIPPED)
143140 return true;
144141
142+ return false;
143+}
144+
145+/*
146+ * Compaction has backed off for some reason after doing some work or none
147+ * at all. It might be throttling or lock contention. Retrying might be still
148+ * worthwhile, but with a higher priority if allowed.
149+ */
150+static inline bool compaction_withdrawn(enum compact_result result)
151+{
145152 /*
146153 * If compaction is deferred for high-order allocations, it is
147154 * because sync compaction recently failed. If this is the case
@@ -207,6 +214,11 @@ static inline bool compaction_failed(enum compact_result result) · 59 unmodified lines
207214 return false;
208215 }
209216
217+static inline bool compaction_needs_reclaim(enum compact_result result)
218+{
219+ return false;
220+}
221+
210222 static inline bool compaction_withdrawn(enum compact_result result)
211223 {
212224 return true;
include/linux/compiler.h+4−4
@@ -24,7 +24,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 23 unmodified lines
2424 long ______r; \
2525 static struct ftrace_likely_data \
2626 __aligned(4) \
27− __section("_ftrace_annotated_branch") \
27+ __section(_ftrace_annotated_branch) \
2828 ______f = { \
2929 .data.func = __func__, \
3030 .data.file = __FILE__, \
@@ -60,7 +60,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 29 unmodified lines
6060 #define __trace_if_value(cond) ({ \
6161 static struct ftrace_branch_data \
6262 __aligned(4) \
63− __section("_ftrace_branch") \
63+ __section(_ftrace_branch) \
6464 __if_trace = { \
6565 .func = __func__, \
6666 .file = __FILE__, \
@@ -118,7 +118,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 51 unmodified lines
118118 ".popsection\n\t"
119119
120120 /* Annotate a C jump table to allow objtool to follow the code flow */
121−#define __annotate_jump_table __section(".rodata..c_jump_table")
121+#define __annotate_jump_table __section(.rodata..c_jump_table)
122122
123123 #else
124124 #define annotate_reachable()
@@ -298,7 +298,7 @@ unsigned long read_word_at_a_time(const void *addr) · 173 unmodified lines
298298 * visible to the compiler.
299299 */
300300 #define __ADDRESSABLE(sym) \
301− static void * __section(".discard.addressable") __used \
301+ static void * __section(.discard.addressable) __used \
302302 __PASTE(__addressable_##sym, __LINE__) = (void *)&sym;
303303
304304 /**
include/linux/compiler_types.h+30−7
@@ -130,10 +130,6 @@ struct ftrace_likely_data { · 129 unmodified lines
130130
131131 /*
132132 * Force always-inline if the user requests it so via the .config.
133− * GCC does not warn about unused static inline functions for
134− * -Wunused-function. This turns out to avoid the need for complex #ifdef
135− * directives. Suppress the warning in clang as well by using "unused"
136− * function attribute, which is redundant but not harmful for gcc.
137133 * Prefer gnu_inline, so that extern inline functions do not emit an
138134 * externally visible function. This makes extern inline behave as per gnu89
139135 * semantics rather than c99. This prevents multiple symbol definition errors
@@ -144,14 +140,35 @@ struct ftrace_likely_data { · 4 unmodified lines
144140 */
145141 #if !defined(CONFIG_OPTIMIZE_INLINING)
146142 #define inline inline __attribute__((__always_inline__)) __gnu_inline \
147− __maybe_unused notrace
143+ __inline_maybe_unused notrace
148144 #else
149145 #define inline inline __gnu_inline \
150− __maybe_unused notrace
146+ __inline_maybe_unused notrace
151147 #endif
152148
149+/*
150+ * gcc provides both __inline__ and __inline as alternate spellings of
151+ * the inline keyword, though the latter is undocumented. New kernel
152+ * code should only use the inline spelling, but some existing code
153+ * uses __inline__. Since we #define inline above, to ensure
154+ * __inline__ has the same semantics, we need this #define.
155+ *
156+ * However, the spelling __inline is strictly reserved for referring
157+ * to the bare keyword.
158+ */
153159 #define __inline__ inline
154−#define __inline inline
160+
161+/*
162+ * GCC does not warn about unused static inline functions for -Wunused-function.
163+ * Suppress the warning in clang as well by using __maybe_unused, but enable it
164+ * for W=1 build. This will allow clang to find unused functions. Remove the
165+ * __inline_maybe_unused entirely after fixing most of -Wunused-function warnings.
166+ */
167+#ifdef KBUILD_EXTRA_WARN1
168+#define __inline_maybe_unused
169+#else
170+#define __inline_maybe_unused __maybe_unused
171+#endif
155172
156173 /*
157174 * Rather then using noinline to prevent stack consumption, use
@@ -189,6 +206,12 @@ struct ftrace_likely_data { · 31 unmodified lines
189206 #define asm_volatile_goto(x...) asm goto(x)
190207 #endif
191208
209+#ifdef CONFIG_CC_HAS_ASM_INLINE
210+#define asm_inline asm __inline
211+#else
212+#define asm_inline asm
213+#endif
214+
192215 #ifndef __no_fgcse
193216 # define __no_fgcse
194217 #endif
include/linux/connector.h+0−1
@@ -50,7 +50,6 @@ struct cn_dev { · 49 unmodified lines
5050
5151 u32 seq, groups;
5252 struct sock *nls;
53− void (*input) (struct sk_buff *skb);
5453
5554 struct cn_queue_dev *cbdev;
5655 };
include/linux/container.h+5−0
@@ -6,6 +6,9 @@ · 5 unmodified lines
66 * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
77 */
88
9+#ifndef _LINUX_CONTAINER_H
10+#define _LINUX_CONTAINER_H
11+
912 #include <linux/device.h>
1013
1114 /* drivers/base/power/container.c */
@@ -20,3 +23,5 @@ static inline struct container_dev *to_container_dev(struct device *dev) · 8 unmodified lines
2023 {
2124 return container_of(dev, struct container_dev, dev);
2225 }
26+
27+#endif /* _LINUX_CONTAINER_H */
include/linux/cpu.h+3−1
@@ -179,7 +179,7 @@ void arch_cpu_idle_dead(void); · 178 unmodified lines
179179 int cpu_report_state(int cpu);
180180 int cpu_check_up_prepare(int cpu);
181181 void cpu_set_state_online(int cpu);
182−void play_idle(unsigned long duration_ms);
182+void play_idle(unsigned long duration_us);
183183
184184 #ifdef CONFIG_HOTPLUG_CPU
185185 bool cpu_wait_death(unsigned int cpu, int seconds);
@@ -201,12 +201,14 @@ enum cpuhp_smt_control { · 15 unmodified lines
201201 extern enum cpuhp_smt_control cpu_smt_control;
202202 extern void cpu_smt_disable(bool force);
203203 extern void cpu_smt_check_topology(void);
204+extern bool cpu_smt_possible(void);
204205 extern int cpuhp_smt_enable(void);
205206 extern int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval);
206207 #else
207208 # define cpu_smt_control (CPU_SMT_NOT_IMPLEMENTED)
208209 static inline void cpu_smt_disable(bool force) { }
209210 static inline void cpu_smt_check_topology(void) { }
211+static inline bool cpu_smt_possible(void) { return false; }
210212 static inline int cpuhp_smt_enable(void) { return 0; }
211213 static inline int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) { return 0; }
212214 #endif
include/linux/cpufreq.h+2−2
@@ -456,8 +456,8 @@ static inline void cpufreq_resume(void) {} · 455 unmodified lines
456456 #define CPUFREQ_POSTCHANGE (1)
457457
458458 /* Policy Notifiers */
459−#define CPUFREQ_ADJUST (0)
460−#define CPUFREQ_NOTIFY (1)
459+#define CPUFREQ_CREATE_POLICY (0)
460+#define CPUFREQ_REMOVE_POLICY (1)
461461
462462 #ifdef CONFIG_CPU_FREQ
463463 int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);
include/linux/cpuidle.h+23−4
@@ -85,7 +85,9 @@ struct cpuidle_device { · 84 unmodified lines
8585 unsigned int cpu;
8686 ktime_t next_hrtimer;
8787
88+ int last_state_idx;
8889 int last_residency;
90+ u64 poll_limit_ns;
8991 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
9092 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
9193 struct cpuidle_driver_kobj *kobj_driver;
@@ -119,6 +121,9 @@ struct cpuidle_driver { · 27 unmodified lines
119121
120122 /* the driver handles the cpus in cpumask */
121123 struct cpumask *cpumask;
124+
125+ /* preferred governor to switch at register time */
126+ const char *governor;
122127 };
123128
124129 #ifdef CONFIG_CPU_IDLE
@@ -132,6 +137,8 @@ extern int cpuidle_select(struct cpuidle_driver *drv, · 7 unmodified lines
132137 extern int cpuidle_enter(struct cpuidle_driver *drv,
133138 struct cpuidle_device *dev, int index);
134139 extern void cpuidle_reflect(struct cpuidle_device *dev, int index);
140+extern u64 cpuidle_poll_time(struct cpuidle_driver *drv,
141+ struct cpuidle_device *dev);
135142
136143 extern int cpuidle_register_driver(struct cpuidle_driver *drv);
137144 extern struct cpuidle_driver *cpuidle_get_driver(void);
@@ -166,6 +173,9 @@ static inline int cpuidle_enter(struct cpuidle_driver *drv, · 28 unmodified lines
166173 struct cpuidle_device *dev, int index)
167174 {return -ENODEV; }
168175 static inline void cpuidle_reflect(struct cpuidle_device *dev, int index) { }
176+static inline u64 cpuidle_poll_time(struct cpuidle_driver *drv,
177+ struct cpuidle_device *dev)
178+{return 0; }
169179 static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
170180 {return -ENODEV; }
171181 static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
@@ -256,7 +266,10 @@ static inline int cpuidle_register_governor(struct cpuidle_governor *gov) · 84 unmodified lines
256266 {return 0;}
257267 #endif
258268
259−#define __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, is_retention) \
269+#define __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, \
270+ idx, \
271+ state, \
272+ is_retention) \
260273 ({ \
261274 int __ret = 0; \
262275 \
@@ -268,7 +281,7 @@ static inline int cpuidle_register_governor(struct cpuidle_governor *gov) · 5 unmodified lines
268281 if (!is_retention) \
269282 __ret = cpu_pm_enter(); \
270283 if (!__ret) { \
271− __ret = low_level_idle_enter(idx); \
284+ __ret = low_level_idle_enter(state); \
272285 if (!is_retention) \
273286 cpu_pm_exit(); \
274287 } \
@@ -277,9 +290,15 @@ static inline int cpuidle_register_governor(struct cpuidle_governor *gov) · 2 unmodified lines
277290 })
278291
279292 #define CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx) \
280− __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, 0)
293+ __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, idx, 0)
281294
282295 #define CPU_PM_CPU_IDLE_ENTER_RETENTION(low_level_idle_enter, idx) \
283− __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, 1)
296+ __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, idx, 1)
297+
298+#define CPU_PM_CPU_IDLE_ENTER_PARAM(low_level_idle_enter, idx, state) \
299+ __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, state, 0)
300+
301+#define CPU_PM_CPU_IDLE_ENTER_RETENTION_PARAM(low_level_idle_enter, idx, state) \
302+ __CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx, state, 1)
284303
285304 #endif /* _LINUX_CPUIDLE_H */
include/linux/cpuidle_haltpoll.h+16−0
@@ -0,0 +1,16 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _CPUIDLE_HALTPOLL_H
3+#define _CPUIDLE_HALTPOLL_H
4+
5+#ifdef CONFIG_ARCH_CPUIDLE_HALTPOLL
6+#include <asm/cpuidle_haltpoll.h>
7+#else
8+static inline void arch_haltpoll_enable(unsigned int cpu)
9+{
10+}
11+
12+static inline void arch_haltpoll_disable(unsigned int cpu)
13+{
14+}
15+#endif
16+#endif
include/linux/cpumask.h+39−16
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/kernel.h>
1111 #include <linux/threads.h>
1212 #include <linux/bitmap.h>
13+#include <linux/atomic.h>
1314 #include <linux/bug.h>
1415
1516 /* Don't assign or return these: may not be this big! */
@@ -95,8 +96,21 @@ extern struct cpumask __cpu_active_mask; · 79 unmodified lines
9596 #define cpu_present_mask ((const struct cpumask *)&__cpu_present_mask)
9697 #define cpu_active_mask ((const struct cpumask *)&__cpu_active_mask)
9798
99+extern atomic_t __num_online_cpus;
100+
98101 #if NR_CPUS > 1
99−#define num_online_cpus() cpumask_weight(cpu_online_mask)
102+/**
103+ * num_online_cpus() - Read the number of online CPUs
104+ *
105+ * Despite the fact that __num_online_cpus is of type atomic_t, this
106+ * interface gives only a momentary snapshot and is not protected against
107+ * concurrent CPU hotplug operations unless invoked from a cpuhp_lock held
108+ * region.
109+ */
110+static inline unsigned int num_online_cpus(void)
111+{
112+ return atomic_read(&__num_online_cpus);
113+}
100114 #define num_possible_cpus() cpumask_weight(cpu_possible_mask)
101115 #define num_present_cpus() cpumask_weight(cpu_present_mask)
102116 #define num_active_cpus() cpumask_weight(cpu_active_mask)
@@ -115,6 +129,8 @@ extern struct cpumask __cpu_active_mask; · 12 unmodified lines
115129 #define cpu_active(cpu) ((cpu) == 0)
116130 #endif
117131
132+extern cpumask_t cpus_booted_once_mask;
133+
118134 static inline void cpu_max_bits_warn(unsigned int cpu, unsigned int bits)
119135 {
120136 #ifdef CONFIG_DEBUG_PER_CPU_MAPS
@@ -184,8 +200,8 @@ static inline unsigned int cpumask_local_spread(unsigned int i, int node) · 63 unmodified lines
184200 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
185201 #define for_each_cpu_wrap(cpu, mask, start) \
186202 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)(start))
187−#define for_each_cpu_and(cpu, mask, and) \
188− for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and)
203+#define for_each_cpu_and(cpu, mask1, mask2) \
204+ for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask1, (void)mask2)
189205 #else
190206 /**
191207 * cpumask_first - get the first cpu in a cpumask
@@ -274,20 +290,20 @@ extern int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool · 82 unmodified lines
274290 /**
275291 * for_each_cpu_and - iterate over every cpu in both masks
276292 * @cpu: the (optionally unsigned) integer iterator
277− * @mask: the first cpumask pointer
278− * @and: the second cpumask pointer
293+ * @mask1: the first cpumask pointer
294+ * @mask2: the second cpumask pointer
279295 *
280296 * This saves a temporary CPU mask in many places. It is equivalent to:
281297 * struct cpumask tmp;
282− * cpumask_and(&tmp, &mask, &and);
298+ * cpumask_and(&tmp, &mask1, &mask2);
283299 * for_each_cpu(cpu, &tmp)
284300 * ...
285301 *
286302 * After the loop, cpu is >= nr_cpu_ids.
287303 */
288−#define for_each_cpu_and(cpu, mask, and) \
304+#define for_each_cpu_and(cpu, mask1, mask2) \
289305 for ((cpu) = -1; \
290− (cpu) = cpumask_next_and((cpu), (mask), (and)), \
306+ (cpu) = cpumask_next_and((cpu), (mask1), (mask2)), \
291307 (cpu) < nr_cpu_ids;)
292308 #endif /* SMP */
293309
@@ -473,6 +489,20 @@ static inline bool cpumask_equal(const struct cpumask *src1p, · 179 unmodified lines
473489 nr_cpumask_bits);
474490 }
475491
492+/**
493+ * cpumask_or_equal - *src1p | *src2p == *src3p
494+ * @src1p: the first input
495+ * @src2p: the second input
496+ * @src3p: the third input
497+ */
498+static inline bool cpumask_or_equal(const struct cpumask *src1p,
499+ const struct cpumask *src2p,
500+ const struct cpumask *src3p)
501+{
502+ return bitmap_or_equal(cpumask_bits(src1p), cpumask_bits(src2p),
503+ cpumask_bits(src3p), nr_cpumask_bits);
504+}
505+
476506 /**
477507 * cpumask_intersects - (*src1p & *src2p) != 0
478508 * @src1p: the first input
@@ -805,14 +835,7 @@ set_cpu_present(unsigned int cpu, bool present) · 326 unmodified lines
805835 cpumask_clear_cpu(cpu, &__cpu_present_mask);
806836 }
807837
808−static inline void
809−set_cpu_online(unsigned int cpu, bool online)
810−{
811− if (online)
812− cpumask_set_cpu(cpu, &__cpu_online_mask);
813− else
814− cpumask_clear_cpu(cpu, &__cpu_online_mask);
815−}
838+void set_cpu_online(unsigned int cpu, bool online);
816839
817840 static inline void
818841 set_cpu_active(unsigned int cpu, bool active)
include/linux/cpuset.h+9−4
@@ -40,14 +40,14 @@ static inline bool cpusets_enabled(void) · 39 unmodified lines
4040
4141 static inline void cpuset_inc(void)
4242 {
43− static_branch_inc(&cpusets_pre_enable_key);
44− static_branch_inc(&cpusets_enabled_key);
43+ static_branch_inc_cpuslocked(&cpusets_pre_enable_key);
44+ static_branch_inc_cpuslocked(&cpusets_enabled_key);
4545 }
4646
4747 static inline void cpuset_dec(void)
4848 {
49− static_branch_dec(&cpusets_enabled_key);
50− static_branch_dec(&cpusets_pre_enable_key);
49+ static_branch_dec_cpuslocked(&cpusets_enabled_key);
50+ static_branch_dec_cpuslocked(&cpusets_pre_enable_key);
5151 }
5252
5353 extern int cpuset_init(void);
@@ -55,6 +55,8 @@ extern void cpuset_init_smp(void); · 1 unmodified line
5555 extern void cpuset_force_rebuild(void);
5656 extern void cpuset_update_active_cpus(void);
5757 extern void cpuset_wait_for_hotplug(void);
58+extern void cpuset_read_lock(void);
59+extern void cpuset_read_unlock(void);
5860 extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);
5961 extern void cpuset_cpus_allowed_fallback(struct task_struct *p);
6062 extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
@@ -176,6 +178,9 @@ static inline void cpuset_update_active_cpus(void) · 115 unmodified lines
176178
177179 static inline void cpuset_wait_for_hotplug(void) { }
178180
181+static inline void cpuset_read_lock(void) { }
182+static inline void cpuset_read_unlock(void) { }
183+
179184 static inline void cpuset_cpus_allowed(struct task_struct *p,
180185 struct cpumask *mask)
181186 {
include/linux/crash_dump.h+14−0
@@ -115,4 +115,18 @@ static inline int vmcore_add_device_dump(struct vmcoredd_data *data) · 114 unmodified lines
115115 return -EOPNOTSUPP;
116116 }
117117 #endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */
118+
119+#ifdef CONFIG_PROC_VMCORE
120+ssize_t read_from_oldmem(char *buf, size_t count,
121+ u64 *ppos, int userbuf,
122+ bool encrypted);
123+#else
124+static inline ssize_t read_from_oldmem(char *buf, size_t count,
125+ u64 *ppos, int userbuf,
126+ bool encrypted)
127+{
128+ return -EOPNOTSUPP;
129+}
130+#endif /* CONFIG_PROC_VMCORE */
131+
118132 #endif /* LINUX_CRASHDUMP_H */
include/linux/cred.h+7−2
@@ -145,7 +145,11 @@ struct cred { · 144 unmodified lines
145145 struct user_struct *user; /* real user ID subscription */
146146 struct user_namespace *user_ns; /* user_ns the caps and keyrings are relative to. */
147147 struct group_info *group_info; /* supplementary groups for euid/fsgid */
148− struct rcu_head rcu; /* RCU deletion hook */
148+ /* RCU deletion */
149+ union {
150+ int non_rcu; /* Can we skip RCU deletion? */
151+ struct rcu_head rcu; /* RCU deletion hook */
152+ };
149153 } __randomize_layout;
150154
151155 extern void __put_cred(struct cred *);
@@ -246,6 +250,7 @@ static inline const struct cred *get_cred(const struct cred *cred) · 94 unmodified lines
246250 if (!cred)
247251 return cred;
248252 validate_creds(cred);
253+ nonconst_cred->non_rcu = 0;
249254 return get_new_cred(nonconst_cred);
250255 }
251256
@@ -257,6 +262,7 @@ static inline const struct cred *get_cred_rcu(const struct cred *cred) · 5 unmodified lines
257262 if (!atomic_inc_not_zero(&nonconst_cred->usage))
258263 return NULL;
259264 validate_creds(cred);
265+ nonconst_cred->non_rcu = 0;
260266 return cred;
261267 }
262268
@@ -380,7 +386,6 @@ static inline void put_cred(const struct cred *_cred) · 117 unmodified lines
380386 #define current_fsgid() (current_cred_xxx(fsgid))
381387 #define current_cap() (current_cred_xxx(cap_effective))
382388 #define current_user() (current_cred_xxx(user))
383−#define current_security() (current_cred_xxx(security))
384389
385390 extern struct user_namespace init_user_ns;
386391 #ifdef CONFIG_USER_NS
include/linux/dcache.h+1−1
@@ -151,7 +151,7 @@ struct dentry_operations { · 150 unmodified lines
151151
152152 /*
153153 * Locking rules for dentry_operations callbacks are to be found in
154− * Documentation/filesystems/Locking. Keep it updated!
154+ * Documentation/filesystems/locking.rst. Keep it updated!
155155 *
156156 * FUrther descriptions are found in Documentation/filesystems/vfs.rst.
157157 * Keep it updated too!
include/linux/devfreq-event.h+6−0
@@ -78,14 +78,20 @@ struct devfreq_event_ops { · 77 unmodified lines
7878 * struct devfreq_event_desc - the descriptor of devfreq-event device
7979 *
8080 * @name : the name of devfreq-event device.
81+ * @event_type : the type of the event determined and used by driver
8182 * @driver_data : the private data for devfreq-event driver.
8283 * @ops : the operation to control devfreq-event device.
8384 *
8485 * Each devfreq-event device is described with a this structure.
8586 * This structure contains the various data for devfreq-event device.
87+ * The event_type describes what is going to be counted in the register.
88+ * It might choose to count e.g. read requests, write data in bytes, etc.
89+ * The full supported list of types is present in specyfic header in:
90+ * include/dt-bindings/pmu/.
8691 */
8792 struct devfreq_event_desc {
8893 const char *name;
94+ u32 event_type;
8995 void *driver_data;
9096
9197 const struct devfreq_event_ops *ops;
include/linux/device.h+255−7
@@ -164,16 +164,102 @@ void subsys_dev_iter_init(struct subsys_dev_iter *iter, · 163 unmodified lines
164164 struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter);
165165 void subsys_dev_iter_exit(struct subsys_dev_iter *iter);
166166
167+int device_match_name(struct device *dev, const void *name);
167168 int device_match_of_node(struct device *dev, const void *np);
169+int device_match_fwnode(struct device *dev, const void *fwnode);
170+int device_match_devt(struct device *dev, const void *pdevt);
171+int device_match_acpi_dev(struct device *dev, const void *adev);
172+int device_match_any(struct device *dev, const void *unused);
168173
169174 int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
170175 int (*fn)(struct device *dev, void *data));
171176 struct device *bus_find_device(struct bus_type *bus, struct device *start,
172177 const void *data,
173178 int (*match)(struct device *dev, const void *data));
174−struct device *bus_find_device_by_name(struct bus_type *bus,
175− struct device *start,
176− const char *name);
179+/**
180+ * bus_find_device_by_name - device iterator for locating a particular device
181+ * of a specific name.
182+ * @bus: bus type
183+ * @start: Device to begin with
184+ * @name: name of the device to match
185+ */
186+static inline struct device *bus_find_device_by_name(struct bus_type *bus,
187+ struct device *start,
188+ const char *name)
189+{
190+ return bus_find_device(bus, start, name, device_match_name);
191+}
192+
193+/**
194+ * bus_find_device_by_of_node : device iterator for locating a particular device
195+ * matching the of_node.
196+ * @bus: bus type
197+ * @np: of_node of the device to match.
198+ */
199+static inline struct device *
200+bus_find_device_by_of_node(struct bus_type *bus, const struct device_node *np)
201+{
202+ return bus_find_device(bus, NULL, np, device_match_of_node);
203+}
204+
205+/**
206+ * bus_find_device_by_fwnode : device iterator for locating a particular device
207+ * matching the fwnode.
208+ * @bus: bus type
209+ * @fwnode: fwnode of the device to match.
210+ */
211+static inline struct device *
212+bus_find_device_by_fwnode(struct bus_type *bus, const struct fwnode_handle *fwnode)
213+{
214+ return bus_find_device(bus, NULL, fwnode, device_match_fwnode);
215+}
216+
217+/**
218+ * bus_find_device_by_devt : device iterator for locating a particular device
219+ * matching the device type.
220+ * @bus: bus type
221+ * @devt: device type of the device to match.
222+ */
223+static inline struct device *bus_find_device_by_devt(struct bus_type *bus,
224+ dev_t devt)
225+{
226+ return bus_find_device(bus, NULL, &devt, device_match_devt);
227+}
228+
229+/**
230+ * bus_find_next_device - Find the next device after a given device in a
231+ * given bus.
232+ * @bus: bus type
233+ * @cur: device to begin the search with.
234+ */
235+static inline struct device *
236+bus_find_next_device(struct bus_type *bus,struct device *cur)
237+{
238+ return bus_find_device(bus, cur, NULL, device_match_any);
239+}
240+
241+#ifdef CONFIG_ACPI
242+struct acpi_device;
243+
244+/**
245+ * bus_find_device_by_acpi_dev : device iterator for locating a particular device
246+ * matching the ACPI COMPANION device.
247+ * @bus: bus type
248+ * @adev: ACPI COMPANION device to match.
249+ */
250+static inline struct device *
251+bus_find_device_by_acpi_dev(struct bus_type *bus, const struct acpi_device *adev)
252+{
253+ return bus_find_device(bus, NULL, adev, device_match_acpi_dev);
254+}
255+#else
256+static inline struct device *
257+bus_find_device_by_acpi_dev(struct bus_type *bus, const void *adev)
258+{
259+ return NULL;
260+}
261+#endif
262+
177263 struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,
178264 struct device *hint);
179265 int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
@@ -262,6 +348,8 @@ enum probe_type { · 82 unmodified lines
262348 * @resume: Called to bring a device from sleep mode.
263349 * @groups: Default attributes that get created by the driver core
264350 * automatically.
351+ * @dev_groups: Additional attributes attached to device instance once the
352+ * it is bound to the driver.
265353 * @pm: Power management operations of the device which matched
266354 * this driver.
267355 * @coredump: Called when sysfs entry is written to. The device driver
@@ -296,6 +384,7 @@ struct device_driver { · 28 unmodified lines
296384 int (*suspend) (struct device *dev, pm_message_t state);
297385 int (*resume) (struct device *dev);
298386 const struct attribute_group **groups;
387+ const struct attribute_group **dev_groups;
299388
300389 const struct dev_pm_ops *pm;
301390 void (*coredump) (struct device *dev);
@@ -342,6 +431,83 @@ struct device *driver_find_device(struct device_driver *drv, · 40 unmodified lines
342431 struct device *start, const void *data,
343432 int (*match)(struct device *dev, const void *data));
344433
434+/**
435+ * driver_find_device_by_name - device iterator for locating a particular device
436+ * of a specific name.
437+ * @drv: the driver we're iterating
438+ * @name: name of the device to match
439+ */
440+static inline struct device *driver_find_device_by_name(struct device_driver *drv,
441+ const char *name)
442+{
443+ return driver_find_device(drv, NULL, name, device_match_name);
444+}
445+
446+/**
447+ * driver_find_device_by_of_node- device iterator for locating a particular device
448+ * by of_node pointer.
449+ * @drv: the driver we're iterating
450+ * @np: of_node pointer to match.
451+ */
452+static inline struct device *
453+driver_find_device_by_of_node(struct device_driver *drv,
454+ const struct device_node *np)
455+{
456+ return driver_find_device(drv, NULL, np, device_match_of_node);
457+}
458+
459+/**
460+ * driver_find_device_by_fwnode- device iterator for locating a particular device
461+ * by fwnode pointer.
462+ * @drv: the driver we're iterating
463+ * @fwnode: fwnode pointer to match.
464+ */
465+static inline struct device *
466+driver_find_device_by_fwnode(struct device_driver *drv,
467+ const struct fwnode_handle *fwnode)
468+{
469+ return driver_find_device(drv, NULL, fwnode, device_match_fwnode);
470+}
471+
472+/**
473+ * driver_find_device_by_devt- device iterator for locating a particular device
474+ * by devt.
475+ * @drv: the driver we're iterating
476+ * @devt: devt pointer to match.
477+ */
478+static inline struct device *driver_find_device_by_devt(struct device_driver *drv,
479+ dev_t devt)
480+{
481+ return driver_find_device(drv, NULL, &devt, device_match_devt);
482+}
483+
484+static inline struct device *driver_find_next_device(struct device_driver *drv,
485+ struct device *start)
486+{
487+ return driver_find_device(drv, start, NULL, device_match_any);
488+}
489+
490+#ifdef CONFIG_ACPI
491+/**
492+ * driver_find_device_by_acpi_dev : device iterator for locating a particular
493+ * device matching the ACPI_COMPANION device.
494+ * @drv: the driver we're iterating
495+ * @adev: ACPI_COMPANION device to match.
496+ */
497+static inline struct device *
498+driver_find_device_by_acpi_dev(struct device_driver *drv,
499+ const struct acpi_device *adev)
500+{
501+ return driver_find_device(drv, NULL, adev, device_match_acpi_dev);
502+}
503+#else
504+static inline struct device *
505+driver_find_device_by_acpi_dev(struct device_driver *drv, const void *adev)
506+{
507+ return NULL;
508+}
509+#endif
510+
345511 void driver_deferred_probe_add(struct device *dev);
346512 int driver_deferred_probe_check_state(struct device *dev);
347513 int driver_deferred_probe_check_state_continue(struct device *dev);
@@ -471,6 +637,76 @@ extern struct device *class_find_device(struct class *class, · 123 unmodified lines
471637 struct device *start, const void *data,
472638 int (*match)(struct device *, const void *));
473639
640+/**
641+ * class_find_device_by_name - device iterator for locating a particular device
642+ * of a specific name.
643+ * @class: class type
644+ * @name: name of the device to match
645+ */
646+static inline struct device *class_find_device_by_name(struct class *class,
647+ const char *name)
648+{
649+ return class_find_device(class, NULL, name, device_match_name);
650+}
651+
652+/**
653+ * class_find_device_by_of_node : device iterator for locating a particular device
654+ * matching the of_node.
655+ * @class: class type
656+ * @np: of_node of the device to match.
657+ */
658+static inline struct device *
659+class_find_device_by_of_node(struct class *class, const struct device_node *np)
660+{
661+ return class_find_device(class, NULL, np, device_match_of_node);
662+}
663+
664+/**
665+ * class_find_device_by_fwnode : device iterator for locating a particular device
666+ * matching the fwnode.
667+ * @class: class type
668+ * @fwnode: fwnode of the device to match.
669+ */
670+static inline struct device *
671+class_find_device_by_fwnode(struct class *class,
672+ const struct fwnode_handle *fwnode)
673+{
674+ return class_find_device(class, NULL, fwnode, device_match_fwnode);
675+}
676+
677+/**
678+ * class_find_device_by_devt : device iterator for locating a particular device
679+ * matching the device type.
680+ * @class: class type
681+ * @devt: device type of the device to match.
682+ */
683+static inline struct device *class_find_device_by_devt(struct class *class,
684+ dev_t devt)
685+{
686+ return class_find_device(class, NULL, &devt, device_match_devt);
687+}
688+
689+#ifdef CONFIG_ACPI
690+struct acpi_device;
691+/**
692+ * class_find_device_by_acpi_dev : device iterator for locating a particular
693+ * device matching the ACPI_COMPANION device.
694+ * @class: class type
695+ * @adev: ACPI_COMPANION device to match.
696+ */
697+static inline struct device *
698+class_find_device_by_acpi_dev(struct class *class, const struct acpi_device *adev)
699+{
700+ return class_find_device(class, NULL, adev, device_match_acpi_dev);
701+}
702+#else
703+static inline struct device *
704+class_find_device_by_acpi_dev(struct class *class, const void *adev)
705+{
706+ return NULL;
707+}
708+#endif
709+
474710 struct class_attribute {
475711 struct attribute attr;
476712 ssize_t (*show)(struct class *class, struct class_attribute *attr,
@@ -778,10 +1014,14 @@ struct device_connection { · 301 unmodified lines
7781014 struct list_head list;
7791015 };
7801016
1017+typedef void *(*devcon_match_fn_t)(struct device_connection *con, int ep,
1018+ void *data);
1019+
1020+void *fwnode_connection_find_match(struct fwnode_handle *fwnode,
1021+ const char *con_id, void *data,
1022+ devcon_match_fn_t match);
7811023 void *device_connection_find_match(struct device *dev, const char *con_id,
782− void *data,
783− void *(*match)(struct device_connection *con,
784− int ep, void *data));
1024+ void *data, devcon_match_fn_t match);
7851025
7861026 struct device *device_connection_find(struct device *dev, const char *con_id);
7871027
@@ -833,12 +1073,13 @@ enum device_link_state { · 45 unmodified lines
8331073 /*
8341074 * Device link flags.
8351075 *
836− * STATELESS: The core won't track the presence of supplier/consumer drivers.
1076+ * STATELESS: The core will not remove this link automatically.
8371077 * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
8381078 * PM_RUNTIME: If set, the runtime PM framework will use this link.
8391079 * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
8401080 * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
8411081 * AUTOPROBE_CONSUMER: Probe consumer driver automatically after supplier binds.
1082+ * MANAGED: The core tracks presence of supplier/consumer drivers (internal).
8421083 */
8431084 #define DL_FLAG_STATELESS BIT(0)
8441085 #define DL_FLAG_AUTOREMOVE_CONSUMER BIT(1)
@@ -846,6 +1087,7 @@ enum device_link_state { · 1 unmodified line
8461087 #define DL_FLAG_RPM_ACTIVE BIT(3)
8471088 #define DL_FLAG_AUTOREMOVE_SUPPLIER BIT(4)
8481089 #define DL_FLAG_AUTOPROBE_CONSUMER BIT(5)
1090+#define DL_FLAG_MANAGED BIT(6)
8491091
8501092 /**
8511093 * struct device_link - Device link representation.
@@ -915,6 +1157,8 @@ struct dev_links_info { · 63 unmodified lines
9151157 * This identifies the device type and carries type-specific
9161158 * information.
9171159 * @mutex: Mutex to synchronize calls to its driver.
1160+ * @lockdep_mutex: An optional debug lock that a subsystem can use as a
1161+ * peer lock to gain localized lockdep coverage of the device_lock.
9181162 * @bus: Type of bus device is on.
9191163 * @driver: Which driver has allocated this
9201164 * @platform_data: Platform data specific to the device.
@@ -998,6 +1242,9 @@ struct device { · 77 unmodified lines
9981242 core doesn't touch it */
9991243 void *driver_data; /* Driver data, set and get with
10001244 dev_set_drvdata/dev_get_drvdata */
1245+#ifdef CONFIG_PROVE_LOCKING
1246+ struct mutex lockdep_mutex;
1247+#endif
10011248 struct mutex mutex; /* mutex to synchronize calls to
10021249 * its driver.
10031250 */
@@ -1383,6 +1630,7 @@ extern int (*platform_notify_remove)(struct device *dev); · 379 unmodified lines
13831630 */
13841631 extern struct device *get_device(struct device *dev);
13851632 extern void put_device(struct device *dev);
1633+extern bool kill_device(struct device *dev);
13861634
13871635 #ifdef CONFIG_DEVTMPFS
13881636 extern int devtmpfs_create_node(struct device *dev);
include/linux/dim.h+0−56
@@ -272,62 +272,6 @@ dim_update_sample_with_comps(u16 event_ctr, u64 packets, u64 bytes, u64 comps, · 271 unmodified lines
272272
273273 /* Net DIM */
274274
275−/*
276− * Net DIM profiles:
277− * There are different set of profiles for each CQ period mode.
278− * There are different set of profiles for RX/TX CQs.
279− * Each profile size must be of NET_DIM_PARAMS_NUM_PROFILES
280− */
281−#define NET_DIM_PARAMS_NUM_PROFILES 5
282−#define NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE 256
283−#define NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE 128
284−#define NET_DIM_DEF_PROFILE_CQE 1
285−#define NET_DIM_DEF_PROFILE_EQE 1
286−
287−#define NET_DIM_RX_EQE_PROFILES { \
288− {1, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
289− {8, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
290− {64, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
291− {128, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
292− {256, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \
293−}
294−
295−#define NET_DIM_RX_CQE_PROFILES { \
296− {2, 256}, \
297− {8, 128}, \
298− {16, 64}, \
299− {32, 64}, \
300− {64, 64} \
301−}
302−
303−#define NET_DIM_TX_EQE_PROFILES { \
304− {1, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
305− {8, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
306− {32, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
307− {64, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \
308− {128, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE} \
309−}
310−
311−#define NET_DIM_TX_CQE_PROFILES { \
312− {5, 128}, \
313− {8, 64}, \
314− {16, 32}, \
315− {32, 32}, \
316− {64, 32} \
317−}
318−
319−static const struct dim_cq_moder
320−rx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
321− NET_DIM_RX_EQE_PROFILES,
322− NET_DIM_RX_CQE_PROFILES,
323−};
324−
325−static const struct dim_cq_moder
326−tx_profile[DIM_CQ_PERIOD_NUM_MODES][NET_DIM_PARAMS_NUM_PROFILES] = {
327− NET_DIM_TX_EQE_PROFILES,
328− NET_DIM_TX_CQE_PROFILES,
329−};
330−
331275 /**
332276 * net_dim_get_rx_moderation - provide a CQ moderation object for the given RX profile
333277 * @cq_period_mode: CQ period mode
include/linux/dma-contiguous.h+1−4
@@ -160,10 +160,7 @@ bool dma_release_from_contiguous(struct device *dev, struct page *pages, · 159 unmodified lines
160160 static inline struct page *dma_alloc_contiguous(struct device *dev, size_t size,
161161 gfp_t gfp)
162162 {
163− int node = dev ? dev_to_node(dev) : NUMA_NO_NODE;
164− size_t align = get_order(PAGE_ALIGN(size));
165−
166− return alloc_pages_node(node, gfp, align);
163+ return NULL;
167164 }
168165
169166 static inline void dma_free_contiguous(struct device *dev, struct page *page,
include/linux/dma-mapping.h+16−27
@@ -131,6 +131,7 @@ struct dma_map_ops { · 130 unmodified lines
131131 int (*dma_supported)(struct device *dev, u64 mask);
132132 u64 (*get_required_mask)(struct device *dev);
133133 size_t (*max_mapping_size)(struct device *dev);
134+ unsigned long (*get_merge_boundary)(struct device *dev);
134135 };
135136
136137 #define DMA_MAPPING_ERROR (~(dma_addr_t)0)
@@ -149,11 +150,6 @@ static inline int valid_dma_direction(int dma_direction) · 12 unmodified lines
149150 (dma_direction == DMA_FROM_DEVICE));
150151 }
151152
152−static inline int is_device_dma_capable(struct device *dev)
153−{
154− return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE;
155−}
156−
157153 #ifdef CONFIG_DMA_DECLARE_COHERENT
158154 /*
159155 * These three functions are only for dma allocator.
@@ -462,11 +458,13 @@ int dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, · 302 unmodified lines
462458 int dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma,
463459 void *cpu_addr, dma_addr_t dma_addr, size_t size,
464460 unsigned long attrs);
461+bool dma_can_mmap(struct device *dev);
465462 int dma_supported(struct device *dev, u64 mask);
466463 int dma_set_mask(struct device *dev, u64 mask);
467464 int dma_set_coherent_mask(struct device *dev, u64 mask);
468465 u64 dma_get_required_mask(struct device *dev);
469466 size_t dma_max_mapping_size(struct device *dev);
467+unsigned long dma_get_merge_boundary(struct device *dev);
470468 #else /* CONFIG_HAS_DMA */
471469 static inline dma_addr_t dma_map_page_attrs(struct device *dev,
472470 struct page *page, size_t offset, size_t size,
@@ -552,6 +550,10 @@ static inline int dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma, · 79 unmodified lines
552550 {
553551 return -ENXIO;
554552 }
553+static inline bool dma_can_mmap(struct device *dev)
554+{
555+ return false;
556+}
555557 static inline int dma_supported(struct device *dev, u64 mask)
556558 {
557559 return 0;
@@ -572,6 +574,10 @@ static inline size_t dma_max_mapping_size(struct device *dev) · 14 unmodified lines
572574 {
573575 return 0;
574576 }
577+static inline unsigned long dma_get_merge_boundary(struct device *dev)
578+{
579+ return 0;
580+}
575581 #endif /* CONFIG_HAS_DMA */
576582
577583 static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
@@ -615,16 +621,14 @@ extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, · 37 unmodified lines
615621 void *cpu_addr, dma_addr_t dma_addr, size_t size,
616622 unsigned long attrs);
617623
624+struct page **dma_common_find_pages(void *cpu_addr);
618625 void *dma_common_contiguous_remap(struct page *page, size_t size,
619− unsigned long vm_flags,
620626 pgprot_t prot, const void *caller);
621627
622628 void *dma_common_pages_remap(struct page **pages, size_t size,
623− unsigned long vm_flags, pgprot_t prot,
624− const void *caller);
625−void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags);
629+ pgprot_t prot, const void *caller);
630+void dma_common_free_remap(void *cpu_addr, size_t size);
626631
627−int __init dma_atomic_pool_init(gfp_t gfp, pgprot_t prot);
628632 bool dma_in_atomic_pool(void *start, size_t size);
629633 void *dma_alloc_from_pool(size_t size, struct page **ret_page, gfp_t flags);
630634 bool dma_free_from_pool(void *start, size_t size);
@@ -689,8 +693,8 @@ static inline int dma_coerce_mask_and_coherent(struct device *dev, u64 mask) · 58 unmodified lines
689693 */
690694 static inline bool dma_addressing_limited(struct device *dev)
691695 {
692− return min_not_zero(*dev->dma_mask, dev->bus_dma_mask) <
693− dma_get_required_mask(dev);
696+ return min_not_zero(dma_get_mask(dev), dev->bus_dma_mask) <
697+ dma_get_required_mask(dev);
694698 }
695699
696700 #ifdef CONFIG_ARCH_HAS_SETUP_DMA_OPS
@@ -754,7 +758,6 @@ static inline int dma_get_cache_alignment(void) · 57 unmodified lines
754758 #ifdef CONFIG_DMA_DECLARE_COHERENT
755759 int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
756760 dma_addr_t device_addr, size_t size);
757−void dma_release_declared_memory(struct device *dev);
758761 #else
759762 static inline int
760763 dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
@@ -762,11 +765,6 @@ dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, · 1 unmodified line
762765 {
763766 return -ENOSYS;
764767 }
765−
766−static inline void
767−dma_release_declared_memory(struct device *dev)
768−{
769−}
770768 #endif /* CONFIG_DMA_DECLARE_COHERENT */
771769
772770 static inline void *dmam_alloc_coherent(struct device *dev, size_t size,
@@ -786,9 +784,6 @@ static inline void *dma_alloc_wc(struct device *dev, size_t size, · 13 unmodified lines
786784
787785 return dma_alloc_attrs(dev, size, dma_addr, gfp, attrs);
788786 }
789−#ifndef dma_alloc_writecombine
790−#define dma_alloc_writecombine dma_alloc_wc
791−#endif
792787
793788 static inline void dma_free_wc(struct device *dev, size_t size,
794789 void *cpu_addr, dma_addr_t dma_addr)
@@ -796,9 +791,6 @@ static inline void dma_free_wc(struct device *dev, size_t size, · 1 unmodified line
796791 return dma_free_attrs(dev, size, cpu_addr, dma_addr,
797792 DMA_ATTR_WRITE_COMBINE);
798793 }
799−#ifndef dma_free_writecombine
800−#define dma_free_writecombine dma_free_wc
801−#endif
802794
803795 static inline int dma_mmap_wc(struct device *dev,
804796 struct vm_area_struct *vma,
@@ -808,9 +800,6 @@ static inline int dma_mmap_wc(struct device *dev, · 3 unmodified lines
808800 return dma_mmap_attrs(dev, vma, cpu_addr, dma_addr, size,
809801 DMA_ATTR_WRITE_COMBINE);
810802 }
811−#ifndef dma_mmap_writecombine
812−#define dma_mmap_writecombine dma_mmap_wc
813−#endif
814803
815804 #ifdef CONFIG_NEED_DMA_MAP_STATE
816805 #define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME
include/linux/dma-noncoherent.h+19−5
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #define _LINUX_DMA_NONCOHERENT_H 1
44
55 #include <linux/dma-mapping.h>
6+#include <asm/pgtable.h>
67
78 #ifdef CONFIG_ARCH_HAS_DMA_COHERENCE_H
89 #include <asm/dma-coherence.h>
@@ -43,13 +44,26 @@ void arch_dma_free(struct device *dev, size_t size, void *cpu_addr, · 34 unmodified lines
4344 long arch_dma_coherent_to_pfn(struct device *dev, void *cpu_addr,
4445 dma_addr_t dma_addr);
4546
46−#ifdef CONFIG_ARCH_HAS_DMA_MMAP_PGPROT
47−pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,
48− unsigned long attrs);
49−#else
50−# define arch_dma_mmap_pgprot(dev, prot, attrs) pgprot_noncached(prot)
47+#ifdef CONFIG_MMU
48+/*
49+ * Page protection so that devices that can't snoop CPU caches can use the
50+ * memory coherently. We default to pgprot_noncached which is usually used
51+ * for ioremap as a safe bet, but architectures can override this with less
52+ * strict semantics if possible.
53+ */
54+#ifndef pgprot_dmacoherent
55+#define pgprot_dmacoherent(prot) pgprot_noncached(prot)
5156 #endif
5257
58+pgprot_t dma_pgprot(struct device *dev, pgprot_t prot, unsigned long attrs);
59+#else
60+static inline pgprot_t dma_pgprot(struct device *dev, pgprot_t prot,
61+ unsigned long attrs)
62+{
63+ return prot; /* no protection bits supported without page tables */
64+}
65+#endif /* CONFIG_MMU */
66+
5367 #ifdef CONFIG_DMA_NONCOHERENT_CACHE_SYNC
5468 void arch_dma_cache_sync(struct device *dev, void *vaddr, size_t size,
5569 enum dma_data_direction direction);
include/linux/edac.h+5−5
@@ -440,7 +440,7 @@ struct dimm_info { · 439 unmodified lines
440440 char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */
441441
442442 /* Memory location data */
443− unsigned location[EDAC_MAX_LAYERS];
443+ unsigned int location[EDAC_MAX_LAYERS];
444444
445445 struct mem_ctl_info *mci; /* the parent */
446446
@@ -451,7 +451,7 @@ struct dimm_info { · 4 unmodified lines
451451
452452 u32 nr_pages; /* number of pages on this dimm */
453453
454− unsigned csrow, cschannel; /* Points to the old API data */
454+ unsigned int csrow, cschannel; /* Points to the old API data */
455455
456456 u16 smbios_handle; /* Handle for SMBIOS type 17 */
457457 };
@@ -597,7 +597,7 @@ struct mem_ctl_info { · 139 unmodified lines
597597 unsigned long page);
598598 int mc_idx;
599599 struct csrow_info **csrows;
600− unsigned nr_csrows, num_cschannel;
600+ unsigned int nr_csrows, num_cschannel;
601601
602602 /*
603603 * Memory Controller hierarchy
@@ -608,14 +608,14 @@ struct mem_ctl_info { · 4 unmodified lines
608608 * of the recent drivers enumerate memories per DIMM, instead.
609609 * When the memory controller is per rank, csbased is true.
610610 */
611− unsigned n_layers;
611+ unsigned int n_layers;
612612 struct edac_mc_layer *layers;
613613 bool csbased;
614614
615615 /*
616616 * DIMM info. Will eventually remove the entire csrows_info some day
617617 */
618− unsigned tot_dimms;
618+ unsigned int tot_dimms;
619619 struct dimm_info **dimms;
620620
621621 /*
include/linux/edma.h+0−29
@@ -1,29 +0,0 @@
1−/*
2− * TI EDMA DMA engine driver
3− *
4− * Copyright 2012 Texas Instruments
5− *
6− * This program is free software; you can redistribute it and/or
7− * modify it under the terms of the GNU General Public License as
8− * published by the Free Software Foundation version 2.
9− *
10− * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11− * kind, whether express or implied; without even the implied warranty
12− * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13− * GNU General Public License for more details.
14− */
15−#ifndef __LINUX_EDMA_H
16−#define __LINUX_EDMA_H
17−
18−struct dma_chan;
19−
20−#if defined(CONFIG_TI_EDMA) || defined(CONFIG_TI_EDMA_MODULE)
21−bool edma_filter_fn(struct dma_chan *, void *);
22−#else
23−static inline bool edma_filter_fn(struct dma_chan *chan, void *param)
24−{
25− return false;
26−}
27−#endif
28−
29−#endif
include/linux/efi.h+5−9
@@ -692,6 +692,9 @@ void efi_native_runtime_setup(void); · 691 unmodified lines
692692 #define LINUX_EFI_TPM_FINAL_LOG_GUID EFI_GUID(0x1e2ed096, 0x30e2, 0x4254, 0xbd, 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25)
693693 #define LINUX_EFI_MEMRESERVE_TABLE_GUID EFI_GUID(0x888eb0c6, 0x8ede, 0x4ff5, 0xa8, 0xf0, 0x9a, 0xee, 0x5c, 0xb9, 0x77, 0xc2)
694694
695+/* OEM GUIDs */
696+#define DELLEMC_EFI_RCI2_TABLE_GUID EFI_GUID(0x2d9f28a2, 0xa886, 0x456a, 0x97, 0xa8, 0xf1, 0x1e, 0xf2, 0x4f, 0xf4, 0x55)
697+
695698 typedef struct {
696699 efi_guid_t guid;
697700 u64 table;
@@ -984,11 +987,9 @@ extern struct efi { · 286 unmodified lines
984987 unsigned long acpi20; /* ACPI table (ACPI 2.0) */
985988 unsigned long smbios; /* SMBIOS table (32 bit entry point) */
986989 unsigned long smbios3; /* SMBIOS table (64 bit entry point) */
987− unsigned long sal_systab; /* SAL system table */
988990 unsigned long boot_info; /* boot info table */
989991 unsigned long hcdp; /* HCDP table */
990992 unsigned long uga; /* UGA table */
991− unsigned long uv_systab; /* UV system table */
992993 unsigned long fw_vendor; /* fw_vendor */
993994 unsigned long runtime; /* runtime table */
994995 unsigned long config_table; /* config tables */
@@ -1211,8 +1212,6 @@ static inline bool efi_enabled(int feature) · 216 unmodified lines
12111212 return test_bit(feature, &efi.flags) != 0;
12121213 }
12131214 extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
1214−
1215−extern bool efi_is_table_address(unsigned long phys_addr);
12161215 #else
12171216 static inline bool efi_enabled(int feature)
12181217 {
@@ -1226,11 +1225,6 @@ efi_capsule_pending(int *reset_type) · 7 unmodified lines
12261225 {
12271226 return false;
12281227 }
1229−
1230−static inline bool efi_is_table_address(unsigned long phys_addr)
1231−{
1232− return false;
1233−}
12341228 #endif
12351229
12361230 extern int efi_status_to_err(efi_status_t status);
@@ -1722,6 +1716,8 @@ struct efi_tcg2_final_events_table { · 485 unmodified lines
17221716 };
17231717 extern int efi_tpm_final_log_size;
17241718
1719+extern unsigned long rci2_table_phys;
1720+
17251721 /*
17261722 * efi_runtime_service() function identifiers.
17271723 * "NONE" is used by efi_recover_from_page_fault() to check if the page
include/linux/elevator.h+8−1
@@ -45,7 +45,6 @@ struct elevator_mq_ops { · 44 unmodified lines
4545 struct request *(*dispatch_request)(struct blk_mq_hw_ctx *);
4646 bool (*has_work)(struct blk_mq_hw_ctx *);
4747 void (*completed_request)(struct request *, u64);
48− void (*started_request)(struct request *);
4948 void (*requeue_request)(struct request *);
5049 struct request *(*former_request)(struct request_queue *, struct request *);
5150 struct request *(*next_request)(struct request_queue *, struct request *);
@@ -77,6 +76,7 @@ struct elevator_type · 25 unmodified lines
7776 struct elv_fs_entry *elevator_attrs;
7877 const char *elevator_name;
7978 const char *elevator_alias;
79+ const unsigned int elevator_features;
8080 struct module *elevator_owner;
8181 #ifdef CONFIG_BLK_DEBUG_FS
8282 const struct blk_mq_debugfs_attr *queue_debugfs_attrs;
@@ -166,5 +166,12 @@ extern struct request *elv_rb_find(struct rb_root *, sector_t); · 83 unmodified lines
166166 #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist)
167167 #define rq_fifo_clear(rq) list_del_init(&(rq)->queuelist)
168168
169+/*
170+ * Elevator features.
171+ */
172+
173+/* Supports zoned block devices sequential write constraint */
174+#define ELEVATOR_F_ZBD_SEQ_WRITE (1U << 0)
175+
169176 #endif /* CONFIG_BLOCK */
170177 #endif
include/linux/error-injection.h+3−3
@@ -2,16 +2,16 @@ · 1 unmodified line
22 #ifndef _LINUX_ERROR_INJECTION_H
33 #define _LINUX_ERROR_INJECTION_H
44
5−#ifdef CONFIG_FUNCTION_ERROR_INJECTION
5+#include <linux/compiler.h>
6+#include <asm-generic/error-injection.h>
67
7−#include <asm/error-injection.h>
8+#ifdef CONFIG_FUNCTION_ERROR_INJECTION
89
910 extern bool within_error_injection_list(unsigned long addr);
1011 extern int get_injectable_error_type(unsigned long addr);
1112
1213 #else /* !CONFIG_FUNCTION_ERROR_INJECTION */
1314
14−#include <asm-generic/error-injection.h>
1515 static inline bool within_error_injection_list(unsigned long addr)
1616 {
1717 return false;
include/linux/export.h+78−32
@@ -18,9 +18,8 @@ extern struct module __this_module; · 17 unmodified lines
1818 #define THIS_MODULE ((struct module *)0)
1919 #endif
2020
21−#ifdef CONFIG_MODULES
21+#define NS_SEPARATOR "."
2222
23−#if defined(__KERNEL__) && !defined(__GENKSYMS__)
2423 #ifdef CONFIG_MODVERSIONS
2524 /* Mark the CRC weak since genksyms apparently decides not to
2625 * generate a checksums for some symbols */
@@ -29,13 +28,13 @@ extern struct module __this_module; · 2 unmodified lines
2928 asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \
3029 " .weak __crc_" #sym " \n" \
3130 " .long __crc_" #sym " - . \n" \
32− " .previous \n");
31+ " .previous \n")
3332 #else
3433 #define __CRC_SYMBOL(sym, sec) \
3534 asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \
3635 " .weak __crc_" #sym " \n" \
3736 " .long __crc_" #sym " \n" \
38− " .previous \n");
37+ " .previous \n")
3938 #endif
4039 #else
4140 #define __CRC_SYMBOL(sym, sec)
@@ -49,47 +48,89 @@ extern struct module __this_module; · 7 unmodified lines
4948 * absolute relocations that require runtime processing on relocatable
5049 * kernels.
5150 */
51+#define __KSYMTAB_ENTRY_NS(sym, sec, ns) \
52+ __ADDRESSABLE(sym) \
53+ asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \
54+ " .balign 4 \n" \
55+ "__ksymtab_" #sym NS_SEPARATOR #ns ": \n" \
56+ " .long " #sym "- . \n" \
57+ " .long __kstrtab_" #sym "- . \n" \
58+ " .long __kstrtab_ns_" #sym "- . \n" \
59+ " .previous \n")
60+
5261 #define __KSYMTAB_ENTRY(sym, sec) \
5362 __ADDRESSABLE(sym) \
5463 asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \
55− " .balign 8 \n" \
64+ " .balign 4 \n" \
5665 "__ksymtab_" #sym ": \n" \
5766 " .long " #sym "- . \n" \
5867 " .long __kstrtab_" #sym "- . \n" \
68+ " .long 0 \n" \
5969 " .previous \n")
6070
6171 struct kernel_symbol {
6272 int value_offset;
6373 int name_offset;
74+ int namespace_offset;
6475 };
6576 #else
77+#define __KSYMTAB_ENTRY_NS(sym, sec, ns) \
78+ static const struct kernel_symbol __ksymtab_##sym##__##ns \
79+ asm("__ksymtab_" #sym NS_SEPARATOR #ns) \
80+ __attribute__((section("___ksymtab" sec "+" #sym), used)) \
81+ __aligned(sizeof(void *)) \
82+ = { (unsigned long)&sym, __kstrtab_##sym, __kstrtab_ns_##sym }
83+
6684 #define __KSYMTAB_ENTRY(sym, sec) \
6785 static const struct kernel_symbol __ksymtab_##sym \
86+ asm("__ksymtab_" #sym) \
6887 __attribute__((section("___ksymtab" sec "+" #sym), used)) \
69− = { (unsigned long)&sym, __kstrtab_##sym }
88+ __aligned(sizeof(void *)) \
89+ = { (unsigned long)&sym, __kstrtab_##sym, NULL }
7090
7191 struct kernel_symbol {
7292 unsigned long value;
7393 const char *name;
94+ const char *namespace;
7495 };
7596 #endif
7697
77−/* For every exported symbol, place a struct in the __ksymtab section */
78−#define ___EXPORT_SYMBOL(sym, sec) \
98+#ifdef __GENKSYMS__
99+
100+#define ___EXPORT_SYMBOL(sym,sec) __GENKSYMS_EXPORT_SYMBOL(sym)
101+#define ___EXPORT_SYMBOL_NS(sym,sec,ns) __GENKSYMS_EXPORT_SYMBOL(sym)
102+
103+#else
104+
105+#define ___export_symbol_common(sym, sec) \
79106 extern typeof(sym) sym; \
80− __CRC_SYMBOL(sym, sec) \
107+ __CRC_SYMBOL(sym, sec); \
81108 static const char __kstrtab_##sym[] \
82109 __attribute__((section("__ksymtab_strings"), used, aligned(1))) \
83− = #sym; \
110+ = #sym \
111+
112+/* For every exported symbol, place a struct in the __ksymtab section */
113+#define ___EXPORT_SYMBOL_NS(sym, sec, ns) \
114+ ___export_symbol_common(sym, sec); \
115+ static const char __kstrtab_ns_##sym[] \
116+ __attribute__((section("__ksymtab_strings"), used, aligned(1))) \
117+ = #ns; \
118+ __KSYMTAB_ENTRY_NS(sym, sec, ns)
119+
120+#define ___EXPORT_SYMBOL(sym, sec) \
121+ ___export_symbol_common(sym, sec); \
84122 __KSYMTAB_ENTRY(sym, sec)
85123
86−#if defined(__DISABLE_EXPORTS)
124+#endif
125+
126+#if !defined(CONFIG_MODULES) || defined(__DISABLE_EXPORTS)
87127
88128 /*
89129 * Allow symbol exports to be disabled completely so that C code may
90130 * be reused in other execution contexts such as the UEFI stub or the
91131 * decompressor.
92132 */
133+#define __EXPORT_SYMBOL_NS(sym, sec, ns)
93134 #define __EXPORT_SYMBOL(sym, sec)
94135
95136 #elif defined(CONFIG_TRIM_UNUSED_KSYMS)
@@ -116,38 +157,43 @@ struct kernel_symbol { · 20 unmodified lines
116157 #define __cond_export_sym_1(sym, sec) ___EXPORT_SYMBOL(sym, sec)
117158 #define __cond_export_sym_0(sym, sec) /* nothing */
118159
160+#define __EXPORT_SYMBOL_NS(sym, sec, ns) \
161+ __ksym_marker(sym); \
162+ __cond_export_ns_sym(sym, sec, ns, __is_defined(__KSYM_##sym))
163+#define __cond_export_ns_sym(sym, sec, ns, conf) \
164+ ___cond_export_ns_sym(sym, sec, ns, conf)
165+#define ___cond_export_ns_sym(sym, sec, ns, enabled) \
166+ __cond_export_ns_sym_##enabled(sym, sec, ns)
167+#define __cond_export_ns_sym_1(sym, sec, ns) ___EXPORT_SYMBOL_NS(sym, sec, ns)
168+#define __cond_export_ns_sym_0(sym, sec, ns) /* nothing */
169+
119170 #else
120−#define __EXPORT_SYMBOL ___EXPORT_SYMBOL
121−#endif
122171
123−#define EXPORT_SYMBOL(sym) \
124− __EXPORT_SYMBOL(sym, "")
172+#define __EXPORT_SYMBOL_NS(sym,sec,ns) ___EXPORT_SYMBOL_NS(sym,sec,ns)
173+#define __EXPORT_SYMBOL(sym,sec) ___EXPORT_SYMBOL(sym,sec)
125174
126−#define EXPORT_SYMBOL_GPL(sym) \
127− __EXPORT_SYMBOL(sym, "_gpl")
175+#endif /* CONFIG_MODULES */
128176
129−#define EXPORT_SYMBOL_GPL_FUTURE(sym) \
130− __EXPORT_SYMBOL(sym, "_gpl_future")
177+#ifdef DEFAULT_SYMBOL_NAMESPACE
178+#undef __EXPORT_SYMBOL
179+#define __EXPORT_SYMBOL(sym, sec) \
180+ __EXPORT_SYMBOL_NS(sym, sec, DEFAULT_SYMBOL_NAMESPACE)
181+#endif
182+
183+#define EXPORT_SYMBOL(sym) __EXPORT_SYMBOL(sym, "")
184+#define EXPORT_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_gpl")
185+#define EXPORT_SYMBOL_GPL_FUTURE(sym) __EXPORT_SYMBOL(sym, "_gpl_future")
186+#define EXPORT_SYMBOL_NS(sym, ns) __EXPORT_SYMBOL_NS(sym, "", ns)
187+#define EXPORT_SYMBOL_NS_GPL(sym, ns) __EXPORT_SYMBOL_NS(sym, "_gpl", ns)
131188
132189 #ifdef CONFIG_UNUSED_SYMBOLS
133−#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
134−#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
190+#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
191+#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
135192 #else
136193 #define EXPORT_UNUSED_SYMBOL(sym)
137194 #define EXPORT_UNUSED_SYMBOL_GPL(sym)
138195 #endif
139196
140−#endif /* __GENKSYMS__ */
141−
142−#else /* !CONFIG_MODULES... */
143−
144−#define EXPORT_SYMBOL(sym)
145−#define EXPORT_SYMBOL_GPL(sym)
146−#define EXPORT_SYMBOL_GPL_FUTURE(sym)
147−#define EXPORT_UNUSED_SYMBOL(sym)
148−#define EXPORT_UNUSED_SYMBOL_GPL(sym)
149−
150−#endif /* CONFIG_MODULES */
151197 #endif /* !__ASSEMBLY__ */
152198
153199 #endif /* _LINUX_EXPORT_H */
include/linux/exportfs.h+1−1
@@ -139,7 +139,7 @@ struct fid { · 138 unmodified lines
139139 * @get_parent: find the parent of a given directory
140140 * @commit_metadata: commit metadata changes to stable storage
141141 *
142− * See Documentation/filesystems/nfs/Exporting for details on how to use
142+ * See Documentation/filesystems/nfs/exporting.rst for details on how to use
143143 * this interface correctly.
144144 *
145145 * encode_fh:
include/linux/extable.h+2−0
@@ -19,6 +19,8 @@ void trim_init_extable(struct module *m); · 18 unmodified lines
1919
2020 /* Given an address, look for it in the exception tables */
2121 const struct exception_table_entry *search_exception_tables(unsigned long add);
22+const struct exception_table_entry *
23+search_kernel_exception_table(unsigned long addr);
2224
2325 #ifdef CONFIG_MODULES
2426 /* For extable.c to search modules' exception tables. */
include/linux/f2fs_fs.h+9−1
@@ -36,11 +36,17 @@ · 35 unmodified lines
3636
3737 #define F2FS_MAX_QUOTAS 3
3838
39+#define F2FS_ENC_UTF8_12_1 1
40+#define F2FS_ENC_STRICT_MODE_FL (1 << 0)
41+#define f2fs_has_strict_mode(sbi) \
42+ (sbi->s_encoding_flags & F2FS_ENC_STRICT_MODE_FL)
43+
3944 #define F2FS_IO_SIZE(sbi) (1 << F2FS_OPTION(sbi).write_io_size_bits) /* Blocks */
4045 #define F2FS_IO_SIZE_KB(sbi) (1 << (F2FS_OPTION(sbi).write_io_size_bits + 2)) /* KB */
4146 #define F2FS_IO_SIZE_BYTES(sbi) (1 << (F2FS_OPTION(sbi).write_io_size_bits + 12)) /* B */
4247 #define F2FS_IO_SIZE_BITS(sbi) (F2FS_OPTION(sbi).write_io_size_bits) /* power of 2 */
4348 #define F2FS_IO_SIZE_MASK(sbi) (F2FS_IO_SIZE(sbi) - 1)
49+#define F2FS_IO_ALIGNED(sbi) (F2FS_IO_SIZE(sbi) > 1)
4450
4551 /* This flag is used by node and meta inodes, and by recovery */
4652 #define GFP_F2FS_ZERO (GFP_NOFS | __GFP_ZERO)
@@ -109,7 +115,9 @@ struct f2fs_super_block { · 62 unmodified lines
109115 struct f2fs_device devs[MAX_DEVICES]; /* device list */
110116 __le32 qf_ino[F2FS_MAX_QUOTAS]; /* quota inode numbers */
111117 __u8 hot_ext_count; /* # of hot file extension */
112− __u8 reserved[310]; /* valid reserved region */
118+ __le16 s_encoding; /* Filename charset encoding */
119+ __le16 s_encoding_flags; /* Filename charset encoding flags */
120+ __u8 reserved[306]; /* valid reserved region */
113121 __le32 crc; /* checksum of superblock */
114122 } __packed;
115123
include/linux/filter.h+13−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424
2525 #include <net/sch_generic.h>
2626
27+#include <asm/byteorder.h>
2728 #include <uapi/linux/filter.h>
2829 #include <uapi/linux/bpf.h>
2930
@@ -747,6 +748,18 @@ bpf_ctx_narrow_access_ok(u32 off, u32 size, u32 size_default) · 717 unmodified lines
747748 return size <= size_default && (size & (size - 1)) == 0;
748749 }
749750
751+static inline u8
752+bpf_ctx_narrow_access_offset(u32 off, u32 size, u32 size_default)
753+{
754+ u8 access_off = off & (size_default - 1);
755+
756+#ifdef __LITTLE_ENDIAN
757+ return access_off;
758+#else
759+ return size_default - (access_off + size);
760+#endif
761+}
762+
750763 #define bpf_ctx_wide_access_ok(off, size, type, field) \
751764 (size == sizeof(__u64) && \
752765 off >= offsetof(type, field) && \
include/linux/fips.h+7−0
@@ -4,8 +4,15 @@ · 3 unmodified lines
44
55 #ifdef CONFIG_CRYPTO_FIPS
66 extern int fips_enabled;
7+extern struct atomic_notifier_head fips_fail_notif_chain;
8+
9+void fips_fail_notify(void);
10+
711 #else
812 #define fips_enabled 0
13+
14+static inline void fips_fail_notify(void) {}
15+
916 #endif
1017
1118 #endif
include/linux/firmware/imx/dsp.h+67−0
@@ -0,0 +1,67 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
2+/*
3+ * Copyright 2019 NXP
4+ *
5+ * Header file for the DSP IPC implementation
6+ */
7+
8+#ifndef _IMX_DSP_IPC_H
9+#define _IMX_DSP_IPC_H
10+
11+#include <linux/device.h>
12+#include <linux/types.h>
13+#include <linux/mailbox_client.h>
14+
15+#define DSP_MU_CHAN_NUM 4
16+
17+struct imx_dsp_chan {
18+ struct imx_dsp_ipc *ipc;
19+ struct mbox_client cl;
20+ struct mbox_chan *ch;
21+ char *name;
22+ int idx;
23+};
24+
25+struct imx_dsp_ops {
26+ void (*handle_reply)(struct imx_dsp_ipc *ipc);
27+ void (*handle_request)(struct imx_dsp_ipc *ipc);
28+};
29+
30+struct imx_dsp_ipc {
31+ /* Host <-> DSP communication uses 2 txdb and 2 rxdb channels */
32+ struct imx_dsp_chan chans[DSP_MU_CHAN_NUM];
33+ struct device *dev;
34+ struct imx_dsp_ops *ops;
35+ void *private_data;
36+};
37+
38+static inline void imx_dsp_set_data(struct imx_dsp_ipc *ipc, void *data)
39+{
40+ if (!ipc)
41+ return;
42+
43+ ipc->private_data = data;
44+}
45+
46+static inline void *imx_dsp_get_data(struct imx_dsp_ipc *ipc)
47+{
48+ if (!ipc)
49+ return NULL;
50+
51+ return ipc->private_data;
52+}
53+
54+#if IS_ENABLED(CONFIG_IMX_DSP)
55+
56+int imx_dsp_ring_doorbell(struct imx_dsp_ipc *dsp, unsigned int chan_idx);
57+
58+#else
59+
60+static inline int imx_dsp_ring_doorbell(struct imx_dsp_ipc *ipc,
61+ unsigned int chan_idx)
62+{
63+ return -ENOTSUPP;
64+}
65+
66+#endif
67+#endif /* _IMX_DSP_IPC_H */
include/linux/firmware/intel/stratix10-smc.h+45−6
@@ -210,7 +210,7 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 209 unmodified lines
210210 #define INTEL_SIP_SMC_FPGA_CONFIG_LOOPBACK \
211211 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK)
212212
213−/*
213+/**
214214 * Request INTEL_SIP_SMC_REG_READ
215215 *
216216 * Read a protected register at EL3
@@ -229,7 +229,7 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 12 unmodified lines
229229 #define INTEL_SIP_SMC_REG_READ \
230230 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_READ)
231231
232−/*
232+/**
233233 * Request INTEL_SIP_SMC_REG_WRITE
234234 *
235235 * Write a protected register at EL3
@@ -248,7 +248,7 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 12 unmodified lines
248248 #define INTEL_SIP_SMC_REG_WRITE \
249249 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_WRITE)
250250
251−/*
251+/**
252252 * Request INTEL_SIP_SMC_FUNCID_REG_UPDATE
253253 *
254254 * Update one or more bits in a protected register at EL3 using a
@@ -269,7 +269,7 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 14 unmodified lines
269269 #define INTEL_SIP_SMC_REG_UPDATE \
270270 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_UPDATE)
271271
272−/*
272+/**
273273 * Request INTEL_SIP_SMC_RSU_STATUS
274274 *
275275 * Request remote status update boot log, call is synchronous.
@@ -292,7 +292,7 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 16 unmodified lines
292292 #define INTEL_SIP_SMC_RSU_STATUS \
293293 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_STATUS)
294294
295−/*
295+/**
296296 * Request INTEL_SIP_SMC_RSU_UPDATE
297297 *
298298 * Request to set the offset of the bitstream to boot after reboot, call
@@ -310,7 +310,7 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 11 unmodified lines
310310 #define INTEL_SIP_SMC_RSU_UPDATE \
311311 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_UPDATE)
312312
313−/*
313+/**
314314 * Request INTEL_SIP_SMC_ECC_DBE
315315 *
316316 * Sync call used by service driver at EL1 to alert EL3 that a Double
@@ -329,3 +329,42 @@ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_COMPLETED_WRITE) · 12 unmodified lines
329329 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_ECC_DBE)
330330
331331 #endif
332+
333+/**
334+ * Request INTEL_SIP_SMC_RSU_NOTIFY
335+ *
336+ * Sync call used by service driver at EL1 to report hard processor
337+ * system execution stage to firmware
338+ *
339+ * Call register usage:
340+ * a0 INTEL_SIP_SMC_RSU_NOTIFY
341+ * a1 32bit value representing hard processor system execution stage
342+ * a2-7 not used
343+ *
344+ * Return status
345+ * a0 INTEL_SIP_SMC_STATUS_OK
346+ */
347+#define INTEL_SIP_SMC_FUNCID_RSU_NOTIFY 14
348+#define INTEL_SIP_SMC_RSU_NOTIFY \
349+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_NOTIFY)
350+
351+/**
352+ * Request INTEL_SIP_SMC_RSU_RETRY_COUNTER
353+ *
354+ * Sync call used by service driver at EL1 to query RSU retry counter
355+ *
356+ * Call register usage:
357+ * a0 INTEL_SIP_SMC_RSU_RETRY_COUNTER
358+ * a1-7 not used
359+ *
360+ * Return status
361+ * a0 INTEL_SIP_SMC_STATUS_OK
362+ * a1 the retry counter
363+ *
364+ * Or
365+ *
366+ * a0 INTEL_SIP_SMC_RSU_ERROR
367+ */
368+#define INTEL_SIP_SMC_FUNCID_RSU_RETRY_COUNTER 15
369+#define INTEL_SIP_SMC_RSU_RETRY_COUNTER \
370+ INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_RETRY_COUNTER)
include/linux/firmware/intel/stratix10-svc-client.h+10−1
@@ -95,6 +95,13 @@ struct stratix10_svc_chan; · 94 unmodified lines
9595 *
9696 * @COMMAND_RSU_UPDATE: set the offset of the bitstream to boot after reboot,
9797 * return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR
98+ *
99+ * @COMMAND_RSU_NOTIFY: report the status of hard processor system
100+ * software to firmware, return status is SVC_STATUS_RSU_OK or
101+ * SVC_STATUS_RSU_ERROR
102+ *
103+ * @COMMAND_RSU_RETRY: query firmware for the current image's retry counter,
104+ * return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR
98105 */
99106 enum stratix10_svc_command_code {
100107 COMMAND_NOOP = 0,
@@ -103,7 +110,9 @@ enum stratix10_svc_command_code { · 2 unmodified lines
103110 COMMAND_RECONFIG_DATA_CLAIM,
104111 COMMAND_RECONFIG_STATUS,
105112 COMMAND_RSU_STATUS,
106− COMMAND_RSU_UPDATE
113+ COMMAND_RSU_UPDATE,
114+ COMMAND_RSU_NOTIFY,
115+ COMMAND_RSU_RETRY,
107116 };
108117
109118 /**
include/linux/fpga/altera-pr-ip-core.h+1−1
@@ -13,6 +13,6 @@ · 12 unmodified lines
1313 #include <linux/io.h>
1414
1515 int alt_pr_register(struct device *dev, void __iomem *reg_base);
16−int alt_pr_unregister(struct device *dev);
16+void alt_pr_unregister(struct device *dev);
1717
1818 #endif /* _ALT_PR_IP_CORE_H */
include/linux/fs.h+73−0
@@ -64,6 +64,8 @@ struct workqueue_struct; · 63 unmodified lines
6464 struct iov_iter;
6565 struct fscrypt_info;
6666 struct fscrypt_operations;
67+struct fsverity_info;
68+struct fsverity_operations;
6769 struct fs_context;
6870 struct fs_parameter_description;
6971
@@ -427,6 +429,7 @@ int pagecache_write_end(struct file *, struct address_space *mapping, · 357 unmodified lines
427429 * @i_pages: Cached pages.
428430 * @gfp_mask: Memory allocation flags to use for allocating pages.
429431 * @i_mmap_writable: Number of VM_SHARED mappings.
432+ * @nr_thps: Number of THPs in the pagecache (non-shmem only).
430433 * @i_mmap: Tree of private and shared mappings.
431434 * @i_mmap_rwsem: Protects @i_mmap and @i_mmap_writable.
432435 * @nrpages: Number of page entries, protected by the i_pages lock.
@@ -444,6 +447,10 @@ struct address_space { · 11 unmodified lines
444447 struct xarray i_pages;
445448 gfp_t gfp_mask;
446449 atomic_t i_mmap_writable;
450+#ifdef CONFIG_READ_ONLY_THP_FOR_FS
451+ /* number of thp, only for non-shmem files */
452+ atomic_t nr_thps;
453+#endif
447454 struct rb_root_cached i_mmap;
448455 struct rw_semaphore i_mmap_rwsem;
449456 unsigned long nrpages;
@@ -723,9 +730,15 @@ struct inode { · 273 unmodified lines
723730 struct fscrypt_info *i_crypt_info;
724731 #endif
725732
733+#ifdef CONFIG_FS_VERITY
734+ struct fsverity_info *i_verity_info;
735+#endif
736+
726737 void *i_private; /* fs or device private pointer */
727738 } __randomize_layout;
728739
740+struct timespec64 timestamp_truncate(struct timespec64 t, struct inode *inode);
741+
729742 static inline unsigned int i_blocksize(const struct inode *node)
730743 {
731744 return (1 << node->i_blkbits);
@@ -1155,6 +1168,11 @@ extern void lease_get_mtime(struct inode *, struct timespec64 *time); · 423 unmodified lines
11551168 extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
11561169 extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
11571170 extern int lease_modify(struct file_lock *, int, struct list_head *);
1171+
1172+struct notifier_block;
1173+extern int lease_register_notifier(struct notifier_block *);
1174+extern void lease_unregister_notifier(struct notifier_block *);
1175+
11581176 struct files_struct;
11591177 extern void show_fd_locks(struct seq_file *f,
11601178 struct file *filp, struct files_struct *files);
@@ -1427,6 +1445,10 @@ struct super_block { · 266 unmodified lines
14271445 const struct xattr_handler **s_xattr;
14281446 #ifdef CONFIG_FS_ENCRYPTION
14291447 const struct fscrypt_operations *s_cop;
1448+ struct key *s_master_keys; /* master crypto keys in use */
1449+#endif
1450+#ifdef CONFIG_FS_VERITY
1451+ const struct fsverity_operations *s_vop;
14301452 #endif
14311453 struct hlist_bl_head s_roots; /* alternate root dentries for NFS */
14321454 struct list_head s_mounts; /* list of mounts; _not_ for fs use */
@@ -1448,6 +1470,9 @@ struct super_block { · 15 unmodified lines
14481470
14491471 /* Granularity of c/m/atime in ns (cannot be worse than a second) */
14501472 u32 s_time_gran;
1473+ /* Time limits for c/m/atime in seconds */
1474+ time64_t s_time_min;
1475+ time64_t s_time_max;
14511476 #ifdef CONFIG_FSNOTIFY
14521477 __u32 s_fsnotify_mask;
14531478 struct fsnotify_mark_connector __rcu *s_fsnotify_marks;
@@ -1965,6 +1990,7 @@ struct super_operations { · 511 unmodified lines
19651990 #endif
19661991 #define S_ENCRYPTED 16384 /* Encrypted file (using fs/crypto/) */
19671992 #define S_CASEFOLD 32768 /* Casefolded file */
1993+#define S_VERITY 65536 /* Verity file (using fs/verity/) */
19681994
19691995 /*
19701996 * Note that nosuid etc flags are inode-specific: setting some file-system
@@ -2006,6 +2032,7 @@ static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags · 35 unmodified lines
20062032 #define IS_DAX(inode) ((inode)->i_flags & S_DAX)
20072033 #define IS_ENCRYPTED(inode) ((inode)->i_flags & S_ENCRYPTED)
20082034 #define IS_CASEFOLDED(inode) ((inode)->i_flags & S_CASEFOLD)
2035+#define IS_VERITY(inode) ((inode)->i_flags & S_VERITY)
20092036
20102037 #define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \
20112038 (inode)->i_rdev == WHITEOUT_DEV)
@@ -2598,6 +2625,12 @@ extern struct block_device *blkdev_get_by_path(const char *path, fmode_t mode, · 586 unmodified lines
25982625 void *holder);
25992626 extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode,
26002627 void *holder);
2628+extern struct block_device *bd_start_claiming(struct block_device *bdev,
2629+ void *holder);
2630+extern void bd_finish_claiming(struct block_device *bdev,
2631+ struct block_device *whole, void *holder);
2632+extern void bd_abort_claiming(struct block_device *bdev,
2633+ struct block_device *whole, void *holder);
26012634 extern void blkdev_put(struct block_device *bdev, fmode_t mode);
26022635 extern int __blkdev_reread_part(struct block_device *bdev);
26032636 extern int blkdev_reread_part(struct block_device *bdev);
@@ -2775,6 +2808,33 @@ static inline errseq_t filemap_sample_wb_err(struct address_space *mapping) · 171 unmodified lines
27752808 return errseq_sample(&mapping->wb_err);
27762809 }
27772810
2811+static inline int filemap_nr_thps(struct address_space *mapping)
2812+{
2813+#ifdef CONFIG_READ_ONLY_THP_FOR_FS
2814+ return atomic_read(&mapping->nr_thps);
2815+#else
2816+ return 0;
2817+#endif
2818+}
2819+
2820+static inline void filemap_nr_thps_inc(struct address_space *mapping)
2821+{
2822+#ifdef CONFIG_READ_ONLY_THP_FOR_FS
2823+ atomic_inc(&mapping->nr_thps);
2824+#else
2825+ WARN_ON_ONCE(1);
2826+#endif
2827+}
2828+
2829+static inline void filemap_nr_thps_dec(struct address_space *mapping)
2830+{
2831+#ifdef CONFIG_READ_ONLY_THP_FOR_FS
2832+ atomic_dec(&mapping->nr_thps);
2833+#else
2834+ WARN_ON_ONCE(1);
2835+#endif
2836+}
2837+
27782838 extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
27792839 int datasync);
27802840 extern int vfs_fsync(struct file *file, int datasync);
@@ -3525,6 +3585,8 @@ extern void inode_nohighmem(struct inode *inode); · 744 unmodified lines
35253585 /* mm/fadvise.c */
35263586 extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,
35273587 int advice);
3588+extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,
3589+ int advice);
35283590
35293591 #if defined(CONFIG_IO_URING)
35303592 extern struct sock *io_uring_get_socket(struct file *file);
@@ -3547,4 +3609,15 @@ static inline void simple_fill_fsxattr(struct fsxattr *fa, __u32 xflags) · 16 unmodified lines
35473609 fa->fsx_xflags = xflags;
35483610 }
35493611
3612+/*
3613+ * Flush file data before changing attributes. Caller must hold any locks
3614+ * required to prevent further writes to this file until we're done setting
3615+ * flags.
3616+ */
3617+static inline int inode_drain_writes(struct inode *inode)
3618+{
3619+ inode_dio_wait(inode);
3620+ return filemap_write_and_wait(inode->i_mapping);
3621+}
3622+
35503623 #endif /* _LINUX_FS_H */
include/linux/fs_context.h+15−2
@@ -88,13 +88,13 @@ struct fs_context { · 87 unmodified lines
8888 struct mutex uapi_mutex; /* Userspace access mutex */
8989 struct file_system_type *fs_type;
9090 void *fs_private; /* The filesystem's context */
91+ void *sget_key;
9192 struct dentry *root; /* The root and superblock */
9293 struct user_namespace *user_ns; /* The user namespace for this mount */
9394 struct net *net_ns; /* The network namespace for this mount */
9495 const struct cred *cred; /* The mounter's credentials */
9596 struct fc_log *log; /* Logging buffer */
9697 const char *source; /* The source name (eg. dev path) */
97− const char *subtype; /* The subtype to set on the superblock */
9898 void *security; /* Linux S&M options */
9999 void *s_fs_info; /* Proposed s_fs_info */
100100 unsigned int sb_flags; /* Proposed superblock flags (SB_*) */
@@ -136,10 +136,11 @@ extern int vfs_get_tree(struct fs_context *fc); · 35 unmodified lines
136136 extern void put_fs_context(struct fs_context *fc);
137137
138138 /*
139− * sget() wrapper to be called from the ->get_tree() op.
139+ * sget() wrappers to be called from the ->get_tree() op.
140140 */
141141 enum vfs_get_super_keying {
142142 vfs_get_single_super, /* Only one such superblock may exist */
143+ vfs_get_single_reconf_super, /* As above, but reconfigure if it exists */
143144 vfs_get_keyed_super, /* Superblocks with different s_fs_info keys may exist */
144145 vfs_get_independent_super, /* Multiple independent superblocks may exist */
145146 };
@@ -147,12 +148,24 @@ extern int vfs_get_super(struct fs_context *fc, · 1 unmodified line
147148 enum vfs_get_super_keying keying,
148149 int (*fill_super)(struct super_block *sb,
149150 struct fs_context *fc));
151+
150152 extern int get_tree_nodev(struct fs_context *fc,
151153 int (*fill_super)(struct super_block *sb,
152154 struct fs_context *fc));
153155 extern int get_tree_single(struct fs_context *fc,
154156 int (*fill_super)(struct super_block *sb,
155157 struct fs_context *fc));
158+extern int get_tree_single_reconf(struct fs_context *fc,
159+ int (*fill_super)(struct super_block *sb,
160+ struct fs_context *fc));
161+extern int get_tree_keyed(struct fs_context *fc,
162+ int (*fill_super)(struct super_block *sb,
163+ struct fs_context *fc),
164+ void *key);
165+
166+extern int get_tree_bdev(struct fs_context *fc,
167+ int (*fill_super)(struct super_block *sb,
168+ struct fs_context *fc));
156169
157170 extern const struct file_operations fscontext_fops;
158171
include/linux/fscrypt.h+52−3
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/fs.h>
1717 #include <linux/mm.h>
1818 #include <linux/slab.h>
19+#include <uapi/linux/fscrypt.h>
1920
2021 #define FS_CRYPTO_BLOCK_SIZE 16
2122
@@ -42,7 +43,7 @@ struct fscrypt_name { · 20 unmodified lines
4243 #define fname_len(p) ((p)->disk_name.len)
4344
4445 /* Maximum value for the third parameter of fscrypt_operations.set_context(). */
45−#define FSCRYPT_SET_CONTEXT_MAX_SIZE 28
46+#define FSCRYPT_SET_CONTEXT_MAX_SIZE 40
4647
4748 #ifdef CONFIG_FS_ENCRYPTION
4849 /*
@@ -134,13 +135,23 @@ extern void fscrypt_free_bounce_page(struct page *bounce_page); · 85 unmodified lines
134135 /* policy.c */
135136 extern int fscrypt_ioctl_set_policy(struct file *, const void __user *);
136137 extern int fscrypt_ioctl_get_policy(struct file *, void __user *);
138+extern int fscrypt_ioctl_get_policy_ex(struct file *, void __user *);
137139 extern int fscrypt_has_permitted_context(struct inode *, struct inode *);
138140 extern int fscrypt_inherit_context(struct inode *, struct inode *,
139141 void *, bool);
140−/* keyinfo.c */
142+/* keyring.c */
143+extern void fscrypt_sb_free(struct super_block *sb);
144+extern int fscrypt_ioctl_add_key(struct file *filp, void __user *arg);
145+extern int fscrypt_ioctl_remove_key(struct file *filp, void __user *arg);
146+extern int fscrypt_ioctl_remove_key_all_users(struct file *filp,
147+ void __user *arg);
148+extern int fscrypt_ioctl_get_key_status(struct file *filp, void __user *arg);
149+
150+/* keysetup.c */
141151 extern int fscrypt_get_encryption_info(struct inode *);
142152 extern void fscrypt_put_encryption_info(struct inode *);
143153 extern void fscrypt_free_inode(struct inode *);
154+extern int fscrypt_drop_inode(struct inode *inode);
144155
145156 /* fname.c */
146157 extern int fscrypt_setup_filename(struct inode *, const struct qstr *,
@@ -353,6 +364,12 @@ static inline int fscrypt_ioctl_get_policy(struct file *filp, void __user *arg) · 206 unmodified lines
353364 return -EOPNOTSUPP;
354365 }
355366
367+static inline int fscrypt_ioctl_get_policy_ex(struct file *filp,
368+ void __user *arg)
369+{
370+ return -EOPNOTSUPP;
371+}
372+
356373 static inline int fscrypt_has_permitted_context(struct inode *parent,
357374 struct inode *child)
358375 {
@@ -366,7 +383,34 @@ static inline int fscrypt_inherit_context(struct inode *parent, · 7 unmodified lines
366383 return -EOPNOTSUPP;
367384 }
368385
369−/* keyinfo.c */
386+/* keyring.c */
387+static inline void fscrypt_sb_free(struct super_block *sb)
388+{
389+}
390+
391+static inline int fscrypt_ioctl_add_key(struct file *filp, void __user *arg)
392+{
393+ return -EOPNOTSUPP;
394+}
395+
396+static inline int fscrypt_ioctl_remove_key(struct file *filp, void __user *arg)
397+{
398+ return -EOPNOTSUPP;
399+}
400+
401+static inline int fscrypt_ioctl_remove_key_all_users(struct file *filp,
402+ void __user *arg)
403+{
404+ return -EOPNOTSUPP;
405+}
406+
407+static inline int fscrypt_ioctl_get_key_status(struct file *filp,
408+ void __user *arg)
409+{
410+ return -EOPNOTSUPP;
411+}
412+
413+/* keysetup.c */
370414 static inline int fscrypt_get_encryption_info(struct inode *inode)
371415 {
372416 return -EOPNOTSUPP;
@@ -381,6 +425,11 @@ static inline void fscrypt_free_inode(struct inode *inode) · 8 unmodified lines
381425 {
382426 }
383427
428+static inline int fscrypt_drop_inode(struct inode *inode)
429+{
430+ return 0;
431+}
432+
384433 /* fname.c */
385434 static inline int fscrypt_setup_filename(struct inode *dir,
386435 const struct qstr *iname,
include/linux/fsnotify_backend.h+2−0
@@ -475,6 +475,8 @@ extern void fsnotify_destroy_mark(struct fsnotify_mark *mark, · 474 unmodified lines
475475 extern void fsnotify_detach_mark(struct fsnotify_mark *mark);
476476 /* free mark */
477477 extern void fsnotify_free_mark(struct fsnotify_mark *mark);
478+/* Wait until all marks queued for destruction are destroyed */
479+extern void fsnotify_wait_marks_destroyed(void);
478480 /* run all the marks in a group, and clear all of the marks attached to given object type */
479481 extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group, unsigned int type);
480482 /* run all the marks in a group, and clear all of the vfsmount marks */
include/linux/fsverity.h+211−0
@@ -0,0 +1,211 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * fs-verity: read-only file-based authenticity protection
4+ *
5+ * This header declares the interface between the fs/verity/ support layer and
6+ * filesystems that support fs-verity.
7+ *
8+ * Copyright 2019 Google LLC
9+ */
10+
11+#ifndef _LINUX_FSVERITY_H
12+#define _LINUX_FSVERITY_H
13+
14+#include <linux/fs.h>
15+#include <uapi/linux/fsverity.h>
16+
17+/* Verity operations for filesystems */
18+struct fsverity_operations {
19+
20+ /**
21+ * Begin enabling verity on the given file.
22+ *
23+ * @filp: a readonly file descriptor for the file
24+ *
25+ * The filesystem must do any needed filesystem-specific preparations
26+ * for enabling verity, e.g. evicting inline data. It also must return
27+ * -EBUSY if verity is already being enabled on the given file.
28+ *
29+ * i_rwsem is held for write.
30+ *
31+ * Return: 0 on success, -errno on failure
32+ */
33+ int (*begin_enable_verity)(struct file *filp);
34+
35+ /**
36+ * End enabling verity on the given file.
37+ *
38+ * @filp: a readonly file descriptor for the file
39+ * @desc: the verity descriptor to write, or NULL on failure
40+ * @desc_size: size of verity descriptor, or 0 on failure
41+ * @merkle_tree_size: total bytes the Merkle tree took up
42+ *
43+ * If desc == NULL, then enabling verity failed and the filesystem only
44+ * must do any necessary cleanups. Else, it must also store the given
45+ * verity descriptor to a fs-specific location associated with the inode
46+ * and do any fs-specific actions needed to mark the inode as a verity
47+ * inode, e.g. setting a bit in the on-disk inode. The filesystem is
48+ * also responsible for setting the S_VERITY flag in the VFS inode.
49+ *
50+ * i_rwsem is held for write, but it may have been dropped between
51+ * ->begin_enable_verity() and ->end_enable_verity().
52+ *
53+ * Return: 0 on success, -errno on failure
54+ */
55+ int (*end_enable_verity)(struct file *filp, const void *desc,
56+ size_t desc_size, u64 merkle_tree_size);
57+
58+ /**
59+ * Get the verity descriptor of the given inode.
60+ *
61+ * @inode: an inode with the S_VERITY flag set
62+ * @buf: buffer in which to place the verity descriptor
63+ * @bufsize: size of @buf, or 0 to retrieve the size only
64+ *
65+ * If bufsize == 0, then the size of the verity descriptor is returned.
66+ * Otherwise the verity descriptor is written to 'buf' and its actual
67+ * size is returned; -ERANGE is returned if it's too large. This may be
68+ * called by multiple processes concurrently on the same inode.
69+ *
70+ * Return: the size on success, -errno on failure
71+ */
72+ int (*get_verity_descriptor)(struct inode *inode, void *buf,
73+ size_t bufsize);
74+
75+ /**
76+ * Read a Merkle tree page of the given inode.
77+ *
78+ * @inode: the inode
79+ * @index: 0-based index of the page within the Merkle tree
80+ *
81+ * This can be called at any time on an open verity file, as well as
82+ * between ->begin_enable_verity() and ->end_enable_verity(). It may be
83+ * called by multiple processes concurrently, even with the same page.
84+ *
85+ * Note that this must retrieve a *page*, not necessarily a *block*.
86+ *
87+ * Return: the page on success, ERR_PTR() on failure
88+ */
89+ struct page *(*read_merkle_tree_page)(struct inode *inode,
90+ pgoff_t index);
91+
92+ /**
93+ * Write a Merkle tree block to the given inode.
94+ *
95+ * @inode: the inode for which the Merkle tree is being built
96+ * @buf: block to write
97+ * @index: 0-based index of the block within the Merkle tree
98+ * @log_blocksize: log base 2 of the Merkle tree block size
99+ *
100+ * This is only called between ->begin_enable_verity() and
101+ * ->end_enable_verity().
102+ *
103+ * Return: 0 on success, -errno on failure
104+ */
105+ int (*write_merkle_tree_block)(struct inode *inode, const void *buf,
106+ u64 index, int log_blocksize);
107+};
108+
109+#ifdef CONFIG_FS_VERITY
110+
111+static inline struct fsverity_info *fsverity_get_info(const struct inode *inode)
112+{
113+ /* pairs with the cmpxchg() in fsverity_set_info() */
114+ return READ_ONCE(inode->i_verity_info);
115+}
116+
117+/* enable.c */
118+
119+extern int fsverity_ioctl_enable(struct file *filp, const void __user *arg);
120+
121+/* measure.c */
122+
123+extern int fsverity_ioctl_measure(struct file *filp, void __user *arg);
124+
125+/* open.c */
126+
127+extern int fsverity_file_open(struct inode *inode, struct file *filp);
128+extern int fsverity_prepare_setattr(struct dentry *dentry, struct iattr *attr);
129+extern void fsverity_cleanup_inode(struct inode *inode);
130+
131+/* verify.c */
132+
133+extern bool fsverity_verify_page(struct page *page);
134+extern void fsverity_verify_bio(struct bio *bio);
135+extern void fsverity_enqueue_verify_work(struct work_struct *work);
136+
137+#else /* !CONFIG_FS_VERITY */
138+
139+static inline struct fsverity_info *fsverity_get_info(const struct inode *inode)
140+{
141+ return NULL;
142+}
143+
144+/* enable.c */
145+
146+static inline int fsverity_ioctl_enable(struct file *filp,
147+ const void __user *arg)
148+{
149+ return -EOPNOTSUPP;
150+}
151+
152+/* measure.c */
153+
154+static inline int fsverity_ioctl_measure(struct file *filp, void __user *arg)
155+{
156+ return -EOPNOTSUPP;
157+}
158+
159+/* open.c */
160+
161+static inline int fsverity_file_open(struct inode *inode, struct file *filp)
162+{
163+ return IS_VERITY(inode) ? -EOPNOTSUPP : 0;
164+}
165+
166+static inline int fsverity_prepare_setattr(struct dentry *dentry,
167+ struct iattr *attr)
168+{
169+ return IS_VERITY(d_inode(dentry)) ? -EOPNOTSUPP : 0;
170+}
171+
172+static inline void fsverity_cleanup_inode(struct inode *inode)
173+{
174+}
175+
176+/* verify.c */
177+
178+static inline bool fsverity_verify_page(struct page *page)
179+{
180+ WARN_ON(1);
181+ return false;
182+}
183+
184+static inline void fsverity_verify_bio(struct bio *bio)
185+{
186+ WARN_ON(1);
187+}
188+
189+static inline void fsverity_enqueue_verify_work(struct work_struct *work)
190+{
191+ WARN_ON(1);
192+}
193+
194+#endif /* !CONFIG_FS_VERITY */
195+
196+/**
197+ * fsverity_active() - do reads from the inode need to go through fs-verity?
198+ *
199+ * This checks whether ->i_verity_info has been set.
200+ *
201+ * Filesystems call this from ->readpages() to check whether the pages need to
202+ * be verified or not. Don't use IS_VERITY() for this purpose; it's subject to
203+ * a race condition where the file is being read concurrently with
204+ * FS_IOC_ENABLE_VERITY completing. (S_VERITY is set before ->i_verity_info.)
205+ */
206+static inline bool fsverity_active(const struct inode *inode)
207+{
208+ return fsverity_get_info(inode) != NULL;
209+}
210+
211+#endif /* _LINUX_FSVERITY_H */
include/linux/fwnode.h+5−4
@@ -110,10 +110,11 @@ struct fwnode_operations { · 109 unmodified lines
110110 (fwnode ? (fwnode_has_op(fwnode, op) ? \
111111 (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : -ENXIO) : \
112112 -EINVAL)
113−#define fwnode_call_bool_op(fwnode, op, ...) \
114− (fwnode ? (fwnode_has_op(fwnode, op) ? \
115− (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : false) : \
116− false)
113+
114+#define fwnode_call_bool_op(fwnode, op, ...) \
115+ (fwnode_has_op(fwnode, op) ? \
116+ (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : false)
117+
117118 #define fwnode_call_ptr_op(fwnode, op, ...) \
118119 (fwnode_has_op(fwnode, op) ? \
119120 (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : NULL)
include/linux/gpio.h+0−37
@@ -221,19 +221,6 @@ static inline int gpio_to_irq(unsigned gpio) · 220 unmodified lines
221221 return -EINVAL;
222222 }
223223
224−static inline int gpiochip_lock_as_irq(struct gpio_chip *chip,
225− unsigned int offset)
226−{
227− WARN_ON(1);
228− return -EINVAL;
229−}
230−
231−static inline void gpiochip_unlock_as_irq(struct gpio_chip *chip,
232− unsigned int offset)
233−{
234− WARN_ON(1);
235−}
236−
237224 static inline int irq_to_gpio(unsigned irq)
238225 {
239226 /* irq can never have been returned from gpio_to_irq() */
@@ -241,30 +228,6 @@ static inline int irq_to_gpio(unsigned irq) · 1 unmodified line
241228 return -EINVAL;
242229 }
243230
244−static inline int
245−gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
246− unsigned int gpio_offset, unsigned int pin_offset,
247− unsigned int npins)
248−{
249− WARN_ON(1);
250− return -EINVAL;
251−}
252−
253−static inline int
254−gpiochip_add_pingroup_range(struct gpio_chip *chip,
255− struct pinctrl_dev *pctldev,
256− unsigned int gpio_offset, const char *pin_group)
257−{
258− WARN_ON(1);
259− return -EINVAL;
260−}
261−
262−static inline void
263−gpiochip_remove_pin_ranges(struct gpio_chip *chip)
264−{
265− WARN_ON(1);
266−}
267−
268231 static inline int devm_gpio_request(struct device *dev, unsigned gpio,
269232 const char *label)
270233 {
include/linux/gpio/consumer.h+137−62
@@ -170,18 +170,8 @@ struct gpio_desc *gpio_to_desc(unsigned gpio); · 169 unmodified lines
170170 int desc_to_gpio(const struct gpio_desc *desc);
171171
172172 /* Child properties interface */
173−struct device_node;
174173 struct fwnode_handle;
175174
176−struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
177− const char *propname, int index,
178− enum gpiod_flags dflags,
179− const char *label);
180−struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev,
181− struct device_node *node,
182− const char *propname, int index,
183− enum gpiod_flags dflags,
184− const char *label);
185175 struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
186176 const char *propname, int index,
187177 enum gpiod_flags dflags,
@@ -247,7 +237,7 @@ static inline void gpiod_put(struct gpio_desc *desc) · 59 unmodified lines
247237 might_sleep();
248238
249239 /* GPIO can never have been requested */
250− WARN_ON(1);
240+ WARN_ON(desc);
251241 }
252242
253243 static inline void devm_gpiod_unhinge(struct device *dev,
@@ -256,7 +246,7 @@ static inline void devm_gpiod_unhinge(struct device *dev, · 2 unmodified lines
256246 might_sleep();
257247
258248 /* GPIO can never have been requested */
259− WARN_ON(1);
249+ WARN_ON(desc);
260250 }
261251
262252 static inline void gpiod_put_array(struct gpio_descs *descs)
@@ -264,7 +254,7 @@ static inline void gpiod_put_array(struct gpio_descs *descs) · 1 unmodified line
264254 might_sleep();
265255
266256 /* GPIO can never have been requested */
267− WARN_ON(1);
257+ WARN_ON(descs);
268258 }
269259
270260 static inline struct gpio_desc *__must_check
@@ -317,7 +307,7 @@ static inline void devm_gpiod_put(struct device *dev, struct gpio_desc *desc) · 46 unmodified lines
317307 might_sleep();
318308
319309 /* GPIO can never have been requested */
320− WARN_ON(1);
310+ WARN_ON(desc);
321311 }
322312
323313 static inline void devm_gpiod_put_array(struct device *dev,
@@ -326,32 +316,32 @@ static inline void devm_gpiod_put_array(struct device *dev, · 2 unmodified lines
326316 might_sleep();
327317
328318 /* GPIO can never have been requested */
329− WARN_ON(1);
319+ WARN_ON(descs);
330320 }
331321
332322
333323 static inline int gpiod_get_direction(const struct gpio_desc *desc)
334324 {
335325 /* GPIO can never have been requested */
336− WARN_ON(1);
326+ WARN_ON(desc);
337327 return -ENOSYS;
338328 }
339329 static inline int gpiod_direction_input(struct gpio_desc *desc)
340330 {
341331 /* GPIO can never have been requested */
342− WARN_ON(1);
332+ WARN_ON(desc);
343333 return -ENOSYS;
344334 }
345335 static inline int gpiod_direction_output(struct gpio_desc *desc, int value)
346336 {
347337 /* GPIO can never have been requested */
348− WARN_ON(1);
338+ WARN_ON(desc);
349339 return -ENOSYS;
350340 }
351341 static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)
352342 {
353343 /* GPIO can never have been requested */
354− WARN_ON(1);
344+ WARN_ON(desc);
355345 return -ENOSYS;
356346 }
357347
@@ -359,7 +349,7 @@ static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value) · 1 unmodified line
359349 static inline int gpiod_get_value(const struct gpio_desc *desc)
360350 {
361351 /* GPIO can never have been requested */
362− WARN_ON(1);
352+ WARN_ON(desc);
363353 return 0;
364354 }
365355 static inline int gpiod_get_array_value(unsigned int array_size,
@@ -368,13 +358,13 @@ static inline int gpiod_get_array_value(unsigned int array_size, · 2 unmodified lines
368358 unsigned long *value_bitmap)
369359 {
370360 /* GPIO can never have been requested */
371− WARN_ON(1);
361+ WARN_ON(desc_array);
372362 return 0;
373363 }
374364 static inline void gpiod_set_value(struct gpio_desc *desc, int value)
375365 {
376366 /* GPIO can never have been requested */
377− WARN_ON(1);
367+ WARN_ON(desc);
378368 }
379369 static inline int gpiod_set_array_value(unsigned int array_size,
380370 struct gpio_desc **desc_array,
@@ -382,13 +372,13 @@ static inline int gpiod_set_array_value(unsigned int array_size, · 1 unmodified line
382372 unsigned long *value_bitmap)
383373 {
384374 /* GPIO can never have been requested */
385− WARN_ON(1);
375+ WARN_ON(desc_array);
386376 return 0;
387377 }
388378 static inline int gpiod_get_raw_value(const struct gpio_desc *desc)
389379 {
390380 /* GPIO can never have been requested */
391− WARN_ON(1);
381+ WARN_ON(desc);
392382 return 0;
393383 }
394384 static inline int gpiod_get_raw_array_value(unsigned int array_size,
@@ -397,13 +387,13 @@ static inline int gpiod_get_raw_array_value(unsigned int array_size, · 2 unmodified lines
397387 unsigned long *value_bitmap)
398388 {
399389 /* GPIO can never have been requested */
400− WARN_ON(1);
390+ WARN_ON(desc_array);
401391 return 0;
402392 }
403393 static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value)
404394 {
405395 /* GPIO can never have been requested */
406− WARN_ON(1);
396+ WARN_ON(desc);
407397 }
408398 static inline int gpiod_set_raw_array_value(unsigned int array_size,
409399 struct gpio_desc **desc_array,
@@ -411,14 +401,14 @@ static inline int gpiod_set_raw_array_value(unsigned int array_size, · 1 unmodified line
411401 unsigned long *value_bitmap)
412402 {
413403 /* GPIO can never have been requested */
414− WARN_ON(1);
404+ WARN_ON(desc_array);
415405 return 0;
416406 }
417407
418408 static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc)
419409 {
420410 /* GPIO can never have been requested */
421− WARN_ON(1);
411+ WARN_ON(desc);
422412 return 0;
423413 }
424414 static inline int gpiod_get_array_value_cansleep(unsigned int array_size,
@@ -427,13 +417,13 @@ static inline int gpiod_get_array_value_cansleep(unsigned int array_size, · 2 unmodified lines
427417 unsigned long *value_bitmap)
428418 {
429419 /* GPIO can never have been requested */
430− WARN_ON(1);
420+ WARN_ON(desc_array);
431421 return 0;
432422 }
433423 static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value)
434424 {
435425 /* GPIO can never have been requested */
436− WARN_ON(1);
426+ WARN_ON(desc);
437427 }
438428 static inline int gpiod_set_array_value_cansleep(unsigned int array_size,
439429 struct gpio_desc **desc_array,
@@ -441,13 +431,13 @@ static inline int gpiod_set_array_value_cansleep(unsigned int array_size, · 1 unmodified line
441431 unsigned long *value_bitmap)
442432 {
443433 /* GPIO can never have been requested */
444− WARN_ON(1);
434+ WARN_ON(desc_array);
445435 return 0;
446436 }
447437 static inline int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc)
448438 {
449439 /* GPIO can never have been requested */
450− WARN_ON(1);
440+ WARN_ON(desc);
451441 return 0;
452442 }
453443 static inline int gpiod_get_raw_array_value_cansleep(unsigned int array_size,
@@ -456,14 +446,14 @@ static inline int gpiod_get_raw_array_value_cansleep(unsigned int array_size, · 2 unmodified lines
456446 unsigned long *value_bitmap)
457447 {
458448 /* GPIO can never have been requested */
459− WARN_ON(1);
449+ WARN_ON(desc_array);
460450 return 0;
461451 }
462452 static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc,
463453 int value)
464454 {
465455 /* GPIO can never have been requested */
466− WARN_ON(1);
456+ WARN_ON(desc);
467457 }
468458 static inline int gpiod_set_raw_array_value_cansleep(unsigned int array_size,
469459 struct gpio_desc **desc_array,
@@ -471,41 +461,41 @@ static inline int gpiod_set_raw_array_value_cansleep(unsigned int array_size, · 1 unmodified line
471461 unsigned long *value_bitmap)
472462 {
473463 /* GPIO can never have been requested */
474− WARN_ON(1);
464+ WARN_ON(desc_array);
475465 return 0;
476466 }
477467
478468 static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
479469 {
480470 /* GPIO can never have been requested */
481− WARN_ON(1);
471+ WARN_ON(desc);
482472 return -ENOSYS;
483473 }
484474
485475 static inline int gpiod_set_transitory(struct gpio_desc *desc, bool transitory)
486476 {
487477 /* GPIO can never have been requested */
488− WARN_ON(1);
478+ WARN_ON(desc);
489479 return -ENOSYS;
490480 }
491481
492482 static inline int gpiod_is_active_low(const struct gpio_desc *desc)
493483 {
494484 /* GPIO can never have been requested */
495− WARN_ON(1);
485+ WARN_ON(desc);
496486 return 0;
497487 }
498488 static inline int gpiod_cansleep(const struct gpio_desc *desc)
499489 {
500490 /* GPIO can never have been requested */
501− WARN_ON(1);
491+ WARN_ON(desc);
502492 return 0;
503493 }
504494
505495 static inline int gpiod_to_irq(const struct gpio_desc *desc)
506496 {
507497 /* GPIO can never have been requested */
508− WARN_ON(1);
498+ WARN_ON(desc);
509499 return -EINVAL;
510500 }
511501
@@ -513,7 +503,7 @@ static inline int gpiod_set_consumer_name(struct gpio_desc *desc, · 1 unmodified line
513503 const char *name)
514504 {
515505 /* GPIO can never have been requested */
516− WARN_ON(1);
506+ WARN_ON(desc);
517507 return -EINVAL;
518508 }
519509
@@ -525,33 +515,13 @@ static inline struct gpio_desc *gpio_to_desc(unsigned gpio) · 5 unmodified lines
525515 static inline int desc_to_gpio(const struct gpio_desc *desc)
526516 {
527517 /* GPIO can never have been requested */
528− WARN_ON(1);
518+ WARN_ON(desc);
529519 return -EINVAL;
530520 }
531521
532522 /* Child properties interface */
533−struct device_node;
534523 struct fwnode_handle;
535524
536−static inline
537−struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
538− const char *propname, int index,
539− enum gpiod_flags dflags,
540− const char *label)
541−{
542− return ERR_PTR(-ENOSYS);
543−}
544−
545−static inline
546−struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev,
547− struct device_node *node,
548− const char *propname, int index,
549− enum gpiod_flags dflags,
550− const char *label)
551−{
552− return ERR_PTR(-ENOSYS);
553−}
554−
555525 static inline
556526 struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
557527 const char *propname, int index,
@@ -584,6 +554,111 @@ struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev, · 26 unmodified lines
584554 flags, label);
585555 }
586556
557+#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_OF_GPIO)
558+struct device_node;
559+
560+struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
561+ const char *propname, int index,
562+ enum gpiod_flags dflags,
563+ const char *label);
564+
565+#else /* CONFIG_GPIOLIB && CONFIG_OF_GPIO */
566+
567+struct device_node;
568+
569+static inline
570+struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
571+ const char *propname, int index,
572+ enum gpiod_flags dflags,
573+ const char *label)
574+{
575+ return ERR_PTR(-ENOSYS);
576+}
577+
578+#endif /* CONFIG_GPIOLIB && CONFIG_OF_GPIO */
579+
580+#ifdef CONFIG_GPIOLIB
581+struct device_node;
582+
583+struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev,
584+ struct device_node *node,
585+ const char *propname, int index,
586+ enum gpiod_flags dflags,
587+ const char *label);
588+
589+#else /* CONFIG_GPIOLIB */
590+
591+struct device_node;
592+
593+static inline
594+struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev,
595+ struct device_node *node,
596+ const char *propname, int index,
597+ enum gpiod_flags dflags,
598+ const char *label)
599+{
600+ return ERR_PTR(-ENOSYS);
601+}
602+
603+#endif /* CONFIG_GPIOLIB */
604+
605+struct acpi_gpio_params {
606+ unsigned int crs_entry_index;
607+ unsigned int line_index;
608+ bool active_low;
609+};
610+
611+struct acpi_gpio_mapping {
612+ const char *name;
613+ const struct acpi_gpio_params *data;
614+ unsigned int size;
615+
616+/* Ignore IoRestriction field */
617+#define ACPI_GPIO_QUIRK_NO_IO_RESTRICTION BIT(0)
618+/*
619+ * When ACPI GPIO mapping table is in use the index parameter inside it
620+ * refers to the GPIO resource in _CRS method. That index has no
621+ * distinction of actual type of the resource. When consumer wants to
622+ * get GpioIo type explicitly, this quirk may be used.
623+ */
624+#define ACPI_GPIO_QUIRK_ONLY_GPIOIO BIT(1)
625+
626+ unsigned int quirks;
627+};
628+
629+#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_ACPI)
630+
631+struct acpi_device;
632+
633+int acpi_dev_add_driver_gpios(struct acpi_device *adev,
634+ const struct acpi_gpio_mapping *gpios);
635+void acpi_dev_remove_driver_gpios(struct acpi_device *adev);
636+
637+int devm_acpi_dev_add_driver_gpios(struct device *dev,
638+ const struct acpi_gpio_mapping *gpios);
639+void devm_acpi_dev_remove_driver_gpios(struct device *dev);
640+
641+#else /* CONFIG_GPIOLIB && CONFIG_ACPI */
642+
643+struct acpi_device;
644+
645+static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
646+ const struct acpi_gpio_mapping *gpios)
647+{
648+ return -ENXIO;
649+}
650+static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) {}
651+
652+static inline int devm_acpi_dev_add_driver_gpios(struct device *dev,
653+ const struct acpi_gpio_mapping *gpios)
654+{
655+ return -ENXIO;
656+}
657+static inline void devm_acpi_dev_remove_driver_gpios(struct device *dev) {}
658+
659+#endif /* CONFIG_GPIOLIB && CONFIG_ACPI */
660+
661+
587662 #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)
588663
589664 int gpiod_export(struct gpio_desc *desc, bool direction_may_change);
include/linux/gpio/driver.h+144−34
@@ -20,9 +20,8 @@ struct module; · 19 unmodified lines
2020 enum gpiod_flags;
2121 enum gpio_lookup_flags;
2222
23−#ifdef CONFIG_GPIOLIB
23+struct gpio_chip;
2424
25−#ifdef CONFIG_GPIOLIB_IRQCHIP
2625 /**
2726 * struct gpio_irq_chip - GPIO interrupt controller
2827 */
@@ -49,6 +48,84 @@ struct gpio_irq_chip { · 20 unmodified lines
4948 */
5049 const struct irq_domain_ops *domain_ops;
5150
51+#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
52+ /**
53+ * @fwnode:
54+ *
55+ * Firmware node corresponding to this gpiochip/irqchip, necessary
56+ * for hierarchical irqdomain support.
57+ */
58+ struct fwnode_handle *fwnode;
59+
60+ /**
61+ * @parent_domain:
62+ *
63+ * If non-NULL, will be set as the parent of this GPIO interrupt
64+ * controller's IRQ domain to establish a hierarchical interrupt
65+ * domain. The presence of this will activate the hierarchical
66+ * interrupt support.
67+ */
68+ struct irq_domain *parent_domain;
69+
70+ /**
71+ * @child_to_parent_hwirq:
72+ *
73+ * This callback translates a child hardware IRQ offset to a parent
74+ * hardware IRQ offset on a hierarchical interrupt chip. The child
75+ * hardware IRQs correspond to the GPIO index 0..ngpio-1 (see the
76+ * ngpio field of struct gpio_chip) and the corresponding parent
77+ * hardware IRQ and type (such as IRQ_TYPE_*) shall be returned by
78+ * the driver. The driver can calculate this from an offset or using
79+ * a lookup table or whatever method is best for this chip. Return
80+ * 0 on successful translation in the driver.
81+ *
82+ * If some ranges of hardware IRQs do not have a corresponding parent
83+ * HWIRQ, return -EINVAL, but also make sure to fill in @valid_mask and
84+ * @need_valid_mask to make these GPIO lines unavailable for
85+ * translation.
86+ */
87+ int (*child_to_parent_hwirq)(struct gpio_chip *chip,
88+ unsigned int child_hwirq,
89+ unsigned int child_type,
90+ unsigned int *parent_hwirq,
91+ unsigned int *parent_type);
92+
93+ /**
94+ * @populate_parent_fwspec:
95+ *
96+ * This optional callback populates the &struct irq_fwspec for the
97+ * parent's IRQ domain. If this is not specified, then
98+ * &gpiochip_populate_parent_fwspec_twocell will be used. A four-cell
99+ * variant named &gpiochip_populate_parent_fwspec_fourcell is also
100+ * available.
101+ */
102+ void (*populate_parent_fwspec)(struct gpio_chip *chip,
103+ struct irq_fwspec *fwspec,
104+ unsigned int parent_hwirq,
105+ unsigned int parent_type);
106+
107+ /**
108+ * @child_offset_to_irq:
109+ *
110+ * This optional callback is used to translate the child's GPIO line
111+ * offset on the GPIO chip to an IRQ number for the GPIO to_irq()
112+ * callback. If this is not specified, then a default callback will be
113+ * provided that returns the line offset.
114+ */
115+ unsigned int (*child_offset_to_irq)(struct gpio_chip *chip,
116+ unsigned int pin);
117+
118+ /**
119+ * @child_irq_domain_ops:
120+ *
121+ * The IRQ domain operations that will be used for this GPIO IRQ
122+ * chip. If no operations are provided, then default callbacks will
123+ * be populated to setup the IRQ hierarchy. Some drivers need to
124+ * supply their own translate function.
125+ */
126+ struct irq_domain_ops child_irq_domain_ops;
127+#endif
128+
52129 /**
53130 * @handler:
54131 *
@@ -125,11 +202,17 @@ struct gpio_irq_chip { · 70 unmodified lines
125202 bool threaded;
126203
127204 /**
128− * @need_valid_mask:
129− *
130− * If set core allocates @valid_mask with all bits set to one.
205+ * @init_valid_mask: optional routine to initialize @valid_mask, to be
206+ * used if not all GPIO lines are valid interrupts. Sometimes some
207+ * lines just cannot fire interrupts, and this routine, when defined,
208+ * is passed a bitmap in "valid_mask" and it will have ngpios
209+ * bits from 0..(ngpios-1) set to "1" as in valid. The callback can
210+ * then directly set some bits to "0" if they cannot be used for
211+ * interrupts.
131212 */
132− bool need_valid_mask;
213+ void (*init_valid_mask)(struct gpio_chip *chip,
214+ unsigned long *valid_mask,
215+ unsigned int ngpios);
133216
134217 /**
135218 * @valid_mask:
@@ -161,7 +244,6 @@ struct gpio_irq_chip { · 25 unmodified lines
161244 */
162245 void (*irq_disable)(struct irq_data *data);
163246 };
164−#endif /* CONFIG_GPIOLIB_IRQCHIP */
165247
166248 /**
167249 * struct gpio_chip - abstract a GPIO controller
@@ -282,7 +364,9 @@ struct gpio_chip { · 114 unmodified lines
282364 void (*dbg_show)(struct seq_file *s,
283365 struct gpio_chip *chip);
284366
285− int (*init_valid_mask)(struct gpio_chip *chip);
367+ int (*init_valid_mask)(struct gpio_chip *chip,
368+ unsigned long *valid_mask,
369+ unsigned int ngpios);
286370
287371 int base;
288372 u16 ngpio;
@@ -320,15 +404,6 @@ struct gpio_chip { · 31 unmodified lines
320404 struct gpio_irq_chip irq;
321405 #endif /* CONFIG_GPIOLIB_IRQCHIP */
322406
323− /**
324− * @need_valid_mask:
325− *
326− * If set core allocates @valid_mask with all its values initialized
327− * with init_valid_mask() or set to one if init_valid_mask() is not
328− * defined
329− */
330− bool need_valid_mask;
331−
332407 /**
333408 * @valid_mask:
334409 *
@@ -421,9 +496,6 @@ extern int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *chip, · 86 unmodified lines
421496 extern struct gpio_chip *gpiochip_find(void *data,
422497 int (*match)(struct gpio_chip *chip, void *data));
423498
424−/* lock/unlock as IRQ */
425−int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset);
426−void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);
427499 bool gpiochip_line_is_irq(struct gpio_chip *chip, unsigned int offset);
428500 int gpiochip_reqres_irq(struct gpio_chip *chip, unsigned int offset);
429501 void gpiochip_relres_irq(struct gpio_chip *chip, unsigned int offset);
@@ -441,15 +513,40 @@ bool gpiochip_line_is_valid(const struct gpio_chip *chip, unsigned int offset); · 11 unmodified lines
441513 /* get driver data */
442514 void *gpiochip_get_data(struct gpio_chip *chip);
443515
444−struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc);
445−
446516 struct bgpio_pdata {
447517 const char *label;
448518 int base;
449519 int ngpio;
450520 };
451521
452−#if IS_ENABLED(CONFIG_GPIO_GENERIC)
522+#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
523+
524+void gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *chip,
525+ struct irq_fwspec *fwspec,
526+ unsigned int parent_hwirq,
527+ unsigned int parent_type);
528+void gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *chip,
529+ struct irq_fwspec *fwspec,
530+ unsigned int parent_hwirq,
531+ unsigned int parent_type);
532+
533+#else
534+
535+static inline void gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *chip,
536+ struct irq_fwspec *fwspec,
537+ unsigned int parent_hwirq,
538+ unsigned int parent_type)
539+{
540+}
541+
542+static inline void gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *chip,
543+ struct irq_fwspec *fwspec,
544+ unsigned int parent_hwirq,
545+ unsigned int parent_type)
546+{
547+}
548+
549+#endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */
453550
454551 int bgpio_init(struct gpio_chip *gc, struct device *dev,
455552 unsigned long sz, void __iomem *dat, void __iomem *set,
@@ -463,10 +560,6 @@ int bgpio_init(struct gpio_chip *gc, struct device *dev, · 7 unmodified lines
463560 #define BGPIOF_READ_OUTPUT_REG_SET BIT(4) /* reg_set stores output value */
464561 #define BGPIOF_NO_OUTPUT BIT(5) /* only input */
465562
466−#endif /* CONFIG_GPIO_GENERIC */
467−
468−#ifdef CONFIG_GPIOLIB_IRQCHIP
469−
470563 int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
471564 irq_hw_number_t hwirq);
472565 void gpiochip_irq_unmap(struct irq_domain *d, unsigned int irq);
@@ -555,15 +648,11 @@ static inline int gpiochip_irqchip_add_nested(struct gpio_chip *gpiochip, · 82 unmodified lines
555648 }
556649 #endif /* CONFIG_LOCKDEP */
557650
558−#endif /* CONFIG_GPIOLIB_IRQCHIP */
559−
560651 int gpiochip_generic_request(struct gpio_chip *chip, unsigned offset);
561652 void gpiochip_generic_free(struct gpio_chip *chip, unsigned offset);
562653 int gpiochip_generic_config(struct gpio_chip *chip, unsigned offset,
563654 unsigned long config);
564655
565−#ifdef CONFIG_PINCTRL
566−
567656 /**
568657 * struct gpio_pin_range - pin range controlled by a gpio chip
569658 * @node: list for maintaining set of pin ranges, used internally
@@ -576,6 +665,8 @@ struct gpio_pin_range { · 6 unmodified lines
576665 struct pinctrl_gpio_range range;
577666 };
578667
668+#ifdef CONFIG_PINCTRL
669+
579670 int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
580671 unsigned int gpio_offset, unsigned int pin_offset,
581672 unsigned int npins);
@@ -586,8 +677,6 @@ void gpiochip_remove_pin_ranges(struct gpio_chip *chip); · 4 unmodified lines
586677
587678 #else /* ! CONFIG_PINCTRL */
588679
589−struct pinctrl_dev;
590−
591680 static inline int
592681 gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
593682 unsigned int gpio_offset, unsigned int pin_offset,
@@ -619,6 +708,15 @@ void gpiochip_free_own_desc(struct gpio_desc *desc); · 25 unmodified lines
619708 void devprop_gpiochip_set_names(struct gpio_chip *chip,
620709 const struct fwnode_handle *fwnode);
621710
711+#ifdef CONFIG_GPIOLIB
712+
713+/* lock/unlock as IRQ */
714+int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset);
715+void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);
716+
717+
718+struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc);
719+
622720 #else /* CONFIG_GPIOLIB */
623721
624722 static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc)
@@ -628,6 +726,18 @@ static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc) · 3 unmodified lines
628726 return ERR_PTR(-ENODEV);
629727 }
630728
729+static inline int gpiochip_lock_as_irq(struct gpio_chip *chip,
730+ unsigned int offset)
731+{
732+ WARN_ON(1);
733+ return -EINVAL;
734+}
735+
736+static inline void gpiochip_unlock_as_irq(struct gpio_chip *chip,
737+ unsigned int offset)
738+{
739+ WARN_ON(1);
740+}
631741 #endif /* CONFIG_GPIOLIB */
632742
633−#endif
743+#endif /* __LINUX_GPIO_DRIVER_H */
include/linux/greybus.h+152−0
@@ -0,0 +1,152 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Greybus driver and device API
4+ *
5+ * Copyright 2014-2015 Google Inc.
6+ * Copyright 2014-2015 Linaro Ltd.
7+ */
8+
9+#ifndef __LINUX_GREYBUS_H
10+#define __LINUX_GREYBUS_H
11+
12+#ifdef __KERNEL__
13+
14+#include <linux/kernel.h>
15+#include <linux/types.h>
16+#include <linux/list.h>
17+#include <linux/slab.h>
18+#include <linux/device.h>
19+#include <linux/module.h>
20+#include <linux/pm_runtime.h>
21+#include <linux/idr.h>
22+
23+#include <linux/greybus/greybus_id.h>
24+#include <linux/greybus/greybus_manifest.h>
25+#include <linux/greybus/greybus_protocols.h>
26+#include <linux/greybus/manifest.h>
27+#include <linux/greybus/hd.h>
28+#include <linux/greybus/svc.h>
29+#include <linux/greybus/control.h>
30+#include <linux/greybus/module.h>
31+#include <linux/greybus/interface.h>
32+#include <linux/greybus/bundle.h>
33+#include <linux/greybus/connection.h>
34+#include <linux/greybus/operation.h>
35+
36+/* Matches up with the Greybus Protocol specification document */
37+#define GREYBUS_VERSION_MAJOR 0x00
38+#define GREYBUS_VERSION_MINOR 0x01
39+
40+#define GREYBUS_ID_MATCH_DEVICE \
41+ (GREYBUS_ID_MATCH_VENDOR | GREYBUS_ID_MATCH_PRODUCT)
42+
43+#define GREYBUS_DEVICE(v, p) \
44+ .match_flags = GREYBUS_ID_MATCH_DEVICE, \
45+ .vendor = (v), \
46+ .product = (p),
47+
48+#define GREYBUS_DEVICE_CLASS(c) \
49+ .match_flags = GREYBUS_ID_MATCH_CLASS, \
50+ .class = (c),
51+
52+/* Maximum number of CPorts */
53+#define CPORT_ID_MAX 4095 /* UniPro max id is 4095 */
54+#define CPORT_ID_BAD U16_MAX
55+
56+struct greybus_driver {
57+ const char *name;
58+
59+ int (*probe)(struct gb_bundle *bundle,
60+ const struct greybus_bundle_id *id);
61+ void (*disconnect)(struct gb_bundle *bundle);
62+
63+ const struct greybus_bundle_id *id_table;
64+
65+ struct device_driver driver;
66+};
67+#define to_greybus_driver(d) container_of(d, struct greybus_driver, driver)
68+
69+static inline void greybus_set_drvdata(struct gb_bundle *bundle, void *data)
70+{
71+ dev_set_drvdata(&bundle->dev, data);
72+}
73+
74+static inline void *greybus_get_drvdata(struct gb_bundle *bundle)
75+{
76+ return dev_get_drvdata(&bundle->dev);
77+}
78+
79+/* Don't call these directly, use the module_greybus_driver() macro instead */
80+int greybus_register_driver(struct greybus_driver *driver,
81+ struct module *module, const char *mod_name);
82+void greybus_deregister_driver(struct greybus_driver *driver);
83+
84+/* define to get proper THIS_MODULE and KBUILD_MODNAME values */
85+#define greybus_register(driver) \
86+ greybus_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
87+#define greybus_deregister(driver) \
88+ greybus_deregister_driver(driver)
89+
90+/**
91+ * module_greybus_driver() - Helper macro for registering a Greybus driver
92+ * @__greybus_driver: greybus_driver structure
93+ *
94+ * Helper macro for Greybus drivers to set up proper module init / exit
95+ * functions. Replaces module_init() and module_exit() and keeps people from
96+ * printing pointless things to the kernel log when their driver is loaded.
97+ */
98+#define module_greybus_driver(__greybus_driver) \
99+ module_driver(__greybus_driver, greybus_register, greybus_deregister)
100+
101+int greybus_disabled(void);
102+
103+void gb_debugfs_init(void);
104+void gb_debugfs_cleanup(void);
105+struct dentry *gb_debugfs_get(void);
106+
107+extern struct bus_type greybus_bus_type;
108+
109+extern struct device_type greybus_hd_type;
110+extern struct device_type greybus_module_type;
111+extern struct device_type greybus_interface_type;
112+extern struct device_type greybus_control_type;
113+extern struct device_type greybus_bundle_type;
114+extern struct device_type greybus_svc_type;
115+
116+static inline int is_gb_host_device(const struct device *dev)
117+{
118+ return dev->type == &greybus_hd_type;
119+}
120+
121+static inline int is_gb_module(const struct device *dev)
122+{
123+ return dev->type == &greybus_module_type;
124+}
125+
126+static inline int is_gb_interface(const struct device *dev)
127+{
128+ return dev->type == &greybus_interface_type;
129+}
130+
131+static inline int is_gb_control(const struct device *dev)
132+{
133+ return dev->type == &greybus_control_type;
134+}
135+
136+static inline int is_gb_bundle(const struct device *dev)
137+{
138+ return dev->type == &greybus_bundle_type;
139+}
140+
141+static inline int is_gb_svc(const struct device *dev)
142+{
143+ return dev->type == &greybus_svc_type;
144+}
145+
146+static inline bool cport_id_valid(struct gb_host_device *hd, u16 cport_id)
147+{
148+ return cport_id != CPORT_ID_BAD && cport_id < hd->num_cports;
149+}
150+
151+#endif /* __KERNEL__ */
152+#endif /* __LINUX_GREYBUS_H */
include/linux/greybus/bundle.h+92−0
@@ -0,0 +1,92 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Greybus bundles
4+ *
5+ * Copyright 2014 Google Inc.
6+ * Copyright 2014 Linaro Ltd.
7+ */
8+
9+#ifndef __BUNDLE_H
10+#define __BUNDLE_H
11+
12+#include <linux/types.h>
13+#include <linux/list.h>
14+#include <linux/pm_runtime.h>
15+#include <linux/device.h>
16+
17+#define BUNDLE_ID_NONE U8_MAX
18+
19+/* Greybus "public" definitions" */
20+struct gb_bundle {
21+ struct device dev;
22+ struct gb_interface *intf;
23+
24+ u8 id;
25+ u8 class;
26+ u8 class_major;
27+ u8 class_minor;
28+
29+ size_t num_cports;
30+ struct greybus_descriptor_cport *cport_desc;
31+
32+ struct list_head connections;
33+ u8 *state;
34+
35+ struct list_head links; /* interface->bundles */
36+};
37+#define to_gb_bundle(d) container_of(d, struct gb_bundle, dev)
38+
39+/* Greybus "private" definitions" */
40+struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id,
41+ u8 class);
42+int gb_bundle_add(struct gb_bundle *bundle);
43+void gb_bundle_destroy(struct gb_bundle *bundle);
44+
45+/* Bundle Runtime PM wrappers */
46+#ifdef CONFIG_PM
47+static inline int gb_pm_runtime_get_sync(struct gb_bundle *bundle)
48+{
49+ int retval;
50+
51+ retval = pm_runtime_get_sync(&bundle->dev);
52+ if (retval < 0) {
53+ dev_err(&bundle->dev,
54+ "pm_runtime_get_sync failed: %d\n", retval);
55+ pm_runtime_put_noidle(&bundle->dev);
56+ return retval;
57+ }
58+
59+ return 0;
60+}
61+
62+static inline int gb_pm_runtime_put_autosuspend(struct gb_bundle *bundle)
63+{
64+ int retval;
65+
66+ pm_runtime_mark_last_busy(&bundle->dev);
67+ retval = pm_runtime_put_autosuspend(&bundle->dev);
68+
69+ return retval;
70+}
71+
72+static inline void gb_pm_runtime_get_noresume(struct gb_bundle *bundle)
73+{
74+ pm_runtime_get_noresume(&bundle->dev);
75+}
76+
77+static inline void gb_pm_runtime_put_noidle(struct gb_bundle *bundle)
78+{
79+ pm_runtime_put_noidle(&bundle->dev);
80+}
81+
82+#else
83+static inline int gb_pm_runtime_get_sync(struct gb_bundle *bundle)
84+{ return 0; }
85+static inline int gb_pm_runtime_put_autosuspend(struct gb_bundle *bundle)
86+{ return 0; }
87+
88+static inline void gb_pm_runtime_get_noresume(struct gb_bundle *bundle) {}
89+static inline void gb_pm_runtime_put_noidle(struct gb_bundle *bundle) {}
90+#endif
91+
92+#endif /* __BUNDLE_H */
include/linux/greybus/connection.h+131−0
@@ -0,0 +1,131 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Greybus connections
4+ *
5+ * Copyright 2014 Google Inc.
6+ * Copyright 2014 Linaro Ltd.
7+ */
8+
9+#ifndef __CONNECTION_H
10+#define __CONNECTION_H
11+
12+#include <linux/bits.h>
13+#include <linux/list.h>
14+#include <linux/kfifo.h>
15+#include <linux/kref.h>
16+#include <linux/workqueue.h>
17+
18+#define GB_CONNECTION_FLAG_CSD BIT(0)
19+#define GB_CONNECTION_FLAG_NO_FLOWCTRL BIT(1)
20+#define GB_CONNECTION_FLAG_OFFLOADED BIT(2)
21+#define GB_CONNECTION_FLAG_CDSI1 BIT(3)
22+#define GB_CONNECTION_FLAG_CONTROL BIT(4)
23+#define GB_CONNECTION_FLAG_HIGH_PRIO BIT(5)
24+
25+#define GB_CONNECTION_FLAG_CORE_MASK GB_CONNECTION_FLAG_CONTROL
26+
27+enum gb_connection_state {
28+ GB_CONNECTION_STATE_DISABLED = 0,
29+ GB_CONNECTION_STATE_ENABLED_TX = 1,
30+ GB_CONNECTION_STATE_ENABLED = 2,
31+ GB_CONNECTION_STATE_DISCONNECTING = 3,
32+};
33+
34+struct gb_operation;
35+
36+typedef int (*gb_request_handler_t)(struct gb_operation *);
37+
38+struct gb_connection {
39+ struct gb_host_device *hd;
40+ struct gb_interface *intf;
41+ struct gb_bundle *bundle;
42+ struct kref kref;
43+ u16 hd_cport_id;
44+ u16 intf_cport_id;
45+
46+ struct list_head hd_links;
47+ struct list_head bundle_links;
48+
49+ gb_request_handler_t handler;
50+ unsigned long flags;
51+
52+ struct mutex mutex;
53+ spinlock_t lock;
54+ enum gb_connection_state state;
55+ struct list_head operations;
56+
57+ char name[16];
58+ struct workqueue_struct *wq;
59+
60+ atomic_t op_cycle;
61+
62+ void *private;
63+
64+ bool mode_switch;
65+};
66+
67+struct gb_connection *gb_connection_create_static(struct gb_host_device *hd,
68+ u16 hd_cport_id, gb_request_handler_t handler);
69+struct gb_connection *gb_connection_create_control(struct gb_interface *intf);
70+struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
71+ u16 cport_id, gb_request_handler_t handler);
72+struct gb_connection *gb_connection_create_flags(struct gb_bundle *bundle,
73+ u16 cport_id, gb_request_handler_t handler,
74+ unsigned long flags);
75+struct gb_connection *gb_connection_create_offloaded(struct gb_bundle *bundle,
76+ u16 cport_id, unsigned long flags);
77+void gb_connection_destroy(struct gb_connection *connection);
78+
79+static inline bool gb_connection_is_static(struct gb_connection *connection)
80+{
81+ return !connection->intf;
82+}
83+
84+int gb_connection_enable(struct gb_connection *connection);
85+int gb_connection_enable_tx(struct gb_connection *connection);
86+void gb_connection_disable_rx(struct gb_connection *connection);
87+void gb_connection_disable(struct gb_connection *connection);
88+void gb_connection_disable_forced(struct gb_connection *connection);
89+
90+void gb_connection_mode_switch_prepare(struct gb_connection *connection);
91+void gb_connection_mode_switch_complete(struct gb_connection *connection);
92+
93+void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id,
94+ u8 *data, size_t length);
95+
96+void gb_connection_latency_tag_enable(struct gb_connection *connection);
97+void gb_connection_latency_tag_disable(struct gb_connection *connection);
98+
99+static inline bool gb_connection_e2efc_enabled(struct gb_connection *connection)
100+{
101+ return !(connection->flags & GB_CONNECTION_FLAG_CSD);
102+}
103+
104+static inline bool
105+gb_connection_flow_control_disabled(struct gb_connection *connection)
106+{
107+ return connection->flags & GB_CONNECTION_FLAG_NO_FLOWCTRL;
108+}
109+
110+static inline bool gb_connection_is_offloaded(struct gb_connection *connection)
111+{
112+ return connection->flags & GB_CONNECTION_FLAG_OFFLOADED;
113+}
114+
115+static inline bool gb_connection_is_control(struct gb_connection *connection)
116+{
117+ return connection->flags & GB_CONNECTION_FLAG_CONTROL;
118+}
119+
120+static inline void *gb_connection_get_data(struct gb_connection *connection)
121+{
122+ return connection->private;
123+}
124+
125+static inline void gb_connection_set_data(struct gb_connection *connection,
126+ void *data)
127+{
128+ connection->private = data;
129+}
130+
131+#endif /* __CONNECTION_H */
include/linux/greybus/control.h+60−0
@@ -0,0 +1,60 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Greybus CPort control protocol
4+ *
5+ * Copyright 2015 Google Inc.
6+ * Copyright 2015 Linaro Ltd.
7+ */
8+
9+#ifndef __CONTROL_H
10+#define __CONTROL_H
11+
12+#include <linux/types.h>
13+#include <linux/device.h>
14+
15+struct gb_control {
16+ struct device dev;
17+ struct gb_interface *intf;
18+
19+ struct gb_connection *connection;
20+
21+ u8 protocol_major;
22+ u8 protocol_minor;
23+
24+ bool has_bundle_activate;
25+ bool has_bundle_version;
26+
27+ char *vendor_string;
28+ char *product_string;
29+};
30+#define to_gb_control(d) container_of(d, struct gb_control, dev)
31+
32+struct gb_control *gb_control_create(struct gb_interface *intf);
33+int gb_control_enable(struct gb_control *control);
34+void gb_control_disable(struct gb_control *control);
35+int gb_control_suspend(struct gb_control *control);
36+int gb_control_resume(struct gb_control *control);
37+int gb_control_add(struct gb_control *control);
38+void gb_control_del(struct gb_control *control);
39+struct gb_control *gb_control_get(struct gb_control *control);
40+void gb_control_put(struct gb_control *control);
41+
42+int gb_control_get_bundle_versions(struct gb_control *control);
43+int gb_control_connected_operation(struct gb_control *control, u16 cport_id);
44+int gb_control_disconnected_operation(struct gb_control *control, u16 cport_id);
45+int gb_control_disconnecting_operation(struct gb_control *control,
46+ u16 cport_id);
47+int gb_control_mode_switch_operation(struct gb_control *control);
48+void gb_control_mode_switch_prepare(struct gb_control *control);
49+void gb_control_mode_switch_complete(struct gb_control *control);
50+int gb_control_get_manifest_size_operation(struct gb_interface *intf);
51+int gb_control_get_manifest_operation(struct gb_interface *intf, void *manifest,
52+ size_t size);
53+int gb_control_bundle_suspend(struct gb_control *control, u8 bundle_id);
54+int gb_control_bundle_resume(struct gb_control *control, u8 bundle_id);
55+int gb_control_bundle_deactivate(struct gb_control *control, u8 bundle_id);
56+int gb_control_bundle_activate(struct gb_control *control, u8 bundle_id);
57+int gb_control_interface_suspend_prepare(struct gb_control *control);
58+int gb_control_interface_deactivate_prepare(struct gb_control *control);
59+int gb_control_interface_hibernate_abort(struct gb_control *control);
60+#endif /* __CONTROL_H */
include/linux/greybus/greybus_id.h+27−0
@@ -0,0 +1,27 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/* FIXME
3+ * move this to include/linux/mod_devicetable.h when merging
4+ */
5+
6+#ifndef __LINUX_GREYBUS_ID_H
7+#define __LINUX_GREYBUS_ID_H
8+
9+#include <linux/types.h>
10+#include <linux/mod_devicetable.h>
11+
12+
13+struct greybus_bundle_id {
14+ __u16 match_flags;
15+ __u32 vendor;
16+ __u32 product;
17+ __u8 class;
18+
19+ kernel_ulong_t driver_info __aligned(sizeof(kernel_ulong_t));
20+};
21+
22+/* Used to match the greybus_bundle_id */
23+#define GREYBUS_ID_MATCH_VENDOR BIT(0)
24+#define GREYBUS_ID_MATCH_PRODUCT BIT(1)
25+#define GREYBUS_ID_MATCH_CLASS BIT(2)
26+
27+#endif /* __LINUX_GREYBUS_ID_H */
include/linux/greybus/greybus_manifest.h+181−0
@@ -0,0 +1,181 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Greybus manifest definition
4+ *
5+ * See "Greybus Application Protocol" document (version 0.1) for
6+ * details on these values and structures.
7+ *
8+ * Copyright 2014-2015 Google Inc.
9+ * Copyright 2014-2015 Linaro Ltd.
10+ *
11+ * Released under the GPLv2 and BSD licenses.
12+ */
13+
14+#ifndef __GREYBUS_MANIFEST_H
15+#define __GREYBUS_MANIFEST_H
16+
17+#include <linux/bits.h>
18+#include <linux/types.h>
19+
20+enum greybus_descriptor_type {
21+ GREYBUS_TYPE_INVALID = 0x00,
22+ GREYBUS_TYPE_INTERFACE = 0x01,
23+ GREYBUS_TYPE_STRING = 0x02,
24+ GREYBUS_TYPE_BUNDLE = 0x03,
25+ GREYBUS_TYPE_CPORT = 0x04,
26+};
27+
28+enum greybus_protocol {
29+ GREYBUS_PROTOCOL_CONTROL = 0x00,
30+ /* 0x01 is unused */
31+ GREYBUS_PROTOCOL_GPIO = 0x02,
32+ GREYBUS_PROTOCOL_I2C = 0x03,
33+ GREYBUS_PROTOCOL_UART = 0x04,
34+ GREYBUS_PROTOCOL_HID = 0x05,
35+ GREYBUS_PROTOCOL_USB = 0x06,
36+ GREYBUS_PROTOCOL_SDIO = 0x07,
37+ GREYBUS_PROTOCOL_POWER_SUPPLY = 0x08,
38+ GREYBUS_PROTOCOL_PWM = 0x09,
39+ /* 0x0a is unused */
40+ GREYBUS_PROTOCOL_SPI = 0x0b,
41+ GREYBUS_PROTOCOL_DISPLAY = 0x0c,
42+ GREYBUS_PROTOCOL_CAMERA_MGMT = 0x0d,
43+ GREYBUS_PROTOCOL_SENSOR = 0x0e,
44+ GREYBUS_PROTOCOL_LIGHTS = 0x0f,
45+ GREYBUS_PROTOCOL_VIBRATOR = 0x10,
46+ GREYBUS_PROTOCOL_LOOPBACK = 0x11,
47+ GREYBUS_PROTOCOL_AUDIO_MGMT = 0x12,
48+ GREYBUS_PROTOCOL_AUDIO_DATA = 0x13,
49+ GREYBUS_PROTOCOL_SVC = 0x14,
50+ GREYBUS_PROTOCOL_BOOTROM = 0x15,
51+ GREYBUS_PROTOCOL_CAMERA_DATA = 0x16,
52+ GREYBUS_PROTOCOL_FW_DOWNLOAD = 0x17,
53+ GREYBUS_PROTOCOL_FW_MANAGEMENT = 0x18,
54+ GREYBUS_PROTOCOL_AUTHENTICATION = 0x19,
55+ GREYBUS_PROTOCOL_LOG = 0x1a,
56+ /* ... */
57+ GREYBUS_PROTOCOL_RAW = 0xfe,
58+ GREYBUS_PROTOCOL_VENDOR = 0xff,
59+};
60+
61+enum greybus_class_type {
62+ GREYBUS_CLASS_CONTROL = 0x00,
63+ /* 0x01 is unused */
64+ /* 0x02 is unused */
65+ /* 0x03 is unused */
66+ /* 0x04 is unused */
67+ GREYBUS_CLASS_HID = 0x05,
68+ /* 0x06 is unused */
69+ /* 0x07 is unused */
70+ GREYBUS_CLASS_POWER_SUPPLY = 0x08,
71+ /* 0x09 is unused */
72+ GREYBUS_CLASS_BRIDGED_PHY = 0x0a,
73+ /* 0x0b is unused */
74+ GREYBUS_CLASS_DISPLAY = 0x0c,
75+ GREYBUS_CLASS_CAMERA = 0x0d,
76+ GREYBUS_CLASS_SENSOR = 0x0e,
77+ GREYBUS_CLASS_LIGHTS = 0x0f,
78+ GREYBUS_CLASS_VIBRATOR = 0x10,
79+ GREYBUS_CLASS_LOOPBACK = 0x11,
80+ GREYBUS_CLASS_AUDIO = 0x12,
81+ /* 0x13 is unused */
82+ /* 0x14 is unused */
83+ GREYBUS_CLASS_BOOTROM = 0x15,
84+ GREYBUS_CLASS_FW_MANAGEMENT = 0x16,
85+ GREYBUS_CLASS_LOG = 0x17,
86+ /* ... */
87+ GREYBUS_CLASS_RAW = 0xfe,
88+ GREYBUS_CLASS_VENDOR = 0xff,
89+};
90+
91+enum {
92+ GREYBUS_INTERFACE_FEATURE_TIMESYNC = BIT(0),
93+};
94+
95+/*
96+ * The string in a string descriptor is not NUL-terminated. The
97+ * size of the descriptor will be rounded up to a multiple of 4
98+ * bytes, by padding the string with 0x00 bytes if necessary.
99+ */
100+struct greybus_descriptor_string {
101+ __u8 length;
102+ __u8 id;
103+ __u8 string[0];
104+} __packed;
105+
106+/*
107+ * An interface descriptor describes information about an interface as a whole,
108+ * *not* the functions within it.
109+ */
110+struct greybus_descriptor_interface {
111+ __u8 vendor_stringid;
112+ __u8 product_stringid;
113+ __u8 features;
114+ __u8 pad;
115+} __packed;
116+
117+/*
118+ * An bundle descriptor defines an identification number and a class for
119+ * each bundle.
120+ *
121+ * @id: Uniquely identifies a bundle within a interface, its sole purpose is to
122+ * allow CPort descriptors to specify which bundle they are associated with.
123+ * The first bundle will have id 0, second will have 1 and so on.
124+ *
125+ * The largest CPort id associated with an bundle (defined by a
126+ * CPort descriptor in the manifest) is used to determine how to
127+ * encode the device id and module number in UniPro packets
128+ * that use the bundle.
129+ *
130+ * @class: It is used by kernel to know the functionality provided by the
131+ * bundle and will be matched against drivers functinality while probing greybus
132+ * driver. It should contain one of the values defined in
133+ * 'enum greybus_class_type'.
134+ *
135+ */
136+struct greybus_descriptor_bundle {
137+ __u8 id; /* interface-relative id (0..) */
138+ __u8 class;
139+ __u8 pad[2];
140+} __packed;
141+
142+/*
143+ * A CPort descriptor indicates the id of the bundle within the
144+ * module it's associated with, along with the CPort id used to
145+ * address the CPort. The protocol id defines the format of messages
146+ * exchanged using the CPort.
147+ */
148+struct greybus_descriptor_cport {
149+ __le16 id;
150+ __u8 bundle;
151+ __u8 protocol_id; /* enum greybus_protocol */
152+} __packed;
153+
154+struct greybus_descriptor_header {
155+ __le16 size;
156+ __u8 type; /* enum greybus_descriptor_type */
157+ __u8 pad;
158+} __packed;
159+
160+struct greybus_descriptor {
161+ struct greybus_descriptor_header header;
162+ union {
163+ struct greybus_descriptor_string string;
164+ struct greybus_descriptor_interface interface;
165+ struct greybus_descriptor_bundle bundle;
166+ struct greybus_descriptor_cport cport;
167+ };
168+} __packed;
169+
170+struct greybus_manifest_header {
171+ __le16 size;
172+ __u8 version_major;
173+ __u8 version_minor;
174+} __packed;
175+
176+struct greybus_manifest {
177+ struct greybus_manifest_header header;
178+ struct greybus_descriptor descriptors[0];
179+} __packed;
180+
181+#endif /* __GREYBUS_MANIFEST_H */
include/linux/greybus/greybus_protocols.h+2178−0
@@ -0,0 +1,2178 @@
1+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
2+/*
3+ * Copyright(c) 2014 - 2015 Google Inc. All rights reserved.
4+ * Copyright(c) 2014 - 2015 Linaro Ltd. All rights reserved.
5+ */
6+
7+#ifndef __GREYBUS_PROTOCOLS_H
8+#define __GREYBUS_PROTOCOLS_H
9+
10+#include <linux/types.h>
11+
12+/* Fixed IDs for control/svc protocols */
13+
14+/* SVC switch-port device ids */
15+#define GB_SVC_DEVICE_ID_SVC 0
16+#define GB_SVC_DEVICE_ID_AP 1
17+#define GB_SVC_DEVICE_ID_MIN 2
18+#define GB_SVC_DEVICE_ID_MAX 31
19+
20+#define GB_SVC_CPORT_ID 0
21+#define GB_CONTROL_BUNDLE_ID 0
22+#define GB_CONTROL_CPORT_ID 0
23+
24+
25+/*
26+ * All operation messages (both requests and responses) begin with
27+ * a header that encodes the size of the message (header included).
28+ * This header also contains a unique identifier, that associates a
29+ * response message with its operation. The header contains an
30+ * operation type field, whose interpretation is dependent on what
31+ * type of protocol is used over the connection. The high bit
32+ * (0x80) of the operation type field is used to indicate whether
33+ * the message is a request (clear) or a response (set).
34+ *
35+ * Response messages include an additional result byte, which
36+ * communicates the result of the corresponding request. A zero
37+ * result value means the operation completed successfully. Any
38+ * other value indicates an error; in this case, the payload of the
39+ * response message (if any) is ignored. The result byte must be
40+ * zero in the header for a request message.
41+ *
42+ * The wire format for all numeric fields in the header is little
43+ * endian. Any operation-specific data begins immediately after the
44+ * header.
45+ */
46+struct gb_operation_msg_hdr {
47+ __le16 size; /* Size in bytes of header + payload */
48+ __le16 operation_id; /* Operation unique id */
49+ __u8 type; /* E.g GB_I2C_TYPE_* or GB_GPIO_TYPE_* */
50+ __u8 result; /* Result of request (in responses only) */
51+ __u8 pad[2]; /* must be zero (ignore when read) */
52+} __packed;
53+
54+
55+/* Generic request types */
56+#define GB_REQUEST_TYPE_CPORT_SHUTDOWN 0x00
57+#define GB_REQUEST_TYPE_INVALID 0x7f
58+
59+struct gb_cport_shutdown_request {
60+ __u8 phase;
61+} __packed;
62+
63+
64+/* Control Protocol */
65+
66+/* Greybus control request types */
67+#define GB_CONTROL_TYPE_VERSION 0x01
68+#define GB_CONTROL_TYPE_PROBE_AP 0x02
69+#define GB_CONTROL_TYPE_GET_MANIFEST_SIZE 0x03
70+#define GB_CONTROL_TYPE_GET_MANIFEST 0x04
71+#define GB_CONTROL_TYPE_CONNECTED 0x05
72+#define GB_CONTROL_TYPE_DISCONNECTED 0x06
73+#define GB_CONTROL_TYPE_TIMESYNC_ENABLE 0x07
74+#define GB_CONTROL_TYPE_TIMESYNC_DISABLE 0x08
75+#define GB_CONTROL_TYPE_TIMESYNC_AUTHORITATIVE 0x09
76+/* Unused 0x0a */
77+#define GB_CONTROL_TYPE_BUNDLE_VERSION 0x0b
78+#define GB_CONTROL_TYPE_DISCONNECTING 0x0c
79+#define GB_CONTROL_TYPE_TIMESYNC_GET_LAST_EVENT 0x0d
80+#define GB_CONTROL_TYPE_MODE_SWITCH 0x0e
81+#define GB_CONTROL_TYPE_BUNDLE_SUSPEND 0x0f
82+#define GB_CONTROL_TYPE_BUNDLE_RESUME 0x10
83+#define GB_CONTROL_TYPE_BUNDLE_DEACTIVATE 0x11
84+#define GB_CONTROL_TYPE_BUNDLE_ACTIVATE 0x12
85+#define GB_CONTROL_TYPE_INTF_SUSPEND_PREPARE 0x13
86+#define GB_CONTROL_TYPE_INTF_DEACTIVATE_PREPARE 0x14
87+#define GB_CONTROL_TYPE_INTF_HIBERNATE_ABORT 0x15
88+
89+struct gb_control_version_request {
90+ __u8 major;
91+ __u8 minor;
92+} __packed;
93+
94+struct gb_control_version_response {
95+ __u8 major;
96+ __u8 minor;
97+} __packed;
98+
99+struct gb_control_bundle_version_request {
100+ __u8 bundle_id;
101+} __packed;
102+
103+struct gb_control_bundle_version_response {
104+ __u8 major;
105+ __u8 minor;
106+} __packed;
107+
108+/* Control protocol manifest get size request has no payload*/
109+struct gb_control_get_manifest_size_response {
110+ __le16 size;
111+} __packed;
112+
113+/* Control protocol manifest get request has no payload */
114+struct gb_control_get_manifest_response {
115+ __u8 data[0];
116+} __packed;
117+
118+/* Control protocol [dis]connected request */
119+struct gb_control_connected_request {
120+ __le16 cport_id;
121+} __packed;
122+
123+struct gb_control_disconnecting_request {
124+ __le16 cport_id;
125+} __packed;
126+/* disconnecting response has no payload */
127+
128+struct gb_control_disconnected_request {
129+ __le16 cport_id;
130+} __packed;
131+/* Control protocol [dis]connected response has no payload */
132+
133+/*
134+ * All Bundle power management operations use the same request and response
135+ * layout and status codes.
136+ */
137+
138+#define GB_CONTROL_BUNDLE_PM_OK 0x00
139+#define GB_CONTROL_BUNDLE_PM_INVAL 0x01
140+#define GB_CONTROL_BUNDLE_PM_BUSY 0x02
141+#define GB_CONTROL_BUNDLE_PM_FAIL 0x03
142+#define GB_CONTROL_BUNDLE_PM_NA 0x04
143+
144+struct gb_control_bundle_pm_request {
145+ __u8 bundle_id;
146+} __packed;
147+
148+struct gb_control_bundle_pm_response {
149+ __u8 status;
150+} __packed;
151+
152+/*
153+ * Interface Suspend Prepare and Deactivate Prepare operations use the same
154+ * response layout and error codes. Define a single response structure and reuse
155+ * it. Both operations have no payload.
156+ */
157+
158+#define GB_CONTROL_INTF_PM_OK 0x00
159+#define GB_CONTROL_INTF_PM_BUSY 0x01
160+#define GB_CONTROL_INTF_PM_NA 0x02
161+
162+struct gb_control_intf_pm_response {
163+ __u8 status;
164+} __packed;
165+
166+/* APBridge protocol */
167+
168+/* request APB1 log */
169+#define GB_APB_REQUEST_LOG 0x02
170+
171+/* request to map a cport to bulk in and bulk out endpoints */
172+#define GB_APB_REQUEST_EP_MAPPING 0x03
173+
174+/* request to get the number of cports available */
175+#define GB_APB_REQUEST_CPORT_COUNT 0x04
176+
177+/* request to reset a cport state */
178+#define GB_APB_REQUEST_RESET_CPORT 0x05
179+
180+/* request to time the latency of messages on a given cport */
181+#define GB_APB_REQUEST_LATENCY_TAG_EN 0x06
182+#define GB_APB_REQUEST_LATENCY_TAG_DIS 0x07
183+
184+/* request to control the CSI transmitter */
185+#define GB_APB_REQUEST_CSI_TX_CONTROL 0x08
186+
187+/* request to control audio streaming */
188+#define GB_APB_REQUEST_AUDIO_CONTROL 0x09
189+
190+/* TimeSync requests */
191+#define GB_APB_REQUEST_TIMESYNC_ENABLE 0x0d
192+#define GB_APB_REQUEST_TIMESYNC_DISABLE 0x0e
193+#define GB_APB_REQUEST_TIMESYNC_AUTHORITATIVE 0x0f
194+#define GB_APB_REQUEST_TIMESYNC_GET_LAST_EVENT 0x10
195+
196+/* requests to set Greybus CPort flags */
197+#define GB_APB_REQUEST_CPORT_FLAGS 0x11
198+
199+/* ARPC request */
200+#define GB_APB_REQUEST_ARPC_RUN 0x12
201+
202+struct gb_apb_request_cport_flags {
203+ __le32 flags;
204+#define GB_APB_CPORT_FLAG_CONTROL 0x01
205+#define GB_APB_CPORT_FLAG_HIGH_PRIO 0x02
206+} __packed;
207+
208+
209+/* Firmware Download Protocol */
210+
211+/* Request Types */
212+#define GB_FW_DOWNLOAD_TYPE_FIND_FIRMWARE 0x01
213+#define GB_FW_DOWNLOAD_TYPE_FETCH_FIRMWARE 0x02
214+#define GB_FW_DOWNLOAD_TYPE_RELEASE_FIRMWARE 0x03
215+
216+#define GB_FIRMWARE_TAG_MAX_SIZE 10
217+
218+/* firmware download find firmware request/response */
219+struct gb_fw_download_find_firmware_request {
220+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
221+} __packed;
222+
223+struct gb_fw_download_find_firmware_response {
224+ __u8 firmware_id;
225+ __le32 size;
226+} __packed;
227+
228+/* firmware download fetch firmware request/response */
229+struct gb_fw_download_fetch_firmware_request {
230+ __u8 firmware_id;
231+ __le32 offset;
232+ __le32 size;
233+} __packed;
234+
235+struct gb_fw_download_fetch_firmware_response {
236+ __u8 data[0];
237+} __packed;
238+
239+/* firmware download release firmware request */
240+struct gb_fw_download_release_firmware_request {
241+ __u8 firmware_id;
242+} __packed;
243+/* firmware download release firmware response has no payload */
244+
245+
246+/* Firmware Management Protocol */
247+
248+/* Request Types */
249+#define GB_FW_MGMT_TYPE_INTERFACE_FW_VERSION 0x01
250+#define GB_FW_MGMT_TYPE_LOAD_AND_VALIDATE_FW 0x02
251+#define GB_FW_MGMT_TYPE_LOADED_FW 0x03
252+#define GB_FW_MGMT_TYPE_BACKEND_FW_VERSION 0x04
253+#define GB_FW_MGMT_TYPE_BACKEND_FW_UPDATE 0x05
254+#define GB_FW_MGMT_TYPE_BACKEND_FW_UPDATED 0x06
255+
256+#define GB_FW_LOAD_METHOD_UNIPRO 0x01
257+#define GB_FW_LOAD_METHOD_INTERNAL 0x02
258+
259+#define GB_FW_LOAD_STATUS_FAILED 0x00
260+#define GB_FW_LOAD_STATUS_UNVALIDATED 0x01
261+#define GB_FW_LOAD_STATUS_VALIDATED 0x02
262+#define GB_FW_LOAD_STATUS_VALIDATION_FAILED 0x03
263+
264+#define GB_FW_BACKEND_FW_STATUS_SUCCESS 0x01
265+#define GB_FW_BACKEND_FW_STATUS_FAIL_FIND 0x02
266+#define GB_FW_BACKEND_FW_STATUS_FAIL_FETCH 0x03
267+#define GB_FW_BACKEND_FW_STATUS_FAIL_WRITE 0x04
268+#define GB_FW_BACKEND_FW_STATUS_INT 0x05
269+#define GB_FW_BACKEND_FW_STATUS_RETRY 0x06
270+#define GB_FW_BACKEND_FW_STATUS_NOT_SUPPORTED 0x07
271+
272+#define GB_FW_BACKEND_VERSION_STATUS_SUCCESS 0x01
273+#define GB_FW_BACKEND_VERSION_STATUS_NOT_AVAILABLE 0x02
274+#define GB_FW_BACKEND_VERSION_STATUS_NOT_SUPPORTED 0x03
275+#define GB_FW_BACKEND_VERSION_STATUS_RETRY 0x04
276+#define GB_FW_BACKEND_VERSION_STATUS_FAIL_INT 0x05
277+
278+/* firmware management interface firmware version request has no payload */
279+struct gb_fw_mgmt_interface_fw_version_response {
280+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
281+ __le16 major;
282+ __le16 minor;
283+} __packed;
284+
285+/* firmware management load and validate firmware request/response */
286+struct gb_fw_mgmt_load_and_validate_fw_request {
287+ __u8 request_id;
288+ __u8 load_method;
289+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
290+} __packed;
291+/* firmware management load and validate firmware response has no payload*/
292+
293+/* firmware management loaded firmware request */
294+struct gb_fw_mgmt_loaded_fw_request {
295+ __u8 request_id;
296+ __u8 status;
297+ __le16 major;
298+ __le16 minor;
299+} __packed;
300+/* firmware management loaded firmware response has no payload */
301+
302+/* firmware management backend firmware version request/response */
303+struct gb_fw_mgmt_backend_fw_version_request {
304+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
305+} __packed;
306+
307+struct gb_fw_mgmt_backend_fw_version_response {
308+ __le16 major;
309+ __le16 minor;
310+ __u8 status;
311+} __packed;
312+
313+/* firmware management backend firmware update request */
314+struct gb_fw_mgmt_backend_fw_update_request {
315+ __u8 request_id;
316+ __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
317+} __packed;
318+/* firmware management backend firmware update response has no payload */
319+
320+/* firmware management backend firmware updated request */
321+struct gb_fw_mgmt_backend_fw_updated_request {
322+ __u8 request_id;
323+ __u8 status;
324+} __packed;
325+/* firmware management backend firmware updated response has no payload */
326+
327+
328+/* Component Authentication Protocol (CAP) */
329+
330+/* Request Types */
331+#define GB_CAP_TYPE_GET_ENDPOINT_UID 0x01
332+#define GB_CAP_TYPE_GET_IMS_CERTIFICATE 0x02
333+#define GB_CAP_TYPE_AUTHENTICATE 0x03
334+
335+/* CAP get endpoint uid request has no payload */
336+struct gb_cap_get_endpoint_uid_response {
337+ __u8 uid[8];
338+} __packed;
339+
340+/* CAP get endpoint ims certificate request/response */
341+struct gb_cap_get_ims_certificate_request {
342+ __le32 certificate_class;
343+ __le32 certificate_id;
344+} __packed;
345+
346+struct gb_cap_get_ims_certificate_response {
347+ __u8 result_code;
348+ __u8 certificate[0];
349+} __packed;
350+
351+/* CAP authenticate request/response */
352+struct gb_cap_authenticate_request {
353+ __le32 auth_type;
354+ __u8 uid[8];
355+ __u8 challenge[32];
356+} __packed;
357+
358+struct gb_cap_authenticate_response {
359+ __u8 result_code;
360+ __u8 response[64];
361+ __u8 signature[0];
362+} __packed;
363+
364+
365+/* Bootrom Protocol */
366+
367+/* Version of the Greybus bootrom protocol we support */
368+#define GB_BOOTROM_VERSION_MAJOR 0x00
369+#define GB_BOOTROM_VERSION_MINOR 0x01
370+
371+/* Greybus bootrom request types */
372+#define GB_BOOTROM_TYPE_VERSION 0x01
373+#define GB_BOOTROM_TYPE_FIRMWARE_SIZE 0x02
374+#define GB_BOOTROM_TYPE_GET_FIRMWARE 0x03
375+#define GB_BOOTROM_TYPE_READY_TO_BOOT 0x04
376+#define GB_BOOTROM_TYPE_AP_READY 0x05 /* Request with no-payload */
377+#define GB_BOOTROM_TYPE_GET_VID_PID 0x06 /* Request with no-payload */
378+
379+/* Greybus bootrom boot stages */
380+#define GB_BOOTROM_BOOT_STAGE_ONE 0x01 /* Reserved for the boot ROM */
381+#define GB_BOOTROM_BOOT_STAGE_TWO 0x02 /* Bootrom package to be loaded by the boot ROM */
382+#define GB_BOOTROM_BOOT_STAGE_THREE 0x03 /* Module personality package loaded by Stage 2 firmware */
383+
384+/* Greybus bootrom ready to boot status */
385+#define GB_BOOTROM_BOOT_STATUS_INVALID 0x00 /* Firmware blob could not be validated */
386+#define GB_BOOTROM_BOOT_STATUS_INSECURE 0x01 /* Firmware blob is valid but insecure */
387+#define GB_BOOTROM_BOOT_STATUS_SECURE 0x02 /* Firmware blob is valid and secure */
388+
389+/* Max bootrom data fetch size in bytes */
390+#define GB_BOOTROM_FETCH_MAX 2000
391+
392+struct gb_bootrom_version_request {
393+ __u8 major;
394+ __u8 minor;
395+} __packed;
396+
397+struct gb_bootrom_version_response {
398+ __u8 major;
399+ __u8 minor;
400+} __packed;
401+
402+/* Bootrom protocol firmware size request/response */
403+struct gb_bootrom_firmware_size_request {
404+ __u8 stage;
405+} __packed;
406+
407+struct gb_bootrom_firmware_size_response {
408+ __le32 size;
409+} __packed;
410+
411+/* Bootrom protocol get firmware request/response */
412+struct gb_bootrom_get_firmware_request {
413+ __le32 offset;
414+ __le32 size;
415+} __packed;
416+
417+struct gb_bootrom_get_firmware_response {
418+ __u8 data[0];
419+} __packed;
420+
421+/* Bootrom protocol Ready to boot request */
422+struct gb_bootrom_ready_to_boot_request {
423+ __u8 status;
424+} __packed;
425+/* Bootrom protocol Ready to boot response has no payload */
426+
427+/* Bootrom protocol get VID/PID request has no payload */
428+struct gb_bootrom_get_vid_pid_response {
429+ __le32 vendor_id;
430+ __le32 product_id;
431+} __packed;
432+
433+
434+/* Power Supply */
435+
436+/* Greybus power supply request types */
437+#define GB_POWER_SUPPLY_TYPE_GET_SUPPLIES 0x02
438+#define GB_POWER_SUPPLY_TYPE_GET_DESCRIPTION 0x03
439+#define GB_POWER_SUPPLY_TYPE_GET_PROP_DESCRIPTORS 0x04
440+#define GB_POWER_SUPPLY_TYPE_GET_PROPERTY 0x05
441+#define GB_POWER_SUPPLY_TYPE_SET_PROPERTY 0x06
442+#define GB_POWER_SUPPLY_TYPE_EVENT 0x07
443+
444+/* Greybus power supply battery technologies types */
445+#define GB_POWER_SUPPLY_TECH_UNKNOWN 0x0000
446+#define GB_POWER_SUPPLY_TECH_NiMH 0x0001
447+#define GB_POWER_SUPPLY_TECH_LION 0x0002
448+#define GB_POWER_SUPPLY_TECH_LIPO 0x0003
449+#define GB_POWER_SUPPLY_TECH_LiFe 0x0004
450+#define GB_POWER_SUPPLY_TECH_NiCd 0x0005
451+#define GB_POWER_SUPPLY_TECH_LiMn 0x0006
452+
453+/* Greybus power supply types */
454+#define GB_POWER_SUPPLY_UNKNOWN_TYPE 0x0000
455+#define GB_POWER_SUPPLY_BATTERY_TYPE 0x0001
456+#define GB_POWER_SUPPLY_UPS_TYPE 0x0002
457+#define GB_POWER_SUPPLY_MAINS_TYPE 0x0003
458+#define GB_POWER_SUPPLY_USB_TYPE 0x0004
459+#define GB_POWER_SUPPLY_USB_DCP_TYPE 0x0005
460+#define GB_POWER_SUPPLY_USB_CDP_TYPE 0x0006
461+#define GB_POWER_SUPPLY_USB_ACA_TYPE 0x0007
462+
463+/* Greybus power supply health values */
464+#define GB_POWER_SUPPLY_HEALTH_UNKNOWN 0x0000
465+#define GB_POWER_SUPPLY_HEALTH_GOOD 0x0001
466+#define GB_POWER_SUPPLY_HEALTH_OVERHEAT 0x0002
467+#define GB_POWER_SUPPLY_HEALTH_DEAD 0x0003
468+#define GB_POWER_SUPPLY_HEALTH_OVERVOLTAGE 0x0004
469+#define GB_POWER_SUPPLY_HEALTH_UNSPEC_FAILURE 0x0005
470+#define GB_POWER_SUPPLY_HEALTH_COLD 0x0006
471+#define GB_POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE 0x0007
472+#define GB_POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE 0x0008
473+
474+/* Greybus power supply status values */
475+#define GB_POWER_SUPPLY_STATUS_UNKNOWN 0x0000
476+#define GB_POWER_SUPPLY_STATUS_CHARGING 0x0001
477+#define GB_POWER_SUPPLY_STATUS_DISCHARGING 0x0002
478+#define GB_POWER_SUPPLY_STATUS_NOT_CHARGING 0x0003
479+#define GB_POWER_SUPPLY_STATUS_FULL 0x0004
480+
481+/* Greybus power supply capacity level values */
482+#define GB_POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN 0x0000
483+#define GB_POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL 0x0001
484+#define GB_POWER_SUPPLY_CAPACITY_LEVEL_LOW 0x0002
485+#define GB_POWER_SUPPLY_CAPACITY_LEVEL_NORMAL 0x0003
486+#define GB_POWER_SUPPLY_CAPACITY_LEVEL_HIGH 0x0004
487+#define GB_POWER_SUPPLY_CAPACITY_LEVEL_FULL 0x0005
488+
489+/* Greybus power supply scope values */
490+#define GB_POWER_SUPPLY_SCOPE_UNKNOWN 0x0000
491+#define GB_POWER_SUPPLY_SCOPE_SYSTEM 0x0001
492+#define GB_POWER_SUPPLY_SCOPE_DEVICE 0x0002
493+
494+struct gb_power_supply_get_supplies_response {
495+ __u8 supplies_count;
496+} __packed;
497+
498+struct gb_power_supply_get_description_request {
499+ __u8 psy_id;
500+} __packed;
501+
502+struct gb_power_supply_get_description_response {
503+ __u8 manufacturer[32];
504+ __u8 model[32];
505+ __u8 serial_number[32];
506+ __le16 type;
507+ __u8 properties_count;
508+} __packed;
509+
510+struct gb_power_supply_props_desc {
511+ __u8 property;
512+#define GB_POWER_SUPPLY_PROP_STATUS 0x00
513+#define GB_POWER_SUPPLY_PROP_CHARGE_TYPE 0x01
514+#define GB_POWER_SUPPLY_PROP_HEALTH 0x02
515+#define GB_POWER_SUPPLY_PROP_PRESENT 0x03
516+#define GB_POWER_SUPPLY_PROP_ONLINE 0x04
517+#define GB_POWER_SUPPLY_PROP_AUTHENTIC 0x05
518+#define GB_POWER_SUPPLY_PROP_TECHNOLOGY 0x06
519+#define GB_POWER_SUPPLY_PROP_CYCLE_COUNT 0x07
520+#define GB_POWER_SUPPLY_PROP_VOLTAGE_MAX 0x08
521+#define GB_POWER_SUPPLY_PROP_VOLTAGE_MIN 0x09
522+#define GB_POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN 0x0A
523+#define GB_POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN 0x0B
524+#define GB_POWER_SUPPLY_PROP_VOLTAGE_NOW 0x0C
525+#define GB_POWER_SUPPLY_PROP_VOLTAGE_AVG 0x0D
526+#define GB_POWER_SUPPLY_PROP_VOLTAGE_OCV 0x0E
527+#define GB_POWER_SUPPLY_PROP_VOLTAGE_BOOT 0x0F
528+#define GB_POWER_SUPPLY_PROP_CURRENT_MAX 0x10
529+#define GB_POWER_SUPPLY_PROP_CURRENT_NOW 0x11
530+#define GB_POWER_SUPPLY_PROP_CURRENT_AVG 0x12
531+#define GB_POWER_SUPPLY_PROP_CURRENT_BOOT 0x13
532+#define GB_POWER_SUPPLY_PROP_POWER_NOW 0x14
533+#define GB_POWER_SUPPLY_PROP_POWER_AVG 0x15
534+#define GB_POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN 0x16
535+#define GB_POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN 0x17
536+#define GB_POWER_SUPPLY_PROP_CHARGE_FULL 0x18
537+#define GB_POWER_SUPPLY_PROP_CHARGE_EMPTY 0x19
538+#define GB_POWER_SUPPLY_PROP_CHARGE_NOW 0x1A
539+#define GB_POWER_SUPPLY_PROP_CHARGE_AVG 0x1B
540+#define GB_POWER_SUPPLY_PROP_CHARGE_COUNTER 0x1C
541+#define GB_POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT 0x1D
542+#define GB_POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX 0x1E
543+#define GB_POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE 0x1F
544+#define GB_POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX 0x20
545+#define GB_POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT 0x21
546+#define GB_POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX 0x22
547+#define GB_POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT 0x23
548+#define GB_POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN 0x24
549+#define GB_POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN 0x25
550+#define GB_POWER_SUPPLY_PROP_ENERGY_FULL 0x26
551+#define GB_POWER_SUPPLY_PROP_ENERGY_EMPTY 0x27
552+#define GB_POWER_SUPPLY_PROP_ENERGY_NOW 0x28
553+#define GB_POWER_SUPPLY_PROP_ENERGY_AVG 0x29
554+#define GB_POWER_SUPPLY_PROP_CAPACITY 0x2A
555+#define GB_POWER_SUPPLY_PROP_CAPACITY_ALERT_MIN 0x2B
556+#define GB_POWER_SUPPLY_PROP_CAPACITY_ALERT_MAX 0x2C
557+#define GB_POWER_SUPPLY_PROP_CAPACITY_LEVEL 0x2D
558+#define GB_POWER_SUPPLY_PROP_TEMP 0x2E
559+#define GB_POWER_SUPPLY_PROP_TEMP_MAX 0x2F
560+#define GB_POWER_SUPPLY_PROP_TEMP_MIN 0x30
561+#define GB_POWER_SUPPLY_PROP_TEMP_ALERT_MIN 0x31
562+#define GB_POWER_SUPPLY_PROP_TEMP_ALERT_MAX 0x32
563+#define GB_POWER_SUPPLY_PROP_TEMP_AMBIENT 0x33
564+#define GB_POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MIN 0x34
565+#define GB_POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MAX 0x35
566+#define GB_POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW 0x36
567+#define GB_POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG 0x37
568+#define GB_POWER_SUPPLY_PROP_TIME_TO_FULL_NOW 0x38
569+#define GB_POWER_SUPPLY_PROP_TIME_TO_FULL_AVG 0x39
570+#define GB_POWER_SUPPLY_PROP_TYPE 0x3A
571+#define GB_POWER_SUPPLY_PROP_SCOPE 0x3B
572+#define GB_POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT 0x3C
573+#define GB_POWER_SUPPLY_PROP_CALIBRATE 0x3D
574+ __u8 is_writeable;
575+} __packed;
576+
577+struct gb_power_supply_get_property_descriptors_request {
578+ __u8 psy_id;
579+} __packed;
580+
581+struct gb_power_supply_get_property_descriptors_response {
582+ __u8 properties_count;
583+ struct gb_power_supply_props_desc props[];
584+} __packed;
585+
586+struct gb_power_supply_get_property_request {
587+ __u8 psy_id;
588+ __u8 property;
589+} __packed;
590+
591+struct gb_power_supply_get_property_response {
592+ __le32 prop_val;
593+};
594+
595+struct gb_power_supply_set_property_request {
596+ __u8 psy_id;
597+ __u8 property;
598+ __le32 prop_val;
599+} __packed;
600+
601+struct gb_power_supply_event_request {
602+ __u8 psy_id;
603+ __u8 event;
604+#define GB_POWER_SUPPLY_UPDATE 0x01
605+} __packed;
606+
607+
608+/* HID */
609+
610+/* Greybus HID operation types */
611+#define GB_HID_TYPE_GET_DESC 0x02
612+#define GB_HID_TYPE_GET_REPORT_DESC 0x03
613+#define GB_HID_TYPE_PWR_ON 0x04
614+#define GB_HID_TYPE_PWR_OFF 0x05
615+#define GB_HID_TYPE_GET_REPORT 0x06
616+#define GB_HID_TYPE_SET_REPORT 0x07
617+#define GB_HID_TYPE_IRQ_EVENT 0x08
618+
619+/* Report type */
620+#define GB_HID_INPUT_REPORT 0
621+#define GB_HID_OUTPUT_REPORT 1
622+#define GB_HID_FEATURE_REPORT 2
623+
624+/* Different request/response structures */
625+/* HID get descriptor response */
626+struct gb_hid_desc_response {
627+ __u8 bLength;
628+ __le16 wReportDescLength;
629+ __le16 bcdHID;
630+ __le16 wProductID;
631+ __le16 wVendorID;
632+ __u8 bCountryCode;
633+} __packed;
634+
635+/* HID get report request/response */
636+struct gb_hid_get_report_request {
637+ __u8 report_type;
638+ __u8 report_id;
639+} __packed;
640+
641+/* HID set report request */
642+struct gb_hid_set_report_request {
643+ __u8 report_type;
644+ __u8 report_id;
645+ __u8 report[0];
646+} __packed;
647+
648+/* HID input report request, via interrupt pipe */
649+struct gb_hid_input_report_request {
650+ __u8 report[0];
651+} __packed;
652+
653+
654+/* I2C */
655+
656+/* Greybus i2c request types */
657+#define GB_I2C_TYPE_FUNCTIONALITY 0x02
658+#define GB_I2C_TYPE_TRANSFER 0x05
659+
660+/* functionality request has no payload */
661+struct gb_i2c_functionality_response {
662+ __le32 functionality;
663+} __packed;
664+
665+/*
666+ * Outgoing data immediately follows the op count and ops array.
667+ * The data for each write (master -> slave) op in the array is sent
668+ * in order, with no (e.g. pad) bytes separating them.
669+ *
670+ * Short reads cause the entire transfer request to fail So response
671+ * payload consists only of bytes read, and the number of bytes is
672+ * exactly what was specified in the corresponding op. Like
673+ * outgoing data, the incoming data is in order and contiguous.
674+ */
675+struct gb_i2c_transfer_op {
676+ __le16 addr;
677+ __le16 flags;
678+ __le16 size;
679+} __packed;
680+
681+struct gb_i2c_transfer_request {
682+ __le16 op_count;
683+ struct gb_i2c_transfer_op ops[0]; /* op_count of these */
684+} __packed;
685+struct gb_i2c_transfer_response {
686+ __u8 data[0]; /* inbound data */
687+} __packed;
688+
689+
690+/* GPIO */
691+
692+/* Greybus GPIO request types */
693+#define GB_GPIO_TYPE_LINE_COUNT 0x02
694+#define GB_GPIO_TYPE_ACTIVATE 0x03
695+#define GB_GPIO_TYPE_DEACTIVATE 0x04
696+#define GB_GPIO_TYPE_GET_DIRECTION 0x05
697+#define GB_GPIO_TYPE_DIRECTION_IN 0x06
698+#define GB_GPIO_TYPE_DIRECTION_OUT 0x07
699+#define GB_GPIO_TYPE_GET_VALUE 0x08
700+#define GB_GPIO_TYPE_SET_VALUE 0x09
701+#define GB_GPIO_TYPE_SET_DEBOUNCE 0x0a
702+#define GB_GPIO_TYPE_IRQ_TYPE 0x0b
703+#define GB_GPIO_TYPE_IRQ_MASK 0x0c
704+#define GB_GPIO_TYPE_IRQ_UNMASK 0x0d
705+#define GB_GPIO_TYPE_IRQ_EVENT 0x0e
706+
707+#define GB_GPIO_IRQ_TYPE_NONE 0x00
708+#define GB_GPIO_IRQ_TYPE_EDGE_RISING 0x01
709+#define GB_GPIO_IRQ_TYPE_EDGE_FALLING 0x02
710+#define GB_GPIO_IRQ_TYPE_EDGE_BOTH 0x03
711+#define GB_GPIO_IRQ_TYPE_LEVEL_HIGH 0x04
712+#define GB_GPIO_IRQ_TYPE_LEVEL_LOW 0x08
713+
714+/* line count request has no payload */
715+struct gb_gpio_line_count_response {
716+ __u8 count;
717+} __packed;
718+
719+struct gb_gpio_activate_request {
720+ __u8 which;
721+} __packed;
722+/* activate response has no payload */
723+
724+struct gb_gpio_deactivate_request {
725+ __u8 which;
726+} __packed;
727+/* deactivate response has no payload */
728+
729+struct gb_gpio_get_direction_request {
730+ __u8 which;
731+} __packed;
732+struct gb_gpio_get_direction_response {
733+ __u8 direction;
734+} __packed;
735+
736+struct gb_gpio_direction_in_request {
737+ __u8 which;
738+} __packed;
739+/* direction in response has no payload */
740+
741+struct gb_gpio_direction_out_request {
742+ __u8 which;
743+ __u8 value;
744+} __packed;
745+/* direction out response has no payload */
746+
747+struct gb_gpio_get_value_request {
748+ __u8 which;
749+} __packed;
750+struct gb_gpio_get_value_response {
751+ __u8 value;
752+} __packed;
753+
754+struct gb_gpio_set_value_request {
755+ __u8 which;
756+ __u8 value;
757+} __packed;
758+/* set value response has no payload */
759+
760+struct gb_gpio_set_debounce_request {
761+ __u8 which;
762+ __le16 usec;
763+} __packed;
764+/* debounce response has no payload */
765+
766+struct gb_gpio_irq_type_request {
767+ __u8 which;
768+ __u8 type;
769+} __packed;
770+/* irq type response has no payload */
771+
772+struct gb_gpio_irq_mask_request {
773+ __u8 which;
774+} __packed;
775+/* irq mask response has no payload */
776+
777+struct gb_gpio_irq_unmask_request {
778+ __u8 which;
779+} __packed;
780+/* irq unmask response has no payload */
781+
782+/* irq event requests originate on another module and are handled on the AP */
783+struct gb_gpio_irq_event_request {
784+ __u8 which;
785+} __packed;
786+/* irq event has no response */
787+
788+
789+/* PWM */
790+
791+/* Greybus PWM operation types */
792+#define GB_PWM_TYPE_PWM_COUNT 0x02
793+#define GB_PWM_TYPE_ACTIVATE 0x03
794+#define GB_PWM_TYPE_DEACTIVATE 0x04
795+#define GB_PWM_TYPE_CONFIG 0x05
796+#define GB_PWM_TYPE_POLARITY 0x06
797+#define GB_PWM_TYPE_ENABLE 0x07
798+#define GB_PWM_TYPE_DISABLE 0x08
799+
800+/* pwm count request has no payload */
801+struct gb_pwm_count_response {
802+ __u8 count;
803+} __packed;
804+
805+struct gb_pwm_activate_request {
806+ __u8 which;
807+} __packed;
808+
809+struct gb_pwm_deactivate_request {
810+ __u8 which;
811+} __packed;
812+
813+struct gb_pwm_config_request {
814+ __u8 which;
815+ __le32 duty;
816+ __le32 period;
817+} __packed;
818+
819+struct gb_pwm_polarity_request {
820+ __u8 which;
821+ __u8 polarity;
822+} __packed;
823+
824+struct gb_pwm_enable_request {
825+ __u8 which;
826+} __packed;
827+
828+struct gb_pwm_disable_request {
829+ __u8 which;
830+} __packed;
831+
832+/* SPI */
833+
834+/* Should match up with modes in linux/spi/spi.h */
835+#define GB_SPI_MODE_CPHA 0x01 /* clock phase */
836+#define GB_SPI_MODE_CPOL 0x02 /* clock polarity */
837+#define GB_SPI_MODE_MODE_0 (0 | 0) /* (original MicroWire) */
838+#define GB_SPI_MODE_MODE_1 (0 | GB_SPI_MODE_CPHA)
839+#define GB_SPI_MODE_MODE_2 (GB_SPI_MODE_CPOL | 0)
840+#define GB_SPI_MODE_MODE_3 (GB_SPI_MODE_CPOL | GB_SPI_MODE_CPHA)
841+#define GB_SPI_MODE_CS_HIGH 0x04 /* chipselect active high? */
842+#define GB_SPI_MODE_LSB_FIRST 0x08 /* per-word bits-on-wire */
843+#define GB_SPI_MODE_3WIRE 0x10 /* SI/SO signals shared */
844+#define GB_SPI_MODE_LOOP 0x20 /* loopback mode */
845+#define GB_SPI_MODE_NO_CS 0x40 /* 1 dev/bus, no chipselect */
846+#define GB_SPI_MODE_READY 0x80 /* slave pulls low to pause */
847+
848+/* Should match up with flags in linux/spi/spi.h */
849+#define GB_SPI_FLAG_HALF_DUPLEX BIT(0) /* can't do full duplex */
850+#define GB_SPI_FLAG_NO_RX BIT(1) /* can't do buffer read */
851+#define GB_SPI_FLAG_NO_TX BIT(2) /* can't do buffer write */
852+
853+/* Greybus spi operation types */
854+#define GB_SPI_TYPE_MASTER_CONFIG 0x02
855+#define GB_SPI_TYPE_DEVICE_CONFIG 0x03
856+#define GB_SPI_TYPE_TRANSFER 0x04
857+
858+/* mode request has no payload */
859+struct gb_spi_master_config_response {
860+ __le32 bits_per_word_mask;
861+ __le32 min_speed_hz;
862+ __le32 max_speed_hz;
863+ __le16 mode;
864+ __le16 flags;
865+ __u8 num_chipselect;
866+} __packed;
867+
868+struct gb_spi_device_config_request {
869+ __u8 chip_select;
870+} __packed;
871+
872+struct gb_spi_device_config_response {
873+ __le16 mode;
874+ __u8 bits_per_word;
875+ __le32 max_speed_hz;
876+ __u8 device_type;
877+#define GB_SPI_SPI_DEV 0x00
878+#define GB_SPI_SPI_NOR 0x01
879+#define GB_SPI_SPI_MODALIAS 0x02
880+ __u8 name[32];
881+} __packed;
882+
883+/**
884+ * struct gb_spi_transfer - a read/write buffer pair
885+ * @speed_hz: Select a speed other than the device default for this transfer. If
886+ * 0 the default (from @spi_device) is used.
887+ * @len: size of rx and tx buffers (in bytes)
888+ * @delay_usecs: microseconds to delay after this transfer before (optionally)
889+ * changing the chipselect status, then starting the next transfer or
890+ * completing this spi_message.
891+ * @cs_change: affects chipselect after this transfer completes
892+ * @bits_per_word: select a bits_per_word other than the device default for this
893+ * transfer. If 0 the default (from @spi_device) is used.
894+ */
895+struct gb_spi_transfer {
896+ __le32 speed_hz;
897+ __le32 len;
898+ __le16 delay_usecs;
899+ __u8 cs_change;
900+ __u8 bits_per_word;
901+ __u8 xfer_flags;
902+#define GB_SPI_XFER_READ 0x01
903+#define GB_SPI_XFER_WRITE 0x02
904+#define GB_SPI_XFER_INPROGRESS 0x04
905+} __packed;
906+
907+struct gb_spi_transfer_request {
908+ __u8 chip_select; /* of the spi device */
909+ __u8 mode; /* of the spi device */
910+ __le16 count;
911+ struct gb_spi_transfer transfers[0]; /* count of these */
912+} __packed;
913+
914+struct gb_spi_transfer_response {
915+ __u8 data[0]; /* inbound data */
916+} __packed;
917+
918+/* Version of the Greybus SVC protocol we support */
919+#define GB_SVC_VERSION_MAJOR 0x00
920+#define GB_SVC_VERSION_MINOR 0x01
921+
922+/* Greybus SVC request types */
923+#define GB_SVC_TYPE_PROTOCOL_VERSION 0x01
924+#define GB_SVC_TYPE_SVC_HELLO 0x02
925+#define GB_SVC_TYPE_INTF_DEVICE_ID 0x03
926+#define GB_SVC_TYPE_INTF_RESET 0x06
927+#define GB_SVC_TYPE_CONN_CREATE 0x07
928+#define GB_SVC_TYPE_CONN_DESTROY 0x08
929+#define GB_SVC_TYPE_DME_PEER_GET 0x09
930+#define GB_SVC_TYPE_DME_PEER_SET 0x0a
931+#define GB_SVC_TYPE_ROUTE_CREATE 0x0b
932+#define GB_SVC_TYPE_ROUTE_DESTROY 0x0c
933+#define GB_SVC_TYPE_TIMESYNC_ENABLE 0x0d
934+#define GB_SVC_TYPE_TIMESYNC_DISABLE 0x0e
935+#define GB_SVC_TYPE_TIMESYNC_AUTHORITATIVE 0x0f
936+#define GB_SVC_TYPE_INTF_SET_PWRM 0x10
937+#define GB_SVC_TYPE_INTF_EJECT 0x11
938+#define GB_SVC_TYPE_PING 0x13
939+#define GB_SVC_TYPE_PWRMON_RAIL_COUNT_GET 0x14
940+#define GB_SVC_TYPE_PWRMON_RAIL_NAMES_GET 0x15
941+#define GB_SVC_TYPE_PWRMON_SAMPLE_GET 0x16
942+#define GB_SVC_TYPE_PWRMON_INTF_SAMPLE_GET 0x17
943+#define GB_SVC_TYPE_TIMESYNC_WAKE_PINS_ACQUIRE 0x18
944+#define GB_SVC_TYPE_TIMESYNC_WAKE_PINS_RELEASE 0x19
945+#define GB_SVC_TYPE_TIMESYNC_PING 0x1a
946+#define GB_SVC_TYPE_MODULE_INSERTED 0x1f
947+#define GB_SVC_TYPE_MODULE_REMOVED 0x20
948+#define GB_SVC_TYPE_INTF_VSYS_ENABLE 0x21
949+#define GB_SVC_TYPE_INTF_VSYS_DISABLE 0x22
950+#define GB_SVC_TYPE_INTF_REFCLK_ENABLE 0x23
951+#define GB_SVC_TYPE_INTF_REFCLK_DISABLE 0x24
952+#define GB_SVC_TYPE_INTF_UNIPRO_ENABLE 0x25
953+#define GB_SVC_TYPE_INTF_UNIPRO_DISABLE 0x26
954+#define GB_SVC_TYPE_INTF_ACTIVATE 0x27
955+#define GB_SVC_TYPE_INTF_RESUME 0x28
956+#define GB_SVC_TYPE_INTF_MAILBOX_EVENT 0x29
957+#define GB_SVC_TYPE_INTF_OOPS 0x2a
958+
959+/* Greybus SVC protocol status values */
960+#define GB_SVC_OP_SUCCESS 0x00
961+#define GB_SVC_OP_UNKNOWN_ERROR 0x01
962+#define GB_SVC_INTF_NOT_DETECTED 0x02
963+#define GB_SVC_INTF_NO_UPRO_LINK 0x03
964+#define GB_SVC_INTF_UPRO_NOT_DOWN 0x04
965+#define GB_SVC_INTF_UPRO_NOT_HIBERNATED 0x05
966+#define GB_SVC_INTF_NO_V_SYS 0x06
967+#define GB_SVC_INTF_V_CHG 0x07
968+#define GB_SVC_INTF_WAKE_BUSY 0x08
969+#define GB_SVC_INTF_NO_REFCLK 0x09
970+#define GB_SVC_INTF_RELEASING 0x0a
971+#define GB_SVC_INTF_NO_ORDER 0x0b
972+#define GB_SVC_INTF_MBOX_SET 0x0c
973+#define GB_SVC_INTF_BAD_MBOX 0x0d
974+#define GB_SVC_INTF_OP_TIMEOUT 0x0e
975+#define GB_SVC_PWRMON_OP_NOT_PRESENT 0x0f
976+
977+struct gb_svc_version_request {
978+ __u8 major;
979+ __u8 minor;
980+} __packed;
981+
982+struct gb_svc_version_response {
983+ __u8 major;
984+ __u8 minor;
985+} __packed;
986+
987+/* SVC protocol hello request */
988+struct gb_svc_hello_request {
989+ __le16 endo_id;
990+ __u8 interface_id;
991+} __packed;
992+/* hello response has no payload */
993+
994+struct gb_svc_intf_device_id_request {
995+ __u8 intf_id;
996+ __u8 device_id;
997+} __packed;
998+/* device id response has no payload */
999+
1000+struct gb_svc_intf_reset_request {
1001+ __u8 intf_id;
1002+} __packed;
1003+/* interface reset response has no payload */
1004+
1005+struct gb_svc_intf_eject_request {
1006+ __u8 intf_id;
1007+} __packed;
1008+/* interface eject response has no payload */
1009+
1010+struct gb_svc_conn_create_request {
1011+ __u8 intf1_id;
1012+ __le16 cport1_id;
1013+ __u8 intf2_id;
1014+ __le16 cport2_id;
1015+ __u8 tc;
1016+ __u8 flags;
1017+} __packed;
1018+/* connection create response has no payload */
1019+
1020+struct gb_svc_conn_destroy_request {
1021+ __u8 intf1_id;
1022+ __le16 cport1_id;
1023+ __u8 intf2_id;
1024+ __le16 cport2_id;
1025+} __packed;
1026+/* connection destroy response has no payload */
1027+
1028+struct gb_svc_dme_peer_get_request {
1029+ __u8 intf_id;
1030+ __le16 attr;
1031+ __le16 selector;
1032+} __packed;
1033+
1034+struct gb_svc_dme_peer_get_response {
1035+ __le16 result_code;
1036+ __le32 attr_value;
1037+} __packed;
1038+
1039+struct gb_svc_dme_peer_set_request {
1040+ __u8 intf_id;
1041+ __le16 attr;
1042+ __le16 selector;
1043+ __le32 value;
1044+} __packed;
1045+
1046+struct gb_svc_dme_peer_set_response {
1047+ __le16 result_code;
1048+} __packed;
1049+
1050+/* Greybus init-status values, currently retrieved using DME peer gets. */
1051+#define GB_INIT_SPI_BOOT_STARTED 0x02
1052+#define GB_INIT_TRUSTED_SPI_BOOT_FINISHED 0x03
1053+#define GB_INIT_UNTRUSTED_SPI_BOOT_FINISHED 0x04
1054+#define GB_INIT_BOOTROM_UNIPRO_BOOT_STARTED 0x06
1055+#define GB_INIT_BOOTROM_FALLBACK_UNIPRO_BOOT_STARTED 0x09
1056+#define GB_INIT_S2_LOADER_BOOT_STARTED 0x0D
1057+
1058+struct gb_svc_route_create_request {
1059+ __u8 intf1_id;
1060+ __u8 dev1_id;
1061+ __u8 intf2_id;
1062+ __u8 dev2_id;
1063+} __packed;
1064+/* route create response has no payload */
1065+
1066+struct gb_svc_route_destroy_request {
1067+ __u8 intf1_id;
1068+ __u8 intf2_id;
1069+} __packed;
1070+/* route destroy response has no payload */
1071+
1072+/* used for svc_intf_vsys_{enable,disable} */
1073+struct gb_svc_intf_vsys_request {
1074+ __u8 intf_id;
1075+} __packed;
1076+
1077+struct gb_svc_intf_vsys_response {
1078+ __u8 result_code;
1079+#define GB_SVC_INTF_VSYS_OK 0x00
1080+ /* 0x01 is reserved */
1081+#define GB_SVC_INTF_VSYS_FAIL 0x02
1082+} __packed;
1083+
1084+/* used for svc_intf_refclk_{enable,disable} */
1085+struct gb_svc_intf_refclk_request {
1086+ __u8 intf_id;
1087+} __packed;
1088+
1089+struct gb_svc_intf_refclk_response {
1090+ __u8 result_code;
1091+#define GB_SVC_INTF_REFCLK_OK 0x00
1092+ /* 0x01 is reserved */
1093+#define GB_SVC_INTF_REFCLK_FAIL 0x02
1094+} __packed;
1095+
1096+/* used for svc_intf_unipro_{enable,disable} */
1097+struct gb_svc_intf_unipro_request {
1098+ __u8 intf_id;
1099+} __packed;
1100+
1101+struct gb_svc_intf_unipro_response {
1102+ __u8 result_code;
1103+#define GB_SVC_INTF_UNIPRO_OK 0x00
1104+ /* 0x01 is reserved */
1105+#define GB_SVC_INTF_UNIPRO_FAIL 0x02
1106+#define GB_SVC_INTF_UNIPRO_NOT_OFF 0x03
1107+} __packed;
1108+
1109+#define GB_SVC_UNIPRO_FAST_MODE 0x01
1110+#define GB_SVC_UNIPRO_SLOW_MODE 0x02
1111+#define GB_SVC_UNIPRO_FAST_AUTO_MODE 0x04
1112+#define GB_SVC_UNIPRO_SLOW_AUTO_MODE 0x05
1113+#define GB_SVC_UNIPRO_MODE_UNCHANGED 0x07
1114+#define GB_SVC_UNIPRO_HIBERNATE_MODE 0x11
1115+#define GB_SVC_UNIPRO_OFF_MODE 0x12
1116+
1117+#define GB_SVC_SMALL_AMPLITUDE 0x01
1118+#define GB_SVC_LARGE_AMPLITUDE 0x02
1119+
1120+#define GB_SVC_NO_DE_EMPHASIS 0x00
1121+#define GB_SVC_SMALL_DE_EMPHASIS 0x01
1122+#define GB_SVC_LARGE_DE_EMPHASIS 0x02
1123+
1124+#define GB_SVC_PWRM_RXTERMINATION 0x01
1125+#define GB_SVC_PWRM_TXTERMINATION 0x02
1126+#define GB_SVC_PWRM_LINE_RESET 0x04
1127+#define GB_SVC_PWRM_SCRAMBLING 0x20
1128+
1129+#define GB_SVC_PWRM_QUIRK_HSSER 0x00000001
1130+
1131+#define GB_SVC_UNIPRO_HS_SERIES_A 0x01
1132+#define GB_SVC_UNIPRO_HS_SERIES_B 0x02
1133+
1134+#define GB_SVC_SETPWRM_PWR_OK 0x00
1135+#define GB_SVC_SETPWRM_PWR_LOCAL 0x01
1136+#define GB_SVC_SETPWRM_PWR_REMOTE 0x02
1137+#define GB_SVC_SETPWRM_PWR_BUSY 0x03
1138+#define GB_SVC_SETPWRM_PWR_ERROR_CAP 0x04
1139+#define GB_SVC_SETPWRM_PWR_FATAL_ERROR 0x05
1140+
1141+struct gb_svc_l2_timer_cfg {
1142+ __le16 tsb_fc0_protection_timeout;
1143+ __le16 tsb_tc0_replay_timeout;
1144+ __le16 tsb_afc0_req_timeout;
1145+ __le16 tsb_fc1_protection_timeout;
1146+ __le16 tsb_tc1_replay_timeout;
1147+ __le16 tsb_afc1_req_timeout;
1148+ __le16 reserved_for_tc2[3];
1149+ __le16 reserved_for_tc3[3];
1150+} __packed;
1151+
1152+struct gb_svc_intf_set_pwrm_request {
1153+ __u8 intf_id;
1154+ __u8 hs_series;
1155+ __u8 tx_mode;
1156+ __u8 tx_gear;
1157+ __u8 tx_nlanes;
1158+ __u8 tx_amplitude;
1159+ __u8 tx_hs_equalizer;
1160+ __u8 rx_mode;
1161+ __u8 rx_gear;
1162+ __u8 rx_nlanes;
1163+ __u8 flags;
1164+ __le32 quirks;
1165+ struct gb_svc_l2_timer_cfg local_l2timerdata, remote_l2timerdata;
1166+} __packed;
1167+
1168+struct gb_svc_intf_set_pwrm_response {
1169+ __u8 result_code;
1170+} __packed;
1171+
1172+struct gb_svc_key_event_request {
1173+ __le16 key_code;
1174+#define GB_KEYCODE_ARA 0x00
1175+
1176+ __u8 key_event;
1177+#define GB_SVC_KEY_RELEASED 0x00
1178+#define GB_SVC_KEY_PRESSED 0x01
1179+} __packed;
1180+
1181+#define GB_SVC_PWRMON_MAX_RAIL_COUNT 254
1182+
1183+struct gb_svc_pwrmon_rail_count_get_response {
1184+ __u8 rail_count;
1185+} __packed;
1186+
1187+#define GB_SVC_PWRMON_RAIL_NAME_BUFSIZE 32
1188+
1189+struct gb_svc_pwrmon_rail_names_get_response {
1190+ __u8 status;
1191+ __u8 name[0][GB_SVC_PWRMON_RAIL_NAME_BUFSIZE];
1192+} __packed;
1193+
1194+#define GB_SVC_PWRMON_TYPE_CURR 0x01
1195+#define GB_SVC_PWRMON_TYPE_VOL 0x02
1196+#define GB_SVC_PWRMON_TYPE_PWR 0x03
1197+
1198+#define GB_SVC_PWRMON_GET_SAMPLE_OK 0x00
1199+#define GB_SVC_PWRMON_GET_SAMPLE_INVAL 0x01
1200+#define GB_SVC_PWRMON_GET_SAMPLE_NOSUPP 0x02
1201+#define GB_SVC_PWRMON_GET_SAMPLE_HWERR 0x03
1202+
1203+struct gb_svc_pwrmon_sample_get_request {
1204+ __u8 rail_id;
1205+ __u8 measurement_type;
1206+} __packed;
1207+
1208+struct gb_svc_pwrmon_sample_get_response {
1209+ __u8 result;
1210+ __le32 measurement;
1211+} __packed;
1212+
1213+struct gb_svc_pwrmon_intf_sample_get_request {
1214+ __u8 intf_id;
1215+ __u8 measurement_type;
1216+} __packed;
1217+
1218+struct gb_svc_pwrmon_intf_sample_get_response {
1219+ __u8 result;
1220+ __le32 measurement;
1221+} __packed;
1222+
1223+#define GB_SVC_MODULE_INSERTED_FLAG_NO_PRIMARY 0x0001
1224+
1225+struct gb_svc_module_inserted_request {
1226+ __u8 primary_intf_id;
1227+ __u8 intf_count;
1228+ __le16 flags;
1229+} __packed;
1230+/* module_inserted response has no payload */
1231+
1232+struct gb_svc_module_removed_request {
1233+ __u8 primary_intf_id;
1234+} __packed;
1235+/* module_removed response has no payload */
1236+
1237+struct gb_svc_intf_activate_request {
1238+ __u8 intf_id;
1239+} __packed;
1240+
1241+#define GB_SVC_INTF_TYPE_UNKNOWN 0x00
1242+#define GB_SVC_INTF_TYPE_DUMMY 0x01
1243+#define GB_SVC_INTF_TYPE_UNIPRO 0x02
1244+#define GB_SVC_INTF_TYPE_GREYBUS 0x03
1245+
1246+struct gb_svc_intf_activate_response {
1247+ __u8 status;
1248+ __u8 intf_type;
1249+} __packed;
1250+
1251+struct gb_svc_intf_resume_request {
1252+ __u8 intf_id;
1253+} __packed;
1254+
1255+struct gb_svc_intf_resume_response {
1256+ __u8 status;
1257+} __packed;
1258+
1259+#define GB_SVC_INTF_MAILBOX_NONE 0x00
1260+#define GB_SVC_INTF_MAILBOX_AP 0x01
1261+#define GB_SVC_INTF_MAILBOX_GREYBUS 0x02
1262+
1263+struct gb_svc_intf_mailbox_event_request {
1264+ __u8 intf_id;
1265+ __le16 result_code;
1266+ __le32 mailbox;
1267+} __packed;
1268+/* intf_mailbox_event response has no payload */
1269+
1270+struct gb_svc_intf_oops_request {
1271+ __u8 intf_id;
1272+ __u8 reason;
1273+} __packed;
1274+/* intf_oops response has no payload */
1275+
1276+
1277+/* RAW */
1278+
1279+/* Greybus raw request types */
1280+#define GB_RAW_TYPE_SEND 0x02
1281+
1282+struct gb_raw_send_request {
1283+ __le32 len;
1284+ __u8 data[0];
1285+} __packed;
1286+
1287+
1288+/* UART */
1289+
1290+/* Greybus UART operation types */
1291+#define GB_UART_TYPE_SEND_DATA 0x02
1292+#define GB_UART_TYPE_RECEIVE_DATA 0x03 /* Unsolicited data */
1293+#define GB_UART_TYPE_SET_LINE_CODING 0x04
1294+#define GB_UART_TYPE_SET_CONTROL_LINE_STATE 0x05
1295+#define GB_UART_TYPE_SEND_BREAK 0x06
1296+#define GB_UART_TYPE_SERIAL_STATE 0x07 /* Unsolicited data */
1297+#define GB_UART_TYPE_RECEIVE_CREDITS 0x08
1298+#define GB_UART_TYPE_FLUSH_FIFOS 0x09
1299+
1300+/* Represents data from AP -> Module */
1301+struct gb_uart_send_data_request {
1302+ __le16 size;
1303+ __u8 data[0];
1304+} __packed;
1305+
1306+/* recv-data-request flags */
1307+#define GB_UART_RECV_FLAG_FRAMING 0x01 /* Framing error */
1308+#define GB_UART_RECV_FLAG_PARITY 0x02 /* Parity error */
1309+#define GB_UART_RECV_FLAG_OVERRUN 0x04 /* Overrun error */
1310+#define GB_UART_RECV_FLAG_BREAK 0x08 /* Break */
1311+
1312+/* Represents data from Module -> AP */
1313+struct gb_uart_recv_data_request {
1314+ __le16 size;
1315+ __u8 flags;
1316+ __u8 data[0];
1317+} __packed;
1318+
1319+struct gb_uart_receive_credits_request {
1320+ __le16 count;
1321+} __packed;
1322+
1323+struct gb_uart_set_line_coding_request {
1324+ __le32 rate;
1325+ __u8 format;
1326+#define GB_SERIAL_1_STOP_BITS 0
1327+#define GB_SERIAL_1_5_STOP_BITS 1
1328+#define GB_SERIAL_2_STOP_BITS 2
1329+
1330+ __u8 parity;
1331+#define GB_SERIAL_NO_PARITY 0
1332+#define GB_SERIAL_ODD_PARITY 1
1333+#define GB_SERIAL_EVEN_PARITY 2
1334+#define GB_SERIAL_MARK_PARITY 3
1335+#define GB_SERIAL_SPACE_PARITY 4
1336+
1337+ __u8 data_bits;
1338+
1339+ __u8 flow_control;
1340+#define GB_SERIAL_AUTO_RTSCTS_EN 0x1
1341+} __packed;
1342+
1343+/* output control lines */
1344+#define GB_UART_CTRL_DTR 0x01
1345+#define GB_UART_CTRL_RTS 0x02
1346+
1347+struct gb_uart_set_control_line_state_request {
1348+ __u8 control;
1349+} __packed;
1350+
1351+struct gb_uart_set_break_request {
1352+ __u8 state;
1353+} __packed;
1354+
1355+/* input control lines and line errors */
1356+#define GB_UART_CTRL_DCD 0x01
1357+#define GB_UART_CTRL_DSR 0x02
1358+#define GB_UART_CTRL_RI 0x04
1359+
1360+struct gb_uart_serial_state_request {
1361+ __u8 control;
1362+} __packed;
1363+
1364+struct gb_uart_serial_flush_request {
1365+ __u8 flags;
1366+#define GB_SERIAL_FLAG_FLUSH_TRANSMITTER 0x01
1367+#define GB_SERIAL_FLAG_FLUSH_RECEIVER 0x02
1368+} __packed;
1369+
1370+/* Loopback */
1371+
1372+/* Greybus loopback request types */
1373+#define GB_LOOPBACK_TYPE_PING 0x02
1374+#define GB_LOOPBACK_TYPE_TRANSFER 0x03
1375+#define GB_LOOPBACK_TYPE_SINK 0x04
1376+
1377+/*
1378+ * Loopback request/response header format should be identical
1379+ * to simplify bandwidth and data movement analysis.
1380+ */
1381+struct gb_loopback_transfer_request {
1382+ __le32 len;
1383+ __le32 reserved0;
1384+ __le32 reserved1;
1385+ __u8 data[0];
1386+} __packed;
1387+
1388+struct gb_loopback_transfer_response {
1389+ __le32 len;
1390+ __le32 reserved0;
1391+ __le32 reserved1;
1392+ __u8 data[0];
1393+} __packed;
1394+
1395+/* SDIO */
1396+/* Greybus SDIO operation types */
1397+#define GB_SDIO_TYPE_GET_CAPABILITIES 0x02
1398+#define GB_SDIO_TYPE_SET_IOS 0x03
1399+#define GB_SDIO_TYPE_COMMAND 0x04
1400+#define GB_SDIO_TYPE_TRANSFER 0x05
1401+#define GB_SDIO_TYPE_EVENT 0x06
1402+
1403+/* get caps response: request has no payload */
1404+struct gb_sdio_get_caps_response {
1405+ __le32 caps;
1406+#define GB_SDIO_CAP_NONREMOVABLE 0x00000001
1407+#define GB_SDIO_CAP_4_BIT_DATA 0x00000002
1408+#define GB_SDIO_CAP_8_BIT_DATA 0x00000004
1409+#define GB_SDIO_CAP_MMC_HS 0x00000008
1410+#define GB_SDIO_CAP_SD_HS 0x00000010
1411+#define GB_SDIO_CAP_ERASE 0x00000020
1412+#define GB_SDIO_CAP_1_2V_DDR 0x00000040
1413+#define GB_SDIO_CAP_1_8V_DDR 0x00000080
1414+#define GB_SDIO_CAP_POWER_OFF_CARD 0x00000100
1415+#define GB_SDIO_CAP_UHS_SDR12 0x00000200
1416+#define GB_SDIO_CAP_UHS_SDR25 0x00000400
1417+#define GB_SDIO_CAP_UHS_SDR50 0x00000800
1418+#define GB_SDIO_CAP_UHS_SDR104 0x00001000
1419+#define GB_SDIO_CAP_UHS_DDR50 0x00002000
1420+#define GB_SDIO_CAP_DRIVER_TYPE_A 0x00004000
1421+#define GB_SDIO_CAP_DRIVER_TYPE_C 0x00008000
1422+#define GB_SDIO_CAP_DRIVER_TYPE_D 0x00010000
1423+#define GB_SDIO_CAP_HS200_1_2V 0x00020000
1424+#define GB_SDIO_CAP_HS200_1_8V 0x00040000
1425+#define GB_SDIO_CAP_HS400_1_2V 0x00080000
1426+#define GB_SDIO_CAP_HS400_1_8V 0x00100000
1427+
1428+ /* see possible values below at vdd */
1429+ __le32 ocr;
1430+ __le32 f_min;
1431+ __le32 f_max;
1432+ __le16 max_blk_count;
1433+ __le16 max_blk_size;
1434+} __packed;
1435+
1436+/* set ios request: response has no payload */
1437+struct gb_sdio_set_ios_request {
1438+ __le32 clock;
1439+ __le32 vdd;
1440+#define GB_SDIO_VDD_165_195 0x00000001
1441+#define GB_SDIO_VDD_20_21 0x00000002
1442+#define GB_SDIO_VDD_21_22 0x00000004
1443+#define GB_SDIO_VDD_22_23 0x00000008
1444+#define GB_SDIO_VDD_23_24 0x00000010
1445+#define GB_SDIO_VDD_24_25 0x00000020
1446+#define GB_SDIO_VDD_25_26 0x00000040
1447+#define GB_SDIO_VDD_26_27 0x00000080
1448+#define GB_SDIO_VDD_27_28 0x00000100
1449+#define GB_SDIO_VDD_28_29 0x00000200
1450+#define GB_SDIO_VDD_29_30 0x00000400
1451+#define GB_SDIO_VDD_30_31 0x00000800
1452+#define GB_SDIO_VDD_31_32 0x00001000
1453+#define GB_SDIO_VDD_32_33 0x00002000
1454+#define GB_SDIO_VDD_33_34 0x00004000
1455+#define GB_SDIO_VDD_34_35 0x00008000
1456+#define GB_SDIO_VDD_35_36 0x00010000
1457+
1458+ __u8 bus_mode;
1459+#define GB_SDIO_BUSMODE_OPENDRAIN 0x00
1460+#define GB_SDIO_BUSMODE_PUSHPULL 0x01
1461+
1462+ __u8 power_mode;
1463+#define GB_SDIO_POWER_OFF 0x00
1464+#define GB_SDIO_POWER_UP 0x01
1465+#define GB_SDIO_POWER_ON 0x02
1466+#define GB_SDIO_POWER_UNDEFINED 0x03
1467+
1468+ __u8 bus_width;
1469+#define GB_SDIO_BUS_WIDTH_1 0x00
1470+#define GB_SDIO_BUS_WIDTH_4 0x02
1471+#define GB_SDIO_BUS_WIDTH_8 0x03
1472+
1473+ __u8 timing;
1474+#define GB_SDIO_TIMING_LEGACY 0x00
1475+#define GB_SDIO_TIMING_MMC_HS 0x01
1476+#define GB_SDIO_TIMING_SD_HS 0x02
1477+#define GB_SDIO_TIMING_UHS_SDR12 0x03
1478+#define GB_SDIO_TIMING_UHS_SDR25 0x04
1479+#define GB_SDIO_TIMING_UHS_SDR50 0x05
1480+#define GB_SDIO_TIMING_UHS_SDR104 0x06
1481+#define GB_SDIO_TIMING_UHS_DDR50 0x07
1482+#define GB_SDIO_TIMING_MMC_DDR52 0x08
1483+#define GB_SDIO_TIMING_MMC_HS200 0x09
1484+#define GB_SDIO_TIMING_MMC_HS400 0x0A
1485+
1486+ __u8 signal_voltage;
1487+#define GB_SDIO_SIGNAL_VOLTAGE_330 0x00
1488+#define GB_SDIO_SIGNAL_VOLTAGE_180 0x01
1489+#define GB_SDIO_SIGNAL_VOLTAGE_120 0x02
1490+
1491+ __u8 drv_type;
1492+#define GB_SDIO_SET_DRIVER_TYPE_B 0x00
1493+#define GB_SDIO_SET_DRIVER_TYPE_A 0x01
1494+#define GB_SDIO_SET_DRIVER_TYPE_C 0x02
1495+#define GB_SDIO_SET_DRIVER_TYPE_D 0x03
1496+} __packed;
1497+
1498+/* command request */
1499+struct gb_sdio_command_request {
1500+ __u8 cmd;
1501+ __u8 cmd_flags;
1502+#define GB_SDIO_RSP_NONE 0x00
1503+#define GB_SDIO_RSP_PRESENT 0x01
1504+#define GB_SDIO_RSP_136 0x02
1505+#define GB_SDIO_RSP_CRC 0x04
1506+#define GB_SDIO_RSP_BUSY 0x08
1507+#define GB_SDIO_RSP_OPCODE 0x10
1508+
1509+ __u8 cmd_type;
1510+#define GB_SDIO_CMD_AC 0x00
1511+#define GB_SDIO_CMD_ADTC 0x01
1512+#define GB_SDIO_CMD_BC 0x02
1513+#define GB_SDIO_CMD_BCR 0x03
1514+
1515+ __le32 cmd_arg;
1516+ __le16 data_blocks;
1517+ __le16 data_blksz;
1518+} __packed;
1519+
1520+struct gb_sdio_command_response {
1521+ __le32 resp[4];
1522+} __packed;
1523+
1524+/* transfer request */
1525+struct gb_sdio_transfer_request {
1526+ __u8 data_flags;
1527+#define GB_SDIO_DATA_WRITE 0x01
1528+#define GB_SDIO_DATA_READ 0x02
1529+#define GB_SDIO_DATA_STREAM 0x04
1530+
1531+ __le16 data_blocks;
1532+ __le16 data_blksz;
1533+ __u8 data[0];
1534+} __packed;
1535+
1536+struct gb_sdio_transfer_response {
1537+ __le16 data_blocks;
1538+ __le16 data_blksz;
1539+ __u8 data[0];
1540+} __packed;
1541+
1542+/* event request: generated by module and is defined as unidirectional */
1543+struct gb_sdio_event_request {
1544+ __u8 event;
1545+#define GB_SDIO_CARD_INSERTED 0x01
1546+#define GB_SDIO_CARD_REMOVED 0x02
1547+#define GB_SDIO_WP 0x04
1548+} __packed;
1549+
1550+/* Camera */
1551+
1552+/* Greybus Camera request types */
1553+#define GB_CAMERA_TYPE_CAPABILITIES 0x02
1554+#define GB_CAMERA_TYPE_CONFIGURE_STREAMS 0x03
1555+#define GB_CAMERA_TYPE_CAPTURE 0x04
1556+#define GB_CAMERA_TYPE_FLUSH 0x05
1557+#define GB_CAMERA_TYPE_METADATA 0x06
1558+
1559+#define GB_CAMERA_MAX_STREAMS 4
1560+#define GB_CAMERA_MAX_SETTINGS_SIZE 8192
1561+
1562+/* Greybus Camera Configure Streams request payload */
1563+struct gb_camera_stream_config_request {
1564+ __le16 width;
1565+ __le16 height;
1566+ __le16 format;
1567+ __le16 padding;
1568+} __packed;
1569+
1570+struct gb_camera_configure_streams_request {
1571+ __u8 num_streams;
1572+ __u8 flags;
1573+#define GB_CAMERA_CONFIGURE_STREAMS_TEST_ONLY 0x01
1574+ __le16 padding;
1575+ struct gb_camera_stream_config_request config[0];
1576+} __packed;
1577+
1578+/* Greybus Camera Configure Streams response payload */
1579+struct gb_camera_stream_config_response {
1580+ __le16 width;
1581+ __le16 height;
1582+ __le16 format;
1583+ __u8 virtual_channel;
1584+ __u8 data_type[2];
1585+ __le16 max_pkt_size;
1586+ __u8 padding;
1587+ __le32 max_size;
1588+} __packed;
1589+
1590+struct gb_camera_configure_streams_response {
1591+ __u8 num_streams;
1592+#define GB_CAMERA_CONFIGURE_STREAMS_ADJUSTED 0x01
1593+ __u8 flags;
1594+ __u8 padding[2];
1595+ __le32 data_rate;
1596+ struct gb_camera_stream_config_response config[0];
1597+};
1598+
1599+/* Greybus Camera Capture request payload - response has no payload */
1600+struct gb_camera_capture_request {
1601+ __le32 request_id;
1602+ __u8 streams;
1603+ __u8 padding;
1604+ __le16 num_frames;
1605+ __u8 settings[0];
1606+} __packed;
1607+
1608+/* Greybus Camera Flush response payload - request has no payload */
1609+struct gb_camera_flush_response {
1610+ __le32 request_id;
1611+} __packed;
1612+
1613+/* Greybus Camera Metadata request payload - operation has no response */
1614+struct gb_camera_metadata_request {
1615+ __le32 request_id;
1616+ __le16 frame_number;
1617+ __u8 stream;
1618+ __u8 padding;
1619+ __u8 metadata[0];
1620+} __packed;
1621+
1622+/* Lights */
1623+
1624+/* Greybus Lights request types */
1625+#define GB_LIGHTS_TYPE_GET_LIGHTS 0x02
1626+#define GB_LIGHTS_TYPE_GET_LIGHT_CONFIG 0x03
1627+#define GB_LIGHTS_TYPE_GET_CHANNEL_CONFIG 0x04
1628+#define GB_LIGHTS_TYPE_GET_CHANNEL_FLASH_CONFIG 0x05
1629+#define GB_LIGHTS_TYPE_SET_BRIGHTNESS 0x06
1630+#define GB_LIGHTS_TYPE_SET_BLINK 0x07
1631+#define GB_LIGHTS_TYPE_SET_COLOR 0x08
1632+#define GB_LIGHTS_TYPE_SET_FADE 0x09
1633+#define GB_LIGHTS_TYPE_EVENT 0x0A
1634+#define GB_LIGHTS_TYPE_SET_FLASH_INTENSITY 0x0B
1635+#define GB_LIGHTS_TYPE_SET_FLASH_STROBE 0x0C
1636+#define GB_LIGHTS_TYPE_SET_FLASH_TIMEOUT 0x0D
1637+#define GB_LIGHTS_TYPE_GET_FLASH_FAULT 0x0E
1638+
1639+/* Greybus Light modes */
1640+
1641+/*
1642+ * if you add any specific mode below, update also the
1643+ * GB_CHANNEL_MODE_DEFINED_RANGE value accordingly
1644+ */
1645+#define GB_CHANNEL_MODE_NONE 0x00000000
1646+#define GB_CHANNEL_MODE_BATTERY 0x00000001
1647+#define GB_CHANNEL_MODE_POWER 0x00000002
1648+#define GB_CHANNEL_MODE_WIRELESS 0x00000004
1649+#define GB_CHANNEL_MODE_BLUETOOTH 0x00000008
1650+#define GB_CHANNEL_MODE_KEYBOARD 0x00000010
1651+#define GB_CHANNEL_MODE_BUTTONS 0x00000020
1652+#define GB_CHANNEL_MODE_NOTIFICATION 0x00000040
1653+#define GB_CHANNEL_MODE_ATTENTION 0x00000080
1654+#define GB_CHANNEL_MODE_FLASH 0x00000100
1655+#define GB_CHANNEL_MODE_TORCH 0x00000200
1656+#define GB_CHANNEL_MODE_INDICATOR 0x00000400
1657+
1658+/* Lights Mode valid bit values */
1659+#define GB_CHANNEL_MODE_DEFINED_RANGE 0x000004FF
1660+#define GB_CHANNEL_MODE_VENDOR_RANGE 0x00F00000
1661+
1662+/* Greybus Light Channels Flags */
1663+#define GB_LIGHT_CHANNEL_MULTICOLOR 0x00000001
1664+#define GB_LIGHT_CHANNEL_FADER 0x00000002
1665+#define GB_LIGHT_CHANNEL_BLINK 0x00000004
1666+
1667+/* get count of lights in module */
1668+struct gb_lights_get_lights_response {
1669+ __u8 lights_count;
1670+} __packed;
1671+
1672+/* light config request payload */
1673+struct gb_lights_get_light_config_request {
1674+ __u8 id;
1675+} __packed;
1676+
1677+/* light config response payload */
1678+struct gb_lights_get_light_config_response {
1679+ __u8 channel_count;
1680+ __u8 name[32];
1681+} __packed;
1682+
1683+/* channel config request payload */
1684+struct gb_lights_get_channel_config_request {
1685+ __u8 light_id;
1686+ __u8 channel_id;
1687+} __packed;
1688+
1689+/* channel flash config request payload */
1690+struct gb_lights_get_channel_flash_config_request {
1691+ __u8 light_id;
1692+ __u8 channel_id;
1693+} __packed;
1694+
1695+/* channel config response payload */
1696+struct gb_lights_get_channel_config_response {
1697+ __u8 max_brightness;
1698+ __le32 flags;
1699+ __le32 color;
1700+ __u8 color_name[32];
1701+ __le32 mode;
1702+ __u8 mode_name[32];
1703+} __packed;
1704+
1705+/* channel flash config response payload */
1706+struct gb_lights_get_channel_flash_config_response {
1707+ __le32 intensity_min_uA;
1708+ __le32 intensity_max_uA;
1709+ __le32 intensity_step_uA;
1710+ __le32 timeout_min_us;
1711+ __le32 timeout_max_us;
1712+ __le32 timeout_step_us;
1713+} __packed;
1714+
1715+/* blink request payload: response have no payload */
1716+struct gb_lights_blink_request {
1717+ __u8 light_id;
1718+ __u8 channel_id;
1719+ __le16 time_on_ms;
1720+ __le16 time_off_ms;
1721+} __packed;
1722+
1723+/* set brightness request payload: response have no payload */
1724+struct gb_lights_set_brightness_request {
1725+ __u8 light_id;
1726+ __u8 channel_id;
1727+ __u8 brightness;
1728+} __packed;
1729+
1730+/* set color request payload: response have no payload */
1731+struct gb_lights_set_color_request {
1732+ __u8 light_id;
1733+ __u8 channel_id;
1734+ __le32 color;
1735+} __packed;
1736+
1737+/* set fade request payload: response have no payload */
1738+struct gb_lights_set_fade_request {
1739+ __u8 light_id;
1740+ __u8 channel_id;
1741+ __u8 fade_in;
1742+ __u8 fade_out;
1743+} __packed;
1744+
1745+/* event request: generated by module */
1746+struct gb_lights_event_request {
1747+ __u8 light_id;
1748+ __u8 event;
1749+#define GB_LIGHTS_LIGHT_CONFIG 0x01
1750+} __packed;
1751+
1752+/* set flash intensity request payload: response have no payload */
1753+struct gb_lights_set_flash_intensity_request {
1754+ __u8 light_id;
1755+ __u8 channel_id;
1756+ __le32 intensity_uA;
1757+} __packed;
1758+
1759+/* set flash strobe state request payload: response have no payload */
1760+struct gb_lights_set_flash_strobe_request {
1761+ __u8 light_id;
1762+ __u8 channel_id;
1763+ __u8 state;
1764+} __packed;
1765+
1766+/* set flash timeout request payload: response have no payload */
1767+struct gb_lights_set_flash_timeout_request {
1768+ __u8 light_id;
1769+ __u8 channel_id;
1770+ __le32 timeout_us;
1771+} __packed;
1772+
1773+/* get flash fault request payload */
1774+struct gb_lights_get_flash_fault_request {
1775+ __u8 light_id;
1776+ __u8 channel_id;
1777+} __packed;
1778+
1779+/* get flash fault response payload */
1780+struct gb_lights_get_flash_fault_response {
1781+ __le32 fault;
1782+#define GB_LIGHTS_FLASH_FAULT_OVER_VOLTAGE 0x00000000
1783+#define GB_LIGHTS_FLASH_FAULT_TIMEOUT 0x00000001
1784+#define GB_LIGHTS_FLASH_FAULT_OVER_TEMPERATURE 0x00000002
1785+#define GB_LIGHTS_FLASH_FAULT_SHORT_CIRCUIT 0x00000004
1786+#define GB_LIGHTS_FLASH_FAULT_OVER_CURRENT 0x00000008
1787+#define GB_LIGHTS_FLASH_FAULT_INDICATOR 0x00000010
1788+#define GB_LIGHTS_FLASH_FAULT_UNDER_VOLTAGE 0x00000020
1789+#define GB_LIGHTS_FLASH_FAULT_INPUT_VOLTAGE 0x00000040
1790+#define GB_LIGHTS_FLASH_FAULT_LED_OVER_TEMPERATURE 0x00000080
1791+} __packed;
1792+
1793+/* Audio */
1794+
1795+#define GB_AUDIO_TYPE_GET_TOPOLOGY_SIZE 0x02
1796+#define GB_AUDIO_TYPE_GET_TOPOLOGY 0x03
1797+#define GB_AUDIO_TYPE_GET_CONTROL 0x04
1798+#define GB_AUDIO_TYPE_SET_CONTROL 0x05
1799+#define GB_AUDIO_TYPE_ENABLE_WIDGET 0x06
1800+#define GB_AUDIO_TYPE_DISABLE_WIDGET 0x07
1801+#define GB_AUDIO_TYPE_GET_PCM 0x08
1802+#define GB_AUDIO_TYPE_SET_PCM 0x09
1803+#define GB_AUDIO_TYPE_SET_TX_DATA_SIZE 0x0a
1804+ /* 0x0b unused */
1805+#define GB_AUDIO_TYPE_ACTIVATE_TX 0x0c
1806+#define GB_AUDIO_TYPE_DEACTIVATE_TX 0x0d
1807+#define GB_AUDIO_TYPE_SET_RX_DATA_SIZE 0x0e
1808+ /* 0x0f unused */
1809+#define GB_AUDIO_TYPE_ACTIVATE_RX 0x10
1810+#define GB_AUDIO_TYPE_DEACTIVATE_RX 0x11
1811+#define GB_AUDIO_TYPE_JACK_EVENT 0x12
1812+#define GB_AUDIO_TYPE_BUTTON_EVENT 0x13
1813+#define GB_AUDIO_TYPE_STREAMING_EVENT 0x14
1814+#define GB_AUDIO_TYPE_SEND_DATA 0x15
1815+
1816+/* Module must be able to buffer 10ms of audio data, minimum */
1817+#define GB_AUDIO_SAMPLE_BUFFER_MIN_US 10000
1818+
1819+#define GB_AUDIO_PCM_NAME_MAX 32
1820+#define AUDIO_DAI_NAME_MAX 32
1821+#define AUDIO_CONTROL_NAME_MAX 32
1822+#define AUDIO_CTL_ELEM_NAME_MAX 44
1823+#define AUDIO_ENUM_NAME_MAX 64
1824+#define AUDIO_WIDGET_NAME_MAX 32
1825+
1826+/* See SNDRV_PCM_FMTBIT_* in Linux source */
1827+#define GB_AUDIO_PCM_FMT_S8 BIT(0)
1828+#define GB_AUDIO_PCM_FMT_U8 BIT(1)
1829+#define GB_AUDIO_PCM_FMT_S16_LE BIT(2)
1830+#define GB_AUDIO_PCM_FMT_S16_BE BIT(3)
1831+#define GB_AUDIO_PCM_FMT_U16_LE BIT(4)
1832+#define GB_AUDIO_PCM_FMT_U16_BE BIT(5)
1833+#define GB_AUDIO_PCM_FMT_S24_LE BIT(6)
1834+#define GB_AUDIO_PCM_FMT_S24_BE BIT(7)
1835+#define GB_AUDIO_PCM_FMT_U24_LE BIT(8)
1836+#define GB_AUDIO_PCM_FMT_U24_BE BIT(9)
1837+#define GB_AUDIO_PCM_FMT_S32_LE BIT(10)
1838+#define GB_AUDIO_PCM_FMT_S32_BE BIT(11)
1839+#define GB_AUDIO_PCM_FMT_U32_LE BIT(12)
1840+#define GB_AUDIO_PCM_FMT_U32_BE BIT(13)
1841+
1842+/* See SNDRV_PCM_RATE_* in Linux source */
1843+#define GB_AUDIO_PCM_RATE_5512 BIT(0)
1844+#define GB_AUDIO_PCM_RATE_8000 BIT(1)
1845+#define GB_AUDIO_PCM_RATE_11025 BIT(2)
1846+#define GB_AUDIO_PCM_RATE_16000 BIT(3)
1847+#define GB_AUDIO_PCM_RATE_22050 BIT(4)
1848+#define GB_AUDIO_PCM_RATE_32000 BIT(5)
1849+#define GB_AUDIO_PCM_RATE_44100 BIT(6)
1850+#define GB_AUDIO_PCM_RATE_48000 BIT(7)
1851+#define GB_AUDIO_PCM_RATE_64000 BIT(8)
1852+#define GB_AUDIO_PCM_RATE_88200 BIT(9)
1853+#define GB_AUDIO_PCM_RATE_96000 BIT(10)
1854+#define GB_AUDIO_PCM_RATE_176400 BIT(11)
1855+#define GB_AUDIO_PCM_RATE_192000 BIT(12)
1856+
1857+#define GB_AUDIO_STREAM_TYPE_CAPTURE 0x1
1858+#define GB_AUDIO_STREAM_TYPE_PLAYBACK 0x2
1859+
1860+#define GB_AUDIO_CTL_ELEM_ACCESS_READ BIT(0)
1861+#define GB_AUDIO_CTL_ELEM_ACCESS_WRITE BIT(1)
1862+
1863+/* See SNDRV_CTL_ELEM_TYPE_* in Linux source */
1864+#define GB_AUDIO_CTL_ELEM_TYPE_BOOLEAN 0x01
1865+#define GB_AUDIO_CTL_ELEM_TYPE_INTEGER 0x02
1866+#define GB_AUDIO_CTL_ELEM_TYPE_ENUMERATED 0x03
1867+#define GB_AUDIO_CTL_ELEM_TYPE_INTEGER64 0x06
1868+
1869+/* See SNDRV_CTL_ELEM_IFACE_* in Linux source */
1870+#define GB_AUDIO_CTL_ELEM_IFACE_CARD 0x00
1871+#define GB_AUDIO_CTL_ELEM_IFACE_HWDEP 0x01
1872+#define GB_AUDIO_CTL_ELEM_IFACE_MIXER 0x02
1873+#define GB_AUDIO_CTL_ELEM_IFACE_PCM 0x03
1874+#define GB_AUDIO_CTL_ELEM_IFACE_RAWMIDI 0x04
1875+#define GB_AUDIO_CTL_ELEM_IFACE_TIMER 0x05
1876+#define GB_AUDIO_CTL_ELEM_IFACE_SEQUENCER 0x06
1877+
1878+/* SNDRV_CTL_ELEM_ACCESS_* in Linux source */
1879+#define GB_AUDIO_ACCESS_READ BIT(0)
1880+#define GB_AUDIO_ACCESS_WRITE BIT(1)
1881+#define GB_AUDIO_ACCESS_VOLATILE BIT(2)
1882+#define GB_AUDIO_ACCESS_TIMESTAMP BIT(3)
1883+#define GB_AUDIO_ACCESS_TLV_READ BIT(4)
1884+#define GB_AUDIO_ACCESS_TLV_WRITE BIT(5)
1885+#define GB_AUDIO_ACCESS_TLV_COMMAND BIT(6)
1886+#define GB_AUDIO_ACCESS_INACTIVE BIT(7)
1887+#define GB_AUDIO_ACCESS_LOCK BIT(8)
1888+#define GB_AUDIO_ACCESS_OWNER BIT(9)
1889+
1890+/* enum snd_soc_dapm_type */
1891+#define GB_AUDIO_WIDGET_TYPE_INPUT 0x0
1892+#define GB_AUDIO_WIDGET_TYPE_OUTPUT 0x1
1893+#define GB_AUDIO_WIDGET_TYPE_MUX 0x2
1894+#define GB_AUDIO_WIDGET_TYPE_VIRT_MUX 0x3
1895+#define GB_AUDIO_WIDGET_TYPE_VALUE_MUX 0x4
1896+#define GB_AUDIO_WIDGET_TYPE_MIXER 0x5
1897+#define GB_AUDIO_WIDGET_TYPE_MIXER_NAMED_CTL 0x6
1898+#define GB_AUDIO_WIDGET_TYPE_PGA 0x7
1899+#define GB_AUDIO_WIDGET_TYPE_OUT_DRV 0x8
1900+#define GB_AUDIO_WIDGET_TYPE_ADC 0x9
1901+#define GB_AUDIO_WIDGET_TYPE_DAC 0xa
1902+#define GB_AUDIO_WIDGET_TYPE_MICBIAS 0xb
1903+#define GB_AUDIO_WIDGET_TYPE_MIC 0xc
1904+#define GB_AUDIO_WIDGET_TYPE_HP 0xd
1905+#define GB_AUDIO_WIDGET_TYPE_SPK 0xe
1906+#define GB_AUDIO_WIDGET_TYPE_LINE 0xf
1907+#define GB_AUDIO_WIDGET_TYPE_SWITCH 0x10
1908+#define GB_AUDIO_WIDGET_TYPE_VMID 0x11
1909+#define GB_AUDIO_WIDGET_TYPE_PRE 0x12
1910+#define GB_AUDIO_WIDGET_TYPE_POST 0x13
1911+#define GB_AUDIO_WIDGET_TYPE_SUPPLY 0x14
1912+#define GB_AUDIO_WIDGET_TYPE_REGULATOR_SUPPLY 0x15
1913+#define GB_AUDIO_WIDGET_TYPE_CLOCK_SUPPLY 0x16
1914+#define GB_AUDIO_WIDGET_TYPE_AIF_IN 0x17
1915+#define GB_AUDIO_WIDGET_TYPE_AIF_OUT 0x18
1916+#define GB_AUDIO_WIDGET_TYPE_SIGGEN 0x19
1917+#define GB_AUDIO_WIDGET_TYPE_DAI_IN 0x1a
1918+#define GB_AUDIO_WIDGET_TYPE_DAI_OUT 0x1b
1919+#define GB_AUDIO_WIDGET_TYPE_DAI_LINK 0x1c
1920+
1921+#define GB_AUDIO_WIDGET_STATE_DISABLED 0x01
1922+#define GB_AUDIO_WIDGET_STATE_ENAABLED 0x02
1923+
1924+#define GB_AUDIO_JACK_EVENT_INSERTION 0x1
1925+#define GB_AUDIO_JACK_EVENT_REMOVAL 0x2
1926+
1927+#define GB_AUDIO_BUTTON_EVENT_PRESS 0x1
1928+#define GB_AUDIO_BUTTON_EVENT_RELEASE 0x2
1929+
1930+#define GB_AUDIO_STREAMING_EVENT_UNSPECIFIED 0x1
1931+#define GB_AUDIO_STREAMING_EVENT_HALT 0x2
1932+#define GB_AUDIO_STREAMING_EVENT_INTERNAL_ERROR 0x3
1933+#define GB_AUDIO_STREAMING_EVENT_PROTOCOL_ERROR 0x4
1934+#define GB_AUDIO_STREAMING_EVENT_FAILURE 0x5
1935+#define GB_AUDIO_STREAMING_EVENT_UNDERRUN 0x6
1936+#define GB_AUDIO_STREAMING_EVENT_OVERRUN 0x7
1937+#define GB_AUDIO_STREAMING_EVENT_CLOCKING 0x8
1938+#define GB_AUDIO_STREAMING_EVENT_DATA_LEN 0x9
1939+
1940+#define GB_AUDIO_INVALID_INDEX 0xff
1941+
1942+/* enum snd_jack_types */
1943+#define GB_AUDIO_JACK_HEADPHONE 0x0000001
1944+#define GB_AUDIO_JACK_MICROPHONE 0x0000002
1945+#define GB_AUDIO_JACK_HEADSET (GB_AUDIO_JACK_HEADPHONE | \
1946+ GB_AUDIO_JACK_MICROPHONE)
1947+#define GB_AUDIO_JACK_LINEOUT 0x0000004
1948+#define GB_AUDIO_JACK_MECHANICAL 0x0000008
1949+#define GB_AUDIO_JACK_VIDEOOUT 0x0000010
1950+#define GB_AUDIO_JACK_AVOUT (GB_AUDIO_JACK_LINEOUT | \
1951+ GB_AUDIO_JACK_VIDEOOUT)
1952+#define GB_AUDIO_JACK_LINEIN 0x0000020
1953+#define GB_AUDIO_JACK_OC_HPHL 0x0000040
1954+#define GB_AUDIO_JACK_OC_HPHR 0x0000080
1955+#define GB_AUDIO_JACK_MICROPHONE2 0x0000200
1956+#define GB_AUDIO_JACK_ANC_HEADPHONE (GB_AUDIO_JACK_HEADPHONE | \
1957+ GB_AUDIO_JACK_MICROPHONE | \
1958+ GB_AUDIO_JACK_MICROPHONE2)
1959+/* Kept separate from switches to facilitate implementation */
1960+#define GB_AUDIO_JACK_BTN_0 0x4000000
1961+#define GB_AUDIO_JACK_BTN_1 0x2000000
1962+#define GB_AUDIO_JACK_BTN_2 0x1000000
1963+#define GB_AUDIO_JACK_BTN_3 0x0800000
1964+
1965+struct gb_audio_pcm {
1966+ __u8 stream_name[GB_AUDIO_PCM_NAME_MAX];
1967+ __le32 formats; /* GB_AUDIO_PCM_FMT_* */
1968+ __le32 rates; /* GB_AUDIO_PCM_RATE_* */
1969+ __u8 chan_min;
1970+ __u8 chan_max;
1971+ __u8 sig_bits; /* number of bits of content */
1972+} __packed;
1973+
1974+struct gb_audio_dai {
1975+ __u8 name[AUDIO_DAI_NAME_MAX];
1976+ __le16 data_cport;
1977+ struct gb_audio_pcm capture;
1978+ struct gb_audio_pcm playback;
1979+} __packed;
1980+
1981+struct gb_audio_integer {
1982+ __le32 min;
1983+ __le32 max;
1984+ __le32 step;
1985+} __packed;
1986+
1987+struct gb_audio_integer64 {
1988+ __le64 min;
1989+ __le64 max;
1990+ __le64 step;
1991+} __packed;
1992+
1993+struct gb_audio_enumerated {
1994+ __le32 items;
1995+ __le16 names_length;
1996+ __u8 names[0];
1997+} __packed;
1998+
1999+struct gb_audio_ctl_elem_info { /* See snd_ctl_elem_info in Linux source */
2000+ __u8 type; /* GB_AUDIO_CTL_ELEM_TYPE_* */
2001+ __le16 dimen[4];
2002+ union {
2003+ struct gb_audio_integer integer;
2004+ struct gb_audio_integer64 integer64;
2005+ struct gb_audio_enumerated enumerated;
2006+ } value;
2007+} __packed;
2008+
2009+struct gb_audio_ctl_elem_value { /* See snd_ctl_elem_value in Linux source */
2010+ __le64 timestamp; /* XXX needed? */
2011+ union {
2012+ __le32 integer_value[2]; /* consider CTL_DOUBLE_xxx */
2013+ __le64 integer64_value[2];
2014+ __le32 enumerated_item[2];
2015+ } value;
2016+} __packed;
2017+
2018+struct gb_audio_control {
2019+ __u8 name[AUDIO_CONTROL_NAME_MAX];
2020+ __u8 id; /* 0-63 */
2021+ __u8 iface; /* GB_AUDIO_IFACE_* */
2022+ __le16 data_cport;
2023+ __le32 access; /* GB_AUDIO_ACCESS_* */
2024+ __u8 count; /* count of same elements */
2025+ __u8 count_values; /* count of values, max=2 for CTL_DOUBLE_xxx */
2026+ struct gb_audio_ctl_elem_info info;
2027+} __packed;
2028+
2029+struct gb_audio_widget {
2030+ __u8 name[AUDIO_WIDGET_NAME_MAX];
2031+ __u8 sname[AUDIO_WIDGET_NAME_MAX];
2032+ __u8 id;
2033+ __u8 type; /* GB_AUDIO_WIDGET_TYPE_* */
2034+ __u8 state; /* GB_AUDIO_WIDGET_STATE_* */
2035+ __u8 ncontrols;
2036+ struct gb_audio_control ctl[0]; /* 'ncontrols' entries */
2037+} __packed;
2038+
2039+struct gb_audio_route {
2040+ __u8 source_id; /* widget id */
2041+ __u8 destination_id; /* widget id */
2042+ __u8 control_id; /* 0-63 */
2043+ __u8 index; /* Selection within the control */
2044+} __packed;
2045+
2046+struct gb_audio_topology {
2047+ __u8 num_dais;
2048+ __u8 num_controls;
2049+ __u8 num_widgets;
2050+ __u8 num_routes;
2051+ __le32 size_dais;
2052+ __le32 size_controls;
2053+ __le32 size_widgets;
2054+ __le32 size_routes;
2055+ __le32 jack_type;
2056+ /*
2057+ * struct gb_audio_dai dai[num_dais];
2058+ * struct gb_audio_control controls[num_controls];
2059+ * struct gb_audio_widget widgets[num_widgets];
2060+ * struct gb_audio_route routes[num_routes];
2061+ */
2062+ __u8 data[0];
2063+} __packed;
2064+
2065+struct gb_audio_get_topology_size_response {
2066+ __le16 size;
2067+} __packed;
2068+
2069+struct gb_audio_get_topology_response {
2070+ struct gb_audio_topology topology;
2071+} __packed;
2072+
2073+struct gb_audio_get_control_request {
2074+ __u8 control_id;
2075+ __u8 index;
2076+} __packed;
2077+
2078+struct gb_audio_get_control_response {
2079+ struct gb_audio_ctl_elem_value value;
2080+} __packed;
2081+
2082+struct gb_audio_set_control_request {
2083+ __u8 control_id;
2084+ __u8 index;
2085+ struct gb_audio_ctl_elem_value value;
2086+} __packed;
2087+
2088+struct gb_audio_enable_widget_request {
2089+ __u8 widget_id;
2090+} __packed;
2091+
2092+struct gb_audio_disable_widget_request {
2093+ __u8 widget_id;
2094+} __packed;
2095+
2096+struct gb_audio_get_pcm_request {
2097+ __le16 data_cport;
2098+} __packed;
2099+
2100+struct gb_audio_get_pcm_response {
2101+ __le32 format;
2102+ __le32 rate;
2103+ __u8 channels;
2104+ __u8 sig_bits;
2105+} __packed;
2106+
2107+struct gb_audio_set_pcm_request {
2108+ __le16 data_cport;
2109+ __le32 format;
2110+ __le32 rate;
2111+ __u8 channels;
2112+ __u8 sig_bits;
2113+} __packed;
2114+
2115+struct gb_audio_set_tx_data_size_request {
2116+ __le16 data_cport;
2117+ __le16 size;
2118+} __packed;
2119+
2120+struct gb_audio_activate_tx_request {
2121+ __le16 data_cport;
2122+} __packed;
2123+
2124+struct gb_audio_deactivate_tx_request {
2125+ __le16 data_cport;
2126+} __packed;
2127+
2128+struct gb_audio_set_rx_data_size_request {
2129+ __le16 data_cport;
2130+ __le16 size;
2131+} __packed;
2132+
2133+struct gb_audio_activate_rx_request {
2134+ __le16 data_cport;
2135+} __packed;
2136+
2137+struct gb_audio_deactivate_rx_request {
2138+ __le16 data_cport;
2139+} __packed;
2140+
2141+struct gb_audio_jack_event_request {
2142+ __u8 widget_id;
2143+ __u8 jack_attribute;
2144+ __u8 event;
2145+} __packed;
2146+
2147+struct gb_audio_button_event_request {
2148+ __u8 widget_id;
2149+ __u8 button_id;
2150+ __u8 event;
2151+} __packed;
2152+
2153+struct gb_audio_streaming_event_request {
2154+ __le16 data_cport;
2155+ __u8 event;
2156+} __packed;
2157+
2158+struct gb_audio_send_data_request {
2159+ __le64 timestamp;
2160+ __u8 data[0];
2161+} __packed;
2162+
2163+
2164+/* Log */
2165+
2166+/* operations */
2167+#define GB_LOG_TYPE_SEND_LOG 0x02
2168+
2169+/* length */
2170+#define GB_LOG_MAX_LEN 1024
2171+
2172+struct gb_log_send_log_request {
2173+ __le16 len;
2174+ __u8 msg[0];
2175+} __packed;
2176+
2177+#endif /* __GREYBUS_PROTOCOLS_H */
2178+
include/linux/greybus/hd.h+85−0
@@ -0,0 +1,85 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Greybus Host Device
4+ *
5+ * Copyright 2014-2015 Google Inc.
6+ * Copyright 2014-2015 Linaro Ltd.
7+ */
8+
9+#ifndef __HD_H
10+#define __HD_H
11+
12+#include <linux/types.h>
13+#include <linux/device.h>
14+
15+struct gb_host_device;
16+struct gb_message;
17+
18+struct gb_hd_driver {
19+ size_t hd_priv_size;
20+
21+ int (*cport_allocate)(struct gb_host_device *hd, int cport_id,
22+ unsigned long flags);
23+ void (*cport_release)(struct gb_host_device *hd, u16 cport_id);
24+ int (*cport_enable)(struct gb_host_device *hd, u16 cport_id,
25+ unsigned long flags);
26+ int (*cport_disable)(struct gb_host_device *hd, u16 cport_id);
27+ int (*cport_connected)(struct gb_host_device *hd, u16 cport_id);
28+ int (*cport_flush)(struct gb_host_device *hd, u16 cport_id);
29+ int (*cport_shutdown)(struct gb_host_device *hd, u16 cport_id,
30+ u8 phase, unsigned int timeout);
31+ int (*cport_quiesce)(struct gb_host_device *hd, u16 cport_id,
32+ size_t peer_space, unsigned int timeout);
33+ int (*cport_clear)(struct gb_host_device *hd, u16 cport_id);
34+
35+ int (*message_send)(struct gb_host_device *hd, u16 dest_cport_id,
36+ struct gb_message *message, gfp_t gfp_mask);
37+ void (*message_cancel)(struct gb_message *message);
38+ int (*latency_tag_enable)(struct gb_host_device *hd, u16 cport_id);
39+ int (*latency_tag_disable)(struct gb_host_device *hd, u16 cport_id);
40+ int (*output)(struct gb_host_device *hd, void *req, u16 size, u8 cmd,
41+ bool async);
42+};
43+
44+struct gb_host_device {
45+ struct device dev;
46+ int bus_id;
47+ const struct gb_hd_driver *driver;
48+
49+ struct list_head modules;
50+ struct list_head connections;
51+ struct ida cport_id_map;
52+
53+ /* Number of CPorts supported by the UniPro IP */
54+ size_t num_cports;
55+
56+ /* Host device buffer constraints */
57+ size_t buffer_size_max;
58+
59+ struct gb_svc *svc;
60+ /* Private data for the host driver */
61+ unsigned long hd_priv[0] __aligned(sizeof(s64));
62+};
63+#define to_gb_host_device(d) container_of(d, struct gb_host_device, dev)
64+
65+int gb_hd_cport_reserve(struct gb_host_device *hd, u16 cport_id);
66+void gb_hd_cport_release_reserved(struct gb_host_device *hd, u16 cport_id);
67+int gb_hd_cport_allocate(struct gb_host_device *hd, int cport_id,
68+ unsigned long flags);
69+void gb_hd_cport_release(struct gb_host_device *hd, u16 cport_id);
70+
71+struct gb_host_device *gb_hd_create(struct gb_hd_driver *driver,
72+ struct device *parent,
73+ size_t buffer_size_max,
74+ size_t num_cports);
75+int gb_hd_add(struct gb_host_device *hd);
76+void gb_hd_del(struct gb_host_device *hd);
77+void gb_hd_shutdown(struct gb_host_device *hd);
78+void gb_hd_put(struct gb_host_device *hd);
79+int gb_hd_output(struct gb_host_device *hd, void *req, u16 size, u8 cmd,
80+ bool in_irq);
81+
82+int gb_hd_init(void);
83+void gb_hd_exit(void);
84+
85+#endif /* __HD_H */
include/linux/greybus/interface.h+85−0
@@ -0,0 +1,85 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Greybus Interface Block code
4+ *
5+ * Copyright 2014 Google Inc.
6+ * Copyright 2014 Linaro Ltd.
7+ */
8+
9+#ifndef __INTERFACE_H
10+#define __INTERFACE_H
11+
12+#include <linux/types.h>
13+#include <linux/device.h>
14+
15+enum gb_interface_type {
16+ GB_INTERFACE_TYPE_INVALID = 0,
17+ GB_INTERFACE_TYPE_UNKNOWN,
18+ GB_INTERFACE_TYPE_DUMMY,
19+ GB_INTERFACE_TYPE_UNIPRO,
20+ GB_INTERFACE_TYPE_GREYBUS,
21+};
22+
23+#define GB_INTERFACE_QUIRK_NO_CPORT_FEATURES BIT(0)
24+#define GB_INTERFACE_QUIRK_NO_INIT_STATUS BIT(1)
25+#define GB_INTERFACE_QUIRK_NO_GMP_IDS BIT(2)
26+#define GB_INTERFACE_QUIRK_FORCED_DISABLE BIT(3)
27+#define GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH BIT(4)
28+#define GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE BIT(5)
29+#define GB_INTERFACE_QUIRK_NO_PM BIT(6)
30+
31+struct gb_interface {
32+ struct device dev;
33+ struct gb_control *control;
34+
35+ struct list_head bundles;
36+ struct list_head module_node;
37+ struct list_head manifest_descs;
38+ u8 interface_id; /* Physical location within the Endo */
39+ u8 device_id;
40+ u8 features; /* Feature flags set in the manifest */
41+
42+ enum gb_interface_type type;
43+
44+ u32 ddbl1_manufacturer_id;
45+ u32 ddbl1_product_id;
46+ u32 vendor_id;
47+ u32 product_id;
48+ u64 serial_number;
49+
50+ struct gb_host_device *hd;
51+ struct gb_module *module;
52+
53+ unsigned long quirks;
54+
55+ struct mutex mutex;
56+
57+ bool disconnected;
58+
59+ bool ejected;
60+ bool removed;
61+ bool active;
62+ bool enabled;
63+ bool mode_switch;
64+ bool dme_read;
65+
66+ struct work_struct mode_switch_work;
67+ struct completion mode_switch_completion;
68+};
69+#define to_gb_interface(d) container_of(d, struct gb_interface, dev)
70+
71+struct gb_interface *gb_interface_create(struct gb_module *module,
72+ u8 interface_id);
73+int gb_interface_activate(struct gb_interface *intf);
74+void gb_interface_deactivate(struct gb_interface *intf);
75+int gb_interface_enable(struct gb_interface *intf);
76+void gb_interface_disable(struct gb_interface *intf);
77+int gb_interface_add(struct gb_interface *intf);
78+void gb_interface_del(struct gb_interface *intf);
79+void gb_interface_put(struct gb_interface *intf);
80+void gb_interface_mailbox_event(struct gb_interface *intf, u16 result,
81+ u32 mailbox);
82+
83+int gb_interface_request_mode_switch(struct gb_interface *intf);
84+
85+#endif /* __INTERFACE_H */
include/linux/greybus/manifest.h+17−0
@@ -0,0 +1,17 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Greybus manifest parsing
4+ *
5+ * Copyright 2014 Google Inc.
6+ * Copyright 2014 Linaro Ltd.
7+ */
8+
9+#ifndef __MANIFEST_H
10+#define __MANIFEST_H
11+
12+#include <linux/types.h>
13+
14+struct gb_interface;
15+bool gb_manifest_parse(struct gb_interface *intf, void *data, size_t size);
16+
17+#endif /* __MANIFEST_H */
include/linux/greybus/module.h+36−0
@@ -0,0 +1,36 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Greybus Module code
4+ *
5+ * Copyright 2016 Google Inc.
6+ * Copyright 2016 Linaro Ltd.
7+ */
8+
9+#ifndef __MODULE_H
10+#define __MODULE_H
11+
12+#include <linux/types.h>
13+#include <linux/device.h>
14+
15+struct gb_module {
16+ struct device dev;
17+ struct gb_host_device *hd;
18+
19+ struct list_head hd_node;
20+
21+ u8 module_id;
22+ size_t num_interfaces;
23+
24+ bool disconnected;
25+
26+ struct gb_interface *interfaces[0];
27+};
28+#define to_gb_module(d) container_of(d, struct gb_module, dev)
29+
30+struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
31+ size_t num_interfaces);
32+int gb_module_add(struct gb_module *module);
33+void gb_module_del(struct gb_module *module);
34+void gb_module_put(struct gb_module *module);
35+
36+#endif /* __MODULE_H */
include/linux/greybus/operation.h+229−0
@@ -0,0 +1,229 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Greybus operations
4+ *
5+ * Copyright 2014 Google Inc.
6+ * Copyright 2014 Linaro Ltd.
7+ */
8+
9+#ifndef __OPERATION_H
10+#define __OPERATION_H
11+
12+#include <linux/completion.h>
13+#include <linux/kref.h>
14+#include <linux/timer.h>
15+#include <linux/types.h>
16+#include <linux/workqueue.h>
17+
18+struct gb_host_device;
19+struct gb_operation;
20+
21+/* The default amount of time a request is given to complete */
22+#define GB_OPERATION_TIMEOUT_DEFAULT 1000 /* milliseconds */
23+
24+/*
25+ * The top bit of the type in an operation message header indicates
26+ * whether the message is a request (bit clear) or response (bit set)
27+ */
28+#define GB_MESSAGE_TYPE_RESPONSE ((u8)0x80)
29+
30+enum gb_operation_result {
31+ GB_OP_SUCCESS = 0x00,
32+ GB_OP_INTERRUPTED = 0x01,
33+ GB_OP_TIMEOUT = 0x02,
34+ GB_OP_NO_MEMORY = 0x03,
35+ GB_OP_PROTOCOL_BAD = 0x04,
36+ GB_OP_OVERFLOW = 0x05,
37+ GB_OP_INVALID = 0x06,
38+ GB_OP_RETRY = 0x07,
39+ GB_OP_NONEXISTENT = 0x08,
40+ GB_OP_UNKNOWN_ERROR = 0xfe,
41+ GB_OP_MALFUNCTION = 0xff,
42+};
43+
44+#define GB_OPERATION_MESSAGE_SIZE_MIN sizeof(struct gb_operation_msg_hdr)
45+#define GB_OPERATION_MESSAGE_SIZE_MAX U16_MAX
46+
47+/*
48+ * Protocol code should only examine the payload and payload_size fields, and
49+ * host-controller drivers may use the hcpriv field. All other fields are
50+ * intended to be private to the operations core code.
51+ */
52+struct gb_message {
53+ struct gb_operation *operation;
54+ struct gb_operation_msg_hdr *header;
55+
56+ void *payload;
57+ size_t payload_size;
58+
59+ void *buffer;
60+
61+ void *hcpriv;
62+};
63+
64+#define GB_OPERATION_FLAG_INCOMING BIT(0)
65+#define GB_OPERATION_FLAG_UNIDIRECTIONAL BIT(1)
66+#define GB_OPERATION_FLAG_SHORT_RESPONSE BIT(2)
67+#define GB_OPERATION_FLAG_CORE BIT(3)
68+
69+#define GB_OPERATION_FLAG_USER_MASK (GB_OPERATION_FLAG_SHORT_RESPONSE | \
70+ GB_OPERATION_FLAG_UNIDIRECTIONAL)
71+
72+/*
73+ * A Greybus operation is a remote procedure call performed over a
74+ * connection between two UniPro interfaces.
75+ *
76+ * Every operation consists of a request message sent to the other
77+ * end of the connection coupled with a reply message returned to
78+ * the sender. Every operation has a type, whose interpretation is
79+ * dependent on the protocol associated with the connection.
80+ *
81+ * Only four things in an operation structure are intended to be
82+ * directly usable by protocol handlers: the operation's connection
83+ * pointer; the operation type; the request message payload (and
84+ * size); and the response message payload (and size). Note that a
85+ * message with a 0-byte payload has a null message payload pointer.
86+ *
87+ * In addition, every operation has a result, which is an errno
88+ * value. Protocol handlers access the operation result using
89+ * gb_operation_result().
90+ */
91+typedef void (*gb_operation_callback)(struct gb_operation *);
92+struct gb_operation {
93+ struct gb_connection *connection;
94+ struct gb_message *request;
95+ struct gb_message *response;
96+
97+ unsigned long flags;
98+ u8 type;
99+ u16 id;
100+ int errno; /* Operation result */
101+
102+ struct work_struct work;
103+ gb_operation_callback callback;
104+ struct completion completion;
105+ struct timer_list timer;
106+
107+ struct kref kref;
108+ atomic_t waiters;
109+
110+ int active;
111+ struct list_head links; /* connection->operations */
112+
113+ void *private;
114+};
115+
116+static inline bool
117+gb_operation_is_incoming(struct gb_operation *operation)
118+{
119+ return operation->flags & GB_OPERATION_FLAG_INCOMING;
120+}
121+
122+static inline bool
123+gb_operation_is_unidirectional(struct gb_operation *operation)
124+{
125+ return operation->flags & GB_OPERATION_FLAG_UNIDIRECTIONAL;
126+}
127+
128+static inline bool
129+gb_operation_short_response_allowed(struct gb_operation *operation)
130+{
131+ return operation->flags & GB_OPERATION_FLAG_SHORT_RESPONSE;
132+}
133+
134+static inline bool gb_operation_is_core(struct gb_operation *operation)
135+{
136+ return operation->flags & GB_OPERATION_FLAG_CORE;
137+}
138+
139+void gb_connection_recv(struct gb_connection *connection,
140+ void *data, size_t size);
141+
142+int gb_operation_result(struct gb_operation *operation);
143+
144+size_t gb_operation_get_payload_size_max(struct gb_connection *connection);
145+struct gb_operation *
146+gb_operation_create_flags(struct gb_connection *connection,
147+ u8 type, size_t request_size,
148+ size_t response_size, unsigned long flags,
149+ gfp_t gfp);
150+
151+static inline struct gb_operation *
152+gb_operation_create(struct gb_connection *connection,
153+ u8 type, size_t request_size,
154+ size_t response_size, gfp_t gfp)
155+{
156+ return gb_operation_create_flags(connection, type, request_size,
157+ response_size, 0, gfp);
158+}
159+
160+struct gb_operation *
161+gb_operation_create_core(struct gb_connection *connection,
162+ u8 type, size_t request_size,
163+ size_t response_size, unsigned long flags,
164+ gfp_t gfp);
165+
166+void gb_operation_get(struct gb_operation *operation);
167+void gb_operation_put(struct gb_operation *operation);
168+
169+bool gb_operation_response_alloc(struct gb_operation *operation,
170+ size_t response_size, gfp_t gfp);
171+
172+int gb_operation_request_send(struct gb_operation *operation,
173+ gb_operation_callback callback,
174+ unsigned int timeout,
175+ gfp_t gfp);
176+int gb_operation_request_send_sync_timeout(struct gb_operation *operation,
177+ unsigned int timeout);
178+static inline int
179+gb_operation_request_send_sync(struct gb_operation *operation)
180+{
181+ return gb_operation_request_send_sync_timeout(operation,
182+ GB_OPERATION_TIMEOUT_DEFAULT);
183+}
184+
185+void gb_operation_cancel(struct gb_operation *operation, int errno);
186+void gb_operation_cancel_incoming(struct gb_operation *operation, int errno);
187+
188+void greybus_message_sent(struct gb_host_device *hd,
189+ struct gb_message *message, int status);
190+
191+int gb_operation_sync_timeout(struct gb_connection *connection, int type,
192+ void *request, int request_size,
193+ void *response, int response_size,
194+ unsigned int timeout);
195+int gb_operation_unidirectional_timeout(struct gb_connection *connection,
196+ int type, void *request, int request_size,
197+ unsigned int timeout);
198+
199+static inline int gb_operation_sync(struct gb_connection *connection, int type,
200+ void *request, int request_size,
201+ void *response, int response_size)
202+{
203+ return gb_operation_sync_timeout(connection, type,
204+ request, request_size, response, response_size,
205+ GB_OPERATION_TIMEOUT_DEFAULT);
206+}
207+
208+static inline int gb_operation_unidirectional(struct gb_connection *connection,
209+ int type, void *request, int request_size)
210+{
211+ return gb_operation_unidirectional_timeout(connection, type,
212+ request, request_size, GB_OPERATION_TIMEOUT_DEFAULT);
213+}
214+
215+static inline void *gb_operation_get_data(struct gb_operation *operation)
216+{
217+ return operation->private;
218+}
219+
220+static inline void gb_operation_set_data(struct gb_operation *operation,
221+ void *data)
222+{
223+ operation->private = data;
224+}
225+
226+int gb_operation_init(void);
227+void gb_operation_exit(void);
228+
229+#endif /* !__OPERATION_H */
include/linux/greybus/svc.h+106−0
@@ -0,0 +1,106 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Greybus SVC code
4+ *
5+ * Copyright 2015 Google Inc.
6+ * Copyright 2015 Linaro Ltd.
7+ */
8+
9+#ifndef __SVC_H
10+#define __SVC_H
11+
12+#include <linux/types.h>
13+#include <linux/device.h>
14+
15+struct gb_svc_l2_timer_cfg;
16+
17+#define GB_SVC_CPORT_FLAG_E2EFC BIT(0)
18+#define GB_SVC_CPORT_FLAG_CSD_N BIT(1)
19+#define GB_SVC_CPORT_FLAG_CSV_N BIT(2)
20+
21+enum gb_svc_state {
22+ GB_SVC_STATE_RESET,
23+ GB_SVC_STATE_PROTOCOL_VERSION,
24+ GB_SVC_STATE_SVC_HELLO,
25+};
26+
27+enum gb_svc_watchdog_bite {
28+ GB_SVC_WATCHDOG_BITE_RESET_UNIPRO = 0,
29+ GB_SVC_WATCHDOG_BITE_PANIC_KERNEL,
30+};
31+
32+struct gb_svc_watchdog;
33+
34+struct svc_debugfs_pwrmon_rail {
35+ u8 id;
36+ struct gb_svc *svc;
37+};
38+
39+struct gb_svc {
40+ struct device dev;
41+
42+ struct gb_host_device *hd;
43+ struct gb_connection *connection;
44+ enum gb_svc_state state;
45+ struct ida device_id_map;
46+ struct workqueue_struct *wq;
47+
48+ u16 endo_id;
49+ u8 ap_intf_id;
50+
51+ u8 protocol_major;
52+ u8 protocol_minor;
53+
54+ struct gb_svc_watchdog *watchdog;
55+ enum gb_svc_watchdog_bite action;
56+
57+ struct dentry *debugfs_dentry;
58+ struct svc_debugfs_pwrmon_rail *pwrmon_rails;
59+};
60+#define to_gb_svc(d) container_of(d, struct gb_svc, dev)
61+
62+struct gb_svc *gb_svc_create(struct gb_host_device *hd);
63+int gb_svc_add(struct gb_svc *svc);
64+void gb_svc_del(struct gb_svc *svc);
65+void gb_svc_put(struct gb_svc *svc);
66+
67+int gb_svc_pwrmon_intf_sample_get(struct gb_svc *svc, u8 intf_id,
68+ u8 measurement_type, u32 *value);
69+int gb_svc_intf_device_id(struct gb_svc *svc, u8 intf_id, u8 device_id);
70+int gb_svc_route_create(struct gb_svc *svc, u8 intf1_id, u8 dev1_id,
71+ u8 intf2_id, u8 dev2_id);
72+void gb_svc_route_destroy(struct gb_svc *svc, u8 intf1_id, u8 intf2_id);
73+int gb_svc_connection_create(struct gb_svc *svc, u8 intf1_id, u16 cport1_id,
74+ u8 intf2_id, u16 cport2_id, u8 cport_flags);
75+void gb_svc_connection_destroy(struct gb_svc *svc, u8 intf1_id, u16 cport1_id,
76+ u8 intf2_id, u16 cport2_id);
77+int gb_svc_intf_eject(struct gb_svc *svc, u8 intf_id);
78+int gb_svc_intf_vsys_set(struct gb_svc *svc, u8 intf_id, bool enable);
79+int gb_svc_intf_refclk_set(struct gb_svc *svc, u8 intf_id, bool enable);
80+int gb_svc_intf_unipro_set(struct gb_svc *svc, u8 intf_id, bool enable);
81+int gb_svc_intf_activate(struct gb_svc *svc, u8 intf_id, u8 *intf_type);
82+int gb_svc_intf_resume(struct gb_svc *svc, u8 intf_id);
83+
84+int gb_svc_dme_peer_get(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector,
85+ u32 *value);
86+int gb_svc_dme_peer_set(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector,
87+ u32 value);
88+int gb_svc_intf_set_power_mode(struct gb_svc *svc, u8 intf_id, u8 hs_series,
89+ u8 tx_mode, u8 tx_gear, u8 tx_nlanes,
90+ u8 tx_amplitude, u8 tx_hs_equalizer,
91+ u8 rx_mode, u8 rx_gear, u8 rx_nlanes,
92+ u8 flags, u32 quirks,
93+ struct gb_svc_l2_timer_cfg *local,
94+ struct gb_svc_l2_timer_cfg *remote);
95+int gb_svc_intf_set_power_mode_hibernate(struct gb_svc *svc, u8 intf_id);
96+int gb_svc_ping(struct gb_svc *svc);
97+int gb_svc_watchdog_create(struct gb_svc *svc);
98+void gb_svc_watchdog_destroy(struct gb_svc *svc);
99+bool gb_svc_watchdog_enabled(struct gb_svc *svc);
100+int gb_svc_watchdog_enable(struct gb_svc *svc);
101+int gb_svc_watchdog_disable(struct gb_svc *svc);
102+
103+int gb_svc_protocol_init(void);
104+void gb_svc_protocol_exit(void);
105+
106+#endif /* __SVC_H */
include/linux/hid.h+23−20
@@ -1154,29 +1154,32 @@ int hid_pidff_init(struct hid_device *hid); · 1153 unmodified lines
11541154 #define hid_pidff_init NULL
11551155 #endif
11561156
1157−#define dbg_hid(format, arg...) \
1157+#define dbg_hid(fmt, ...) \
11581158 do { \
11591159 if (hid_debug) \
1160− printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \
1160+ printk(KERN_DEBUG "%s: " fmt, __FILE__, ##__VA_ARGS__); \
11611161 } while (0)
11621162
1163−#define hid_printk(level, hid, fmt, arg...) \
1164− dev_printk(level, &(hid)->dev, fmt, ##arg)
1165−#define hid_emerg(hid, fmt, arg...) \
1166− dev_emerg(&(hid)->dev, fmt, ##arg)
1167−#define hid_crit(hid, fmt, arg...) \
1168− dev_crit(&(hid)->dev, fmt, ##arg)
1169−#define hid_alert(hid, fmt, arg...) \
1170− dev_alert(&(hid)->dev, fmt, ##arg)
1171−#define hid_err(hid, fmt, arg...) \
1172− dev_err(&(hid)->dev, fmt, ##arg)
1173−#define hid_notice(hid, fmt, arg...) \
1174− dev_notice(&(hid)->dev, fmt, ##arg)
1175−#define hid_warn(hid, fmt, arg...) \
1176− dev_warn(&(hid)->dev, fmt, ##arg)
1177−#define hid_info(hid, fmt, arg...) \
1178− dev_info(&(hid)->dev, fmt, ##arg)
1179−#define hid_dbg(hid, fmt, arg...) \
1180− dev_dbg(&(hid)->dev, fmt, ##arg)
1163+#define hid_err(hid, fmt, ...) \
1164+ dev_err(&(hid)->dev, fmt, ##__VA_ARGS__)
1165+#define hid_notice(hid, fmt, ...) \
1166+ dev_notice(&(hid)->dev, fmt, ##__VA_ARGS__)
1167+#define hid_warn(hid, fmt, ...) \
1168+ dev_warn(&(hid)->dev, fmt, ##__VA_ARGS__)
1169+#define hid_info(hid, fmt, ...) \
1170+ dev_info(&(hid)->dev, fmt, ##__VA_ARGS__)
1171+#define hid_dbg(hid, fmt, ...) \
1172+ dev_dbg(&(hid)->dev, fmt, ##__VA_ARGS__)
1173+
1174+#define hid_err_once(hid, fmt, ...) \
1175+ dev_err_once(&(hid)->dev, fmt, ##__VA_ARGS__)
1176+#define hid_notice_once(hid, fmt, ...) \
1177+ dev_notice_once(&(hid)->dev, fmt, ##__VA_ARGS__)
1178+#define hid_warn_once(hid, fmt, ...) \
1179+ dev_warn_once(&(hid)->dev, fmt, ##__VA_ARGS__)
1180+#define hid_info_once(hid, fmt, ...) \
1181+ dev_info_once(&(hid)->dev, fmt, ##__VA_ARGS__)
1182+#define hid_dbg_once(hid, fmt, ...) \
1183+ dev_dbg_once(&(hid)->dev, fmt, ##__VA_ARGS__)
11811184
11821185 #endif
include/linux/hmm.h+20−159
@@ -84,15 +84,12 @@ · 83 unmodified lines
8484 * @notifiers: count of active mmu notifiers
8585 */
8686 struct hmm {
87− struct mm_struct *mm;
88− struct kref kref;
87+ struct mmu_notifier mmu_notifier;
8988 spinlock_t ranges_lock;
9089 struct list_head ranges;
9190 struct list_head mirrors;
92− struct mmu_notifier mmu_notifier;
9391 struct rw_semaphore mirrors_sem;
9492 wait_queue_head_t wq;
95− struct rcu_head rcu;
9693 long notifiers;
9794 };
9895
@@ -158,13 +155,11 @@ enum hmm_pfn_value_e { · 59 unmodified lines
158155 * @values: pfn value for some special case (none, special, error, ...)
159156 * @default_flags: default flags for the range (write, read, ... see hmm doc)
160157 * @pfn_flags_mask: allows to mask pfn flags so that only default_flags matter
161− * @page_shift: device virtual address shift value (should be >= PAGE_SHIFT)
162158 * @pfn_shifts: pfn shift value (should be <= PAGE_SHIFT)
163159 * @valid: pfns array did not change since it has been fill by an HMM function
164160 */
165161 struct hmm_range {
166162 struct hmm *hmm;
167− struct vm_area_struct *vma;
168163 struct list_head list;
169164 unsigned long start;
170165 unsigned long end;
@@ -173,31 +168,10 @@ struct hmm_range { · 2 unmodified lines
173168 const uint64_t *values;
174169 uint64_t default_flags;
175170 uint64_t pfn_flags_mask;
176− uint8_t page_shift;
177171 uint8_t pfn_shift;
178172 bool valid;
179173 };
180174
181−/*
182− * hmm_range_page_shift() - return the page shift for the range
183− * @range: range being queried
184− * Return: page shift (page size = 1 << page shift) for the range
185− */
186−static inline unsigned hmm_range_page_shift(const struct hmm_range *range)
187−{
188− return range->page_shift;
189−}
190−
191−/*
192− * hmm_range_page_size() - return the page size for the range
193− * @range: range being queried
194− * Return: page size for the range in bytes
195− */
196−static inline unsigned long hmm_range_page_size(const struct hmm_range *range)
197−{
198− return 1UL << hmm_range_page_shift(range);
199−}
200−
201175 /*
202176 * hmm_range_wait_until_valid() - wait for range to be valid
203177 * @range: range affected by invalidation to wait on
@@ -290,40 +264,6 @@ static inline uint64_t hmm_device_entry_from_pfn(const struct hmm_range *range, · 86 unmodified lines
290264 range->flags[HMM_PFN_VALID];
291265 }
292266
293−/*
294− * Old API:
295− * hmm_pfn_to_page()
296− * hmm_pfn_to_pfn()
297− * hmm_pfn_from_page()
298− * hmm_pfn_from_pfn()
299− *
300− * This are the OLD API please use new API, it is here to avoid cross-tree
301− * merge painfullness ie we convert things to new API in stages.
302− */
303−static inline struct page *hmm_pfn_to_page(const struct hmm_range *range,
304− uint64_t pfn)
305−{
306− return hmm_device_entry_to_page(range, pfn);
307−}
308−
309−static inline unsigned long hmm_pfn_to_pfn(const struct hmm_range *range,
310− uint64_t pfn)
311−{
312− return hmm_device_entry_to_pfn(range, pfn);
313−}
314−
315−static inline uint64_t hmm_pfn_from_page(const struct hmm_range *range,
316− struct page *page)
317−{
318− return hmm_device_entry_from_page(range, page);
319−}
320−
321−static inline uint64_t hmm_pfn_from_pfn(const struct hmm_range *range,
322− unsigned long pfn)
323−{
324− return hmm_device_entry_from_pfn(range, pfn);
325−}
326−
327267 /*
328268 * Mirroring: how to synchronize device page table with CPU page table.
329269 *
@@ -374,29 +314,6 @@ static inline uint64_t hmm_pfn_from_pfn(const struct hmm_range *range, · 44 unmodified lines
374314
375315 struct hmm_mirror;
376316
377−/*
378− * enum hmm_update_event - type of update
379− * @HMM_UPDATE_INVALIDATE: invalidate range (no indication as to why)
380− */
381−enum hmm_update_event {
382− HMM_UPDATE_INVALIDATE,
383−};
384−
385−/*
386− * struct hmm_update - HMM update information for callback
387− *
388− * @start: virtual start address of the range to update
389− * @end: virtual end address of the range to update
390− * @event: event triggering the update (what is happening)
391− * @blockable: can the callback block/sleep ?
392− */
393−struct hmm_update {
394− unsigned long start;
395− unsigned long end;
396− enum hmm_update_event event;
397− bool blockable;
398−};
399−
400317 /*
401318 * struct hmm_mirror_ops - HMM mirror device operations callback
402319 *
@@ -417,9 +334,9 @@ struct hmm_mirror_ops { · 14 unmodified lines
417334 /* sync_cpu_device_pagetables() - synchronize page tables
418335 *
419336 * @mirror: pointer to struct hmm_mirror
420− * @update: update information (see struct hmm_update)
421− * Return: -EAGAIN if update.blockable false and callback need to
422− * block, 0 otherwise.
337+ * @update: update information (see struct mmu_notifier_range)
338+ * Return: -EAGAIN if mmu_notifier_range_blockable(update) is false
339+ * and callback needs to block, 0 otherwise.
423340 *
424341 * This callback ultimately originates from mmu_notifiers when the CPU
425342 * page table is updated. The device driver must update its page table
@@ -430,8 +347,9 @@ struct hmm_mirror_ops { · 4 unmodified lines
430347 * page tables are completely updated (TLBs flushed, etc); this is a
431348 * synchronous call.
432349 */
433− int (*sync_cpu_device_pagetables)(struct hmm_mirror *mirror,
434− const struct hmm_update *update);
350+ int (*sync_cpu_device_pagetables)(
351+ struct hmm_mirror *mirror,
352+ const struct mmu_notifier_range *update);
435353 };
436354
437355 /*
@@ -457,20 +375,24 @@ void hmm_mirror_unregister(struct hmm_mirror *mirror); · 19 unmodified lines
457375 /*
458376 * Please see Documentation/vm/hmm.rst for how to use the range API.
459377 */
460−int hmm_range_register(struct hmm_range *range,
461− struct hmm_mirror *mirror,
462− unsigned long start,
463− unsigned long end,
464− unsigned page_shift);
378+int hmm_range_register(struct hmm_range *range, struct hmm_mirror *mirror);
465379 void hmm_range_unregister(struct hmm_range *range);
466−long hmm_range_snapshot(struct hmm_range *range);
467−long hmm_range_fault(struct hmm_range *range, bool block);
380+
381+/*
382+ * Retry fault if non-blocking, drop mmap_sem and return -EAGAIN in that case.
383+ */
384+#define HMM_FAULT_ALLOW_RETRY (1 << 0)
385+
386+/* Don't fault in missing PTEs, just snapshot the current state. */
387+#define HMM_FAULT_SNAPSHOT (1 << 1)
388+
389+long hmm_range_fault(struct hmm_range *range, unsigned int flags);
390+
468391 long hmm_range_dma_map(struct hmm_range *range,
469392 struct device *device,
470393 dma_addr_t *daddrs,
471− bool block);
394+ unsigned int flags);
472395 long hmm_range_dma_unmap(struct hmm_range *range,
473− struct vm_area_struct *vma,
474396 struct device *device,
475397 dma_addr_t *daddrs,
476398 bool dirty);
@@ -484,67 +406,6 @@ long hmm_range_dma_unmap(struct hmm_range *range, · 7 unmodified lines
484406 */
485407 #define HMM_RANGE_DEFAULT_TIMEOUT 1000
486408
487−/* This is a temporary helper to avoid merge conflict between trees. */
488−static inline bool hmm_vma_range_done(struct hmm_range *range)
489−{
490− bool ret = hmm_range_valid(range);
491−
492− hmm_range_unregister(range);
493− return ret;
494−}
495−
496−/* This is a temporary helper to avoid merge conflict between trees. */
497−static inline int hmm_vma_fault(struct hmm_mirror *mirror,
498− struct hmm_range *range, bool block)
499−{
500− long ret;
501−
502− /*
503− * With the old API the driver must set each individual entries with
504− * the requested flags (valid, write, ...). So here we set the mask to
505− * keep intact the entries provided by the driver and zero out the
506− * default_flags.
507− */
508− range->default_flags = 0;
509− range->pfn_flags_mask = -1UL;
510−
511− ret = hmm_range_register(range, mirror,
512− range->start, range->end,
513− PAGE_SHIFT);
514− if (ret)
515− return (int)ret;
516−
517− if (!hmm_range_wait_until_valid(range, HMM_RANGE_DEFAULT_TIMEOUT)) {
518− /*
519− * The mmap_sem was taken by driver we release it here and
520− * returns -EAGAIN which correspond to mmap_sem have been
521− * drop in the old API.
522− */
523− up_read(&range->vma->vm_mm->mmap_sem);
524− return -EAGAIN;
525− }
526−
527− ret = hmm_range_fault(range, block);
528− if (ret <= 0) {
529− if (ret == -EBUSY || !ret) {
530− /* Same as above, drop mmap_sem to match old API. */
531− up_read(&range->vma->vm_mm->mmap_sem);
532− ret = -EBUSY;
533− } else if (ret == -EAGAIN)
534− ret = -EBUSY;
535− hmm_range_unregister(range);
536− return ret;
537− }
538− return 0;
539−}
540−
541−/* Below are for HMM internal use only! Not to be used by device driver! */
542−static inline void hmm_mm_init(struct mm_struct *mm)
543−{
544− mm->hmm = NULL;
545−}
546−#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */
547−static inline void hmm_mm_init(struct mm_struct *mm) {}
548409 #endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
549410
550411 #endif /* LINUX_HMM_H */
include/linux/hrtimer.h+44−4
@@ -32,12 +32,15 @@ struct hrtimer_cpu_base; · 31 unmodified lines
3232 * when starting the timer)
3333 * HRTIMER_MODE_SOFT - Timer callback function will be executed in
3434 * soft irq context
35+ * HRTIMER_MODE_HARD - Timer callback function will be executed in
36+ * hard irq context even on PREEMPT_RT.
3537 */
3638 enum hrtimer_mode {
3739 HRTIMER_MODE_ABS = 0x00,
3840 HRTIMER_MODE_REL = 0x01,
3941 HRTIMER_MODE_PINNED = 0x02,
4042 HRTIMER_MODE_SOFT = 0x04,
43+ HRTIMER_MODE_HARD = 0x08,
4144
4245 HRTIMER_MODE_ABS_PINNED = HRTIMER_MODE_ABS | HRTIMER_MODE_PINNED,
4346 HRTIMER_MODE_REL_PINNED = HRTIMER_MODE_REL | HRTIMER_MODE_PINNED,
@@ -48,6 +51,11 @@ enum hrtimer_mode { · 4 unmodified lines
4851 HRTIMER_MODE_ABS_PINNED_SOFT = HRTIMER_MODE_ABS_PINNED | HRTIMER_MODE_SOFT,
4952 HRTIMER_MODE_REL_PINNED_SOFT = HRTIMER_MODE_REL_PINNED | HRTIMER_MODE_SOFT,
5053
54+ HRTIMER_MODE_ABS_HARD = HRTIMER_MODE_ABS | HRTIMER_MODE_HARD,
55+ HRTIMER_MODE_REL_HARD = HRTIMER_MODE_REL | HRTIMER_MODE_HARD,
56+
57+ HRTIMER_MODE_ABS_PINNED_HARD = HRTIMER_MODE_ABS_PINNED | HRTIMER_MODE_HARD,
58+ HRTIMER_MODE_REL_PINNED_HARD = HRTIMER_MODE_REL_PINNED | HRTIMER_MODE_HARD,
5159 };
5260
5361 /*
@@ -101,6 +109,8 @@ enum hrtimer_restart { · 47 unmodified lines
101109 * @state: state information (See bit values above)
102110 * @is_rel: Set if the timer was armed relative
103111 * @is_soft: Set if hrtimer will be expired in soft interrupt context.
112+ * @is_hard: Set if hrtimer will be expired in hard interrupt context
113+ * even on RT.
104114 *
105115 * The hrtimer structure must be initialized by hrtimer_init()
106116 */
@@ -112,6 +122,7 @@ struct hrtimer { · 5 unmodified lines
112122 u8 state;
113123 u8 is_rel;
114124 u8 is_soft;
125+ u8 is_hard;
115126 };
116127
117128 /**
@@ -183,6 +194,10 @@ enum hrtimer_base_type { · 65 unmodified lines
183194 * @nr_retries: Total number of hrtimer interrupt retries
184195 * @nr_hangs: Total number of hrtimer interrupt hangs
185196 * @max_hang_time: Maximum time spent in hrtimer_interrupt
197+ * @softirq_expiry_lock: Lock which is taken while softirq based hrtimer are
198+ * expired
199+ * @timer_waiters: A hrtimer_cancel() invocation waits for the timer
200+ * callback to finish.
186201 * @expires_next: absolute time of the next event, is required for remote
187202 * hrtimer enqueue; it is the total first expiry time (hard
188203 * and soft hrtimer are taken into account)
@@ -209,6 +224,10 @@ struct hrtimer_cpu_base { · 20 unmodified lines
209224 unsigned short nr_retries;
210225 unsigned short nr_hangs;
211226 unsigned int max_hang_time;
227+#endif
228+#ifdef CONFIG_PREEMPT_RT
229+ spinlock_t softirq_expiry_lock;
230+ atomic_t timer_waiters;
212231 #endif
213232 ktime_t expires_next;
214233 struct hrtimer *next_timer;
@@ -341,16 +360,29 @@ extern void hrtimers_resume(void); · 126 unmodified lines
341360
342361 DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
343362
363+#ifdef CONFIG_PREEMPT_RT
364+void hrtimer_cancel_wait_running(const struct hrtimer *timer);
365+#else
366+static inline void hrtimer_cancel_wait_running(struct hrtimer *timer)
367+{
368+ cpu_relax();
369+}
370+#endif
344371
345372 /* Exported timer functions: */
346373
347374 /* Initialize timers: */
348375 extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
349376 enum hrtimer_mode mode);
377+extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, clockid_t clock_id,
378+ enum hrtimer_mode mode);
350379
351380 #ifdef CONFIG_DEBUG_OBJECTS_TIMERS
352381 extern void hrtimer_init_on_stack(struct hrtimer *timer, clockid_t which_clock,
353382 enum hrtimer_mode mode);
383+extern void hrtimer_init_sleeper_on_stack(struct hrtimer_sleeper *sl,
384+ clockid_t clock_id,
385+ enum hrtimer_mode mode);
354386
355387 extern void destroy_hrtimer_on_stack(struct hrtimer *timer);
356388 #else
@@ -360,6 +392,14 @@ static inline void hrtimer_init_on_stack(struct hrtimer *timer, · 3 unmodified lines
360392 {
361393 hrtimer_init(timer, which_clock, mode);
362394 }
395+
396+static inline void hrtimer_init_sleeper_on_stack(struct hrtimer_sleeper *sl,
397+ clockid_t clock_id,
398+ enum hrtimer_mode mode)
399+{
400+ hrtimer_init_sleeper(sl, clock_id, mode);
401+}
402+
363403 static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { }
364404 #endif
365405
@@ -395,6 +435,9 @@ static inline void hrtimer_start_expires(struct hrtimer *timer, · 29 unmodified lines
395435 hrtimer_start_range_ns(timer, soft, delta, mode);
396436 }
397437
438+void hrtimer_sleeper_start_expires(struct hrtimer_sleeper *sl,
439+ enum hrtimer_mode mode);
440+
398441 static inline void hrtimer_restart(struct hrtimer *timer)
399442 {
400443 hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
@@ -463,11 +506,8 @@ extern long hrtimer_nanosleep(const struct timespec64 *rqtp, · 62 unmodified lines
463506 const enum hrtimer_mode mode,
464507 const clockid_t clockid);
465508
466−extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
467− struct task_struct *tsk);
468−
469509 extern int schedule_hrtimeout_range(ktime_t *expires, u64 delta,
470− const enum hrtimer_mode mode);
510+ const enum hrtimer_mode mode);
471511 extern int schedule_hrtimeout_range_clock(ktime_t *expires,
472512 u64 delta,
473513 const enum hrtimer_mode mode,
include/linux/huge_mm.h+15−1
@@ -108,7 +108,12 @@ static inline bool __transparent_hugepage_enabled(struct vm_area_struct *vma) · 107 unmodified lines
108108
109109 if (transparent_hugepage_flags & (1 << TRANSPARENT_HUGEPAGE_FLAG))
110110 return true;
111−
111+ /*
112+ * For dax vmas, try to always use hugepage mappings. If the kernel does
113+ * not support hugepages, fsdax mappings will fallback to PAGE_SIZE
114+ * mappings, and device-dax namespaces, that try to guarantee a given
115+ * mapping size, will fail to enable
116+ */
112117 if (vma_is_dax(vma))
113118 return true;
114119
@@ -267,6 +272,15 @@ static inline bool thp_migration_supported(void) · 152 unmodified lines
267272 return IS_ENABLED(CONFIG_ARCH_ENABLE_THP_MIGRATION);
268273 }
269274
275+static inline struct list_head *page_deferred_list(struct page *page)
276+{
277+ /*
278+ * Global or memcg deferred list in the second tail pages is
279+ * occupied by compound_head.
280+ */
281+ return &page[2].deferred_list;
282+}
283+
270284 #else /* CONFIG_TRANSPARENT_HUGEPAGE */
271285 #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
272286 #define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })
include/linux/hugetlb.h+1−1
@@ -454,7 +454,7 @@ static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma, · 453 unmodified lines
454454 static inline struct hstate *page_hstate(struct page *page)
455455 {
456456 VM_BUG_ON_PAGE(!PageHuge(page), page);
457− return size_to_hstate(PAGE_SIZE << compound_order(page));
457+ return size_to_hstate(page_size(page));
458458 }
459459
460460 static inline unsigned hstate_index_to_shift(unsigned index)
include/linux/hyperv.h+44−1
@@ -245,7 +245,10 @@ struct vmbus_channel_offer { · 244 unmodified lines
245245 } pipe;
246246 } u;
247247 /*
248− * The sub_channel_index is defined in win8.
248+ * The sub_channel_index is defined in Win8: a value of zero means a
249+ * primary channel and a value of non-zero means a sub-channel.
250+ *
251+ * Before Win8, the field is reserved, meaning it's always zero.
249252 */
250253 u16 sub_channel_index;
251254 u16 reserved3;
@@ -423,6 +426,9 @@ enum vmbus_channel_message_type { · 171 unmodified lines
423426 CHANNELMSG_COUNT
424427 };
425428
429+/* Hyper-V supports about 2048 channels, and the RELIDs start with 1. */
430+#define INVALID_RELID U32_MAX
431+
426432 struct vmbus_channel_message_header {
427433 enum vmbus_channel_message_type msgtype;
428434 u32 padding;
@@ -934,6 +940,11 @@ static inline bool is_hvsock_channel(const struct vmbus_channel *c) · 505 unmodified lines
934940 VMBUS_CHANNEL_TLNPI_PROVIDER_OFFER);
935941 }
936942
943+static inline bool is_sub_channel(const struct vmbus_channel *c)
944+{
945+ return c->offermsg.offer.sub_channel_index != 0;
946+}
947+
937948 static inline void set_channel_affinity_state(struct vmbus_channel *c,
938949 enum hv_numa_policy policy)
939950 {
@@ -1149,6 +1160,9 @@ struct hv_driver { · 209 unmodified lines
11491160 int (*remove)(struct hv_device *);
11501161 void (*shutdown)(struct hv_device *);
11511162
1163+ int (*suspend)(struct hv_device *);
1164+ int (*resume)(struct hv_device *);
1165+
11521166 };
11531167
11541168 /* Base device object */
@@ -1578,4 +1592,33 @@ hv_pkt_iter_next(struct vmbus_channel *channel, · 423 unmodified lines
15781592 for (pkt = hv_pkt_iter_first(channel); pkt; \
15791593 pkt = hv_pkt_iter_next(channel, pkt))
15801594
1595+/*
1596+ * Interface for passing data between SR-IOV PF and VF drivers. The VF driver
1597+ * sends requests to read and write blocks. Each block must be 128 bytes or
1598+ * smaller. Optionally, the VF driver can register a callback function which
1599+ * will be invoked when the host says that one or more of the first 64 block
1600+ * IDs is "invalid" which means that the VF driver should reread them.
1601+ */
1602+#define HV_CONFIG_BLOCK_SIZE_MAX 128
1603+
1604+int hyperv_read_cfg_blk(struct pci_dev *dev, void *buf, unsigned int buf_len,
1605+ unsigned int block_id, unsigned int *bytes_returned);
1606+int hyperv_write_cfg_blk(struct pci_dev *dev, void *buf, unsigned int len,
1607+ unsigned int block_id);
1608+int hyperv_reg_block_invalidate(struct pci_dev *dev, void *context,
1609+ void (*block_invalidate)(void *context,
1610+ u64 block_mask));
1611+
1612+struct hyperv_pci_block_ops {
1613+ int (*read_block)(struct pci_dev *dev, void *buf, unsigned int buf_len,
1614+ unsigned int block_id, unsigned int *bytes_returned);
1615+ int (*write_block)(struct pci_dev *dev, void *buf, unsigned int len,
1616+ unsigned int block_id);
1617+ int (*reg_blk_invalidate)(struct pci_dev *dev, void *context,
1618+ void (*block_invalidate)(void *context,
1619+ u64 block_mask));
1620+};
1621+
1622+extern struct hyperv_pci_block_ops hvpci_block_ops;
1623+
15811624 #endif /* _HYPERV_H */
include/linux/i2c.h+2−2
@@ -473,7 +473,7 @@ extern struct i2c_client * · 472 unmodified lines
473473 devm_i2c_new_dummy_device(struct device *dev, struct i2c_adapter *adap, u16 address);
474474
475475 extern struct i2c_client *
476−i2c_new_secondary_device(struct i2c_client *client,
476+i2c_new_ancillary_device(struct i2c_client *client,
477477 const char *name,
478478 u16 default_addr);
479479
@@ -521,7 +521,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info, · 41 unmodified lines
521521 *
522522 * The return codes from the @master_xfer{_atomic} fields should indicate the
523523 * type of error code that occurred during the transfer, as documented in the
524− * Kernel Documentation file Documentation/i2c/fault-codes.
524+ * Kernel Documentation file Documentation/i2c/fault-codes.rst.
525525 */
526526 struct i2c_algorithm {
527527 /*
include/linux/i3c/device.h+4−0
@@ -188,6 +188,10 @@ static inline struct i3c_driver *drv_to_i3cdrv(struct device_driver *drv) · 187 unmodified lines
188188 struct device *i3cdev_to_dev(struct i3c_device *i3cdev);
189189 struct i3c_device *dev_to_i3cdev(struct device *dev);
190190
191+const struct i3c_device_id *
192+i3c_device_match_id(struct i3c_device *i3cdev,
193+ const struct i3c_device_id *id_table);
194+
191195 static inline void i3cdev_set_drvdata(struct i3c_device *i3cdev,
192196 void *data)
193197 {
include/linux/i3c/master.h+5−0
@@ -71,6 +71,9 @@ struct i2c_dev_boardinfo { · 70 unmodified lines
7171 * @common: common part of the I2C device descriptor
7272 * @boardinfo: pointer to the boardinfo attached to this I2C device
7373 * @dev: I2C device object registered to the I2C framework
74+ * @addr: I2C device address
75+ * @lvr: LVR (Legacy Virtual Register) needed by the I3C core to know about
76+ * the I2C device limitations
7477 *
7578 * Each I2C device connected on the bus will have an i2c_dev_desc.
7679 * This object is created by the core and later attached to the controller
@@ -84,6 +87,8 @@ struct i2c_dev_desc { · 7 unmodified lines
8487 struct i3c_i2c_dev_desc common;
8588 const struct i2c_dev_boardinfo *boardinfo;
8689 struct i2c_client *dev;
90+ u16 addr;
91+ u8 lvr;
8792 };
8893
8994 /**
include/linux/idle_inject.h+4−4
@@ -20,10 +20,10 @@ int idle_inject_start(struct idle_inject_device *ii_dev); · 19 unmodified lines
2020 void idle_inject_stop(struct idle_inject_device *ii_dev);
2121
2222 void idle_inject_set_duration(struct idle_inject_device *ii_dev,
23− unsigned int run_duration_ms,
24− unsigned int idle_duration_ms);
23+ unsigned int run_duration_us,
24+ unsigned int idle_duration_us);
2525
2626 void idle_inject_get_duration(struct idle_inject_device *ii_dev,
27− unsigned int *run_duration_ms,
28− unsigned int *idle_duration_ms);
27+ unsigned int *run_duration_us,
28+ unsigned int *idle_duration_us);
2929 #endif /* __IDLE_INJECT_H__ */
include/linux/ieee80211.h+61−2
@@ -881,6 +881,14 @@ struct ieee80211_tpc_report_ie { · 880 unmodified lines
881881 u8 link_margin;
882882 } __packed;
883883
884+#define IEEE80211_ADDBA_EXT_FRAG_LEVEL_MASK GENMASK(2, 1)
885+#define IEEE80211_ADDBA_EXT_FRAG_LEVEL_SHIFT 1
886+#define IEEE80211_ADDBA_EXT_NO_FRAG BIT(0)
887+
888+struct ieee80211_addba_ext_ie {
889+ u8 data;
890+} __packed;
891+
884892 struct ieee80211_mgmt {
885893 __le16 frame_control;
886894 __le16 duration;
@@ -973,6 +981,8 @@ struct ieee80211_mgmt { · 86 unmodified lines
973981 __le16 capab;
974982 __le16 timeout;
975983 __le16 start_seq_num;
984+ /* followed by BA Extension */
985+ u8 variable[0];
976986 } __packed addba_req;
977987 struct{
978988 u8 action_code;
@@ -1625,6 +1635,18 @@ struct ieee80211_he_operation { · 646 unmodified lines
16251635 u8 optional[0];
16261636 } __packed;
16271637
1638+/**
1639+ * struct ieee80211_he_spr - HE spatial reuse element
1640+ *
1641+ * This structure is the "HE spatial reuse element" element as
1642+ * described in P802.11ax_D4.0 section 9.4.2.241
1643+ */
1644+struct ieee80211_he_spr {
1645+ u8 he_sr_control;
1646+ /* Optional 0 to 19 bytes: depends on @he_sr_control */
1647+ u8 optional[0];
1648+} __packed;
1649+
16281650 /**
16291651 * struct ieee80211_he_mu_edca_param_ac_rec - MU AC Parameter Record field
16301652 *
@@ -2033,8 +2055,8 @@ ieee80211_he_ppe_size(u8 ppe_thres_hdr, const u8 *phy_cap_info) · 402 unmodified lines
20332055 * ieee80211_he_oper_size - calculate 802.11ax HE Operations IE size
20342056 * @he_oper_ie: byte data of the He Operations IE, stating from the the byte
20352057 * after the ext ID byte. It is assumed that he_oper_ie has at least
2036− * sizeof(struct ieee80211_he_operation) bytes, checked already in
2037− * ieee802_11_parse_elems_crc()
2058+ * sizeof(struct ieee80211_he_operation) bytes, the caller must have
2059+ * validated this.
20382060 * @return the actual size of the IE data (not including header), or 0 on error
20392061 */
20402062 static inline u8
@@ -2063,6 +2085,42 @@ ieee80211_he_oper_size(const u8 *he_oper_ie) · 22 unmodified lines
20632085 return oper_len;
20642086 }
20652087
2088+/* HE Spatial Reuse defines */
2089+#define IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT 0x4
2090+#define IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT 0x8
2091+
2092+/*
2093+ * ieee80211_he_spr_size - calculate 802.11ax HE Spatial Reuse IE size
2094+ * @he_spr_ie: byte data of the He Spatial Reuse IE, stating from the the byte
2095+ * after the ext ID byte. It is assumed that he_spr_ie has at least
2096+ * sizeof(struct ieee80211_he_spr) bytes, the caller must have validated
2097+ * this
2098+ * @return the actual size of the IE data (not including header), or 0 on error
2099+ */
2100+static inline u8
2101+ieee80211_he_spr_size(const u8 *he_spr_ie)
2102+{
2103+ struct ieee80211_he_spr *he_spr = (void *)he_spr_ie;
2104+ u8 spr_len = sizeof(struct ieee80211_he_spr);
2105+ u32 he_spr_params;
2106+
2107+ /* Make sure the input is not NULL */
2108+ if (!he_spr_ie)
2109+ return 0;
2110+
2111+ /* Calc required length */
2112+ he_spr_params = le32_to_cpu(he_spr->he_sr_control);
2113+ if (he_spr_params & IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT)
2114+ spr_len++;
2115+ if (he_spr_params & IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT)
2116+ spr_len += 18;
2117+
2118+ /* Add the first byte (extension ID) to the total length */
2119+ spr_len++;
2120+
2121+ return spr_len;
2122+}
2123+
20662124 /* Authentication algorithms */
20672125 #define WLAN_AUTH_OPEN 0
20682126 #define WLAN_AUTH_SHARED_KEY 1
@@ -2485,6 +2543,7 @@ enum ieee80211_eid_ext { · 416 unmodified lines
24852543 WLAN_EID_EXT_HE_OPERATION = 36,
24862544 WLAN_EID_EXT_UORA = 37,
24872545 WLAN_EID_EXT_HE_MU_EDCA = 38,
2546+ WLAN_EID_EXT_HE_SPR = 39,
24882547 WLAN_EID_EXT_MAX_CHANNEL_SWITCH_TIME = 52,
24892548 WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION = 55,
24902549 WLAN_EID_EXT_NON_INHERITANCE = 56,
include/linux/if_pppox.h+3−0
@@ -80,6 +80,9 @@ extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp); · 79 unmodified lines
8080 extern void unregister_pppox_proto(int proto_num);
8181 extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
8282 extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
83+extern int pppox_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
84+
85+#define PPPOEIOCSFWD32 _IOW(0xB1 ,0, compat_size_t)
8386
8487 /* PPPoX socket states */
8588 enum {
include/linux/if_rmnet.h+2−2
@@ -41,11 +41,11 @@ struct rmnet_map_ul_csum_header { · 40 unmodified lines
4141 __be16 csum_start_offset;
4242 #if defined(__LITTLE_ENDIAN_BITFIELD)
4343 u16 csum_insert_offset:14;
44− u16 udp_ip4_ind:1;
44+ u16 udp_ind:1;
4545 u16 csum_enabled:1;
4646 #elif defined (__BIG_ENDIAN_BITFIELD)
4747 u16 csum_enabled:1;
48− u16 udp_ip4_ind:1;
48+ u16 udp_ind:1;
4949 u16 csum_insert_offset:14;
5050 #else
5151 #error "Please fix <asm/byteorder.h>"
include/linux/iio/common/cros_ec_sensors_core.h+28−3
@@ -10,7 +10,8 @@ · 9 unmodified lines
1010
1111 #include <linux/iio/iio.h>
1212 #include <linux/irqreturn.h>
13−#include <linux/mfd/cros_ec.h>
13+#include <linux/platform_data/cros_ec_commands.h>
14+#include <linux/platform_data/cros_ec_proto.h>
1415
1516 enum {
1617 CROS_EC_SENSOR_X,
@@ -62,14 +63,20 @@ struct cros_ec_sensors_core_state { · 45 unmodified lines
6263 enum motionsensor_type type;
6364 enum motionsensor_location loc;
6465
65− s16 calib[CROS_EC_SENSOR_MAX_AXIS];
66−
66+ struct calib_data {
67+ s16 offset;
68+ u16 scale;
69+ } calib[CROS_EC_SENSOR_MAX_AXIS];
70+ s8 sign[CROS_EC_SENSOR_MAX_AXIS];
6771 u8 samples[CROS_EC_SAMPLE_SIZE];
6872
6973 int (*read_ec_sensors_data)(struct iio_dev *indio_dev,
7074 unsigned long scan_mask, s16 *data);
7175
7276 int curr_sampl_freq;
77+
78+ /* Table of known available frequencies : 0, Min and Max in mHz */
79+ int frequencies[3];
7380 };
7481
7582 /**
@@ -150,6 +157,24 @@ int cros_ec_sensors_core_read(struct cros_ec_sensors_core_state *st, · 74 unmodified lines
150157 struct iio_chan_spec const *chan,
151158 int *val, int *val2, long mask);
152159
160+/**
161+ * cros_ec_sensors_core_read_avail() - get available values
162+ * @indio_dev: pointer to state information for device
163+ * @chan: channel specification structure table
164+ * @vals: list of available values
165+ * @type: type of data returned
166+ * @length: number of data returned in the array
167+ * @mask: specifies which values to be requested
168+ *
169+ * Return: an error code, IIO_AVAIL_RANGE or IIO_AVAIL_LIST
170+ */
171+int cros_ec_sensors_core_read_avail(struct iio_dev *indio_dev,
172+ struct iio_chan_spec const *chan,
173+ const int **vals,
174+ int *type,
175+ int *length,
176+ long mask);
177+
153178 /**
154179 * cros_ec_sensors_core_write() - function to write a value to the sensor
155180 * @st: pointer to state information for device
include/linux/iio/common/st_sensors.h+19−47
@@ -16,11 +16,16 @@ · 15 unmodified lines
1616 #include <linux/iio/trigger.h>
1717 #include <linux/bitops.h>
1818 #include <linux/regulator/consumer.h>
19+#include <linux/regmap.h>
1920
2021 #include <linux/platform_data/st_sensors_pdata.h>
2122
22−#define ST_SENSORS_TX_MAX_LENGTH 2
23−#define ST_SENSORS_RX_MAX_LENGTH 6
23+/*
24+ * Buffer size max case: 2bytes per channel, 3 channels in total +
25+ * 8bytes timestamp channel (s64)
26+ */
27+#define ST_SENSORS_MAX_BUFFER_SIZE (ALIGN(2 * 3, sizeof(s64)) + \
28+ sizeof(s64))
2429
2530 #define ST_SENSORS_ODR_LIST_MAX 10
2631 #define ST_SENSORS_FULLSCALE_AVL_MAX 10
@@ -169,36 +174,6 @@ struct st_sensor_data_ready_irq { · 142 unmodified lines
169174 } ig1;
170175 };
171176
172−/**
173− * struct st_sensor_transfer_buffer - ST sensor device I/O buffer
174− * @buf_lock: Mutex to protect rx and tx buffers.
175− * @tx_buf: Buffer used by SPI transfer function to send data to the sensors.
176− * This buffer is used to avoid DMA not-aligned issue.
177− * @rx_buf: Buffer used by SPI transfer to receive data from sensors.
178− * This buffer is used to avoid DMA not-aligned issue.
179− */
180−struct st_sensor_transfer_buffer {
181− struct mutex buf_lock;
182− u8 rx_buf[ST_SENSORS_RX_MAX_LENGTH];
183− u8 tx_buf[ST_SENSORS_TX_MAX_LENGTH] ____cacheline_aligned;
184−};
185−
186−/**
187− * struct st_sensor_transfer_function - ST sensor device I/O function
188− * @read_byte: Function used to read one byte.
189− * @write_byte: Function used to write one byte.
190− * @read_multiple_byte: Function used to read multiple byte.
191− */
192−struct st_sensor_transfer_function {
193− int (*read_byte) (struct st_sensor_transfer_buffer *tb,
194− struct device *dev, u8 reg_addr, u8 *res_byte);
195− int (*write_byte) (struct st_sensor_transfer_buffer *tb,
196− struct device *dev, u8 reg_addr, u8 data);
197− int (*read_multiple_byte) (struct st_sensor_transfer_buffer *tb,
198− struct device *dev, u8 reg_addr, int len, u8 *data,
199− bool multiread_bit);
200−};
201−
202177 /**
203178 * struct st_sensor_settings - ST specific sensor settings
204179 * @wai: Contents of WhoAmI register.
@@ -242,19 +217,17 @@ struct st_sensor_settings { · 37 unmodified lines
242217 * @current_fullscale: Maximum range of measure by the sensor.
243218 * @vdd: Pointer to sensor's Vdd power supply
244219 * @vdd_io: Pointer to sensor's Vdd-IO power supply
220+ * @regmap: Pointer to specific sensor regmap configuration.
245221 * @enabled: Status of the sensor (false->off, true->on).
246− * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread.
247− * @buffer_data: Data used by buffer part.
248222 * @odr: Output data rate of the sensor [Hz].
249223 * num_data_channels: Number of data channels used in buffer.
250224 * @drdy_int_pin: Redirect DRDY on pin 1 (1) or pin 2 (2).
251225 * @int_pin_open_drain: Set the interrupt/DRDY to open drain.
252− * @get_irq_data_ready: Function to get the IRQ used for data ready signal.
253− * @tf: Transfer function structure used by I/O operations.
254− * @tb: Transfer buffers and mutex used by I/O operations.
226+ * @irq: the IRQ number.
255227 * @edge_irq: the IRQ triggers on edges and need special handling.
256228 * @hw_irq_trigger: if we're using the hardware interrupt on the sensor.
257229 * @hw_timestamp: Latest timestamp from the interrupt handler, when in use.
230+ * @buffer_data: Data used by buffer part.
258231 */
259232 struct st_sensor_data {
260233 struct device *dev;
@@ -264,26 +237,22 @@ struct st_sensor_data { · 3 unmodified lines
264237 struct st_sensor_fullscale_avl *current_fullscale;
265238 struct regulator *vdd;
266239 struct regulator *vdd_io;
240+ struct regmap *regmap;
267241
268242 bool enabled;
269− bool multiread_bit;
270−
271− char *buffer_data;
272243
273244 unsigned int odr;
274245 unsigned int num_data_channels;
275246
276247 u8 drdy_int_pin;
277248 bool int_pin_open_drain;
278−
279− unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev);
280−
281− const struct st_sensor_transfer_function *tf;
282− struct st_sensor_transfer_buffer tb;
249+ int irq;
283250
284251 bool edge_irq;
285252 bool hw_irq_trigger;
286253 s64 hw_timestamp;
254+
255+ char buffer_data[ST_SENSORS_MAX_BUFFER_SIZE] ____cacheline_aligned;
287256 };
288257
289258 #ifdef CONFIG_IIO_BUFFER
@@ -334,8 +303,11 @@ int st_sensors_set_fullscale_by_gain(struct iio_dev *indio_dev, int scale); · 44 unmodified lines
334303 int st_sensors_read_info_raw(struct iio_dev *indio_dev,
335304 struct iio_chan_spec const *ch, int *val);
336305
337−int st_sensors_check_device_support(struct iio_dev *indio_dev,
338− int num_sensors_list, const struct st_sensor_settings *sensor_settings);
306+int st_sensors_get_settings_index(const char *name,
307+ const struct st_sensor_settings *list,
308+ const int list_length);
309+
310+int st_sensors_verify_id(struct iio_dev *indio_dev);
339311
340312 ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev,
341313 struct device_attribute *attr, char *buf);
include/linux/iio/common/st_sensors_i2c.h+2−2
@@ -14,8 +14,8 @@ · 13 unmodified lines
1414 #include <linux/iio/common/st_sensors.h>
1515 #include <linux/of.h>
1616
17−void st_sensors_i2c_configure(struct iio_dev *indio_dev,
18− struct i2c_client *client, struct st_sensor_data *sdata);
17+int st_sensors_i2c_configure(struct iio_dev *indio_dev,
18+ struct i2c_client *client);
1919
2020 #ifdef CONFIG_ACPI
2121 int st_sensors_match_acpi_device(struct device *dev);
include/linux/iio/common/st_sensors_spi.h+2−2
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 #include <linux/spi/spi.h>
1414 #include <linux/iio/common/st_sensors.h>
1515
16−void st_sensors_spi_configure(struct iio_dev *indio_dev,
17− struct spi_device *spi, struct st_sensor_data *sdata);
16+int st_sensors_spi_configure(struct iio_dev *indio_dev,
17+ struct spi_device *spi);
1818
1919 #endif /* ST_SENSORS_SPI_H */
include/linux/iio/imu/adis.h+2−0
@@ -26,6 +26,7 @@ struct adis_burst; · 25 unmodified lines
2626 * struct adis_data - ADIS chip variant specific data
2727 * @read_delay: SPI delay for read operations in us
2828 * @write_delay: SPI delay for write operations in us
29+ * @cs_change_delay: SPI delay between CS changes in us
2930 * @glob_cmd_reg: Register address of the GLOB_CMD register
3031 * @msc_ctrl_reg: Register address of the MSC_CTRL register
3132 * @diag_stat_reg: Register address of the DIAG_STAT register
@@ -35,6 +36,7 @@ struct adis_burst; · 3 unmodified lines
3536 struct adis_data {
3637 unsigned int read_delay;
3738 unsigned int write_delay;
39+ unsigned int cs_change_delay;
3840
3941 unsigned int glob_cmd_reg;
4042 unsigned int msc_ctrl_reg;
include/linux/ima.h+9−0
@@ -131,4 +131,13 @@ static inline int ima_inode_removexattr(struct dentry *dentry, · 130 unmodified lines
131131 return 0;
132132 }
133133 #endif /* CONFIG_IMA_APPRAISE */
134+
135+#if defined(CONFIG_IMA_APPRAISE) && defined(CONFIG_INTEGRITY_TRUSTED_KEYRING)
136+extern bool ima_appraise_signature(enum kernel_read_file_id func);
137+#else
138+static inline bool ima_appraise_signature(enum kernel_read_file_id func)
139+{
140+ return false;
141+}
142+#endif /* CONFIG_IMA_APPRAISE && CONFIG_INTEGRITY_TRUSTED_KEYRING */
134143 #endif /* _LINUX_IMA_H */
include/linux/init_task.h+0−11
@@ -36,17 +36,6 @@ extern struct cred init_cred; · 35 unmodified lines
3636 #define INIT_PREV_CPUTIME(x)
3737 #endif
3838
39−#ifdef CONFIG_POSIX_TIMERS
40−#define INIT_CPU_TIMERS(s) \
41− .cpu_timers = { \
42− LIST_HEAD_INIT(s.cpu_timers[0]), \
43− LIST_HEAD_INIT(s.cpu_timers[1]), \
44− LIST_HEAD_INIT(s.cpu_timers[2]), \
45− },
46−#else
47−#define INIT_CPU_TIMERS(s)
48−#endif
49−
5039 #define INIT_TASK_COMM "swapper"
5140
5241 /* Attach to the init_task data structure for proper alignment */
include/linux/input.h+26−0
@@ -21,6 +21,8 @@ · 20 unmodified lines
2121 #include <linux/timer.h>
2222 #include <linux/mod_devicetable.h>
2323
24+struct input_dev_poller;
25+
2426 /**
2527 * struct input_value - input value representation
2628 * @type: type of value (EV_KEY, EV_ABS, etc)
@@ -33,6 +35,13 @@ struct input_value { · 6 unmodified lines
3335 __s32 value;
3436 };
3537
38+enum input_clock_type {
39+ INPUT_CLK_REAL = 0,
40+ INPUT_CLK_MONO,
41+ INPUT_CLK_BOOT,
42+ INPUT_CLK_MAX
43+};
44+
3645 /**
3746 * struct input_dev - represents an input device
3847 * @name: name of the device
@@ -64,6 +73,8 @@ struct input_value { · 25 unmodified lines
6473 * not sleep
6574 * @ff: force feedback structure associated with the device if device
6675 * supports force feedback effects
76+ * @poller: poller structure associated with the device if device is
77+ * set up to use polling mode
6778 * @repeat_key: stores key code of the last key pressed; used to implement
6879 * software autorepeat
6980 * @timer: timer for software autorepeat
@@ -114,6 +125,8 @@ struct input_value { · 44 unmodified lines
114125 * @vals: array of values queued in the current frame
115126 * @devres_managed: indicates that devices is managed with devres framework
116127 * and needs not be explicitly unregistered or freed.
128+ * @timestamp: storage for a timestamp set by input_set_timestamp called
129+ * by a driver
117130 */
118131 struct input_dev {
119132 const char *name;
@@ -147,6 +160,8 @@ struct input_dev { · 27 unmodified lines
147160
148161 struct ff_device *ff;
149162
163+ struct input_dev_poller *poller;
164+
150165 unsigned int repeat_key;
151166 struct timer_list timer;
152167
@@ -184,6 +199,8 @@ struct input_dev { · 31 unmodified lines
184199 struct input_value *vals;
185200
186201 bool devres_managed;
202+
203+ ktime_t timestamp[INPUT_CLK_MAX];
187204 };
188205 #define to_input_dev(d) container_of(d, struct input_dev, dev)
189206
@@ -361,6 +378,12 @@ void input_unregister_device(struct input_dev *); · 171 unmodified lines
361378
362379 void input_reset_device(struct input_dev *);
363380
381+int input_setup_polling(struct input_dev *dev,
382+ void (*poll_fn)(struct input_dev *dev));
383+void input_set_poll_interval(struct input_dev *dev, unsigned int interval);
384+void input_set_min_poll_interval(struct input_dev *dev, unsigned int interval);
385+void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval);
386+
364387 int __must_check input_register_handler(struct input_handler *);
365388 void input_unregister_handler(struct input_handler *);
366389
@@ -382,6 +405,9 @@ void input_close_device(struct input_handle *); · 15 unmodified lines
382405
383406 int input_flush_device(struct input_handle *handle, struct file *file);
384407
408+void input_set_timestamp(struct input_dev *dev, ktime_t timestamp);
409+ktime_t *input_get_timestamp(struct input_dev *dev);
410+
385411 void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
386412 void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value);
387413
include/linux/input/bu21013.h+0−34
@@ -1,34 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/*
3− * Copyright (C) ST-Ericsson SA 2010
4− * Author: Naveen Kumar G <naveen.gaddipati@stericsson.com> for ST-Ericsson
5− */
6−
7−#ifndef _BU21013_H
8−#define _BU21013_H
9−
10−/**
11− * struct bu21013_platform_device - Handle the platform data
12− * @touch_x_max: touch x max
13− * @touch_y_max: touch y max
14− * @cs_pin: chip select pin
15− * @touch_pin: touch gpio pin
16− * @ext_clk: external clock flag
17− * @x_flip: x flip flag
18− * @y_flip: y flip flag
19− * @wakeup: wakeup flag
20− *
21− * This is used to handle the platform data
22− */
23−struct bu21013_platform_device {
24− int touch_x_max;
25− int touch_y_max;
26− unsigned int cs_pin;
27− unsigned int touch_pin;
28− bool ext_clk;
29− bool x_flip;
30− bool y_flip;
31− bool wakeup;
32−};
33−
34−#endif
include/linux/input/elan-i2c-ids.h+1−1
@@ -48,7 +48,7 @@ static const struct acpi_device_id elan_acpi_id[] = { · 47 unmodified lines
4848 { "ELAN0618", 0 },
4949 { "ELAN0619", 0 },
5050 { "ELAN061A", 0 },
51− { "ELAN061B", 0 },
51+/* { "ELAN061B", 0 }, not working on the Lenovo Legion Y7000 */
5252 { "ELAN061C", 0 },
5353 { "ELAN061D", 0 },
5454 { "ELAN061E", 0 },
include/linux/intel-iommu.h+2−3
@@ -272,6 +272,8 @@ · 271 unmodified lines
272272 #define dma_frcd_type(d) ((d >> 30) & 1)
273273 #define dma_frcd_fault_reason(c) (c & 0xff)
274274 #define dma_frcd_source_id(c) (c & 0xffff)
275+#define dma_frcd_pasid_value(c) (((c) >> 8) & 0xfffff)
276+#define dma_frcd_pasid_present(c) (((c) >> 31) & 1)
275277 /* low 64 bit */
276278 #define dma_frcd_page_addr(d) (d & (((u64)-1) << PAGE_SHIFT))
277279
@@ -346,7 +348,6 @@ enum { · 68 unmodified lines
346348 #define QI_PC_PASID_SEL (QI_PC_TYPE | QI_PC_GRAN(1))
347349
348350 #define QI_EIOTLB_ADDR(addr) ((u64)(addr) & VTD_PAGE_MASK)
349−#define QI_EIOTLB_GL(gl) (((u64)gl) << 7)
350351 #define QI_EIOTLB_IH(ih) (((u64)ih) << 6)
351352 #define QI_EIOTLB_AM(am) (((u64)am))
352353 #define QI_EIOTLB_PASID(pasid) (((u64)pasid) << 32)
@@ -378,8 +379,6 @@ enum { · 25 unmodified lines
378379 #define QI_RESP_INVALID 0x1
379380 #define QI_RESP_FAILURE 0xf
380381
381−#define QI_GRAN_ALL_ALL 0
382−#define QI_GRAN_NONG_ALL 1
383382 #define QI_GRAN_NONG_PASID 2
384383 #define QI_GRAN_PSI_PASID 3
385384
include/linux/intel_th.h+79−0
@@ -0,0 +1,79 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Intel(R) Trace Hub data structures for implementing buffer sinks.
4+ *
5+ * Copyright (C) 2019 Intel Corporation.
6+ */
7+
8+#ifndef _INTEL_TH_H_
9+#define _INTEL_TH_H_
10+
11+#include <linux/scatterlist.h>
12+
13+/* MSC operating modes (MSC_MODE) */
14+enum {
15+ MSC_MODE_SINGLE = 0,
16+ MSC_MODE_MULTI,
17+ MSC_MODE_EXI,
18+ MSC_MODE_DEBUG,
19+};
20+
21+struct msu_buffer {
22+ const char *name;
23+ /*
24+ * ->assign() called when buffer 'mode' is set to this driver
25+ * (aka mode_store())
26+ * @device: struct device * of the msc
27+ * @mode: allows the driver to set HW mode (see the enum above)
28+ * Returns: a pointer to a private structure associated with this
29+ * msc or NULL in case of error. This private structure
30+ * will then be passed into all other callbacks.
31+ */
32+ void *(*assign)(struct device *dev, int *mode);
33+ /* ->unassign(): some other mode is selected, clean up */
34+ void (*unassign)(void *priv);
35+ /*
36+ * ->alloc_window(): allocate memory for the window of a given
37+ * size
38+ * @sgt: pointer to sg_table, can be overridden by the buffer
39+ * driver, or kept intact
40+ * Returns: number of sg table entries <= number of pages;
41+ * 0 is treated as an allocation failure.
42+ */
43+ int (*alloc_window)(void *priv, struct sg_table **sgt,
44+ size_t size);
45+ void (*free_window)(void *priv, struct sg_table *sgt);
46+ /* ->activate(): trace has started */
47+ void (*activate)(void *priv);
48+ /* ->deactivate(): trace is about to stop */
49+ void (*deactivate)(void *priv);
50+ /*
51+ * ->ready(): window @sgt is filled up to the last block OR
52+ * tracing is stopped by the user; this window contains
53+ * @bytes data. The window in question transitions into
54+ * the "LOCKED" state, indicating that it can't be used
55+ * by hardware. To clear this state and make the window
56+ * available to the hardware again, call
57+ * intel_th_msc_window_unlock().
58+ */
59+ int (*ready)(void *priv, struct sg_table *sgt, size_t bytes);
60+};
61+
62+int intel_th_msu_buffer_register(const struct msu_buffer *mbuf,
63+ struct module *owner);
64+void intel_th_msu_buffer_unregister(const struct msu_buffer *mbuf);
65+void intel_th_msc_window_unlock(struct device *dev, struct sg_table *sgt);
66+
67+#define module_intel_th_msu_buffer(__buffer) \
68+static int __init __buffer##_init(void) \
69+{ \
70+ return intel_th_msu_buffer_register(&(__buffer), THIS_MODULE); \
71+} \
72+module_init(__buffer##_init); \
73+static void __exit __buffer##_exit(void) \
74+{ \
75+ intel_th_msu_buffer_unregister(&(__buffer)); \
76+} \
77+module_exit(__buffer##_exit);
78+
79+#endif /* _INTEL_TH_H_ */
include/linux/interconnect-provider.h+5−2
@@ -36,6 +36,8 @@ struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec, · 35 unmodified lines
3636 * @nodes: internal list of the interconnect provider nodes
3737 * @set: pointer to device specific set operation function
3838 * @aggregate: pointer to device specific aggregate operation function
39+ * @pre_aggregate: pointer to device specific function that is called
40+ * before the aggregation begins (optional)
3941 * @xlate: provider-specific callback for mapping nodes from phandle arguments
4042 * @dev: the device this interconnect provider belongs to
4143 * @users: count of active users
@@ -45,8 +47,9 @@ struct icc_provider { · 3 unmodified lines
4547 struct list_head provider_list;
4648 struct list_head nodes;
4749 int (*set)(struct icc_node *src, struct icc_node *dst);
48− int (*aggregate)(struct icc_node *node, u32 avg_bw, u32 peak_bw,
49− u32 *agg_avg, u32 *agg_peak);
50+ int (*aggregate)(struct icc_node *node, u32 tag, u32 avg_bw,
51+ u32 peak_bw, u32 *agg_avg, u32 *agg_peak);
52+ void (*pre_aggregate)(struct icc_node *node);
5053 struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data);
5154 struct device *dev;
5255 int users;
include/linux/interconnect.h+5−0
@@ -30,6 +30,7 @@ struct icc_path *icc_get(struct device *dev, const int src_id, · 29 unmodified lines
3030 struct icc_path *of_icc_get(struct device *dev, const char *name);
3131 void icc_put(struct icc_path *path);
3232 int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw);
33+void icc_set_tag(struct icc_path *path, u32 tag);
3334
3435 #else
3536
@@ -54,6 +55,10 @@ static inline int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw) · 18 unmodified lines
5455 return 0;
5556 }
5657
58+static inline void icc_set_tag(struct icc_path *path, u32 tag)
59+{
60+}
61+
5762 #endif /* CONFIG_INTERCONNECT */
5863
5964 #endif /* __LINUX_INTERCONNECT_H */
include/linux/interrupt.h+5−0
@@ -238,6 +238,7 @@ extern void teardown_percpu_nmi(unsigned int irq); · 237 unmodified lines
238238 /* The following three functions are for the core kernel use only. */
239239 extern void suspend_device_irqs(void);
240240 extern void resume_device_irqs(void);
241+extern void rearm_wake_irq(unsigned int irq);
241242
242243 /**
243244 * struct irq_affinity_notify - context for notification of IRQ affinity changes
@@ -472,7 +473,11 @@ extern int irq_set_irqchip_state(unsigned int irq, enum irqchip_irq_state which, · 228 unmodified lines
472473 bool state);
473474
474475 #ifdef CONFIG_IRQ_FORCED_THREADING
476+# ifdef CONFIG_PREEMPT_RT
477+# define force_irqthreads (true)
478+# else
475479 extern bool force_irqthreads;
480+# endif
476481 #else
477482 #define force_irqthreads (0)
478483 #endif
include/linux/interval_tree_generic.h+2−20
@@ -30,26 +30,8 @@ · 29 unmodified lines
3030 \
3131 /* Callbacks for augmented rbtree insert and remove */ \
3232 \
33−static inline ITTYPE ITPREFIX ## _compute_subtree_last(ITSTRUCT *node) \
34−{ \
35− ITTYPE max = ITLAST(node), subtree_last; \
36− if (node->ITRB.rb_left) { \
37− subtree_last = rb_entry(node->ITRB.rb_left, \
38− ITSTRUCT, ITRB)->ITSUBTREE; \
39− if (max < subtree_last) \
40− max = subtree_last; \
41− } \
42− if (node->ITRB.rb_right) { \
43− subtree_last = rb_entry(node->ITRB.rb_right, \
44− ITSTRUCT, ITRB)->ITSUBTREE; \
45− if (max < subtree_last) \
46− max = subtree_last; \
47− } \
48− return max; \
49−} \
50− \
51−RB_DECLARE_CALLBACKS(static, ITPREFIX ## _augment, ITSTRUCT, ITRB, \
52− ITTYPE, ITSUBTREE, ITPREFIX ## _compute_subtree_last) \
33+RB_DECLARE_CALLBACKS_MAX(static, ITPREFIX ## _augment, \
34+ ITSTRUCT, ITRB, ITTYPE, ITSUBTREE, ITLAST) \
5335 \
5436 /* Insert / remove interval nodes from the tree */ \
5537 \
include/linux/io-pgtable.h+44−22
@@ -1,7 +1,9 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 #ifndef __IO_PGTABLE_H
33 #define __IO_PGTABLE_H
4+
45 #include <linux/bitops.h>
6+#include <linux/iommu.h>
57
68 /*
79 * Public API for use by IOMMU drivers
@@ -17,22 +19,31 @@ enum io_pgtable_fmt { · 9 unmodified lines
1719 };
1820
1921 /**
20− * struct iommu_gather_ops - IOMMU callbacks for TLB and page table management.
22+ * struct iommu_flush_ops - IOMMU callbacks for TLB and page table management.
2123 *
22− * @tlb_flush_all: Synchronously invalidate the entire TLB context.
23− * @tlb_add_flush: Queue up a TLB invalidation for a virtual address range.
24− * @tlb_sync: Ensure any queued TLB invalidation has taken effect, and
25− * any corresponding page table updates are visible to the
26− * IOMMU.
24+ * @tlb_flush_all: Synchronously invalidate the entire TLB context.
25+ * @tlb_flush_walk: Synchronously invalidate all intermediate TLB state
26+ * (sometimes referred to as the "walk cache") for a virtual
27+ * address range.
28+ * @tlb_flush_leaf: Synchronously invalidate all leaf TLB state for a virtual
29+ * address range.
30+ * @tlb_add_page: Optional callback to queue up leaf TLB invalidation for a
31+ * single page. IOMMUs that cannot batch TLB invalidation
32+ * operations efficiently will typically issue them here, but
33+ * others may decide to update the iommu_iotlb_gather structure
34+ * and defer the invalidation until iommu_tlb_sync() instead.
2735 *
2836 * Note that these can all be called in atomic context and must therefore
2937 * not block.
3038 */
31−struct iommu_gather_ops {
39+struct iommu_flush_ops {
3240 void (*tlb_flush_all)(void *cookie);
33− void (*tlb_add_flush)(unsigned long iova, size_t size, size_t granule,
34− bool leaf, void *cookie);
35− void (*tlb_sync)(void *cookie);
41+ void (*tlb_flush_walk)(unsigned long iova, size_t size, size_t granule,
42+ void *cookie);
43+ void (*tlb_flush_leaf)(unsigned long iova, size_t size, size_t granule,
44+ void *cookie);
45+ void (*tlb_add_page)(struct iommu_iotlb_gather *gather,
46+ unsigned long iova, size_t granule, void *cookie);
3647 };
3748
3849 /**
@@ -65,10 +76,9 @@ struct io_pgtable_cfg { · 26 unmodified lines
6576 * (unmapped) entries but the hardware might do so anyway, perform
6677 * TLB maintenance when mapping as well as when unmapping.
6778 *
68− * IO_PGTABLE_QUIRK_ARM_MTK_4GB: (ARM v7s format) Set bit 9 in all
69− * PTEs, for Mediatek IOMMUs which treat it as a 33rd address bit
70− * when the SoC is in "4GB mode" and they can only access the high
71− * remap of DRAM (0x1_00000000 to 0x1_ffffffff).
79+ * IO_PGTABLE_QUIRK_ARM_MTK_EXT: (ARM v7s format) MediaTek IOMMUs extend
80+ * to support up to 34 bits PA where the bit32 and bit33 are
81+ * encoded in the bit9 and bit4 of the PTE respectively.
7282 *
7383 * IO_PGTABLE_QUIRK_NON_STRICT: Skip issuing synchronous leaf TLBIs
7484 * on unmap, for DMA domains using the flush queue mechanism for
@@ -77,14 +87,14 @@ struct io_pgtable_cfg { · 2 unmodified lines
7787 #define IO_PGTABLE_QUIRK_ARM_NS BIT(0)
7888 #define IO_PGTABLE_QUIRK_NO_PERMS BIT(1)
7989 #define IO_PGTABLE_QUIRK_TLBI_ON_MAP BIT(2)
80− #define IO_PGTABLE_QUIRK_ARM_MTK_4GB BIT(3)
90+ #define IO_PGTABLE_QUIRK_ARM_MTK_EXT BIT(3)
8191 #define IO_PGTABLE_QUIRK_NON_STRICT BIT(4)
8292 unsigned long quirks;
8393 unsigned long pgsize_bitmap;
8494 unsigned int ias;
8595 unsigned int oas;
8696 bool coherent_walk;
87− const struct iommu_gather_ops *tlb;
97+ const struct iommu_flush_ops *tlb;
8898 struct device *iommu_dev;
8999
90100 /* Low-level data specific to the table format */
@@ -128,7 +138,7 @@ struct io_pgtable_ops { · 37 unmodified lines
128138 int (*map)(struct io_pgtable_ops *ops, unsigned long iova,
129139 phys_addr_t paddr, size_t size, int prot);
130140 size_t (*unmap)(struct io_pgtable_ops *ops, unsigned long iova,
131− size_t size);
141+ size_t size, struct iommu_iotlb_gather *gather);
132142 phys_addr_t (*iova_to_phys)(struct io_pgtable_ops *ops,
133143 unsigned long iova);
134144 };
@@ -184,15 +194,27 @@ static inline void io_pgtable_tlb_flush_all(struct io_pgtable *iop) · 49 unmodified lines
184194 iop->cfg.tlb->tlb_flush_all(iop->cookie);
185195 }
186196
187−static inline void io_pgtable_tlb_add_flush(struct io_pgtable *iop,
188− unsigned long iova, size_t size, size_t granule, bool leaf)
197+static inline void
198+io_pgtable_tlb_flush_walk(struct io_pgtable *iop, unsigned long iova,
199+ size_t size, size_t granule)
200+{
201+ iop->cfg.tlb->tlb_flush_walk(iova, size, granule, iop->cookie);
202+}
203+
204+static inline void
205+io_pgtable_tlb_flush_leaf(struct io_pgtable *iop, unsigned long iova,
206+ size_t size, size_t granule)
189207 {
190− iop->cfg.tlb->tlb_add_flush(iova, size, granule, leaf, iop->cookie);
208+ iop->cfg.tlb->tlb_flush_leaf(iova, size, granule, iop->cookie);
191209 }
192210
193−static inline void io_pgtable_tlb_sync(struct io_pgtable *iop)
211+static inline void
212+io_pgtable_tlb_add_page(struct io_pgtable *iop,
213+ struct iommu_iotlb_gather * gather, unsigned long iova,
214+ size_t granule)
194215 {
195− iop->cfg.tlb->tlb_sync(iop->cookie);
216+ if (iop->cfg.tlb->tlb_add_page)
217+ iop->cfg.tlb->tlb_add_page(gather, iova, granule, iop->cookie);
196218 }
197219
198220 /**
include/linux/ioc4.h+0−184
@@ -1,184 +0,0 @@
1−/*
2− * This file is subject to the terms and conditions of the GNU General Public
3− * License. See the file "COPYING" in the main directory of this archive
4− * for more details.
5− *
6− * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
7− */
8−
9−#ifndef _LINUX_IOC4_H
10−#define _LINUX_IOC4_H
11−
12−#include <linux/interrupt.h>
13−
14−/***************
15− * Definitions *
16− ***************/
17−
18−/* Miscellaneous values inherent to hardware */
19−
20−#define IOC4_EXTINT_COUNT_DIVISOR 520 /* PCI clocks per COUNT tick */
21−
22−/***********************************
23− * Structures needed by subdrivers *
24− ***********************************/
25−
26−/* This structure fully describes the IOC4 miscellaneous registers which
27− * appear at bar[0]+0x00000 through bar[0]+0x0005c. The corresponding
28− * PCI resource is managed by the main IOC4 driver because it contains
29− * registers of interest to many different IOC4 subdrivers.
30− */
31−struct ioc4_misc_regs {
32− /* Miscellaneous IOC4 registers */
33− union ioc4_pci_err_addr_l {
34− uint32_t raw;
35− struct {
36− uint32_t valid:1; /* Address captured */
37− uint32_t master_id:4; /* Unit causing error
38− * 0/1: Serial port 0 TX/RX
39− * 2/3: Serial port 1 TX/RX
40− * 4/5: Serial port 2 TX/RX
41− * 6/7: Serial port 3 TX/RX
42− * 8: ATA/ATAPI
43− * 9-15: Undefined
44− */
45− uint32_t mul_err:1; /* Multiple errors occurred */
46− uint32_t addr:26; /* Bits 31-6 of error addr */
47− } fields;
48− } pci_err_addr_l;
49− uint32_t pci_err_addr_h; /* Bits 63-32 of error addr */
50− union ioc4_sio_int {
51− uint32_t raw;
52− struct {
53− uint8_t tx_mt:1; /* TX ring buffer empty */
54− uint8_t rx_full:1; /* RX ring buffer full */
55− uint8_t rx_high:1; /* RX high-water exceeded */
56− uint8_t rx_timer:1; /* RX timer has triggered */
57− uint8_t delta_dcd:1; /* DELTA_DCD seen */
58− uint8_t delta_cts:1; /* DELTA_CTS seen */
59− uint8_t intr_pass:1; /* Interrupt pass-through */
60− uint8_t tx_explicit:1; /* TX, MCW, or delay complete */
61− } fields[4];
62− } sio_ir; /* Serial interrupt state */
63− union ioc4_other_int {
64− uint32_t raw;
65− struct {
66− uint32_t ata_int:1; /* ATA port passthru */
67− uint32_t ata_memerr:1; /* ATA halted by mem error */
68− uint32_t memerr:4; /* Serial halted by mem err */
69− uint32_t kbd_int:1; /* kbd/mouse intr asserted */
70− uint32_t reserved:16; /* zero */
71− uint32_t rt_int:1; /* INT_OUT section latch */
72− uint32_t gen_int:8; /* Intr. from generic pins */
73− } fields;
74− } other_ir; /* Other interrupt state */
75− union ioc4_sio_int sio_ies; /* Serial interrupt enable set */
76− union ioc4_other_int other_ies; /* Other interrupt enable set */
77− union ioc4_sio_int sio_iec; /* Serial interrupt enable clear */
78− union ioc4_other_int other_iec; /* Other interrupt enable clear */
79− union ioc4_sio_cr {
80− uint32_t raw;
81− struct {
82− uint32_t cmd_pulse:4; /* Bytebus strobe width */
83− uint32_t arb_diag:3; /* PCI bus requester */
84− uint32_t sio_diag_idle:1; /* Active ser req? */
85− uint32_t ata_diag_idle:1; /* Active ATA req? */
86− uint32_t ata_diag_active:1; /* ATA req is winner */
87− uint32_t reserved:22; /* zero */
88− } fields;
89− } sio_cr;
90− uint32_t unused1;
91− union ioc4_int_out {
92− uint32_t raw;
93− struct {
94− uint32_t count:16; /* Period control */
95− uint32_t mode:3; /* Output signal shape */
96− uint32_t reserved:11; /* zero */
97− uint32_t diag:1; /* Timebase control */
98− uint32_t int_out:1; /* Current value */
99− } fields;
100− } int_out; /* External interrupt output control */
101− uint32_t unused2;
102− union ioc4_gpcr {
103− uint32_t raw;
104− struct {
105− uint32_t dir:8; /* Pin direction */
106− uint32_t edge:8; /* Edge/level mode */
107− uint32_t reserved1:4; /* zero */
108− uint32_t int_out_en:1; /* INT_OUT enable */
109− uint32_t reserved2:11; /* zero */
110− } fields;
111− } gpcr_s; /* Generic PIO control set */
112− union ioc4_gpcr gpcr_c; /* Generic PIO control clear */
113− union ioc4_gpdr {
114− uint32_t raw;
115− struct {
116− uint32_t gen_pin:8; /* State of pins */
117− uint32_t reserved:24;
118− } fields;
119− } gpdr; /* Generic PIO data */
120− uint32_t unused3;
121− union ioc4_gppr {
122− uint32_t raw;
123− struct {
124− uint32_t gen_pin:1; /* Single pin state */
125− uint32_t reserved:31;
126− } fields;
127− } gppr[8]; /* Generic PIO pins */
128−};
129−
130−/* Masks for GPCR DIR pins */
131−#define IOC4_GPCR_DIR_0 0x01 /* External interrupt output */
132−#define IOC4_GPCR_DIR_1 0x02 /* External interrupt input */
133−#define IOC4_GPCR_DIR_2 0x04
134−#define IOC4_GPCR_DIR_3 0x08 /* Keyboard/mouse presence */
135−#define IOC4_GPCR_DIR_4 0x10 /* Ser. port 0 xcvr select (0=232, 1=422) */
136−#define IOC4_GPCR_DIR_5 0x20 /* Ser. port 1 xcvr select (0=232, 1=422) */
137−#define IOC4_GPCR_DIR_6 0x40 /* Ser. port 2 xcvr select (0=232, 1=422) */
138−#define IOC4_GPCR_DIR_7 0x80 /* Ser. port 3 xcvr select (0=232, 1=422) */
139−
140−/* Masks for GPCR EDGE pins */
141−#define IOC4_GPCR_EDGE_0 0x01
142−#define IOC4_GPCR_EDGE_1 0x02 /* External interrupt input */
143−#define IOC4_GPCR_EDGE_2 0x04
144−#define IOC4_GPCR_EDGE_3 0x08
145−#define IOC4_GPCR_EDGE_4 0x10
146−#define IOC4_GPCR_EDGE_5 0x20
147−#define IOC4_GPCR_EDGE_6 0x40
148−#define IOC4_GPCR_EDGE_7 0x80
149−
150−#define IOC4_VARIANT_IO9 0x0900
151−#define IOC4_VARIANT_PCI_RT 0x0901
152−#define IOC4_VARIANT_IO10 0x1000
153−
154−/* One of these per IOC4 */
155−struct ioc4_driver_data {
156− struct list_head idd_list;
157− unsigned long idd_bar0;
158− struct pci_dev *idd_pdev;
159− const struct pci_device_id *idd_pci_id;
160− struct ioc4_misc_regs __iomem *idd_misc_regs;
161− unsigned long count_period;
162− void *idd_serial_data;
163− unsigned int idd_variant;
164−};
165−
166−/* One per submodule */
167−struct ioc4_submodule {
168− struct list_head is_list;
169− char *is_name;
170− struct module *is_owner;
171− int (*is_probe) (struct ioc4_driver_data *);
172− int (*is_remove) (struct ioc4_driver_data *);
173−};
174−
175−#define IOC4_NUM_CARDS 8 /* max cards per partition */
176−
177−/**********************************
178− * Functions needed by submodules *
179− **********************************/
180−
181−extern int ioc4_register_submodule(struct ioc4_submodule *);
182−extern void ioc4_unregister_submodule(struct ioc4_submodule *);
183−
184−#endif /* _LINUX_IOC4_H */
include/linux/iomap.h+7−3
@@ -188,10 +188,14 @@ sector_t iomap_bmap(struct address_space *mapping, sector_t bno, · 187 unmodified lines
188188 */
189189 #define IOMAP_DIO_UNWRITTEN (1 << 0) /* covers unwritten extent(s) */
190190 #define IOMAP_DIO_COW (1 << 1) /* covers COW extent(s) */
191−typedef int (iomap_dio_end_io_t)(struct kiocb *iocb, ssize_t ret,
192− unsigned flags);
191+
192+struct iomap_dio_ops {
193+ int (*end_io)(struct kiocb *iocb, ssize_t size, int error,
194+ unsigned flags);
195+};
196+
193197 ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,
194− const struct iomap_ops *ops, iomap_dio_end_io_t end_io);
198+ const struct iomap_ops *ops, const struct iomap_dio_ops *dops);
195199 int iomap_dio_iopoll(struct kiocb *kiocb, bool spin);
196200
197201 #ifdef CONFIG_SWAP
include/linux/iommu.h+88−20
@@ -191,6 +191,23 @@ struct iommu_sva_ops { · 190 unmodified lines
191191
192192 #ifdef CONFIG_IOMMU_API
193193
194+/**
195+ * struct iommu_iotlb_gather - Range information for a pending IOTLB flush
196+ *
197+ * @start: IOVA representing the start of the range to be flushed
198+ * @end: IOVA representing the end of the range to be flushed (exclusive)
199+ * @pgsize: The interval at which to perform the flush
200+ *
201+ * This structure is intended to be updated by multiple calls to the
202+ * ->unmap() function in struct iommu_ops before eventually being passed
203+ * into ->iotlb_sync().
204+ */
205+struct iommu_iotlb_gather {
206+ unsigned long start;
207+ unsigned long end;
208+ size_t pgsize;
209+};
210+
194211 /**
195212 * struct iommu_ops - iommu ops and capabilities
196213 * @capable: check capability
@@ -201,7 +218,6 @@ struct iommu_sva_ops { · 4 unmodified lines
201218 * @map: map a physically contiguous memory region to an iommu domain
202219 * @unmap: unmap a physically contiguous memory region from an iommu domain
203220 * @flush_iotlb_all: Synchronously flush all hardware TLBs for this domain
204− * @iotlb_range_add: Add a given iova range to the flush queue for this domain
205221 * @iotlb_sync_map: Sync mappings created recently using @map to the hardware
206222 * @iotlb_sync: Flush all queued ranges from the hardware TLBs and empty flush
207223 * queue
@@ -242,12 +258,11 @@ struct iommu_ops { · 34 unmodified lines
242258 int (*map)(struct iommu_domain *domain, unsigned long iova,
243259 phys_addr_t paddr, size_t size, int prot);
244260 size_t (*unmap)(struct iommu_domain *domain, unsigned long iova,
245− size_t size);
261+ size_t size, struct iommu_iotlb_gather *iotlb_gather);
246262 void (*flush_iotlb_all)(struct iommu_domain *domain);
247− void (*iotlb_range_add)(struct iommu_domain *domain,
248− unsigned long iova, size_t size);
249263 void (*iotlb_sync_map)(struct iommu_domain *domain);
250− void (*iotlb_sync)(struct iommu_domain *domain);
264+ void (*iotlb_sync)(struct iommu_domain *domain,
265+ struct iommu_iotlb_gather *iotlb_gather);
251266 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova);
252267 int (*add_device)(struct device *dev);
253268 void (*remove_device)(struct device *dev);
@@ -378,6 +393,13 @@ static inline struct iommu_device *dev_to_iommu_device(struct device *dev) · 124 unmodified lines
378393 return (struct iommu_device *)dev_get_drvdata(dev);
379394 }
380395
396+static inline void iommu_iotlb_gather_init(struct iommu_iotlb_gather *gather)
397+{
398+ *gather = (struct iommu_iotlb_gather) {
399+ .start = ULONG_MAX,
400+ };
401+}
402+
381403 #define IOMMU_GROUP_NOTIFY_ADD_DEVICE 1 /* Device added */
382404 #define IOMMU_GROUP_NOTIFY_DEL_DEVICE 2 /* Pre Device removed */
383405 #define IOMMU_GROUP_NOTIFY_BIND_DRIVER 3 /* Pre Driver bind */
@@ -402,7 +424,8 @@ extern int iommu_map(struct iommu_domain *domain, unsigned long iova, · 18 unmodified lines
402424 extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova,
403425 size_t size);
404426 extern size_t iommu_unmap_fast(struct iommu_domain *domain,
405− unsigned long iova, size_t size);
427+ unsigned long iova, size_t size,
428+ struct iommu_iotlb_gather *iotlb_gather);
406429 extern size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
407430 struct scatterlist *sg,unsigned int nents, int prot);
408431 extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova);
@@ -413,6 +436,9 @@ extern void iommu_get_resv_regions(struct device *dev, struct list_head *list); · 4 unmodified lines
413436 extern void iommu_put_resv_regions(struct device *dev, struct list_head *list);
414437 extern int iommu_request_dm_for_dev(struct device *dev);
415438 extern int iommu_request_dma_domain_for_dev(struct device *dev);
439+extern void iommu_set_default_passthrough(bool cmd_line);
440+extern void iommu_set_default_translated(bool cmd_line);
441+extern bool iommu_default_passthrough(void);
416442 extern struct iommu_resv_region *
417443 iommu_alloc_resv_region(phys_addr_t start, size_t length, int prot,
418444 enum iommu_resv_type type);
@@ -476,17 +502,38 @@ static inline void iommu_flush_tlb_all(struct iommu_domain *domain) · 57 unmodified lines
476502 domain->ops->flush_iotlb_all(domain);
477503 }
478504
479−static inline void iommu_tlb_range_add(struct iommu_domain *domain,
480− unsigned long iova, size_t size)
505+static inline void iommu_tlb_sync(struct iommu_domain *domain,
506+ struct iommu_iotlb_gather *iotlb_gather)
481507 {
482− if (domain->ops->iotlb_range_add)
483− domain->ops->iotlb_range_add(domain, iova, size);
508+ if (domain->ops->iotlb_sync)
509+ domain->ops->iotlb_sync(domain, iotlb_gather);
510+
511+ iommu_iotlb_gather_init(iotlb_gather);
484512 }
485513
486−static inline void iommu_tlb_sync(struct iommu_domain *domain)
514+static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain,
515+ struct iommu_iotlb_gather *gather,
516+ unsigned long iova, size_t size)
487517 {
488− if (domain->ops->iotlb_sync)
489− domain->ops->iotlb_sync(domain);
518+ unsigned long start = iova, end = start + size;
519+
520+ /*
521+ * If the new page is disjoint from the current range or is mapped at
522+ * a different granularity, then sync the TLB so that the gather
523+ * structure can be rewritten.
524+ */
525+ if (gather->pgsize != size ||
526+ end < gather->start || start > gather->end) {
527+ if (gather->pgsize)
528+ iommu_tlb_sync(domain, gather);
529+ gather->pgsize = size;
530+ }
531+
532+ if (gather->end < end)
533+ gather->end = end;
534+
535+ if (gather->start > start)
536+ gather->start = start;
490537 }
491538
492539 /* PCI device grouping function */
@@ -567,6 +614,7 @@ struct iommu_group {}; · 74 unmodified lines
567614 struct iommu_fwspec {};
568615 struct iommu_device {};
569616 struct iommu_fault_param {};
617+struct iommu_iotlb_gather {};
570618
571619 static inline bool iommu_present(struct bus_type *bus)
572620 {
@@ -621,7 +669,8 @@ static inline size_t iommu_unmap(struct iommu_domain *domain, · 48 unmodified lines
621669 }
622670
623671 static inline size_t iommu_unmap_fast(struct iommu_domain *domain,
624− unsigned long iova, int gfp_order)
672+ unsigned long iova, int gfp_order,
673+ struct iommu_iotlb_gather *iotlb_gather)
625674 {
626675 return 0;
627676 }
@@ -637,12 +686,8 @@ static inline void iommu_flush_tlb_all(struct iommu_domain *domain) · 9 unmodified lines
637686 {
638687 }
639688
640−static inline void iommu_tlb_range_add(struct iommu_domain *domain,
641− unsigned long iova, size_t size)
642−{
643−}
644−
645−static inline void iommu_tlb_sync(struct iommu_domain *domain)
689+static inline void iommu_tlb_sync(struct iommu_domain *domain,
690+ struct iommu_iotlb_gather *iotlb_gather)
646691 {
647692 }
648693
@@ -694,6 +739,19 @@ static inline int iommu_request_dma_domain_for_dev(struct device *dev) · 45 unmodified lines
694739 return -ENODEV;
695740 }
696741
742+static inline void iommu_set_default_passthrough(bool cmd_line)
743+{
744+}
745+
746+static inline void iommu_set_default_translated(bool cmd_line)
747+{
748+}
749+
750+static inline bool iommu_default_passthrough(void)
751+{
752+ return true;
753+}
754+
697755 static inline int iommu_attach_group(struct iommu_domain *domain,
698756 struct iommu_group *group)
699757 {
@@ -827,6 +885,16 @@ static inline struct iommu_device *dev_to_iommu_device(struct device *dev) · 127 unmodified lines
827885 return NULL;
828886 }
829887
888+static inline void iommu_iotlb_gather_init(struct iommu_iotlb_gather *gather)
889+{
890+}
891+
892+static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain,
893+ struct iommu_iotlb_gather *gather,
894+ unsigned long iova, size_t size)
895+{
896+}
897+
830898 static inline void iommu_device_unregister(struct iommu_device *iommu)
831899 {
832900 }
include/linux/ioport.h+2−0
@@ -297,6 +297,8 @@ static inline bool resource_overlaps(struct resource *r1, struct resource *r2) · 296 unmodified lines
297297
298298 struct resource *devm_request_free_mem_region(struct device *dev,
299299 struct resource *base, unsigned long size);
300+struct resource *request_free_mem_region(struct resource *base,
301+ unsigned long size, const char *name);
300302
301303 #endif /* __ASSEMBLY__ */
302304 #endif /* _LINUX_IOPORT_H */
include/linux/iova.h+6−0
@@ -155,6 +155,7 @@ struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo, · 154 unmodified lines
155155 void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to);
156156 void init_iova_domain(struct iova_domain *iovad, unsigned long granule,
157157 unsigned long start_pfn);
158+bool has_iova_flush_queue(struct iova_domain *iovad);
158159 int init_iova_flush_queue(struct iova_domain *iovad,
159160 iova_flush_cb flush_cb, iova_entry_dtor entry_dtor);
160161 struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn);
@@ -235,6 +236,11 @@ static inline void init_iova_domain(struct iova_domain *iovad, · 74 unmodified lines
235236 {
236237 }
237238
239+static inline bool has_iova_flush_queue(struct iova_domain *iovad)
240+{
241+ return false;
242+}
243+
238244 static inline int init_iova_flush_queue(struct iova_domain *iovad,
239245 iova_flush_cb flush_cb,
240246 iova_entry_dtor entry_dtor)
include/linux/irqchip/arm-gic-v3.h+29−1
@@ -30,10 +30,22 @@ · 29 unmodified lines
3030 #define GICD_ICFGR 0x0C00
3131 #define GICD_IGRPMODR 0x0D00
3232 #define GICD_NSACR 0x0E00
33+#define GICD_IGROUPRnE 0x1000
34+#define GICD_ISENABLERnE 0x1200
35+#define GICD_ICENABLERnE 0x1400
36+#define GICD_ISPENDRnE 0x1600
37+#define GICD_ICPENDRnE 0x1800
38+#define GICD_ISACTIVERnE 0x1A00
39+#define GICD_ICACTIVERnE 0x1C00
40+#define GICD_IPRIORITYRnE 0x2000
41+#define GICD_ICFGRnE 0x3000
3342 #define GICD_IROUTER 0x6000
43+#define GICD_IROUTERnE 0x8000
3444 #define GICD_IDREGS 0xFFD0
3545 #define GICD_PIDR2 0xFFE8
3646
47+#define ESPI_BASE_INTID 4096
48+
3749 /*
3850 * Those registers are actually from GICv2, but the spec demands that they
3951 * are implemented as RES0 if ARE is 1 (which we do in KVM's emulated GICv3).
@@ -69,10 +81,13 @@ · 29 unmodified lines
6981 #define GICD_TYPER_RSS (1U << 26)
7082 #define GICD_TYPER_LPIS (1U << 17)
7183 #define GICD_TYPER_MBIS (1U << 16)
84+#define GICD_TYPER_ESPI (1U << 8)
7285
7386 #define GICD_TYPER_ID_BITS(typer) ((((typer) >> 19) & 0x1f) + 1)
7487 #define GICD_TYPER_NUM_LPIS(typer) ((((typer) >> 11) & 0x1f) + 1)
75−#define GICD_TYPER_IRQS(typer) ((((typer) & 0x1f) + 1) * 32)
88+#define GICD_TYPER_SPIS(typer) ((((typer) & 0x1f) + 1) * 32)
89+#define GICD_TYPER_ESPIS(typer) \
90+ (((typer) & GICD_TYPER_ESPI) ? GICD_TYPER_SPIS((typer) >> 27) : 0)
7691
7792 #define GICD_IROUTER_SPI_MODE_ONE (0U << 31)
7893 #define GICD_IROUTER_SPI_MODE_ANY (1U << 31)
@@ -109,6 +124,18 @@ · 30 unmodified lines
109124
110125 #define GICR_TYPER_CPU_NUMBER(r) (((r) >> 8) & 0xffff)
111126
127+#define EPPI_BASE_INTID 1056
128+
129+#define GICR_TYPER_NR_PPIS(r) \
130+ ({ \
131+ unsigned int __ppinum = ((r) >> 27) & 0x1f; \
132+ unsigned int __nr_ppis = 16; \
133+ if (__ppinum == 1 || __ppinum == 2) \
134+ __nr_ppis += __ppinum * 32; \
135+ \
136+ __nr_ppis; \
137+ })
138+
112139 #define GICR_WAKER_ProcessorSleep (1U << 1)
113140 #define GICR_WAKER_ChildrenAsleep (1U << 2)
114141
@@ -469,6 +496,7 @@ · 354 unmodified lines
469496 #define ICC_CTLR_EL1_A3V_SHIFT 15
470497 #define ICC_CTLR_EL1_A3V_MASK (0x1 << ICC_CTLR_EL1_A3V_SHIFT)
471498 #define ICC_CTLR_EL1_RSS (0x1 << 18)
499+#define ICC_CTLR_EL1_ExtRange (0x1 << 19)
472500 #define ICC_PMR_EL1_SHIFT 0
473501 #define ICC_PMR_EL1_MASK (0xff << ICC_PMR_EL1_SHIFT)
474502 #define ICC_BPR0_EL1_SHIFT 0
include/linux/irqchip/irq-partition-percpu.h+5−0
@@ -4,6 +4,9 @@ · 3 unmodified lines
44 * Author: Marc Zyngier <marc.zyngier@arm.com>
55 */
66
7+#ifndef __LINUX_IRQCHIP_IRQ_PARTITION_PERCPU_H
8+#define __LINUX_IRQCHIP_IRQ_PARTITION_PERCPU_H
9+
710 #include <linux/fwnode.h>
811 #include <linux/cpumask.h>
912 #include <linux/irqdomain.h>
@@ -46,3 +49,5 @@ struct irq_domain *partition_get_domain(struct partition_desc *dsc) · 36 unmodified lines
4649 return NULL;
4750 }
4851 #endif
52+
53+#endif /* __LINUX_IRQCHIP_IRQ_PARTITION_PERCPU_H */
include/linux/irqdomain.h+3−3
@@ -220,7 +220,7 @@ static inline struct device_node *irq_domain_get_of_node(struct irq_domain *d) · 219 unmodified lines
220220
221221 #ifdef CONFIG_IRQ_DOMAIN
222222 struct fwnode_handle *__irq_domain_alloc_fwnode(unsigned int type, int id,
223− const char *name, void *data);
223+ const char *name, phys_addr_t *pa);
224224
225225 enum {
226226 IRQCHIP_FWNODE_REAL,
@@ -241,9 +241,9 @@ struct fwnode_handle *irq_domain_alloc_named_id_fwnode(const char *name, int id) · 14 unmodified lines
241241 NULL);
242242 }
243243
244−static inline struct fwnode_handle *irq_domain_alloc_fwnode(void *data)
244+static inline struct fwnode_handle *irq_domain_alloc_fwnode(phys_addr_t *pa)
245245 {
246− return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, data);
246+ return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, pa);
247247 }
248248
249249 void irq_domain_free_fwnode(struct fwnode_handle *fwnode);
include/linux/jbd2.h+0−2
@@ -1410,8 +1410,6 @@ extern int jbd2_journal_clear_err (journal_t *); · 1409 unmodified lines
14101410 extern int jbd2_journal_bmap(journal_t *, unsigned long, unsigned long long *);
14111411 extern int jbd2_journal_force_commit(journal_t *);
14121412 extern int jbd2_journal_force_commit_nested(journal_t *);
1413−extern int jbd2_journal_inode_add_write(handle_t *handle, struct jbd2_inode *inode);
1414−extern int jbd2_journal_inode_add_wait(handle_t *handle, struct jbd2_inode *inode);
14151413 extern int jbd2_journal_inode_ranged_write(handle_t *handle,
14161414 struct jbd2_inode *inode, loff_t start_byte,
14171415 loff_t length);
include/linux/kernel.h+22−1
@@ -217,7 +217,9 @@ extern void __cant_sleep(const char *file, int line, int preempt_offset); · 216 unmodified lines
217217 * might_sleep - annotation for functions that can sleep
218218 *
219219 * this macro will print a stack trace if it is executed in an atomic
220− * context (spinlock, irq-handler, ...).
220+ * context (spinlock, irq-handler, ...). Additional sections where blocking is
221+ * not allowed can be annotated with non_block_start() and non_block_end()
222+ * pairs.
221223 *
222224 * This is a useful debugging help to be able to catch problems early and not
223225 * be bitten later when the calling function happens to sleep when it is not
@@ -233,6 +235,23 @@ extern void __cant_sleep(const char *file, int line, int preempt_offset); · 9 unmodified lines
233235 # define cant_sleep() \
234236 do { __cant_sleep(__FILE__, __LINE__, 0); } while (0)
235237 # define sched_annotate_sleep() (current->task_state_change = 0)
238+/**
239+ * non_block_start - annotate the start of section where sleeping is prohibited
240+ *
241+ * This is on behalf of the oom reaper, specifically when it is calling the mmu
242+ * notifiers. The problem is that if the notifier were to block on, for example,
243+ * mutex_lock() and if the process which holds that mutex were to perform a
244+ * sleeping memory allocation, the oom reaper is now blocked on completion of
245+ * that memory allocation. Other blocking calls like wait_event() pose similar
246+ * issues.
247+ */
248+# define non_block_start() (current->non_block_count++)
249+/**
250+ * non_block_end - annotate the end of section where sleeping is prohibited
251+ *
252+ * Closes a section opened by non_block_start().
253+ */
254+# define non_block_end() WARN_ON(current->non_block_count-- == 0)
236255 #else
237256 static inline void ___might_sleep(const char *file, int line,
238257 int preempt_offset) { }
@@ -241,6 +260,8 @@ extern void __cant_sleep(const char *file, int line, int preempt_offset); · 2 unmodified lines
241260 # define might_sleep() do { might_resched(); } while (0)
242261 # define cant_sleep() do { } while (0)
243262 # define sched_annotate_sleep() do { } while (0)
263+# define non_block_start() do { } while (0)
264+# define non_block_end() do { } while (0)
244265 #endif
245266
246267 #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
include/linux/kexec.h+27−2
@@ -125,7 +125,7 @@ typedef void *(kexec_load_t)(struct kimage *image, char *kernel_buf, · 124 unmodified lines
125125 unsigned long cmdline_len);
126126 typedef int (kexec_cleanup_t)(void *loader_data);
127127
128−#ifdef CONFIG_KEXEC_VERIFY_SIG
128+#ifdef CONFIG_KEXEC_SIG
129129 typedef int (kexec_verify_sig_t)(const char *kernel_buf,
130130 unsigned long kernel_len);
131131 #endif
@@ -134,7 +134,7 @@ struct kexec_file_ops { · 2 unmodified lines
134134 kexec_probe_t *probe;
135135 kexec_load_t *load;
136136 kexec_cleanup_t *cleanup;
137−#ifdef CONFIG_KEXEC_VERIFY_SIG
137+#ifdef CONFIG_KEXEC_SIG
138138 kexec_verify_sig_t *verify_sig;
139139 #endif
140140 };
@@ -183,6 +183,8 @@ int kexec_purgatory_get_set_symbol(struct kimage *image, const char *name, · 42 unmodified lines
183183 bool get_value);
184184 void *kexec_purgatory_get_symbol_addr(struct kimage *image, const char *name);
185185
186+int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,
187+ unsigned long buf_len);
186188 void * __weak arch_kexec_kernel_image_load(struct kimage *image);
187189 int __weak arch_kexec_apply_relocations_add(struct purgatory_info *pi,
188190 Elf_Shdr *section,
@@ -216,6 +218,29 @@ extern int crash_prepare_elf64_headers(struct crash_mem *mem, int kernel_map, · 27 unmodified lines
216218 void **addr, unsigned long *sz);
217219 #endif /* CONFIG_KEXEC_FILE */
218220
221+#ifdef CONFIG_KEXEC_ELF
222+struct kexec_elf_info {
223+ /*
224+ * Where the ELF binary contents are kept.
225+ * Memory managed by the user of the struct.
226+ */
227+ const char *buffer;
228+
229+ const struct elfhdr *ehdr;
230+ const struct elf_phdr *proghdrs;
231+};
232+
233+int kexec_build_elf_info(const char *buf, size_t len, struct elfhdr *ehdr,
234+ struct kexec_elf_info *elf_info);
235+
236+int kexec_elf_load(struct kimage *image, struct elfhdr *ehdr,
237+ struct kexec_elf_info *elf_info,
238+ struct kexec_buf *kbuf,
239+ unsigned long *lowest_load_addr);
240+
241+void kexec_free_elf_info(struct kexec_elf_info *elf_info);
242+int kexec_elf_probe(const char *buf, unsigned long len);
243+#endif
219244 struct kimage {
220245 kimage_entry_t head;
221246 kimage_entry_t *entry;
include/linux/key.h+17−5
@@ -94,11 +94,11 @@ struct keyring_index_key { · 93 unmodified lines
9494 union {
9595 struct {
9696 #ifdef __LITTLE_ENDIAN /* Put desc_len at the LSB of x */
97− u8 desc_len;
98− char desc[sizeof(long) - 1]; /* First few chars of description */
97+ u16 desc_len;
98+ char desc[sizeof(long) - 2]; /* First few chars of description */
9999 #else
100− char desc[sizeof(long) - 1]; /* First few chars of description */
101− u8 desc_len;
100+ char desc[sizeof(long) - 2]; /* First few chars of description */
101+ u16 desc_len;
102102 #endif
103103 };
104104 unsigned long x;
@@ -324,7 +324,7 @@ static inline struct key *request_key(struct key_type *type, · 219 unmodified lines
324324 }
325325
326326 #ifdef CONFIG_NET
327−/*
327+/**
328328 * request_key_net - Request a key for a net namespace and wait for construction
329329 * @type: Type of key.
330330 * @description: The searchable description of the key.
@@ -341,6 +341,18 @@ static inline struct key *request_key(struct key_type *type, · 10 unmodified lines
341341 */
342342 #define request_key_net(type, description, net, callout_info) \
343343 request_key_tag(type, description, net->key_domain, callout_info);
344+
345+/**
346+ * request_key_net_rcu - Request a key for a net namespace under RCU conditions
347+ * @type: Type of key.
348+ * @description: The searchable description of the key.
349+ * @net: The network namespace that is the key's domain of operation.
350+ *
351+ * As for request_key_rcu() except that only keys that operate the specified
352+ * network namespace are used.
353+ */
354+#define request_key_net_rcu(type, description, net) \
355+ request_key_rcu(type, description, net->key_domain);
344356 #endif /* CONFIG_NET */
345357
346358 extern int wait_for_key_construction(struct key *key, bool intr);
include/linux/kgdb.h+2−0
@@ -326,8 +326,10 @@ extern atomic_t kgdb_active; · 325 unmodified lines
326326 (raw_smp_processor_id() == atomic_read(&kgdb_active))
327327 extern bool dbg_is_early;
328328 extern void __init dbg_late_init(void);
329+extern void kgdb_panic(const char *msg);
329330 #else /* ! CONFIG_KGDB */
330331 #define in_dbg_master() (0)
331332 #define dbg_late_init()
333+static inline void kgdb_panic(const char *msg) {}
332334 #endif /* ! CONFIG_KGDB */
333335 #endif /* _KGDB_H_ */
include/linux/khugepaged.h+12−0
@@ -15,6 +15,14 @@ extern int __khugepaged_enter(struct mm_struct *mm); · 14 unmodified lines
1515 extern void __khugepaged_exit(struct mm_struct *mm);
1616 extern int khugepaged_enter_vma_merge(struct vm_area_struct *vma,
1717 unsigned long vm_flags);
18+#ifdef CONFIG_SHMEM
19+extern void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr);
20+#else
21+static inline void collapse_pte_mapped_thp(struct mm_struct *mm,
22+ unsigned long addr)
23+{
24+}
25+#endif
1826
1927 #define khugepaged_enabled() \
2028 (transparent_hugepage_flags & \
@@ -73,6 +81,10 @@ static inline int khugepaged_enter_vma_merge(struct vm_area_struct *vma, · 52 unmodified lines
7381 {
7482 return 0;
7583 }
84+static inline void collapse_pte_mapped_thp(struct mm_struct *mm,
85+ unsigned long addr)
86+{
87+}
7688 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
7789
7890 #endif /* _LINUX_KHUGEPAGED_H */
include/linux/kvm_host.h+4−2
@@ -861,8 +861,9 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu); · 860 unmodified lines
861861 void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu);
862862 void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu);
863863
864−bool kvm_arch_has_vcpu_debugfs(void);
865−int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu);
864+#ifdef __KVM_HAVE_ARCH_VCPU_DEBUGFS
865+void kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu);
866+#endif
866867
867868 int kvm_arch_hardware_enable(void);
868869 void kvm_arch_hardware_disable(void);
@@ -872,6 +873,7 @@ int kvm_arch_check_processor_compat(void); · 3 unmodified lines
872873 int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
873874 bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu);
874875 int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);
876+bool kvm_arch_dy_runnable(struct kvm_vcpu *vcpu);
875877
876878 #ifndef __KVM_HAVE_ARCH_VM_ALLOC
877879 /*
include/linux/led-class-flash.h+10−5
@@ -86,15 +86,20 @@ static inline struct led_classdev_flash *lcdev_to_flcdev( · 85 unmodified lines
8686 }
8787
8888 /**
89− * led_classdev_flash_register - register a new object of led_classdev class
90− * with support for flash LEDs
91− * @parent: the flash LED to register
89+ * led_classdev_flash_register_ext - register a new object of LED class with
90+ * init data and with support for flash LEDs
91+ * @parent: LED flash controller device this flash LED is driven by
9292 * @fled_cdev: the led_classdev_flash structure for this device
93+ * @init_data: the LED class flash device initialization data
9394 *
9495 * Returns: 0 on success or negative error value on failure
9596 */
96−extern int led_classdev_flash_register(struct device *parent,
97− struct led_classdev_flash *fled_cdev);
97+extern int led_classdev_flash_register_ext(struct device *parent,
98+ struct led_classdev_flash *fled_cdev,
99+ struct led_init_data *init_data);
100+
101+#define led_classdev_flash_register(parent, fled_cdev) \
102+ led_classdev_flash_register_ext(parent, fled_cdev, NULL)
98103
99104 /**
100105 * led_classdev_flash_unregister - unregisters an object of led_classdev class
include/linux/leds.h+90−10
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 #ifndef __LINUX_LEDS_H_INCLUDED
99 #define __LINUX_LEDS_H_INCLUDED
1010
11+#include <dt-bindings/leds/common.h>
1112 #include <linux/device.h>
1213 #include <linux/kernfs.h>
1314 #include <linux/list.h>
@@ -30,6 +31,30 @@ enum led_brightness { · 16 unmodified lines
3031 LED_FULL = 255,
3132 };
3233
34+struct led_init_data {
35+ /* device fwnode handle */
36+ struct fwnode_handle *fwnode;
37+ /*
38+ * default <color:function> tuple, for backward compatibility
39+ * with in-driver hard-coded LED names used as a fallback when
40+ * DT "label" property is absent; it should be set to NULL
41+ * in new LED class drivers.
42+ */
43+ const char *default_label;
44+ /*
45+ * string to be used for devicename section of LED class device
46+ * either for label based LED name composition path or for fwnode
47+ * based when devname_mandatory is true
48+ */
49+ const char *devicename;
50+ /*
51+ * indicates if LED name should always comprise devicename section;
52+ * only LEDs exposed by drivers of hot-pluggable devices should
53+ * set it to true
54+ */
55+ bool devname_mandatory;
56+};
57+
3358 struct led_classdev {
3459 const char *name;
3560 enum led_brightness brightness;
@@ -125,16 +150,46 @@ struct led_classdev { · 89 unmodified lines
125150 struct mutex led_access;
126151 };
127152
128−extern int of_led_classdev_register(struct device *parent,
129− struct device_node *np,
130− struct led_classdev *led_cdev);
131−#define led_classdev_register(parent, led_cdev) \
132− of_led_classdev_register(parent, NULL, led_cdev)
133−extern int devm_of_led_classdev_register(struct device *parent,
134− struct device_node *np,
135− struct led_classdev *led_cdev);
136−#define devm_led_classdev_register(parent, led_cdev) \
137− devm_of_led_classdev_register(parent, NULL, led_cdev)
153+/**
154+ * led_classdev_register_ext - register a new object of LED class with
155+ * init data
156+ * @parent: LED controller device this LED is driven by
157+ * @led_cdev: the led_classdev structure for this device
158+ * @init_data: the LED class device initialization data
159+ *
160+ * Register a new object of LED class, with name derived from init_data.
161+ *
162+ * Returns: 0 on success or negative error value on failure
163+ */
164+extern int led_classdev_register_ext(struct device *parent,
165+ struct led_classdev *led_cdev,
166+ struct led_init_data *init_data);
167+
168+/**
169+ * led_classdev_register - register a new object of LED class
170+ * @parent: LED controller device this LED is driven by
171+ * @led_cdev: the led_classdev structure for this device
172+ *
173+ * Register a new object of LED class, with name derived from the name property
174+ * of passed led_cdev argument.
175+ *
176+ * Returns: 0 on success or negative error value on failure
177+ */
178+static inline int led_classdev_register(struct device *parent,
179+ struct led_classdev *led_cdev)
180+{
181+ return led_classdev_register_ext(parent, led_cdev, NULL);
182+}
183+
184+extern int devm_led_classdev_register_ext(struct device *parent,
185+ struct led_classdev *led_cdev,
186+ struct led_init_data *init_data);
187+
188+static inline int devm_led_classdev_register(struct device *parent,
189+ struct led_classdev *led_cdev)
190+{
191+ return devm_led_classdev_register_ext(parent, led_cdev, NULL);
192+}
138193 extern void led_classdev_unregister(struct led_classdev *led_cdev);
139194 extern void devm_led_classdev_unregister(struct device *parent,
140195 struct led_classdev *led_cdev);
@@ -243,6 +298,22 @@ extern void led_sysfs_disable(struct led_classdev *led_cdev); · 102 unmodified lines
243298 */
244299 extern void led_sysfs_enable(struct led_classdev *led_cdev);
245300
301+/**
302+ * led_compose_name - compose LED class device name
303+ * @dev: LED controller device object
304+ * @child: child fwnode_handle describing a LED or a group of synchronized LEDs;
305+ * it must be provided only for fwnode based LEDs
306+ * @led_classdev_name: composed LED class device name
307+ *
308+ * Create LED class device name basing on the provided init_data argument.
309+ * The name can have <devicename:color:function> or <color:function>.
310+ * form, depending on the init_data configuration.
311+ *
312+ * Returns: 0 on success or negative error value on failure
313+ */
314+extern int led_compose_name(struct device *dev, struct led_init_data *init_data,
315+ char *led_classdev_name);
316+
246317 /**
247318 * led_sysfs_is_disabled - check if LED sysfs interface is disabled
248319 * @led_cdev: the LED to query
@@ -420,6 +491,15 @@ struct led_platform_data { · 171 unmodified lines
420491 struct led_info *leds;
421492 };
422493
494+struct led_properties {
495+ u32 color;
496+ bool color_present;
497+ const char *function;
498+ u32 func_enum;
499+ bool func_enum_present;
500+ const char *label;
501+};
502+
423503 struct gpio_desc;
424504 typedef int (*gpio_blink_set_t)(struct gpio_desc *desc, int state,
425505 unsigned long *delay_on,
include/linux/libnvdimm.h+6−3
@@ -160,8 +160,11 @@ static inline struct nd_blk_region_desc *to_blk_region_desc( · 159 unmodified lines
160160
161161 }
162162
163−enum nvdimm_security_state {
164− NVDIMM_SECURITY_ERROR = -1,
163+/*
164+ * Note that separate bits for locked + unlocked are defined so that
165+ * 'flags == 0' corresponds to an error / not-supported state.
166+ */
167+enum nvdimm_security_bits {
165168 NVDIMM_SECURITY_DISABLED,
166169 NVDIMM_SECURITY_UNLOCKED,
167170 NVDIMM_SECURITY_LOCKED,
@@ -182,7 +185,7 @@ enum nvdimm_passphrase_type { · 14 unmodified lines
182185 };
183186
184187 struct nvdimm_security_ops {
185− enum nvdimm_security_state (*state)(struct nvdimm *nvdimm,
188+ unsigned long (*get_flags)(struct nvdimm *nvdimm,
186189 enum nvdimm_passphrase_type pass_type);
187190 int (*freeze)(struct nvdimm *nvdimm);
188191 int (*change_key)(struct nvdimm *nvdimm,
include/linux/lightnvm.h+3−5
@@ -88,8 +88,7 @@ typedef int (nvm_op_bb_tbl_fn)(struct nvm_dev *, struct ppa_addr, u8 *); · 87 unmodified lines
8888 typedef int (nvm_op_set_bb_fn)(struct nvm_dev *, struct ppa_addr *, int, int);
8989 typedef int (nvm_get_chk_meta_fn)(struct nvm_dev *, sector_t, int,
9090 struct nvm_chk_meta *);
91−typedef int (nvm_submit_io_fn)(struct nvm_dev *, struct nvm_rq *);
92−typedef int (nvm_submit_io_sync_fn)(struct nvm_dev *, struct nvm_rq *);
91+typedef int (nvm_submit_io_fn)(struct nvm_dev *, struct nvm_rq *, void *);
9392 typedef void *(nvm_create_dma_pool_fn)(struct nvm_dev *, char *, int);
9493 typedef void (nvm_destroy_dma_pool_fn)(void *);
9594 typedef void *(nvm_dev_dma_alloc_fn)(struct nvm_dev *, void *, gfp_t,
@@ -104,7 +103,6 @@ struct nvm_dev_ops { · 8 unmodified lines
104103 nvm_get_chk_meta_fn *get_chk_meta;
105104
106105 nvm_submit_io_fn *submit_io;
107− nvm_submit_io_sync_fn *submit_io_sync;
108106
109107 nvm_create_dma_pool_fn *create_dma_pool;
110108 nvm_destroy_dma_pool_fn *destroy_dma_pool;
@@ -682,8 +680,8 @@ extern int nvm_get_chunk_meta(struct nvm_tgt_dev *, struct ppa_addr, · 571 unmodified lines
682680 int, struct nvm_chk_meta *);
683681 extern int nvm_set_chunk_meta(struct nvm_tgt_dev *, struct ppa_addr *,
684682 int, int);
685−extern int nvm_submit_io(struct nvm_tgt_dev *, struct nvm_rq *);
686−extern int nvm_submit_io_sync(struct nvm_tgt_dev *, struct nvm_rq *);
683+extern int nvm_submit_io(struct nvm_tgt_dev *, struct nvm_rq *, void *);
684+extern int nvm_submit_io_sync(struct nvm_tgt_dev *, struct nvm_rq *, void *);
687685 extern void nvm_end_io(struct nvm_rq *);
688686
689687 #else /* CONFIG_NVM */
include/linux/lockdep.h+4−7
@@ -66,10 +66,7 @@ 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−};
69+struct lock_trace;
7370
7471 #define LOCKSTAT_POINTS 4
7572
@@ -97,7 +94,7 @@ struct lock_class { · 21 unmodified lines
9794 */
9895 struct list_head locks_after, locks_before;
9996
100− struct lockdep_subclass_key *key;
97+ const struct lockdep_subclass_key *key;
10198 unsigned int subclass;
10299 unsigned int dep_gen_id;
103100
@@ -105,7 +102,7 @@ struct lock_class { · 1 unmodified line
105102 * IRQ/softirq usage tracking bits:
106103 */
107104 unsigned long usage_mask;
108− struct lock_trace usage_traces[XXX_LOCK_USAGE_STATES];
105+ const struct lock_trace *usage_traces[XXX_LOCK_USAGE_STATES];
109106
110107 /*
111108 * Generation counter, when doing certain classes of graph walking,
@@ -193,7 +190,7 @@ struct lock_list { · 81 unmodified lines
193190 struct list_head entry;
194191 struct lock_class *class;
195192 struct lock_class *links_to;
196− struct lock_trace trace;
193+ const struct lock_trace *trace;
197194 int distance;
198195
199196 /*
include/linux/logic_pio.h+1−0
@@ -117,6 +117,7 @@ struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode); · 116 unmodified lines
117117 unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,
118118 resource_size_t hw_addr, resource_size_t size);
119119 int logic_pio_register_range(struct logic_pio_hwaddr *newrange);
120+void logic_pio_unregister_range(struct logic_pio_hwaddr *range);
120121 resource_size_t logic_pio_to_hwaddr(unsigned long pio);
121122 unsigned long logic_pio_trans_cpuaddr(resource_size_t hw_addr);
122123
include/linux/lsm_hooks.h+21−1
@@ -339,6 +339,9 @@ · 338 unmodified lines
339339 * Check for permission to change root directory.
340340 * @path contains the path structure.
341341 * Return 0 if permission is granted.
342+ * @path_notify:
343+ * Check permissions before setting a watch on events as defined by @mask,
344+ * on an object at @path, whose type is defined by @obj_type.
342345 * @inode_readlink:
343346 * Check the permission to read the symbolic link.
344347 * @dentry contains the dentry structure for the file link.
@@ -1446,6 +1449,11 @@ · 1101 unmodified lines
14461449 * @bpf_prog_free_security:
14471450 * Clean up the security information stored inside bpf prog.
14481451 *
1452+ * @locked_down
1453+ * Determine whether a kernel feature that potentially enables arbitrary
1454+ * code execution in kernel space should be permitted.
1455+ *
1456+ * @what: kernel feature being accessed
14491457 */
14501458 union security_list_options {
14511459 int (*binder_set_context_mgr)(struct task_struct *mgr);
@@ -1535,7 +1543,9 @@ union security_list_options { · 83 unmodified lines
15351543 int (*path_chown)(const struct path *path, kuid_t uid, kgid_t gid);
15361544 int (*path_chroot)(const struct path *path);
15371545 #endif
1538−
1546+ /* Needed for inode based security check */
1547+ int (*path_notify)(const struct path *path, u64 mask,
1548+ unsigned int obj_type);
15391549 int (*inode_alloc_security)(struct inode *inode);
15401550 void (*inode_free_security)(struct inode *inode);
15411551 int (*inode_init_security)(struct inode *inode, struct inode *dir,
@@ -1807,6 +1817,7 @@ union security_list_options { · 265 unmodified lines
18071817 int (*bpf_prog_alloc_security)(struct bpf_prog_aux *aux);
18081818 void (*bpf_prog_free_security)(struct bpf_prog_aux *aux);
18091819 #endif /* CONFIG_BPF_SYSCALL */
1820+ int (*locked_down)(enum lockdown_reason what);
18101821 };
18111822
18121823 struct security_hook_heads {
@@ -1860,6 +1871,8 @@ struct security_hook_heads { · 47 unmodified lines
18601871 struct hlist_head path_chown;
18611872 struct hlist_head path_chroot;
18621873 #endif
1874+ /* Needed for inode based modules as well */
1875+ struct hlist_head path_notify;
18631876 struct hlist_head inode_alloc_security;
18641877 struct hlist_head inode_free_security;
18651878 struct hlist_head inode_init_security;
@@ -2046,6 +2059,7 @@ struct security_hook_heads { · 180 unmodified lines
20462059 struct hlist_head bpf_prog_alloc_security;
20472060 struct hlist_head bpf_prog_free_security;
20482061 #endif /* CONFIG_BPF_SYSCALL */
2062+ struct hlist_head locked_down;
20492063 } __randomize_layout;
20502064
20512065 /*
@@ -2104,12 +2118,18 @@ struct lsm_info { · 52 unmodified lines
21042118 };
21052119
21062120 extern struct lsm_info __start_lsm_info[], __end_lsm_info[];
2121+extern struct lsm_info __start_early_lsm_info[], __end_early_lsm_info[];
21072122
21082123 #define DEFINE_LSM(lsm) \
21092124 static struct lsm_info __lsm_##lsm \
21102125 __used __section(.lsm_info.init) \
21112126 __aligned(sizeof(unsigned long))
21122127
2128+#define DEFINE_EARLY_LSM(lsm) \
2129+ static struct lsm_info __early_lsm_##lsm \
2130+ __used __section(.early_lsm_info.init) \
2131+ __aligned(sizeof(unsigned long))
2132+
21132133 #ifdef CONFIG_SECURITY_SELINUX_DISABLE
21142134 /*
21152135 * Assuring the safety of deleting a security module is up to
include/linux/mailbox/mtk-cmdq-mailbox.h+3−0
@@ -20,6 +20,9 @@ · 19 unmodified lines
2020 #define CMDQ_WFE_WAIT BIT(15)
2121 #define CMDQ_WFE_WAIT_VALUE 0x1
2222
23+/** cmdq event maximum */
24+#define CMDQ_MAX_EVENT 0x3ff
25+
2326 /*
2427 * CMDQ_CODE_MASK:
2528 * set write mask
include/linux/mdio.h+11−0
@@ -68,6 +68,17 @@ struct mdio_driver { · 67 unmodified lines
6868 #define to_mdio_driver(d) \
6969 container_of(to_mdio_common_driver(d), struct mdio_driver, mdiodrv)
7070
71+/* device driver data */
72+static inline void mdiodev_set_drvdata(struct mdio_device *mdio, void *data)
73+{
74+ dev_set_drvdata(&mdio->dev, data);
75+}
76+
77+static inline void *mdiodev_get_drvdata(struct mdio_device *mdio)
78+{
79+ return dev_get_drvdata(&mdio->dev);
80+}
81+
7182 void mdio_device_free(struct mdio_device *mdiodev);
7283 struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr);
7384 int mdio_device_register(struct mdio_device *mdiodev);
include/linux/mem_encrypt.h+1−14
@@ -18,23 +18,10 @@ · 17 unmodified lines
1818
1919 #else /* !CONFIG_ARCH_HAS_MEM_ENCRYPT */
2020
21−#define sme_me_mask 0ULL
22−
23−static inline bool sme_active(void) { return false; }
24−static inline bool sev_active(void) { return false; }
21+static inline bool mem_encrypt_active(void) { return false; }
2522
2623 #endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
2724
28−static inline bool mem_encrypt_active(void)
29−{
30− return sme_me_mask;
31−}
32−
33−static inline u64 sme_get_me_mask(void)
34−{
35− return sme_me_mask;
36−}
37−
3825 #ifdef CONFIG_AMD_MEM_ENCRYPT
3926 /*
4027 * The __sme_set() and __sme_clr() macros are useful for adding or removing
include/linux/memcontrol.h+73−8
@@ -128,9 +128,8 @@ struct mem_cgroup_per_node { · 127 unmodified lines
128128
129129 struct mem_cgroup_reclaim_iter iter[DEF_PRIORITY + 1];
130130
131−#ifdef CONFIG_MEMCG_KMEM
132131 struct memcg_shrinker_map __rcu *shrinker_map;
133−#endif
132+
134133 struct rb_node tree_node; /* RB tree node */
135134 unsigned long usage_in_excess;/* Set to the value by which */
136135 /* the soft limit is exceeded*/
@@ -183,6 +182,23 @@ struct memcg_padding { · 46 unmodified lines
183182 #define MEMCG_PADDING(name)
184183 #endif
185184
185+/*
186+ * Remember four most recent foreign writebacks with dirty pages in this
187+ * cgroup. Inode sharing is expected to be uncommon and, even if we miss
188+ * one in a given round, we're likely to catch it later if it keeps
189+ * foreign-dirtying, so a fairly low count should be enough.
190+ *
191+ * See mem_cgroup_track_foreign_dirty_slowpath() for details.
192+ */
193+#define MEMCG_CGWB_FRN_CNT 4
194+
195+struct memcg_cgwb_frn {
196+ u64 bdi_id; /* bdi->id of the foreign inode */
197+ int memcg_id; /* memcg->css.id of foreign inode */
198+ u64 at; /* jiffies_64 at the time of dirtying */
199+ struct wb_completion done; /* tracks in-flight foreign writebacks */
200+};
201+
186202 /*
187203 * The memory controller data structure. The memory controller controls both
188204 * page cache and RSS per cgroup. We would eventually like to provide
@@ -307,12 +323,17 @@ struct mem_cgroup { · 118 unmodified lines
307323 #ifdef CONFIG_CGROUP_WRITEBACK
308324 struct list_head cgwb_list;
309325 struct wb_domain cgwb_domain;
326+ struct memcg_cgwb_frn cgwb_frn[MEMCG_CGWB_FRN_CNT];
310327 #endif
311328
312329 /* List of events which userspace want to receive */
313330 struct list_head event_list;
314331 spinlock_t event_list_lock;
315332
333+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
334+ struct deferred_split deferred_split_queue;
335+#endif
336+
316337 struct mem_cgroup_per_node *nodeinfo[0];
317338 /* WARNING: nodeinfo must be the last member here */
318339 };
@@ -668,6 +689,7 @@ static inline unsigned long lruvec_page_state_local(struct lruvec *lruvec, · 349 unmodified lines
668689
669690 void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx,
670691 int val);
692+void __mod_lruvec_slab_state(void *p, enum node_stat_item idx, int val);
671693
672694 static inline void mod_lruvec_state(struct lruvec *lruvec,
673695 enum node_stat_item idx, int val)
@@ -1072,6 +1094,14 @@ static inline void mod_lruvec_page_state(struct page *page, · 398 unmodified lines
10721094 mod_node_page_state(page_pgdat(page), idx, val);
10731095 }
10741096
1097+static inline void __mod_lruvec_slab_state(void *p, enum node_stat_item idx,
1098+ int val)
1099+{
1100+ struct page *page = virt_to_head_page(p);
1101+
1102+ __mod_node_page_state(page_pgdat(page), idx, val);
1103+}
1104+
10751105 static inline
10761106 unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order,
10771107 gfp_t gfp_mask,
@@ -1159,6 +1189,16 @@ static inline void __dec_lruvec_page_state(struct page *page, · 81 unmodified lines
11591189 __mod_lruvec_page_state(page, idx, -1);
11601190 }
11611191
1192+static inline void __inc_lruvec_slab_state(void *p, enum node_stat_item idx)
1193+{
1194+ __mod_lruvec_slab_state(p, idx, 1);
1195+}
1196+
1197+static inline void __dec_lruvec_slab_state(void *p, enum node_stat_item idx)
1198+{
1199+ __mod_lruvec_slab_state(p, idx, -1);
1200+}
1201+
11621202 /* idx can be of type enum memcg_stat_item or node_stat_item */
11631203 static inline void inc_memcg_state(struct mem_cgroup *memcg,
11641204 int idx)
@@ -1218,6 +1258,18 @@ void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages, · 53 unmodified lines
12181258 unsigned long *pheadroom, unsigned long *pdirty,
12191259 unsigned long *pwriteback);
12201260
1261+void mem_cgroup_track_foreign_dirty_slowpath(struct page *page,
1262+ struct bdi_writeback *wb);
1263+
1264+static inline void mem_cgroup_track_foreign_dirty(struct page *page,
1265+ struct bdi_writeback *wb)
1266+{
1267+ if (unlikely(&page->mem_cgroup->css != wb->memcg_css))
1268+ mem_cgroup_track_foreign_dirty_slowpath(page, wb);
1269+}
1270+
1271+void mem_cgroup_flush_foreign(struct bdi_writeback *wb);
1272+
12211273 #else /* CONFIG_CGROUP_WRITEBACK */
12221274
12231275 static inline struct wb_domain *mem_cgroup_wb_domain(struct bdi_writeback *wb)
@@ -1233,6 +1285,15 @@ static inline void mem_cgroup_wb_stats(struct bdi_writeback *wb, · 9 unmodified lines
12331285 {
12341286 }
12351287
1288+static inline void mem_cgroup_track_foreign_dirty(struct page *page,
1289+ struct bdi_writeback *wb)
1290+{
1291+}
1292+
1293+static inline void mem_cgroup_flush_foreign(struct bdi_writeback *wb)
1294+{
1295+}
1296+
12361297 #endif /* CONFIG_CGROUP_WRITEBACK */
12371298
12381299 struct sock;
@@ -1253,6 +1314,11 @@ static inline bool mem_cgroup_under_socket_pressure(struct mem_cgroup *memcg) · 14 unmodified lines
12531314 } while ((memcg = parent_mem_cgroup(memcg)));
12541315 return false;
12551316 }
1317+
1318+extern int memcg_expand_shrinker_maps(int new_id);
1319+
1320+extern void memcg_set_shrinker_bit(struct mem_cgroup *memcg,
1321+ int nid, int shrinker_id);
12561322 #else
12571323 #define mem_cgroup_sockets_enabled 0
12581324 static inline void mem_cgroup_sk_alloc(struct sock *sk) { };
@@ -1261,6 +1327,11 @@ static inline bool mem_cgroup_under_socket_pressure(struct mem_cgroup *memcg) · 2 unmodified lines
12611327 {
12621328 return false;
12631329 }
1330+
1331+static inline void memcg_set_shrinker_bit(struct mem_cgroup *memcg,
1332+ int nid, int shrinker_id)
1333+{
1334+}
12641335 #endif
12651336
12661337 struct kmem_cache *memcg_kmem_get_cache(struct kmem_cache *cachep);
@@ -1332,10 +1403,6 @@ static inline int memcg_cache_id(struct mem_cgroup *memcg) · 65 unmodified lines
13321403 return memcg ? memcg->kmemcg_id : -1;
13331404 }
13341405
1335−extern int memcg_expand_shrinker_maps(int new_id);
1336−
1337−extern void memcg_set_shrinker_bit(struct mem_cgroup *memcg,
1338− int nid, int shrinker_id);
13391406 #else
13401407
13411408 static inline int memcg_kmem_charge(struct page *page, gfp_t gfp, int order)
@@ -1377,8 +1444,6 @@ static inline void memcg_put_cache_ids(void) · 35 unmodified lines
13771444 {
13781445 }
13791446
1380−static inline void memcg_set_shrinker_bit(struct mem_cgroup *memcg,
1381− int nid, int shrinker_id) { }
13821447 #endif /* CONFIG_MEMCG_KMEM */
13831448
13841449 #endif /* _LINUX_MEMCONTROL_H */
include/linux/memory.h+3−4
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525
2626 struct memory_block {
2727 unsigned long start_section_nr;
28− unsigned long end_section_nr;
2928 unsigned long state; /* serialized by the dev->lock */
3029 int section_count; /* serialized by mem_sysfs_mutex */
3130 int online_type; /* for passing data to online routine */
@@ -80,9 +79,9 @@ struct mem_section; · 48 unmodified lines
8079 #define IPC_CALLBACK_PRI 10
8180
8281 #ifndef CONFIG_MEMORY_HOTPLUG_SPARSE
83−static inline int memory_dev_init(void)
82+static inline void memory_dev_init(void)
8483 {
85− return 0;
84+ return;
8685 }
8786 static inline int register_memory_notifier(struct notifier_block *nb)
8887 {
@@ -113,7 +112,7 @@ extern int register_memory_isolate_notifier(struct notifier_block *nb); · 24 unmodified lines
113112 extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
114113 int create_memory_block_devices(unsigned long start, unsigned long size);
115114 void remove_memory_block_devices(unsigned long start, unsigned long size);
116−extern int memory_dev_init(void);
115+extern void memory_dev_init(void);
117116 extern int memory_notify(unsigned long val, void *v);
118117 extern int memory_isolate_notify(unsigned long val, void *v);
119118 extern struct memory_block *find_memory_block(struct mem_section *);
include/linux/memremap.h+3−2
@@ -17,6 +17,7 @@ struct device; · 16 unmodified lines
1717 */
1818 struct vmem_altmap {
1919 const unsigned long base_pfn;
20+ const unsigned long end_pfn;
2021 const unsigned long reserve;
2122 unsigned long free;
2223 unsigned long align;
@@ -109,10 +110,8 @@ struct dev_pagemap { · 86 unmodified lines
109110 struct percpu_ref *ref;
110111 struct percpu_ref internal_ref;
111112 struct completion done;
112− struct device *dev;
113113 enum memory_type type;
114114 unsigned int flags;
115− u64 pci_p2pdma_bus_offset;
116115 const struct dev_pagemap_ops *ops;
117116 };
118117
@@ -124,6 +123,8 @@ static inline struct vmem_altmap *pgmap_altmap(struct dev_pagemap *pgmap) · 5 unmodified lines
124123 }
125124
126125 #ifdef CONFIG_ZONE_DEVICE
126+void *memremap_pages(struct dev_pagemap *pgmap, int nid);
127+void memunmap_pages(struct dev_pagemap *pgmap);
127128 void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
128129 void devm_memunmap_pages(struct device *dev, struct dev_pagemap *pgmap);
129130 struct dev_pagemap *get_dev_pagemap(unsigned long pfn,
include/linux/mfd/aat2870.h+0−1
@@ -136,7 +136,6 @@ struct aat2870_data { · 135 unmodified lines
136136
137137 /* for debugfs */
138138 struct dentry *dentry_root;
139− struct dentry *dentry_reg;
140139 };
141140
142141 struct aat2870_subdev_info {
include/linux/mfd/cros_ec.h+0−292
@@ -8,183 +8,11 @@ · 7 unmodified lines
88 #ifndef __LINUX_MFD_CROS_EC_H
99 #define __LINUX_MFD_CROS_EC_H
1010
11−#include <linux/cdev.h>
1211 #include <linux/device.h>
13−#include <linux/notifier.h>
14−#include <linux/mfd/cros_ec_commands.h>
15−#include <linux/mutex.h>
16−
17−#define CROS_EC_DEV_NAME "cros_ec"
18−#define CROS_EC_DEV_FP_NAME "cros_fp"
19−#define CROS_EC_DEV_PD_NAME "cros_pd"
20−#define CROS_EC_DEV_TP_NAME "cros_tp"
21−#define CROS_EC_DEV_ISH_NAME "cros_ish"
22−#define CROS_EC_DEV_SCP_NAME "cros_scp"
23−
24−/*
25− * The EC is unresponsive for a time after a reboot command. Add a
26− * simple delay to make sure that the bus stays locked.
27− */
28−#define EC_REBOOT_DELAY_MS 50
29−
30−/*
31− * Max bus-specific overhead incurred by request/responses.
32− * I2C requires 1 additional byte for requests.
33− * I2C requires 2 additional bytes for responses.
34− * SPI requires up to 32 additional bytes for responses.
35− */
36−#define EC_PROTO_VERSION_UNKNOWN 0
37−#define EC_MAX_REQUEST_OVERHEAD 1
38−#define EC_MAX_RESPONSE_OVERHEAD 32
39−
40−/*
41− * Command interface between EC and AP, for LPC, I2C and SPI interfaces.
42− */
43−enum {
44− EC_MSG_TX_HEADER_BYTES = 3,
45− EC_MSG_TX_TRAILER_BYTES = 1,
46− EC_MSG_TX_PROTO_BYTES = EC_MSG_TX_HEADER_BYTES +
47− EC_MSG_TX_TRAILER_BYTES,
48− EC_MSG_RX_PROTO_BYTES = 3,
49−
50− /* Max length of messages for proto 2*/
51− EC_PROTO2_MSG_BYTES = EC_PROTO2_MAX_PARAM_SIZE +
52− EC_MSG_TX_PROTO_BYTES,
53−
54− EC_MAX_MSG_BYTES = 64 * 1024,
55−};
56−
57−/**
58− * struct cros_ec_command - Information about a ChromeOS EC command.
59− * @version: Command version number (often 0).
60− * @command: Command to send (EC_CMD_...).
61− * @outsize: Outgoing length in bytes.
62− * @insize: Max number of bytes to accept from the EC.
63− * @result: EC's response to the command (separate from communication failure).
64− * @data: Where to put the incoming data from EC and outgoing data to EC.
65− */
66−struct cros_ec_command {
67− uint32_t version;
68− uint32_t command;
69− uint32_t outsize;
70− uint32_t insize;
71− uint32_t result;
72− uint8_t data[0];
73−};
74−
75−/**
76− * struct cros_ec_device - Information about a ChromeOS EC device.
77− * @phys_name: Name of physical comms layer (e.g. 'i2c-4').
78− * @dev: Device pointer for physical comms device
79− * @was_wake_device: True if this device was set to wake the system from
80− * sleep at the last suspend.
81− * @cros_class: The class structure for this device.
82− * @cmd_readmem: Direct read of the EC memory-mapped region, if supported.
83− * @offset: Is within EC_LPC_ADDR_MEMMAP region.
84− * @bytes: Number of bytes to read. zero means "read a string" (including
85− * the trailing '\0'). At most only EC_MEMMAP_SIZE bytes can be
86− * read. Caller must ensure that the buffer is large enough for the
87− * result when reading a string.
88− * @max_request: Max size of message requested.
89− * @max_response: Max size of message response.
90− * @max_passthru: Max sice of passthru message.
91− * @proto_version: The protocol version used for this device.
92− * @priv: Private data.
93− * @irq: Interrupt to use.
94− * @id: Device id.
95− * @din: Input buffer (for data from EC). This buffer will always be
96− * dword-aligned and include enough space for up to 7 word-alignment
97− * bytes also, so we can ensure that the body of the message is always
98− * dword-aligned (64-bit). We use this alignment to keep ARM and x86
99− * happy. Probably word alignment would be OK, there might be a small
100− * performance advantage to using dword.
101− * @dout: Output buffer (for data to EC). This buffer will always be
102− * dword-aligned and include enough space for up to 7 word-alignment
103− * bytes also, so we can ensure that the body of the message is always
104− * dword-aligned (64-bit). We use this alignment to keep ARM and x86
105− * happy. Probably word alignment would be OK, there might be a small
106− * performance advantage to using dword.
107− * @din_size: Size of din buffer to allocate (zero to use static din).
108− * @dout_size: Size of dout buffer to allocate (zero to use static dout).
109− * @wake_enabled: True if this device can wake the system from sleep.
110− * @suspended: True if this device had been suspended.
111− * @cmd_xfer: Send command to EC and get response.
112− * Returns the number of bytes received if the communication
113− * succeeded, but that doesn't mean the EC was happy with the
114− * command. The caller should check msg.result for the EC's result
115− * code.
116− * @pkt_xfer: Send packet to EC and get response.
117− * @lock: One transaction at a time.
118− * @mkbp_event_supported: True if this EC supports the MKBP event protocol.
119− * @host_sleep_v1: True if this EC supports the sleep v1 command.
120− * @event_notifier: Interrupt event notifier for transport devices.
121− * @event_data: Raw payload transferred with the MKBP event.
122− * @event_size: Size in bytes of the event data.
123− * @host_event_wake_mask: Mask of host events that cause wake from suspend.
124− */
125−struct cros_ec_device {
126− /* These are used by other drivers that want to talk to the EC */
127− const char *phys_name;
128− struct device *dev;
129− bool was_wake_device;
130− struct class *cros_class;
131− int (*cmd_readmem)(struct cros_ec_device *ec, unsigned int offset,
132− unsigned int bytes, void *dest);
133−
134− /* These are used to implement the platform-specific interface */
135− u16 max_request;
136− u16 max_response;
137− u16 max_passthru;
138− u16 proto_version;
139− void *priv;
140− int irq;
141− u8 *din;
142− u8 *dout;
143− int din_size;
144− int dout_size;
145− bool wake_enabled;
146− bool suspended;
147− int (*cmd_xfer)(struct cros_ec_device *ec,
148− struct cros_ec_command *msg);
149− int (*pkt_xfer)(struct cros_ec_device *ec,
150− struct cros_ec_command *msg);
151− struct mutex lock;
152− bool mkbp_event_supported;
153− bool host_sleep_v1;
154− struct blocking_notifier_head event_notifier;
155−
156− struct ec_response_get_next_event_v1 event_data;
157− int event_size;
158− u32 host_event_wake_mask;
159− u32 last_resume_result;
160−};
161−
162−/**
163− * struct cros_ec_sensor_platform - ChromeOS EC sensor platform information.
164− * @sensor_num: Id of the sensor, as reported by the EC.
165− */
166−struct cros_ec_sensor_platform {
167− u8 sensor_num;
168−};
169−
170−/**
171− * struct cros_ec_platform - ChromeOS EC platform information.
172− * @ec_name: Name of EC device (e.g. 'cros-ec', 'cros-pd', ...)
173− * used in /dev/ and sysfs.
174− * @cmd_offset: Offset to apply for each command. Set when
175− * registering a device behind another one.
176− */
177−struct cros_ec_platform {
178− const char *ec_name;
179− u16 cmd_offset;
180−};
181−
182−struct cros_ec_debugfs;
18312
18413 /**
18514 * struct cros_ec_dev - ChromeOS EC device entry point.
18615 * @class_dev: Device structure used in sysfs.
187− * @cdev: Character device structure in /dev.
18816 * @ec_dev: cros_ec_device structure to talk to the physical device.
18917 * @dev: Pointer to the platform device.
19018 * @debug_info: cros_ec_debugfs structure for debugging information.
@@ -194,7 +22,6 @@ struct cros_ec_debugfs; · 3 unmodified lines
19422 */
19523 struct cros_ec_dev {
19624 struct device class_dev;
197− struct cdev cdev;
19825 struct cros_ec_device *ec_dev;
19926 struct device *dev;
20027 struct cros_ec_debugfs *debug_info;
@@ -205,123 +32,4 @@ struct cros_ec_dev { · 4 unmodified lines
20532
20633 #define to_cros_ec_dev(dev) container_of(dev, struct cros_ec_dev, class_dev)
20734
208−/**
209− * cros_ec_suspend() - Handle a suspend operation for the ChromeOS EC device.
210− * @ec_dev: Device to suspend.
211− *
212− * This can be called by drivers to handle a suspend event.
213− *
214− * Return: 0 on success or negative error code.
215− */
216−int cros_ec_suspend(struct cros_ec_device *ec_dev);
217−
218−/**
219− * cros_ec_resume() - Handle a resume operation for the ChromeOS EC device.
220− * @ec_dev: Device to resume.
221− *
222− * This can be called by drivers to handle a resume event.
223− *
224− * Return: 0 on success or negative error code.
225− */
226−int cros_ec_resume(struct cros_ec_device *ec_dev);
227−
228−/**
229− * cros_ec_prepare_tx() - Prepare an outgoing message in the output buffer.
230− * @ec_dev: Device to register.
231− * @msg: Message to write.
232− *
233− * This is intended to be used by all ChromeOS EC drivers, but at present
234− * only SPI uses it. Once LPC uses the same protocol it can start using it.
235− * I2C could use it now, with a refactor of the existing code.
236− *
237− * Return: 0 on success or negative error code.
238− */
239−int cros_ec_prepare_tx(struct cros_ec_device *ec_dev,
240− struct cros_ec_command *msg);
241−
242−/**
243− * cros_ec_check_result() - Check ec_msg->result.
244− * @ec_dev: EC device.
245− * @msg: Message to check.
246− *
247− * This is used by ChromeOS EC drivers to check the ec_msg->result for
248− * errors and to warn about them.
249− *
250− * Return: 0 on success or negative error code.
251− */
252−int cros_ec_check_result(struct cros_ec_device *ec_dev,
253− struct cros_ec_command *msg);
254−
255−/**
256− * cros_ec_cmd_xfer() - Send a command to the ChromeOS EC.
257− * @ec_dev: EC device.
258− * @msg: Message to write.
259− *
260− * Call this to send a command to the ChromeOS EC. This should be used
261− * instead of calling the EC's cmd_xfer() callback directly.
262− *
263− * Return: 0 on success or negative error code.
264− */
265−int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev,
266− struct cros_ec_command *msg);
267−
268−/**
269− * cros_ec_cmd_xfer_status() - Send a command to the ChromeOS EC.
270− * @ec_dev: EC device.
271− * @msg: Message to write.
272− *
273− * This function is identical to cros_ec_cmd_xfer, except it returns success
274− * status only if both the command was transmitted successfully and the EC
275− * replied with success status. It's not necessary to check msg->result when
276− * using this function.
277− *
278− * Return: The number of bytes transferred on success or negative error code.
279− */
280−int cros_ec_cmd_xfer_status(struct cros_ec_device *ec_dev,
281− struct cros_ec_command *msg);
282−
283−/**
284− * cros_ec_register() - Register a new ChromeOS EC, using the provided info.
285− * @ec_dev: Device to register.
286− *
287− * Before calling this, allocate a pointer to a new device and then fill
288− * in all the fields up to the --private-- marker.
289− *
290− * Return: 0 on success or negative error code.
291− */
292−int cros_ec_register(struct cros_ec_device *ec_dev);
293−
294−/**
295− * cros_ec_query_all() - Query the protocol version supported by the
296− * ChromeOS EC.
297− * @ec_dev: Device to register.
298− *
299− * Return: 0 on success or negative error code.
300− */
301−int cros_ec_query_all(struct cros_ec_device *ec_dev);
302−
303−/**
304− * cros_ec_get_next_event() - Fetch next event from the ChromeOS EC.
305− * @ec_dev: Device to fetch event from.
306− * @wake_event: Pointer to a bool set to true upon return if the event might be
307− * treated as a wake event. Ignored if null.
308− *
309− * Return: negative error code on errors; 0 for no data; or else number of
310− * bytes received (i.e., an event was retrieved successfully). Event types are
311− * written out to @ec_dev->event_data.event_type on success.
312− */
313−int cros_ec_get_next_event(struct cros_ec_device *ec_dev, bool *wake_event);
314−
315−/**
316− * cros_ec_get_host_event() - Return a mask of event set by the ChromeOS EC.
317− * @ec_dev: Device to fetch event from.
318− *
319− * When MKBP is supported, when the EC raises an interrupt, we collect the
320− * events raised and call the functions in the ec notifier. This function
321− * is a helper to know which events are raised.
322− *
323− * Return: 0 on error or non-zero bitmask of one or more EC_HOST_EVENT_*.
324− */
325−u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev);
326−
32735 #endif /* __LINUX_MFD_CROS_EC_H */
include/linux/mfd/da9063/pdata.h+0−60
@@ -1,60 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-or-later */
2−/*
3− * Platform configuration options for DA9063
4− *
5− * Copyright 2012 Dialog Semiconductor Ltd.
6− *
7− * Author: Michal Hajduk, Dialog Semiconductor
8− * Author: Krystian Garbaciak, Dialog Semiconductor
9− */
10−
11−#ifndef __MFD_DA9063_PDATA_H__
12−#define __MFD_DA9063_PDATA_H__
13−
14−/*
15− * RGB LED configuration
16− */
17−/* LED IDs for flags in struct led_info. */
18−enum {
19− DA9063_GPIO11_LED,
20− DA9063_GPIO14_LED,
21− DA9063_GPIO15_LED,
22−
23− DA9063_LED_NUM
24−};
25−#define DA9063_LED_ID_MASK 0x3
26−
27−/* LED polarity for flags in struct led_info. */
28−#define DA9063_LED_HIGH_LEVEL_ACTIVE 0x0
29−#define DA9063_LED_LOW_LEVEL_ACTIVE 0x4
30−
31−
32−/*
33− * General PMIC configuration
34− */
35−/* HWMON ADC channels configuration */
36−#define DA9063_FLG_FORCE_IN0_MANUAL_MODE 0x0010
37−#define DA9063_FLG_FORCE_IN0_AUTO_MODE 0x0020
38−#define DA9063_FLG_FORCE_IN1_MANUAL_MODE 0x0040
39−#define DA9063_FLG_FORCE_IN1_AUTO_MODE 0x0080
40−#define DA9063_FLG_FORCE_IN2_MANUAL_MODE 0x0100
41−#define DA9063_FLG_FORCE_IN2_AUTO_MODE 0x0200
42−#define DA9063_FLG_FORCE_IN3_MANUAL_MODE 0x0400
43−#define DA9063_FLG_FORCE_IN3_AUTO_MODE 0x0800
44−
45−/* Disable register caching. */
46−#define DA9063_FLG_NO_CACHE 0x0008
47−
48−struct da9063;
49−
50−/* DA9063 platform data */
51−struct da9063_pdata {
52− int (*init)(struct da9063 *da9063);
53− int irq_base;
54− bool key_power;
55− unsigned flags;
56− struct da9063_regulators_pdata *regulators_pdata;
57− struct led_platform_data *leds_pdata;
58−};
59−
60−#endif /* __MFD_DA9063_PDATA_H__ */
include/linux/mfd/intel_soc_pmic_mrfld.h+81−0
@@ -0,0 +1,81 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Header file for Intel Merrifield Basin Cove PMIC
4+ *
5+ * Copyright (C) 2019 Intel Corporation. All rights reserved.
6+ */
7+
8+#ifndef __INTEL_SOC_PMIC_MRFLD_H__
9+#define __INTEL_SOC_PMIC_MRFLD_H__
10+
11+#include <linux/bits.h>
12+
13+#define BCOVE_ID 0x00
14+
15+#define BCOVE_ID_MINREV0 GENMASK(2, 0)
16+#define BCOVE_ID_MAJREV0 GENMASK(5, 3)
17+#define BCOVE_ID_VENDID0 GENMASK(7, 6)
18+
19+#define BCOVE_MINOR(x) (unsigned int)(((x) & BCOVE_ID_MINREV0) >> 0)
20+#define BCOVE_MAJOR(x) (unsigned int)(((x) & BCOVE_ID_MAJREV0) >> 3)
21+#define BCOVE_VENDOR(x) (unsigned int)(((x) & BCOVE_ID_VENDID0) >> 6)
22+
23+#define BCOVE_IRQLVL1 0x01
24+
25+#define BCOVE_PBIRQ 0x02
26+#define BCOVE_TMUIRQ 0x03
27+#define BCOVE_THRMIRQ 0x04
28+#define BCOVE_BCUIRQ 0x05
29+#define BCOVE_ADCIRQ 0x06
30+#define BCOVE_CHGRIRQ0 0x07
31+#define BCOVE_CHGRIRQ1 0x08
32+#define BCOVE_GPIOIRQ 0x09
33+#define BCOVE_CRITIRQ 0x0B
34+
35+#define BCOVE_MIRQLVL1 0x0C
36+
37+#define BCOVE_MPBIRQ 0x0D
38+#define BCOVE_MTMUIRQ 0x0E
39+#define BCOVE_MTHRMIRQ 0x0F
40+#define BCOVE_MBCUIRQ 0x10
41+#define BCOVE_MADCIRQ 0x11
42+#define BCOVE_MCHGRIRQ0 0x12
43+#define BCOVE_MCHGRIRQ1 0x13
44+#define BCOVE_MGPIOIRQ 0x14
45+#define BCOVE_MCRITIRQ 0x16
46+
47+#define BCOVE_SCHGRIRQ0 0x4E
48+#define BCOVE_SCHGRIRQ1 0x4F
49+
50+/* Level 1 IRQs */
51+#define BCOVE_LVL1_PWRBTN BIT(0) /* power button */
52+#define BCOVE_LVL1_TMU BIT(1) /* time management unit */
53+#define BCOVE_LVL1_THRM BIT(2) /* thermal */
54+#define BCOVE_LVL1_BCU BIT(3) /* burst control unit */
55+#define BCOVE_LVL1_ADC BIT(4) /* ADC */
56+#define BCOVE_LVL1_CHGR BIT(5) /* charger */
57+#define BCOVE_LVL1_GPIO BIT(6) /* GPIO */
58+#define BCOVE_LVL1_CRIT BIT(7) /* critical event */
59+
60+/* Level 2 IRQs: power button */
61+#define BCOVE_PBIRQ_PBTN BIT(0)
62+#define BCOVE_PBIRQ_UBTN BIT(1)
63+
64+/* Level 2 IRQs: ADC */
65+#define BCOVE_ADCIRQ_BATTEMP BIT(2)
66+#define BCOVE_ADCIRQ_SYSTEMP BIT(3)
67+#define BCOVE_ADCIRQ_BATTID BIT(4)
68+#define BCOVE_ADCIRQ_VIBATT BIT(5)
69+#define BCOVE_ADCIRQ_CCTICK BIT(7)
70+
71+/* Level 2 IRQs: charger */
72+#define BCOVE_CHGRIRQ_BAT0ALRT BIT(4)
73+#define BCOVE_CHGRIRQ_BAT1ALRT BIT(5)
74+#define BCOVE_CHGRIRQ_BATCRIT BIT(6)
75+
76+#define BCOVE_CHGRIRQ_VBUSDET BIT(0)
77+#define BCOVE_CHGRIRQ_DCDET BIT(1)
78+#define BCOVE_CHGRIRQ_BATTDET BIT(2)
79+#define BCOVE_CHGRIRQ_USBIDDET BIT(3)
80+
81+#endif /* __INTEL_SOC_PMIC_MRFLD_H__ */
include/linux/mfd/mt6397/core.h+11−0
@@ -7,6 +7,14 @@ · 6 unmodified lines
77 #ifndef __MFD_MT6397_CORE_H__
88 #define __MFD_MT6397_CORE_H__
99
10+#include <linux/mutex.h>
11+
12+enum chip_id {
13+ MT6323_CHIP_ID = 0x23,
14+ MT6391_CHIP_ID = 0x91,
15+ MT6397_CHIP_ID = 0x97,
16+};
17+
1018 enum mt6397_irq_numbers {
1119 MT6397_IRQ_SPKL_AB = 0,
1220 MT6397_IRQ_SPKR_AB,
@@ -54,6 +62,9 @@ struct mt6397_chip { · 41 unmodified lines
5462 u16 irq_masks_cache[2];
5563 u16 int_con[2];
5664 u16 int_status[2];
65+ u16 chip_id;
5766 };
5867
68+int mt6397_irq_init(struct mt6397_chip *chip);
69+
5970 #endif /* __MFD_MT6397_CORE_H__ */
include/linux/mfd/syscon.h+6−0
@@ -17,12 +17,18 @@ · 16 unmodified lines
1717 struct device_node;
1818
1919 #ifdef CONFIG_MFD_SYSCON
20+extern struct regmap *device_node_to_regmap(struct device_node *np);
2021 extern struct regmap *syscon_node_to_regmap(struct device_node *np);
2122 extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
2223 extern struct regmap *syscon_regmap_lookup_by_phandle(
2324 struct device_node *np,
2425 const char *property);
2526 #else
27+static inline struct regmap *device_node_to_regmap(struct device_node *np)
28+{
29+ return ERR_PTR(-ENOTSUPP);
30+}
31+
2632 static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
2733 {
2834 return ERR_PTR(-ENOTSUPP);
include/linux/migrate.h+19−101
@@ -166,8 +166,6 @@ static inline int migrate_misplaced_transhuge_page(struct mm_struct *mm, · 165 unmodified lines
166166 #define MIGRATE_PFN_MIGRATE (1UL << 1)
167167 #define MIGRATE_PFN_LOCKED (1UL << 2)
168168 #define MIGRATE_PFN_WRITE (1UL << 3)
169−#define MIGRATE_PFN_DEVICE (1UL << 4)
170−#define MIGRATE_PFN_ERROR (1UL << 5)
171169 #define MIGRATE_PFN_SHIFT 6
172170
173171 static inline struct page *migrate_pfn_to_page(unsigned long mpfn)
@@ -182,107 +180,27 @@ static inline unsigned long migrate_pfn(unsigned long pfn) · 8 unmodified lines
182180 return (pfn << MIGRATE_PFN_SHIFT) | MIGRATE_PFN_VALID;
183181 }
184182
185−/*
186− * struct migrate_vma_ops - migrate operation callback
187− *
188− * @alloc_and_copy: alloc destination memory and copy source memory to it
189− * @finalize_and_map: allow caller to map the successfully migrated pages
190− *
191− *
192− * The alloc_and_copy() callback happens once all source pages have been locked,
193− * unmapped and checked (checked whether pinned or not). All pages that can be
194− * migrated will have an entry in the src array set with the pfn value of the
195− * page and with the MIGRATE_PFN_VALID and MIGRATE_PFN_MIGRATE flag set (other
196− * flags might be set but should be ignored by the callback).
197− *
198− * The alloc_and_copy() callback can then allocate destination memory and copy
199− * source memory to it for all those entries (ie with MIGRATE_PFN_VALID and
200− * MIGRATE_PFN_MIGRATE flag set). Once these are allocated and copied, the
201− * callback must update each corresponding entry in the dst array with the pfn
202− * value of the destination page and with the MIGRATE_PFN_VALID and
203− * MIGRATE_PFN_LOCKED flags set (destination pages must have their struct pages
204− * locked, via lock_page()).
205− *
206− * At this point the alloc_and_copy() callback is done and returns.
207− *
208− * Note that the callback does not have to migrate all the pages that are
209− * marked with MIGRATE_PFN_MIGRATE flag in src array unless this is a migration
210− * from device memory to system memory (ie the MIGRATE_PFN_DEVICE flag is also
211− * set in the src array entry). If the device driver cannot migrate a device
212− * page back to system memory, then it must set the corresponding dst array
213− * entry to MIGRATE_PFN_ERROR. This will trigger a SIGBUS if CPU tries to
214− * access any of the virtual addresses originally backed by this page. Because
215− * a SIGBUS is such a severe result for the userspace process, the device
216− * driver should avoid setting MIGRATE_PFN_ERROR unless it is really in an
217− * unrecoverable state.
218− *
219− * For empty entry inside CPU page table (pte_none() or pmd_none() is true) we
220− * do set MIGRATE_PFN_MIGRATE flag inside the corresponding source array thus
221− * allowing device driver to allocate device memory for those unback virtual
222− * address. For this the device driver simply have to allocate device memory
223− * and properly set the destination entry like for regular migration. Note that
224− * this can still fails and thus inside the device driver must check if the
225− * migration was successful for those entry inside the finalize_and_map()
226− * callback just like for regular migration.
227− *
228− * THE alloc_and_copy() CALLBACK MUST NOT CHANGE ANY OF THE SRC ARRAY ENTRIES
229− * OR BAD THINGS WILL HAPPEN !
230− *
231− *
232− * The finalize_and_map() callback happens after struct page migration from
233− * source to destination (destination struct pages are the struct pages for the
234− * memory allocated by the alloc_and_copy() callback). Migration can fail, and
235− * thus the finalize_and_map() allows the driver to inspect which pages were
236− * successfully migrated, and which were not. Successfully migrated pages will
237− * have the MIGRATE_PFN_MIGRATE flag set for their src array entry.
238− *
239− * It is safe to update device page table from within the finalize_and_map()
240− * callback because both destination and source page are still locked, and the
241− * mmap_sem is held in read mode (hence no one can unmap the range being
242− * migrated).
243− *
244− * Once callback is done cleaning up things and updating its page table (if it
245− * chose to do so, this is not an obligation) then it returns. At this point,
246− * the HMM core will finish up the final steps, and the migration is complete.
247− *
248− * THE finalize_and_map() CALLBACK MUST NOT CHANGE ANY OF THE SRC OR DST ARRAY
249− * ENTRIES OR BAD THINGS WILL HAPPEN !
250− */
251−struct migrate_vma_ops {
252− void (*alloc_and_copy)(struct vm_area_struct *vma,
253− const unsigned long *src,
254− unsigned long *dst,
255− unsigned long start,
256− unsigned long end,
257− void *private);
258− void (*finalize_and_map)(struct vm_area_struct *vma,
259− const unsigned long *src,
260− const unsigned long *dst,
261− unsigned long start,
262− unsigned long end,
263− void *private);
183+struct migrate_vma {
184+ struct vm_area_struct *vma;
185+ /*
186+ * Both src and dst array must be big enough for
187+ * (end - start) >> PAGE_SHIFT entries.
188+ *
189+ * The src array must not be modified by the caller after
190+ * migrate_vma_setup(), and must not change the dst array after
191+ * migrate_vma_pages() returns.
192+ */
193+ unsigned long *dst;
194+ unsigned long *src;
195+ unsigned long cpages;
196+ unsigned long npages;
197+ unsigned long start;
198+ unsigned long end;
264199 };
265200
266−#if defined(CONFIG_MIGRATE_VMA_HELPER)
267−int migrate_vma(const struct migrate_vma_ops *ops,
268− struct vm_area_struct *vma,
269− unsigned long start,
270− unsigned long end,
271− unsigned long *src,
272− unsigned long *dst,
273− void *private);
274−#else
275−static inline int migrate_vma(const struct migrate_vma_ops *ops,
276− struct vm_area_struct *vma,
277− unsigned long start,
278− unsigned long end,
279− unsigned long *src,
280− unsigned long *dst,
281− void *private)
282−{
283− return -EINVAL;
284−}
285−#endif /* IS_ENABLED(CONFIG_MIGRATE_VMA_HELPER) */
201+int migrate_vma_setup(struct migrate_vma *args);
202+void migrate_vma_pages(struct migrate_vma *migrate);
203+void migrate_vma_finalize(struct migrate_vma *migrate);
286204
287205 #endif /* CONFIG_MIGRATION */
288206
include/linux/mlx5/device.h+19−2
@@ -328,6 +328,7 @@ enum mlx5_event { · 327 unmodified lines
328328 MLX5_EVENT_TYPE_GPIO_EVENT = 0x15,
329329 MLX5_EVENT_TYPE_PORT_MODULE_EVENT = 0x16,
330330 MLX5_EVENT_TYPE_TEMP_WARN_EVENT = 0x17,
331+ MLX5_EVENT_TYPE_XRQ_ERROR = 0x18,
331332 MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19,
332333 MLX5_EVENT_TYPE_GENERAL_EVENT = 0x22,
333334 MLX5_EVENT_TYPE_MONITOR_COUNTER = 0x24,
@@ -345,6 +346,7 @@ enum mlx5_event { · 11 unmodified lines
345346 MLX5_EVENT_TYPE_ESW_FUNCTIONS_CHANGED = 0xe,
346347
347348 MLX5_EVENT_TYPE_DCT_DRAINED = 0x1c,
349+ MLX5_EVENT_TYPE_DCT_KEY_VIOLATION = 0x1d,
348350
349351 MLX5_EVENT_TYPE_FPGA_ERROR = 0x20,
350352 MLX5_EVENT_TYPE_FPGA_QP_ERROR = 0x21,
@@ -446,11 +448,11 @@ enum { · 95 unmodified lines
446448 };
447449
448450 enum {
449− MLX5_OPC_MOD_TLS_TIS_STATIC_PARAMS = 0x20,
451+ MLX5_OPC_MOD_TLS_TIS_STATIC_PARAMS = 0x1,
450452 };
451453
452454 enum {
453− MLX5_OPC_MOD_TLS_TIS_PROGRESS_PARAMS = 0x20,
455+ MLX5_OPC_MOD_TLS_TIS_PROGRESS_PARAMS = 0x1,
454456 };
455457
456458 enum {
@@ -584,6 +586,12 @@ struct mlx5_eqe_cq_err { · 127 unmodified lines
584586 u8 syndrome;
585587 };
586588
589+struct mlx5_eqe_xrq_err {
590+ __be32 reserved1[5];
591+ __be32 type_xrqn;
592+ __be32 reserved2;
593+};
594+
587595 struct mlx5_eqe_port_state {
588596 u8 reserved0[8];
589597 u8 port;
@@ -698,6 +706,7 @@ union ev_data { · 108 unmodified lines
698706 struct mlx5_eqe_pps pps;
699707 struct mlx5_eqe_dct dct;
700708 struct mlx5_eqe_temp_warning temp_warning;
709+ struct mlx5_eqe_xrq_err xrq_err;
701710 } __packed;
702711
703712 struct mlx5_eqe {
@@ -1162,6 +1171,9 @@ enum mlx5_qcam_feature_groups { · 458 unmodified lines
11621171 #define MLX5_CAP_FLOWTABLE(mdev, cap) \
11631172 MLX5_GET(flow_table_nic_cap, mdev->caps.hca_cur[MLX5_CAP_FLOW_TABLE], cap)
11641173
1174+#define MLX5_CAP64_FLOWTABLE(mdev, cap) \
1175+ MLX5_GET64(flow_table_nic_cap, (mdev)->caps.hca_cur[MLX5_CAP_FLOW_TABLE], cap)
1176+
11651177 #define MLX5_CAP_FLOWTABLE_MAX(mdev, cap) \
11661178 MLX5_GET(flow_table_nic_cap, mdev->caps.hca_max[MLX5_CAP_FLOW_TABLE], cap)
11671179
@@ -1225,6 +1237,10 @@ enum mlx5_qcam_feature_groups { · 57 unmodified lines
12251237 MLX5_GET(e_switch_cap, \
12261238 mdev->caps.hca_cur[MLX5_CAP_ESWITCH], cap)
12271239
1240+#define MLX5_CAP64_ESW_FLOWTABLE(mdev, cap) \
1241+ MLX5_GET64(flow_table_eswitch_cap, \
1242+ (mdev)->caps.hca_cur[MLX5_CAP_ESWITCH_FLOW_TABLE], cap)
1243+
12281244 #define MLX5_CAP_ESW_MAX(mdev, cap) \
12291245 MLX5_GET(e_switch_cap, \
12301246 mdev->caps.hca_max[MLX5_CAP_ESWITCH], cap)
@@ -1309,6 +1325,7 @@ enum { · 78 unmodified lines
13091325 MLX5_PER_PRIORITY_COUNTERS_GROUP = 0x10,
13101326 MLX5_PER_TRAFFIC_CLASS_COUNTERS_GROUP = 0x11,
13111327 MLX5_PHYSICAL_LAYER_COUNTERS_GROUP = 0x12,
1328+ MLX5_PER_TRAFFIC_CLASS_CONGESTION_GROUP = 0x13,
13121329 MLX5_PHYSICAL_LAYER_STATISTICAL_GROUP = 0x16,
13131330 MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20,
13141331 };
include/linux/mlx5/driver.h+33−11
@@ -47,6 +47,7 @@ · 46 unmodified lines
4747 #include <linux/interrupt.h>
4848 #include <linux/idr.h>
4949 #include <linux/notifier.h>
50+#include <linux/refcount.h>
5051
5152 #include <linux/mlx5/device.h>
5253 #include <linux/mlx5/doorbell.h>
@@ -189,7 +190,6 @@ enum mlx5_coredev_type { · 136 unmodified lines
189190 };
190191
191192 struct mlx5_field_desc {
192− struct dentry *dent;
193193 int i;
194194 };
195195
@@ -242,11 +242,6 @@ struct mlx5_cmd_msg { · 46 unmodified lines
242242
243243 struct mlx5_cmd_debug {
244244 struct dentry *dbg_root;
245− struct dentry *dbg_in;
246− struct dentry *dbg_out;
247− struct dentry *dbg_outlen;
248− struct dentry *dbg_status;
249− struct dentry *dbg_run;
250245 void *in_msg;
251246 void *out_msg;
252247 u8 status;
@@ -271,8 +266,6 @@ struct mlx5_cmd_stats { · 18 unmodified lines
271266 u64 sum;
272267 u64 n;
273268 struct dentry *root;
274− struct dentry *avg;
275− struct dentry *count;
276269 /* protect command average calculations */
277270 spinlock_t lock;
278271 };
@@ -398,7 +391,7 @@ enum mlx5_res_type { · 119 unmodified lines
398391
399392 struct mlx5_core_rsc_common {
400393 enum mlx5_res_type res;
401− atomic_t refcount;
394+ refcount_t refcount;
402395 struct completion free;
403396 };
404397
@@ -477,6 +470,17 @@ struct mlx5_core_sriov { · 72 unmodified lines
477470 u16 max_vfs;
478471 };
479472
473+struct mlx5_fc_pool {
474+ struct mlx5_core_dev *dev;
475+ struct mutex pool_lock; /* protects pool lists */
476+ struct list_head fully_used;
477+ struct list_head partially_used;
478+ struct list_head unused;
479+ int available_fcs;
480+ int used_fcs;
481+ int threshold;
482+};
483+
480484 struct mlx5_fc_stats {
481485 spinlock_t counters_idr_lock; /* protects counters_idr */
482486 struct idr counters_idr;
@@ -488,6 +492,8 @@ struct mlx5_fc_stats { · 5 unmodified lines
488492 struct delayed_work work;
489493 unsigned long next_query;
490494 unsigned long sampling_interval; /* jiffies */
495+ u32 *bulk_query_out;
496+ struct mlx5_fc_pool fc_pool;
491497 };
492498
493499 struct mlx5_events;
@@ -620,6 +626,11 @@ struct mlx5e_resources { · 126 unmodified lines
620626 struct mlx5_sq_bfreg bfreg;
621627 };
622628
629+enum mlx5_sw_icm_type {
630+ MLX5_SW_ICM_TYPE_STEERING,
631+ MLX5_SW_ICM_TYPE_HEADER_MODIFY,
632+};
633+
623634 #define MLX5_MAX_RESERVED_GIDS 8
624635
625636 struct mlx5_rsvd_gids {
@@ -651,9 +662,14 @@ struct mlx5_clock { · 25 unmodified lines
651662 struct mlx5_pps pps_info;
652663 };
653664
665+struct mlx5_dm;
654666 struct mlx5_fw_tracer;
655667 struct mlx5_vxlan;
656668 struct mlx5_geneve;
669+struct mlx5_hv_vhca;
670+
671+#define MLX5_LOG_SW_ICM_BLOCK_SIZE(dev) (MLX5_CAP_DEV_MEM(dev, log_sw_icm_alloc_granularity))
672+#define MLX5_SW_ICM_BLOCK_SIZE(dev) (1 << MLX5_LOG_SW_ICM_BLOCK_SIZE(dev))
657673
658674 struct mlx5_core_dev {
659675 struct device *device;
@@ -688,6 +704,7 @@ struct mlx5_core_dev { · 28 unmodified lines
688704 atomic_t num_qps;
689705 u32 issi;
690706 struct mlx5e_resources mlx5e_res;
707+ struct mlx5_dm *dm;
691708 struct mlx5_vxlan *vxlan;
692709 struct mlx5_geneve *geneve;
693710 struct {
@@ -701,6 +718,7 @@ struct mlx5_core_dev { · 7 unmodified lines
701718 struct mlx5_ib_clock_info *clock_info;
702719 struct mlx5_fw_tracer *tracer;
703720 u32 vsc_addr;
721+ struct mlx5_hv_vhca *hv_vhca;
704722 };
705723
706724 struct mlx5_db {
@@ -959,7 +977,7 @@ int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn, · 252 unmodified lines
959977 int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn);
960978 int mlx5_core_detach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn);
961979
962−int mlx5_qp_debugfs_init(struct mlx5_core_dev *dev);
980+void mlx5_qp_debugfs_init(struct mlx5_core_dev *dev);
963981 void mlx5_qp_debugfs_cleanup(struct mlx5_core_dev *dev);
964982 int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in,
965983 int size_in, void *data_out, int size_out,
@@ -971,7 +989,7 @@ int mlx5_db_alloc_node(struct mlx5_core_dev *dev, struct mlx5_db *db, · 5 unmodified lines
971989 void mlx5_db_free(struct mlx5_core_dev *dev, struct mlx5_db *db);
972990
973991 const char *mlx5_command_str(int command);
974−int mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev);
992+void mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev);
975993 void mlx5_cmdif_debugfs_cleanup(struct mlx5_core_dev *dev);
976994 int mlx5_core_create_psv(struct mlx5_core_dev *dev, u32 pdn,
977995 int npsvs, u32 *sig_index);
@@ -1070,6 +1088,10 @@ int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev, · 92 unmodified lines
10701088 size_t *offsets);
10711089 struct mlx5_uars_page *mlx5_get_uars_page(struct mlx5_core_dev *mdev);
10721090 void mlx5_put_uars_page(struct mlx5_core_dev *mdev, struct mlx5_uars_page *up);
1091+int mlx5_dm_sw_icm_alloc(struct mlx5_core_dev *dev, enum mlx5_sw_icm_type type,
1092+ u64 length, u16 uid, phys_addr_t *addr, u32 *obj_id);
1093+int mlx5_dm_sw_icm_dealloc(struct mlx5_core_dev *dev, enum mlx5_sw_icm_type type,
1094+ u64 length, u16 uid, phys_addr_t addr, u32 obj_id);
10731095
10741096 #ifdef CONFIG_MLX5_CORE_IPOIB
10751097 struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,
include/linux/mlx5/eswitch.h+7−2
@@ -44,7 +44,6 @@ struct mlx5_eswitch_rep_data { · 43 unmodified lines
4444 struct mlx5_eswitch_rep {
4545 struct mlx5_eswitch_rep_data rep_data[NUM_REP_TYPES];
4646 u16 vport;
47− u8 hw_id[ETH_ALEN];
4847 u16 vlan;
4948 /* Only IB rep is using vport_index */
5049 u16 vport_index;
@@ -61,7 +60,6 @@ void *mlx5_eswitch_get_proto_dev(struct mlx5_eswitch *esw, · 10 unmodified lines
6160 struct mlx5_eswitch_rep *mlx5_eswitch_vport_rep(struct mlx5_eswitch *esw,
6261 u16 vport_num);
6362 void *mlx5_eswitch_uplink_get_proto_dev(struct mlx5_eswitch *esw, u8 rep_type);
64−u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw);
6563 struct mlx5_flow_handle *
6664 mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw,
6765 u16 vport_num, u32 sqn);
@@ -75,7 +73,14 @@ mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev); · 7 unmodified lines
7573 bool mlx5_eswitch_vport_match_metadata_enabled(const struct mlx5_eswitch *esw);
7674 u32 mlx5_eswitch_get_vport_metadata_for_match(const struct mlx5_eswitch *esw,
7775 u16 vport_num);
76+u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw);
7877 #else /* CONFIG_MLX5_ESWITCH */
78+
79+static inline u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw)
80+{
81+ return MLX5_ESWITCH_NONE;
82+}
83+
7984 static inline enum devlink_eswitch_encap_mode
8085 mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev)
8186 {
include/linux/mlx5/fs.h+23−17
@@ -75,6 +75,7 @@ enum mlx5_flow_namespace_type { · 74 unmodified lines
7575 MLX5_FLOW_NAMESPACE_SNIFFER_TX,
7676 MLX5_FLOW_NAMESPACE_EGRESS,
7777 MLX5_FLOW_NAMESPACE_RDMA_RX,
78+ MLX5_FLOW_NAMESPACE_RDMA_RX_KERNEL,
7879 };
7980
8081 enum {
@@ -83,6 +84,8 @@ enum { · 2 unmodified lines
8384 FDB_SLOW_PATH,
8485 };
8586
87+struct mlx5_pkt_reformat;
88+struct mlx5_modify_hdr;
8689 struct mlx5_flow_table;
8790 struct mlx5_flow_group;
8891 struct mlx5_flow_namespace;
@@ -120,12 +123,17 @@ struct mlx5_flow_destination { · 31 unmodified lines
120123 struct {
121124 u16 num;
122125 u16 vhca_id;
123− u32 reformat_id;
126+ struct mlx5_pkt_reformat *pkt_reformat;
124127 u8 flags;
125128 } vport;
126129 };
127130 };
128131
132+struct mod_hdr_tbl {
133+ struct mutex lock; /* protects hlist */
134+ DECLARE_HASHTABLE(hlist, 8);
135+};
136+
129137 struct mlx5_flow_namespace *
130138 mlx5_get_fdb_sub_ns(struct mlx5_core_dev *dev, int n);
131139 struct mlx5_flow_namespace *
@@ -189,8 +197,8 @@ enum { · 57 unmodified lines
189197
190198 struct mlx5_flow_act {
191199 u32 action;
192− u32 reformat_id;
193− u32 modify_id;
200+ struct mlx5_modify_hdr *modify_hdr;
201+ struct mlx5_pkt_reformat *pkt_reformat;
194202 uintptr_t esp_id;
195203 u32 flags;
196204 struct mlx5_fs_vlan vlan[MLX5_FS_VLAN_DEPTH];
@@ -199,8 +207,6 @@ struct mlx5_flow_act { · 2 unmodified lines
199207
200208 #define MLX5_DECLARE_FLOW_ACT(name) \
201209 struct mlx5_flow_act name = { .action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,\
202− .reformat_id = 0, \
203− .modify_id = 0, \
204210 .flags = 0, }
205211
206212 /* Single destination per rule.
@@ -220,6 +226,7 @@ int mlx5_modify_rule_destination(struct mlx5_flow_handle *handler, · 13 unmodified lines
220226
221227 struct mlx5_fc *mlx5_fc_create(struct mlx5_core_dev *dev, bool aging);
222228 void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter);
229+u64 mlx5_fc_query_lastuse(struct mlx5_fc *counter);
223230 void mlx5_fc_query_cached(struct mlx5_fc *counter,
224231 u64 *bytes, u64 *packets, u64 *lastuse);
225232 int mlx5_fc_query(struct mlx5_core_dev *dev, struct mlx5_fc *counter,
@@ -229,19 +236,18 @@ u32 mlx5_fc_id(struct mlx5_fc *counter); · 3 unmodified lines
229236 int mlx5_fs_add_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn);
230237 int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn);
231238
232−int mlx5_modify_header_alloc(struct mlx5_core_dev *dev,
233− u8 namespace, u8 num_actions,
234− void *modify_actions, u32 *modify_header_id);
239+struct mlx5_modify_hdr *mlx5_modify_header_alloc(struct mlx5_core_dev *dev,
240+ u8 ns_type, u8 num_actions,
241+ void *modify_actions);
235242 void mlx5_modify_header_dealloc(struct mlx5_core_dev *dev,
236− u32 modify_header_id);
237−
238−int mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev,
239− int reformat_type,
240− size_t size,
241− void *reformat_data,
242− enum mlx5_flow_namespace_type namespace,
243− u32 *packet_reformat_id);
243+ struct mlx5_modify_hdr *modify_hdr);
244+
245+struct mlx5_pkt_reformat *mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev,
246+ int reformat_type,
247+ size_t size,
248+ void *reformat_data,
249+ enum mlx5_flow_namespace_type ns_type);
244250 void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,
245− u32 packet_reformat_id);
251+ struct mlx5_pkt_reformat *reformat);
246252
247253 #endif
include/linux/mlx5/mlx5_ifc.h+271−54
@@ -172,6 +172,8 @@ enum { · 171 unmodified lines
172172 MLX5_CMD_OP_QUERY_XRQ_DC_PARAMS_ENTRY = 0x725,
173173 MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY = 0x726,
174174 MLX5_CMD_OP_QUERY_XRQ_ERROR_PARAMS = 0x727,
175+ MLX5_CMD_OP_RELEASE_XRQ_ERROR = 0x729,
176+ MLX5_CMD_OP_MODIFY_XRQ = 0x72a,
175177 MLX5_CMD_OP_QUERY_ESW_FUNCTIONS = 0x740,
176178 MLX5_CMD_OP_QUERY_VPORT_STATE = 0x750,
177179 MLX5_CMD_OP_MODIFY_VPORT_STATE = 0x751,
@@ -293,6 +295,7 @@ enum { · 115 unmodified lines
293295 MLX5_CMD_OP_DESTROY_UCTX = 0xa06,
294296 MLX5_CMD_OP_CREATE_UMEM = 0xa08,
295297 MLX5_CMD_OP_DESTROY_UMEM = 0xa0a,
298+ MLX5_CMD_OP_SYNC_STEERING = 0xb00,
296299 MLX5_CMD_OP_MAX
297300 };
298301
@@ -483,7 +486,11 @@ union mlx5_ifc_gre_key_bits { · 184 unmodified lines
483486 };
484487
485488 struct mlx5_ifc_fte_match_set_misc_bits {
486− u8 reserved_at_0[0x8];
489+ u8 gre_c_present[0x1];
490+ u8 reserved_at_1[0x1];
491+ u8 gre_k_present[0x1];
492+ u8 gre_s_present[0x1];
493+ u8 source_vhca_port[0x4];
487494 u8 source_sqn[0x18];
488495
489496 u8 source_eswitch_owner_vhca_id[0x10];
@@ -563,12 +570,38 @@ struct mlx5_ifc_fte_match_set_misc2_bits { · 73 unmodified lines
563570
564571 u8 metadata_reg_a[0x20];
565572
566− u8 reserved_at_1a0[0x60];
573+ u8 metadata_reg_b[0x20];
574+
575+ u8 reserved_at_1c0[0x40];
567576 };
568577
569578 struct mlx5_ifc_fte_match_set_misc3_bits {
570− u8 reserved_at_0[0x120];
579+ u8 inner_tcp_seq_num[0x20];
580+
581+ u8 outer_tcp_seq_num[0x20];
582+
583+ u8 inner_tcp_ack_num[0x20];
584+
585+ u8 outer_tcp_ack_num[0x20];
586+
587+ u8 reserved_at_80[0x8];
588+ u8 outer_vxlan_gpe_vni[0x18];
589+
590+ u8 outer_vxlan_gpe_next_protocol[0x8];
591+ u8 outer_vxlan_gpe_flags[0x8];
592+ u8 reserved_at_b0[0x10];
593+
594+ u8 icmp_header_data[0x20];
595+
596+ u8 icmpv6_header_data[0x20];
597+
598+ u8 icmp_type[0x8];
599+ u8 icmp_code[0x8];
600+ u8 icmpv6_type[0x8];
601+ u8 icmpv6_code[0x8];
602+
571603 u8 geneve_tlv_option_0_data[0x20];
604+
572605 u8 reserved_at_140[0xc0];
573606 };
574607
@@ -664,7 +697,15 @@ struct mlx5_ifc_flow_table_nic_cap_bits { · 89 unmodified lines
664697
665698 struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_transmit_sniffer;
666699
667− u8 reserved_at_e00[0x7200];
700+ u8 reserved_at_e00[0x1200];
701+
702+ u8 sw_steering_nic_rx_action_drop_icm_address[0x40];
703+
704+ u8 sw_steering_nic_tx_action_drop_icm_address[0x40];
705+
706+ u8 sw_steering_nic_tx_action_allow_icm_address[0x40];
707+
708+ u8 reserved_at_20c0[0x5f40];
668709 };
669710
670711 enum {
@@ -696,7 +737,17 @@ struct mlx5_ifc_flow_table_eswitch_cap_bits { · 25 unmodified lines
696737
697738 struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_esw_acl_egress;
698739
699− u8 reserved_at_800[0x7800];
740+ u8 reserved_at_800[0x1000];
741+
742+ u8 sw_steering_fdb_action_drop_icm_address_rx[0x40];
743+
744+ u8 sw_steering_fdb_action_drop_icm_address_tx[0x40];
745+
746+ u8 sw_steering_uplink_icm_address_rx[0x40];
747+
748+ u8 sw_steering_uplink_icm_address_tx[0x40];
749+
750+ u8 reserved_at_1900[0x6700];
700751 };
701752
702753 enum {
@@ -806,7 +857,9 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_bits { · 103 unmodified lines
806857 u8 swp_csum[0x1];
807858 u8 swp_lso[0x1];
808859 u8 cqe_checksum_full[0x1];
809− u8 reserved_at_24[0xc];
860+ u8 reserved_at_24[0x5];
861+ u8 tunnel_stateless_ip_over_ip[0x1];
862+ u8 reserved_at_2a[0x6];
810863 u8 max_vxlan_udp_ports[0x8];
811864 u8 reserved_at_38[0x6];
812865 u8 max_geneve_opt_len[0x1];
@@ -845,6 +898,25 @@ struct mlx5_ifc_roce_cap_bits { · 32 unmodified lines
845898 u8 reserved_at_100[0x700];
846899 };
847900
901+struct mlx5_ifc_sync_steering_in_bits {
902+ u8 opcode[0x10];
903+ u8 uid[0x10];
904+
905+ u8 reserved_at_20[0x10];
906+ u8 op_mod[0x10];
907+
908+ u8 reserved_at_40[0xc0];
909+};
910+
911+struct mlx5_ifc_sync_steering_out_bits {
912+ u8 status[0x8];
913+ u8 reserved_at_8[0x18];
914+
915+ u8 syndrome[0x20];
916+
917+ u8 reserved_at_40[0x40];
918+};
919+
848920 struct mlx5_ifc_device_mem_cap_bits {
849921 u8 memic[0x1];
850922 u8 reserved_at_1[0x1f];
@@ -944,7 +1016,9 @@ struct mlx5_ifc_odp_cap_bits { · 93 unmodified lines
9441016
9451017 struct mlx5_ifc_odp_per_transport_service_cap_bits xrc_odp_caps;
9461018
947− u8 reserved_at_100[0x700];
1019+ struct mlx5_ifc_odp_per_transport_service_cap_bits dc_odp_caps;
1020+
1021+ u8 reserved_at_120[0x6E0];
9481022 };
9491023
9501024 struct mlx5_ifc_calc_op {
@@ -1035,11 +1109,32 @@ enum { · 84 unmodified lines
10351109 MLX5_CAP_UMR_FENCE_NONE = 0x2,
10361110 };
10371111
1112+enum {
1113+ MLX5_FLEX_PARSER_VXLAN_GPE_ENABLED = 1 << 7,
1114+ MLX5_FLEX_PARSER_ICMP_V4_ENABLED = 1 << 8,
1115+ MLX5_FLEX_PARSER_ICMP_V6_ENABLED = 1 << 9,
1116+};
1117+
10381118 enum {
10391119 MLX5_UCTX_CAP_RAW_TX = 1UL << 0,
10401120 MLX5_UCTX_CAP_INTERNAL_DEV_RES = 1UL << 1,
10411121 };
10421122
1123+#define MLX5_FC_BULK_SIZE_FACTOR 128
1124+
1125+enum mlx5_fc_bulk_alloc_bitmask {
1126+ MLX5_FC_BULK_128 = (1 << 0),
1127+ MLX5_FC_BULK_256 = (1 << 1),
1128+ MLX5_FC_BULK_512 = (1 << 2),
1129+ MLX5_FC_BULK_1024 = (1 << 3),
1130+ MLX5_FC_BULK_2048 = (1 << 4),
1131+ MLX5_FC_BULK_4096 = (1 << 5),
1132+ MLX5_FC_BULK_8192 = (1 << 6),
1133+ MLX5_FC_BULK_16384 = (1 << 7),
1134+};
1135+
1136+#define MLX5_FC_BULK_NUM_FCS(fc_enum) (MLX5_FC_BULK_SIZE_FACTOR * (fc_enum))
1137+
10431138 struct mlx5_ifc_cmd_hca_cap_bits {
10441139 u8 reserved_at_0[0x30];
10451140 u8 vhca_id[0x10];
@@ -1099,7 +1194,10 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 53 unmodified lines
10991194 u8 cache_line_128byte[0x1];
11001195 u8 reserved_at_165[0x4];
11011196 u8 rts2rts_qp_counters_set_id[0x1];
1102− u8 reserved_at_16a[0x5];
1197+ u8 reserved_at_16a[0x2];
1198+ u8 vnic_env_int_rq_oob[0x1];
1199+ u8 sbcam_reg[0x1];
1200+ u8 reserved_at_16e[0x1];
11031201 u8 qcam_reg[0x1];
11041202 u8 gid_table_size[0x10];
11051203
@@ -1228,7 +1326,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 122 unmodified lines
12281326 u8 reserved_at_263[0x8];
12291327 u8 log_bf_reg_size[0x5];
12301328
1231− u8 reserved_at_270[0xb];
1329+ u8 reserved_at_270[0x8];
1330+ u8 lag_tx_port_affinity[0x1];
1331+ u8 reserved_at_279[0x2];
12321332 u8 lag_master[0x1];
12331333 u8 num_lag_ports[0x4];
12341334
@@ -1244,7 +1344,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 9 unmodified lines
12441344 u8 reserved_at_2e0[0x7];
12451345 u8 max_qp_mcg[0x19];
12461346
1247− u8 reserved_at_300[0x18];
1347+ u8 reserved_at_300[0x10];
1348+ u8 flow_counter_bulk_alloc[0x8];
12481349 u8 log_max_mcg[0x8];
12491350
12501351 u8 reserved_at_320[0x3];
@@ -1388,7 +1489,14 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 137 unmodified lines
13881489
13891490 u8 reserved_at_6c0[0x4];
13901491 u8 flex_parser_id_geneve_tlv_option_0[0x4];
1391− u8 reserved_at_6c8[0x28];
1492+ u8 flex_parser_id_icmp_dw1[0x4];
1493+ u8 flex_parser_id_icmp_dw0[0x4];
1494+ u8 flex_parser_id_icmpv6_dw1[0x4];
1495+ u8 flex_parser_id_icmpv6_dw0[0x4];
1496+ u8 flex_parser_id_outer_first_mpls_over_gre[0x4];
1497+ u8 flex_parser_id_outer_first_mpls_over_udp_label[0x4];
1498+
1499+ u8 reserved_at_6e0[0x10];
13921500 u8 sf_base_id[0x10];
13931501
13941502 u8 reserved_at_700[0x80];
@@ -1853,12 +1961,28 @@ struct mlx5_ifc_ib_port_cntrs_grp_data_layout_bits { · 458 unmodified lines
18531961 u8 port_xmit_wait[0x20];
18541962 };
18551963
1856−struct mlx5_ifc_eth_per_traffic_grp_data_layout_bits {
1964+struct mlx5_ifc_eth_per_tc_prio_grp_data_layout_bits {
18571965 u8 transmit_queue_high[0x20];
18581966
18591967 u8 transmit_queue_low[0x20];
18601968
1861− u8 reserved_at_40[0x780];
1969+ u8 no_buffer_discard_uc_high[0x20];
1970+
1971+ u8 no_buffer_discard_uc_low[0x20];
1972+
1973+ u8 reserved_at_80[0x740];
1974+};
1975+
1976+struct mlx5_ifc_eth_per_tc_congest_prio_grp_data_layout_bits {
1977+ u8 wred_discard_high[0x20];
1978+
1979+ u8 wred_discard_low[0x20];
1980+
1981+ u8 ecn_marked_tc_high[0x20];
1982+
1983+ u8 ecn_marked_tc_low[0x20];
1984+
1985+ u8 reserved_at_80[0x740];
18621986 };
18631987
18641988 struct mlx5_ifc_eth_per_prio_grp_data_layout_bits {
@@ -2626,6 +2750,7 @@ union mlx5_ifc_hca_cap_union_bits { · 761 unmodified lines
26262750 struct mlx5_ifc_debug_cap_bits debug_cap;
26272751 struct mlx5_ifc_fpga_cap_bits fpga_cap;
26282752 struct mlx5_ifc_tls_cap_bits tls_cap;
2753+ struct mlx5_ifc_device_mem_cap_bits device_mem_cap;
26292754 u8 reserved_at_0[0x8000];
26302755 };
26312756
@@ -2754,7 +2879,11 @@ struct mlx5_ifc_vnic_diagnostic_statistics_bits { · 122 unmodified lines
27542879
27552880 u8 transmit_discard_vport_down[0x40];
27562881
2757− u8 reserved_at_140[0xec0];
2882+ u8 reserved_at_140[0xa0];
2883+
2884+ u8 internal_rq_out_of_buffer[0x20];
2885+
2886+ u8 reserved_at_200[0xe00];
27582887 };
27592888
27602889 struct mlx5_ifc_traffic_counter_bits {
@@ -2766,7 +2895,7 @@ struct mlx5_ifc_traffic_counter_bits { · 5 unmodified lines
27662895 struct mlx5_ifc_tisc_bits {
27672896 u8 strict_lag_tx_port_affinity[0x1];
27682897 u8 tls_en[0x1];
2769− u8 reserved_at_1[0x2];
2898+ u8 reserved_at_2[0x2];
27702899 u8 lag_tx_port_affinity[0x04];
27712900
27722901 u8 reserved_at_8[0x4];
@@ -2941,6 +3070,13 @@ enum { · 168 unmodified lines
29413070 SCHEDULING_CONTEXT_ELEMENT_TYPE_PARA_VPORT_TC = 0x3,
29423071 };
29433072
3073+enum {
3074+ ELEMENT_TYPE_CAP_MASK_TASR = 1 << 0,
3075+ ELEMENT_TYPE_CAP_MASK_VPORT = 1 << 1,
3076+ ELEMENT_TYPE_CAP_MASK_VPORT_TC = 1 << 2,
3077+ ELEMENT_TYPE_CAP_MASK_PARA_VPORT_TC = 1 << 3,
3078+};
3079+
29443080 struct mlx5_ifc_scheduling_context_bits {
29453081 u8 element_type[0x8];
29463082 u8 reserved_at_8[0x18];
@@ -3218,7 +3354,11 @@ struct mlx5_ifc_esw_vport_context_bits { · 271 unmodified lines
32183354 u8 cvlan_pcp[0x3];
32193355 u8 cvlan_id[0xc];
32203356
3221− u8 reserved_at_60[0x7a0];
3357+ u8 reserved_at_60[0x720];
3358+
3359+ u8 sw_steering_vport_icm_address_rx[0x40];
3360+
3361+ u8 sw_steering_vport_icm_address_tx[0x40];
32223362 };
32233363
32243364 enum {
@@ -3519,7 +3659,8 @@ union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits { · 294 unmodified lines
35193659 struct mlx5_ifc_eth_3635_cntrs_grp_data_layout_bits eth_3635_cntrs_grp_data_layout;
35203660 struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits eth_extended_cntrs_grp_data_layout;
35213661 struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout;
3522− struct mlx5_ifc_eth_per_traffic_grp_data_layout_bits eth_per_traffic_grp_data_layout;
3662+ struct mlx5_ifc_eth_per_tc_prio_grp_data_layout_bits eth_per_tc_prio_grp_data_layout;
3663+ struct mlx5_ifc_eth_per_tc_congest_prio_grp_data_layout_bits eth_per_tc_congest_prio_grp_data_layout;
35233664 struct mlx5_ifc_ib_port_cntrs_grp_data_layout_bits ib_port_cntrs_grp_data_layout;
35243665 struct mlx5_ifc_phys_layer_cntrs_bits phys_layer_cntrs;
35253666 struct mlx5_ifc_phys_layer_statistical_cntrs_bits phys_layer_statistical_cntrs;
@@ -4904,23 +5045,98 @@ struct mlx5_ifc_query_hca_cap_in_bits { · 1378 unmodified lines
49045045 u8 reserved_at_20[0x10];
49055046 u8 op_mod[0x10];
49065047
5048+ u8 other_function[0x1];
5049+ u8 reserved_at_41[0xf];
5050+ u8 function_id[0x10];
5051+
5052+ u8 reserved_at_60[0x20];
5053+};
5054+
5055+struct mlx5_ifc_other_hca_cap_bits {
5056+ u8 roce[0x1];
5057+ u8 reserved_at_1[0x27f];
5058+};
5059+
5060+struct mlx5_ifc_query_other_hca_cap_out_bits {
5061+ u8 status[0x8];
5062+ u8 reserved_at_8[0x18];
5063+
5064+ u8 syndrome[0x20];
5065+
49075066 u8 reserved_at_40[0x40];
5067+
5068+ struct mlx5_ifc_other_hca_cap_bits other_capability;
49085069 };
49095070
4910−struct mlx5_ifc_query_flow_table_out_bits {
5071+struct mlx5_ifc_query_other_hca_cap_in_bits {
5072+ u8 opcode[0x10];
5073+ u8 reserved_at_10[0x10];
5074+
5075+ u8 reserved_at_20[0x10];
5076+ u8 op_mod[0x10];
5077+
5078+ u8 reserved_at_40[0x10];
5079+ u8 function_id[0x10];
5080+
5081+ u8 reserved_at_60[0x20];
5082+};
5083+
5084+struct mlx5_ifc_modify_other_hca_cap_out_bits {
49115085 u8 status[0x8];
49125086 u8 reserved_at_8[0x18];
49135087
49145088 u8 syndrome[0x20];
49155089
4916− u8 reserved_at_40[0x80];
5090+ u8 reserved_at_40[0x40];
5091+};
49175092
4918− u8 reserved_at_c0[0x8];
5093+struct mlx5_ifc_modify_other_hca_cap_in_bits {
5094+ u8 opcode[0x10];
5095+ u8 reserved_at_10[0x10];
5096+
5097+ u8 reserved_at_20[0x10];
5098+ u8 op_mod[0x10];
5099+
5100+ u8 reserved_at_40[0x10];
5101+ u8 function_id[0x10];
5102+ u8 field_select[0x20];
5103+
5104+ struct mlx5_ifc_other_hca_cap_bits other_capability;
5105+};
5106+
5107+struct mlx5_ifc_flow_table_context_bits {
5108+ u8 reformat_en[0x1];
5109+ u8 decap_en[0x1];
5110+ u8 sw_owner[0x1];
5111+ u8 termination_table[0x1];
5112+ u8 table_miss_action[0x4];
49195113 u8 level[0x8];
4920− u8 reserved_at_d0[0x8];
5114+ u8 reserved_at_10[0x8];
49215115 u8 log_size[0x8];
49225116
4923− u8 reserved_at_e0[0x120];
5117+ u8 reserved_at_20[0x8];
5118+ u8 table_miss_id[0x18];
5119+
5120+ u8 reserved_at_40[0x8];
5121+ u8 lag_master_next_table_id[0x18];
5122+
5123+ u8 reserved_at_60[0x60];
5124+
5125+ u8 sw_owner_icm_root_1[0x40];
5126+
5127+ u8 sw_owner_icm_root_0[0x40];
5128+
5129+};
5130+
5131+struct mlx5_ifc_query_flow_table_out_bits {
5132+ u8 status[0x8];
5133+ u8 reserved_at_8[0x18];
5134+
5135+ u8 syndrome[0x20];
5136+
5137+ u8 reserved_at_40[0x80];
5138+
5139+ struct mlx5_ifc_flow_table_context_bits flow_table_context;
49245140 };
49255141
49265142 struct mlx5_ifc_query_flow_table_in_bits {
@@ -5190,7 +5406,7 @@ struct mlx5_ifc_alloc_packet_reformat_context_out_bits { · 263 unmodified lines
51905406 u8 reserved_at_60[0x20];
51915407 };
51925408
5193−enum {
5409+enum mlx5_reformat_ctx_type {
51945410 MLX5_REFORMAT_TYPE_L2_TO_VXLAN = 0x0,
51955411 MLX5_REFORMAT_TYPE_L2_TO_NVGRE = 0x1,
51965412 MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL = 0x2,
@@ -5286,7 +5502,16 @@ enum { · 89 unmodified lines
52865502 MLX5_ACTION_IN_FIELD_OUT_DIPV4 = 0x16,
52875503 MLX5_ACTION_IN_FIELD_OUT_FIRST_VID = 0x17,
52885504 MLX5_ACTION_IN_FIELD_OUT_IPV6_HOPLIMIT = 0x47,
5505+ MLX5_ACTION_IN_FIELD_METADATA_REG_A = 0x49,
5506+ MLX5_ACTION_IN_FIELD_METADATA_REG_B = 0x50,
52895507 MLX5_ACTION_IN_FIELD_METADATA_REG_C_0 = 0x51,
5508+ MLX5_ACTION_IN_FIELD_METADATA_REG_C_1 = 0x52,
5509+ MLX5_ACTION_IN_FIELD_METADATA_REG_C_2 = 0x53,
5510+ MLX5_ACTION_IN_FIELD_METADATA_REG_C_3 = 0x54,
5511+ MLX5_ACTION_IN_FIELD_METADATA_REG_C_4 = 0x55,
5512+ MLX5_ACTION_IN_FIELD_METADATA_REG_C_5 = 0x56,
5513+ MLX5_ACTION_IN_FIELD_OUT_TCP_SEQ_NUM = 0x59,
5514+ MLX5_ACTION_IN_FIELD_OUT_TCP_ACK_NUM = 0x5B,
52905515 };
52915516
52925517 struct mlx5_ifc_alloc_modify_header_context_out_bits {
@@ -5975,10 +6200,12 @@ struct mlx5_ifc_modify_cq_in_bits { · 682 unmodified lines
59756200
59766201 struct mlx5_ifc_cqc_bits cq_context;
59776202
5978− u8 reserved_at_280[0x40];
6203+ u8 reserved_at_280[0x60];
59796204
59806205 u8 cq_umem_valid[0x1];
5981− u8 reserved_at_2c1[0x5bf];
6206+ u8 reserved_at_2e1[0x1f];
6207+
6208+ u8 reserved_at_300[0x580];
59826209
59836210 u8 pas[0][0x40];
59846211 };
@@ -7332,35 +7559,26 @@ struct mlx5_ifc_create_mkey_in_bits { · 1347 unmodified lines
73327559 u8 klm_pas_mtt[0][0x20];
73337560 };
73347561
7562+enum {
7563+ MLX5_FLOW_TABLE_TYPE_NIC_RX = 0x0,
7564+ MLX5_FLOW_TABLE_TYPE_NIC_TX = 0x1,
7565+ MLX5_FLOW_TABLE_TYPE_ESW_EGRESS_ACL = 0x2,
7566+ MLX5_FLOW_TABLE_TYPE_ESW_INGRESS_ACL = 0x3,
7567+ MLX5_FLOW_TABLE_TYPE_FDB = 0X4,
7568+ MLX5_FLOW_TABLE_TYPE_SNIFFER_RX = 0X5,
7569+ MLX5_FLOW_TABLE_TYPE_SNIFFER_TX = 0X6,
7570+};
7571+
73357572 struct mlx5_ifc_create_flow_table_out_bits {
73367573 u8 status[0x8];
7337− u8 reserved_at_8[0x18];
7574+ u8 icm_address_63_40[0x18];
73387575
73397576 u8 syndrome[0x20];
73407577
7341− u8 reserved_at_40[0x8];
7578+ u8 icm_address_39_32[0x8];
73427579 u8 table_id[0x18];
73437580
7344− u8 reserved_at_60[0x20];
7345−};
7346−
7347−struct mlx5_ifc_flow_table_context_bits {
7348− u8 reformat_en[0x1];
7349− u8 decap_en[0x1];
7350− u8 reserved_at_2[0x1];
7351− u8 termination_table[0x1];
7352− u8 table_miss_action[0x4];
7353− u8 level[0x8];
7354− u8 reserved_at_10[0x8];
7355− u8 log_size[0x8];
7356−
7357− u8 reserved_at_20[0x8];
7358− u8 table_miss_id[0x18];
7359−
7360− u8 reserved_at_40[0x8];
7361− u8 lag_master_next_table_id[0x18];
7362−
7363− u8 reserved_at_60[0xe0];
7581+ u8 icm_address_31_0[0x20];
73647582 };
73657583
73667584 struct mlx5_ifc_create_flow_table_in_bits {
@@ -7815,7 +8033,8 @@ struct mlx5_ifc_alloc_flow_counter_in_bits { · 448 unmodified lines
78158033 u8 reserved_at_20[0x10];
78168034 u8 op_mod[0x10];
78178035
7818− u8 reserved_at_40[0x40];
8036+ u8 reserved_at_40[0x38];
8037+ u8 flow_counter_bulk[0x8];
78198038 };
78208039
78218040 struct mlx5_ifc_add_vxlan_udp_dport_out_bits {
@@ -9221,7 +9440,8 @@ union mlx5_ifc_ports_control_registers_document_bits { · 1399 unmodified lines
92219440 struct mlx5_ifc_eth_802_3_cntrs_grp_data_layout_bits eth_802_3_cntrs_grp_data_layout;
92229441 struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits eth_extended_cntrs_grp_data_layout;
92239442 struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout;
9224− struct mlx5_ifc_eth_per_traffic_grp_data_layout_bits eth_per_traffic_grp_data_layout;
9443+ struct mlx5_ifc_eth_per_tc_prio_grp_data_layout_bits eth_per_tc_prio_grp_data_layout;
9444+ struct mlx5_ifc_eth_per_tc_congest_prio_grp_data_layout_bits eth_per_tc_congest_prio_grp_data_layout;
92259445 struct mlx5_ifc_lane_2_module_mapping_bits lane_2_module_mapping;
92269446 struct mlx5_ifc_pamp_reg_bits pamp_reg;
92279447 struct mlx5_ifc_paos_reg_bits paos_reg;
@@ -9568,8 +9788,6 @@ struct mlx5_ifc_query_lag_out_bits { · 340 unmodified lines
95689788
95699789 u8 syndrome[0x20];
95709790
9571− u8 reserved_at_40[0x40];
9572−
95739791 struct mlx5_ifc_lagc_bits ctx;
95749792 };
95759793
@@ -10052,9 +10270,8 @@ struct mlx5_ifc_tls_static_params_bits { · 476 unmodified lines
1005210270 };
1005310271
1005410272 struct mlx5_ifc_tls_progress_params_bits {
10055− u8 valid[0x1];
10056− u8 reserved_at_1[0x7];
10057− u8 pd[0x18];
10273+ u8 reserved_at_0[0x8];
10274+ u8 tisn[0x18];
1005810275
1005910276 u8 next_record_tcp_sn[0x20];
1006010277
include/linux/mm.h+37−50
@@ -805,6 +805,24 @@ static inline void set_compound_order(struct page *page, unsigned int order) · 804 unmodified lines
805805 page[1].compound_order = order;
806806 }
807807
808+/* Returns the number of pages in this potentially compound page. */
809+static inline unsigned long compound_nr(struct page *page)
810+{
811+ return 1UL << compound_order(page);
812+}
813+
814+/* Returns the number of bytes in this potentially compound page. */
815+static inline unsigned long page_size(struct page *page)
816+{
817+ return PAGE_SIZE << compound_order(page);
818+}
819+
820+/* Returns the number of bits needed for the number of bytes in a page */
821+static inline unsigned int page_shift(struct page *page)
822+{
823+ return PAGE_SHIFT + compound_order(page);
824+}
825+
808826 void free_compound_page(struct page *page);
809827
810828 #ifdef CONFIG_MMU
@@ -1057,8 +1075,9 @@ static inline void put_user_page(struct page *page) · 246 unmodified lines
10571075 put_page(page);
10581076 }
10591077
1060−void put_user_pages_dirty(struct page **pages, unsigned long npages);
1061−void put_user_pages_dirty_lock(struct page **pages, unsigned long npages);
1078+void put_user_pages_dirty_lock(struct page **pages, unsigned long npages,
1079+ bool make_dirty);
1080+
10621081 void put_user_pages(struct page **pages, unsigned long npages);
10631082
10641083 #if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
@@ -1405,7 +1424,11 @@ extern void pagefault_out_of_memory(void); · 340 unmodified lines
14051424
14061425 extern void show_free_areas(unsigned int flags, nodemask_t *nodemask);
14071426
1427+#ifdef CONFIG_MMU
14081428 extern bool can_do_mlock(void);
1429+#else
1430+static inline bool can_do_mlock(void) { return false; }
1431+#endif
14091432 extern int user_shm_lock(size_t, struct user_struct *);
14101433 extern void user_shm_unlock(size_t, struct user_struct *);
14111434
@@ -1430,54 +1453,8 @@ void zap_page_range(struct vm_area_struct *vma, unsigned long address, · 18 unmodified lines
14301453 void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma,
14311454 unsigned long start, unsigned long end);
14321455
1433−/**
1434− * mm_walk - callbacks for walk_page_range
1435− * @pud_entry: if set, called for each non-empty PUD (2nd-level) entry
1436− * this handler should only handle pud_trans_huge() puds.
1437− * the pmd_entry or pte_entry callbacks will be used for
1438− * regular PUDs.
1439− * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry
1440− * this handler is required to be able to handle
1441− * pmd_trans_huge() pmds. They may simply choose to
1442− * split_huge_page() instead of handling it explicitly.
1443− * @pte_entry: if set, called for each non-empty PTE (4th-level) entry
1444− * @pte_hole: if set, called for each hole at all levels
1445− * @hugetlb_entry: if set, called for each hugetlb entry
1446− * @test_walk: caller specific callback function to determine whether
1447− * we walk over the current vma or not. Returning 0
1448− * value means "do page table walk over the current vma,"
1449− * and a negative one means "abort current page table walk
1450− * right now." 1 means "skip the current vma."
1451− * @mm: mm_struct representing the target process of page table walk
1452− * @vma: vma currently walked (NULL if walking outside vmas)
1453− * @private: private data for callbacks' usage
1454− *
1455− * (see the comment on walk_page_range() for more details)
1456− */
1457−struct mm_walk {
1458− int (*pud_entry)(pud_t *pud, unsigned long addr,
1459− unsigned long next, struct mm_walk *walk);
1460− int (*pmd_entry)(pmd_t *pmd, unsigned long addr,
1461− unsigned long next, struct mm_walk *walk);
1462− int (*pte_entry)(pte_t *pte, unsigned long addr,
1463− unsigned long next, struct mm_walk *walk);
1464− int (*pte_hole)(unsigned long addr, unsigned long next,
1465− struct mm_walk *walk);
1466− int (*hugetlb_entry)(pte_t *pte, unsigned long hmask,
1467− unsigned long addr, unsigned long next,
1468− struct mm_walk *walk);
1469− int (*test_walk)(unsigned long addr, unsigned long next,
1470− struct mm_walk *walk);
1471− struct mm_struct *mm;
1472− struct vm_area_struct *vma;
1473− void *private;
1474−};
1475−
14761456 struct mmu_notifier_range;
14771457
1478−int walk_page_range(unsigned long addr, unsigned long end,
1479− struct mm_walk *walk);
1480−int walk_page_vma(struct vm_area_struct *vma, struct mm_walk *walk);
14811458 void free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
14821459 unsigned long end, unsigned long floor, unsigned long ceiling);
14831460 int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
@@ -1972,7 +1949,7 @@ static inline void pgtable_init(void) · 488 unmodified lines
19721949 pgtable_cache_init();
19731950 }
19741951
1975−static inline bool pgtable_page_ctor(struct page *page)
1952+static inline bool pgtable_pte_page_ctor(struct page *page)
19761953 {
19771954 if (!ptlock_init(page))
19781955 return false;
@@ -1981,7 +1958,7 @@ static inline bool pgtable_page_ctor(struct page *page) · 2 unmodified lines
19811958 return true;
19821959 }
19831960
1984−static inline void pgtable_page_dtor(struct page *page)
1961+static inline void pgtable_pte_page_dtor(struct page *page)
19851962 {
19861963 ptlock_free(page);
19871964 __ClearPageTable(page);
@@ -2351,6 +2328,8 @@ extern int install_special_mapping(struct mm_struct *mm, · 363 unmodified lines
23512328 unsigned long addr, unsigned long len,
23522329 unsigned long flags, struct page **pages);
23532330
2331+unsigned long randomize_stack_top(unsigned long stack_top);
2332+
23542333 extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
23552334
23562335 extern unsigned long mmap_region(struct file *file, unsigned long addr,
@@ -2614,6 +2593,7 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, · 257 unmodified lines
26142593 #define FOLL_COW 0x4000 /* internal GUP flag */
26152594 #define FOLL_ANON 0x8000 /* don't do file mappings */
26162595 #define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite: see below */
2596+#define FOLL_SPLIT_PMD 0x20000 /* split huge pmd before returning */
26172597
26182598 /*
26192599 * NOTE on FOLL_LONGTERM:
@@ -2891,5 +2871,12 @@ void __init setup_nr_node_ids(void); · 271 unmodified lines
28912871 static inline void setup_nr_node_ids(void) {}
28922872 #endif
28932873
2874+extern int memcmp_pages(struct page *page1, struct page *page2);
2875+
2876+static inline int pages_identical(struct page *page1, struct page *page2)
2877+{
2878+ return !memcmp_pages(page1, page2);
2879+}
2880+
28942881 #endif /* __KERNEL__ */
28952882 #endif /* _LINUX_MM_H */
include/linux/mm_types.h+22−10
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525
2626 struct address_space;
2727 struct mem_cgroup;
28−struct hmm;
2928
3029 /*
3130 * Each physical page in the system has a struct page associated with
@@ -139,6 +138,7 @@ struct page { · 107 unmodified lines
139138 struct { /* Second tail page of compound page */
140139 unsigned long _compound_pad_1; /* compound_head */
141140 unsigned long _compound_pad_2;
141+ /* For both global and memcg */
142142 struct list_head deferred_list;
143143 };
144144 struct { /* Page table pages */
@@ -159,7 +159,16 @@ struct page { · 14 unmodified lines
159159 /** @pgmap: Points to the hosting device page map. */
160160 struct dev_pagemap *pgmap;
161161 void *zone_device_data;
162− unsigned long _zd_pad_1; /* uses mapping */
162+ /*
163+ * ZONE_DEVICE private pages are counted as being
164+ * mapped so the next 3 words hold the mapping, index,
165+ * and private fields from the source anonymous or
166+ * page cache page while the page is migrated to device
167+ * private memory.
168+ * ZONE_DEVICE MEMORY_DEVICE_FS_DAX pages also
169+ * use the mapping, index, and private fields when
170+ * pmem backed DAX files are mapped.
171+ */
163172 };
164173
165174 /** @rcu_head: You can use this to free a page by RCU. */
@@ -374,6 +383,16 @@ struct mm_struct { · 208 unmodified lines
374383 unsigned long highest_vm_end; /* highest vma end address */
375384 pgd_t * pgd;
376385
386+#ifdef CONFIG_MEMBARRIER
387+ /**
388+ * @membarrier_state: Flags controlling membarrier behavior.
389+ *
390+ * This field is close to @pgd to hopefully fit in the same
391+ * cache-line, which needs to be touched by switch_mm().
392+ */
393+ atomic_t membarrier_state;
394+#endif
395+
377396 /**
378397 * @mm_users: The number of users including userspace.
379398 *
@@ -443,9 +462,7 @@ struct mm_struct { · 63 unmodified lines
443462 unsigned long flags; /* Must use atomic bitops to access */
444463
445464 struct core_state *core_state; /* coredumping support */
446−#ifdef CONFIG_MEMBARRIER
447− atomic_t membarrier_state;
448−#endif
465+
449466 #ifdef CONFIG_AIO
450467 spinlock_t ioctx_lock;
451468 struct kioctx_table __rcu *ioctx_table;
@@ -502,11 +519,6 @@ struct mm_struct { · 50 unmodified lines
502519 atomic_long_t hugetlb_usage;
503520 #endif
504521 struct work_struct async_put_work;
505−
506−#ifdef CONFIG_HMM_MIRROR
507− /* HMM needs to track a few things per mm */
508− struct hmm *hmm;
509−#endif
510522 } __randomize_layout;
511523
512524 /*
include/linux/mm_types_task.h+4−0
@@ -36,6 +36,10 @@ struct vmacache { · 35 unmodified lines
3636 struct vm_area_struct *vmas[VMACACHE_SIZE];
3737 };
3838
39+/*
40+ * When updating this, please also update struct resident_page_types[] in
41+ * kernel/fork.c
42+ */
3943 enum {
4044 MM_FILEPAGES, /* Resident file mapping pages */
4145 MM_ANONPAGES, /* Resident anonymous pages */
include/linux/mmc/host.h+12−0
@@ -128,6 +128,7 @@ struct mmc_host_ops { · 127 unmodified lines
128128 int (*get_cd)(struct mmc_host *host);
129129
130130 void (*enable_sdio_irq)(struct mmc_host *host, int enable);
131+ /* Mandatory callback when using MMC_CAP2_SDIO_IRQ_NOTHREAD. */
131132 void (*ack_sdio_irq)(struct mmc_host *host);
132133
133134 /* optional callback for HC quirks */
@@ -367,6 +368,7 @@ struct mmc_host { · 233 unmodified lines
367368 #define MMC_CAP2_CQE (1 << 23) /* Has eMMC command queue engine */
368369 #define MMC_CAP2_CQE_DCMD (1 << 24) /* CQE can issue a direct command */
369370 #define MMC_CAP2_AVOID_3_3V (1 << 25) /* Host must negotiate down from 3.3V */
371+#define MMC_CAP2_MERGE_CAPABLE (1 << 26) /* Host can merge a segment over the segment size */
370372
371373 int fixed_drv_type; /* fixed driver type for non-removable media */
372374
@@ -396,6 +398,7 @@ struct mmc_host { · 23 unmodified lines
396398 unsigned int retune_paused:1; /* re-tuning is temporarily disabled */
397399 unsigned int use_blk_mq:1; /* use blk-mq */
398400 unsigned int retune_crc_disable:1; /* don't trigger retune upon crc */
401+ unsigned int can_dma_map_merge:1; /* merging can be used */
399402
400403 int rescan_disable; /* disable card detection */
401404 int rescan_entered; /* used with nonremovable devices */
@@ -493,6 +496,15 @@ void mmc_command_done(struct mmc_host *host, struct mmc_request *mrq); · 91 unmodified lines
493496
494497 void mmc_cqe_request_done(struct mmc_host *host, struct mmc_request *mrq);
495498
499+/*
500+ * May be called from host driver's system/runtime suspend/resume callbacks,
501+ * to know if SDIO IRQs has been claimed.
502+ */
503+static inline bool sdio_irq_claimed(struct mmc_host *host)
504+{
505+ return host->sdio_irqs > 0;
506+}
507+
496508 static inline void mmc_signal_sdio_irq(struct mmc_host *host)
497509 {
498510 host->ops->enable_sdio_irq(host, 0);
include/linux/mmu_notifier.h+52−7
@@ -42,6 +42,10 @@ enum mmu_notifier_event { · 41 unmodified lines
4242
4343 #ifdef CONFIG_MMU_NOTIFIER
4444
45+#ifdef CONFIG_LOCKDEP
46+extern struct lockdep_map __mmu_notifier_invalidate_range_start_map;
47+#endif
48+
4549 /*
4650 * The mmu notifier_mm structure is allocated and installed in
4751 * mm->mmu_notifier_mm inside the mm_take_all_locks() protected
@@ -211,6 +215,19 @@ struct mmu_notifier_ops { · 163 unmodified lines
211215 */
212216 void (*invalidate_range)(struct mmu_notifier *mn, struct mm_struct *mm,
213217 unsigned long start, unsigned long end);
218+
219+ /*
220+ * These callbacks are used with the get/put interface to manage the
221+ * lifetime of the mmu_notifier memory. alloc_notifier() returns a new
222+ * notifier for use with the mm.
223+ *
224+ * free_notifier() is only called after the mmu_notifier has been
225+ * fully put, calls to any ops callback are prevented and no ops
226+ * callbacks are currently running. It is called from a SRCU callback
227+ * and cannot sleep.
228+ */
229+ struct mmu_notifier *(*alloc_notifier)(struct mm_struct *mm);
230+ void (*free_notifier)(struct mmu_notifier *mn);
214231 };
215232
216233 /*
@@ -227,6 +244,9 @@ struct mmu_notifier_ops { · 10 unmodified lines
227244 struct mmu_notifier {
228245 struct hlist_node hlist;
229246 const struct mmu_notifier_ops *ops;
247+ struct mm_struct *mm;
248+ struct rcu_head rcu;
249+ unsigned int users;
230250 };
231251
232252 static inline int mm_has_notifiers(struct mm_struct *mm)
@@ -234,14 +254,27 @@ static inline int mm_has_notifiers(struct mm_struct *mm) · 1 unmodified line
234254 return unlikely(mm->mmu_notifier_mm);
235255 }
236256
257+struct mmu_notifier *mmu_notifier_get_locked(const struct mmu_notifier_ops *ops,
258+ struct mm_struct *mm);
259+static inline struct mmu_notifier *
260+mmu_notifier_get(const struct mmu_notifier_ops *ops, struct mm_struct *mm)
261+{
262+ struct mmu_notifier *ret;
263+
264+ down_write(&mm->mmap_sem);
265+ ret = mmu_notifier_get_locked(ops, mm);
266+ up_write(&mm->mmap_sem);
267+ return ret;
268+}
269+void mmu_notifier_put(struct mmu_notifier *mn);
270+void mmu_notifier_synchronize(void);
271+
237272 extern int mmu_notifier_register(struct mmu_notifier *mn,
238273 struct mm_struct *mm);
239274 extern int __mmu_notifier_register(struct mmu_notifier *mn,
240275 struct mm_struct *mm);
241276 extern void mmu_notifier_unregister(struct mmu_notifier *mn,
242277 struct mm_struct *mm);
243−extern void mmu_notifier_unregister_no_release(struct mmu_notifier *mn,
244− struct mm_struct *mm);
245278 extern void __mmu_notifier_mm_destroy(struct mm_struct *mm);
246279 extern void __mmu_notifier_release(struct mm_struct *mm);
247280 extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm,
@@ -310,25 +343,36 @@ static inline void mmu_notifier_change_pte(struct mm_struct *mm, · 62 unmodified lines
310343 static inline void
311344 mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range)
312345 {
346+ might_sleep();
347+
348+ lock_map_acquire(&__mmu_notifier_invalidate_range_start_map);
313349 if (mm_has_notifiers(range->mm)) {
314350 range->flags |= MMU_NOTIFIER_RANGE_BLOCKABLE;
315351 __mmu_notifier_invalidate_range_start(range);
316352 }
353+ lock_map_release(&__mmu_notifier_invalidate_range_start_map);
317354 }
318355
319356 static inline int
320357 mmu_notifier_invalidate_range_start_nonblock(struct mmu_notifier_range *range)
321358 {
359+ int ret = 0;
360+
361+ lock_map_acquire(&__mmu_notifier_invalidate_range_start_map);
322362 if (mm_has_notifiers(range->mm)) {
323363 range->flags &= ~MMU_NOTIFIER_RANGE_BLOCKABLE;
324− return __mmu_notifier_invalidate_range_start(range);
364+ ret = __mmu_notifier_invalidate_range_start(range);
325365 }
326− return 0;
366+ lock_map_release(&__mmu_notifier_invalidate_range_start_map);
367+ return ret;
327368 }
328369
329370 static inline void
330371 mmu_notifier_invalidate_range_end(struct mmu_notifier_range *range)
331372 {
373+ if (mmu_notifier_range_blockable(range))
374+ might_sleep();
375+
332376 if (mm_has_notifiers(range->mm))
333377 __mmu_notifier_invalidate_range_end(range, false);
334378 }
@@ -482,9 +526,6 @@ static inline void mmu_notifier_range_init(struct mmu_notifier_range *range, · 147 unmodified lines
482526 set_pte_at(___mm, ___address, __ptep, ___pte); \
483527 })
484528
485−extern void mmu_notifier_call_srcu(struct rcu_head *rcu,
486− void (*func)(struct rcu_head *rcu));
487−
488529 #else /* CONFIG_MMU_NOTIFIER */
489530
490531 struct mmu_notifier_range {
@@ -581,6 +622,10 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) · 90 unmodified lines
581622 #define pudp_huge_clear_flush_notify pudp_huge_clear_flush
582623 #define set_pte_at_notify set_pte_at
583624
625+static inline void mmu_notifier_synchronize(void)
626+{
627+}
628+
584629 #endif /* CONFIG_MMU_NOTIFIER */
585630
586631 #endif /* _LINUX_MMU_NOTIFIER_H */
include/linux/mmzone.h+14−5
@@ -215,8 +215,9 @@ enum node_stat_item { · 214 unmodified lines
215215 NR_INACTIVE_FILE, /* " " " " " */
216216 NR_ACTIVE_FILE, /* " " " " " */
217217 NR_UNEVICTABLE, /* " " " " " */
218− NR_SLAB_RECLAIMABLE,
219− NR_SLAB_UNRECLAIMABLE,
218+ NR_SLAB_RECLAIMABLE, /* Please do not reorder this item */
219+ NR_SLAB_UNRECLAIMABLE, /* and this one without looking at
220+ * memcg_flush_percpu_vmstats() first. */
220221 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */
221222 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */
222223 WORKINGSET_NODES,
@@ -234,6 +235,8 @@ enum node_stat_item { · 11 unmodified lines
234235 NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */
235236 NR_SHMEM_THPS,
236237 NR_SHMEM_PMDMAPPED,
238+ NR_FILE_THPS,
239+ NR_FILE_PMDMAPPED,
237240 NR_ANON_THPS,
238241 NR_UNSTABLE_NFS, /* NFS unstable pages */
239242 NR_VMSCAN_WRITE,
@@ -676,6 +679,14 @@ struct zonelist { · 436 unmodified lines
676679 extern struct page *mem_map;
677680 #endif
678681
682+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
683+struct deferred_split {
684+ spinlock_t split_queue_lock;
685+ struct list_head split_queue;
686+ unsigned long split_queue_len;
687+};
688+#endif
689+
679690 /*
680691 * On NUMA machines, each NUMA node would have a pg_data_t to describe
681692 * it's memory layout. On UMA machines there is a single pglist_data which
@@ -755,9 +766,7 @@ typedef struct pglist_data { · 73 unmodified lines
755766 #endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
756767
757768 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
758− spinlock_t split_queue_lock;
759− struct list_head split_queue;
760− unsigned long split_queue_len;
769+ struct deferred_split deferred_split_queue;
761770 #endif
762771
763772 /* Fields commonly accessed by the page reclaim scanner */
include/linux/mod_devicetable.h+1−0
@@ -814,6 +814,7 @@ struct tee_client_device_id { · 813 unmodified lines
814814 /**
815815 * struct wmi_device_id - WMI device identifier
816816 * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
817+ * @context: pointer to driver specific data
817818 */
818819 struct wmi_device_id {
819820 const char guid_string[UUID_STRING_LEN+1];
include/linux/module.h+2−3
@@ -26,9 +26,6 @@ · 25 unmodified lines
2626 #include <linux/percpu.h>
2727 #include <asm/module.h>
2828
29−/* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */
30−#define MODULE_SIG_STRING "~Module signature appended~\n"
31−
3229 /* Not Yet Implemented */
3330 #define MODULE_SUPPORTED_DEVICE(name)
3431
@@ -276,6 +273,8 @@ extern typeof(name) __mod_##type##__##name##_device_table \ · 241 unmodified lines
276273 * files require multiple MODULE_FIRMWARE() specifiers */
277274 #define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
278275
276+#define MODULE_IMPORT_NS(ns) MODULE_INFO(import_ns, #ns)
277+
279278 struct notifier_block;
280279
281280 #ifdef CONFIG_MODULES
include/linux/module_signature.h+46−0
@@ -0,0 +1,46 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
2+/*
3+ * Module signature handling.
4+ *
5+ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
6+ * Written by David Howells (dhowells@redhat.com)
7+ */
8+
9+#ifndef _LINUX_MODULE_SIGNATURE_H
10+#define _LINUX_MODULE_SIGNATURE_H
11+
12+#include <linux/types.h>
13+
14+/* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */
15+#define MODULE_SIG_STRING "~Module signature appended~\n"
16+
17+enum pkey_id_type {
18+ PKEY_ID_PGP, /* OpenPGP generated key ID */
19+ PKEY_ID_X509, /* X.509 arbitrary subjectKeyIdentifier */
20+ PKEY_ID_PKCS7, /* Signature in PKCS#7 message */
21+};
22+
23+/*
24+ * Module signature information block.
25+ *
26+ * The constituents of the signature section are, in order:
27+ *
28+ * - Signer's name
29+ * - Key identifier
30+ * - Signature data
31+ * - Information block
32+ */
33+struct module_signature {
34+ u8 algo; /* Public-key crypto algorithm [0] */
35+ u8 hash; /* Digest algorithm [0] */
36+ u8 id_type; /* Key identifier type [PKEY_ID_PKCS7] */
37+ u8 signer_len; /* Length of signer's name [0] */
38+ u8 key_id_len; /* Length of key identifier [0] */
39+ u8 __pad[3];
40+ __be32 sig_len; /* Length of signature data */
41+};
42+
43+int mod_check_sig(const struct module_signature *ms, size_t file_len,
44+ const char *name);
45+
46+#endif /* _LINUX_MODULE_SIGNATURE_H */
include/linux/moxtet.h+109−0
@@ -0,0 +1,109 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Turris Mox module configuration bus driver
4+ *
5+ * Copyright (C) 2019 Marek Behun <marek.behun@nic.cz>
6+ */
7+
8+#ifndef __LINUX_MOXTET_H
9+#define __LINUX_MOXTET_H
10+
11+#include <linux/device.h>
12+#include <linux/irq.h>
13+#include <linux/irqdomain.h>
14+#include <linux/mutex.h>
15+
16+#define TURRIS_MOX_MAX_MODULES 10
17+
18+enum turris_mox_cpu_module_id {
19+ TURRIS_MOX_CPU_ID_EMMC = 0x00,
20+ TURRIS_MOX_CPU_ID_SD = 0x10,
21+};
22+
23+enum turris_mox_module_id {
24+ TURRIS_MOX_MODULE_FIRST = 0x01,
25+
26+ TURRIS_MOX_MODULE_SFP = 0x01,
27+ TURRIS_MOX_MODULE_PCI = 0x02,
28+ TURRIS_MOX_MODULE_TOPAZ = 0x03,
29+ TURRIS_MOX_MODULE_PERIDOT = 0x04,
30+ TURRIS_MOX_MODULE_USB3 = 0x05,
31+ TURRIS_MOX_MODULE_PCI_BRIDGE = 0x06,
32+
33+ TURRIS_MOX_MODULE_LAST = 0x06,
34+};
35+
36+#define MOXTET_NIRQS 16
37+
38+extern struct bus_type moxtet_type;
39+
40+struct moxtet {
41+ struct device *dev;
42+ struct mutex lock;
43+ u8 modules[TURRIS_MOX_MAX_MODULES];
44+ int count;
45+ u8 tx[TURRIS_MOX_MAX_MODULES];
46+ int dev_irq;
47+ struct {
48+ struct irq_domain *domain;
49+ struct irq_chip chip;
50+ unsigned long masked, exists;
51+ struct moxtet_irqpos {
52+ u8 idx;
53+ u8 bit;
54+ } position[MOXTET_NIRQS];
55+ } irq;
56+#ifdef CONFIG_DEBUG_FS
57+ struct dentry *debugfs_root;
58+#endif
59+};
60+
61+struct moxtet_driver {
62+ const enum turris_mox_module_id *id_table;
63+ struct device_driver driver;
64+};
65+
66+static inline struct moxtet_driver *
67+to_moxtet_driver(struct device_driver *drv)
68+{
69+ if (!drv)
70+ return NULL;
71+ return container_of(drv, struct moxtet_driver, driver);
72+}
73+
74+extern int __moxtet_register_driver(struct module *owner,
75+ struct moxtet_driver *mdrv);
76+
77+static inline void moxtet_unregister_driver(struct moxtet_driver *mdrv)
78+{
79+ if (mdrv)
80+ driver_unregister(&mdrv->driver);
81+}
82+
83+#define moxtet_register_driver(driver) \
84+ __moxtet_register_driver(THIS_MODULE, driver)
85+
86+#define module_moxtet_driver(__moxtet_driver) \
87+ module_driver(__moxtet_driver, moxtet_register_driver, \
88+ moxtet_unregister_driver)
89+
90+struct moxtet_device {
91+ struct device dev;
92+ struct moxtet *moxtet;
93+ enum turris_mox_module_id id;
94+ unsigned int idx;
95+};
96+
97+extern int moxtet_device_read(struct device *dev);
98+extern int moxtet_device_write(struct device *dev, u8 val);
99+extern int moxtet_device_written(struct device *dev);
100+
101+static inline struct moxtet_device *
102+to_moxtet_device(struct device *dev)
103+{
104+ if (!dev)
105+ return NULL;
106+ return container_of(dev, struct moxtet_device, dev);
107+}
108+
109+#endif /* __LINUX_MOXTET_H */
include/linux/mtd/mtd.h+3−0
@@ -189,6 +189,9 @@ struct module; /* only needed for owner field in mtd_info */ · 188 unmodified lines
189189 */
190190 struct mtd_debug_info {
191191 struct dentry *dfs_dir;
192+
193+ const char *partname;
194+ const char *partid;
192195 };
193196
194197 struct mtd_info {
include/linux/mtd/nand.h+1−1
@@ -346,7 +346,7 @@ static inline unsigned int nanddev_ntargets(const struct nand_device *nand) · 345 unmodified lines
346346 }
347347
348348 /**
349− * nanddev_neraseblocks() - Get the total number of erasablocks
349+ * nanddev_neraseblocks() - Get the total number of eraseblocks
350350 * @nand: NAND device
351351 *
352352 * Return: the total number of eraseblocks exposed by @nand.
include/linux/mtd/sharpsl.h+5−0
@@ -5,6 +5,9 @@ · 4 unmodified lines
55 * Copyright (C) 2008 Dmitry Baryshkov
66 */
77
8+#ifndef _MTD_SHARPSL_H
9+#define _MTD_SHARPSL_H
10+
811 #include <linux/mtd/rawnand.h>
912 #include <linux/mtd/nand_ecc.h>
1013 #include <linux/mtd/partitions.h>
@@ -16,3 +19,5 @@ struct sharpsl_nand_platform_data { · 5 unmodified lines
1619 unsigned int nr_partitions;
1720 const char *const *part_parsers;
1821 };
22+
23+#endif /* _MTD_SHARPSL_H */
include/linux/mtd/spi-nor.h+209−82
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include <linux/bitops.h>
1010 #include <linux/mtd/cfi.h>
1111 #include <linux/mtd/mtd.h>
12+#include <linux/spi/spi-mem.h>
1213
1314 /*
1415 * Manufacturer IDs
@@ -224,7 +225,6 @@ static inline u8 spi_nor_get_protocol_width(enum spi_nor_protocol proto) · 209 unmodified lines
224225 return spi_nor_get_protocol_data_nbits(proto);
225226 }
226227
227−#define SPI_NOR_MAX_CMD_SIZE 8
228228 enum spi_nor_ops {
229229 SPI_NOR_OPS_READ = 0,
230230 SPI_NOR_OPS_WRITE,
@@ -237,12 +237,12 @@ enum spi_nor_option_flags { · 6 unmodified lines
237237 SNOR_F_USE_FSR = BIT(0),
238238 SNOR_F_HAS_SR_TB = BIT(1),
239239 SNOR_F_NO_OP_CHIP_ERASE = BIT(2),
240− SNOR_F_S3AN_ADDR_DEFAULT = BIT(3),
241− SNOR_F_READY_XSR_RDY = BIT(4),
242− SNOR_F_USE_CLSR = BIT(5),
243− SNOR_F_BROKEN_RESET = BIT(6),
244− SNOR_F_4B_OPCODES = BIT(7),
245− SNOR_F_HAS_4BAIT = BIT(8),
240+ SNOR_F_READY_XSR_RDY = BIT(3),
241+ SNOR_F_USE_CLSR = BIT(4),
242+ SNOR_F_BROKEN_RESET = BIT(5),
243+ SNOR_F_4B_OPCODES = BIT(6),
244+ SNOR_F_HAS_4BAIT = BIT(7),
245+ SNOR_F_HAS_LOCK = BIT(8),
246246 };
247247
248248 /**
@@ -333,6 +333,195 @@ struct spi_nor_erase_map { · 84 unmodified lines
333333 u8 uniform_erase_type;
334334 };
335335
336+/**
337+ * struct spi_nor_hwcaps - Structure for describing the hardware capabilies
338+ * supported by the SPI controller (bus master).
339+ * @mask: the bitmask listing all the supported hw capabilies
340+ */
341+struct spi_nor_hwcaps {
342+ u32 mask;
343+};
344+
345+/*
346+ *(Fast) Read capabilities.
347+ * MUST be ordered by priority: the higher bit position, the higher priority.
348+ * As a matter of performances, it is relevant to use Octal SPI protocols first,
349+ * then Quad SPI protocols before Dual SPI protocols, Fast Read and lastly
350+ * (Slow) Read.
351+ */
352+#define SNOR_HWCAPS_READ_MASK GENMASK(14, 0)
353+#define SNOR_HWCAPS_READ BIT(0)
354+#define SNOR_HWCAPS_READ_FAST BIT(1)
355+#define SNOR_HWCAPS_READ_1_1_1_DTR BIT(2)
356+
357+#define SNOR_HWCAPS_READ_DUAL GENMASK(6, 3)
358+#define SNOR_HWCAPS_READ_1_1_2 BIT(3)
359+#define SNOR_HWCAPS_READ_1_2_2 BIT(4)
360+#define SNOR_HWCAPS_READ_2_2_2 BIT(5)
361+#define SNOR_HWCAPS_READ_1_2_2_DTR BIT(6)
362+
363+#define SNOR_HWCAPS_READ_QUAD GENMASK(10, 7)
364+#define SNOR_HWCAPS_READ_1_1_4 BIT(7)
365+#define SNOR_HWCAPS_READ_1_4_4 BIT(8)
366+#define SNOR_HWCAPS_READ_4_4_4 BIT(9)
367+#define SNOR_HWCAPS_READ_1_4_4_DTR BIT(10)
368+
369+#define SNOR_HWCAPS_READ_OCTAL GENMASK(14, 11)
370+#define SNOR_HWCAPS_READ_1_1_8 BIT(11)
371+#define SNOR_HWCAPS_READ_1_8_8 BIT(12)
372+#define SNOR_HWCAPS_READ_8_8_8 BIT(13)
373+#define SNOR_HWCAPS_READ_1_8_8_DTR BIT(14)
374+
375+/*
376+ * Page Program capabilities.
377+ * MUST be ordered by priority: the higher bit position, the higher priority.
378+ * Like (Fast) Read capabilities, Octal/Quad SPI protocols are preferred to the
379+ * legacy SPI 1-1-1 protocol.
380+ * Note that Dual Page Programs are not supported because there is no existing
381+ * JEDEC/SFDP standard to define them. Also at this moment no SPI flash memory
382+ * implements such commands.
383+ */
384+#define SNOR_HWCAPS_PP_MASK GENMASK(22, 16)
385+#define SNOR_HWCAPS_PP BIT(16)
386+
387+#define SNOR_HWCAPS_PP_QUAD GENMASK(19, 17)
388+#define SNOR_HWCAPS_PP_1_1_4 BIT(17)
389+#define SNOR_HWCAPS_PP_1_4_4 BIT(18)
390+#define SNOR_HWCAPS_PP_4_4_4 BIT(19)
391+
392+#define SNOR_HWCAPS_PP_OCTAL GENMASK(22, 20)
393+#define SNOR_HWCAPS_PP_1_1_8 BIT(20)
394+#define SNOR_HWCAPS_PP_1_8_8 BIT(21)
395+#define SNOR_HWCAPS_PP_8_8_8 BIT(22)
396+
397+#define SNOR_HWCAPS_X_X_X (SNOR_HWCAPS_READ_2_2_2 | \
398+ SNOR_HWCAPS_READ_4_4_4 | \
399+ SNOR_HWCAPS_READ_8_8_8 | \
400+ SNOR_HWCAPS_PP_4_4_4 | \
401+ SNOR_HWCAPS_PP_8_8_8)
402+
403+#define SNOR_HWCAPS_DTR (SNOR_HWCAPS_READ_1_1_1_DTR | \
404+ SNOR_HWCAPS_READ_1_2_2_DTR | \
405+ SNOR_HWCAPS_READ_1_4_4_DTR | \
406+ SNOR_HWCAPS_READ_1_8_8_DTR)
407+
408+#define SNOR_HWCAPS_ALL (SNOR_HWCAPS_READ_MASK | \
409+ SNOR_HWCAPS_PP_MASK)
410+
411+struct spi_nor_read_command {
412+ u8 num_mode_clocks;
413+ u8 num_wait_states;
414+ u8 opcode;
415+ enum spi_nor_protocol proto;
416+};
417+
418+struct spi_nor_pp_command {
419+ u8 opcode;
420+ enum spi_nor_protocol proto;
421+};
422+
423+enum spi_nor_read_command_index {
424+ SNOR_CMD_READ,
425+ SNOR_CMD_READ_FAST,
426+ SNOR_CMD_READ_1_1_1_DTR,
427+
428+ /* Dual SPI */
429+ SNOR_CMD_READ_1_1_2,
430+ SNOR_CMD_READ_1_2_2,
431+ SNOR_CMD_READ_2_2_2,
432+ SNOR_CMD_READ_1_2_2_DTR,
433+
434+ /* Quad SPI */
435+ SNOR_CMD_READ_1_1_4,
436+ SNOR_CMD_READ_1_4_4,
437+ SNOR_CMD_READ_4_4_4,
438+ SNOR_CMD_READ_1_4_4_DTR,
439+
440+ /* Octal SPI */
441+ SNOR_CMD_READ_1_1_8,
442+ SNOR_CMD_READ_1_8_8,
443+ SNOR_CMD_READ_8_8_8,
444+ SNOR_CMD_READ_1_8_8_DTR,
445+
446+ SNOR_CMD_READ_MAX
447+};
448+
449+enum spi_nor_pp_command_index {
450+ SNOR_CMD_PP,
451+
452+ /* Quad SPI */
453+ SNOR_CMD_PP_1_1_4,
454+ SNOR_CMD_PP_1_4_4,
455+ SNOR_CMD_PP_4_4_4,
456+
457+ /* Octal SPI */
458+ SNOR_CMD_PP_1_1_8,
459+ SNOR_CMD_PP_1_8_8,
460+ SNOR_CMD_PP_8_8_8,
461+
462+ SNOR_CMD_PP_MAX
463+};
464+
465+/* Forward declaration that will be used in 'struct spi_nor_flash_parameter' */
466+struct spi_nor;
467+
468+/**
469+ * struct spi_nor_locking_ops - SPI NOR locking methods
470+ * @lock: lock a region of the SPI NOR.
471+ * @unlock: unlock a region of the SPI NOR.
472+ * @is_locked: check if a region of the SPI NOR is completely locked
473+ */
474+struct spi_nor_locking_ops {
475+ int (*lock)(struct spi_nor *nor, loff_t ofs, uint64_t len);
476+ int (*unlock)(struct spi_nor *nor, loff_t ofs, uint64_t len);
477+ int (*is_locked)(struct spi_nor *nor, loff_t ofs, uint64_t len);
478+};
479+
480+/**
481+ * struct spi_nor_flash_parameter - SPI NOR flash parameters and settings.
482+ * Includes legacy flash parameters and settings that can be overwritten
483+ * by the spi_nor_fixups hooks, or dynamically when parsing the JESD216
484+ * Serial Flash Discoverable Parameters (SFDP) tables.
485+ *
486+ * @size: the flash memory density in bytes.
487+ * @page_size: the page size of the SPI NOR flash memory.
488+ * @hwcaps: describes the read and page program hardware
489+ * capabilities.
490+ * @reads: read capabilities ordered by priority: the higher index
491+ * in the array, the higher priority.
492+ * @page_programs: page program capabilities ordered by priority: the
493+ * higher index in the array, the higher priority.
494+ * @erase_map: the erase map parsed from the SFDP Sector Map Parameter
495+ * Table.
496+ * @quad_enable: enables SPI NOR quad mode.
497+ * @set_4byte: puts the SPI NOR in 4 byte addressing mode.
498+ * @convert_addr: converts an absolute address into something the flash
499+ * will understand. Particularly useful when pagesize is
500+ * not a power-of-2.
501+ * @setup: configures the SPI NOR memory. Useful for SPI NOR
502+ * flashes that have peculiarities to the SPI NOR standard
503+ * e.g. different opcodes, specific address calculation,
504+ * page size, etc.
505+ * @locking_ops: SPI NOR locking methods.
506+ */
507+struct spi_nor_flash_parameter {
508+ u64 size;
509+ u32 page_size;
510+
511+ struct spi_nor_hwcaps hwcaps;
512+ struct spi_nor_read_command reads[SNOR_CMD_READ_MAX];
513+ struct spi_nor_pp_command page_programs[SNOR_CMD_PP_MAX];
514+
515+ struct spi_nor_erase_map erase_map;
516+
517+ int (*quad_enable)(struct spi_nor *nor);
518+ int (*set_4byte)(struct spi_nor *nor, bool enable);
519+ u32 (*convert_addr)(struct spi_nor *nor, u32 addr);
520+ int (*setup)(struct spi_nor *nor, const struct spi_nor_hwcaps *hwcaps);
521+
522+ const struct spi_nor_locking_ops *locking_ops;
523+};
524+
336525 /**
337526 * struct flash_info - Forward declaration of a structure used internally by
338527 * spi_nor_scan()
@@ -344,6 +533,10 @@ struct flash_info; · 5 unmodified lines
344533 * @mtd: point to a mtd_info structure
345534 * @lock: the lock for the read/write/erase/lock/unlock operations
346535 * @dev: point to a spi device, or a spi nor controller device.
536+ * @spimem: point to the spi mem device
537+ * @bouncebuf: bounce buffer used when the buffer passed by the MTD
538+ * layer is not DMA-able
539+ * @bouncebuf_size: size of the bounce buffer
347540 * @info: spi-nor part JDEC MFR id and other info
348541 * @page_size: the page size of the SPI NOR
349542 * @addr_width: number of address bytes
@@ -356,8 +549,6 @@ struct flash_info; · 6 unmodified lines
356549 * @read_proto: the SPI protocol for read operations
357550 * @write_proto: the SPI protocol for write operations
358551 * @reg_proto the SPI protocol for read_reg/write_reg/erase operations
359− * @cmd_buf: used by the write_reg
360− * @erase_map: the erase map of the SPI NOR
361552 * @prepare: [OPTIONAL] do some preparations for the
362553 * read/write/erase/lock/unlock operations
363554 * @unprepare: [OPTIONAL] do some post work after the
@@ -369,19 +560,21 @@ struct flash_info; · 5 unmodified lines
369560 * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR
370561 * at the offset @offs; if not provided by the driver,
371562 * spi-nor will send the erase opcode via write_reg()
372− * @flash_lock: [FLASH-SPECIFIC] lock a region of the SPI NOR
373− * @flash_unlock: [FLASH-SPECIFIC] unlock a region of the SPI NOR
374− * @flash_is_locked: [FLASH-SPECIFIC] check if a region of the SPI NOR is
375− * @quad_enable: [FLASH-SPECIFIC] enables SPI NOR quad mode
376563 * @clear_sr_bp: [FLASH-SPECIFIC] clears the Block Protection Bits from
377564 * the SPI NOR Status Register.
378− * completely locked
565+ * @params: [FLASH-SPECIFIC] SPI-NOR flash parameters and settings.
566+ * The structure includes legacy flash parameters and
567+ * settings that can be overwritten by the spi_nor_fixups
568+ * hooks, or dynamically when parsing the SFDP tables.
379569 * @priv: the private data
380570 */
381571 struct spi_nor {
382572 struct mtd_info mtd;
383573 struct mutex lock;
384574 struct device *dev;
575+ struct spi_mem *spimem;
576+ u8 *bouncebuf;
577+ size_t bouncebuf_size;
385578 const struct flash_info *info;
386579 u32 page_size;
387580 u8 addr_width;
@@ -394,8 +587,6 @@ struct spi_nor { · 6 unmodified lines
394587 enum spi_nor_protocol reg_proto;
395588 bool sst_write_second;
396589 u32 flags;
397− u8 cmd_buf[SPI_NOR_MAX_CMD_SIZE];
398− struct spi_nor_erase_map erase_map;
399590
400591 int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops);
401592 void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops);
@@ -408,11 +599,8 @@ struct spi_nor { · 6 unmodified lines
408599 size_t len, const u_char *write_buf);
409600 int (*erase)(struct spi_nor *nor, loff_t offs);
410601
411− int (*flash_lock)(struct spi_nor *nor, loff_t ofs, uint64_t len);
412− int (*flash_unlock)(struct spi_nor *nor, loff_t ofs, uint64_t len);
413− int (*flash_is_locked)(struct spi_nor *nor, loff_t ofs, uint64_t len);
414− int (*quad_enable)(struct spi_nor *nor);
415602 int (*clear_sr_bp)(struct spi_nor *nor);
603+ struct spi_nor_flash_parameter params;
416604
417605 void *priv;
418606 };
@@ -443,7 +631,7 @@ spi_nor_region_mark_overlay(struct spi_nor_erase_region *region) · 24 unmodified lines
443631
444632 static bool __maybe_unused spi_nor_has_uniform_erase(const struct spi_nor *nor)
445633 {
446− return !!nor->erase_map.uniform_erase_type;
634+ return !!nor->params.erase_map.uniform_erase_type;
447635 }
448636
449637 static inline void spi_nor_set_flash_node(struct spi_nor *nor,
@@ -457,67 +645,6 @@ static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor) · 7 unmodified lines
457645 return mtd_get_of_node(&nor->mtd);
458646 }
459647
460−/**
461− * struct spi_nor_hwcaps - Structure for describing the hardware capabilies
462− * supported by the SPI controller (bus master).
463− * @mask: the bitmask listing all the supported hw capabilies
464− */
465−struct spi_nor_hwcaps {
466− u32 mask;
467−};
468−
469−/*
470− *(Fast) Read capabilities.
471− * MUST be ordered by priority: the higher bit position, the higher priority.
472− * As a matter of performances, it is relevant to use Octal SPI protocols first,
473− * then Quad SPI protocols before Dual SPI protocols, Fast Read and lastly
474− * (Slow) Read.
475− */
476−#define SNOR_HWCAPS_READ_MASK GENMASK(14, 0)
477−#define SNOR_HWCAPS_READ BIT(0)
478−#define SNOR_HWCAPS_READ_FAST BIT(1)
479−#define SNOR_HWCAPS_READ_1_1_1_DTR BIT(2)
480−
481−#define SNOR_HWCAPS_READ_DUAL GENMASK(6, 3)
482−#define SNOR_HWCAPS_READ_1_1_2 BIT(3)
483−#define SNOR_HWCAPS_READ_1_2_2 BIT(4)
484−#define SNOR_HWCAPS_READ_2_2_2 BIT(5)
485−#define SNOR_HWCAPS_READ_1_2_2_DTR BIT(6)
486−
487−#define SNOR_HWCAPS_READ_QUAD GENMASK(10, 7)
488−#define SNOR_HWCAPS_READ_1_1_4 BIT(7)
489−#define SNOR_HWCAPS_READ_1_4_4 BIT(8)
490−#define SNOR_HWCAPS_READ_4_4_4 BIT(9)
491−#define SNOR_HWCAPS_READ_1_4_4_DTR BIT(10)
492−
493−#define SNOR_HWCAPS_READ_OCTAL GENMASK(14, 11)
494−#define SNOR_HWCAPS_READ_1_1_8 BIT(11)
495−#define SNOR_HWCAPS_READ_1_8_8 BIT(12)
496−#define SNOR_HWCAPS_READ_8_8_8 BIT(13)
497−#define SNOR_HWCAPS_READ_1_8_8_DTR BIT(14)
498−
499−/*
500− * Page Program capabilities.
501− * MUST be ordered by priority: the higher bit position, the higher priority.
502− * Like (Fast) Read capabilities, Octal/Quad SPI protocols are preferred to the
503− * legacy SPI 1-1-1 protocol.
504− * Note that Dual Page Programs are not supported because there is no existing
505− * JEDEC/SFDP standard to define them. Also at this moment no SPI flash memory
506− * implements such commands.
507− */
508−#define SNOR_HWCAPS_PP_MASK GENMASK(22, 16)
509−#define SNOR_HWCAPS_PP BIT(16)
510−
511−#define SNOR_HWCAPS_PP_QUAD GENMASK(19, 17)
512−#define SNOR_HWCAPS_PP_1_1_4 BIT(17)
513−#define SNOR_HWCAPS_PP_1_4_4 BIT(18)
514−#define SNOR_HWCAPS_PP_4_4_4 BIT(19)
515−
516−#define SNOR_HWCAPS_PP_OCTAL GENMASK(22, 20)
517−#define SNOR_HWCAPS_PP_1_1_8 BIT(20)
518−#define SNOR_HWCAPS_PP_1_8_8 BIT(21)
519−#define SNOR_HWCAPS_PP_8_8_8 BIT(22)
520−
521648 /**
522649 * spi_nor_scan() - scan the SPI NOR
523650 * @nor: the spi_nor structure
include/linux/mtd/super.h+3−3
@@ -14,9 +14,9 @@ · 13 unmodified lines
1414 #include <linux/fs.h>
1515 #include <linux/mount.h>
1616
17−extern struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
18− const char *dev_name, void *data,
19− int (*fill_super)(struct super_block *, void *, int));
17+extern int get_tree_mtd(struct fs_context *fc,
18+ int (*fill_super)(struct super_block *sb,
19+ struct fs_context *fc));
2020 extern void kill_mtd_super(struct super_block *sb);
2121
2222
include/linux/mutex.h+3−22
@@ -65,16 +65,6 @@ struct mutex { · 64 unmodified lines
6565 #endif
6666 };
6767
68−/*
69− * Internal helper function; C doesn't allow us to hide it :/
70− *
71− * DO NOT USE (outside of mutex code).
72− */
73−static inline struct task_struct *__mutex_owner(struct mutex *lock)
74−{
75− return (struct task_struct *)(atomic_long_read(&lock->owner) & ~0x07);
76−}
77−
7868 /*
7969 * This is the control structure for tasks blocked on mutex,
8070 * which resides on the blocked task's kernel stack:
@@ -144,10 +134,7 @@ extern void __mutex_init(struct mutex *lock, const char *name, · 63 unmodified lines
144134 *
145135 * Returns true if the mutex is locked, false if unlocked.
146136 */
147−static inline bool mutex_is_locked(struct mutex *lock)
148−{
149− return __mutex_owner(lock) != NULL;
150−}
137+extern bool mutex_is_locked(struct mutex *lock);
151138
152139 /*
153140 * See kernel/locking/mutex.c for detailed documentation of these APIs.
@@ -220,13 +207,7 @@ enum mutex_trylock_recursive_enum { · 66 unmodified lines
220207 * - MUTEX_TRYLOCK_SUCCESS - lock acquired,
221208 * - MUTEX_TRYLOCK_RECURSIVE - we already owned the lock.
222209 */
223−static inline /* __deprecated */ __must_check enum mutex_trylock_recursive_enum
224−mutex_trylock_recursive(struct mutex *lock)
225−{
226− if (unlikely(__mutex_owner(lock) == current))
227− return MUTEX_TRYLOCK_RECURSIVE;
228−
229− return mutex_trylock(lock);
230−}
210+extern /* __deprecated */ __must_check enum mutex_trylock_recursive_enum
211+mutex_trylock_recursive(struct mutex *lock);
231212
232213 #endif /* __LINUX_MUTEX_H */
include/linux/namei.h+18−45
@@ -16,39 +16,28 @@ enum { MAX_NESTED_LINKS = 8 }; · 15 unmodified lines
1616 */
1717 enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
1818
19−/*
20− * The bitmask for a lookup event:
21− * - follow links at the end
22− * - require a directory
23− * - ending slashes ok even for nonexistent files
24− * - internal "there are more path components" flag
25− * - dentry cache is untrusted; force a real lookup
26− * - suppress terminal automount
27− * - skip revalidation
28− * - don't fetch xattrs on audit_inode
29− */
30−#define LOOKUP_FOLLOW 0x0001
31−#define LOOKUP_DIRECTORY 0x0002
32−#define LOOKUP_AUTOMOUNT 0x0004
33−
19+/* pathwalk mode */
20+#define LOOKUP_FOLLOW 0x0001 /* follow links at the end */
21+#define LOOKUP_DIRECTORY 0x0002 /* require a directory */
22+#define LOOKUP_AUTOMOUNT 0x0004 /* force terminal automount */
23+#define LOOKUP_EMPTY 0x4000 /* accept empty path [user_... only] */
24+#define LOOKUP_DOWN 0x8000 /* follow mounts in the starting point */
25+
26+#define LOOKUP_REVAL 0x0020 /* tell ->d_revalidate() to trust no cache */
27+#define LOOKUP_RCU 0x0040 /* RCU pathwalk mode; semi-internal */
28+
29+/* These tell filesystem methods that we are dealing with the final component... */
30+#define LOOKUP_OPEN 0x0100 /* ... in open */
31+#define LOOKUP_CREATE 0x0200 /* ... in object creation */
32+#define LOOKUP_EXCL 0x0400 /* ... in exclusive creation */
33+#define LOOKUP_RENAME_TARGET 0x0800 /* ... in destination of rename() */
34+
35+/* internal use only */
3436 #define LOOKUP_PARENT 0x0010
35−#define LOOKUP_REVAL 0x0020
36−#define LOOKUP_RCU 0x0040
3737 #define LOOKUP_NO_REVAL 0x0080
38−#define LOOKUP_NO_EVAL 0x0100
39−
40−/*
41− * Intent data
42− */
43−#define LOOKUP_OPEN 0x0100
44−#define LOOKUP_CREATE 0x0200
45−#define LOOKUP_EXCL 0x0400
46−#define LOOKUP_RENAME_TARGET 0x0800
47−
4838 #define LOOKUP_JUMPED 0x1000
4939 #define LOOKUP_ROOT 0x2000
50−#define LOOKUP_EMPTY 0x4000
51−#define LOOKUP_DOWN 0x8000
40+#define LOOKUP_ROOT_GRABBED 0x0008
5241
5342 extern int path_pts(struct path *path);
5443
@@ -60,22 +49,6 @@ static inline int user_path_at(int dfd, const char __user *name, unsigned flags, · 5 unmodified lines
6049 return user_path_at_empty(dfd, name, flags, path, NULL);
6150 }
6251
63−static inline int user_path(const char __user *name, struct path *path)
64−{
65− return user_path_at_empty(AT_FDCWD, name, LOOKUP_FOLLOW, path, NULL);
66−}
67−
68−static inline int user_lpath(const char __user *name, struct path *path)
69−{
70− return user_path_at_empty(AT_FDCWD, name, 0, path, NULL);
71−}
72−
73−static inline int user_path_dir(const char __user *name, struct path *path)
74−{
75− return user_path_at_empty(AT_FDCWD, name,
76− LOOKUP_FOLLOW | LOOKUP_DIRECTORY, path, NULL);
77−}
78−
7952 extern int kern_path(const char *, unsigned, struct path *);
8053
8154 extern struct dentry *kern_path_create(int, const char *, struct path *, unsigned int);
include/linux/netdevice.h+17−3
@@ -332,6 +332,8 @@ struct napi_struct { · 331 unmodified lines
332332 struct net_device *dev;
333333 struct gro_list gro_hash[GRO_HASH_BUCKETS];
334334 struct sk_buff *skb;
335+ struct list_head rx_list; /* Pending GRO_NORMAL skbs */
336+ int rx_count; /* length of rx_list */
335337 struct hrtimer timer;
336338 struct list_head dev_list;
337339 struct hlist_node napi_hash_node;
@@ -845,6 +847,7 @@ enum tc_setup_type { · 507 unmodified lines
845847 TC_SETUP_QDISC_ETF,
846848 TC_SETUP_ROOT_QDISC,
847849 TC_SETUP_QDISC_GRED,
850+ TC_SETUP_QDISC_TAPRIO,
848851 };
849852
850853 /* These structures hold the attributes of bpf state that are being passed
@@ -899,6 +902,10 @@ struct netdev_bpf { · 48 unmodified lines
899902 };
900903 };
901904
905+/* Flags for ndo_xsk_wakeup. */
906+#define XDP_WAKEUP_RX (1 << 0)
907+#define XDP_WAKEUP_TX (1 << 1)
908+
902909 #ifdef CONFIG_XFRM_OFFLOAD
903910 struct xfrmdev_ops {
904911 int (*xdo_dev_state_add) (struct xfrm_state *x);
@@ -1225,6 +1232,12 @@ struct tlsdev_ops; · 320 unmodified lines
12251232 * that got dropped are freed/returned via xdp_return_frame().
12261233 * Returns negative number, means general error invoking ndo, meaning
12271234 * no frames were xmit'ed and core-caller will free all frames.
1235+ * int (*ndo_xsk_wakeup)(struct net_device *dev, u32 queue_id, u32 flags);
1236+ * This function is used to wake up the softirq, ksoftirqd or kthread
1237+ * responsible for sending and/or receiving packets on a specific
1238+ * queue id bound to an AF_XDP socket. The flags field specifies if
1239+ * only RX, only Tx, or both should be woken up using the flags
1240+ * XDP_WAKEUP_RX and XDP_WAKEUP_TX.
12281241 * struct devlink_port *(*ndo_get_devlink_port)(struct net_device *dev);
12291242 * Get devlink port instance associated with a given netdev.
12301243 * Called with a reference on the netdevice and devlink locks only,
@@ -1424,8 +1437,8 @@ struct net_device_ops { · 193 unmodified lines
14241437 int (*ndo_xdp_xmit)(struct net_device *dev, int n,
14251438 struct xdp_frame **xdp,
14261439 u32 flags);
1427− int (*ndo_xsk_async_xmit)(struct net_device *dev,
1428− u32 queue_id);
1440+ int (*ndo_xsk_wakeup)(struct net_device *dev,
1441+ u32 queue_id, u32 flags);
14291442 struct devlink_port * (*ndo_get_devlink_port)(struct net_device *dev);
14301443 };
14311444
@@ -3270,7 +3283,7 @@ static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue, · 1838 unmodified lines
32703283 */
32713284 smp_mb();
32723285
3273− if (dql_avail(&dev_queue->dql) < 0)
3286+ if (unlikely(dql_avail(&dev_queue->dql) < 0))
32743287 return;
32753288
32763289 if (test_and_clear_bit(__QUEUE_STATE_STACK_XOFF, &dev_queue->state))
@@ -4239,6 +4252,7 @@ extern int dev_weight_rx_bias; · 962 unmodified lines
42394252 extern int dev_weight_tx_bias;
42404253 extern int dev_rx_weight;
42414254 extern int dev_tx_weight;
4255+extern int gro_normal_batch;
42424256
42434257 bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);
42444258 struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev,
include/linux/netfilter.h+2−2
@@ -15,7 +15,6 @@ · 14 unmodified lines
1515 #include <linux/netdevice.h>
1616 #include <net/net_namespace.h>
1717
18−#ifdef CONFIG_NETFILTER
1918 static inline int NF_DROP_GETERR(int verdict)
2019 {
2120 return -(verdict >> NF_VERDICT_QBITS);
@@ -118,6 +117,7 @@ struct nf_hook_entries { · 96 unmodified lines
118117 */
119118 };
120119
120+#ifdef CONFIG_NETFILTER
121121 static inline struct nf_hook_ops **nf_hook_entries_get_hook_ops(const struct nf_hook_entries *e)
122122 {
123123 unsigned int n = e->num_hook_entries;
@@ -422,7 +422,7 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) · 298 unmodified lines
422422 }
423423 #endif /*CONFIG_NETFILTER*/
424424
425−#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
425+#if IS_ENABLED(CONFIG_NF_CONNTRACK)
426426 #include <linux/netfilter/nf_conntrack_zones_common.h>
427427
428428 extern void (*ip_ct_attach)(struct sk_buff *, const struct sk_buff *) __rcu;
include/linux/netfilter/ipset/ip_set.h+234−4
@@ -452,10 +452,240 @@ bitmap_bytes(u32 a, u32 b) · 451 unmodified lines
452452 return 4 * ((((b - a + 8) / 8) + 3) / 4);
453453 }
454454
455−#include <linux/netfilter/ipset/ip_set_timeout.h>
456−#include <linux/netfilter/ipset/ip_set_comment.h>
457−#include <linux/netfilter/ipset/ip_set_counter.h>
458−#include <linux/netfilter/ipset/ip_set_skbinfo.h>
455+/* How often should the gc be run by default */
456+#define IPSET_GC_TIME (3 * 60)
457+
458+/* Timeout period depending on the timeout value of the given set */
459+#define IPSET_GC_PERIOD(timeout) \
460+ ((timeout/3) ? min_t(u32, (timeout)/3, IPSET_GC_TIME) : 1)
461+
462+/* Entry is set with no timeout value */
463+#define IPSET_ELEM_PERMANENT 0
464+
465+/* Set is defined with timeout support: timeout value may be 0 */
466+#define IPSET_NO_TIMEOUT UINT_MAX
467+
468+/* Max timeout value, see msecs_to_jiffies() in jiffies.h */
469+#define IPSET_MAX_TIMEOUT (UINT_MAX >> 1)/MSEC_PER_SEC
470+
471+#define ip_set_adt_opt_timeout(opt, set) \
472+((opt)->ext.timeout != IPSET_NO_TIMEOUT ? (opt)->ext.timeout : (set)->timeout)
473+
474+static inline unsigned int
475+ip_set_timeout_uget(struct nlattr *tb)
476+{
477+ unsigned int timeout = ip_set_get_h32(tb);
478+
479+ /* Normalize to fit into jiffies */
480+ if (timeout > IPSET_MAX_TIMEOUT)
481+ timeout = IPSET_MAX_TIMEOUT;
482+
483+ return timeout;
484+}
485+
486+static inline bool
487+ip_set_timeout_expired(const unsigned long *t)
488+{
489+ return *t != IPSET_ELEM_PERMANENT && time_is_before_jiffies(*t);
490+}
491+
492+static inline void
493+ip_set_timeout_set(unsigned long *timeout, u32 value)
494+{
495+ unsigned long t;
496+
497+ if (!value) {
498+ *timeout = IPSET_ELEM_PERMANENT;
499+ return;
500+ }
501+
502+ t = msecs_to_jiffies(value * MSEC_PER_SEC) + jiffies;
503+ if (t == IPSET_ELEM_PERMANENT)
504+ /* Bingo! :-) */
505+ t--;
506+ *timeout = t;
507+}
508+
509+static inline u32
510+ip_set_timeout_get(const unsigned long *timeout)
511+{
512+ u32 t;
513+
514+ if (*timeout == IPSET_ELEM_PERMANENT)
515+ return 0;
516+
517+ t = jiffies_to_msecs(*timeout - jiffies)/MSEC_PER_SEC;
518+ /* Zero value in userspace means no timeout */
519+ return t == 0 ? 1 : t;
520+}
521+
522+static inline char*
523+ip_set_comment_uget(struct nlattr *tb)
524+{
525+ return nla_data(tb);
526+}
527+
528+/* Called from uadd only, protected by the set spinlock.
529+ * The kadt functions don't use the comment extensions in any way.
530+ */
531+static inline void
532+ip_set_init_comment(struct ip_set *set, struct ip_set_comment *comment,
533+ const struct ip_set_ext *ext)
534+{
535+ struct ip_set_comment_rcu *c = rcu_dereference_protected(comment->c, 1);
536+ size_t len = ext->comment ? strlen(ext->comment) : 0;
537+
538+ if (unlikely(c)) {
539+ set->ext_size -= sizeof(*c) + strlen(c->str) + 1;
540+ kfree_rcu(c, rcu);
541+ rcu_assign_pointer(comment->c, NULL);
542+ }
543+ if (!len)
544+ return;
545+ if (unlikely(len > IPSET_MAX_COMMENT_SIZE))
546+ len = IPSET_MAX_COMMENT_SIZE;
547+ c = kmalloc(sizeof(*c) + len + 1, GFP_ATOMIC);
548+ if (unlikely(!c))
549+ return;
550+ strlcpy(c->str, ext->comment, len + 1);
551+ set->ext_size += sizeof(*c) + strlen(c->str) + 1;
552+ rcu_assign_pointer(comment->c, c);
553+}
554+
555+/* Used only when dumping a set, protected by rcu_read_lock() */
556+static inline int
557+ip_set_put_comment(struct sk_buff *skb, const struct ip_set_comment *comment)
558+{
559+ struct ip_set_comment_rcu *c = rcu_dereference(comment->c);
560+
561+ if (!c)
562+ return 0;
563+ return nla_put_string(skb, IPSET_ATTR_COMMENT, c->str);
564+}
565+
566+/* Called from uadd/udel, flush or the garbage collectors protected
567+ * by the set spinlock.
568+ * Called when the set is destroyed and when there can't be any user
569+ * of the set data anymore.
570+ */
571+static inline void
572+ip_set_comment_free(struct ip_set *set, struct ip_set_comment *comment)
573+{
574+ struct ip_set_comment_rcu *c;
575+
576+ c = rcu_dereference_protected(comment->c, 1);
577+ if (unlikely(!c))
578+ return;
579+ set->ext_size -= sizeof(*c) + strlen(c->str) + 1;
580+ kfree_rcu(c, rcu);
581+ rcu_assign_pointer(comment->c, NULL);
582+}
583+
584+static inline void
585+ip_set_add_bytes(u64 bytes, struct ip_set_counter *counter)
586+{
587+ atomic64_add((long long)bytes, &(counter)->bytes);
588+}
589+
590+static inline void
591+ip_set_add_packets(u64 packets, struct ip_set_counter *counter)
592+{
593+ atomic64_add((long long)packets, &(counter)->packets);
594+}
595+
596+static inline u64
597+ip_set_get_bytes(const struct ip_set_counter *counter)
598+{
599+ return (u64)atomic64_read(&(counter)->bytes);
600+}
601+
602+static inline u64
603+ip_set_get_packets(const struct ip_set_counter *counter)
604+{
605+ return (u64)atomic64_read(&(counter)->packets);
606+}
607+
608+static inline bool
609+ip_set_match_counter(u64 counter, u64 match, u8 op)
610+{
611+ switch (op) {
612+ case IPSET_COUNTER_NONE:
613+ return true;
614+ case IPSET_COUNTER_EQ:
615+ return counter == match;
616+ case IPSET_COUNTER_NE:
617+ return counter != match;
618+ case IPSET_COUNTER_LT:
619+ return counter < match;
620+ case IPSET_COUNTER_GT:
621+ return counter > match;
622+ }
623+ return false;
624+}
625+
626+static inline void
627+ip_set_update_counter(struct ip_set_counter *counter,
628+ const struct ip_set_ext *ext, u32 flags)
629+{
630+ if (ext->packets != ULLONG_MAX &&
631+ !(flags & IPSET_FLAG_SKIP_COUNTER_UPDATE)) {
632+ ip_set_add_bytes(ext->bytes, counter);
633+ ip_set_add_packets(ext->packets, counter);
634+ }
635+}
636+
637+static inline bool
638+ip_set_put_counter(struct sk_buff *skb, const struct ip_set_counter *counter)
639+{
640+ return nla_put_net64(skb, IPSET_ATTR_BYTES,
641+ cpu_to_be64(ip_set_get_bytes(counter)),
642+ IPSET_ATTR_PAD) ||
643+ nla_put_net64(skb, IPSET_ATTR_PACKETS,
644+ cpu_to_be64(ip_set_get_packets(counter)),
645+ IPSET_ATTR_PAD);
646+}
647+
648+static inline void
649+ip_set_init_counter(struct ip_set_counter *counter,
650+ const struct ip_set_ext *ext)
651+{
652+ if (ext->bytes != ULLONG_MAX)
653+ atomic64_set(&(counter)->bytes, (long long)(ext->bytes));
654+ if (ext->packets != ULLONG_MAX)
655+ atomic64_set(&(counter)->packets, (long long)(ext->packets));
656+}
657+
658+static inline void
659+ip_set_get_skbinfo(struct ip_set_skbinfo *skbinfo,
660+ const struct ip_set_ext *ext,
661+ struct ip_set_ext *mext, u32 flags)
662+{
663+ mext->skbinfo = *skbinfo;
664+}
665+
666+static inline bool
667+ip_set_put_skbinfo(struct sk_buff *skb, const struct ip_set_skbinfo *skbinfo)
668+{
669+ /* Send nonzero parameters only */
670+ return ((skbinfo->skbmark || skbinfo->skbmarkmask) &&
671+ nla_put_net64(skb, IPSET_ATTR_SKBMARK,
672+ cpu_to_be64((u64)skbinfo->skbmark << 32 |
673+ skbinfo->skbmarkmask),
674+ IPSET_ATTR_PAD)) ||
675+ (skbinfo->skbprio &&
676+ nla_put_net32(skb, IPSET_ATTR_SKBPRIO,
677+ cpu_to_be32(skbinfo->skbprio))) ||
678+ (skbinfo->skbqueue &&
679+ nla_put_net16(skb, IPSET_ATTR_SKBQUEUE,
680+ cpu_to_be16(skbinfo->skbqueue)));
681+}
682+
683+static inline void
684+ip_set_init_skbinfo(struct ip_set_skbinfo *skbinfo,
685+ const struct ip_set_ext *ext)
686+{
687+ *skbinfo = ext->skbinfo;
688+}
459689
460690 #define IP_SET_INIT_KEXT(skb, opt, set) \
461691 { .bytes = (skb)->len, .packets = 1, \
include/linux/netfilter/ipset/ip_set_comment.h+0−73
@@ -1,73 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−#ifndef _IP_SET_COMMENT_H
3−#define _IP_SET_COMMENT_H
4−
5−/* Copyright (C) 2013 Oliver Smith <oliver@8.c.9.b.0.7.4.0.1.0.0.2.ip6.arpa>
6− */
7−
8−#ifdef __KERNEL__
9−
10−static inline char*
11−ip_set_comment_uget(struct nlattr *tb)
12−{
13− return nla_data(tb);
14−}
15−
16−/* Called from uadd only, protected by the set spinlock.
17− * The kadt functions don't use the comment extensions in any way.
18− */
19−static inline void
20−ip_set_init_comment(struct ip_set *set, struct ip_set_comment *comment,
21− const struct ip_set_ext *ext)
22−{
23− struct ip_set_comment_rcu *c = rcu_dereference_protected(comment->c, 1);
24− size_t len = ext->comment ? strlen(ext->comment) : 0;
25−
26− if (unlikely(c)) {
27− set->ext_size -= sizeof(*c) + strlen(c->str) + 1;
28− kfree_rcu(c, rcu);
29− rcu_assign_pointer(comment->c, NULL);
30− }
31− if (!len)
32− return;
33− if (unlikely(len > IPSET_MAX_COMMENT_SIZE))
34− len = IPSET_MAX_COMMENT_SIZE;
35− c = kmalloc(sizeof(*c) + len + 1, GFP_ATOMIC);
36− if (unlikely(!c))
37− return;
38− strlcpy(c->str, ext->comment, len + 1);
39− set->ext_size += sizeof(*c) + strlen(c->str) + 1;
40− rcu_assign_pointer(comment->c, c);
41−}
42−
43−/* Used only when dumping a set, protected by rcu_read_lock() */
44−static inline int
45−ip_set_put_comment(struct sk_buff *skb, const struct ip_set_comment *comment)
46−{
47− struct ip_set_comment_rcu *c = rcu_dereference(comment->c);
48−
49− if (!c)
50− return 0;
51− return nla_put_string(skb, IPSET_ATTR_COMMENT, c->str);
52−}
53−
54−/* Called from uadd/udel, flush or the garbage collectors protected
55− * by the set spinlock.
56− * Called when the set is destroyed and when there can't be any user
57− * of the set data anymore.
58− */
59−static inline void
60−ip_set_comment_free(struct ip_set *set, struct ip_set_comment *comment)
61−{
62− struct ip_set_comment_rcu *c;
63−
64− c = rcu_dereference_protected(comment->c, 1);
65− if (unlikely(!c))
66− return;
67− set->ext_size -= sizeof(*c) + strlen(c->str) + 1;
68− kfree_rcu(c, rcu);
69− rcu_assign_pointer(comment->c, NULL);
70−}
71−
72−#endif
73−#endif
include/linux/netfilter/ipset/ip_set_counter.h+0−84
@@ -1,84 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−#ifndef _IP_SET_COUNTER_H
3−#define _IP_SET_COUNTER_H
4−
5−/* Copyright (C) 2015 Jozsef Kadlecsik <kadlec@netfilter.org> */
6−
7−#ifdef __KERNEL__
8−
9−static inline void
10−ip_set_add_bytes(u64 bytes, struct ip_set_counter *counter)
11−{
12− atomic64_add((long long)bytes, &(counter)->bytes);
13−}
14−
15−static inline void
16−ip_set_add_packets(u64 packets, struct ip_set_counter *counter)
17−{
18− atomic64_add((long long)packets, &(counter)->packets);
19−}
20−
21−static inline u64
22−ip_set_get_bytes(const struct ip_set_counter *counter)
23−{
24− return (u64)atomic64_read(&(counter)->bytes);
25−}
26−
27−static inline u64
28−ip_set_get_packets(const struct ip_set_counter *counter)
29−{
30− return (u64)atomic64_read(&(counter)->packets);
31−}
32−
33−static inline bool
34−ip_set_match_counter(u64 counter, u64 match, u8 op)
35−{
36− switch (op) {
37− case IPSET_COUNTER_NONE:
38− return true;
39− case IPSET_COUNTER_EQ:
40− return counter == match;
41− case IPSET_COUNTER_NE:
42− return counter != match;
43− case IPSET_COUNTER_LT:
44− return counter < match;
45− case IPSET_COUNTER_GT:
46− return counter > match;
47− }
48− return false;
49−}
50−
51−static inline void
52−ip_set_update_counter(struct ip_set_counter *counter,
53− const struct ip_set_ext *ext, u32 flags)
54−{
55− if (ext->packets != ULLONG_MAX &&
56− !(flags & IPSET_FLAG_SKIP_COUNTER_UPDATE)) {
57− ip_set_add_bytes(ext->bytes, counter);
58− ip_set_add_packets(ext->packets, counter);
59− }
60−}
61−
62−static inline bool
63−ip_set_put_counter(struct sk_buff *skb, const struct ip_set_counter *counter)
64−{
65− return nla_put_net64(skb, IPSET_ATTR_BYTES,
66− cpu_to_be64(ip_set_get_bytes(counter)),
67− IPSET_ATTR_PAD) ||
68− nla_put_net64(skb, IPSET_ATTR_PACKETS,
69− cpu_to_be64(ip_set_get_packets(counter)),
70− IPSET_ATTR_PAD);
71−}
72−
73−static inline void
74−ip_set_init_counter(struct ip_set_counter *counter,
75− const struct ip_set_ext *ext)
76−{
77− if (ext->bytes != ULLONG_MAX)
78− atomic64_set(&(counter)->bytes, (long long)(ext->bytes));
79− if (ext->packets != ULLONG_MAX)
80− atomic64_set(&(counter)->packets, (long long)(ext->packets));
81−}
82−
83−#endif /* __KERNEL__ */
84−#endif /* _IP_SET_COUNTER_H */
include/linux/netfilter/ipset/ip_set_getport.h+5−1
@@ -2,10 +2,14 @@ · 1 unmodified line
22 #ifndef _IP_SET_GETPORT_H
33 #define _IP_SET_GETPORT_H
44
5+#include <linux/skbuff.h>
6+#include <linux/types.h>
7+#include <uapi/linux/in.h>
8+
59 extern bool ip_set_get_ip4_port(const struct sk_buff *skb, bool src,
610 __be16 *port, u8 *proto);
711
8−#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
12+#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
913 extern bool ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
1014 __be16 *port, u8 *proto);
1115 #else
include/linux/netfilter/ipset/ip_set_skbinfo.h+0−42
@@ -1,42 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−#ifndef _IP_SET_SKBINFO_H
3−#define _IP_SET_SKBINFO_H
4−
5−/* Copyright (C) 2015 Jozsef Kadlecsik <kadlec@netfilter.org> */
6−
7−#ifdef __KERNEL__
8−
9−static inline void
10−ip_set_get_skbinfo(struct ip_set_skbinfo *skbinfo,
11− const struct ip_set_ext *ext,
12− struct ip_set_ext *mext, u32 flags)
13−{
14− mext->skbinfo = *skbinfo;
15−}
16−
17−static inline bool
18−ip_set_put_skbinfo(struct sk_buff *skb, const struct ip_set_skbinfo *skbinfo)
19−{
20− /* Send nonzero parameters only */
21− return ((skbinfo->skbmark || skbinfo->skbmarkmask) &&
22− nla_put_net64(skb, IPSET_ATTR_SKBMARK,
23− cpu_to_be64((u64)skbinfo->skbmark << 32 |
24− skbinfo->skbmarkmask),
25− IPSET_ATTR_PAD)) ||
26− (skbinfo->skbprio &&
27− nla_put_net32(skb, IPSET_ATTR_SKBPRIO,
28− cpu_to_be32(skbinfo->skbprio))) ||
29− (skbinfo->skbqueue &&
30− nla_put_net16(skb, IPSET_ATTR_SKBQUEUE,
31− cpu_to_be16(skbinfo->skbqueue)));
32−}
33−
34−static inline void
35−ip_set_init_skbinfo(struct ip_set_skbinfo *skbinfo,
36− const struct ip_set_ext *ext)
37−{
38− *skbinfo = ext->skbinfo;
39−}
40−
41−#endif /* __KERNEL__ */
42−#endif /* _IP_SET_SKBINFO_H */
include/linux/netfilter/ipset/ip_set_timeout.h+0−77
@@ -1,77 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−#ifndef _IP_SET_TIMEOUT_H
3−#define _IP_SET_TIMEOUT_H
4−
5−/* Copyright (C) 2003-2013 Jozsef Kadlecsik <kadlec@netfilter.org> */
6−
7−#ifdef __KERNEL__
8−
9−/* How often should the gc be run by default */
10−#define IPSET_GC_TIME (3 * 60)
11−
12−/* Timeout period depending on the timeout value of the given set */
13−#define IPSET_GC_PERIOD(timeout) \
14− ((timeout/3) ? min_t(u32, (timeout)/3, IPSET_GC_TIME) : 1)
15−
16−/* Entry is set with no timeout value */
17−#define IPSET_ELEM_PERMANENT 0
18−
19−/* Set is defined with timeout support: timeout value may be 0 */
20−#define IPSET_NO_TIMEOUT UINT_MAX
21−
22−/* Max timeout value, see msecs_to_jiffies() in jiffies.h */
23−#define IPSET_MAX_TIMEOUT (UINT_MAX >> 1)/MSEC_PER_SEC
24−
25−#define ip_set_adt_opt_timeout(opt, set) \
26−((opt)->ext.timeout != IPSET_NO_TIMEOUT ? (opt)->ext.timeout : (set)->timeout)
27−
28−static inline unsigned int
29−ip_set_timeout_uget(struct nlattr *tb)
30−{
31− unsigned int timeout = ip_set_get_h32(tb);
32−
33− /* Normalize to fit into jiffies */
34− if (timeout > IPSET_MAX_TIMEOUT)
35− timeout = IPSET_MAX_TIMEOUT;
36−
37− return timeout;
38−}
39−
40−static inline bool
41−ip_set_timeout_expired(const unsigned long *t)
42−{
43− return *t != IPSET_ELEM_PERMANENT && time_is_before_jiffies(*t);
44−}
45−
46−static inline void
47−ip_set_timeout_set(unsigned long *timeout, u32 value)
48−{
49− unsigned long t;
50−
51− if (!value) {
52− *timeout = IPSET_ELEM_PERMANENT;
53− return;
54− }
55−
56− t = msecs_to_jiffies(value * MSEC_PER_SEC) + jiffies;
57− if (t == IPSET_ELEM_PERMANENT)
58− /* Bingo! :-) */
59− t--;
60− *timeout = t;
61−}
62−
63−static inline u32
64−ip_set_timeout_get(const unsigned long *timeout)
65−{
66− u32 t;
67−
68− if (*timeout == IPSET_ELEM_PERMANENT)
69− return 0;
70−
71− t = jiffies_to_msecs(*timeout - jiffies)/MSEC_PER_SEC;
72− /* Zero value in userspace means no timeout */
73− return t == 0 ? 1 : t;
74−}
75−
76−#endif /* __KERNEL__ */
77−#endif /* _IP_SET_TIMEOUT_H */
include/linux/netfilter/nf_conntrack_amanda.h+4−0
@@ -3,6 +3,10 @@ · 2 unmodified lines
33 #define _NF_CONNTRACK_AMANDA_H
44 /* AMANDA tracking. */
55
6+#include <linux/netfilter.h>
7+#include <linux/skbuff.h>
8+#include <net/netfilter/nf_conntrack_expect.h>
9+
610 extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff *skb,
711 enum ip_conntrack_info ctinfo,
812 unsigned int protoff,
include/linux/netfilter/nf_conntrack_common.h+20−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 #ifndef _NF_CONNTRACK_COMMON_H
33 #define _NF_CONNTRACK_COMMON_H
44
5+#include <linux/atomic.h>
56 #include <uapi/linux/netfilter/nf_conntrack_common.h>
67
78 struct ip_conntrack_stat {
@@ -19,4 +20,23 @@ struct ip_conntrack_stat { · 11 unmodified lines
1920 unsigned int search_restart;
2021 };
2122
23+#define NFCT_INFOMASK 7UL
24+#define NFCT_PTRMASK ~(NFCT_INFOMASK)
25+
26+struct nf_conntrack {
27+ atomic_t use;
28+};
29+
30+void nf_conntrack_destroy(struct nf_conntrack *nfct);
31+static inline void nf_conntrack_put(struct nf_conntrack *nfct)
32+{
33+ if (nfct && atomic_dec_and_test(&nfct->use))
34+ nf_conntrack_destroy(nfct);
35+}
36+static inline void nf_conntrack_get(struct nf_conntrack *nfct)
37+{
38+ if (nfct)
39+ atomic_inc(&nfct->use);
40+}
41+
2242 #endif /* _NF_CONNTRACK_COMMON_H */
include/linux/netfilter/nf_conntrack_dccp.h+0−3
@@ -25,7 +25,6 @@ enum ct_dccp_roles { · 24 unmodified lines
2525 };
2626 #define CT_DCCP_ROLE_MAX (__CT_DCCP_ROLE_MAX - 1)
2727
28−#ifdef __KERNEL__
2928 #include <linux/netfilter/nf_conntrack_tuple_common.h>
3029
3130 struct nf_ct_dccp {
@@ -36,6 +35,4 @@ struct nf_ct_dccp { · 4 unmodified lines
3635 u_int64_t handshake_seq;
3736 };
3837
39−#endif /* __KERNEL__ */
40−
4138 #endif /* _NF_CONNTRACK_DCCP_H */
include/linux/netfilter/nf_conntrack_ftp.h+5−3
@@ -2,8 +2,12 @@ · 1 unmodified line
22 #ifndef _NF_CONNTRACK_FTP_H
33 #define _NF_CONNTRACK_FTP_H
44
5+#include <linux/netfilter.h>
6+#include <linux/skbuff.h>
7+#include <linux/types.h>
8+#include <net/netfilter/nf_conntrack_expect.h>
59 #include <uapi/linux/netfilter/nf_conntrack_ftp.h>
6−
10+#include <uapi/linux/netfilter/nf_conntrack_tuple_common.h>
711
812 #define FTP_PORT 21
913
@@ -20,8 +24,6 @@ struct nf_ct_ftp_master { · 10 unmodified lines
2024 u_int16_t flags[IP_CT_DIR_MAX];
2125 };
2226
23−struct nf_conntrack_expect;
24−
2527 /* For NAT to hook in when we find a packet which describes what other
2628 * connection we should expect. */
2729 extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb,
include/linux/netfilter/nf_conntrack_h323.h+5−6
@@ -2,9 +2,12 @@ · 1 unmodified line
22 #ifndef _NF_CONNTRACK_H323_H
33 #define _NF_CONNTRACK_H323_H
44
5−#ifdef __KERNEL__
6−
5+#include <linux/netfilter.h>
6+#include <linux/skbuff.h>
7+#include <linux/types.h>
78 #include <linux/netfilter/nf_conntrack_h323_asn1.h>
9+#include <net/netfilter/nf_conntrack_expect.h>
10+#include <uapi/linux/netfilter/nf_conntrack_tuple_common.h>
811
912 #define RAS_PORT 1719
1013 #define Q931_PORT 1720
@@ -28,8 +31,6 @@ struct nf_ct_h323_master { · 17 unmodified lines
2831 };
2932 };
3033
31−struct nf_conn;
32−
3334 int get_h225_addr(struct nf_conn *ct, unsigned char *data,
3435 TransportAddress *taddr, union nf_inet_addr *addr,
3536 __be16 *port);
@@ -94,5 +95,3 @@ extern int (*nat_q931_hook) (struct sk_buff *skb, struct nf_conn *ct, · 58 unmodified lines
9495 struct nf_conntrack_expect *exp);
9596
9697 #endif
97−
98−#endif
include/linux/netfilter/nf_conntrack_h323_asn1.h+3−2
@@ -1,7 +1,6 @@
11 /* SPDX-License-Identifier: GPL-2.0-only */
22 /****************************************************************************
3− * ip_conntrack_h323_asn1.h - BER and PER decoding library for H.323
4− * conntrack/NAT module.
3+ * BER and PER decoding library for H.323 conntrack/NAT module.
54 *
65 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net>
76 *
@@ -38,6 +37,8 @@ · 30 unmodified lines
3837 /*****************************************************************************
3938 * H.323 Types
4039 ****************************************************************************/
40+
41+#include <linux/types.h>
4142 #include <linux/netfilter/nf_conntrack_h323_types.h>
4243
4344 typedef struct {
include/linux/netfilter/nf_conntrack_h323_types.h+5−0
@@ -4,6 +4,9 @@ · 3 unmodified lines
44 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net>
55 */
66
7+#ifndef _NF_CONNTRACK_H323_TYPES_H
8+#define _NF_CONNTRACK_H323_TYPES_H
9+
710 typedef struct TransportAddress_ipAddress { /* SEQUENCE */
811 int options; /* No use */
912 unsigned int ip;
@@ -931,3 +934,5 @@ typedef struct RasMessage { /* CHOICE */ · 921 unmodified lines
931934 InfoRequestResponse infoRequestResponse;
932935 };
933936 } RasMessage;
937+
938+#endif /* _NF_CONNTRACK_H323_TYPES_H */
include/linux/netfilter/nf_conntrack_irc.h+3−2
@@ -2,7 +2,9 @@ · 1 unmodified line
22 #ifndef _NF_CONNTRACK_IRC_H
33 #define _NF_CONNTRACK_IRC_H
44
5−#ifdef __KERNEL__
5+#include <linux/netfilter.h>
6+#include <linux/skbuff.h>
7+#include <net/netfilter/nf_conntrack_expect.h>
68
79 #define IRC_PORT 6667
810
@@ -13,5 +15,4 @@ extern unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb, · 4 unmodified lines
1315 unsigned int matchlen,
1416 struct nf_conntrack_expect *exp);
1517
16−#endif /* __KERNEL__ */
1718 #endif /* _NF_CONNTRACK_IRC_H */
include/linux/netfilter/nf_conntrack_pptp.h+5−7
@@ -3,7 +3,12 @@ · 2 unmodified lines
33 #ifndef _NF_CONNTRACK_PPTP_H
44 #define _NF_CONNTRACK_PPTP_H
55
6+#include <linux/netfilter.h>
7+#include <linux/skbuff.h>
8+#include <linux/types.h>
69 #include <linux/netfilter/nf_conntrack_common.h>
10+#include <net/netfilter/nf_conntrack_expect.h>
11+#include <uapi/linux/netfilter/nf_conntrack_tuple_common.h>
712
813 extern const char *const pptp_msg_name[];
914
@@ -45,8 +50,6 @@ struct nf_nat_pptp { · 35 unmodified lines
4550 __be16 pac_call_id; /* NAT'ed PAC call id */
4651 };
4752
48−#ifdef __KERNEL__
49−
5053 #define PPTP_CONTROL_PORT 1723
5154
5255 #define PPTP_PACKET_CONTROL 1
@@ -297,10 +300,6 @@ union pptp_ctrl_union { · 244 unmodified lines
297300 struct PptpSetLinkInfo setlink;
298301 };
299302
300−/* crap needed for nf_conntrack_compat.h */
301−struct nf_conn;
302−struct nf_conntrack_expect;
303−
304303 extern int
305304 (*nf_nat_pptp_hook_outbound)(struct sk_buff *skb,
306305 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
@@ -323,5 +322,4 @@ extern void · 16 unmodified lines
323322 (*nf_nat_pptp_hook_expectfn)(struct nf_conn *ct,
324323 struct nf_conntrack_expect *exp);
325324
326−#endif /* __KERNEL__ */
327325 #endif /* _NF_CONNTRACK_PPTP_H */
include/linux/netfilter/nf_conntrack_proto_gre.h+0−2
@@ -10,7 +10,6 @@ struct nf_ct_gre { · 9 unmodified lines
1010 unsigned int timeout;
1111 };
1212
13−#ifdef __KERNEL__
1413 #include <net/netfilter/nf_conntrack_tuple.h>
1514
1615 struct nf_conn;
@@ -32,5 +31,4 @@ void nf_ct_gre_keymap_destroy(struct nf_conn *ct); · 15 unmodified lines
3231
3332 bool gre_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff,
3433 struct net *net, struct nf_conntrack_tuple *tuple);
35−#endif /* __KERNEL__ */
3634 #endif /* _CONNTRACK_PROTO_GRE_H */
include/linux/netfilter/nf_conntrack_sane.h+0−4
@@ -3,8 +3,6 @@ · 2 unmodified lines
33 #define _NF_CONNTRACK_SANE_H
44 /* SANE tracking. */
55
6−#ifdef __KERNEL__
7−
86 #define SANE_PORT 6566
97
108 enum sane_state {
@@ -17,6 +15,4 @@ struct nf_ct_sane_master { · 6 unmodified lines
1715 enum sane_state state;
1816 };
1917
20−#endif /* __KERNEL__ */
21−
2218 #endif /* _NF_CONNTRACK_SANE_H */
include/linux/netfilter/nf_conntrack_sip.h+2−4
@@ -1,11 +1,10 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 #ifndef __NF_CONNTRACK_SIP_H__
33 #define __NF_CONNTRACK_SIP_H__
4−#ifdef __KERNEL__
5−
6−#include <net/netfilter/nf_conntrack_expect.h>
74
5+#include <linux/skbuff.h>
86 #include <linux/types.h>
7+#include <net/netfilter/nf_conntrack_expect.h>
98
109 #define SIP_PORT 5060
1110 #define SIP_TIMEOUT 3600
@@ -196,5 +195,4 @@ int ct_sip_get_sdp_header(const struct nf_conn *ct, const char *dptr, · 184 unmodified lines
196195 enum sdp_header_types term,
197196 unsigned int *matchoff, unsigned int *matchlen);
198197
199−#endif /* __KERNEL__ */
200198 #endif /* __NF_CONNTRACK_SIP_H__ */
include/linux/netfilter/nf_conntrack_snmp.h+3−0
@@ -2,6 +2,9 @@ · 1 unmodified line
22 #ifndef _NF_CONNTRACK_SNMP_H
33 #define _NF_CONNTRACK_SNMP_H
44
5+#include <linux/netfilter.h>
6+#include <linux/skbuff.h>
7+
58 extern int (*nf_nat_snmp_hook)(struct sk_buff *skb,
69 unsigned int protoff,
710 struct nf_conn *ct,
include/linux/netfilter/nf_conntrack_tftp.h+5−0
@@ -4,6 +4,11 @@ · 3 unmodified lines
44
55 #define TFTP_PORT 69
66
7+#include <linux/netfilter.h>
8+#include <linux/skbuff.h>
9+#include <linux/types.h>
10+#include <net/netfilter/nf_conntrack_expect.h>
11+
712 struct tftphdr {
813 __be16 opcode;
914 };
include/linux/netfilter/x_tables.h+1−1
@@ -336,7 +336,7 @@ void xt_free_table_info(struct xt_table_info *info); · 335 unmodified lines
336336
337337 /**
338338 * xt_recseq - recursive seqcount for netfilter use
339− *
339+ *
340340 * Packet processing changes the seqcount only if no recursion happened
341341 * get_counters() can use read_seqcount_begin()/read_seqcount_retry(),
342342 * because we use the normal seqcount convention :
include/linux/netfilter/xt_hashlimit.h+0−11
@@ -1,11 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef _XT_HASHLIMIT_H
3−#define _XT_HASHLIMIT_H
4−
5−#include <uapi/linux/netfilter/xt_hashlimit.h>
6−
7−#define XT_HASHLIMIT_ALL (XT_HASHLIMIT_HASH_DIP | XT_HASHLIMIT_HASH_DPT | \
8− XT_HASHLIMIT_HASH_SIP | XT_HASHLIMIT_HASH_SPT | \
9− XT_HASHLIMIT_INVERT | XT_HASHLIMIT_BYTES |\
10− XT_HASHLIMIT_RATE_MATCH)
11−#endif /*_XT_HASHLIMIT_H*/
include/linux/netfilter/xt_physdev.h+0−8
@@ -1,8 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef _XT_PHYSDEV_H
3−#define _XT_PHYSDEV_H
4−
5−#include <linux/if.h>
6−#include <uapi/linux/netfilter/xt_physdev.h>
7−
8−#endif /*_XT_PHYSDEV_H*/
include/linux/netfilter_bridge.h+7−0
@@ -5,6 +5,13 @@ · 4 unmodified lines
55 #include <uapi/linux/netfilter_bridge.h>
66 #include <linux/skbuff.h>
77
8+struct nf_bridge_frag_data {
9+ char mac[ETH_HLEN];
10+ bool vlan_present;
11+ u16 vlan_tci;
12+ __be16 vlan_proto;
13+};
14+
815 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
916
1017 int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
include/linux/netfilter_bridge/ebt_802_3.h+0−12
@@ -1,12 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef __LINUX_BRIDGE_EBT_802_3_H
3−#define __LINUX_BRIDGE_EBT_802_3_H
4−
5−#include <linux/skbuff.h>
6−#include <uapi/linux/netfilter_bridge/ebt_802_3.h>
7−
8−static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
9−{
10− return (struct ebt_802_3_hdr *)skb_mac_header(skb);
11−}
12−#endif
include/linux/netfilter_bridge/ebtables.h+1−0
@@ -105,6 +105,7 @@ struct ebt_table { · 104 unmodified lines
105105
106106 #define EBT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) & \
107107 ~(__alignof__(struct _xt_align)-1))
108+
108109 extern int ebt_register_table(struct net *net,
109110 const struct ebt_table *table,
110111 const struct nf_hook_ops *ops,
include/linux/netfilter_ipv4/ip_tables.h+1−4
@@ -17,14 +17,11 @@ · 16 unmodified lines
1717
1818 #include <linux/if.h>
1919 #include <linux/in.h>
20+#include <linux/init.h>
2021 #include <linux/ip.h>
2122 #include <linux/skbuff.h>
22−
23−#include <linux/init.h>
2423 #include <uapi/linux/netfilter_ipv4/ip_tables.h>
2524
26−extern void ipt_init(void) __init;
27−
2825 int ipt_register_table(struct net *net, const struct xt_table *table,
2926 const struct ipt_replace *repl,
3027 const struct nf_hook_ops *ops, struct xt_table **res);
include/linux/netfilter_ipv6.h+20−8
@@ -1,7 +1,7 @@
11 /* IPv6-specific defines for netfilter.
22 * (C)1998 Rusty Russell -- This code is GPL.
33 * (C)1999 David Jeffery
4− * this header was blatantly ripped from netfilter_ipv4.h
4+ * this header was blatantly ripped from netfilter_ipv4.h
55 * it's amazing what adding a bunch of 6s can do =8^)
66 */
77 #ifndef __LINUX_IP6_NETFILTER_H
@@ -10,6 +10,18 @@ · 2 unmodified lines
1010 #include <uapi/linux/netfilter_ipv6.h>
1111 #include <net/tcp.h>
1212
13+/* Check for an extension */
14+static inline int
15+nf_ip6_ext_hdr(u8 nexthdr)
16+{ return (nexthdr == IPPROTO_HOPOPTS) ||
17+ (nexthdr == IPPROTO_ROUTING) ||
18+ (nexthdr == IPPROTO_FRAGMENT) ||
19+ (nexthdr == IPPROTO_ESP) ||
20+ (nexthdr == IPPROTO_AH) ||
21+ (nexthdr == IPPROTO_NONE) ||
22+ (nexthdr == IPPROTO_DSTOPTS);
23+}
24+
1325 /* Extra routing may needed on local out, as the QUEUE target never returns
1426 * control to the table.
1527 */
@@ -20,7 +32,7 @@ struct ip6_rt_info { · 4 unmodified lines
2032 };
2133
2234 struct nf_queue_entry;
23−struct nf_ct_bridge_frag_data;
35+struct nf_bridge_frag_data;
2436
2537 /*
2638 * Hook functions for ipv6 to allow xt_* modules to be built-in even
@@ -49,9 +61,9 @@ struct nf_ipv6_ops { · 22 unmodified lines
4961 int (*br_defrag)(struct net *net, struct sk_buff *skb, u32 user);
5062 int (*br_fragment)(struct net *net, struct sock *sk,
5163 struct sk_buff *skb,
52− struct nf_ct_bridge_frag_data *data,
64+ struct nf_bridge_frag_data *data,
5365 int (*output)(struct net *, struct sock *sk,
54− const struct nf_ct_bridge_frag_data *data,
66+ const struct nf_bridge_frag_data *data,
5567 struct sk_buff *));
5668 #endif
5769 };
@@ -123,16 +135,16 @@ static inline int nf_ipv6_br_defrag(struct net *net, struct sk_buff *skb, · 65 unmodified lines
123135 }
124136
125137 int br_ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
126− struct nf_ct_bridge_frag_data *data,
138+ struct nf_bridge_frag_data *data,
127139 int (*output)(struct net *, struct sock *sk,
128− const struct nf_ct_bridge_frag_data *data,
140+ const struct nf_bridge_frag_data *data,
129141 struct sk_buff *));
130142
131143 static inline int nf_br_ip6_fragment(struct net *net, struct sock *sk,
132144 struct sk_buff *skb,
133− struct nf_ct_bridge_frag_data *data,
145+ struct nf_bridge_frag_data *data,
134146 int (*output)(struct net *, struct sock *sk,
135− const struct nf_ct_bridge_frag_data *data,
147+ const struct nf_bridge_frag_data *data,
136148 struct sk_buff *))
137149 {
138150 #if IS_MODULE(CONFIG_IPV6)
include/linux/netfilter_ipv6/ip6_tables.h+2−16
@@ -17,15 +17,13 @@ · 16 unmodified lines
1717
1818 #include <linux/if.h>
1919 #include <linux/in6.h>
20+#include <linux/init.h>
2021 #include <linux/ipv6.h>
2122 #include <linux/skbuff.h>
22−
23−#include <linux/init.h>
2423 #include <uapi/linux/netfilter_ipv6/ip6_tables.h>
2524
26−extern void ip6t_init(void) __init;
27−
2825 extern void *ip6t_alloc_initial_table(const struct xt_table *);
26+
2927 int ip6t_register_table(struct net *net, const struct xt_table *table,
3028 const struct ip6t_replace *repl,
3129 const struct nf_hook_ops *ops, struct xt_table **res);
@@ -35,18 +33,6 @@ extern unsigned int ip6t_do_table(struct sk_buff *skb, · 3 unmodified lines
3533 const struct nf_hook_state *state,
3634 struct xt_table *table);
3735
38−/* Check for an extension */
39−static inline int
40−ip6t_ext_hdr(u8 nexthdr)
41−{ return (nexthdr == IPPROTO_HOPOPTS) ||
42− (nexthdr == IPPROTO_ROUTING) ||
43− (nexthdr == IPPROTO_FRAGMENT) ||
44− (nexthdr == IPPROTO_ESP) ||
45− (nexthdr == IPPROTO_AH) ||
46− (nexthdr == IPPROTO_NONE) ||
47− (nexthdr == IPPROTO_DSTOPTS);
48−}
49−
5036 #ifdef CONFIG_COMPAT
5137 #include <net/compat.h>
5238
include/linux/nfs_fs.h+3−0
@@ -490,6 +490,9 @@ extern const struct file_operations nfs_dir_operations; · 489 unmodified lines
490490 extern const struct dentry_operations nfs_dentry_operations;
491491
492492 extern void nfs_force_lookup_revalidate(struct inode *dir);
493+extern struct dentry *nfs_add_or_obtain(struct dentry *dentry,
494+ struct nfs_fh *fh, struct nfs_fattr *fattr,
495+ struct nfs4_label *label);
493496 extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh,
494497 struct nfs_fattr *fattr, struct nfs4_label *label);
495498 extern int nfs_may_open(struct inode *inode, const struct cred *cred, int openflags);
include/linux/nvme-fc-driver.h+2−0
@@ -6,6 +6,8 @@ · 5 unmodified lines
66 #ifndef _NVME_FC_DRIVER_H
77 #define _NVME_FC_DRIVER_H 1
88
9+#include <linux/scatterlist.h>
10+
911
1012 /*
1113 * ********************** LLDD FC-NVME Host API ********************
include/linux/nvme.h+4−1
@@ -140,6 +140,7 @@ enum { · 139 unmodified lines
140140 * Submission and Completion Queue Entry Sizes for the NVM command set.
141141 * (In bytes and specified as a power of two (2^n)).
142142 */
143+#define NVME_ADM_SQES 6
143144 #define NVME_NVM_IOSQES 6
144145 #define NVME_NVM_IOCQES 4
145146
@@ -814,6 +815,7 @@ enum nvme_admin_opcode { · 668 unmodified lines
814815 nvme_admin_security_send = 0x81,
815816 nvme_admin_security_recv = 0x82,
816817 nvme_admin_sanitize_nvm = 0x84,
818+ nvme_admin_get_lba_status = 0x86,
817819 };
818820
819821 #define nvme_admin_opcode_name(opcode) { opcode, #opcode }
@@ -840,7 +842,8 @@ enum nvme_admin_opcode { · 20 unmodified lines
840842 nvme_admin_opcode_name(nvme_admin_format_nvm), \
841843 nvme_admin_opcode_name(nvme_admin_security_send), \
842844 nvme_admin_opcode_name(nvme_admin_security_recv), \
843− nvme_admin_opcode_name(nvme_admin_sanitize_nvm))
845+ nvme_admin_opcode_name(nvme_admin_sanitize_nvm), \
846+ nvme_admin_opcode_name(nvme_admin_get_lba_status))
844847
845848 enum {
846849 NVME_QUEUE_PHYS_CONTIG = (1 << 0),
include/linux/of.h+1−1
@@ -1164,7 +1164,7 @@ static inline int of_property_read_string_index(const struct device_node *np, · 1163 unmodified lines
11641164 }
11651165
11661166 /**
1167− * of_property_read_bool - Findfrom a property
1167+ * of_property_read_bool - Find a property
11681168 * @np: device node from which the property value is to be read.
11691169 * @propname: name of the property to be searched.
11701170 *
include/linux/of_gpio.h+0−11
@@ -61,10 +61,6 @@ static inline int of_mm_gpiochip_add(struct device_node *np, · 60 unmodified lines
6161 }
6262 extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc);
6363
64−extern int of_gpio_simple_xlate(struct gpio_chip *gc,
65− const struct of_phandle_args *gpiospec,
66− u32 *flags);
67−
6864 #else /* CONFIG_OF_GPIO */
6965
7066 /* Drivers may not strictly depend on the GPIO support, so let them link. */
@@ -77,13 +73,6 @@ static inline int of_get_named_gpio_flags(struct device_node *np, · 6 unmodified lines
7773 return -ENOSYS;
7874 }
7975
80−static inline int of_gpio_simple_xlate(struct gpio_chip *gc,
81− const struct of_phandle_args *gpiospec,
82− u32 *flags)
83−{
84− return -ENOSYS;
85−}
86−
8776 #endif /* CONFIG_OF_GPIO */
8877
8978 /**
include/linux/omap-dma.h+0−2
@@ -1,8 +1,6 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 #ifndef __LINUX_OMAP_DMA_H
33 #define __LINUX_OMAP_DMA_H
4−#include <linux/omap-dmaengine.h>
5−
64 /*
75 * Legacy OMAP DMA handling defines and functions
86 *
include/linux/omap-dmaengine.h+0−18
@@ -1,18 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/*
3− * OMAP DMA Engine support
4− */
5−#ifndef __LINUX_OMAP_DMAENGINE_H
6−#define __LINUX_OMAP_DMAENGINE_H
7−
8−struct dma_chan;
9−
10−#if defined(CONFIG_DMA_OMAP) || (defined(CONFIG_DMA_OMAP_MODULE) && defined(MODULE))
11−bool omap_dma_filter_fn(struct dma_chan *, void *);
12−#else
13−static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
14−{
15− return false;
16−}
17−#endif
18−#endif /* __LINUX_OMAP_DMAENGINE_H */
include/linux/omap-iommu.h+15−0
@@ -10,12 +10,27 @@ · 9 unmodified lines
1010 #ifndef _OMAP_IOMMU_H_
1111 #define _OMAP_IOMMU_H_
1212
13+struct iommu_domain;
14+
1315 #ifdef CONFIG_OMAP_IOMMU
1416 extern void omap_iommu_save_ctx(struct device *dev);
1517 extern void omap_iommu_restore_ctx(struct device *dev);
18+
19+int omap_iommu_domain_deactivate(struct iommu_domain *domain);
20+int omap_iommu_domain_activate(struct iommu_domain *domain);
1621 #else
1722 static inline void omap_iommu_save_ctx(struct device *dev) {}
1823 static inline void omap_iommu_restore_ctx(struct device *dev) {}
24+
25+static inline int omap_iommu_domain_deactivate(struct iommu_domain *domain)
26+{
27+ return -ENODEV;
28+}
29+
30+static inline int omap_iommu_domain_activate(struct iommu_domain *domain)
31+{
32+ return -ENODEV;
33+}
1934 #endif
2035
2136 #endif
include/linux/oxu210hp.h+0−8
@@ -1,8 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−/* platform data for the OXU210HP HCD */
3−
4−struct oxu210hp_platform_data {
5− unsigned int bus16:1;
6− unsigned int use_hcd_otg:1;
7− unsigned int use_hcd_sph:1;
8−};
include/linux/padata.h+13−16
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212 #include <linux/workqueue.h>
1313 #include <linux/spinlock.h>
1414 #include <linux/list.h>
15−#include <linux/timer.h>
1615 #include <linux/notifier.h>
1716 #include <linux/kobject.h>
1817
@@ -36,6 +35,7 @@ struct padata_priv { · 17 unmodified lines
3635 struct parallel_data *pd;
3736 int cb_cpu;
3837 int cpu;
38+ unsigned int seq_nr;
3939 int info;
4040 void (*parallel)(struct padata_priv *padata);
4141 void (*serial)(struct padata_priv *padata);
@@ -73,20 +73,14 @@ struct padata_serial_queue { · 31 unmodified lines
7373 * @serial: List to wait for serialization after reordering.
7474 * @pwork: work struct for parallelization.
7575 * @swork: work struct for serialization.
76− * @pd: Backpointer to the internal control structure.
7776 * @work: work struct for parallelization.
78− * @reorder_work: work struct for reordering.
7977 * @num_obj: Number of objects that are processed by this cpu.
80− * @cpu_index: Index of the cpu.
8178 */
8279 struct padata_parallel_queue {
8380 struct padata_list parallel;
8481 struct padata_list reorder;
85− struct parallel_data *pd;
8682 struct work_struct work;
87− struct work_struct reorder_work;
8883 atomic_t num_obj;
89− int cpu_index;
9084 };
9185
9286 /**
@@ -110,10 +104,11 @@ struct padata_cpumask { · 17 unmodified lines
110104 * @reorder_objects: Number of objects waiting in the reorder queues.
111105 * @refcnt: Number of objects holding a reference on this parallel_data.
112106 * @max_seq_nr: Maximal used sequence number.
107+ * @processed: Number of already processed objects.
108+ * @cpu: Next CPU to be processed.
113109 * @cpumask: The cpumasks in use for parallel and serial workers.
110+ * @reorder_work: work struct for reordering.
114111 * @lock: Reorder lock.
115− * @processed: Number of already processed objects.
116− * @timer: Reorder timer.
117112 */
118113 struct parallel_data {
119114 struct padata_instance *pinst;
@@ -122,17 +117,19 @@ struct parallel_data { · 2 unmodified lines
122117 atomic_t reorder_objects;
123118 atomic_t refcnt;
124119 atomic_t seq_nr;
120+ unsigned int processed;
121+ int cpu;
125122 struct padata_cpumask cpumask;
123+ struct work_struct reorder_work;
126124 spinlock_t lock ____cacheline_aligned;
127− unsigned int processed;
128− struct timer_list timer;
129125 };
130126
131127 /**
132128 * struct padata_instance - The overall control structure.
133129 *
134130 * @cpu_notifier: cpu hotplug notifier.
135− * @wq: The workqueue in use.
131+ * @parallel_wq: The workqueue used for parallel work.
132+ * @serial_wq: The workqueue used for serial work.
136133 * @pd: The internal control structure.
137134 * @cpumask: User supplied cpumasks for parallel and serial works.
138135 * @cpumask_change_notifier: Notifiers chain for user-defined notify
@@ -144,7 +141,8 @@ struct parallel_data { · 5 unmodified lines
144141 */
145142 struct padata_instance {
146143 struct hlist_node node;
147− struct workqueue_struct *wq;
144+ struct workqueue_struct *parallel_wq;
145+ struct workqueue_struct *serial_wq;
148146 struct parallel_data *pd;
149147 struct padata_cpumask cpumask;
150148 struct blocking_notifier_head cpumask_change_notifier;
@@ -156,11 +154,10 @@ struct padata_instance { · 5 unmodified lines
156154 #define PADATA_INVALID 4
157155 };
158156
159−extern struct padata_instance *padata_alloc_possible(
160− struct workqueue_struct *wq);
157+extern struct padata_instance *padata_alloc_possible(const char *name);
161158 extern void padata_free(struct padata_instance *pinst);
162159 extern int padata_do_parallel(struct padata_instance *pinst,
163− struct padata_priv *padata, int cb_cpu);
160+ struct padata_priv *padata, int *cb_cpu);
164161 extern void padata_do_serial(struct padata_priv *padata);
165162 extern int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,
166163 cpumask_var_t cpumask);
include/linux/page-flags-layout.h+11−7
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232
3333 #endif /* CONFIG_SPARSEMEM */
3434
35+#ifndef BUILD_VDSO32_64
3536 /*
3637 * page->flags layout:
3738 *
@@ -76,20 +77,22 @@ · 38 unmodified lines
7677 #define LAST_CPUPID_SHIFT 0
7778 #endif
7879
79−#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT+LAST_CPUPID_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS
80+#ifdef CONFIG_KASAN_SW_TAGS
81+#define KASAN_TAG_WIDTH 8
82+#else
83+#define KASAN_TAG_WIDTH 0
84+#endif
85+
86+#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT+LAST_CPUPID_SHIFT+KASAN_TAG_WIDTH \
87+ <= BITS_PER_LONG - NR_PAGEFLAGS
8088 #define LAST_CPUPID_WIDTH LAST_CPUPID_SHIFT
8189 #else
8290 #define LAST_CPUPID_WIDTH 0
8391 #endif
8492
85−#ifdef CONFIG_KASAN_SW_TAGS
86−#define KASAN_TAG_WIDTH 8
8793 #if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH+LAST_CPUPID_WIDTH+KASAN_TAG_WIDTH \
8894 > BITS_PER_LONG - NR_PAGEFLAGS
89−#error "KASAN: not enough bits in page flags for tag"
90−#endif
91−#else
92−#define KASAN_TAG_WIDTH 0
95+#error "Not enough bits in page flags"
9396 #endif
9497
9598 /*
@@ -104,4 +107,5 @@ · 8 unmodified lines
104107 #define LAST_CPUPID_NOT_IN_PAGE_FLAGS
105108 #endif
106109
110+#endif
107111 #endif /* _LINUX_PAGE_FLAGS_LAYOUT */
include/linux/page-flags.h+4−0
@@ -152,6 +152,8 @@ enum pageflags { · 151 unmodified lines
152152 PG_savepinned = PG_dirty,
153153 /* Has a grant mapping of another (foreign) domain's page. */
154154 PG_foreign = PG_owner_priv_1,
155+ /* Remapped by swiotlb-xen. */
156+ PG_xen_remapped = PG_owner_priv_1,
155157
156158 /* SLOB */
157159 PG_slob_free = PG_private,
@@ -329,6 +331,8 @@ PAGEFLAG(Pinned, pinned, PF_NO_COMPOUND) · 171 unmodified lines
329331 TESTSCFLAG(Pinned, pinned, PF_NO_COMPOUND)
330332 PAGEFLAG(SavePinned, savepinned, PF_NO_COMPOUND);
331333 PAGEFLAG(Foreign, foreign, PF_NO_COMPOUND);
334+PAGEFLAG(XenRemapped, xen_remapped, PF_NO_COMPOUND)
335+ TESTCLEARFLAG(XenRemapped, xen_remapped, PF_NO_COMPOUND)
332336
333337 PAGEFLAG(Reserved, reserved, PF_NO_COMPOUND)
334338 __CLEARPAGEFLAG(Reserved, reserved, PF_NO_COMPOUND)
include/linux/page_ext.h+1−0
@@ -18,6 +18,7 @@ struct page_ext_operations { · 17 unmodified lines
1818
1919 enum page_ext_flags {
2020 PAGE_EXT_OWNER,
21+ PAGE_EXT_OWNER_ACTIVE,
2122 #if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT)
2223 PAGE_EXT_YOUNG,
2324 PAGE_EXT_IDLE,
include/linux/pagemap.h+10−0
@@ -333,6 +333,16 @@ 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+ if (PageHuge(page))
339+ return page;
340+
341+ VM_BUG_ON_PAGE(PageTail(page), page);
342+
343+ return page + (offset & (compound_nr(page) - 1));
344+}
345+
336346 struct page *find_get_entry(struct address_space *mapping, pgoff_t offset);
337347 struct page *find_lock_entry(struct address_space *mapping, pgoff_t offset);
338348 unsigned find_get_entries(struct address_space *mapping, pgoff_t start,
include/linux/pagewalk.h+66−0
@@ -0,0 +1,66 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _LINUX_PAGEWALK_H
3+#define _LINUX_PAGEWALK_H
4+
5+#include <linux/mm.h>
6+
7+struct mm_walk;
8+
9+/**
10+ * mm_walk_ops - callbacks for walk_page_range
11+ * @pud_entry: if set, called for each non-empty PUD (2nd-level) entry
12+ * this handler should only handle pud_trans_huge() puds.
13+ * the pmd_entry or pte_entry callbacks will be used for
14+ * regular PUDs.
15+ * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry
16+ * this handler is required to be able to handle
17+ * pmd_trans_huge() pmds. They may simply choose to
18+ * split_huge_page() instead of handling it explicitly.
19+ * @pte_entry: if set, called for each non-empty PTE (4th-level) entry
20+ * @pte_hole: if set, called for each hole at all levels
21+ * @hugetlb_entry: if set, called for each hugetlb entry
22+ * @test_walk: caller specific callback function to determine whether
23+ * we walk over the current vma or not. Returning 0 means
24+ * "do page table walk over the current vma", returning
25+ * a negative value means "abort current page table walk
26+ * right now" and returning 1 means "skip the current vma"
27+ */
28+struct mm_walk_ops {
29+ int (*pud_entry)(pud_t *pud, unsigned long addr,
30+ unsigned long next, struct mm_walk *walk);
31+ int (*pmd_entry)(pmd_t *pmd, unsigned long addr,
32+ unsigned long next, struct mm_walk *walk);
33+ int (*pte_entry)(pte_t *pte, unsigned long addr,
34+ unsigned long next, struct mm_walk *walk);
35+ int (*pte_hole)(unsigned long addr, unsigned long next,
36+ struct mm_walk *walk);
37+ int (*hugetlb_entry)(pte_t *pte, unsigned long hmask,
38+ unsigned long addr, unsigned long next,
39+ struct mm_walk *walk);
40+ int (*test_walk)(unsigned long addr, unsigned long next,
41+ struct mm_walk *walk);
42+};
43+
44+/**
45+ * mm_walk - walk_page_range data
46+ * @ops: operation to call during the walk
47+ * @mm: mm_struct representing the target process of page table walk
48+ * @vma: vma currently walked (NULL if walking outside vmas)
49+ * @private: private data for callbacks' usage
50+ *
51+ * (see the comment on walk_page_range() for more details)
52+ */
53+struct mm_walk {
54+ const struct mm_walk_ops *ops;
55+ struct mm_struct *mm;
56+ struct vm_area_struct *vma;
57+ void *private;
58+};
59+
60+int walk_page_range(struct mm_struct *mm, unsigned long start,
61+ unsigned long end, const struct mm_walk_ops *ops,
62+ void *private);
63+int walk_page_vma(struct vm_area_struct *vma, const struct mm_walk_ops *ops,
64+ void *private);
65+
66+#endif /* _LINUX_PAGEWALK_H */
include/linux/pci-aspm.h+0−36
@@ -1,36 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−/*
3− * aspm.h
4− *
5− * PCI Express ASPM defines and function prototypes
6− *
7− * Copyright (C) 2007 Intel Corp.
8− * Zhang Yanmin (yanmin.zhang@intel.com)
9− * Shaohua Li (shaohua.li@intel.com)
10− *
11− * For more information, please consult the following manuals (look at
12− * http://www.pcisig.com/ for how to get them):
13− *
14− * PCI Express Specification
15− */
16−
17−#ifndef LINUX_ASPM_H
18−#define LINUX_ASPM_H
19−
20−#include <linux/pci.h>
21−
22−#define PCIE_LINK_STATE_L0S 1
23−#define PCIE_LINK_STATE_L1 2
24−#define PCIE_LINK_STATE_CLKPM 4
25−
26−#ifdef CONFIG_PCIEASPM
27−int pci_disable_link_state(struct pci_dev *pdev, int state);
28−int pci_disable_link_state_locked(struct pci_dev *pdev, int state);
29−void pcie_no_aspm(void);
30−#else
31−static inline int pci_disable_link_state(struct pci_dev *pdev, int state)
32−{ return 0; }
33−static inline void pcie_no_aspm(void) { }
34−#endif
35−
36−#endif /* LINUX_ASPM_H */
include/linux/pci-p2pdma.h+24−4
@@ -30,8 +30,10 @@ struct scatterlist *pci_p2pmem_alloc_sgl(struct pci_dev *pdev, · 29 unmodified lines
3030 unsigned int *nents, u32 length);
3131 void pci_p2pmem_free_sgl(struct pci_dev *pdev, struct scatterlist *sgl);
3232 void pci_p2pmem_publish(struct pci_dev *pdev, bool publish);
33−int pci_p2pdma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
34− enum dma_data_direction dir);
33+int pci_p2pdma_map_sg_attrs(struct device *dev, struct scatterlist *sg,
34+ int nents, enum dma_data_direction dir, unsigned long attrs);
35+void pci_p2pdma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg,
36+ int nents, enum dma_data_direction dir, unsigned long attrs);
3537 int pci_p2pdma_enable_store(const char *page, struct pci_dev **p2p_dev,
3638 bool *use_p2pdma);
3739 ssize_t pci_p2pdma_enable_show(char *page, struct pci_dev *p2p_dev,
@@ -81,11 +83,17 @@ static inline void pci_p2pmem_free_sgl(struct pci_dev *pdev, · 43 unmodified lines
8183 static inline void pci_p2pmem_publish(struct pci_dev *pdev, bool publish)
8284 {
8385 }
84−static inline int pci_p2pdma_map_sg(struct device *dev,
85− struct scatterlist *sg, int nents, enum dma_data_direction dir)
86+static inline int pci_p2pdma_map_sg_attrs(struct device *dev,
87+ struct scatterlist *sg, int nents, enum dma_data_direction dir,
88+ unsigned long attrs)
8689 {
8790 return 0;
8891 }
92+static inline void pci_p2pdma_unmap_sg_attrs(struct device *dev,
93+ struct scatterlist *sg, int nents, enum dma_data_direction dir,
94+ unsigned long attrs)
95+{
96+}
8997 static inline int pci_p2pdma_enable_store(const char *page,
9098 struct pci_dev **p2p_dev, bool *use_p2pdma)
9199 {
@@ -111,4 +119,16 @@ static inline struct pci_dev *pci_p2pmem_find(struct device *client) · 19 unmodified lines
111119 return pci_p2pmem_find_many(&client, 1);
112120 }
113121
122+static inline int pci_p2pdma_map_sg(struct device *dev, struct scatterlist *sg,
123+ int nents, enum dma_data_direction dir)
124+{
125+ return pci_p2pdma_map_sg_attrs(dev, sg, nents, dir, 0);
126+}
127+
128+static inline void pci_p2pdma_unmap_sg(struct device *dev,
129+ struct scatterlist *sg, int nents, enum dma_data_direction dir)
130+{
131+ pci_p2pdma_unmap_sg_attrs(dev, sg, nents, dir, 0);
132+}
133+
114134 #endif /* _LINUX_PCI_P2P_H */
include/linux/pci.h+51−84
@@ -6,12 +6,18 @@ · 5 unmodified lines
66 * Copyright 1994, Drew Eckhardt
77 * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
88 *
9+ * PCI Express ASPM defines and function prototypes
10+ * Copyright (c) 2007 Intel Corp.
11+ * Zhang Yanmin (yanmin.zhang@intel.com)
12+ * Shaohua Li (shaohua.li@intel.com)
13+ *
914 * For more information, please consult the following manuals (look at
1015 * http://www.pcisig.com/ for how to get them):
1116 *
1217 * PCI BIOS Specification
1318 * PCI Local Bus Specification
1419 * PCI to PCI Bridge Specification
20+ * PCI Express Specification
1521 * PCI System Design Guide
1622 */
1723 #ifndef LINUX_PCI_H
@@ -145,11 +151,6 @@ static inline const char *pci_power_name(pci_power_t state) · 127 unmodified lines
145151 return pci_power_names[1 + (__force int) state];
146152 }
147153
148−#define PCI_PM_D2_DELAY 200
149−#define PCI_PM_D3_WAIT 10
150−#define PCI_PM_D3COLD_WAIT 100
151−#define PCI_PM_BUS_WAIT 50
152−
153154 /**
154155 * typedef pci_channel_state_t
155156 *
@@ -418,7 +419,6 @@ struct pci_dev { · 262 unmodified lines
418419 unsigned int broken_intx_masking:1; /* INTx masking can't be used */
419420 unsigned int io_window_1k:1; /* Intel bridge 1K I/O windows */
420421 unsigned int irq_managed:1;
421− unsigned int has_secondary_link:1;
422422 unsigned int non_compliant_bars:1; /* Broken BARs; ignore them */
423423 unsigned int is_probed:1; /* Device probing in progress */
424424 unsigned int link_active_reporting:1;/* Device capable of reporting link active */
@@ -649,9 +649,6 @@ static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev) · 224 unmodified lines
649649 return dev->bus->self;
650650 }
651651
652−struct device *pci_get_host_bridge_device(struct pci_dev *dev);
653−void pci_put_host_bridge_device(struct device *dev);
654−
655652 #ifdef CONFIG_PCI_MSI
656653 static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev)
657654 {
@@ -925,6 +922,11 @@ enum { · 267 unmodified lines
925922 PCI_SCAN_ALL_PCIE_DEVS = 0x00000040, /* Scan all, not just dev 0 */
926923 };
927924
925+#define PCI_IRQ_LEGACY (1 << 0) /* Allow legacy interrupts */
926+#define PCI_IRQ_MSI (1 << 1) /* Allow MSI interrupts */
927+#define PCI_IRQ_MSIX (1 << 2) /* Allow MSI-X interrupts */
928+#define PCI_IRQ_AFFINITY (1 << 3) /* Auto-assign affinity */
929+
928930 /* These external functions are only available when PCI support is enabled */
929931 #ifdef CONFIG_PCI
930932
@@ -969,7 +971,7 @@ resource_size_t pcibios_align_resource(void *, const struct resource *, · 38 unmodified lines
969971 resource_size_t,
970972 resource_size_t);
971973
972−/* Weak but can be overriden by arch */
974+/* Weak but can be overridden by arch */
973975 void pci_fixup_cardbus(struct pci_bus *);
974976
975977 /* Generic PCI functions used internally */
@@ -995,7 +997,6 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, · 19 unmodified lines
995997 int pci_scan_root_bus_bridge(struct pci_host_bridge *bridge);
996998 struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
997999 int busnr);
998−void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
9991000 struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
10001001 const char *name,
10011002 struct hotplug_slot *hotplug);
@@ -1241,19 +1242,12 @@ int pci_wake_from_d3(struct pci_dev *dev, bool enable); · 239 unmodified lines
12411242 int pci_prepare_to_sleep(struct pci_dev *dev);
12421243 int pci_back_from_sleep(struct pci_dev *dev);
12431244 bool pci_dev_run_wake(struct pci_dev *dev);
1244−bool pci_check_pme_status(struct pci_dev *dev);
1245−void pci_pme_wakeup_bus(struct pci_bus *bus);
12461245 void pci_d3cold_enable(struct pci_dev *dev);
12471246 void pci_d3cold_disable(struct pci_dev *dev);
12481247 bool pcie_relaxed_ordering_enabled(struct pci_dev *dev);
12491248 void pci_wakeup_bus(struct pci_bus *bus);
12501249 void pci_bus_set_current_state(struct pci_bus *bus, pci_power_t state);
12511250
1252−/* PCI Virtual Channel */
1253−int pci_save_vc_state(struct pci_dev *dev);
1254−void pci_restore_vc_state(struct pci_dev *dev);
1255−void pci_allocate_vc_save_buffers(struct pci_dev *dev);
1256−
12571251 /* For use by arch with custom probe code */
12581252 void set_pcie_port_type(struct pci_dev *pdev);
12591253 void set_pcie_hotplug_bridge(struct pci_dev *pdev);
@@ -1297,8 +1291,6 @@ int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *); · 37 unmodified lines
12971291 void pci_release_selected_regions(struct pci_dev *, int);
12981292
12991293 /* drivers/pci/bus.c */
1300−struct pci_bus *pci_bus_get(struct pci_bus *bus);
1301−void pci_bus_put(struct pci_bus *bus);
13021294 void pci_add_resource(struct list_head *resources, struct resource *res);
13031295 void pci_add_resource_offset(struct list_head *resources, struct resource *res,
13041296 resource_size_t offset);
@@ -1408,11 +1400,6 @@ resource_size_t pcibios_window_alignment(struct pci_bus *bus, · 103 unmodified lines
14081400 int pci_set_vga_state(struct pci_dev *pdev, bool decode,
14091401 unsigned int command_bits, u32 flags);
14101402
1411−#define PCI_IRQ_LEGACY (1 << 0) /* Allow legacy interrupts */
1412−#define PCI_IRQ_MSI (1 << 1) /* Allow MSI interrupts */
1413−#define PCI_IRQ_MSIX (1 << 2) /* Allow MSI-X interrupts */
1414−#define PCI_IRQ_AFFINITY (1 << 3) /* Auto-assign affinity */
1415−
14161403 /*
14171404 * Virtual interrupts allow for more interrupts to be allocated
14181405 * than the device has interrupts for. These are not programmed
@@ -1517,14 +1504,6 @@ static inline int pci_irq_get_node(struct pci_dev *pdev, int vec) · 98 unmodified lines
15171504 }
15181505 #endif
15191506
1520−static inline int
1521−pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
1522− unsigned int max_vecs, unsigned int flags)
1523−{
1524− return pci_alloc_irq_vectors_affinity(dev, min_vecs, max_vecs, flags,
1525− NULL);
1526−}
1527−
15281507 /**
15291508 * pci_irqd_intx_xlate() - Translate PCI INTx value to an IRQ domain hwirq
15301509 * @d: the INTx IRQ domain
@@ -1565,10 +1544,24 @@ extern bool pcie_ports_native; · 34 unmodified lines
15651544 #define pcie_ports_native false
15661545 #endif
15671546
1547+#define PCIE_LINK_STATE_L0S 1
1548+#define PCIE_LINK_STATE_L1 2
1549+#define PCIE_LINK_STATE_CLKPM 4
1550+
15681551 #ifdef CONFIG_PCIEASPM
1552+int pci_disable_link_state(struct pci_dev *pdev, int state);
1553+int pci_disable_link_state_locked(struct pci_dev *pdev, int state);
1554+void pcie_no_aspm(void);
15691555 bool pcie_aspm_support_enabled(void);
1556+bool pcie_aspm_enabled(struct pci_dev *pdev);
15701557 #else
1558+static inline int pci_disable_link_state(struct pci_dev *pdev, int state)
1559+{ return 0; }
1560+static inline int pci_disable_link_state_locked(struct pci_dev *pdev, int state)
1561+{ return 0; }
1562+static inline void pcie_no_aspm(void) { }
15711563 static inline bool pcie_aspm_support_enabled(void) { return false; }
1564+static inline bool pcie_aspm_enabled(struct pci_dev *pdev) { return false; }
15721565 #endif
15731566
15741567 #ifdef CONFIG_PCIEAER
@@ -1577,23 +1570,8 @@ bool pci_aer_available(void); · 2 unmodified lines
15771570 static inline bool pci_aer_available(void) { return false; }
15781571 #endif
15791572
1580−#ifdef CONFIG_PCIE_ECRC
1581−void pcie_set_ecrc_checking(struct pci_dev *dev);
1582−void pcie_ecrc_get_policy(char *str);
1583−#else
1584−static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { }
1585−static inline void pcie_ecrc_get_policy(char *str) { }
1586−#endif
1587−
15881573 bool pci_ats_disabled(void);
15891574
1590−#ifdef CONFIG_PCIE_PTM
1591−int pci_enable_ptm(struct pci_dev *dev, u8 *granularity);
1592−#else
1593−static inline int pci_enable_ptm(struct pci_dev *dev, u8 *granularity)
1594−{ return -EINVAL; }
1595−#endif
1596−
15971575 void pci_cfg_access_lock(struct pci_dev *dev);
15981576 bool pci_cfg_access_trylock(struct pci_dev *dev);
15991577 void pci_cfg_access_unlock(struct pci_dev *dev);
@@ -1747,11 +1725,6 @@ static inline void pci_release_regions(struct pci_dev *dev) { } · 147 unmodified lines
17471725
17481726 static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
17491727
1750−static inline void pci_block_cfg_access(struct pci_dev *dev) { }
1751−static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
1752−{ return 0; }
1753−static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
1754−
17551728 static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
17561729 { return NULL; }
17571730 static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
@@ -1780,17 +1753,36 @@ static inline const struct pci_device_id *pci_match_id(const struct pci_device_i · 22 unmodified lines
17801753 struct pci_dev *dev)
17811754 { return NULL; }
17821755 static inline bool pci_ats_disabled(void) { return true; }
1756+
1757+static inline int pci_irq_vector(struct pci_dev *dev, unsigned int nr)
1758+{
1759+ return -EINVAL;
1760+}
1761+
1762+static inline int
1763+pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
1764+ unsigned int max_vecs, unsigned int flags,
1765+ struct irq_affinity *aff_desc)
1766+{
1767+ return -ENOSPC;
1768+}
17831769 #endif /* CONFIG_PCI */
17841770
1771+static inline int
1772+pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
1773+ unsigned int max_vecs, unsigned int flags)
1774+{
1775+ return pci_alloc_irq_vectors_affinity(dev, min_vecs, max_vecs, flags,
1776+ NULL);
1777+}
1778+
17851779 #ifdef CONFIG_PCI_ATS
17861780 /* Address Translation Service */
1787−void pci_ats_init(struct pci_dev *dev);
17881781 int pci_enable_ats(struct pci_dev *dev, int ps);
17891782 void pci_disable_ats(struct pci_dev *dev);
17901783 int pci_ats_queue_depth(struct pci_dev *dev);
17911784 int pci_ats_page_aligned(struct pci_dev *dev);
17921785 #else
1793−static inline void pci_ats_init(struct pci_dev *d) { }
17941786 static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }
17951787 static inline void pci_disable_ats(struct pci_dev *d) { }
17961788 static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; }
@@ -1801,7 +1793,7 @@ static inline int pci_ats_page_aligned(struct pci_dev *dev) { return 0; } · 4 unmodified lines
18011793
18021794 #include <asm/pci.h>
18031795
1804−/* These two functions provide almost identical functionality. Depennding
1796+/* These two functions provide almost identical functionality. Depending
18051797 * on the architecture, one will be implemented as a wrapper around the
18061798 * other (in drivers/pci/mmap.c).
18071799 *
@@ -1870,25 +1862,9 @@ static inline const char *pci_name(const struct pci_dev *pdev) · 62 unmodified lines
18701862 return dev_name(&pdev->dev);
18711863 }
18721864
1873−
1874−/*
1875− * Some archs don't want to expose struct resource to userland as-is
1876− * in sysfs and /proc
1877− */
1878−#ifdef HAVE_ARCH_PCI_RESOURCE_TO_USER
18791865 void pci_resource_to_user(const struct pci_dev *dev, int bar,
18801866 const struct resource *rsrc,
18811867 resource_size_t *start, resource_size_t *end);
1882−#else
1883−static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
1884− const struct resource *rsrc, resource_size_t *start,
1885− resource_size_t *end)
1886−{
1887− *start = rsrc->start;
1888− *end = rsrc->end;
1889−}
1890−#endif /* HAVE_ARCH_PCI_RESOURCE_TO_USER */
1891−
18921868
18931869 /*
18941870 * The world is not perfect and supplies us with broken PCI devices.
@@ -2030,10 +2006,6 @@ extern unsigned long pci_cardbus_mem_size; · 135 unmodified lines
20302006 extern u8 pci_dfl_cache_line_size;
20312007 extern u8 pci_cache_line_size;
20322008
2033−extern unsigned long pci_hotplug_io_size;
2034−extern unsigned long pci_hotplug_mem_size;
2035−extern unsigned long pci_hotplug_bus_size;
2036−
20372009 /* Architecture-specific versions may override these (weak) */
20382010 void pcibios_disable_device(struct pci_dev *dev);
20392011 void pcibios_set_master(struct pci_dev *dev);
@@ -2303,10 +2275,6 @@ int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, · 263 unmodified lines
23032275 #ifdef CONFIG_OF
23042276 struct device_node;
23052277 struct irq_domain;
2306−void pci_set_of_node(struct pci_dev *dev);
2307−void pci_release_of_node(struct pci_dev *dev);
2308−void pci_set_bus_of_node(struct pci_bus *bus);
2309−void pci_release_bus_of_node(struct pci_bus *bus);
23102278 struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus);
23112279 int pci_parse_request_of_pci_ranges(struct device *dev,
23122280 struct list_head *resources,
@@ -2316,10 +2284,6 @@ int pci_parse_request_of_pci_ranges(struct device *dev, · 3 unmodified lines
23162284 struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus);
23172285
23182286 #else /* CONFIG_OF */
2319−static inline void pci_set_of_node(struct pci_dev *dev) { }
2320−static inline void pci_release_of_node(struct pci_dev *dev) { }
2321−static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
2322−static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
23232287 static inline struct irq_domain *
23242288 pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; }
23252289 static inline int pci_parse_request_of_pci_ranges(struct device *dev,
@@ -2433,4 +2397,7 @@ void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type); · 107 unmodified lines
24332397 #define pci_notice_ratelimited(pdev, fmt, arg...) \
24342398 dev_notice_ratelimited(&(pdev)->dev, fmt, ##arg)
24352399
2400+#define pci_info_ratelimited(pdev, fmt, arg...) \
2401+ dev_info_ratelimited(&(pdev)->dev, fmt, ##arg)
2402+
24362403 #endif /* LINUX_PCI_H */
include/linux/pci_hotplug.h+0−100
@@ -86,114 +86,14 @@ void pci_hp_deregister(struct hotplug_slot *slot); · 85 unmodified lines
8686 #define pci_hp_initialize(slot, bus, nr, name) \
8787 __pci_hp_initialize(slot, bus, nr, name, THIS_MODULE, KBUILD_MODNAME)
8888
89−/* PCI Setting Record (Type 0) */
90−struct hpp_type0 {
91− u32 revision;
92− u8 cache_line_size;
93− u8 latency_timer;
94− u8 enable_serr;
95− u8 enable_perr;
96−};
97−
98−/* PCI-X Setting Record (Type 1) */
99−struct hpp_type1 {
100− u32 revision;
101− u8 max_mem_read;
102− u8 avg_max_split;
103− u16 tot_max_split;
104−};
105−
106−/* PCI Express Setting Record (Type 2) */
107−struct hpp_type2 {
108− u32 revision;
109− u32 unc_err_mask_and;
110− u32 unc_err_mask_or;
111− u32 unc_err_sever_and;
112− u32 unc_err_sever_or;
113− u32 cor_err_mask_and;
114− u32 cor_err_mask_or;
115− u32 adv_err_cap_and;
116− u32 adv_err_cap_or;
117− u16 pci_exp_devctl_and;
118− u16 pci_exp_devctl_or;
119− u16 pci_exp_lnkctl_and;
120− u16 pci_exp_lnkctl_or;
121− u32 sec_unc_err_sever_and;
122− u32 sec_unc_err_sever_or;
123− u32 sec_unc_err_mask_and;
124− u32 sec_unc_err_mask_or;
125−};
126−
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,
179−};
180−
18189 #ifdef CONFIG_ACPI
18290 #include <linux/acpi.h>
183−int pci_acpi_program_hp_params(struct pci_dev *dev,
184− const struct hotplug_program_ops *hp_ops);
18591 bool pciehp_is_native(struct pci_dev *bridge);
18692 int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge);
18793 bool shpchp_is_native(struct pci_dev *bridge);
18894 int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle);
18995 int acpi_pci_detect_ejectable(acpi_handle handle);
19096 #else
191−static inline int pci_acpi_program_hp_params(struct pci_dev *dev,
192− const struct hotplug_program_ops *hp_ops)
193−{
194− return -ENODEV;
195−}
196−
19797 static inline int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge)
19898 {
19999 return 0;
include/linux/pci_ids.h+8−1
@@ -548,6 +548,7 @@ · 547 unmodified lines
548548 #define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463
549549 #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F3 0x15eb
550550 #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F3 0x1493
551+#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F3 0x1443
551552 #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703
552553 #define PCI_DEVICE_ID_AMD_LANCE 0x2000
553554 #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001
@@ -1070,7 +1071,6 @@ · 516 unmodified lines
10701071 #define PCI_VENDOR_ID_SGI 0x10a9
10711072 #define PCI_DEVICE_ID_SGI_IOC3 0x0003
10721073 #define PCI_DEVICE_ID_SGI_LITHIUM 0x1002
1073−#define PCI_DEVICE_ID_SGI_IOC4 0x100a
10741074
10751075 #define PCI_VENDOR_ID_WINBOND 0x10ad
10761076 #define PCI_DEVICE_ID_WINBOND_82C105 0x0105
@@ -1951,6 +1951,8 @@ · 874 unmodified lines
19511951 #define PCI_VENDOR_ID_DIGIGRAM 0x1369
19521952 #define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_SERIAL_SUBSYSTEM 0xc001
19531953 #define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_CAE_SERIAL_SUBSYSTEM 0xc002
1954+#define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ESE_SERIAL_SUBSYSTEM 0xc021
1955+#define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ESE_CAE_SERIAL_SUBSYSTEM 0xc022
19541956
19551957 #define PCI_VENDOR_ID_KAWASAKI 0x136b
19561958 #define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01
@@ -2132,6 +2134,7 @@ · 175 unmodified lines
21322134 #define PCI_VENDOR_ID_MYRICOM 0x14c1
21332135
21342136 #define PCI_VENDOR_ID_MEDIATEK 0x14c3
2137+#define PCI_DEVICE_ID_MEDIATEK_7629 0x7629
21352138
21362139 #define PCI_VENDOR_ID_TITAN 0x14D2
21372140 #define PCI_DEVICE_ID_TITAN_010L 0x8001
@@ -2405,6 +2408,8 @@ · 267 unmodified lines
24052408 #define PCI_DEVICE_ID_RDC_R6061 0x6061
24062409 #define PCI_DEVICE_ID_RDC_D1010 0x1010
24072410
2411+#define PCI_VENDOR_ID_GLI 0x17a0
2412+
24082413 #define PCI_VENDOR_ID_LENOVO 0x17aa
24092414
24102415 #define PCI_VENDOR_ID_QCOM 0x17cb
@@ -2570,6 +2575,8 @@ · 159 unmodified lines
25702575
25712576 #define PCI_VENDOR_ID_ASMEDIA 0x1b21
25722577
2578+#define PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS 0x1c36
2579+
25732580 #define PCI_VENDOR_ID_CIRCUITCO 0x1cc8
25742581 #define PCI_SUBSYSTEM_ID_CIRCUITCO_MINNOWBOARD 0x0001
25752582
include/linux/percpu.h+1−1
@@ -105,7 +105,7 @@ extern struct pcpu_alloc_info * __init pcpu_alloc_alloc_info(int nr_groups, · 104 unmodified lines
105105 int nr_units);
106106 extern void __init pcpu_free_alloc_info(struct pcpu_alloc_info *ai);
107107
108−extern int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
108+extern void __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
109109 void *base_addr);
110110
111111 #ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK
include/linux/perf_event.h+14−0
@@ -246,6 +246,7 @@ struct perf_event; · 245 unmodified lines
246246 #define PERF_PMU_CAP_ITRACE 0x20
247247 #define PERF_PMU_CAP_HETEROGENEOUS_CPUS 0x40
248248 #define PERF_PMU_CAP_NO_EXCLUDE 0x80
249+#define PERF_PMU_CAP_AUX_OUTPUT 0x100
249250
250251 /**
251252 * struct pmu - generic performance monitoring unit
@@ -446,6 +447,16 @@ struct pmu { · 194 unmodified lines
446447 void (*addr_filters_sync) (struct perf_event *event);
447448 /* optional */
448449
450+ /*
451+ * Check if event can be used for aux_output purposes for
452+ * events of this PMU.
453+ *
454+ * Runs from perf_event_open(). Should return 0 for "no match"
455+ * or non-zero for "match".
456+ */
457+ int (*aux_output_match) (struct perf_event *event);
458+ /* optional */
459+
449460 /*
450461 * Filter events for PMU-specific reasons.
451462 */
@@ -681,6 +692,9 @@ struct perf_event { · 229 unmodified lines
681692 struct perf_addr_filter_range *addr_filter_ranges;
682693 unsigned long addr_filters_gen;
683694
695+ /* for aux_output events */
696+ struct perf_event *aux_event;
697+
684698 void (*destroy)(struct perf_event *);
685699 struct rcu_head rcu_head;
686700
include/linux/phy.h+13−2
@@ -403,6 +403,8 @@ struct phy_device { · 402 unmodified lines
403403 __ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
404404 __ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
405405 __ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising);
406+ /* used with phy_speed_down */
407+ __ETHTOOL_DECLARE_LINK_MODE_MASK(adv_old);
406408
407409 /* Energy efficient ethernet modes which should be prohibited */
408410 u32 eee_broken_modes;
@@ -665,6 +667,7 @@ size_t phy_speeds(unsigned int *speeds, size_t size, · 256 unmodified lines
665667 unsigned long *mask);
666668 void of_set_phy_supported(struct phy_device *phydev);
667669 void of_set_phy_eee_broken(struct phy_device *phydev);
670+int phy_speed_down_core(struct phy_device *phydev);
668671
669672 /**
670673 * phy_is_started - Convenience function to check whether PHY is started
@@ -984,6 +987,8 @@ int phy_select_page(struct phy_device *phydev, int page); · 313 unmodified lines
984987 int phy_restore_page(struct phy_device *phydev, int oldpage, int ret);
985988 int phy_read_paged(struct phy_device *phydev, int page, u32 regnum);
986989 int phy_write_paged(struct phy_device *phydev, int page, u32 regnum, u16 val);
990+int phy_modify_paged_changed(struct phy_device *phydev, int page, u32 regnum,
991+ u16 mask, u16 set);
987992 int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum,
988993 u16 mask, u16 set);
989994
@@ -1064,12 +1069,11 @@ void phy_attached_print(struct phy_device *phydev, const char *fmt, ...) · 74 unmodified lines
10641069 void phy_attached_info(struct phy_device *phydev);
10651070
10661071 /* Clause 22 PHY */
1067−int genphy_config_init(struct phy_device *phydev);
10681072 int genphy_read_abilities(struct phy_device *phydev);
10691073 int genphy_setup_forced(struct phy_device *phydev);
10701074 int genphy_restart_aneg(struct phy_device *phydev);
10711075 int genphy_config_eee_advert(struct phy_device *phydev);
1072−int genphy_config_aneg(struct phy_device *phydev);
1076+int __genphy_config_aneg(struct phy_device *phydev, bool changed);
10731077 int genphy_aneg_done(struct phy_device *phydev);
10741078 int genphy_update_link(struct phy_device *phydev);
10751079 int genphy_read_status(struct phy_device *phydev);
@@ -1077,6 +1081,12 @@ int genphy_suspend(struct phy_device *phydev); · 1 unmodified line
10771081 int genphy_resume(struct phy_device *phydev);
10781082 int genphy_loopback(struct phy_device *phydev, bool enable);
10791083 int genphy_soft_reset(struct phy_device *phydev);
1084+
1085+static inline int genphy_config_aneg(struct phy_device *phydev)
1086+{
1087+ return __genphy_config_aneg(phydev, false);
1088+}
1089+
10801090 static inline int genphy_no_soft_reset(struct phy_device *phydev)
10811091 {
10821092 return 0;
@@ -1107,6 +1117,7 @@ int genphy_c45_an_disable_aneg(struct phy_device *phydev); · 24 unmodified lines
11071117 int genphy_c45_read_mdix(struct phy_device *phydev);
11081118 int genphy_c45_pma_read_abilities(struct phy_device *phydev);
11091119 int genphy_c45_read_status(struct phy_device *phydev);
1120+int genphy_c45_config_aneg(struct phy_device *phydev);
11101121
11111122 /* The gen10g_* functions are the old Clause 45 stub */
11121123 int gen10g_config_aneg(struct phy_device *phydev);
include/linux/phy_fixed.h+1−0
@@ -11,6 +11,7 @@ struct fixed_phy_status { · 10 unmodified lines
1111 };
1212
1313 struct device_node;
14+struct gpio_desc;
1415
1516 #if IS_ENABLED(CONFIG_FIXED_PHY)
1617 extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier);
include/linux/pid.h+4−0
@@ -72,6 +72,10 @@ extern struct pid init_struct_pid; · 71 unmodified lines
7272
7373 extern const struct file_operations pidfd_fops;
7474
75+struct file;
76+
77+extern struct pid *pidfd_pid(const struct file *file);
78+
7579 static inline struct pid *get_pid(struct pid *pid)
7680 {
7781 if (pid)
include/linux/pinctrl/consumer.h+6−0
@@ -24,6 +24,7 @@ struct device; · 23 unmodified lines
2424 #ifdef CONFIG_PINCTRL
2525
2626 /* External interface to pin control */
27+extern bool pinctrl_gpio_can_use_line(unsigned gpio);
2728 extern int pinctrl_gpio_request(unsigned gpio);
2829 extern void pinctrl_gpio_free(unsigned gpio);
2930 extern int pinctrl_gpio_direction_input(unsigned gpio);
@@ -61,6 +62,11 @@ static inline int pinctrl_pm_select_idle_state(struct device *dev) · 31 unmodified lines
6162
6263 #else /* !CONFIG_PINCTRL */
6364
65+static inline bool pinctrl_gpio_can_use_line(unsigned gpio)
66+{
67+ return true;
68+}
69+
6470 static inline int pinctrl_gpio_request(unsigned gpio)
6571 {
6672 return 0;
include/linux/platform_data/cros_ec_chardev.h+38−0
@@ -0,0 +1,38 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * ChromeOS EC device interface.
4+ *
5+ * Copyright (C) 2014 Google, Inc.
6+ */
7+
8+#ifndef _UAPI_LINUX_CROS_EC_DEV_H_
9+#define _UAPI_LINUX_CROS_EC_DEV_H_
10+
11+#include <linux/bits.h>
12+#include <linux/ioctl.h>
13+#include <linux/types.h>
14+
15+#include <linux/platform_data/cros_ec_commands.h>
16+
17+#define CROS_EC_DEV_VERSION "1.0.0"
18+
19+/**
20+ * struct cros_ec_readmem - Struct used to read mapped memory.
21+ * @offset: Within EC_LPC_ADDR_MEMMAP region.
22+ * @bytes: Number of bytes to read. Zero means "read a string" (including '\0')
23+ * At most only EC_MEMMAP_SIZE bytes can be read.
24+ * @buffer: Where to store the result. The ioctl returns the number of bytes
25+ * read or negative on error.
26+ */
27+struct cros_ec_readmem {
28+ uint32_t offset;
29+ uint32_t bytes;
30+ uint8_t buffer[EC_MEMMAP_SIZE];
31+};
32+
33+#define CROS_EC_DEV_IOC 0xEC
34+#define CROS_EC_DEV_IOCXCMD _IOWR(CROS_EC_DEV_IOC, 0, struct cros_ec_command)
35+#define CROS_EC_DEV_IOCRDMEM _IOWR(CROS_EC_DEV_IOC, 1, struct cros_ec_readmem)
36+#define CROS_EC_DEV_IOCEVENTMASK _IO(CROS_EC_DEV_IOC, 2)
37+
38+#endif /* _CROS_EC_DEV_H_ */
include/linux/platform_data/cros_ec_commands.hrenamed from include/linux/mfd/cros_ec_commands.h+12−0
@@ -5513,6 +5513,18 @@ struct ec_params_fp_seed { · 5512 unmodified lines
55135513 uint8_t seed[FP_CONTEXT_TPM_BYTES];
55145514 } __ec_align4;
55155515
5516+#define EC_CMD_FP_ENC_STATUS 0x0409
5517+
5518+/* FP TPM seed has been set or not */
5519+#define FP_ENC_STATUS_SEED_SET BIT(0)
5520+
5521+struct ec_response_fp_encryption_status {
5522+ /* Used bits in encryption engine status */
5523+ uint32_t valid_flags;
5524+ /* Encryption engine status */
5525+ uint32_t status;
5526+} __ec_align4;
5527+
55165528 /*****************************************************************************/
55175529 /* Touchpad MCU commands: range 0x0500-0x05FF */
55185530
include/linux/platform_data/cros_ec_proto.h+319−0
@@ -0,0 +1,319 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * ChromeOS Embedded Controller protocol interface.
4+ *
5+ * Copyright (C) 2012 Google, Inc
6+ */
7+
8+#ifndef __LINUX_CROS_EC_PROTO_H
9+#define __LINUX_CROS_EC_PROTO_H
10+
11+#include <linux/device.h>
12+#include <linux/mutex.h>
13+#include <linux/notifier.h>
14+
15+#include <linux/platform_data/cros_ec_commands.h>
16+
17+#define CROS_EC_DEV_NAME "cros_ec"
18+#define CROS_EC_DEV_FP_NAME "cros_fp"
19+#define CROS_EC_DEV_ISH_NAME "cros_ish"
20+#define CROS_EC_DEV_PD_NAME "cros_pd"
21+#define CROS_EC_DEV_SCP_NAME "cros_scp"
22+#define CROS_EC_DEV_TP_NAME "cros_tp"
23+
24+/*
25+ * The EC is unresponsive for a time after a reboot command. Add a
26+ * simple delay to make sure that the bus stays locked.
27+ */
28+#define EC_REBOOT_DELAY_MS 50
29+
30+/*
31+ * Max bus-specific overhead incurred by request/responses.
32+ * I2C requires 1 additional byte for requests.
33+ * I2C requires 2 additional bytes for responses.
34+ * SPI requires up to 32 additional bytes for responses.
35+ */
36+#define EC_PROTO_VERSION_UNKNOWN 0
37+#define EC_MAX_REQUEST_OVERHEAD 1
38+#define EC_MAX_RESPONSE_OVERHEAD 32
39+
40+/*
41+ * Command interface between EC and AP, for LPC, I2C and SPI interfaces.
42+ */
43+enum {
44+ EC_MSG_TX_HEADER_BYTES = 3,
45+ EC_MSG_TX_TRAILER_BYTES = 1,
46+ EC_MSG_TX_PROTO_BYTES = EC_MSG_TX_HEADER_BYTES +
47+ EC_MSG_TX_TRAILER_BYTES,
48+ EC_MSG_RX_PROTO_BYTES = 3,
49+
50+ /* Max length of messages for proto 2*/
51+ EC_PROTO2_MSG_BYTES = EC_PROTO2_MAX_PARAM_SIZE +
52+ EC_MSG_TX_PROTO_BYTES,
53+
54+ EC_MAX_MSG_BYTES = 64 * 1024,
55+};
56+
57+/**
58+ * struct cros_ec_command - Information about a ChromeOS EC command.
59+ * @version: Command version number (often 0).
60+ * @command: Command to send (EC_CMD_...).
61+ * @outsize: Outgoing length in bytes.
62+ * @insize: Max number of bytes to accept from the EC.
63+ * @result: EC's response to the command (separate from communication failure).
64+ * @data: Where to put the incoming data from EC and outgoing data to EC.
65+ */
66+struct cros_ec_command {
67+ uint32_t version;
68+ uint32_t command;
69+ uint32_t outsize;
70+ uint32_t insize;
71+ uint32_t result;
72+ uint8_t data[0];
73+};
74+
75+/**
76+ * struct cros_ec_device - Information about a ChromeOS EC device.
77+ * @phys_name: Name of physical comms layer (e.g. 'i2c-4').
78+ * @dev: Device pointer for physical comms device
79+ * @was_wake_device: True if this device was set to wake the system from
80+ * sleep at the last suspend.
81+ * @cros_class: The class structure for this device.
82+ * @cmd_readmem: Direct read of the EC memory-mapped region, if supported.
83+ * @offset: Is within EC_LPC_ADDR_MEMMAP region.
84+ * @bytes: Number of bytes to read. zero means "read a string" (including
85+ * the trailing '\0'). At most only EC_MEMMAP_SIZE bytes can be
86+ * read. Caller must ensure that the buffer is large enough for the
87+ * result when reading a string.
88+ * @max_request: Max size of message requested.
89+ * @max_response: Max size of message response.
90+ * @max_passthru: Max sice of passthru message.
91+ * @proto_version: The protocol version used for this device.
92+ * @priv: Private data.
93+ * @irq: Interrupt to use.
94+ * @id: Device id.
95+ * @din: Input buffer (for data from EC). This buffer will always be
96+ * dword-aligned and include enough space for up to 7 word-alignment
97+ * bytes also, so we can ensure that the body of the message is always
98+ * dword-aligned (64-bit). We use this alignment to keep ARM and x86
99+ * happy. Probably word alignment would be OK, there might be a small
100+ * performance advantage to using dword.
101+ * @dout: Output buffer (for data to EC). This buffer will always be
102+ * dword-aligned and include enough space for up to 7 word-alignment
103+ * bytes also, so we can ensure that the body of the message is always
104+ * dword-aligned (64-bit). We use this alignment to keep ARM and x86
105+ * happy. Probably word alignment would be OK, there might be a small
106+ * performance advantage to using dword.
107+ * @din_size: Size of din buffer to allocate (zero to use static din).
108+ * @dout_size: Size of dout buffer to allocate (zero to use static dout).
109+ * @wake_enabled: True if this device can wake the system from sleep.
110+ * @suspended: True if this device had been suspended.
111+ * @cmd_xfer: Send command to EC and get response.
112+ * Returns the number of bytes received if the communication
113+ * succeeded, but that doesn't mean the EC was happy with the
114+ * command. The caller should check msg.result for the EC's result
115+ * code.
116+ * @pkt_xfer: Send packet to EC and get response.
117+ * @lock: One transaction at a time.
118+ * @mkbp_event_supported: True if this EC supports the MKBP event protocol.
119+ * @host_sleep_v1: True if this EC supports the sleep v1 command.
120+ * @event_notifier: Interrupt event notifier for transport devices.
121+ * @event_data: Raw payload transferred with the MKBP event.
122+ * @event_size: Size in bytes of the event data.
123+ * @host_event_wake_mask: Mask of host events that cause wake from suspend.
124+ * @ec: The platform_device used by the mfd driver to interface with the
125+ * main EC.
126+ * @pd: The platform_device used by the mfd driver to interface with the
127+ * PD behind an EC.
128+ */
129+struct cros_ec_device {
130+ /* These are used by other drivers that want to talk to the EC */
131+ const char *phys_name;
132+ struct device *dev;
133+ bool was_wake_device;
134+ struct class *cros_class;
135+ int (*cmd_readmem)(struct cros_ec_device *ec, unsigned int offset,
136+ unsigned int bytes, void *dest);
137+
138+ /* These are used to implement the platform-specific interface */
139+ u16 max_request;
140+ u16 max_response;
141+ u16 max_passthru;
142+ u16 proto_version;
143+ void *priv;
144+ int irq;
145+ u8 *din;
146+ u8 *dout;
147+ int din_size;
148+ int dout_size;
149+ bool wake_enabled;
150+ bool suspended;
151+ int (*cmd_xfer)(struct cros_ec_device *ec,
152+ struct cros_ec_command *msg);
153+ int (*pkt_xfer)(struct cros_ec_device *ec,
154+ struct cros_ec_command *msg);
155+ struct mutex lock;
156+ bool mkbp_event_supported;
157+ bool host_sleep_v1;
158+ struct blocking_notifier_head event_notifier;
159+
160+ struct ec_response_get_next_event_v1 event_data;
161+ int event_size;
162+ u32 host_event_wake_mask;
163+ u32 last_resume_result;
164+
165+ /* The platform devices used by the mfd driver */
166+ struct platform_device *ec;
167+ struct platform_device *pd;
168+};
169+
170+/**
171+ * struct cros_ec_sensor_platform - ChromeOS EC sensor platform information.
172+ * @sensor_num: Id of the sensor, as reported by the EC.
173+ */
174+struct cros_ec_sensor_platform {
175+ u8 sensor_num;
176+};
177+
178+/**
179+ * struct cros_ec_platform - ChromeOS EC platform information.
180+ * @ec_name: Name of EC device (e.g. 'cros-ec', 'cros-pd', ...)
181+ * used in /dev/ and sysfs.
182+ * @cmd_offset: Offset to apply for each command. Set when
183+ * registering a device behind another one.
184+ */
185+struct cros_ec_platform {
186+ const char *ec_name;
187+ u16 cmd_offset;
188+};
189+
190+/**
191+ * cros_ec_suspend() - Handle a suspend operation for the ChromeOS EC device.
192+ * @ec_dev: Device to suspend.
193+ *
194+ * This can be called by drivers to handle a suspend event.
195+ *
196+ * Return: 0 on success or negative error code.
197+ */
198+int cros_ec_suspend(struct cros_ec_device *ec_dev);
199+
200+/**
201+ * cros_ec_resume() - Handle a resume operation for the ChromeOS EC device.
202+ * @ec_dev: Device to resume.
203+ *
204+ * This can be called by drivers to handle a resume event.
205+ *
206+ * Return: 0 on success or negative error code.
207+ */
208+int cros_ec_resume(struct cros_ec_device *ec_dev);
209+
210+/**
211+ * cros_ec_prepare_tx() - Prepare an outgoing message in the output buffer.
212+ * @ec_dev: Device to register.
213+ * @msg: Message to write.
214+ *
215+ * This is intended to be used by all ChromeOS EC drivers, but at present
216+ * only SPI uses it. Once LPC uses the same protocol it can start using it.
217+ * I2C could use it now, with a refactor of the existing code.
218+ *
219+ * Return: 0 on success or negative error code.
220+ */
221+int cros_ec_prepare_tx(struct cros_ec_device *ec_dev,
222+ struct cros_ec_command *msg);
223+
224+/**
225+ * cros_ec_check_result() - Check ec_msg->result.
226+ * @ec_dev: EC device.
227+ * @msg: Message to check.
228+ *
229+ * This is used by ChromeOS EC drivers to check the ec_msg->result for
230+ * errors and to warn about them.
231+ *
232+ * Return: 0 on success or negative error code.
233+ */
234+int cros_ec_check_result(struct cros_ec_device *ec_dev,
235+ struct cros_ec_command *msg);
236+
237+/**
238+ * cros_ec_cmd_xfer() - Send a command to the ChromeOS EC.
239+ * @ec_dev: EC device.
240+ * @msg: Message to write.
241+ *
242+ * Call this to send a command to the ChromeOS EC. This should be used
243+ * instead of calling the EC's cmd_xfer() callback directly.
244+ *
245+ * Return: 0 on success or negative error code.
246+ */
247+int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev,
248+ struct cros_ec_command *msg);
249+
250+/**
251+ * cros_ec_cmd_xfer_status() - Send a command to the ChromeOS EC.
252+ * @ec_dev: EC device.
253+ * @msg: Message to write.
254+ *
255+ * This function is identical to cros_ec_cmd_xfer, except it returns success
256+ * status only if both the command was transmitted successfully and the EC
257+ * replied with success status. It's not necessary to check msg->result when
258+ * using this function.
259+ *
260+ * Return: The number of bytes transferred on success or negative error code.
261+ */
262+int cros_ec_cmd_xfer_status(struct cros_ec_device *ec_dev,
263+ struct cros_ec_command *msg);
264+
265+/**
266+ * cros_ec_register() - Register a new ChromeOS EC, using the provided info.
267+ * @ec_dev: Device to register.
268+ *
269+ * Before calling this, allocate a pointer to a new device and then fill
270+ * in all the fields up to the --private-- marker.
271+ *
272+ * Return: 0 on success or negative error code.
273+ */
274+int cros_ec_register(struct cros_ec_device *ec_dev);
275+
276+/**
277+ * cros_ec_unregister() - Remove a ChromeOS EC.
278+ * @ec_dev: Device to unregister.
279+ *
280+ * Call this to deregister a ChromeOS EC, then clean up any private data.
281+ *
282+ * Return: 0 on success or negative error code.
283+ */
284+int cros_ec_unregister(struct cros_ec_device *ec_dev);
285+
286+/**
287+ * cros_ec_query_all() - Query the protocol version supported by the
288+ * ChromeOS EC.
289+ * @ec_dev: Device to register.
290+ *
291+ * Return: 0 on success or negative error code.
292+ */
293+int cros_ec_query_all(struct cros_ec_device *ec_dev);
294+
295+/**
296+ * cros_ec_get_next_event() - Fetch next event from the ChromeOS EC.
297+ * @ec_dev: Device to fetch event from.
298+ * @wake_event: Pointer to a bool set to true upon return if the event might be
299+ * treated as a wake event. Ignored if null.
300+ *
301+ * Return: negative error code on errors; 0 for no data; or else number of
302+ * bytes received (i.e., an event was retrieved successfully). Event types are
303+ * written out to @ec_dev->event_data.event_type on success.
304+ */
305+int cros_ec_get_next_event(struct cros_ec_device *ec_dev, bool *wake_event);
306+
307+/**
308+ * cros_ec_get_host_event() - Return a mask of event set by the ChromeOS EC.
309+ * @ec_dev: Device to fetch event from.
310+ *
311+ * When MKBP is supported, when the EC raises an interrupt, we collect the
312+ * events raised and call the functions in the ec notifier. This function
313+ * is a helper to know which events are raised.
314+ *
315+ * Return: 0 on error or non-zero bitmask of one or more EC_HOST_EVENT_*.
316+ */
317+u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev);
318+
319+#endif /* __LINUX_CROS_EC_PROTO_H */
include/linux/platform_data/db8500_thermal.h+0−29
@@ -1,29 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-or-later */
2−/*
3− * db8500_thermal.h - DB8500 Thermal Management Implementation
4− *
5− * Copyright (C) 2012 ST-Ericsson
6− * Copyright (C) 2012 Linaro Ltd.
7− *
8− * Author: Hongbo Zhang <hongbo.zhang@linaro.com>
9− */
10−
11−#ifndef _DB8500_THERMAL_H_
12−#define _DB8500_THERMAL_H_
13−
14−#include <linux/thermal.h>
15−
16−#define COOLING_DEV_MAX 8
17−
18−struct db8500_trip_point {
19− unsigned long temp;
20− enum thermal_trip_type type;
21− char cdev_name[COOLING_DEV_MAX][THERMAL_NAME_LENGTH];
22−};
23−
24−struct db8500_thsens_platform_data {
25− struct db8500_trip_point trip_points[THERMAL_MAX_TRIPS];
26− int num_trips;
27−};
28−
29−#endif /* _DB8500_THERMAL_H_ */
include/linux/platform_data/dma-iop32x.h+110−0
@@ -0,0 +1,110 @@
1+/* SPDX-License-Identifier: GPL-2.0-only */
2+/*
3+ * Copyright © 2006, Intel Corporation.
4+ */
5+#ifndef IOP_ADMA_H
6+#define IOP_ADMA_H
7+#include <linux/types.h>
8+#include <linux/dmaengine.h>
9+#include <linux/interrupt.h>
10+
11+#define IOP_ADMA_SLOT_SIZE 32
12+#define IOP_ADMA_THRESHOLD 4
13+#ifdef DEBUG
14+#define IOP_PARANOIA 1
15+#else
16+#define IOP_PARANOIA 0
17+#endif
18+#define iop_paranoia(x) BUG_ON(IOP_PARANOIA && (x))
19+
20+#define DMA0_ID 0
21+#define DMA1_ID 1
22+#define AAU_ID 2
23+
24+/**
25+ * struct iop_adma_device - internal representation of an ADMA device
26+ * @pdev: Platform device
27+ * @id: HW ADMA Device selector
28+ * @dma_desc_pool: base of DMA descriptor region (DMA address)
29+ * @dma_desc_pool_virt: base of DMA descriptor region (CPU address)
30+ * @common: embedded struct dma_device
31+ */
32+struct iop_adma_device {
33+ struct platform_device *pdev;
34+ int id;
35+ dma_addr_t dma_desc_pool;
36+ void *dma_desc_pool_virt;
37+ struct dma_device common;
38+};
39+
40+/**
41+ * struct iop_adma_chan - internal representation of an ADMA device
42+ * @pending: allows batching of hardware operations
43+ * @lock: serializes enqueue/dequeue operations to the slot pool
44+ * @mmr_base: memory mapped register base
45+ * @chain: device chain view of the descriptors
46+ * @device: parent device
47+ * @common: common dmaengine channel object members
48+ * @last_used: place holder for allocation to continue from where it left off
49+ * @all_slots: complete domain of slots usable by the channel
50+ * @slots_allocated: records the actual size of the descriptor slot pool
51+ * @irq_tasklet: bottom half where iop_adma_slot_cleanup runs
52+ */
53+struct iop_adma_chan {
54+ int pending;
55+ spinlock_t lock; /* protects the descriptor slot pool */
56+ void __iomem *mmr_base;
57+ struct list_head chain;
58+ struct iop_adma_device *device;
59+ struct dma_chan common;
60+ struct iop_adma_desc_slot *last_used;
61+ struct list_head all_slots;
62+ int slots_allocated;
63+ struct tasklet_struct irq_tasklet;
64+};
65+
66+/**
67+ * struct iop_adma_desc_slot - IOP-ADMA software descriptor
68+ * @slot_node: node on the iop_adma_chan.all_slots list
69+ * @chain_node: node on the op_adma_chan.chain list
70+ * @hw_desc: virtual address of the hardware descriptor chain
71+ * @phys: hardware address of the hardware descriptor chain
72+ * @group_head: first operation in a transaction
73+ * @slot_cnt: total slots used in an transaction (group of operations)
74+ * @slots_per_op: number of slots per operation
75+ * @idx: pool index
76+ * @tx_list: list of descriptors that are associated with one operation
77+ * @async_tx: support for the async_tx api
78+ * @group_list: list of slots that make up a multi-descriptor transaction
79+ * for example transfer lengths larger than the supported hw max
80+ * @xor_check_result: result of zero sum
81+ * @crc32_result: result crc calculation
82+ */
83+struct iop_adma_desc_slot {
84+ struct list_head slot_node;
85+ struct list_head chain_node;
86+ void *hw_desc;
87+ struct iop_adma_desc_slot *group_head;
88+ u16 slot_cnt;
89+ u16 slots_per_op;
90+ u16 idx;
91+ struct list_head tx_list;
92+ struct dma_async_tx_descriptor async_tx;
93+ union {
94+ u32 *xor_check_result;
95+ u32 *crc32_result;
96+ u32 *pq_check_result;
97+ };
98+};
99+
100+struct iop_adma_platform_data {
101+ int hw_id;
102+ dma_cap_mask_t cap_mask;
103+ size_t pool_size;
104+};
105+
106+#define to_iop_sw_desc(addr_hw_desc) \
107+ container_of(addr_hw_desc, struct iop_adma_desc_slot, hw_desc)
108+#define iop_hw_desc_slot_idx(hw_desc, idx) \
109+ ( (void *) (((unsigned long) hw_desc) + ((idx) << 5)) )
110+#endif
include/linux/platform_data/dwc3-omap.h+0−43
@@ -1,43 +0,0 @@
1−/**
2− * dwc3-omap.h - OMAP Specific Glue layer, header.
3− *
4− * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com
5− * All rights reserved.
6− *
7− * Author: Felipe Balbi <balbi@ti.com>
8− *
9− * Redistribution and use in source and binary forms, with or without
10− * modification, are permitted provided that the following conditions
11− * are met:
12− * 1. Redistributions of source code must retain the above copyright
13− * notice, this list of conditions, and the following disclaimer,
14− * without modification.
15− * 2. Redistributions in binary form must reproduce the above copyright
16− * notice, this list of conditions and the following disclaimer in the
17− * documentation and/or other materials provided with the distribution.
18− * 3. The names of the above-listed copyright holders may not be used
19− * to endorse or promote products derived from this software without
20− * specific prior written permission.
21− *
22− * ALTERNATIVELY, this software may be distributed under the terms of the
23− * GNU General Public License ("GPL") version 2, as published by the Free
24− * Software Foundation.
25− *
26− * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
27− * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
28− * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29− * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
30− * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31− * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32− * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33− * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34− * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35− * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36− * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37− */
38−
39−enum dwc3_omap_utmi_mode {
40− DWC3_OMAP_UTMI_MODE_UNKNOWN = 0,
41− DWC3_OMAP_UTMI_MODE_HW,
42− DWC3_OMAP_UTMI_MODE_SW,
43−};
include/linux/platform_data/eth-netx.h+0−13
@@ -1,13 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/*
3− * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
4− */
5−
6−#ifndef __ETH_NETX_H
7−#define __ETH_NETX_H
8−
9−struct netxeth_platform_data {
10− unsigned int xcno; /* number of xmac/xpec engine this eth uses */
11−};
12−
13−#endif
include/linux/platform_data/gpio-htc-egpio.h+0−3
@@ -50,7 +50,4 @@ struct htc_egpio_platform_data { · 49 unmodified lines
5050 int num_chips;
5151 };
5252
53−/* Determine the wakeup irq, to be called during early resume */
54−extern int htc_egpio_get_wakeup_irq(struct device *dev);
55−
5653 #endif
include/linux/platform_data/iommu-omap.h+4−0
@@ -13,4 +13,8 @@ struct iommu_platform_data { · 12 unmodified lines
1313 const char *reset_name;
1414 int (*assert_reset)(struct platform_device *pdev, const char *name);
1515 int (*deassert_reset)(struct platform_device *pdev, const char *name);
16+ int (*device_enable)(struct platform_device *pdev);
17+ int (*device_idle)(struct platform_device *pdev);
18+ int (*set_pwrdm_constraint)(struct platform_device *pdev, bool request,
19+ u8 *pwrst);
1620 };
include/linux/platform_data/keypad-w90p910.h+0−16
@@ -1,16 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef __ASM_ARCH_W90P910_KEYPAD_H
3−#define __ASM_ARCH_W90P910_KEYPAD_H
4−
5−#include <linux/input/matrix_keypad.h>
6−
7−extern void mfp_set_groupi(struct device *dev);
8−
9−struct w90p910_keypad_platform_data {
10− const struct matrix_keymap_data *keymap_data;
11−
12− unsigned int prescale;
13− unsigned int debounce;
14−};
15−
16−#endif /* __ASM_ARCH_W90P910_KEYPAD_H */
include/linux/platform_data/leds-kirkwood-netxbig.h+0−54
@@ -1,54 +0,0 @@
1−/*
2− * Platform data structure for netxbig LED driver
3− *
4− * This file is licensed under the terms of the GNU General Public
5− * License version 2. This program is licensed "as is" without any
6− * warranty of any kind, whether express or implied.
7− */
8−
9−#ifndef __LEDS_KIRKWOOD_NETXBIG_H
10−#define __LEDS_KIRKWOOD_NETXBIG_H
11−
12−struct netxbig_gpio_ext {
13− unsigned *addr;
14− int num_addr;
15− unsigned *data;
16− int num_data;
17− unsigned enable;
18−};
19−
20−enum netxbig_led_mode {
21− NETXBIG_LED_OFF,
22− NETXBIG_LED_ON,
23− NETXBIG_LED_SATA,
24− NETXBIG_LED_TIMER1,
25− NETXBIG_LED_TIMER2,
26− NETXBIG_LED_MODE_NUM,
27−};
28−
29−#define NETXBIG_LED_INVALID_MODE NETXBIG_LED_MODE_NUM
30−
31−struct netxbig_led_timer {
32− unsigned long delay_on;
33− unsigned long delay_off;
34− enum netxbig_led_mode mode;
35−};
36−
37−struct netxbig_led {
38− const char *name;
39− const char *default_trigger;
40− int mode_addr;
41− int *mode_val;
42− int bright_addr;
43− int bright_max;
44−};
45−
46−struct netxbig_led_platform_data {
47− struct netxbig_gpio_ext *gpio_ext;
48− struct netxbig_led_timer *timer;
49− int num_timer;
50− struct netxbig_led *leds;
51− int num_leds;
52−};
53−
54−#endif /* __LEDS_KIRKWOOD_NETXBIG_H */
include/linux/platform_data/nxp-nci.h+0−19
@@ -1,19 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/*
3− * Generic platform data for the NXP NCI NFC chips.
4− *
5− * Copyright (C) 2014 NXP Semiconductors All rights reserved.
6− *
7− * Authors: Clément Perrochaud <clement.perrochaud@nxp.com>
8− */
9−
10−#ifndef _NXP_NCI_H_
11−#define _NXP_NCI_H_
12−
13−struct nxp_nci_nfc_platform_data {
14− unsigned int gpio_en;
15− unsigned int gpio_fw;
16− unsigned int irq;
17−};
18−
19−#endif /* _NXP_NCI_H_ */
include/linux/platform_data/pinctrl-single.h+6−0
@@ -1,4 +1,8 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
2+
3+#ifndef _PINCTRL_SINGLE_H
4+#define _PINCTRL_SINGLE_H
5+
26 /**
37 * irq: optional wake-up interrupt
48 * rearm: optional soc specific rearm function
@@ -11,3 +15,5 @@ struct pcs_pdata { · 6 unmodified lines
1115 int irq;
1216 void (*rearm)(void);
1317 };
18+
19+#endif /* _PINCTRL_SINGLE_H */
include/linux/platform_data/sc18is602.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
66 *
7− * For further information, see the Documentation/spi/spi-sc18is602 file.
7+ * For further information, see the Documentation/spi/spi-sc18is602.rst file.
88 */
99
1010 /**
include/linux/platform_data/sgi-w1.h+13−0
@@ -0,0 +1,13 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * SGI One-Wire (W1) IP
4+ */
5+
6+#ifndef PLATFORM_DATA_SGI_W1_H
7+#define PLATFORM_DATA_SGI_W1_H
8+
9+struct sgi_w1_platform_data {
10+ char dev_id[64];
11+};
12+
13+#endif /* PLATFORM_DATA_SGI_W1_H */
include/linux/platform_data/spi-nuc900.h+0−29
@@ -1,29 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/*
3− * Copyright (c) 2009 Nuvoton technology corporation.
4− *
5− * Wan ZongShun <mcuos.com@gmail.com>
6− */
7−
8−#ifndef __SPI_NUC900_H
9−#define __SPI_NUC900_H
10−
11−extern void mfp_set_groupg(struct device *dev, const char *subname);
12−
13−struct nuc900_spi_info {
14− unsigned int num_cs;
15− unsigned int lsb;
16− unsigned int txneg;
17− unsigned int rxneg;
18− unsigned int divider;
19− unsigned int sleep;
20− unsigned int txnum;
21− unsigned int txbitlen;
22− int bus_num;
23−};
24−
25−struct nuc900_spi_chip {
26− unsigned char bits_per_word;
27−};
28−
29−#endif /* __SPI_NUC900_H */
include/linux/platform_data/ti-sysc.h+6−2
@@ -1,3 +1,5 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+
13 #ifndef __TI_SYSC_DATA_H__
24 #define __TI_SYSC_DATA_H__
35
@@ -47,6 +49,7 @@ struct sysc_regbits { · 43 unmodified lines
4749 s8 emufree_shift;
4850 };
4951
52+#define SYSC_MODULE_QUIRK_SGX BIT(18)
5053 #define SYSC_MODULE_QUIRK_HDQ1W BIT(17)
5154 #define SYSC_MODULE_QUIRK_I2C BIT(16)
5255 #define SYSC_MODULE_QUIRK_WDT BIT(15)
@@ -70,7 +73,7 @@ struct sysc_regbits { · 17 unmodified lines
7073
7174 /**
7275 * struct sysc_capabilities - capabilities for an interconnect target module
73− *
76+ * @type: sysc type identifier for the module
7477 * @sysc_mask: bitmask of supported SYSCONFIG register bits
7578 * @regbits: bitmask of SYSCONFIG register bits
7679 * @mod_quirks: bitmask of module specific quirks
@@ -85,8 +88,9 @@ struct sysc_capabilities { · 8 unmodified lines
8588 /**
8689 * struct sysc_config - configuration for an interconnect target module
8790 * @sysc_val: configured value for sysc register
91+ * @syss_mask: configured mask value for SYSSTATUS register
8892 * @midlemodes: bitmask of supported master idle modes
89− * @sidlemodes: bitmask of supported master idle modes
93+ * @sidlemodes: bitmask of supported slave idle modes
9094 * @srst_udelay: optional delay needed after OCP soft reset
9195 * @quirks: bitmask of enabled quirks
9296 */
include/linux/platform_data/video-nuc900fb.h+0−79
@@ -1,79 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-or-later */
2−/* linux/include/asm/arch-nuc900/fb.h
3− *
4− * Copyright (c) 2008 Nuvoton technology corporation
5− * All rights reserved.
6− *
7− * Changelog:
8− *
9− * 2008/08/26 vincen.zswan modify this file for LCD.
10− */
11−
12−#ifndef __ASM_ARM_FB_H
13−#define __ASM_ARM_FB_H
14−
15−
16−
17−/* LCD Controller Hardware Desc */
18−struct nuc900fb_hw {
19− unsigned int lcd_dccs;
20− unsigned int lcd_device_ctrl;
21− unsigned int lcd_mpulcd_cmd;
22− unsigned int lcd_int_cs;
23− unsigned int lcd_crtc_size;
24− unsigned int lcd_crtc_dend;
25− unsigned int lcd_crtc_hr;
26− unsigned int lcd_crtc_hsync;
27− unsigned int lcd_crtc_vr;
28− unsigned int lcd_va_baddr0;
29− unsigned int lcd_va_baddr1;
30− unsigned int lcd_va_fbctrl;
31− unsigned int lcd_va_scale;
32− unsigned int lcd_va_test;
33− unsigned int lcd_va_win;
34− unsigned int lcd_va_stuff;
35−};
36−
37−/* LCD Display Description */
38−struct nuc900fb_display {
39− /* LCD Image type */
40− unsigned type;
41−
42− /* LCD Screen Size */
43− unsigned short width;
44− unsigned short height;
45−
46− /* LCD Screen Info */
47− unsigned short xres;
48− unsigned short yres;
49− unsigned short bpp;
50−
51− unsigned long pixclock;
52− unsigned short left_margin;
53− unsigned short right_margin;
54− unsigned short hsync_len;
55− unsigned short upper_margin;
56− unsigned short lower_margin;
57− unsigned short vsync_len;
58−
59− /* hardware special register value */
60− unsigned int dccs;
61− unsigned int devctl;
62− unsigned int fbctrl;
63− unsigned int scale;
64−};
65−
66−struct nuc900fb_mach_info {
67− struct nuc900fb_display *displays;
68− unsigned num_displays;
69− unsigned default_display;
70− /* GPIO Setting Info */
71− unsigned gpio_dir;
72− unsigned gpio_dir_mask;
73− unsigned gpio_data;
74− unsigned gpio_data_mask;
75−};
76−
77−extern void __init nuc900_fb_set_platdata(struct nuc900fb_mach_info *);
78−
79−#endif /* __ASM_ARM_FB_H */
include/linux/platform_data/x86/asus-wmi.h+6−2
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #define ASUS_WMI_METHODID_GPID 0x44495047 /* Get Panel ID?? (Resol) */
1313 #define ASUS_WMI_METHODID_QMOD 0x444F4D51 /* Quiet MODe */
1414 #define ASUS_WMI_METHODID_SPLV 0x4C425053 /* Set Panel Light Value */
15−#define ASUS_WMI_METHODID_AGFN 0x4E464741 /* FaN? */
15+#define ASUS_WMI_METHODID_AGFN 0x4E464741 /* Atk Generic FuNction */
1616 #define ASUS_WMI_METHODID_SFUN 0x4E554653 /* FUNCtionalities */
1717 #define ASUS_WMI_METHODID_SDSP 0x50534453 /* Set DiSPlay output */
1818 #define ASUS_WMI_METHODID_GDSP 0x50534447 /* Get DiSPlay output */
@@ -72,7 +72,8 @@ · 53 unmodified lines
7272
7373 /* Fan, Thermal */
7474 #define ASUS_WMI_DEVID_THERMAL_CTRL 0x00110011
75−#define ASUS_WMI_DEVID_FAN_CTRL 0x00110012
75+#define ASUS_WMI_DEVID_FAN_CTRL 0x00110012 /* deprecated */
76+#define ASUS_WMI_DEVID_CPU_FAN_CTRL 0x00110013
7677
7778 /* Power */
7879 #define ASUS_WMI_DEVID_PROCESSOR_STATE 0x00120012
@@ -80,6 +81,9 @@ · 1 unmodified line
8081 /* Deep S3 / Resume on LID open */
8182 #define ASUS_WMI_DEVID_LID_RESUME 0x00120031
8283
84+/* Maximum charging percentage */
85+#define ASUS_WMI_DEVID_RSOC 0x00120057
86+
8387 /* DSTS masks */
8488 #define ASUS_WMI_DSTS_STATUS_BIT 0x00000001
8589 #define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002
include/linux/platform_device.h+5−1
@@ -24,6 +24,7 @@ struct platform_device { · 23 unmodified lines
2424 int id;
2525 bool id_auto;
2626 struct device dev;
27+ u64 dma_mask;
2728 u32 num_resources;
2829 struct resource *resource;
2930
@@ -48,13 +49,16 @@ extern void platform_device_unregister(struct platform_device *); · 18 unmodified lines
4849 extern struct bus_type platform_bus_type;
4950 extern struct device platform_bus;
5051
51−extern void arch_setup_pdev_archdata(struct platform_device *);
5252 extern struct resource *platform_get_resource(struct platform_device *,
5353 unsigned int, unsigned int);
54+extern struct device *
55+platform_find_device_by_driver(struct device *start,
56+ const struct device_driver *drv);
5457 extern void __iomem *
5558 devm_platform_ioremap_resource(struct platform_device *pdev,
5659 unsigned int index);
5760 extern int platform_get_irq(struct platform_device *, unsigned int);
61+extern int platform_get_irq_optional(struct platform_device *, unsigned int);
5862 extern int platform_irq_count(struct platform_device *);
5963 extern struct resource *platform_get_resource_byname(struct platform_device *,
6064 unsigned int,
include/linux/pm.h+0−4
@@ -712,8 +712,6 @@ struct dev_pm_domain { · 711 unmodified lines
712712 extern void device_pm_lock(void);
713713 extern void dpm_resume_start(pm_message_t state);
714714 extern void dpm_resume_end(pm_message_t state);
715−extern void dpm_noirq_resume_devices(pm_message_t state);
716−extern void dpm_noirq_end(void);
717715 extern void dpm_resume_noirq(pm_message_t state);
718716 extern void dpm_resume_early(pm_message_t state);
719717 extern void dpm_resume(pm_message_t state);
@@ -722,8 +720,6 @@ extern void dpm_complete(pm_message_t state); · 2 unmodified lines
722720 extern void device_pm_unlock(void);
723721 extern int dpm_suspend_end(pm_message_t state);
724722 extern int dpm_suspend_start(pm_message_t state);
725−extern void dpm_noirq_begin(void);
726−extern int dpm_noirq_suspend_devices(pm_message_t state);
727723 extern int dpm_suspend_noirq(pm_message_t state);
728724 extern int dpm_suspend_late(pm_message_t state);
729725 extern int dpm_suspend(pm_message_t state);
include/linux/pm_domain.h+8−8
@@ -197,9 +197,9 @@ static inline struct generic_pm_domain_data *dev_gpd_data(struct device *dev) · 196 unmodified lines
197197 int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev);
198198 int pm_genpd_remove_device(struct device *dev);
199199 int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
200− struct generic_pm_domain *new_subdomain);
200+ struct generic_pm_domain *subdomain);
201201 int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
202− struct generic_pm_domain *target);
202+ struct generic_pm_domain *subdomain);
203203 int pm_genpd_init(struct generic_pm_domain *genpd,
204204 struct dev_power_governor *gov, bool is_off);
205205 int pm_genpd_remove(struct generic_pm_domain *genpd);
@@ -226,12 +226,12 @@ static inline int pm_genpd_remove_device(struct device *dev) · 20 unmodified lines
226226 return -ENOSYS;
227227 }
228228 static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
229− struct generic_pm_domain *new_sd)
229+ struct generic_pm_domain *subdomain)
230230 {
231231 return -ENOSYS;
232232 }
233233 static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
234− struct generic_pm_domain *target)
234+ struct generic_pm_domain *subdomain)
235235 {
236236 return -ENOSYS;
237237 }
@@ -282,8 +282,8 @@ int of_genpd_add_provider_onecell(struct device_node *np, · 44 unmodified lines
282282 struct genpd_onecell_data *data);
283283 void of_genpd_del_provider(struct device_node *np);
284284 int of_genpd_add_device(struct of_phandle_args *args, struct device *dev);
285−int of_genpd_add_subdomain(struct of_phandle_args *parent,
286− struct of_phandle_args *new_subdomain);
285+int of_genpd_add_subdomain(struct of_phandle_args *parent_spec,
286+ struct of_phandle_args *subdomain_spec);
287287 struct generic_pm_domain *of_genpd_remove_last(struct device_node *np);
288288 int of_genpd_parse_idle_states(struct device_node *dn,
289289 struct genpd_power_state **states, int *n);
@@ -316,8 +316,8 @@ static inline int of_genpd_add_device(struct of_phandle_args *args, · 26 unmodified lines
316316 return -ENODEV;
317317 }
318318
319−static inline int of_genpd_add_subdomain(struct of_phandle_args *parent,
320− struct of_phandle_args *new_subdomain)
319+static inline int of_genpd_add_subdomain(struct of_phandle_args *parent_spec,
320+ struct of_phandle_args *subdomain_spec)
321321 {
322322 return -ENODEV;
323323 }
include/linux/pm_opp.h+10−2
@@ -96,6 +96,8 @@ unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev); · 95 unmodified lines
9696 struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
9797 unsigned long freq,
9898 bool available);
99+struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev,
100+ unsigned int level);
99101
100102 struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
101103 unsigned long *freq);
@@ -128,7 +130,7 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char * name); · 26 unmodified lines
128130 void dev_pm_opp_put_clkname(struct opp_table *opp_table);
129131 struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data));
130132 void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table);
131−struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names);
133+struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs);
132134 void dev_pm_opp_detach_genpd(struct opp_table *opp_table);
133135 int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate);
134136 int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq);
@@ -200,6 +202,12 @@ static inline struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev, · 65 unmodified lines
200202 return ERR_PTR(-ENOTSUPP);
201203 }
202204
205+static inline struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev,
206+ unsigned int level)
207+{
208+ return ERR_PTR(-ENOTSUPP);
209+}
210+
203211 static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
204212 unsigned long *freq)
205213 {
@@ -292,7 +300,7 @@ static inline struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const · 86 unmodified lines
292300
293301 static inline void dev_pm_opp_put_clkname(struct opp_table *opp_table) {}
294302
295−static inline struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names)
303+static inline struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs)
296304 {
297305 return ERR_PTR(-ENOTSUPP);
298306 }
include/linux/pm_qos.h+0−6
@@ -13,9 +13,6 @@ · 12 unmodified lines
1313 enum {
1414 PM_QOS_RESERVED = 0,
1515 PM_QOS_CPU_DMA_LATENCY,
16− PM_QOS_NETWORK_LATENCY,
17− PM_QOS_NETWORK_THROUGHPUT,
18− PM_QOS_MEMORY_BANDWIDTH,
1916
2017 /* insert new class ID */
2118 PM_QOS_NUM_CLASSES,
@@ -33,9 +30,6 @@ enum pm_qos_flags_status { · 11 unmodified lines
3330 #define PM_QOS_LATENCY_ANY_NS ((s64)PM_QOS_LATENCY_ANY * NSEC_PER_USEC)
3431
3532 #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
36−#define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
37−#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0
38−#define PM_QOS_MEMORY_BANDWIDTH_DEFAULT_VALUE 0
3933 #define PM_QOS_RESUME_LATENCY_DEFAULT_VALUE PM_QOS_LATENCY_ANY
4034 #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT PM_QOS_LATENCY_ANY
4135 #define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT_NS PM_QOS_LATENCY_ANY_NS
include/linux/pm_wakeup.h+8−13
@@ -21,6 +21,7 @@ struct wake_irq; · 20 unmodified lines
2121 * struct wakeup_source - Representation of wakeup sources
2222 *
2323 * @name: Name of the wakeup source
24+ * @id: Wakeup source id
2425 * @entry: Wakeup source list entry
2526 * @lock: Wakeup source lock
2627 * @wakeirq: Optional device specific wakeirq
@@ -35,11 +36,13 @@ struct wake_irq; · 8 unmodified lines
3536 * @relax_count: Number of times the wakeup source was deactivated.
3637 * @expire_count: Number of times the wakeup source's timeout has expired.
3738 * @wakeup_count: Number of times the wakeup source might abort suspend.
39+ * @dev: Struct device for sysfs statistics about the wakeup source.
3840 * @active: Status of the wakeup source.
3941 * @autosleep_enabled: Autosleep is active, so update @prevent_sleep_time.
4042 */
4143 struct wakeup_source {
4244 const char *name;
45+ int id;
4346 struct list_head entry;
4447 spinlock_t lock;
4548 struct wake_irq *wakeirq;
@@ -55,6 +58,7 @@ struct wakeup_source { · 9 unmodified lines
5558 unsigned long relax_count;
5659 unsigned long expire_count;
5760 unsigned long wakeup_count;
61+ struct device *dev;
5862 bool active:1;
5963 bool autosleep_enabled:1;
6064 };
@@ -81,12 +85,12 @@ static inline void device_set_wakeup_path(struct device *dev) · 20 unmodified lines
8185 }
8286
8387 /* drivers/base/power/wakeup.c */
84−extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name);
8588 extern struct wakeup_source *wakeup_source_create(const char *name);
8689 extern void wakeup_source_destroy(struct wakeup_source *ws);
8790 extern void wakeup_source_add(struct wakeup_source *ws);
8891 extern void wakeup_source_remove(struct wakeup_source *ws);
89−extern struct wakeup_source *wakeup_source_register(const char *name);
92+extern struct wakeup_source *wakeup_source_register(struct device *dev,
93+ const char *name);
9094 extern void wakeup_source_unregister(struct wakeup_source *ws);
9195 extern int device_wakeup_enable(struct device *dev);
9296 extern int device_wakeup_disable(struct device *dev);
@@ -112,9 +116,6 @@ static inline bool device_can_wakeup(struct device *dev) · 19 unmodified lines
112116 return dev->power.can_wakeup;
113117 }
114118
115−static inline void wakeup_source_prepare(struct wakeup_source *ws,
116− const char *name) {}
117−
118119 static inline struct wakeup_source *wakeup_source_create(const char *name)
119120 {
120121 return NULL;
@@ -126,7 +127,8 @@ static inline void wakeup_source_add(struct wakeup_source *ws) {} · 5 unmodified lines
126127
127128 static inline void wakeup_source_remove(struct wakeup_source *ws) {}
128129
129−static inline struct wakeup_source *wakeup_source_register(const char *name)
130+static inline struct wakeup_source *wakeup_source_register(struct device *dev,
131+ const char *name)
130132 {
131133 return NULL;
132134 }
@@ -181,13 +183,6 @@ static inline void pm_wakeup_dev_event(struct device *dev, unsigned int msec, · 48 unmodified lines
181183
182184 #endif /* !CONFIG_PM_SLEEP */
183185
184−static inline void wakeup_source_init(struct wakeup_source *ws,
185− const char *name)
186−{
187− wakeup_source_prepare(ws, name);
188− wakeup_source_add(ws);
189−}
190−
191186 static inline void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec)
192187 {
193188 return pm_wakeup_ws_event(ws, msec, false);
include/linux/posix-timers.h+117−14
@@ -4,18 +4,11 @@ · 3 unmodified lines
44
55 #include <linux/spinlock.h>
66 #include <linux/list.h>
7−#include <linux/sched.h>
8−#include <linux/timex.h>
97 #include <linux/alarmtimer.h>
8+#include <linux/timerqueue.h>
109
11−struct siginfo;
12−
13−struct cpu_timer_list {
14− struct list_head entry;
15− u64 expires;
16− struct task_struct *task;
17− int firing;
18−};
10+struct kernel_siginfo;
11+struct task_struct;
1912
2013 /*
2114 * Bit fields within a clockid:
@@ -63,6 +56,115 @@ static inline int clockid_to_fd(const clockid_t clk) · 41 unmodified lines
6356 return ~(clk >> 3);
6457 }
6558
59+#ifdef CONFIG_POSIX_TIMERS
60+
61+/**
62+ * cpu_timer - Posix CPU timer representation for k_itimer
63+ * @node: timerqueue node to queue in the task/sig
64+ * @head: timerqueue head on which this timer is queued
65+ * @task: Pointer to target task
66+ * @elist: List head for the expiry list
67+ * @firing: Timer is currently firing
68+ */
69+struct cpu_timer {
70+ struct timerqueue_node node;
71+ struct timerqueue_head *head;
72+ struct task_struct *task;
73+ struct list_head elist;
74+ int firing;
75+};
76+
77+static inline bool cpu_timer_enqueue(struct timerqueue_head *head,
78+ struct cpu_timer *ctmr)
79+{
80+ ctmr->head = head;
81+ return timerqueue_add(head, &ctmr->node);
82+}
83+
84+static inline void cpu_timer_dequeue(struct cpu_timer *ctmr)
85+{
86+ if (ctmr->head) {
87+ timerqueue_del(ctmr->head, &ctmr->node);
88+ ctmr->head = NULL;
89+ }
90+}
91+
92+static inline u64 cpu_timer_getexpires(struct cpu_timer *ctmr)
93+{
94+ return ctmr->node.expires;
95+}
96+
97+static inline void cpu_timer_setexpires(struct cpu_timer *ctmr, u64 exp)
98+{
99+ ctmr->node.expires = exp;
100+}
101+
102+/**
103+ * posix_cputimer_base - Container per posix CPU clock
104+ * @nextevt: Earliest-expiration cache
105+ * @tqhead: timerqueue head for cpu_timers
106+ */
107+struct posix_cputimer_base {
108+ u64 nextevt;
109+ struct timerqueue_head tqhead;
110+};
111+
112+/**
113+ * posix_cputimers - Container for posix CPU timer related data
114+ * @bases: Base container for posix CPU clocks
115+ * @timers_active: Timers are queued.
116+ * @expiry_active: Timer expiry is active. Used for
117+ * process wide timers to avoid multiple
118+ * task trying to handle expiry concurrently
119+ *
120+ * Used in task_struct and signal_struct
121+ */
122+struct posix_cputimers {
123+ struct posix_cputimer_base bases[CPUCLOCK_MAX];
124+ unsigned int timers_active;
125+ unsigned int expiry_active;
126+};
127+
128+static inline void posix_cputimers_init(struct posix_cputimers *pct)
129+{
130+ memset(pct, 0, sizeof(*pct));
131+ pct->bases[0].nextevt = U64_MAX;
132+ pct->bases[1].nextevt = U64_MAX;
133+ pct->bases[2].nextevt = U64_MAX;
134+}
135+
136+void posix_cputimers_group_init(struct posix_cputimers *pct, u64 cpu_limit);
137+
138+static inline void posix_cputimers_rt_watchdog(struct posix_cputimers *pct,
139+ u64 runtime)
140+{
141+ pct->bases[CPUCLOCK_SCHED].nextevt = runtime;
142+}
143+
144+/* Init task static initializer */
145+#define INIT_CPU_TIMERBASE(b) { \
146+ .nextevt = U64_MAX, \
147+}
148+
149+#define INIT_CPU_TIMERBASES(b) { \
150+ INIT_CPU_TIMERBASE(b[0]), \
151+ INIT_CPU_TIMERBASE(b[1]), \
152+ INIT_CPU_TIMERBASE(b[2]), \
153+}
154+
155+#define INIT_CPU_TIMERS(s) \
156+ .posix_cputimers = { \
157+ .bases = INIT_CPU_TIMERBASES(s.posix_cputimers.bases), \
158+ },
159+#else
160+struct posix_cputimers { };
161+struct cpu_timer { };
162+#define INIT_CPU_TIMERS(s)
163+static inline void posix_cputimers_init(struct posix_cputimers *pct) { }
164+static inline void posix_cputimers_group_init(struct posix_cputimers *pct,
165+ u64 cpu_limit) { }
166+#endif
167+
66168 #define REQUEUE_PENDING 1
67169
68170 /**
@@ -85,7 +187,8 @@ static inline int clockid_to_fd(const clockid_t clk) · 16 unmodified lines
85187 * @it_process: The task to wakeup on clock_nanosleep (CPU timers)
86188 * @sigq: Pointer to preallocated sigqueue
87189 * @it: Union representing the various posix timer type
88− * internals. Also used for rcu freeing the timer.
190+ * internals.
191+ * @rcu: RCU head for freeing the timer.
89192 */
90193 struct k_itimer {
91194 struct list_head list;
@@ -110,15 +213,15 @@ struct k_itimer { · 18 unmodified lines
110213 struct {
111214 struct hrtimer timer;
112215 } real;
113− struct cpu_timer_list cpu;
216+ struct cpu_timer cpu;
114217 struct {
115218 struct alarm alarmtimer;
116219 } alarm;
117− struct rcu_head rcu;
118220 } it;
221+ struct rcu_head rcu;
119222 };
120223
121−void run_posix_cpu_timers(struct task_struct *task);
224+void run_posix_cpu_timers(void);
122225 void posix_cpu_timers_exit(struct task_struct *task);
123226 void posix_cpu_timers_exit_group(struct task_struct *task);
124227 void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx,
include/linux/preempt.h+3−3
@@ -182,7 +182,7 @@ do { \ · 181 unmodified lines
182182
183183 #define preemptible() (preempt_count() == 0 && !irqs_disabled())
184184
185−#ifdef CONFIG_PREEMPT
185+#ifdef CONFIG_PREEMPTION
186186 #define preempt_enable() \
187187 do { \
188188 barrier(); \
@@ -203,7 +203,7 @@ do { \ · 14 unmodified lines
203203 __preempt_schedule(); \
204204 } while (0)
205205
206−#else /* !CONFIG_PREEMPT */
206+#else /* !CONFIG_PREEMPTION */
207207 #define preempt_enable() \
208208 do { \
209209 barrier(); \
@@ -217,7 +217,7 @@ do { \ · 7 unmodified lines
217217 } while (0)
218218
219219 #define preempt_check_resched() do { } while (0)
220−#endif /* CONFIG_PREEMPT */
220+#endif /* CONFIG_PREEMPTION */
221221
222222 #define preempt_disable_notrace() \
223223 do { \
include/linux/printk.h+15−7
@@ -488,13 +488,6 @@ extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, · 487 unmodified lines
488488 extern void print_hex_dump(const char *level, const char *prefix_str,
489489 int prefix_type, int rowsize, int groupsize,
490490 const void *buf, size_t len, bool ascii);
491−#if defined(CONFIG_DYNAMIC_DEBUG)
492−#define print_hex_dump_bytes(prefix_str, prefix_type, buf, len) \
493− dynamic_hex_dump(prefix_str, prefix_type, 16, 1, buf, len, true)
494−#else
495−extern void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
496− const void *buf, size_t len);
497−#endif /* defined(CONFIG_DYNAMIC_DEBUG) */
498491 #else
499492 static inline void print_hex_dump(const char *level, const char *prefix_str,
500493 int prefix_type, int rowsize, int groupsize,
@@ -526,4 +519,19 @@ static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type, · 25 unmodified lines
526519 }
527520 #endif
528521
522+/**
523+ * print_hex_dump_bytes - shorthand form of print_hex_dump() with default params
524+ * @prefix_str: string to prefix each line with;
525+ * caller supplies trailing spaces for alignment if desired
526+ * @prefix_type: controls whether prefix of an offset, address, or none
527+ * is printed (%DUMP_PREFIX_OFFSET, %DUMP_PREFIX_ADDRESS, %DUMP_PREFIX_NONE)
528+ * @buf: data blob to dump
529+ * @len: number of bytes in the @buf
530+ *
531+ * Calls print_hex_dump(), with log level of KERN_DEBUG,
532+ * rowsize of 16, groupsize of 1, and ASCII output included.
533+ */
534+#define print_hex_dump_bytes(prefix_str, prefix_type, buf, len) \
535+ print_hex_dump_debug(prefix_str, prefix_type, 16, 1, buf, len, true)
536+
529537 #endif
include/linux/property.h+4−0
@@ -421,6 +421,10 @@ bool is_software_node(const struct fwnode_handle *fwnode); · 420 unmodified lines
421421 const struct software_node *to_software_node(struct fwnode_handle *fwnode);
422422 struct fwnode_handle *software_node_fwnode(const struct software_node *node);
423423
424+const struct software_node *
425+software_node_find_by_name(const struct software_node *parent,
426+ const char *name);
427+
424428 int software_node_register_nodes(const struct software_node *nodes);
425429 void software_node_unregister_nodes(const struct software_node *nodes);
426430
include/linux/psci.h+2−2
@@ -15,8 +15,8 @@ · 14 unmodified lines
1515
1616 bool psci_tos_resident_on(int cpu);
1717
18−int psci_cpu_init_idle(unsigned int cpu);
19−int psci_cpu_suspend_enter(unsigned long index);
18+int psci_cpu_suspend_enter(u32 state);
19+bool psci_power_state_is_valid(u32 state);
2020
2121 enum psci_conduit {
2222 PSCI_CONDUIT_NONE,
include/linux/pwm.h+2−2
@@ -262,7 +262,7 @@ struct pwm_ops { · 261 unmodified lines
262262 int (*capture)(struct pwm_chip *chip, struct pwm_device *pwm,
263263 struct pwm_capture *result, unsigned long timeout);
264264 int (*apply)(struct pwm_chip *chip, struct pwm_device *pwm,
265− struct pwm_state *state);
265+ const struct pwm_state *state);
266266 void (*get_state)(struct pwm_chip *chip, struct pwm_device *pwm,
267267 struct pwm_state *state);
268268 struct module *owner;
@@ -316,7 +316,7 @@ struct pwm_capture { · 47 unmodified lines
316316 /* PWM user APIs */
317317 struct pwm_device *pwm_request(int pwm_id, const char *label);
318318 void pwm_free(struct pwm_device *pwm);
319−int pwm_apply_state(struct pwm_device *pwm, struct pwm_state *state);
319+int pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state);
320320 int pwm_adjust_config(struct pwm_device *pwm);
321321
322322 /**
include/linux/qcom_scm.h+5−4
@@ -49,8 +49,9 @@ extern int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, · 48 unmodified lines
4949 extern int qcom_scm_pas_auth_and_reset(u32 peripheral);
5050 extern int qcom_scm_pas_shutdown(u32 peripheral);
5151 extern int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
52− unsigned int *src, struct qcom_scm_vmperm *newvm,
53− int dest_cnt);
52+ unsigned int *src,
53+ const struct qcom_scm_vmperm *newvm,
54+ unsigned int dest_cnt);
5455 extern void qcom_scm_cpu_power_down(u32 flags);
5556 extern u32 qcom_scm_get_version(void);
5657 extern int qcom_scm_set_remote_state(u32 state, u32 id);
@@ -87,8 +88,8 @@ qcom_scm_pas_auth_and_reset(u32 peripheral) { return -ENODEV; } · 30 unmodified lines
8788 static inline int qcom_scm_pas_shutdown(u32 peripheral) { return -ENODEV; }
8889 static inline int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
8990 unsigned int *src,
90− struct qcom_scm_vmperm *newvm,
91− int dest_cnt) { return -ENODEV; }
91+ const struct qcom_scm_vmperm *newvm,
92+ unsigned int dest_cnt) { return -ENODEV; }
9293 static inline void qcom_scm_cpu_power_down(u32 flags) {}
9394 static inline u32 qcom_scm_get_version(void) { return 0; }
9495 static inline u32
include/linux/qed/qed_if.h+30−1
@@ -689,7 +689,7 @@ enum qed_link_mode_bits { · 688 unmodified lines
689689 QED_LM_40000baseLR4_Full_BIT = BIT(9),
690690 QED_LM_50000baseKR2_Full_BIT = BIT(10),
691691 QED_LM_100000baseKR4_Full_BIT = BIT(11),
692− QED_LM_2500baseX_Full_BIT = BIT(12),
692+ QED_LM_TP_BIT = BIT(12),
693693 QED_LM_Backplane_BIT = BIT(13),
694694 QED_LM_1000baseKX_Full_BIT = BIT(14),
695695 QED_LM_10000baseKX4_Full_BIT = BIT(15),
@@ -804,6 +804,7 @@ enum qed_nvm_flash_cmd { · 108 unmodified lines
804804 QED_NVM_FLASH_CMD_FILE_DATA = 0x2,
805805 QED_NVM_FLASH_CMD_FILE_START = 0x3,
806806 QED_NVM_FLASH_CMD_NVM_CHANGE = 0x4,
807+ QED_NVM_FLASH_CMD_NVM_CFG_ID = 0x5,
807808 QED_NVM_FLASH_CMD_NVM_MAX,
808809 };
809810
@@ -1131,6 +1132,34 @@ struct qed_common_ops { · 321 unmodified lines
11311132 * @param cdev
11321133 */
11331134 u8 (*get_affin_hwfn_idx)(struct qed_dev *cdev);
1135+
1136+/**
1137+ * @brief read_nvm_cfg - Read NVM config attribute value.
1138+ * @param cdev
1139+ * @param buf - buffer
1140+ * @param cmd - NVM CFG command id
1141+ * @param entity_id - Entity id
1142+ *
1143+ */
1144+ int (*read_nvm_cfg)(struct qed_dev *cdev, u8 **buf, u32 cmd,
1145+ u32 entity_id);
1146+/**
1147+ * @brief read_nvm_cfg - Read NVM config attribute value.
1148+ * @param cdev
1149+ * @param cmd - NVM CFG command id
1150+ *
1151+ * @return config id length, 0 on error.
1152+ */
1153+ int (*read_nvm_cfg_len)(struct qed_dev *cdev, u32 cmd);
1154+
1155+/**
1156+ * @brief set_grc_config - Configure value for grc config id.
1157+ * @param cdev
1158+ * @param cfg_id - grc config id
1159+ * @param val - grc config value
1160+ *
1161+ */
1162+ int (*set_grc_config)(struct qed_dev *cdev, u32 cfg_id, u32 val);
11341163 };
11351164
11361165 #define MASK_FIELD(_name, _value) \
include/linux/qed/qed_rdma_if.h+1−1
@@ -225,7 +225,7 @@ struct qed_rdma_start_in_params { · 224 unmodified lines
225225
226226 struct qed_rdma_add_user_out_params {
227227 u16 dpi;
228− u64 dpi_addr;
228+ void __iomem *dpi_addr;
229229 u64 dpi_phys_addr;
230230 u32 dpi_size;
231231 u16 wid_count;
include/linux/quicklist.h+0−94
@@ -1,94 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef LINUX_QUICKLIST_H
3−#define LINUX_QUICKLIST_H
4−/*
5− * Fast allocations and disposal of pages. Pages must be in the condition
6− * as needed after allocation when they are freed. Per cpu lists of pages
7− * are kept that only contain node local pages.
8− *
9− * (C) 2007, SGI. Christoph Lameter <cl@linux.com>
10− */
11−#include <linux/kernel.h>
12−#include <linux/gfp.h>
13−#include <linux/percpu.h>
14−
15−#ifdef CONFIG_QUICKLIST
16−
17−struct quicklist {
18− void *page;
19− int nr_pages;
20−};
21−
22−DECLARE_PER_CPU(struct quicklist, quicklist)[CONFIG_NR_QUICK];
23−
24−/*
25− * The two key functions quicklist_alloc and quicklist_free are inline so
26− * that they may be custom compiled for the platform.
27− * Specifying a NULL ctor can remove constructor support. Specifying
28− * a constant quicklist allows the determination of the exact address
29− * in the per cpu area.
30− *
31− * The fast patch in quicklist_alloc touched only a per cpu cacheline and
32− * the first cacheline of the page itself. There is minmal overhead involved.
33− */
34−static inline void *quicklist_alloc(int nr, gfp_t flags, void (*ctor)(void *))
35−{
36− struct quicklist *q;
37− void **p = NULL;
38−
39− q =&get_cpu_var(quicklist)[nr];
40− p = q->page;
41− if (likely(p)) {
42− q->page = p[0];
43− p[0] = NULL;
44− q->nr_pages--;
45− }
46− put_cpu_var(quicklist);
47− if (likely(p))
48− return p;
49−
50− p = (void *)__get_free_page(flags | __GFP_ZERO);
51− if (ctor && p)
52− ctor(p);
53− return p;
54−}
55−
56−static inline void __quicklist_free(int nr, void (*dtor)(void *), void *p,
57− struct page *page)
58−{
59− struct quicklist *q;
60−
61− q = &get_cpu_var(quicklist)[nr];
62− *(void **)p = q->page;
63− q->page = p;
64− q->nr_pages++;
65− put_cpu_var(quicklist);
66−}
67−
68−static inline void quicklist_free(int nr, void (*dtor)(void *), void *pp)
69−{
70− __quicklist_free(nr, dtor, pp, virt_to_page(pp));
71−}
72−
73−static inline void quicklist_free_page(int nr, void (*dtor)(void *),
74− struct page *page)
75−{
76− __quicklist_free(nr, dtor, page_address(page), page);
77−}
78−
79−void quicklist_trim(int nr, void (*dtor)(void *),
80− unsigned long min_pages, unsigned long max_free);
81−
82−unsigned long quicklist_total_size(void);
83−
84−#else
85−
86−static inline unsigned long quicklist_total_size(void)
87−{
88− return 0;
89−}
90−
91−#endif
92−
93−#endif /* LINUX_QUICKLIST_H */
94−
include/linux/quotaops.h+1−1
@@ -22,7 +22,7 @@ static inline struct quota_info *sb_dqopt(struct super_block *sb) · 21 unmodified lines
2222 /* i_mutex must being held */
2323 static inline bool is_quota_modification(struct inode *inode, struct iattr *ia)
2424 {
25− return (ia->ia_valid & ATTR_SIZE && ia->ia_size != inode->i_size) ||
25+ return (ia->ia_valid & ATTR_SIZE) ||
2626 (ia->ia_valid & ATTR_UID && !uid_eq(ia->ia_uid, inode->i_uid)) ||
2727 (ia->ia_valid & ATTR_GID && !gid_eq(ia->ia_gid, inode->i_gid));
2828 }
include/linux/ramfs.h+2−4
@@ -4,8 +4,7 @@ · 3 unmodified lines
44
55 struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
66 umode_t mode, dev_t dev);
7−extern struct dentry *ramfs_mount(struct file_system_type *fs_type,
8− int flags, const char *dev_name, void *data);
7+extern int ramfs_init_fs_context(struct fs_context *fc);
98
109 #ifdef CONFIG_MMU
1110 static inline int
@@ -17,9 +16,8 @@ ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) · 5 unmodified lines
1716 extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize);
1817 #endif
1918
19+extern const struct fs_parameter_description ramfs_fs_parameters;
2020 extern const struct file_operations ramfs_file_operations;
2121 extern const struct vm_operations_struct generic_file_vm_ops;
2222
23−int ramfs_fill_super(struct super_block *sb, void *data, int silent);
24−
2523 #endif
include/linux/random.h+1−0
@@ -19,6 +19,7 @@ struct random_ready_callback { · 18 unmodified lines
1919 };
2020
2121 extern void add_device_randomness(const void *, unsigned int);
22+extern void add_bootloader_randomness(const void *, unsigned int);
2223
2324 #if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__)
2425 static inline void add_latent_entropy(void)
include/linux/rbtree_augmented.h+67−21
@@ -60,41 +60,87 @@ rb_insert_augmented_cached(struct rb_node *node, · 59 unmodified lines
6060 rb_insert_augmented(node, &root->rb_root, augment);
6161 }
6262
63−#define RB_DECLARE_CALLBACKS(rbstatic, rbname, rbstruct, rbfield, \
64− rbtype, rbaugmented, rbcompute) \
63+/*
64+ * Template for declaring augmented rbtree callbacks (generic case)
65+ *
66+ * RBSTATIC: 'static' or empty
67+ * RBNAME: name of the rb_augment_callbacks structure
68+ * RBSTRUCT: struct type of the tree nodes
69+ * RBFIELD: name of struct rb_node field within RBSTRUCT
70+ * RBAUGMENTED: name of field within RBSTRUCT holding data for subtree
71+ * RBCOMPUTE: name of function that recomputes the RBAUGMENTED data
72+ */
73+
74+#define RB_DECLARE_CALLBACKS(RBSTATIC, RBNAME, \
75+ RBSTRUCT, RBFIELD, RBAUGMENTED, RBCOMPUTE) \
6576 static inline void \
66−rbname ## _propagate(struct rb_node *rb, struct rb_node *stop) \
77+RBNAME ## _propagate(struct rb_node *rb, struct rb_node *stop) \
6778 { \
6879 while (rb != stop) { \
69− rbstruct *node = rb_entry(rb, rbstruct, rbfield); \
70− rbtype augmented = rbcompute(node); \
71− if (node->rbaugmented == augmented) \
80+ RBSTRUCT *node = rb_entry(rb, RBSTRUCT, RBFIELD); \
81+ if (RBCOMPUTE(node, true)) \
7282 break; \
73− node->rbaugmented = augmented; \
74− rb = rb_parent(&node->rbfield); \
83+ rb = rb_parent(&node->RBFIELD); \
7584 } \
7685 } \
7786 static inline void \
78−rbname ## _copy(struct rb_node *rb_old, struct rb_node *rb_new) \
87+RBNAME ## _copy(struct rb_node *rb_old, struct rb_node *rb_new) \
7988 { \
80− rbstruct *old = rb_entry(rb_old, rbstruct, rbfield); \
81− rbstruct *new = rb_entry(rb_new, rbstruct, rbfield); \
82− new->rbaugmented = old->rbaugmented; \
89+ RBSTRUCT *old = rb_entry(rb_old, RBSTRUCT, RBFIELD); \
90+ RBSTRUCT *new = rb_entry(rb_new, RBSTRUCT, RBFIELD); \
91+ new->RBAUGMENTED = old->RBAUGMENTED; \
8392 } \
8493 static void \
85−rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new) \
94+RBNAME ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new) \
8695 { \
87− rbstruct *old = rb_entry(rb_old, rbstruct, rbfield); \
88− rbstruct *new = rb_entry(rb_new, rbstruct, rbfield); \
89− new->rbaugmented = old->rbaugmented; \
90− old->rbaugmented = rbcompute(old); \
96+ RBSTRUCT *old = rb_entry(rb_old, RBSTRUCT, RBFIELD); \
97+ RBSTRUCT *new = rb_entry(rb_new, RBSTRUCT, RBFIELD); \
98+ new->RBAUGMENTED = old->RBAUGMENTED; \
99+ RBCOMPUTE(old, false); \
91100 } \
92−rbstatic const struct rb_augment_callbacks rbname = { \
93− .propagate = rbname ## _propagate, \
94− .copy = rbname ## _copy, \
95− .rotate = rbname ## _rotate \
101+RBSTATIC const struct rb_augment_callbacks RBNAME = { \
102+ .propagate = RBNAME ## _propagate, \
103+ .copy = RBNAME ## _copy, \
104+ .rotate = RBNAME ## _rotate \
96105 };
97106
107+/*
108+ * Template for declaring augmented rbtree callbacks,
109+ * computing RBAUGMENTED scalar as max(RBCOMPUTE(node)) for all subtree nodes.
110+ *
111+ * RBSTATIC: 'static' or empty
112+ * RBNAME: name of the rb_augment_callbacks structure
113+ * RBSTRUCT: struct type of the tree nodes
114+ * RBFIELD: name of struct rb_node field within RBSTRUCT
115+ * RBTYPE: type of the RBAUGMENTED field
116+ * RBAUGMENTED: name of RBTYPE field within RBSTRUCT holding data for subtree
117+ * RBCOMPUTE: name of function that returns the per-node RBTYPE scalar
118+ */
119+
120+#define RB_DECLARE_CALLBACKS_MAX(RBSTATIC, RBNAME, RBSTRUCT, RBFIELD, \
121+ RBTYPE, RBAUGMENTED, RBCOMPUTE) \
122+static inline bool RBNAME ## _compute_max(RBSTRUCT *node, bool exit) \
123+{ \
124+ RBSTRUCT *child; \
125+ RBTYPE max = RBCOMPUTE(node); \
126+ if (node->RBFIELD.rb_left) { \
127+ child = rb_entry(node->RBFIELD.rb_left, RBSTRUCT, RBFIELD); \
128+ if (child->RBAUGMENTED > max) \
129+ max = child->RBAUGMENTED; \
130+ } \
131+ if (node->RBFIELD.rb_right) { \
132+ child = rb_entry(node->RBFIELD.rb_right, RBSTRUCT, RBFIELD); \
133+ if (child->RBAUGMENTED > max) \
134+ max = child->RBAUGMENTED; \
135+ } \
136+ if (exit && node->RBAUGMENTED == max) \
137+ return true; \
138+ node->RBAUGMENTED = max; \
139+ return false; \
140+} \
141+RB_DECLARE_CALLBACKS(RBSTATIC, RBNAME, \
142+ RBSTRUCT, RBFIELD, RBAUGMENTED, RBNAME ## _compute_max)
143+
98144
99145 #define RB_RED 0
100146 #define RB_BLACK 1
include/linux/rcu_segcblist.h+9−0
@@ -14,6 +14,9 @@ · 13 unmodified lines
1414 #ifndef __INCLUDE_LINUX_RCU_SEGCBLIST_H
1515 #define __INCLUDE_LINUX_RCU_SEGCBLIST_H
1616
17+#include <linux/types.h>
18+#include <linux/atomic.h>
19+
1720 /* Simple unsegmented callback lists. */
1821 struct rcu_cblist {
1922 struct rcu_head *head;
@@ -65,8 +68,14 @@ struct rcu_segcblist { · 45 unmodified lines
6568 struct rcu_head *head;
6669 struct rcu_head **tails[RCU_CBLIST_NSEGS];
6770 unsigned long gp_seq[RCU_CBLIST_NSEGS];
71+#ifdef CONFIG_RCU_NOCB_CPU
72+ atomic_long_t len;
73+#else
6874 long len;
75+#endif
6976 long len_lazy;
77+ u8 enabled;
78+ u8 offloaded;
7079 };
7180
7281 #define RCU_SEGCBLIST_INITIALIZER(n) \
include/linux/rcu_sync.h+1−3
@@ -31,9 +31,7 @@ struct rcu_sync { · 30 unmodified lines
3131 */
3232 static inline bool rcu_sync_is_idle(struct rcu_sync *rsp)
3333 {
34− RCU_LOCKDEP_WARN(!rcu_read_lock_held() &&
35− !rcu_read_lock_bh_held() &&
36− !rcu_read_lock_sched_held(),
34+ RCU_LOCKDEP_WARN(!rcu_read_lock_any_held(),
3735 "suspicious rcu_sync_is_idle() usage");
3836 return !READ_ONCE(rsp->gp_state); /* GP_IDLE */
3937 }
include/linux/rculist.h+29−7
@@ -40,6 +40,24 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list) · 39 unmodified lines
4040 */
4141 #define list_next_rcu(list) (*((struct list_head __rcu **)(&(list)->next)))
4242
43+/*
44+ * Check during list traversal that we are within an RCU reader
45+ */
46+
47+#define check_arg_count_one(dummy)
48+
49+#ifdef CONFIG_PROVE_RCU_LIST
50+#define __list_check_rcu(dummy, cond, extra...) \
51+ ({ \
52+ check_arg_count_one(extra); \
53+ RCU_LOCKDEP_WARN(!cond && !rcu_read_lock_any_held(), \
54+ "RCU-list traversed in non-reader section!"); \
55+ })
56+#else
57+#define __list_check_rcu(dummy, cond, extra...) \
58+ ({ check_arg_count_one(extra); })
59+#endif
60+
4361 /*
4462 * Insert a new entry between two known consecutive entries.
4563 *
@@ -343,14 +361,16 @@ static inline void list_splice_tail_init_rcu(struct list_head *list, · 297 unmodified lines
343361 * @pos: the type * to use as a loop cursor.
344362 * @head: the head for your list.
345363 * @member: the name of the list_head within the struct.
364+ * @cond: optional lockdep expression if called from non-RCU protection.
346365 *
347366 * This list-traversal primitive may safely run concurrently with
348367 * the _rcu list-mutation primitives such as list_add_rcu()
349368 * as long as the traversal is guarded by rcu_read_lock().
350369 */
351−#define list_for_each_entry_rcu(pos, head, member) \
352− for (pos = list_entry_rcu((head)->next, typeof(*pos), member); \
353− &pos->member != (head); \
370+#define list_for_each_entry_rcu(pos, head, member, cond...) \
371+ for (__list_check_rcu(dummy, ## cond, 0), \
372+ pos = list_entry_rcu((head)->next, typeof(*pos), member); \
373+ &pos->member != (head); \
354374 pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
355375
356376 /**
@@ -616,13 +636,15 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, · 259 unmodified lines
616636 * @pos: the type * to use as a loop cursor.
617637 * @head: the head for your list.
618638 * @member: the name of the hlist_node within the struct.
639+ * @cond: optional lockdep expression if called from non-RCU protection.
619640 *
620641 * This list-traversal primitive may safely run concurrently with
621642 * the _rcu list-mutation primitives such as hlist_add_head_rcu()
622643 * as long as the traversal is guarded by rcu_read_lock().
623644 */
624−#define hlist_for_each_entry_rcu(pos, head, member) \
625− for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\
645+#define hlist_for_each_entry_rcu(pos, head, member, cond...) \
646+ for (__list_check_rcu(dummy, ## cond, 0), \
647+ pos = hlist_entry_safe(rcu_dereference_raw(hlist_first_rcu(head)),\
626648 typeof(*(pos)), member); \
627649 pos; \
628650 pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(\
@@ -642,10 +664,10 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, · 13 unmodified lines
642664 * not do any RCU debugging or tracing.
643665 */
644666 #define hlist_for_each_entry_rcu_notrace(pos, head, member) \
645− for (pos = hlist_entry_safe (rcu_dereference_raw_notrace(hlist_first_rcu(head)),\
667+ for (pos = hlist_entry_safe(rcu_dereference_raw_check(hlist_first_rcu(head)),\
646668 typeof(*(pos)), member); \
647669 pos; \
648− pos = hlist_entry_safe(rcu_dereference_raw_notrace(hlist_next_rcu(\
670+ pos = hlist_entry_safe(rcu_dereference_raw_check(hlist_next_rcu(\
649671 &(pos)->member)), typeof(*(pos)), member))
650672
651673 /**
include/linux/rcupdate.h+9−2
@@ -221,6 +221,7 @@ int debug_lockdep_rcu_enabled(void); · 220 unmodified lines
221221 int rcu_read_lock_held(void);
222222 int rcu_read_lock_bh_held(void);
223223 int rcu_read_lock_sched_held(void);
224+int rcu_read_lock_any_held(void);
224225
225226 #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
226227
@@ -241,6 +242,12 @@ static inline int rcu_read_lock_sched_held(void) · 14 unmodified lines
241242 {
242243 return !preemptible();
243244 }
245+
246+static inline int rcu_read_lock_any_held(void)
247+{
248+ return !preemptible();
249+}
250+
244251 #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
245252
246253 #ifdef CONFIG_PROVE_RCU
@@ -476,7 +483,7 @@ do { \ · 229 unmodified lines
476483 * The no-tracing version of rcu_dereference_raw() must not call
477484 * rcu_read_lock_held().
478485 */
479−#define rcu_dereference_raw_notrace(p) __rcu_dereference_check((p), 1, __rcu)
486+#define rcu_dereference_raw_check(p) __rcu_dereference_check((p), 1, __rcu)
480487
481488 /**
482489 * rcu_dereference_protected() - fetch RCU pointer when updates prevented
@@ -578,7 +585,7 @@ do { \ · 95 unmodified lines
578585 *
579586 * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU),
580587 * it is illegal to block while in an RCU read-side critical section.
581− * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPT
588+ * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPTION
582589 * kernel builds, RCU read-side critical sections may be preempted,
583590 * but explicit blocking is illegal. Finally, in preemptible RCU
584591 * implementations in real-time (with -rt patchset) kernel builds, RCU
include/linux/rcutiny.h+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #ifndef __LINUX_TINY_H
1313 #define __LINUX_TINY_H
1414
15−#include <linux/ktime.h>
15+#include <asm/param.h> /* for HZ */
1616
1717 /* Never flag non-existent other CPUs! */
1818 static inline bool rcu_eqs_special_set(int cpu) { return false; }
include/linux/rcutree.h+1−1
@@ -53,7 +53,7 @@ void rcu_scheduler_starting(void); · 52 unmodified lines
5353 extern int rcu_scheduler_active __read_mostly;
5454 void rcu_end_inkernel_boot(void);
5555 bool rcu_is_watching(void);
56−#ifndef CONFIG_PREEMPT
56+#ifndef CONFIG_PREEMPTION
5757 void rcu_all_qs(void);
5858 #endif
5959
include/linux/rcuwait.h+4−16
@@ -6,16 +6,11 @@ · 5 unmodified lines
66
77 /*
88 * rcuwait provides a way of blocking and waking up a single
9− * task in an rcu-safe manner; where it is forbidden to use
10− * after exit_notify(). task_struct is not properly rcu protected,
11− * unless dealing with rcu-aware lists, ie: find_task_by_*().
9+ * task in an rcu-safe manner.
1210 *
13− * Alternatively we have task_rcu_dereference(), but the return
14− * semantics have different implications which would break the
15− * wakeup side. The only time @task is non-nil is when a user is
16− * blocked (or checking if it needs to) on a condition, and reset
17− * as soon as we know that the condition has succeeded and are
18− * awoken.
11+ * The only time @task is non-nil is when a user is blocked (or
12+ * checking if it needs to) on a condition, and reset as soon as we
13+ * know that the condition has succeeded and are awoken.
1914 */
2015 struct rcuwait {
2116 struct task_struct __rcu *task;
@@ -37,13 +32,6 @@ extern void rcuwait_wake_up(struct rcuwait *w); · 15 unmodified lines
3732 */
3833 #define rcuwait_wait_event(w, condition) \
3934 ({ \
40− /* \
41− * Complain if we are called after do_exit()/exit_notify(), \
42− * as we cannot rely on the rcu critical region for the \
43− * wakeup side. \
44− */ \
45− WARN_ON(current->exit_state); \
46− \
4735 rcu_assign_pointer((w)->task, current); \
4836 for (;;) { \
4937 /* \
include/linux/regulator/consumer.h+13−0
@@ -281,6 +281,12 @@ void devm_regulator_unregister_notifier(struct regulator *regulator, · 280 unmodified lines
281281 void *regulator_get_drvdata(struct regulator *regulator);
282282 void regulator_set_drvdata(struct regulator *regulator, void *data);
283283
284+/* misc helpers */
285+
286+void regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers,
287+ const char *const *supply_names,
288+ unsigned int num_supplies);
289+
284290 #else
285291
286292 /*
@@ -580,6 +586,13 @@ static inline int regulator_list_voltage(struct regulator *regulator, unsigned s · 293 unmodified lines
580586 return -EINVAL;
581587 }
582588
589+static inline void
590+regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers,
591+ const char *const *supply_names,
592+ unsigned int num_supplies)
593+{
594+}
595+
583596 #endif
584597
585598 static inline int regulator_set_voltage_triplet(struct regulator *regulator,
include/linux/regulator/mt6358-regulator.h+56−0
@@ -0,0 +1,56 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright (c) 2019 MediaTek Inc.
4+ */
5+
6+#ifndef __LINUX_REGULATOR_MT6358_H
7+#define __LINUX_REGULATOR_MT6358_H
8+
9+enum {
10+ MT6358_ID_VDRAM1 = 0,
11+ MT6358_ID_VCORE,
12+ MT6358_ID_VPA,
13+ MT6358_ID_VPROC11,
14+ MT6358_ID_VPROC12,
15+ MT6358_ID_VGPU,
16+ MT6358_ID_VS2,
17+ MT6358_ID_VMODEM,
18+ MT6358_ID_VS1,
19+ MT6358_ID_VDRAM2 = 9,
20+ MT6358_ID_VSIM1,
21+ MT6358_ID_VIBR,
22+ MT6358_ID_VRF12,
23+ MT6358_ID_VIO18,
24+ MT6358_ID_VUSB,
25+ MT6358_ID_VCAMIO,
26+ MT6358_ID_VCAMD,
27+ MT6358_ID_VCN18,
28+ MT6358_ID_VFE28,
29+ MT6358_ID_VSRAM_PROC11,
30+ MT6358_ID_VCN28,
31+ MT6358_ID_VSRAM_OTHERS,
32+ MT6358_ID_VSRAM_GPU,
33+ MT6358_ID_VXO22,
34+ MT6358_ID_VEFUSE,
35+ MT6358_ID_VAUX18,
36+ MT6358_ID_VMCH,
37+ MT6358_ID_VBIF28,
38+ MT6358_ID_VSRAM_PROC12,
39+ MT6358_ID_VCAMA1,
40+ MT6358_ID_VEMC,
41+ MT6358_ID_VIO28,
42+ MT6358_ID_VA12,
43+ MT6358_ID_VRF18,
44+ MT6358_ID_VCN33_BT,
45+ MT6358_ID_VCN33_WIFI,
46+ MT6358_ID_VCAMA2,
47+ MT6358_ID_VMC,
48+ MT6358_ID_VLDO28,
49+ MT6358_ID_VAUD28,
50+ MT6358_ID_VSIM2,
51+ MT6358_ID_RG_MAX,
52+};
53+
54+#define MT6358_MAX_REGULATOR MT6358_ID_RG_MAX
55+
56+#endif /* __LINUX_REGULATOR_MT6358_H */
include/linux/root_dev.h+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88
99 enum {
1010 Root_NFS = MKDEV(UNNAMED_MAJOR, 255),
11+ Root_CIFS = MKDEV(UNNAMED_MAJOR, 254),
1112 Root_RAM0 = MKDEV(RAMDISK_MAJOR, 0),
1213 Root_RAM1 = MKDEV(RAMDISK_MAJOR, 1),
1314 Root_FD0 = MKDEV(FLOPPY_MAJOR, 0),
include/linux/rwsem.h+10−0
@@ -45,6 +45,9 @@ struct rw_semaphore { · 44 unmodified lines
4545 #endif
4646 raw_spinlock_t wait_lock;
4747 struct list_head wait_list;
48+#ifdef CONFIG_DEBUG_RWSEMS
49+ void *magic;
50+#endif
4851 #ifdef CONFIG_DEBUG_LOCK_ALLOC
4952 struct lockdep_map dep_map;
5053 #endif
@@ -73,6 +76,12 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) · 22 unmodified lines
7376 # define __RWSEM_DEP_MAP_INIT(lockname)
7477 #endif
7578
79+#ifdef CONFIG_DEBUG_RWSEMS
80+# define __DEBUG_RWSEM_INITIALIZER(lockname) , .magic = &lockname
81+#else
82+# define __DEBUG_RWSEM_INITIALIZER(lockname)
83+#endif
84+
7685 #ifdef CONFIG_RWSEM_SPIN_ON_OWNER
7786 #define __RWSEM_OPT_INIT(lockname) , .osq = OSQ_LOCK_UNLOCKED
7887 #else
@@ -85,6 +94,7 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) · 6 unmodified lines
8594 .wait_list = LIST_HEAD_INIT((name).wait_list), \
8695 .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock) \
8796 __RWSEM_OPT_INIT(name) \
97+ __DEBUG_RWSEM_INITIALIZER(name) \
8898 __RWSEM_DEP_MAP_INIT(name) }
8999
90100 #define DECLARE_RWSEM(name) \
include/linux/sched.h+33−31
@@ -25,9 +25,11 @@ · 24 unmodified lines
2525 #include <linux/resource.h>
2626 #include <linux/latencytop.h>
2727 #include <linux/sched/prio.h>
28+#include <linux/sched/types.h>
2829 #include <linux/signal_types.h>
2930 #include <linux/mm_types_task.h>
3031 #include <linux/task_io_accounting.h>
32+#include <linux/posix-timers.h>
3133 #include <linux/rseq.h>
3234
3335 /* task_struct member predeclarations (sorted alphabetically): */
@@ -244,27 +246,6 @@ struct prev_cputime { · 210 unmodified lines
244246 #endif
245247 };
246248
247−/**
248− * struct task_cputime - collected CPU time counts
249− * @utime: time spent in user mode, in nanoseconds
250− * @stime: time spent in kernel mode, in nanoseconds
251− * @sum_exec_runtime: total time spent on the CPU, in nanoseconds
252− *
253− * This structure groups together three kinds of CPU time that are tracked for
254− * threads and thread groups. Most things considering CPU time want to group
255− * these counts together and treat all three of them in parallel.
256− */
257−struct task_cputime {
258− u64 utime;
259− u64 stime;
260− unsigned long long sum_exec_runtime;
261−};
262−
263−/* Alternate field names when used on cache expirations: */
264−#define virt_exp utime
265−#define prof_exp stime
266−#define sched_exp sum_exec_runtime
267−
268249 enum vtime_state {
269250 /* Task is sleeping or running in a CPU with VTIME inactive: */
270251 VTIME_INACTIVE = 0,
@@ -295,6 +276,11 @@ enum uclamp_id { · 24 unmodified lines
295276 UCLAMP_CNT
296277 };
297278
279+#ifdef CONFIG_SMP
280+extern struct root_domain def_root_domain;
281+extern struct mutex sched_domains_mutex;
282+#endif
283+
298284 struct sched_info {
299285 #ifdef CONFIG_SCHED_INFO
300286 /* Cumulative counters: */
@@ -876,10 +862,8 @@ struct task_struct { · 575 unmodified lines
876862 unsigned long min_flt;
877863 unsigned long maj_flt;
878864
879−#ifdef CONFIG_POSIX_TIMERS
880− struct task_cputime cputime_expires;
881− struct list_head cpu_timers[3];
882−#endif
865+ /* Empty if CONFIG_POSIX_CPUTIMERS=n */
866+ struct posix_cputimers posix_cputimers;
883867
884868 /* Process credentials: */
885869
@@ -974,6 +958,10 @@ struct task_struct { · 88 unmodified lines
974958 struct mutex_waiter *blocked_on;
975959 #endif
976960
961+#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
962+ int non_block_count;
963+#endif
964+
977965 #ifdef CONFIG_TRACE_IRQFLAGS
978966 unsigned int irq_events;
979967 unsigned long hardirq_enable_ip;
@@ -1092,7 +1080,15 @@ struct task_struct { · 112 unmodified lines
10921080 u64 last_sum_exec_runtime;
10931081 struct callback_head numa_work;
10941082
1095− struct numa_group *numa_group;
1083+ /*
1084+ * This pointer is only modified for current in syscall and
1085+ * pagefault context (and for tasks being destroyed), so it can be read
1086+ * from any of the following contexts:
1087+ * - RCU read-side critical section
1088+ * - current->numa_group from everywhere
1089+ * - task's runqueue locked, task not running
1090+ */
1091+ struct numa_group __rcu *numa_group;
10961092
10971093 /*
10981094 * numa_faults is an array split into four regions:
@@ -1134,7 +1130,10 @@ struct task_struct { · 35 unmodified lines
11341130
11351131 struct tlbflush_unmap_batch tlb_ubc;
11361132
1137− struct rcu_head rcu;
1133+ union {
1134+ refcount_t rcu_users;
1135+ struct rcu_head rcu;
1136+ };
11381137
11391138 /* Cache last used pipe for splice(): */
11401139 struct pipe_inode_info *splice_pipe;
@@ -1759,7 +1758,7 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) · 618 unmodified lines
17591758 * value indicates whether a reschedule was done in fact.
17601759 * cond_resched_lock() will drop the spinlock before scheduling,
17611760 */
1762−#ifndef CONFIG_PREEMPT
1761+#ifndef CONFIG_PREEMPTION
17631762 extern int _cond_resched(void);
17641763 #else
17651764 static inline int _cond_resched(void) { return 0; }
@@ -1788,12 +1787,12 @@ static inline void cond_resched_rcu(void) · 22 unmodified lines
17881787
17891788 /*
17901789 * Does a critical section need to be broken due to another
1791− * task waiting?: (technically does not depend on CONFIG_PREEMPT,
1790+ * task waiting?: (technically does not depend on CONFIG_PREEMPTION,
17921791 * but a general need for low latency)
17931792 */
17941793 static inline int spin_needbreak(spinlock_t *lock)
17951794 {
1796−#ifdef CONFIG_PREEMPT
1795+#ifdef CONFIG_PREEMPTION
17971796 return spin_is_contended(lock);
17981797 #else
17991798 return 0;
@@ -1843,7 +1842,10 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) · 43 unmodified lines
18431842 * running or not.
18441843 */
18451844 #ifndef vcpu_is_preempted
1846−# define vcpu_is_preempted(cpu) false
1845+static inline bool vcpu_is_preempted(int cpu)
1846+{
1847+ return false;
1848+}
18471849 #endif
18481850
18491851 extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
include/linux/sched/cputime.h+7−5
@@ -61,8 +61,7 @@ extern void cputime_adjust(struct task_cputime *curr, struct prev_cputime *prev, · 60 unmodified lines
6161 * Thread group CPU time accounting.
6262 */
6363 void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
64−void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
65−
64+void thread_group_sample_cputime(struct task_struct *tsk, u64 *samples);
6665
6766 /*
6867 * The following are functions that support scheduler-internal time accounting.
@@ -71,7 +70,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times); · 2 unmodified lines
7170 */
7271
7372 /**
74− * get_running_cputimer - return &tsk->signal->cputimer if cputimer is running
73+ * get_running_cputimer - return &tsk->signal->cputimer if cputimers are active
7574 *
7675 * @tsk: Pointer to target task.
7776 */
@@ -81,8 +80,11 @@ struct thread_group_cputimer *get_running_cputimer(struct task_struct *tsk) · 3 unmodified lines
8180 {
8281 struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
8382
84− /* Check if cputimer isn't running. This is accessed without locking. */
85− if (!READ_ONCE(cputimer->running))
83+ /*
84+ * Check whether posix CPU timers are active. If not the thread
85+ * group accounting is not active either. Lockless check.
86+ */
87+ if (!READ_ONCE(tsk->signal->posix_cputimers.timers_active))
8688 return NULL;
8789
8890 /*
include/linux/sched/deadline.h+8−0
@@ -24,3 +24,11 @@ static inline bool dl_time_before(u64 a, u64 b) · 23 unmodified lines
2424 {
2525 return (s64)(a - b) < 0;
2626 }
27+
28+#ifdef CONFIG_SMP
29+
30+struct root_domain;
31+extern void dl_add_task_root_domain(struct task_struct *p);
32+extern void dl_clear_root_domain(struct root_domain *rd);
33+
34+#endif /* CONFIG_SMP */
include/linux/sched/mm.h+5−5
@@ -362,16 +362,16 @@ enum { · 361 unmodified lines
362362
363363 static inline void membarrier_mm_sync_core_before_usermode(struct mm_struct *mm)
364364 {
365+ if (current->mm != mm)
366+ return;
365367 if (likely(!(atomic_read(&mm->membarrier_state) &
366368 MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE)))
367369 return;
368370 sync_core_before_usermode();
369371 }
370372
371−static inline void membarrier_execve(struct task_struct *t)
372−{
373− atomic_set(&t->mm->membarrier_state, 0);
374−}
373+extern void membarrier_exec_mmap(struct mm_struct *mm);
374+
375375 #else
376376 #ifdef CONFIG_ARCH_HAS_MEMBARRIER_CALLBACKS
377377 static inline void membarrier_arch_switch_mm(struct mm_struct *prev,
@@ -380,7 +380,7 @@ static inline void membarrier_arch_switch_mm(struct mm_struct *prev, · 2 unmodified lines
380380 {
381381 }
382382 #endif
383−static inline void membarrier_execve(struct task_struct *t)
383+static inline void membarrier_exec_mmap(struct mm_struct *mm)
384384 {
385385 }
386386 static inline void membarrier_mm_sync_core_before_usermode(struct mm_struct *mm)
include/linux/sched/numa_balancing.h+2−2
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 extern void task_numa_fault(int last_node, int node, int pages, int flags);
2020 extern pid_t task_numa_group_id(struct task_struct *p);
2121 extern void set_numabalancing_state(bool enabled);
22−extern void task_numa_free(struct task_struct *p);
22+extern void task_numa_free(struct task_struct *p, bool final);
2323 extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page,
2424 int src_nid, int dst_cpu);
2525 #else
@@ -34,7 +34,7 @@ static inline pid_t task_numa_group_id(struct task_struct *p) · 8 unmodified lines
3434 static inline void set_numabalancing_state(bool enabled)
3535 {
3636 }
37−static inline void task_numa_free(struct task_struct *p)
37+static inline void task_numa_free(struct task_struct *p, bool final)
3838 {
3939 }
4040 static inline bool should_numa_migrate_memory(struct task_struct *p,
include/linux/sched/signal.h+3−11
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include <linux/sched/task.h>
1010 #include <linux/cred.h>
1111 #include <linux/refcount.h>
12+#include <linux/posix-timers.h>
1213
1314 /*
1415 * Types defining task->signal and task->sighand and APIs using them:
@@ -56,18 +57,12 @@ struct task_cputime_atomic { · 41 unmodified lines
5657 /**
5758 * struct thread_group_cputimer - thread group interval timer counts
5859 * @cputime_atomic: atomic thread group interval timers.
59− * @running: true when there are timers running and
60− * @cputime_atomic receives updates.
61− * @checking_timer: true when a thread in the group is in the
62− * process of checking for thread group timers.
6360 *
6461 * This structure contains the version of task_cputime, above, that is
6562 * used for thread group CPU timer calculations.
6663 */
6764 struct thread_group_cputimer {
6865 struct task_cputime_atomic cputime_atomic;
69− bool running;
70− bool checking_timer;
7166 };
7267
7368 struct multiprocess_signals {
@@ -148,12 +143,9 @@ struct signal_struct { · 74 unmodified lines
148143 */
149144 struct thread_group_cputimer cputimer;
150145
151− /* Earliest-expiration cache. */
152− struct task_cputime cputime_expires;
153−
154− struct list_head cpu_timers[3];
155−
156146 #endif
147+ /* Empty if CONFIG_POSIX_TIMERS=n */
148+ struct posix_cputimers posix_cputimers;
157149
158150 /* PID/PID hash table linkage. */
159151 struct pid *pids[PIDTYPE_MAX];
include/linux/sched/task.h+6−2
@@ -105,7 +105,11 @@ extern void sched_exec(void); · 104 unmodified lines
105105 #define sched_exec() {}
106106 #endif
107107
108−#define get_task_struct(tsk) do { refcount_inc(&(tsk)->usage); } while(0)
108+static inline struct task_struct *get_task_struct(struct task_struct *t)
109+{
110+ refcount_inc(&t->usage);
111+ return t;
112+}
109113
110114 extern void __put_task_struct(struct task_struct *t);
111115
@@ -115,7 +119,7 @@ static inline void put_task_struct(struct task_struct *t) · 3 unmodified lines
115119 __put_task_struct(t);
116120 }
117121
118−struct task_struct *task_rcu_dereference(struct task_struct **ptask);
122+void put_task_struct_rcu_user(struct task_struct *task);
119123
120124 #ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT
121125 extern int arch_task_struct_size __read_mostly;
include/linux/sched/topology.h+10−0
@@ -150,6 +150,10 @@ static inline struct cpumask *sched_domain_span(struct sched_domain *sd) · 149 unmodified lines
150150 return to_cpumask(sd->span);
151151 }
152152
153+extern void partition_sched_domains_locked(int ndoms_new,
154+ cpumask_var_t doms_new[],
155+ struct sched_domain_attr *dattr_new);
156+
153157 extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
154158 struct sched_domain_attr *dattr_new);
155159
@@ -194,6 +198,12 @@ extern void set_sched_topology(struct sched_domain_topology_level *tl); · 38 unmodified lines
194198
195199 struct sched_domain_attr;
196200
201+static inline void
202+partition_sched_domains_locked(int ndoms_new, cpumask_var_t doms_new[],
203+ struct sched_domain_attr *dattr_new)
204+{
205+}
206+
197207 static inline void
198208 partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
199209 struct sched_domain_attr *dattr_new)
include/linux/sched/types.h+23−0
@@ -0,0 +1,23 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _LINUX_SCHED_TYPES_H
3+#define _LINUX_SCHED_TYPES_H
4+
5+#include <linux/types.h>
6+
7+/**
8+ * struct task_cputime - collected CPU time counts
9+ * @stime: time spent in kernel mode, in nanoseconds
10+ * @utime: time spent in user mode, in nanoseconds
11+ * @sum_exec_runtime: total time spent on the CPU, in nanoseconds
12+ *
13+ * This structure groups together three kinds of CPU time that are tracked for
14+ * threads and thread groups. Most things considering CPU time want to group
15+ * these counts together and treat all three of them in parallel.
16+ */
17+struct task_cputime {
18+ u64 stime;
19+ u64 utime;
20+ unsigned long long sum_exec_runtime;
21+};
22+
23+#endif
include/linux/scmi_protocol.h+37−9
@@ -1,4 +1,4 @@
1−// SPDX-License-Identifier: GPL-2.0
1+/* SPDX-License-Identifier: GPL-2.0-only */
22 /*
33 * SCMI Message Protocol driver header
44 *
@@ -71,7 +71,7 @@ struct scmi_clk_ops { · 66 unmodified lines
7171 int (*rate_get)(const struct scmi_handle *handle, u32 clk_id,
7272 u64 *rate);
7373 int (*rate_set)(const struct scmi_handle *handle, u32 clk_id,
74− u32 config, u64 rate);
74+ u64 rate);
7575 int (*enable)(const struct scmi_handle *handle, u32 clk_id);
7676 int (*disable)(const struct scmi_handle *handle, u32 clk_id);
7777 };
@@ -145,6 +145,8 @@ struct scmi_sensor_info { · 67 unmodified lines
145145 u32 id;
146146 u8 type;
147147 s8 scale;
148+ u8 num_trip_points;
149+ bool async;
148150 char name[SCMI_MAX_STR_SIZE];
149151 };
150152
@@ -167,9 +169,9 @@ enum scmi_sensor_class { · 16 unmodified lines
167169 *
168170 * @count_get: get the count of sensors provided by SCMI
169171 * @info_get: get the information of the specified sensor
170− * @configuration_set: control notifications on cross-over events for
172+ * @trip_point_notify: control notifications on cross-over events for
171173 * the trip-points
172− * @trip_point_set: selects and configures a trip-point of interest
174+ * @trip_point_config: selects and configures a trip-point of interest
173175 * @reading_get: gets the current value of the sensor
174176 */
175177 struct scmi_sensor_ops {
@@ -177,12 +179,32 @@ struct scmi_sensor_ops { · 1 unmodified line
177179
178180 const struct scmi_sensor_info *(*info_get)
179181 (const struct scmi_handle *handle, u32 sensor_id);
180− int (*configuration_set)(const struct scmi_handle *handle,
181− u32 sensor_id);
182− int (*trip_point_set)(const struct scmi_handle *handle, u32 sensor_id,
183− u8 trip_id, u64 trip_value);
182+ int (*trip_point_notify)(const struct scmi_handle *handle,
183+ u32 sensor_id, bool enable);
184+ int (*trip_point_config)(const struct scmi_handle *handle,
185+ u32 sensor_id, u8 trip_id, u64 trip_value);
184186 int (*reading_get)(const struct scmi_handle *handle, u32 sensor_id,
185− bool async, u64 *value);
187+ u64 *value);
188+};
189+
190+/**
191+ * struct scmi_reset_ops - represents the various operations provided
192+ * by SCMI Reset Protocol
193+ *
194+ * @num_domains_get: get the count of reset domains provided by SCMI
195+ * @name_get: gets the name of a reset domain
196+ * @latency_get: gets the reset latency for the specified reset domain
197+ * @reset: resets the specified reset domain
198+ * @assert: explicitly assert reset signal of the specified reset domain
199+ * @deassert: explicitly deassert reset signal of the specified reset domain
200+ */
201+struct scmi_reset_ops {
202+ int (*num_domains_get)(const struct scmi_handle *handle);
203+ char *(*name_get)(const struct scmi_handle *handle, u32 domain);
204+ int (*latency_get)(const struct scmi_handle *handle, u32 domain);
205+ int (*reset)(const struct scmi_handle *handle, u32 domain);
206+ int (*assert)(const struct scmi_handle *handle, u32 domain);
207+ int (*deassert)(const struct scmi_handle *handle, u32 domain);
186208 };
187209
188210 /**
@@ -194,6 +216,7 @@ struct scmi_sensor_ops { · 5 unmodified lines
194216 * @perf_ops: pointer to set of performance protocol operations
195217 * @clk_ops: pointer to set of clock protocol operations
196218 * @sensor_ops: pointer to set of sensor protocol operations
219+ * @reset_ops: pointer to set of reset protocol operations
197220 * @perf_priv: pointer to private data structure specific to performance
198221 * protocol(for internal use only)
199222 * @clk_priv: pointer to private data structure specific to clock
@@ -202,6 +225,8 @@ struct scmi_sensor_ops { · 2 unmodified lines
202225 * protocol(for internal use only)
203226 * @sensor_priv: pointer to private data structure specific to sensors
204227 * protocol(for internal use only)
228+ * @reset_priv: pointer to private data structure specific to reset
229+ * protocol(for internal use only)
205230 */
206231 struct scmi_handle {
207232 struct device *dev;
@@ -210,11 +235,13 @@ struct scmi_handle { · 2 unmodified lines
210235 struct scmi_clk_ops *clk_ops;
211236 struct scmi_power_ops *power_ops;
212237 struct scmi_sensor_ops *sensor_ops;
238+ struct scmi_reset_ops *reset_ops;
213239 /* for protocol internal use */
214240 void *perf_priv;
215241 void *clk_priv;
216242 void *power_priv;
217243 void *sensor_priv;
244+ void *reset_priv;
218245 };
219246
220247 enum scmi_std_protocol {
@@ -224,6 +251,7 @@ enum scmi_std_protocol { · 3 unmodified lines
224251 SCMI_PROTOCOL_PERF = 0x13,
225252 SCMI_PROTOCOL_CLOCK = 0x14,
226253 SCMI_PROTOCOL_SENSOR = 0x15,
254+ SCMI_PROTOCOL_RESET = 0x16,
227255 };
228256
229257 struct scmi_device {
include/linux/security.h+67−2
@@ -77,6 +77,54 @@ enum lsm_event { · 76 unmodified lines
7777 LSM_POLICY_CHANGE,
7878 };
7979
80+/*
81+ * These are reasons that can be passed to the security_locked_down()
82+ * LSM hook. Lockdown reasons that protect kernel integrity (ie, the
83+ * ability for userland to modify kernel code) are placed before
84+ * LOCKDOWN_INTEGRITY_MAX. Lockdown reasons that protect kernel
85+ * confidentiality (ie, the ability for userland to extract
86+ * information from the running kernel that would otherwise be
87+ * restricted) are placed before LOCKDOWN_CONFIDENTIALITY_MAX.
88+ *
89+ * LSM authors should note that the semantics of any given lockdown
90+ * reason are not guaranteed to be stable - the same reason may block
91+ * one set of features in one kernel release, and a slightly different
92+ * set of features in a later kernel release. LSMs that seek to expose
93+ * lockdown policy at any level of granularity other than "none",
94+ * "integrity" or "confidentiality" are responsible for either
95+ * ensuring that they expose a consistent level of functionality to
96+ * userland, or ensuring that userland is aware that this is
97+ * potentially a moving target. It is easy to misuse this information
98+ * in a way that could break userspace. Please be careful not to do
99+ * so.
100+ *
101+ * If you add to this, remember to extend lockdown_reasons in
102+ * security/lockdown/lockdown.c.
103+ */
104+enum lockdown_reason {
105+ LOCKDOWN_NONE,
106+ LOCKDOWN_MODULE_SIGNATURE,
107+ LOCKDOWN_DEV_MEM,
108+ LOCKDOWN_KEXEC,
109+ LOCKDOWN_HIBERNATION,
110+ LOCKDOWN_PCI_ACCESS,
111+ LOCKDOWN_IOPORT,
112+ LOCKDOWN_MSR,
113+ LOCKDOWN_ACPI_TABLES,
114+ LOCKDOWN_PCMCIA_CIS,
115+ LOCKDOWN_TIOCSSERIAL,
116+ LOCKDOWN_MODULE_PARAMETERS,
117+ LOCKDOWN_MMIOTRACE,
118+ LOCKDOWN_DEBUGFS,
119+ LOCKDOWN_INTEGRITY_MAX,
120+ LOCKDOWN_KCORE,
121+ LOCKDOWN_KPROBES,
122+ LOCKDOWN_BPF_READ,
123+ LOCKDOWN_PERF,
124+ LOCKDOWN_TRACEFS,
125+ LOCKDOWN_CONFIDENTIALITY_MAX,
126+};
127+
80128 /* These functions are in security/commoncap.c */
81129 extern int cap_capable(const struct cred *cred, struct user_namespace *ns,
82130 int cap, unsigned int opts);
@@ -195,6 +243,7 @@ int unregister_blocking_lsm_notifier(struct notifier_block *nb); · 112 unmodified lines
195243
196244 /* prototypes */
197245 extern int security_init(void);
246+extern int early_security_init(void);
198247
199248 /* Security operations */
200249 int security_binder_set_context_mgr(struct task_struct *mgr);
@@ -259,7 +308,8 @@ int security_dentry_create_files_as(struct dentry *dentry, int mode, · 58 unmodified lines
259308 struct qstr *name,
260309 const struct cred *old,
261310 struct cred *new);
262−
311+int security_path_notify(const struct path *path, u64 mask,
312+ unsigned int obj_type);
263313 int security_inode_alloc(struct inode *inode);
264314 void security_inode_free(struct inode *inode);
265315 int security_inode_init_security(struct inode *inode, struct inode *dir,
@@ -387,11 +437,11 @@ int security_ismaclabel(const char *name); · 121 unmodified lines
387437 int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
388438 int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);
389439 void security_release_secctx(char *secdata, u32 seclen);
390−
391440 void security_inode_invalidate_secctx(struct inode *inode);
392441 int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen);
393442 int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen);
394443 int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen);
444+int security_locked_down(enum lockdown_reason what);
395445 #else /* CONFIG_SECURITY */
396446
397447 static inline int call_blocking_lsm_notifier(enum lsm_event event, void *data)
@@ -423,6 +473,11 @@ static inline int security_init(void) · 25 unmodified lines
423473 return 0;
424474 }
425475
476+static inline int early_security_init(void)
477+{
478+ return 0;
479+}
480+
426481 static inline int security_binder_set_context_mgr(struct task_struct *mgr)
427482 {
428483 return 0;
@@ -621,6 +676,12 @@ static inline int security_move_mount(const struct path *from_path, · 192 unmodified lines
621676 return 0;
622677 }
623678
679+static inline int security_path_notify(const struct path *path, u64 mask,
680+ unsigned int obj_type)
681+{
682+ return 0;
683+}
684+
624685 static inline int security_inode_alloc(struct inode *inode)
625686 {
626687 return 0;
@@ -1204,6 +1265,10 @@ static inline int security_inode_getsecctx(struct inode *inode, void **ctx, u32 · 577 unmodified lines
12041265 {
12051266 return -EOPNOTSUPP;
12061267 }
1268+static inline int security_locked_down(enum lockdown_reason what)
1269+{
1270+ return 0;
1271+}
12071272 #endif /* CONFIG_SECURITY */
12081273
12091274 #ifdef CONFIG_SECURITY_NETWORK
include/linux/sha256.h+0−28
@@ -1,28 +0,0 @@
1−/* SPDX-License-Identifier: GPL-2.0-only */
2−/*
3− * Copyright (C) 2014 Red Hat Inc.
4− *
5− * Author: Vivek Goyal <vgoyal@redhat.com>
6− */
7−
8−#ifndef SHA256_H
9−#define SHA256_H
10−
11−#include <linux/types.h>
12−#include <crypto/sha.h>
13−
14−/*
15− * Stand-alone implementation of the SHA256 algorithm. It is designed to
16− * have as little dependencies as possible so it can be used in the
17− * kexec_file purgatory. In other cases you should use the implementation in
18− * crypto/.
19− *
20− * For details see lib/sha256.c
21− */
22−
23−extern int sha256_init(struct sha256_state *sctx);
24−extern int sha256_update(struct sha256_state *sctx, const u8 *input,
25− unsigned int length);
26−extern int sha256_final(struct sha256_state *sctx, u8 *hash);
27−
28−#endif /* SHA256_H */
include/linux/shmem_fs.h+2−1
@@ -49,8 +49,9 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) · 48 unmodified lines
4949 /*
5050 * Functions in mm/shmem.c called directly from elsewhere:
5151 */
52+extern const struct fs_parameter_description shmem_fs_parameters;
5253 extern int shmem_init(void);
53−extern int shmem_fill_super(struct super_block *sb, void *data, int silent);
54+extern int shmem_init_fs_context(struct fs_context *fc);
5455 extern struct file *shmem_file_setup(const char *name,
5556 loff_t size, unsigned long flags);
5657 extern struct file *shmem_kernel_file_setup(const char *name, loff_t size,
include/linux/shrinker.h+6−1
@@ -69,7 +69,7 @@ struct shrinker { · 68 unmodified lines
6969
7070 /* These are for internal use */
7171 struct list_head list;
72−#ifdef CONFIG_MEMCG_KMEM
72+#ifdef CONFIG_MEMCG
7373 /* ID in shrinker_idr */
7474 int id;
7575 #endif
@@ -81,6 +81,11 @@ struct shrinker { · 5 unmodified lines
8181 /* Flags */
8282 #define SHRINKER_NUMA_AWARE (1 << 0)
8383 #define SHRINKER_MEMCG_AWARE (1 << 1)
84+/*
85+ * It just makes sense when the shrinker is also MEMCG_AWARE for now,
86+ * non-MEMCG_AWARE shrinker should not have this flag set.
87+ */
88+#define SHRINKER_NONSLAB (1 << 2)
8489
8590 extern int prealloc_shrinker(struct shrinker *shrinker);
8691 extern void register_shrinker_prepared(struct shrinker *shrinker);
include/linux/signal.h+14−1
@@ -282,6 +282,9 @@ extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping); · 281 unmodified lines
282282 extern void exit_signals(struct task_struct *tsk);
283283 extern void kernel_sigaction(int, __sighandler_t);
284284
285+#define SIG_KTHREAD ((__force __sighandler_t)2)
286+#define SIG_KTHREAD_KERNEL ((__force __sighandler_t)3)
287+
285288 static inline void allow_signal(int sig)
286289 {
287290 /*
@@ -289,7 +292,17 @@ static inline void allow_signal(int sig) · 1 unmodified line
289292 * know it'll be handled, so that they don't get converted to
290293 * SIGKILL or just silently dropped.
291294 */
292− kernel_sigaction(sig, (__force __sighandler_t)2);
295+ kernel_sigaction(sig, SIG_KTHREAD);
296+}
297+
298+static inline void allow_kernel_signal(int sig)
299+{
300+ /*
301+ * Kernel threads handle their own signals. Let the signal code
302+ * know signals sent by the kernel will be handled, so that they
303+ * don't get silently dropped.
304+ */
305+ kernel_sigaction(sig, SIG_KTHREAD_KERNEL);
293306 }
294307
295308 static inline void disallow_signal(int sig)
include/linux/skbuff.h+117−50
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/compiler.h>
1515 #include <linux/time.h>
1616 #include <linux/bug.h>
17+#include <linux/bvec.h>
1718 #include <linux/cache.h>
1819 #include <linux/rbtree.h>
1920 #include <linux/socket.h>
@@ -36,6 +37,9 @@ · 16 unmodified lines
3637 #include <linux/in6.h>
3738 #include <linux/if_packet.h>
3839 #include <net/flow.h>
40+#if IS_ENABLED(CONFIG_NF_CONNTRACK)
41+#include <linux/netfilter/nf_conntrack_common.h>
42+#endif
3943
4044 /* The interface for checksum offload between the stack and networking drivers
4145 * is as follows...
@@ -243,12 +247,6 @@ struct bpf_prog; · 201 unmodified lines
243247 union bpf_attr;
244248 struct skb_ext;
245249
246−#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
247−struct nf_conntrack {
248− atomic_t use;
249−};
250−#endif
251−
252250 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
253251 struct nf_bridge_info {
254252 enum {
@@ -278,6 +276,16 @@ struct nf_bridge_info { · 23 unmodified lines
278276 };
279277 #endif
280278
279+#if IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
280+/* Chain in tc_skb_ext will be used to share the tc chain with
281+ * ovs recirc_id. It will be set to the current chain by tc
282+ * and read by ovs to recirc_id.
283+ */
284+struct tc_skb_ext {
285+ __u32 chain;
286+};
287+#endif
288+
281289 struct sk_buff_head {
282290 /* These two members must be first. */
283291 struct sk_buff *next;
@@ -308,58 +316,45 @@ extern int sysctl_max_skb_frags; · 24 unmodified lines
308316 */
309317 #define GSO_BY_FRAGS 0xFFFF
310318
311−typedef struct skb_frag_struct skb_frag_t;
312−
313−struct skb_frag_struct {
314− struct {
315− struct page *p;
316− } page;
317−#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
318− __u32 page_offset;
319− __u32 size;
320−#else
321− __u16 page_offset;
322− __u16 size;
323−#endif
324−};
319+typedef struct bio_vec skb_frag_t;
325320
326321 /**
327− * skb_frag_size - Returns the size of a skb fragment
322+ * skb_frag_size() - Returns the size of a skb fragment
328323 * @frag: skb fragment
329324 */
330325 static inline unsigned int skb_frag_size(const skb_frag_t *frag)
331326 {
332− return frag->size;
327+ return frag->bv_len;
333328 }
334329
335330 /**
336− * skb_frag_size_set - Sets the size of a skb fragment
331+ * skb_frag_size_set() - Sets the size of a skb fragment
337332 * @frag: skb fragment
338333 * @size: size of fragment
339334 */
340335 static inline void skb_frag_size_set(skb_frag_t *frag, unsigned int size)
341336 {
342− frag->size = size;
337+ frag->bv_len = size;
343338 }
344339
345340 /**
346− * skb_frag_size_add - Incrementes the size of a skb fragment by %delta
341+ * skb_frag_size_add() - Increments the size of a skb fragment by @delta
347342 * @frag: skb fragment
348343 * @delta: value to add
349344 */
350345 static inline void skb_frag_size_add(skb_frag_t *frag, int delta)
351346 {
352− frag->size += delta;
347+ frag->bv_len += delta;
353348 }
354349
355350 /**
356− * skb_frag_size_sub - Decrements the size of a skb fragment by %delta
351+ * skb_frag_size_sub() - Decrements the size of a skb fragment by @delta
357352 * @frag: skb fragment
358353 * @delta: value to subtract
359354 */
360355 static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
361356 {
362− frag->size -= delta;
357+ frag->bv_len -= delta;
363358 }
364359
365360 /**
@@ -379,7 +374,7 @@ static inline bool skb_frag_must_loop(struct page *p) · 13 unmodified lines
379374 * skb_frag_foreach_page - loop over pages in a fragment
380375 *
381376 * @f: skb frag to operate on
382− * @f_off: offset from start of f->page.p
377+ * @f_off: offset from start of f->bv_page
383378 * @f_len: length from f_off to loop over
384379 * @p: (temp var) current page
385380 * @p_off: (temp var) offset from start of current page,
@@ -916,7 +911,6 @@ static inline bool skb_pfmemalloc(const struct sk_buff *skb) · 530 unmodified lines
916911 #define SKB_DST_NOREF 1UL
917912 #define SKB_DST_PTRMASK ~(SKB_DST_NOREF)
918913
919−#define SKB_NFCT_PTRMASK ~(7UL)
920914 /**
921915 * skb_dst - returns skb dst_entry
922916 * @skb: buffer
@@ -1283,7 +1277,7 @@ static inline int skb_flow_dissector_bpf_prog_detach(const union bpf_attr *attr) · 360 unmodified lines
12831277
12841278 struct bpf_flow_dissector;
12851279 bool bpf_flow_dissect(struct bpf_prog *prog, struct bpf_flow_dissector *ctx,
1286− __be16 proto, int nhoff, int hlen);
1280+ __be16 proto, int nhoff, int hlen, unsigned int flags);
12871281
12881282 bool __skb_flow_dissect(const struct net *net,
12891283 const struct sk_buff *skb,
@@ -1374,6 +1368,14 @@ static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from) · 84 unmodified lines
13741368 to->l4_hash = from->l4_hash;
13751369 };
13761370
1371+static inline void skb_copy_decrypted(struct sk_buff *to,
1372+ const struct sk_buff *from)
1373+{
1374+#ifdef CONFIG_TLS_DEVICE
1375+ to->decrypted = from->decrypted;
1376+#endif
1377+}
1378+
13771379 #ifdef NET_SKBUFF_DATA_USES_OFFSET
13781380 static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
13791381 {
@@ -2089,8 +2091,8 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i, · 709 unmodified lines
20892091 * that not all callers have unique ownership of the page but rely
20902092 * on page_is_pfmemalloc doing the right thing(tm).
20912093 */
2092− frag->page.p = page;
2093− frag->page_offset = off;
2094+ frag->bv_page = page;
2095+ frag->bv_offset = off;
20942096 skb_frag_size_set(frag, size);
20952097
20962098 page = compound_head(page);
@@ -2869,6 +2871,46 @@ static inline void skb_propagate_pfmemalloc(struct page *page, · 772 unmodified lines
28692871 skb->pfmemalloc = true;
28702872 }
28712873
2874+/**
2875+ * skb_frag_off() - Returns the offset of a skb fragment
2876+ * @frag: the paged fragment
2877+ */
2878+static inline unsigned int skb_frag_off(const skb_frag_t *frag)
2879+{
2880+ return frag->bv_offset;
2881+}
2882+
2883+/**
2884+ * skb_frag_off_add() - Increments the offset of a skb fragment by @delta
2885+ * @frag: skb fragment
2886+ * @delta: value to add
2887+ */
2888+static inline void skb_frag_off_add(skb_frag_t *frag, int delta)
2889+{
2890+ frag->bv_offset += delta;
2891+}
2892+
2893+/**
2894+ * skb_frag_off_set() - Sets the offset of a skb fragment
2895+ * @frag: skb fragment
2896+ * @offset: offset of fragment
2897+ */
2898+static inline void skb_frag_off_set(skb_frag_t *frag, unsigned int offset)
2899+{
2900+ frag->bv_offset = offset;
2901+}
2902+
2903+/**
2904+ * skb_frag_off_copy() - Sets the offset of a skb fragment from another fragment
2905+ * @fragto: skb fragment where offset is set
2906+ * @fragfrom: skb fragment offset is copied from
2907+ */
2908+static inline void skb_frag_off_copy(skb_frag_t *fragto,
2909+ const skb_frag_t *fragfrom)
2910+{
2911+ fragto->bv_offset = fragfrom->bv_offset;
2912+}
2913+
28722914 /**
28732915 * skb_frag_page - retrieve the page referred to by a paged fragment
28742916 * @frag: the paged fragment
@@ -2877,7 +2919,7 @@ static inline void skb_propagate_pfmemalloc(struct page *page, · 2 unmodified lines
28772919 */
28782920 static inline struct page *skb_frag_page(const skb_frag_t *frag)
28792921 {
2880− return frag->page.p;
2922+ return frag->bv_page;
28812923 }
28822924
28832925 /**
@@ -2935,7 +2977,7 @@ static inline void skb_frag_unref(struct sk_buff *skb, int f) · 51 unmodified lines
29352977 */
29362978 static inline void *skb_frag_address(const skb_frag_t *frag)
29372979 {
2938− return page_address(skb_frag_page(frag)) + frag->page_offset;
2980+ return page_address(skb_frag_page(frag)) + skb_frag_off(frag);
29392981 }
29402982
29412983 /**
@@ -2951,7 +2993,18 @@ static inline void *skb_frag_address_safe(const skb_frag_t *frag) · 9 unmodified lines
29512993 if (unlikely(!ptr))
29522994 return NULL;
29532995
2954− return ptr + frag->page_offset;
2996+ return ptr + skb_frag_off(frag);
2997+}
2998+
2999+/**
3000+ * skb_frag_page_copy() - sets the page in a fragment from another fragment
3001+ * @fragto: skb fragment where page is set
3002+ * @fragfrom: skb fragment page is copied from
3003+ */
3004+static inline void skb_frag_page_copy(skb_frag_t *fragto,
3005+ const skb_frag_t *fragfrom)
3006+{
3007+ fragto->bv_page = fragfrom->bv_page;
29553008 }
29563009
29573010 /**
@@ -2963,7 +3016,7 @@ static inline void *skb_frag_address_safe(const skb_frag_t *frag) · 5 unmodified lines
29633016 */
29643017 static inline void __skb_frag_set_page(skb_frag_t *frag, struct page *page)
29653018 {
2966− frag->page.p = page;
3019+ frag->bv_page = page;
29673020 }
29683021
29693022 /**
@@ -2999,7 +3052,7 @@ static inline dma_addr_t skb_frag_dma_map(struct device *dev, · 29 unmodified lines
29993052 enum dma_data_direction dir)
30003053 {
30013054 return dma_map_page(dev, skb_frag_page(frag),
3002− frag->page_offset + offset, size, dir);
3055+ skb_frag_off(frag) + offset, size, dir);
30033056 }
30043057
30053058 static inline struct sk_buff *pskb_copy(struct sk_buff *skb,
@@ -3166,10 +3219,10 @@ static inline bool skb_can_coalesce(struct sk_buff *skb, int i, · 160 unmodified lines
31663219 if (skb_zcopy(skb))
31673220 return false;
31683221 if (i) {
3169− const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1];
3222+ const skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1];
31703223
31713224 return page == skb_frag_page(frag) &&
3172− off == frag->page_offset + skb_frag_size(frag);
3225+ off == skb_frag_off(frag) + skb_frag_size(frag);
31733226 }
31743227 return false;
31753228 }
@@ -3983,25 +4036,27 @@ static inline void skb_remcsum_process(struct sk_buff *skb, void *ptr, · 807 unmodified lines
39834036 static inline struct nf_conntrack *skb_nfct(const struct sk_buff *skb)
39844037 {
39854038 #if IS_ENABLED(CONFIG_NF_CONNTRACK)
3986− return (void *)(skb->_nfct & SKB_NFCT_PTRMASK);
4039+ return (void *)(skb->_nfct & NFCT_PTRMASK);
39874040 #else
39884041 return NULL;
39894042 #endif
39904043 }
39914044
3992−#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
3993−void nf_conntrack_destroy(struct nf_conntrack *nfct);
3994−static inline void nf_conntrack_put(struct nf_conntrack *nfct)
4045+static inline unsigned long skb_get_nfct(const struct sk_buff *skb)
39954046 {
3996− if (nfct && atomic_dec_and_test(&nfct->use))
3997− nf_conntrack_destroy(nfct);
4047+#if IS_ENABLED(CONFIG_NF_CONNTRACK)
4048+ return skb->_nfct;
4049+#else
4050+ return 0UL;
4051+#endif
39984052 }
3999−static inline void nf_conntrack_get(struct nf_conntrack *nfct)
4053+
4054+static inline void skb_set_nfct(struct sk_buff *skb, unsigned long nfct)
40004055 {
4001− if (nfct)
4002− atomic_inc(&nfct->use);
4003−}
4056+#if IS_ENABLED(CONFIG_NF_CONNTRACK)
4057+ skb->_nfct = nfct;
40044058 #endif
4059+}
40054060
40064061 #ifdef CONFIG_SKB_EXTENSIONS
40074062 enum skb_ext_id {
@@ -4010,6 +4065,9 @@ enum skb_ext_id { · 2 unmodified lines
40104065 #endif
40114066 #ifdef CONFIG_XFRM
40124067 SKB_EXT_SEC_PATH,
4068+#endif
4069+#if IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
4070+ TC_SKB_EXT,
40134071 #endif
40144072 SKB_EXT_NUM, /* must be last */
40154073 };
@@ -4086,8 +4144,17 @@ static inline void *skb_ext_find(const struct sk_buff *skb, enum skb_ext_id id) · 70 unmodified lines
40864144
40874145 return NULL;
40884146 }
4147+
4148+static inline void skb_ext_reset(struct sk_buff *skb)
4149+{
4150+ if (unlikely(skb->active_extensions)) {
4151+ __skb_ext_put(skb->extensions);
4152+ skb->active_extensions = 0;
4153+ }
4154+}
40894155 #else
40904156 static inline void skb_ext_put(struct sk_buff *skb) {}
4157+static inline void skb_ext_reset(struct sk_buff *skb) {}
40914158 static inline void skb_ext_del(struct sk_buff *skb, int unused) {}
40924159 static inline void __skb_ext_copy(struct sk_buff *d, const struct sk_buff *s) {}
40934160 static inline void skb_ext_copy(struct sk_buff *dst, const struct sk_buff *s) {}
include/linux/skmsg.h+7−1
@@ -354,7 +354,13 @@ static inline void sk_psock_restore_proto(struct sock *sk, · 353 unmodified lines
354354 sk->sk_write_space = psock->saved_write_space;
355355
356356 if (psock->sk_proto) {
357− sk->sk_prot = psock->sk_proto;
357+ struct inet_connection_sock *icsk = inet_csk(sk);
358+ bool has_ulp = !!icsk->icsk_ulp_data;
359+
360+ if (has_ulp)
361+ tcp_update_ulp(sk, psock->sk_proto);
362+ else
363+ sk->sk_prot = psock->sk_proto;
358364 psock->sk_proto = NULL;
359365 }
360366 }
include/linux/slab.h+0−62
@@ -595,68 +595,6 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) · 594 unmodified lines
595595 return __kmalloc_node(size, flags, node);
596596 }
597597
598−struct memcg_cache_array {
599− struct rcu_head rcu;
600− struct kmem_cache *entries[0];
601−};
602−
603−/*
604− * This is the main placeholder for memcg-related information in kmem caches.
605− * Both the root cache and the child caches will have it. For the root cache,
606− * this will hold a dynamically allocated array large enough to hold
607− * information about the currently limited memcgs in the system. To allow the
608− * array to be accessed without taking any locks, on relocation we free the old
609− * version only after a grace period.
610− *
611− * Root and child caches hold different metadata.
612− *
613− * @root_cache: Common to root and child caches. NULL for root, pointer to
614− * the root cache for children.
615− *
616− * The following fields are specific to root caches.
617− *
618− * @memcg_caches: kmemcg ID indexed table of child caches. This table is
619− * used to index child cachces during allocation and cleared
620− * early during shutdown.
621− *
622− * @root_caches_node: List node for slab_root_caches list.
623− *
624− * @children: List of all child caches. While the child caches are also
625− * reachable through @memcg_caches, a child cache remains on
626− * this list until it is actually destroyed.
627− *
628− * The following fields are specific to child caches.
629− *
630− * @memcg: Pointer to the memcg this cache belongs to.
631− *
632− * @children_node: List node for @root_cache->children list.
633− *
634− * @kmem_caches_node: List node for @memcg->kmem_caches list.
635− */
636−struct memcg_cache_params {
637− struct kmem_cache *root_cache;
638− union {
639− struct {
640− struct memcg_cache_array __rcu *memcg_caches;
641− struct list_head __root_caches_node;
642− struct list_head children;
643− bool dying;
644− };
645− struct {
646− struct mem_cgroup *memcg;
647− struct list_head children_node;
648− struct list_head kmem_caches_node;
649− struct percpu_ref refcnt;
650−
651− void (*work_fn)(struct kmem_cache *);
652− union {
653− struct rcu_head rcu_head;
654− struct work_struct work;
655− };
656− };
657− };
658−};
659−
660598 int memcg_update_all_caches(int num_memcgs);
661599
662600 /**
include/linux/soc/mediatek/mtk-cmdq.h+7−10
@@ -13,9 +13,6 @@ · 12 unmodified lines
1313
1414 #define CMDQ_NO_TIMEOUT 0xffffffffu
1515
16−/** cmdq event maximum */
17−#define CMDQ_MAX_EVENT 0x3ff
18−
1916 struct cmdq_pkt;
2017
2118 struct cmdq_client {
@@ -63,26 +60,26 @@ void cmdq_pkt_destroy(struct cmdq_pkt *pkt); · 41 unmodified lines
6360 /**
6461 * cmdq_pkt_write() - append write command to the CMDQ packet
6562 * @pkt: the CMDQ packet
66− * @value: the specified target register value
6763 * @subsys: the CMDQ sub system code
6864 * @offset: register offset from CMDQ sub system
65+ * @value: the specified target register value
6966 *
7067 * Return: 0 for success; else the error code is returned
7168 */
72−int cmdq_pkt_write(struct cmdq_pkt *pkt, u32 value, u32 subsys, u32 offset);
69+int cmdq_pkt_write(struct cmdq_pkt *pkt, u8 subsys, u16 offset, u32 value);
7370
7471 /**
7572 * cmdq_pkt_write_mask() - append write command with mask to the CMDQ packet
7673 * @pkt: the CMDQ packet
77− * @value: the specified target register value
7874 * @subsys: the CMDQ sub system code
7975 * @offset: register offset from CMDQ sub system
76+ * @value: the specified target register value
8077 * @mask: the specified target register mask
8178 *
8279 * Return: 0 for success; else the error code is returned
8380 */
84−int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u32 value,
85− u32 subsys, u32 offset, u32 mask);
81+int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys,
82+ u16 offset, u32 value, u32 mask);
8683
8784 /**
8885 * cmdq_pkt_wfe() - append wait for event command to the CMDQ packet
@@ -91,7 +88,7 @@ int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u32 value, · 2 unmodified lines
9188 *
9289 * Return: 0 for success; else the error code is returned
9390 */
94−int cmdq_pkt_wfe(struct cmdq_pkt *pkt, u32 event);
91+int cmdq_pkt_wfe(struct cmdq_pkt *pkt, u16 event);
9592
9693 /**
9794 * cmdq_pkt_clear_event() - append clear event command to the CMDQ packet
@@ -100,7 +97,7 @@ int cmdq_pkt_wfe(struct cmdq_pkt *pkt, u32 event); · 2 unmodified lines
10097 *
10198 * Return: 0 for success; else the error code is returned
10299 */
103−int cmdq_pkt_clear_event(struct cmdq_pkt *pkt, u32 event);
100+int cmdq_pkt_clear_event(struct cmdq_pkt *pkt, u16 event);
104101
105102 /**
106103 * cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the CMDQ
include/linux/soc/nxp/lpc32xx-misc.h+33−0
@@ -0,0 +1,33 @@
1+/* SPDX-License-Identifier: GPL-2.0-or-later */
2+/*
3+ * Author: Kevin Wells <kevin.wells@nxp.com>
4+ *
5+ * Copyright (C) 2010 NXP Semiconductors
6+ */
7+
8+#ifndef __SOC_LPC32XX_MISC_H
9+#define __SOC_LPC32XX_MISC_H
10+
11+#include <linux/types.h>
12+#include <linux/phy.h>
13+
14+#ifdef CONFIG_ARCH_LPC32XX
15+extern u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr);
16+extern void lpc32xx_set_phy_interface_mode(phy_interface_t mode);
17+extern void lpc32xx_loopback_set(resource_size_t mapbase, int state);
18+#else
19+static inline u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr)
20+{
21+ *mapbase = NULL;
22+ *dmaaddr = 0;
23+ return 0;
24+}
25+static inline void lpc32xx_set_phy_interface_mode(phy_interface_t mode)
26+{
27+}
28+static inline void lpc32xx_loopback_set(resource_size_t mapbase, int state)
29+{
30+}
31+#endif
32+
33+#endif /* __SOC_LPC32XX_MISC_H */
include/linux/soc/samsung/exynos-chipid.h+52−0
@@ -0,0 +1,52 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
4+ * http://www.samsung.com/
5+ *
6+ * Exynos - CHIPID support
7+ */
8+#ifndef __LINUX_SOC_EXYNOS_CHIPID_H
9+#define __LINUX_SOC_EXYNOS_CHIPID_H
10+
11+#define EXYNOS_CHIPID_REG_PRO_ID 0x00
12+#define EXYNOS_SUBREV_MASK (0xf << 4)
13+#define EXYNOS_MAINREV_MASK (0xf << 0)
14+#define EXYNOS_REV_MASK (EXYNOS_SUBREV_MASK | \
15+ EXYNOS_MAINREV_MASK)
16+#define EXYNOS_MASK 0xfffff000
17+
18+#define EXYNOS_CHIPID_REG_PKG_ID 0x04
19+/* Bit field definitions for EXYNOS_CHIPID_REG_PKG_ID register */
20+#define EXYNOS5422_IDS_OFFSET 24
21+#define EXYNOS5422_IDS_MASK 0xff
22+#define EXYNOS5422_USESG_OFFSET 3
23+#define EXYNOS5422_USESG_MASK 0x01
24+#define EXYNOS5422_SG_OFFSET 0
25+#define EXYNOS5422_SG_MASK 0x07
26+#define EXYNOS5422_TABLE_OFFSET 8
27+#define EXYNOS5422_TABLE_MASK 0x03
28+#define EXYNOS5422_SG_A_OFFSET 17
29+#define EXYNOS5422_SG_A_MASK 0x0f
30+#define EXYNOS5422_SG_B_OFFSET 21
31+#define EXYNOS5422_SG_B_MASK 0x03
32+#define EXYNOS5422_SG_BSIGN_OFFSET 23
33+#define EXYNOS5422_SG_BSIGN_MASK 0x01
34+#define EXYNOS5422_BIN2_OFFSET 12
35+#define EXYNOS5422_BIN2_MASK 0x01
36+
37+#define EXYNOS_CHIPID_REG_LOT_ID 0x14
38+
39+#define EXYNOS_CHIPID_REG_AUX_INFO 0x1c
40+/* Bit field definitions for EXYNOS_CHIPID_REG_AUX_INFO register */
41+#define EXYNOS5422_TMCB_OFFSET 0
42+#define EXYNOS5422_TMCB_MASK 0x7f
43+#define EXYNOS5422_ARM_UP_OFFSET 8
44+#define EXYNOS5422_ARM_UP_MASK 0x03
45+#define EXYNOS5422_ARM_DN_OFFSET 10
46+#define EXYNOS5422_ARM_DN_MASK 0x03
47+#define EXYNOS5422_KFC_UP_OFFSET 12
48+#define EXYNOS5422_KFC_UP_MASK 0x03
49+#define EXYNOS5422_KFC_DN_OFFSET 14
50+#define EXYNOS5422_KFC_DN_MASK 0x03
51+
52+#endif /*__LINUX_SOC_EXYNOS_CHIPID_H */
include/linux/soc/ti/ti_sci_protocol.h+3−0
@@ -97,7 +97,10 @@ struct ti_sci_core_ops { · 96 unmodified lines
9797 */
9898 struct ti_sci_dev_ops {
9999 int (*get_device)(const struct ti_sci_handle *handle, u32 id);
100+ int (*get_device_exclusive)(const struct ti_sci_handle *handle, u32 id);
100101 int (*idle_device)(const struct ti_sci_handle *handle, u32 id);
102+ int (*idle_device_exclusive)(const struct ti_sci_handle *handle,
103+ u32 id);
101104 int (*put_device)(const struct ti_sci_handle *handle, u32 id);
102105 int (*is_valid)(const struct ti_sci_handle *handle, u32 id);
103106 int (*get_context_loss_count)(const struct ti_sci_handle *handle,
include/linux/socket.h+3−0
@@ -292,6 +292,9 @@ struct ucred { · 291 unmodified lines
292292 #define MSG_BATCH 0x40000 /* sendmmsg(): more messages coming */
293293 #define MSG_EOF MSG_FIN
294294 #define MSG_NO_SHARED_FRAGS 0x80000 /* sendpage() internal : page frags are not shared */
295+#define MSG_SENDPAGE_DECRYPTED 0x100000 /* sendpage() internal : page may carry
296+ * plain text and require encryption
297+ */
295298
296299 #define MSG_ZEROCOPY 0x4000000 /* Use user data in kernel path */
297300 #define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */
include/linux/sort.h+5−0
@@ -4,6 +4,11 @@ · 3 unmodified lines
44
55 #include <linux/types.h>
66
7+void sort_r(void *base, size_t num, size_t size,
8+ int (*cmp)(const void *, const void *, const void *),
9+ void (*swap)(void *, void *, int),
10+ const void *priv);
11+
712 void sort(void *base, size_t num, size_t size,
813 int (*cmp)(const void *, const void *),
914 void (*swap)(void *, void *, int));
include/linux/soundwire/sdw.h+18−2
@@ -4,6 +4,8 @@ · 3 unmodified lines
44 #ifndef __SOUNDWIRE_H
55 #define __SOUNDWIRE_H
66
7+#include <linux/mod_devicetable.h>
8+
79 struct sdw_bus;
810 struct sdw_slave;
911
@@ -377,6 +379,8 @@ struct sdw_slave_prop { · 367 unmodified lines
377379 * @dynamic_frame: Dynamic frame shape supported
378380 * @err_threshold: Number of times that software may retry sending a single
379381 * command
382+ * @mclk_freq: clock reference passed to SoundWire Master, in Hz.
383+ * @hw_disabled: if true, the Master is not functional, typically due to pin-mux
380384 */
381385 struct sdw_master_prop {
382386 u32 revision;
@@ -391,6 +395,8 @@ struct sdw_master_prop { · 8 unmodified lines
391395 u32 default_col;
392396 bool dynamic_frame;
393397 u32 err_threshold;
398+ u32 mclk_freq;
399+ bool hw_disabled;
394400 };
395401
396402 int sdw_master_read_prop(struct sdw_bus *bus);
@@ -538,6 +544,7 @@ struct sdw_slave_ops { · 141 unmodified lines
538544 * @bus: Bus handle
539545 * @ops: Slave callback ops
540546 * @prop: Slave properties
547+ * @debugfs: Slave debugfs
541548 * @node: node for bus list
542549 * @port_ready: Port ready completion flag for each Slave port
543550 * @dev_num: Device Number assigned by Bus
@@ -549,6 +556,9 @@ struct sdw_slave { · 5 unmodified lines
549556 struct sdw_bus *bus;
550557 const struct sdw_slave_ops *ops;
551558 struct sdw_slave_prop prop;
559+#ifdef CONFIG_DEBUG_FS
560+ struct dentry *debugfs;
561+#endif
552562 struct list_head node;
553563 struct completion *port_ready;
554564 u16 dev_num;
@@ -718,6 +728,7 @@ struct sdw_master_ops { · 163 unmodified lines
718728 * Bit set implies used number, bit clear implies unused number.
719729 * @bus_lock: bus lock
720730 * @msg_lock: message lock
731+ * @compute_params: points to Bus resource management implementation
721732 * @ops: Master callback ops
722733 * @port_ops: Master port callback ops
723734 * @params: Current bus parameters
@@ -725,6 +736,7 @@ struct sdw_master_ops { · 1 unmodified line
725736 * @m_rt_list: List of Master instance of all stream(s) running on Bus. This
726737 * is used to compute and program bus bandwidth, clock, frame shape,
727738 * transport and port parameters
739+ * @debugfs: Bus debugfs
728740 * @defer_msg: Defer message
729741 * @clk_stop_timeout: Clock stop timeout computed
730742 * @bank_switch_timeout: Bank switch timeout computed
@@ -739,11 +751,15 @@ struct sdw_bus { · 8 unmodified lines
739751 DECLARE_BITMAP(assigned, SDW_MAX_DEVICES);
740752 struct mutex bus_lock;
741753 struct mutex msg_lock;
754+ int (*compute_params)(struct sdw_bus *bus);
742755 const struct sdw_master_ops *ops;
743756 const struct sdw_master_port_ops *port_ops;
744757 struct sdw_bus_params params;
745758 struct sdw_master_prop prop;
746759 struct list_head m_rt_list;
760+#ifdef CONFIG_DEBUG_FS
761+ struct dentry *debugfs;
762+#endif
747763 struct sdw_defer defer_msg;
748764 unsigned int clk_stop_timeout;
749765 u32 bank_switch_timeout;
@@ -828,7 +844,7 @@ struct sdw_stream_params { · 78 unmodified lines
828844 * @m_rt_count: Count of Master runtime(s) in this stream
829845 */
830846 struct sdw_stream_runtime {
831− char *name;
847+ const char *name;
832848 struct sdw_stream_params params;
833849 enum sdw_stream_state state;
834850 enum sdw_stream_type type;
@@ -836,7 +852,7 @@ struct sdw_stream_runtime { · 1 unmodified line
836852 int m_rt_count;
837853 };
838854
839−struct sdw_stream_runtime *sdw_alloc_stream(char *stream_name);
855+struct sdw_stream_runtime *sdw_alloc_stream(const char *stream_name);
840856 void sdw_release_stream(struct sdw_stream_runtime *stream);
841857 int sdw_stream_add_master(struct sdw_bus *bus,
842858 struct sdw_stream_config *stream_config,
include/linux/soundwire/sdw_intel.h+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 * struct sdw_intel_ops: Intel audio driver callback ops
99 *
1010 * @config_stream: configure the stream with the hw_params
11+ * the first argument containing the context is mandatory
1112 */
1213 struct sdw_intel_ops {
1314 int (*config_stream)(void *arg, void *substream,
include/linux/spinlock.h+1−1
@@ -214,7 +214,7 @@ static inline void do_raw_spin_unlock(raw_spinlock_t *lock) __releases(lock) · 213 unmodified lines
214214
215215 /*
216216 * Define the various spin_lock methods. Note we define these
217− * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The
217+ * regardless of whether CONFIG_SMP or CONFIG_PREEMPTION are set. The
218218 * various methods are defined as nops in the case they are not
219219 * required.
220220 */
include/linux/spinlock_api_smp.h+1−1
@@ -96,7 +96,7 @@ static inline int __raw_spin_trylock(raw_spinlock_t *lock) · 95 unmodified lines
9696
9797 /*
9898 * If lockdep is enabled then we use the non-preemption spin-ops
99− * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are
99+ * even on CONFIG_PREEMPTION, because lockdep assumes that interrupts are
100100 * not re-enabled during lock-acquire (which the preempt-spin-ops do):
101101 */
102102 #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC)
include/linux/stacktrace.h+2−2
@@ -9,9 +9,9 @@ struct task_struct; · 8 unmodified lines
99 struct pt_regs;
1010
1111 #ifdef CONFIG_STACKTRACE
12−void stack_trace_print(unsigned long *trace, unsigned int nr_entries,
12+void stack_trace_print(const unsigned long *trace, unsigned int nr_entries,
1313 int spaces);
14−int stack_trace_snprint(char *buf, size_t size, unsigned long *entries,
14+int stack_trace_snprint(char *buf, size_t size, const unsigned long *entries,
1515 unsigned int nr_entries, int spaces);
1616 unsigned int stack_trace_save(unsigned long *store, unsigned int size,
1717 unsigned int skipnr);
include/linux/stmmac.h+4−0
@@ -81,6 +81,7 @@ struct stmmac_mdio_bus_data { · 80 unmodified lines
8181 unsigned int phy_mask;
8282 int *irqs;
8383 int probed_phy_irq;
84+ bool needs_reset;
8485 };
8586
8687 struct stmmac_dma_cfg {
@@ -130,6 +131,7 @@ struct plat_stmmacenet_data { · 43 unmodified lines
130131 int bus_id;
131132 int phy_addr;
132133 int interface;
134+ int phy_interface;
133135 struct stmmac_mdio_bus_data *mdio_bus_data;
134136 struct device_node *phy_node;
135137 struct device_node *phylink_node;
@@ -167,11 +169,13 @@ struct plat_stmmacenet_data { · 31 unmodified lines
167169 struct clk *clk_ptp_ref;
168170 unsigned int clk_ptp_rate;
169171 unsigned int clk_ref_rate;
172+ s32 ptp_max_adj;
170173 struct reset_control *stmmac_rst;
171174 struct stmmac_axi *axi;
172175 int has_gmac4;
173176 bool has_sun8i;
174177 bool tso_en;
178+ int rss_en;
175179 int mac_port_sel_speed;
176180 bool en_tx_lpi_clockgating;
177181 int has_xgmac;
include/linux/string.h+3−2
@@ -474,8 +474,9 @@ static inline void memcpy_and_pad(void *dest, size_t dest_len, · 473 unmodified lines
474474 * But this can lead to bugs due to typos, or if prefix is a pointer
475475 * and not a constant. Instead use str_has_prefix().
476476 *
477− * Returns: 0 if @str does not start with @prefix
478− strlen(@prefix) if @str does start with @prefix
477+ * Returns:
478+ * * strlen(@prefix) if @str starts with @prefix
479+ * * 0 if @str does not start with @prefix
479480 */
480481 static __always_inline size_t str_has_prefix(const char *str, const char *prefix)
481482 {
include/linux/sunrpc/cache.h+4−3
@@ -87,6 +87,7 @@ struct cache_detail { · 86 unmodified lines
8787 int has_died);
8888
8989 struct cache_head * (*alloc)(void);
90+ void (*flush)(void);
9091 int (*match)(struct cache_head *orig, struct cache_head *new);
9192 void (*init)(struct cache_head *orig, struct cache_head *new);
9293 void (*update)(struct cache_head *orig, struct cache_head *new);
@@ -107,9 +108,9 @@ struct cache_detail { · 14 unmodified lines
107108 /* fields for communication over channel */
108109 struct list_head queue;
109110
110− atomic_t readers; /* how many time is /chennel open */
111− time_t last_close; /* if no readers, when did last close */
112− time_t last_warn; /* when we last warned about no readers */
111+ atomic_t writers; /* how many time is /channel open */
112+ time_t last_close; /* if no writers, when did last close */
113+ time_t last_warn; /* when we last warned about no writers */
113114
114115 union {
115116 struct proc_dir_entry *procfs;
include/linux/sunrpc/sched.h+0−4
@@ -98,7 +98,6 @@ typedef void (*rpc_action)(struct rpc_task *); · 97 unmodified lines
9898
9999 struct rpc_call_ops {
100100 void (*rpc_call_prepare)(struct rpc_task *, void *);
101− void (*rpc_call_prepare_transmit)(struct rpc_task *, void *);
102101 void (*rpc_call_done)(struct rpc_task *, void *);
103102 void (*rpc_count_stats)(struct rpc_task *, void *);
104103 void (*rpc_release)(void *);
@@ -243,9 +242,6 @@ void rpc_sleep_on_priority_timeout(struct rpc_wait_queue *queue, · 138 unmodified lines
243242 void rpc_sleep_on_priority(struct rpc_wait_queue *,
244243 struct rpc_task *,
245244 int priority);
246−void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq,
247− struct rpc_wait_queue *queue,
248− struct rpc_task *task);
249245 void rpc_wake_up_queued_task(struct rpc_wait_queue *,
250246 struct rpc_task *);
251247 void rpc_wake_up_queued_task_set_status(struct rpc_wait_queue *,
include/linux/sunrpc/svc_rdma.h+3−3
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242
4343 #ifndef SVC_RDMA_H
4444 #define SVC_RDMA_H
45+#include <linux/llist.h>
4546 #include <linux/sunrpc/xdr.h>
4647 #include <linux/sunrpc/svcsock.h>
4748 #include <linux/sunrpc/rpc_rdma.h>
@@ -107,8 +108,7 @@ struct svcxprt_rdma { · 59 unmodified lines
107108 struct list_head sc_read_complete_q;
108109 struct work_struct sc_work;
109110
110− spinlock_t sc_recv_lock;
111− struct list_head sc_recv_ctxts;
111+ struct llist_head sc_recv_ctxts;
112112 };
113113 /* sc_flags */
114114 #define RDMAXPRT_CONN_PENDING 3
@@ -125,6 +125,7 @@ enum { · 10 unmodified lines
125125 #define RPCSVC_MAXPAYLOAD_RDMA RPCSVC_MAXPAYLOAD
126126
127127 struct svc_rdma_recv_ctxt {
128+ struct llist_node rc_node;
128129 struct list_head rc_list;
129130 struct ib_recv_wr rc_recv_wr;
130131 struct ib_cqe rc_cqe;
@@ -200,7 +201,6 @@ extern struct svc_xprt_class svc_rdma_bc_class; · 69 unmodified lines
200201 #endif
201202
202203 /* svc_rdma.c */
203−extern struct workqueue_struct *svc_rdma_wq;
204204 extern int svc_rdma_init(void);
205205 extern void svc_rdma_cleanup(void);
206206
include/linux/sunrpc/xdr.h+1−1
@@ -186,7 +186,7 @@ xdr_adjust_iovec(struct kvec *iov, __be32 *p) · 185 unmodified lines
186186 extern void xdr_shift_buf(struct xdr_buf *, size_t);
187187 extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *);
188188 extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int);
189−extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int);
189+extern int xdr_buf_read_mic(struct xdr_buf *, struct xdr_netobj *, unsigned int);
190190 extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
191191 extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
192192
include/linux/sunrpc/xprt.h+1−0
@@ -352,6 +352,7 @@ bool xprt_prepare_transmit(struct rpc_task *task); · 351 unmodified lines
352352 void xprt_request_enqueue_transmit(struct rpc_task *task);
353353 void xprt_request_enqueue_receive(struct rpc_task *task);
354354 void xprt_request_wait_receive(struct rpc_task *task);
355+void xprt_request_dequeue_xprt(struct rpc_task *task);
355356 bool xprt_request_need_retransmit(struct rpc_task *task);
356357 void xprt_transmit(struct rpc_task *task);
357358 void xprt_end_transmit(struct rpc_task *task);
include/linux/sunrpc/xprtrdma.h+2−2
@@ -49,9 +49,9 @@ · 48 unmodified lines
4949 * fully-chunked NFS message (read chunks are the largest). Note only
5050 * a single chunk type per message is supported currently.
5151 */
52−#define RPCRDMA_MIN_SLOT_TABLE (2U)
52+#define RPCRDMA_MIN_SLOT_TABLE (4U)
5353 #define RPCRDMA_DEF_SLOT_TABLE (128U)
54−#define RPCRDMA_MAX_SLOT_TABLE (256U)
54+#define RPCRDMA_MAX_SLOT_TABLE (16384U)
5555
5656 #define RPCRDMA_MIN_INLINE (1024) /* min inline thresh */
5757 #define RPCRDMA_DEF_INLINE (4096) /* default inline thresh */
include/linux/suspend.h+3−1
@@ -190,8 +190,9 @@ struct platform_suspend_ops { · 189 unmodified lines
190190 struct platform_s2idle_ops {
191191 int (*begin)(void);
192192 int (*prepare)(void);
193+ int (*prepare_late)(void);
193194 void (*wake)(void);
194− void (*sync)(void);
195+ void (*restore_early)(void);
195196 void (*restore)(void);
196197 void (*end)(void);
197198 };
@@ -336,6 +337,7 @@ static inline void pm_set_suspend_via_firmware(void) {} · 138 unmodified lines
336337 static inline void pm_set_resume_via_firmware(void) {}
337338 static inline bool pm_suspend_via_firmware(void) { return false; }
338339 static inline bool pm_resume_via_firmware(void) { return false; }
340+static inline bool pm_suspend_no_platform(void) { return false; }
339341 static inline bool pm_suspend_default_s2idle(void) { return false; }
340342
341343 static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {}
include/linux/swap.h+2−0
@@ -340,6 +340,7 @@ extern void lru_add_drain_cpu(int cpu); · 339 unmodified lines
340340 extern void lru_add_drain_all(void);
341341 extern void rotate_reclaimable_page(struct page *page);
342342 extern void deactivate_file_page(struct page *page);
343+extern void deactivate_page(struct page *page);
343344 extern void mark_page_lazyfree(struct page *page);
344345 extern void swap_setup(void);
345346
@@ -364,6 +365,7 @@ extern int vm_swappiness; · 18 unmodified lines
364365 extern int remove_mapping(struct address_space *mapping, struct page *page);
365366 extern unsigned long vm_total_pages;
366367
368+extern unsigned long reclaim_pages(struct list_head *page_list);
367369 #ifdef CONFIG_NUMA
368370 extern int node_reclaim_mode;
369371 extern int sysctl_min_unmapped_ratio;
include/linux/swiotlb.h+6−2
@@ -46,13 +46,17 @@ enum dma_sync_target { · 45 unmodified lines
4646
4747 extern phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
4848 dma_addr_t tbl_dma_addr,
49− phys_addr_t phys, size_t size,
49+ phys_addr_t phys,
50+ size_t mapping_size,
51+ size_t alloc_size,
5052 enum dma_data_direction dir,
5153 unsigned long attrs);
5254
5355 extern void swiotlb_tbl_unmap_single(struct device *hwdev,
5456 phys_addr_t tlb_addr,
55− size_t size, enum dma_data_direction dir,
57+ size_t mapping_size,
58+ size_t alloc_size,
59+ enum dma_data_direction dir,
5660 unsigned long attrs);
5761
5862 extern void swiotlb_tbl_sync_single(struct device *hwdev,
include/linux/sys_soc.h+1−0
@@ -12,6 +12,7 @@ struct soc_device_attribute { · 11 unmodified lines
1212 const char *machine;
1313 const char *family;
1414 const char *revision;
15+ const char *serial_number;
1516 const char *soc_id;
1617 const void *data;
1718 };
include/linux/syscalls.h+19−0
@@ -1402,4 +1402,23 @@ static inline unsigned int ksys_personality(unsigned int personality) · 1401 unmodified lines
14021402 return old;
14031403 }
14041404
1405+/* for __ARCH_WANT_SYS_IPC */
1406+long ksys_semtimedop(int semid, struct sembuf __user *tsops,
1407+ unsigned int nsops,
1408+ const struct __kernel_timespec __user *timeout);
1409+long ksys_semget(key_t key, int nsems, int semflg);
1410+long ksys_old_semctl(int semid, int semnum, int cmd, unsigned long arg);
1411+long ksys_msgget(key_t key, int msgflg);
1412+long ksys_old_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
1413+long ksys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz,
1414+ long msgtyp, int msgflg);
1415+long ksys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz,
1416+ int msgflg);
1417+long ksys_shmget(key_t key, size_t size, int shmflg);
1418+long ksys_shmdt(char __user *shmaddr);
1419+long ksys_old_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
1420+long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems,
1421+ unsigned int nsops,
1422+ const struct old_timespec32 __user *timeout);
1423+
14051424 #endif
include/linux/sysfs.h+9−0
@@ -196,6 +196,12 @@ struct bin_attribute { · 195 unmodified lines
196196 .size = _size, \
197197 }
198198
199+#define __BIN_ATTR_WO(_name) { \
200+ .attr = { .name = __stringify(_name), .mode = 0200 }, \
201+ .store = _name##_store, \
202+ .size = _size, \
203+}
204+
199205 #define __BIN_ATTR_RW(_name, _size) \
200206 __BIN_ATTR(_name, 0644, _name##_read, _name##_write, _size)
201207
@@ -208,6 +214,9 @@ struct bin_attribute bin_attr_##_name = __BIN_ATTR(_name, _mode, _read, \ · 6 unmodified lines
208214 #define BIN_ATTR_RO(_name, _size) \
209215 struct bin_attribute bin_attr_##_name = __BIN_ATTR_RO(_name, _size)
210216
217+#define BIN_ATTR_WO(_name, _size) \
218+struct bin_attribute bin_attr_##_name = __BIN_ATTR_WO(_name, _size)
219+
211220 #define BIN_ATTR_RW(_name, _size) \
212221 struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size)
213222
include/linux/t10-pi.h+0−14
@@ -53,18 +53,4 @@ extern const struct blk_integrity_profile t10_pi_type1_ip; · 52 unmodified lines
5353 extern const struct blk_integrity_profile t10_pi_type3_crc;
5454 extern const struct blk_integrity_profile t10_pi_type3_ip;
5555
56−#ifdef CONFIG_BLK_DEV_INTEGRITY
57−extern void t10_pi_prepare(struct request *rq, u8 protection_type);
58−extern void t10_pi_complete(struct request *rq, u8 protection_type,
59− unsigned int intervals);
60−#else
61−static inline void t10_pi_complete(struct request *rq, u8 protection_type,
62− unsigned int intervals)
63−{
64−}
65−static inline void t10_pi_prepare(struct request *rq, u8 protection_type)
66−{
67−}
68−#endif
69−
7056 #endif
include/linux/tcp.h+2−0
@@ -354,6 +354,8 @@ struct tcp_sock { · 353 unmodified lines
354354 #define BPF_SOCK_OPS_TEST_FLAG(TP, ARG) 0
355355 #endif
356356
357+ u32 rcv_ooopack; /* Received out-of-order packets, for tcpinfo */
358+
357359 /* Receiver side RTT estimation */
358360 u32 rcv_rtt_last_tsecr;
359361 struct {
include/linux/thermal.h+2−2
@@ -251,7 +251,7 @@ struct thermal_bind_params { · 250 unmodified lines
251251 * platform characterization. This value is relative to the
252252 * rest of the weights so a cooling device whose weight is
253253 * double that of another cooling device is twice as
254− * effective. See Documentation/thermal/sysfs-api.rst for more
254+ * effective. See Documentation/driver-api/thermal/sysfs-api.rst for more
255255 * information.
256256 */
257257 int weight;
@@ -259,7 +259,7 @@ struct thermal_bind_params { · 1 unmodified line
259259 /*
260260 * This is a bit mask that gives the binding relation between this
261261 * thermal zone and cdev, for a particular trip point.
262− * See Documentation/thermal/sysfs-api.rst for more information.
262+ * See Documentation/driver-api/thermal/sysfs-api.rst for more information.
263263 */
264264 int trip_mask;
265265
include/linux/thread_info.h+1−1
@@ -134,7 +134,7 @@ static inline void copy_overflow(int size, unsigned long count) · 133 unmodified lines
134134 WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);
135135 }
136136
137−static __always_inline bool
137+static __always_inline __must_check bool
138138 check_copy_size(const void *addr, size_t bytes, bool is_source)
139139 {
140140 int sz = __compiletime_object_size(addr);
include/linux/thunderbolt.h+2−0
@@ -429,6 +429,7 @@ static inline struct tb_xdomain *tb_service_parent(struct tb_service *svc) · 428 unmodified lines
429429 * @lock: Must be held during ring creation/destruction. Is acquired by
430430 * interrupt_work when dispatching interrupts to individual rings.
431431 * @pdev: Pointer to the PCI device
432+ * @ops: NHI specific optional ops
432433 * @iobase: MMIO space of the NHI
433434 * @tx_rings: All Tx rings available on this host controller
434435 * @rx_rings: All Rx rings available on this host controller
@@ -442,6 +443,7 @@ static inline struct tb_xdomain *tb_service_parent(struct tb_service *svc) · 7 unmodified lines
442443 struct tb_nhi {
443444 spinlock_t lock;
444445 struct pci_dev *pdev;
446+ const struct tb_nhi_ops *ops;
445447 void __iomem *iobase;
446448 struct tb_ring **tx_rings;
447449 struct tb_ring **rx_rings;
include/linux/time64.h+2−0
@@ -30,6 +30,8 @@ struct itimerspec64 { · 29 unmodified lines
3030
3131 /* Located here for timespec[64]_valid_strict */
3232 #define TIME64_MAX ((s64)~((u64)1 << 63))
33+#define TIME64_MIN (-TIME64_MAX - 1)
34+
3335 #define KTIME_MAX ((s64)~((u64)1 << 63))
3436 #define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
3537
include/linux/timekeeper_internal.h+5−0
@@ -57,6 +57,7 @@ struct tk_read_base { · 56 unmodified lines
5757 * @cs_was_changed_seq: The sequence number of clocksource change events
5858 * @next_leap_ktime: CLOCK_MONOTONIC time value of a pending leap-second
5959 * @raw_sec: CLOCK_MONOTONIC_RAW time in seconds
60+ * @monotonic_to_boot: CLOCK_MONOTONIC to CLOCK_BOOTTIME offset
6061 * @cycle_interval: Number of clock cycles in one NTP interval
6162 * @xtime_interval: Number of clock shifted nano seconds in one NTP
6263 * interval.
@@ -84,6 +85,9 @@ struct tk_read_base { · 21 unmodified lines
8485 *
8586 * wall_to_monotonic is no longer the boot time, getboottime must be
8687 * used instead.
88+ *
89+ * @monotonic_to_boottime is a timespec64 representation of @offs_boot to
90+ * accelerate the VDSO update for CLOCK_BOOTTIME.
8791 */
8892 struct timekeeper {
8993 struct tk_read_base tkr_mono;
@@ -99,6 +103,7 @@ struct timekeeper { · 9 unmodified lines
99103 u8 cs_was_changed_seq;
100104 ktime_t next_leap_ktime;
101105 u64 raw_sec;
106+ struct timespec64 monotonic_to_boot;
102107
103108 /* The following members are for timekeeping internal use */
104109 u64 cycle_interval;
include/linux/timer.h+1−1
@@ -183,7 +183,7 @@ extern void add_timer(struct timer_list *timer); · 182 unmodified lines
183183
184184 extern int try_to_del_timer_sync(struct timer_list *timer);
185185
186−#ifdef CONFIG_SMP
186+#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)
187187 extern int del_timer_sync(struct timer_list *timer);
188188 #else
189189 # define del_timer_sync(t) del_timer(t)
include/linux/timeriomem-rng.h+5−0
@@ -5,6 +5,9 @@ · 4 unmodified lines
55 * Copyright (c) 2009 Alexander Clouter <alex@digriz.org.uk>
66 */
77
8+#ifndef _LINUX_TIMERIOMEM_RNG_H
9+#define _LINUX_TIMERIOMEM_RNG_H
10+
811 struct timeriomem_rng_data {
912 void __iomem *address;
1013
@@ -14,3 +17,5 @@ struct timeriomem_rng_data { · 3 unmodified lines
1417 /* bits of entropy per 1024 bits read */
1518 unsigned int quality;
1619 };
20+
21+#endif /* _LINUX_TIMERIOMEM_RNG_H */
include/linux/timerqueue.h+16−7
@@ -12,8 +12,7 @@ struct timerqueue_node { · 11 unmodified lines
1212 };
1313
1414 struct timerqueue_head {
15− struct rb_root head;
16− struct timerqueue_node *next;
15+ struct rb_root_cached rb_root;
1716 };
1817
1918
@@ -29,13 +28,14 @@ extern struct timerqueue_node *timerqueue_iterate_next( · 9 unmodified lines
2928 *
3029 * @head: head of timerqueue
3130 *
32− * Returns a pointer to the timer node that has the
33− * earliest expiration time.
31+ * Returns a pointer to the timer node that has the earliest expiration time.
3432 */
3533 static inline
3634 struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head)
3735 {
38− return head->next;
36+ struct rb_node *leftmost = rb_first_cached(&head->rb_root);
37+
38+ return rb_entry(leftmost, struct timerqueue_node, node);
3939 }
4040
4141 static inline void timerqueue_init(struct timerqueue_node *node)
@@ -43,9 +43,18 @@ static inline void timerqueue_init(struct timerqueue_node *node) · 1 unmodified line
4343 RB_CLEAR_NODE(&node->node);
4444 }
4545
46+static inline bool timerqueue_node_queued(struct timerqueue_node *node)
47+{
48+ return !RB_EMPTY_NODE(&node->node);
49+}
50+
51+static inline bool timerqueue_node_expires(struct timerqueue_node *node)
52+{
53+ return node->expires;
54+}
55+
4656 static inline void timerqueue_init_head(struct timerqueue_head *head)
4757 {
48− head->head = RB_ROOT;
49− head->next = NULL;
58+ head->rb_root = RB_ROOT_CACHED;
5059 }
5160 #endif /* _LINUX_TIMERQUEUE_H */
include/linux/tnum.h+6−0
@@ -5,6 +5,10 @@ · 4 unmodified lines
55 * propagate the unknown bits such that the tnum result represents all the
66 * possible results for possible values of the operands.
77 */
8+
9+#ifndef _LINUX_TNUM_H
10+#define _LINUX_TNUM_H
11+
812 #include <linux/types.h>
913
1014 struct tnum {
@@ -81,3 +85,5 @@ bool tnum_in(struct tnum a, struct tnum b); · 70 unmodified lines
8185 int tnum_strn(char *str, size_t size, struct tnum a);
8286 /* Format a tnum as tristate binary expansion */
8387 int tnum_sbin(char *str, size_t size, struct tnum a);
88+
89+#endif /* _LINUX_TNUM_H */
include/linux/topology.h+15−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #ifndef _LINUX_TOPOLOGY_H
2828 #define _LINUX_TOPOLOGY_H
2929
30+#include <linux/arch_topology.h>
3031 #include <linux/cpumask.h>
3132 #include <linux/bitops.h>
3233 #include <linux/mmzone.h>
@@ -59,6 +60,20 @@ int arch_update_cpu_topology(void); · 26 unmodified lines
5960 */
6061 #define RECLAIM_DISTANCE 30
6162 #endif
63+
64+/*
65+ * The following tunable allows platforms to override the default node
66+ * reclaim distance (RECLAIM_DISTANCE) if remote memory accesses are
67+ * sufficiently fast that the default value actually hurts
68+ * performance.
69+ *
70+ * AMD EPYC machines use this because even though the 2-hop distance
71+ * is 32 (3.2x slower than a local memory access) performance actually
72+ * *improves* if allowed to reclaim memory and load balance tasks
73+ * between NUMA nodes 2-hops apart.
74+ */
75+extern int __read_mostly node_reclaim_distance;
76+
6277 #ifndef PENALTY_FOR_NODE_WITH_CPUS
6378 #define PENALTY_FOR_NODE_WITH_CPUS (1)
6479 #endif
include/linux/torture.h+1−1
@@ -86,7 +86,7 @@ void _torture_stop_kthread(char *m, struct task_struct **tp); · 85 unmodified lines
8686 #define torture_stop_kthread(n, tp) \
8787 _torture_stop_kthread("Stopping " #n " task", &(tp))
8888
89−#ifdef CONFIG_PREEMPT
89+#ifdef CONFIG_PREEMPTION
9090 #define torture_preempt_schedule() preempt_schedule()
9191 #else
9292 #define torture_preempt_schedule()
include/linux/trace_events.h+1−0
@@ -548,6 +548,7 @@ extern int trace_event_get_offsets(struct trace_event_call *call); · 547 unmodified lines
548548
549549 #define is_signed_type(type) (((type)(-1)) < (type)1)
550550
551+int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set);
551552 int trace_set_clr_event(const char *system, const char *event, int set);
552553
553554 /*
include/linux/uaccess.h+11−10
@@ -55,7 +55,7 @@ · 54 unmodified lines
5555 * as usual) and both source and destination can trigger faults.
5656 */
5757
58−static __always_inline unsigned long
58+static __always_inline __must_check unsigned long
5959 __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)
6060 {
6161 kasan_check_write(to, n);
@@ -63,7 +63,7 @@ __copy_from_user_inatomic(void *to, const void __user *from, unsigned long n) · 1 unmodified line
6363 return raw_copy_from_user(to, from, n);
6464 }
6565
66−static __always_inline unsigned long
66+static __always_inline __must_check unsigned long
6767 __copy_from_user(void *to, const void __user *from, unsigned long n)
6868 {
6969 might_fault();
@@ -85,7 +85,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n) · 15 unmodified lines
8585 * The caller should also make sure he pins the user space address
8686 * so that we don't result in page fault and sleep.
8787 */
88−static __always_inline unsigned long
88+static __always_inline __must_check unsigned long
8989 __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
9090 {
9191 kasan_check_read(from, n);
@@ -93,7 +93,7 @@ __copy_to_user_inatomic(void __user *to, const void *from, unsigned long n) · 1 unmodified line
9393 return raw_copy_to_user(to, from, n);
9494 }
9595
96−static __always_inline unsigned long
96+static __always_inline __must_check unsigned long
9797 __copy_to_user(void __user *to, const void *from, unsigned long n)
9898 {
9999 might_fault();
@@ -103,7 +103,7 @@ __copy_to_user(void __user *to, const void *from, unsigned long n) · 3 unmodified lines
103103 }
104104
105105 #ifdef INLINE_COPY_FROM_USER
106−static inline unsigned long
106+static inline __must_check unsigned long
107107 _copy_from_user(void *to, const void __user *from, unsigned long n)
108108 {
109109 unsigned long res = n;
@@ -117,12 +117,12 @@ _copy_from_user(void *to, const void __user *from, unsigned long n) · 7 unmodified lines
117117 return res;
118118 }
119119 #else
120−extern unsigned long
120+extern __must_check unsigned long
121121 _copy_from_user(void *, const void __user *, unsigned long);
122122 #endif
123123
124124 #ifdef INLINE_COPY_TO_USER
125−static inline unsigned long
125+static inline __must_check unsigned long
126126 _copy_to_user(void __user *to, const void *from, unsigned long n)
127127 {
128128 might_fault();
@@ -133,7 +133,7 @@ _copy_to_user(void __user *to, const void *from, unsigned long n) · 4 unmodified lines
133133 return n;
134134 }
135135 #else
136−extern unsigned long
136+extern __must_check unsigned long
137137 _copy_to_user(void __user *, const void *, unsigned long);
138138 #endif
139139
@@ -222,8 +222,9 @@ static inline bool pagefault_disabled(void) · 82 unmodified lines
222222
223223 #ifndef ARCH_HAS_NOCACHE_UACCESS
224224
225−static inline unsigned long __copy_from_user_inatomic_nocache(void *to,
226− const void __user *from, unsigned long n)
225+static inline __must_check unsigned long
226+__copy_from_user_inatomic_nocache(void *to, const void __user *from,
227+ unsigned long n)
227228 {
228229 return __copy_from_user_inatomic(to, from, n);
229230 }
include/linux/usb.h+7−2
@@ -426,7 +426,6 @@ struct usb_bus { · 425 unmodified lines
426426 struct device *sysdev; /* as seen from firmware or bus */
427427 int busnum; /* Bus number (in order of reg) */
428428 const char *bus_name; /* stable id (PCI slot_name etc) */
429− u8 uses_dma; /* Does the host controller use DMA? */
430429 u8 uses_pio_for_control; /*
431430 * Does the host controller use PIO
432431 * for control transfers?
@@ -1151,6 +1150,8 @@ struct usbdrv_wrap { · 718 unmodified lines
11511150 * @id_table: USB drivers use ID table to support hotplugging.
11521151 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
11531152 * or your driver's probe function will never get called.
1153+ * @dev_groups: Attributes attached to the device that will be created once it
1154+ * is bound to the driver.
11541155 * @dynids: used internally to hold the list of dynamically added device
11551156 * ids for this driver.
11561157 * @drvwrap: Driver-model core structure wrapper.
@@ -1198,6 +1199,7 @@ struct usb_driver { · 41 unmodified lines
11981199 int (*post_reset)(struct usb_interface *intf);
11991200
12001201 const struct usb_device_id *id_table;
1202+ const struct attribute_group **dev_groups;
12011203
12021204 struct usb_dynids dynids;
12031205 struct usbdrv_wrap drvwrap;
@@ -1221,6 +1223,8 @@ struct usb_driver { · 17 unmodified lines
12211223 * module is being unloaded.
12221224 * @suspend: Called when the device is going to be suspended by the system.
12231225 * @resume: Called when the device is being resumed by the system.
1226+ * @dev_groups: Attributes attached to the device that will be created once it
1227+ * is bound to the driver.
12241228 * @drvwrap: Driver-model core structure wrapper.
12251229 * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend
12261230 * for devices bound to this driver.
@@ -1235,6 +1239,7 @@ struct usb_device_driver { · 8 unmodified lines
12351239
12361240 int (*suspend) (struct usb_device *udev, pm_message_t message);
12371241 int (*resume) (struct usb_device *udev, pm_message_t message);
1242+ const struct attribute_group **dev_groups;
12381243 struct usbdrv_wrap drvwrap;
12391244 unsigned int supports_autosuspend:1;
12401245 };
@@ -1457,7 +1462,7 @@ typedef void (*usb_complete_t)(struct urb *); · 216 unmodified lines
14571462 * field rather than determining a dma address themselves.
14581463 *
14591464 * Note that transfer_buffer must still be set if the controller
1460− * does not support DMA (as indicated by bus.uses_dma) and when talking
1465+ * does not support DMA (as indicated by hcd_uses_dma()) and when talking
14611466 * to root hub. If you have to trasfer between highmem zone and the device
14621467 * on such controller, create a bounce buffer or bail out with an error.
14631468 * If transfer_buffer cannot be set (is in highmem) and the controller is DMA
include/linux/usb/association.h+0−151
@@ -1,151 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0
2−/*
3− * Wireless USB - Cable Based Association
4− *
5− * Copyright (C) 2006 Intel Corporation
6− * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
7− *
8− * This program is free software; you can redistribute it and/or
9− * modify it under the terms of the GNU General Public License version
10− * 2 as published by the Free Software Foundation.
11− *
12− */
13−#ifndef __LINUX_USB_ASSOCIATION_H
14−#define __LINUX_USB_ASSOCIATION_H
15−
16−
17−/*
18− * Association attributes
19− *
20− * Association Models Supplement to WUSB 1.0 T[3-1]
21− *
22− * Each field in the structures has it's ID, it's length and then the
23− * value. This is the actual definition of the field's ID and its
24− * length.
25− */
26−struct wusb_am_attr {
27− __u8 id;
28− __u8 len;
29−};
30−
31−/* Different fields defined by the spec */
32−#define WUSB_AR_AssociationTypeId { .id = cpu_to_le16(0x0000), .len = cpu_to_le16(2) }
33−#define WUSB_AR_AssociationSubTypeId { .id = cpu_to_le16(0x0001), .len = cpu_to_le16(2) }
34−#define WUSB_AR_Length { .id = cpu_to_le16(0x0002), .len = cpu_to_le16(4) }
35−#define WUSB_AR_AssociationStatus { .id = cpu_to_le16(0x0004), .len = cpu_to_le16(4) }
36−#define WUSB_AR_LangID { .id = cpu_to_le16(0x0008), .len = cpu_to_le16(2) }
37−#define WUSB_AR_DeviceFriendlyName { .id = cpu_to_le16(0x000b), .len = cpu_to_le16(64) } /* max */
38−#define WUSB_AR_HostFriendlyName { .id = cpu_to_le16(0x000c), .len = cpu_to_le16(64) } /* max */
39−#define WUSB_AR_CHID { .id = cpu_to_le16(0x1000), .len = cpu_to_le16(16) }
40−#define WUSB_AR_CDID { .id = cpu_to_le16(0x1001), .len = cpu_to_le16(16) }
41−#define WUSB_AR_ConnectionContext { .id = cpu_to_le16(0x1002), .len = cpu_to_le16(48) }
42−#define WUSB_AR_BandGroups { .id = cpu_to_le16(0x1004), .len = cpu_to_le16(2) }
43−
44−/* CBAF Control Requests (AMS1.0[T4-1] */
45−enum {
46− CBAF_REQ_GET_ASSOCIATION_INFORMATION = 0x01,
47− CBAF_REQ_GET_ASSOCIATION_REQUEST,
48− CBAF_REQ_SET_ASSOCIATION_RESPONSE
49−};
50−
51−/*
52− * CBAF USB-interface defitions
53− *
54− * No altsettings, one optional interrupt endpoint.
55− */
56−enum {
57− CBAF_IFACECLASS = 0xef,
58− CBAF_IFACESUBCLASS = 0x03,
59− CBAF_IFACEPROTOCOL = 0x01,
60−};
61−
62−/* Association Information (AMS1.0[T4-3]) */
63−struct wusb_cbaf_assoc_info {
64− __le16 Length;
65− __u8 NumAssociationRequests;
66− __le16 Flags;
67− __u8 AssociationRequestsArray[];
68−} __attribute__((packed));
69−
70−/* Association Request (AMS1.0[T4-4]) */
71−struct wusb_cbaf_assoc_request {
72− __u8 AssociationDataIndex;
73− __u8 Reserved;
74− __le16 AssociationTypeId;
75− __le16 AssociationSubTypeId;
76− __le32 AssociationTypeInfoSize;
77−} __attribute__((packed));
78−
79−enum {
80− AR_TYPE_WUSB = 0x0001,
81− AR_TYPE_WUSB_RETRIEVE_HOST_INFO = 0x0000,
82− AR_TYPE_WUSB_ASSOCIATE = 0x0001,
83−};
84−
85−/* Association Attribute header (AMS1.0[3.8]) */
86−struct wusb_cbaf_attr_hdr {
87− __le16 id;
88− __le16 len;
89−} __attribute__((packed));
90−
91−/* Host Info (AMS1.0[T4-7]) (yeah, more headers and fields...) */
92−struct wusb_cbaf_host_info {
93− struct wusb_cbaf_attr_hdr AssociationTypeId_hdr;
94− __le16 AssociationTypeId;
95− struct wusb_cbaf_attr_hdr AssociationSubTypeId_hdr;
96− __le16 AssociationSubTypeId;
97− struct wusb_cbaf_attr_hdr CHID_hdr;
98− struct wusb_ckhdid CHID;
99− struct wusb_cbaf_attr_hdr LangID_hdr;
100− __le16 LangID;
101− struct wusb_cbaf_attr_hdr HostFriendlyName_hdr;
102− __u8 HostFriendlyName[];
103−} __attribute__((packed));
104−
105−/* Device Info (AMS1.0[T4-8])
106− *
107− * I still don't get this tag'n'header stuff for each goddamn
108− * field...
109− */
110−struct wusb_cbaf_device_info {
111− struct wusb_cbaf_attr_hdr Length_hdr;
112− __le32 Length;
113− struct wusb_cbaf_attr_hdr CDID_hdr;
114− struct wusb_ckhdid CDID;
115− struct wusb_cbaf_attr_hdr BandGroups_hdr;
116− __le16 BandGroups;
117− struct wusb_cbaf_attr_hdr LangID_hdr;
118− __le16 LangID;
119− struct wusb_cbaf_attr_hdr DeviceFriendlyName_hdr;
120− __u8 DeviceFriendlyName[];
121−} __attribute__((packed));
122−
123−/* Connection Context; CC_DATA - Success case (AMS1.0[T4-9]) */
124−struct wusb_cbaf_cc_data {
125− struct wusb_cbaf_attr_hdr AssociationTypeId_hdr;
126− __le16 AssociationTypeId;
127− struct wusb_cbaf_attr_hdr AssociationSubTypeId_hdr;
128− __le16 AssociationSubTypeId;
129− struct wusb_cbaf_attr_hdr Length_hdr;
130− __le32 Length;
131− struct wusb_cbaf_attr_hdr ConnectionContext_hdr;
132− struct wusb_ckhdid CHID;
133− struct wusb_ckhdid CDID;
134− struct wusb_ckhdid CK;
135− struct wusb_cbaf_attr_hdr BandGroups_hdr;
136− __le16 BandGroups;
137−} __attribute__((packed));
138−
139−/* CC_DATA - Failure case (AMS1.0[T4-10]) */
140−struct wusb_cbaf_cc_data_fail {
141− struct wusb_cbaf_attr_hdr AssociationTypeId_hdr;
142− __le16 AssociationTypeId;
143− struct wusb_cbaf_attr_hdr AssociationSubTypeId_hdr;
144− __le16 AssociationSubTypeId;
145− struct wusb_cbaf_attr_hdr Length_hdr;
146− __le16 Length;
147− struct wusb_cbaf_attr_hdr AssociationStatus_hdr;
148− __u32 AssociationStatus;
149−} __attribute__((packed));
150−
151−#endif /* __LINUX_USB_ASSOCIATION_H */
include/linux/usb/ch9.h+27−0
@@ -70,4 +70,31 @@ extern enum usb_device_speed usb_get_maximum_speed(struct device *dev); · 69 unmodified lines
7070 */
7171 extern const char *usb_state_string(enum usb_device_state state);
7272
73+#ifdef CONFIG_TRACING
74+/**
75+ * usb_decode_ctrl - Returns human readable representation of control request.
76+ * @str: buffer to return a human-readable representation of control request.
77+ * This buffer should have about 200 bytes.
78+ * @size: size of str buffer.
79+ * @bRequestType: matches the USB bmRequestType field
80+ * @bRequest: matches the USB bRequest field
81+ * @wValue: matches the USB wValue field (CPU byte order)
82+ * @wIndex: matches the USB wIndex field (CPU byte order)
83+ * @wLength: matches the USB wLength field (CPU byte order)
84+ *
85+ * Function returns decoded, formatted and human-readable description of
86+ * control request packet.
87+ *
88+ * The usage scenario for this is for tracepoints, so function as a return
89+ * use the same value as in parameters. This approach allows to use this
90+ * function in TP_printk
91+ *
92+ * Important: wValue, wIndex, wLength parameters before invoking this function
93+ * should be processed by le16_to_cpu macro.
94+ */
95+extern const char *usb_decode_ctrl(char *str, size_t size, __u8 bRequestType,
96+ __u8 bRequest, __u16 wValue, __u16 wIndex,
97+ __u16 wLength);
98+#endif
99+
73100 #endif /* __LINUX_USB_CH9_H */
include/linux/usb/gadget.h+3−0
@@ -291,6 +291,9 @@ struct usb_dcd_config_params { · 290 unmodified lines
291291 #define USB_DEFAULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */
292292 __le16 bU2DevExitLat; /* U2 Device exit Latency */
293293 #define USB_DEFAULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */
294+ __u8 besl_baseline; /* Recommended baseline BESL (0-15) */
295+ __u8 besl_deep; /* Recommended deep BESL (0-15) */
296+#define USB_DEFAULT_BESL_UNSPECIFIED 0xFF /* No recommended value */
294297 };
295298
296299
include/linux/usb/hcd.h+10−0
@@ -256,6 +256,7 @@ struct hc_driver { · 255 unmodified lines
256256
257257 int flags;
258258 #define HCD_MEMORY 0x0001 /* HC regs use memory (else I/O) */
259+#define HCD_DMA 0x0002 /* HC uses DMA */
259260 #define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */
260261 #define HCD_USB11 0x0010 /* USB 1.1 */
261262 #define HCD_USB2 0x0020 /* USB 2.0 */
@@ -422,6 +423,11 @@ static inline bool hcd_periodic_completion_in_progress(struct usb_hcd *hcd, · 160 unmodified lines
422423 return hcd->high_prio_bh.completing_ep == ep;
423424 }
424425
426+static inline bool hcd_uses_dma(struct usb_hcd *hcd)
427+{
428+ return IS_ENABLED(CONFIG_HAS_DMA) && (hcd->driver->flags & HCD_DMA);
429+}
430+
425431 extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
426432 extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb,
427433 int status);
@@ -591,6 +597,10 @@ extern void usb_ep0_reinit(struct usb_device *); · 163 unmodified lines
591597 #define GetPortStatus HUB_CLASS_REQ(USB_DIR_IN, USB_RT_PORT, USB_REQ_GET_STATUS)
592598 #define SetHubFeature HUB_CLASS_REQ(USB_DIR_OUT, USB_RT_HUB, USB_REQ_SET_FEATURE)
593599 #define SetPortFeature HUB_CLASS_REQ(USB_DIR_OUT, USB_RT_PORT, USB_REQ_SET_FEATURE)
600+#define ClearTTBuffer HUB_CLASS_REQ(USB_DIR_OUT, USB_RT_PORT, HUB_CLEAR_TT_BUFFER)
601+#define ResetTT HUB_CLASS_REQ(USB_DIR_OUT, USB_RT_PORT, HUB_RESET_TT)
602+#define GetTTState HUB_CLASS_REQ(USB_DIR_IN, USB_RT_PORT, HUB_GET_TT_STATE)
603+#define StopTT HUB_CLASS_REQ(USB_DIR_OUT, USB_RT_PORT, HUB_STOP_TT)
594604
595605
596606 /*-------------------------------------------------------------------------*/
include/linux/usb/role.h+37−0
@@ -42,14 +42,51 @@ struct usb_role_switch_desc { · 41 unmodified lines
4242 bool allow_userspace_control;
4343 };
4444
45+
46+#if IS_ENABLED(CONFIG_USB_ROLE_SWITCH)
4547 int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role);
4648 enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw);
4749 struct usb_role_switch *usb_role_switch_get(struct device *dev);
50+struct usb_role_switch *fwnode_usb_role_switch_get(struct fwnode_handle *node);
4851 void usb_role_switch_put(struct usb_role_switch *sw);
4952
5053 struct usb_role_switch *
5154 usb_role_switch_register(struct device *parent,
5255 const struct usb_role_switch_desc *desc);
5356 void usb_role_switch_unregister(struct usb_role_switch *sw);
57+#else
58+static inline int usb_role_switch_set_role(struct usb_role_switch *sw,
59+ enum usb_role role)
60+{
61+ return 0;
62+}
63+
64+static inline enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw)
65+{
66+ return USB_ROLE_NONE;
67+}
68+
69+static inline struct usb_role_switch *usb_role_switch_get(struct device *dev)
70+{
71+ return ERR_PTR(-ENODEV);
72+}
73+
74+static inline struct usb_role_switch *
75+fwnode_usb_role_switch_get(struct fwnode_handle *node)
76+{
77+ return ERR_PTR(-ENODEV);
78+}
79+
80+static inline void usb_role_switch_put(struct usb_role_switch *sw) { }
81+
82+static inline struct usb_role_switch *
83+usb_role_switch_register(struct device *parent,
84+ const struct usb_role_switch_desc *desc)
85+{
86+ return ERR_PTR(-ENODEV);
87+}
88+
89+static inline void usb_role_switch_unregister(struct usb_role_switch *sw) { }
90+#endif
5491
5592 #endif /* __LINUX_USB_ROLE_H */
include/linux/usb/samsung_usb_phy.h+0−17
@@ -1,17 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0+
2−/*
3− * Copyright (C) 2012 Samsung Electronics Co.Ltd
4− * http://www.samsung.com/
5− *
6− * Defines phy types for samsung usb phy controllers - HOST or DEIVCE.
7− *
8− * This program is free software; you can redistribute it and/or modify it
9− * under the terms of the GNU General Public License as published by the
10− * Free Software Foundation; either version 2 of the License, or (at your
11− * option) any later version.
12− */
13−
14−enum samsung_usb_phy_type {
15− USB_PHY_TYPE_DEVICE,
16− USB_PHY_TYPE_HOST,
17−};
include/linux/usb/usb338x.h+25−10
@@ -113,7 +113,10 @@ struct usb338x_ll_regs { · 112 unmodified lines
113113 u32 ll_ltssm_ctrl1;
114114 u32 ll_ltssm_ctrl2;
115115 u32 ll_ltssm_ctrl3;
116− u32 unused[2];
116+ u32 unused1;
117+
118+ /* 0x710 */
119+ u32 unused2;
117120 u32 ll_general_ctrl0;
118121 u32 ll_general_ctrl1;
119122 #define PM_U3_AUTO_EXIT 29
@@ -136,29 +139,41 @@ struct usb338x_ll_regs { · 16 unmodified lines
136139 u32 ll_general_ctrl2;
137140 #define SELECT_INVERT_LANE_POLARITY 7
138141 #define FORCE_INVERT_LANE_POLARITY 6
142+
143+ /* 0x720 */
139144 u32 ll_general_ctrl3;
140145 u32 ll_general_ctrl4;
141146 u32 ll_error_gen;
142−} __packed;
147+ u32 unused3;
148+
149+ /* 0x730 */
150+ u32 unused4[4];
143151
144−struct usb338x_ll_lfps_regs {
145− /* offset 0x748 */
152+ /* 0x740 */
153+ u32 unused5[2];
146154 u32 ll_lfps_5;
147155 #define TIMER_LFPS_6US 16
148156 u32 ll_lfps_6;
149157 #define TIMER_LFPS_80US 0
150−} __packed;
151158
152−struct usb338x_ll_tsn_regs {
153− /* offset 0x77C */
159+ /* 0x750 */
160+ u32 unused6[8];
161+
162+ /* 0x770 */
163+ u32 unused7[3];
154164 u32 ll_tsn_counters_2;
155165 #define HOT_TX_NORESET_TS2 24
166+
167+ /* 0x780 */
156168 u32 ll_tsn_counters_3;
157169 #define HOT_RX_RESET_TS2 0
158−} __packed;
170+ u32 unused8[3];
159171
160−struct usb338x_ll_chi_regs {
161− /* offset 0x79C */
172+ /* 0x790 */
173+ u32 unused9;
174+ u32 ll_lfps_timers_2;
175+#define LFPS_TIMERS_2_WORKAROUND_VALUE 0x084d
176+ u32 unused10;
162177 u32 ll_tsn_chicken_bit;
163178 #define RECOVERY_IDLE_TO_RECOVER_FMW 3
164179 } __packed;
include/linux/usb/wusb-wa.h+0−304
@@ -1,304 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0
2−/*
3− * Wireless USB Wire Adapter constants and structures.
4− *
5− * Copyright (C) 2005-2006 Intel Corporation.
6− * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
7− *
8− * This program is free software; you can redistribute it and/or
9− * modify it under the terms of the GNU General Public License version
10− * 2 as published by the Free Software Foundation.
11− *
12− * This program is distributed in the hope that it will be useful,
13− * but WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15− * GNU General Public License for more details.
16− *
17− * You should have received a copy of the GNU General Public License
18− * along with this program; if not, write to the Free Software
19− * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20− * 02110-1301, USA.
21− *
22− *
23− * FIXME: docs
24− * FIXME: organize properly, group logically
25− *
26− * All the event structures are defined in uwb/spec.h, as they are
27− * common to the WHCI and WUSB radio control interfaces.
28− *
29− * References:
30− * [WUSB] Wireless Universal Serial Bus Specification, revision 1.0, ch8
31− */
32−#ifndef __LINUX_USB_WUSB_WA_H
33−#define __LINUX_USB_WUSB_WA_H
34−
35−/**
36− * Radio Command Request for the Radio Control Interface
37− *
38− * Radio Control Interface command and event codes are the same as
39− * WHCI, and listed in include/linux/uwb.h:UWB_RC_{CMD,EVT}_*
40− */
41−enum {
42− WA_EXEC_RC_CMD = 40, /* Radio Control command Request */
43−};
44−
45−/* Wireless Adapter Requests ([WUSB] table 8-51) */
46−enum {
47− WUSB_REQ_ADD_MMC_IE = 20,
48− WUSB_REQ_REMOVE_MMC_IE = 21,
49− WUSB_REQ_SET_NUM_DNTS = 22,
50− WUSB_REQ_SET_CLUSTER_ID = 23,
51− WUSB_REQ_SET_DEV_INFO = 24,
52− WUSB_REQ_GET_TIME = 25,
53− WUSB_REQ_SET_STREAM_IDX = 26,
54− WUSB_REQ_SET_WUSB_MAS = 27,
55− WUSB_REQ_CHAN_STOP = 28,
56−};
57−
58−
59−/* Wireless Adapter WUSB Channel Time types ([WUSB] table 8-52) */
60−enum {
61− WUSB_TIME_ADJ = 0,
62− WUSB_TIME_BPST = 1,
63− WUSB_TIME_WUSB = 2,
64−};
65−
66−enum {
67− WA_ENABLE = 0x01,

237 more lines aren’t shown here.

include/linux/usb/wusb.h+0−362

This diff is large: its 363 lines aren’t shown here.

include/linux/uwb.h+0−817

This diff is large: its 818 lines aren’t shown here.

include/linux/uwb/debug-cmd.h+0−57

This diff is large: its 58 lines aren’t shown here.

include/linux/uwb/spec.h+0−767

This diff is large: its 768 lines aren’t shown here.

include/linux/uwb/umc.h+0−192

This diff is large: its 193 lines aren’t shown here.

include/linux/uwb/whci.h+0−102

This diff is large: its 103 lines aren’t shown here.

include/linux/verification.h+10−0

This diff is large: its 24 lines aren’t shown here.

include/linux/vermagic.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/linux/virtio_vsock.h+3−1

This diff is large: its 24 lines aren’t shown here.

include/linux/vmalloc.h+15−7

This diff is large: its 45 lines aren’t shown here.

include/linux/w1.h+5−0

This diff is large: its 19 lines aren’t shown here.

include/linux/wait.h+15−2

This diff is large: its 31 lines aren’t shown here.

include/linux/wimax/debug.h+3−17

This diff is large: its 39 lines aren’t shown here.

include/linux/workqueue.h+4−0

This diff is large: its 11 lines aren’t shown here.

include/linux/writeback.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/linux/zpool.h+3−0

This diff is large: its 17 lines aren’t shown here.

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