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
643int acpi_arch_timer_mem_init(struct arch_timer_mem *timer_mem, int *timer_count);643int acpi_arch_timer_mem_init(struct arch_timer_mem *timer_mem, int *timer_count);
644#endif644#endif
645 645
646#ifndef ACPI_HAVE_ARCH_SET_ROOT_POINTER
647static inline void acpi_arch_set_root_pointer(u64 addr)
648{
649}
650#endif
651
646#ifndef ACPI_HAVE_ARCH_GET_ROOT_POINTER652#ifndef ACPI_HAVE_ARCH_GET_ROOT_POINTER
647static inline u64 acpi_arch_get_root_pointer(void)653static inline u64 acpi_arch_get_root_pointer(void)
648{654{
@@ -931,6 +937,8 @@ int acpi_subsys_suspend_noirq(struct device *dev); · 282 unmodified lines
931int acpi_subsys_suspend(struct device *dev);937int acpi_subsys_suspend(struct device *dev);
932int acpi_subsys_freeze(struct device *dev);938int acpi_subsys_freeze(struct device *dev);
933int acpi_subsys_poweroff(struct device *dev);939int acpi_subsys_poweroff(struct device *dev);
940void acpi_ec_mark_gpe_for_wake(void);
941void acpi_ec_set_gpe_wake_mask(u8 action);
934#else942#else
935static inline int acpi_subsys_prepare(struct device *dev) { return 0; }943static inline int acpi_subsys_prepare(struct device *dev) { return 0; }
936static inline void acpi_subsys_complete(struct device *dev) {}944static 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
939static inline int acpi_subsys_suspend(struct device *dev) { return 0; }947static inline int acpi_subsys_suspend(struct device *dev) { return 0; }
940static inline int acpi_subsys_freeze(struct device *dev) { return 0; }948static inline int acpi_subsys_freeze(struct device *dev) { return 0; }
941static inline int acpi_subsys_poweroff(struct device *dev) { return 0; }949static inline int acpi_subsys_poweroff(struct device *dev) { return 0; }
950static inline void acpi_ec_mark_gpe_for_wake(void) {}
951static inline void acpi_ec_set_gpe_wake_mask(u8 action) {}
942#endif952#endif
943 953
944#ifdef CONFIG_ACPI954#ifdef CONFIG_ACPI
@@ -994,62 +1004,11 @@ void __acpi_handle_debug(struct _ddebug *descriptor, acpi_handle handle, const c · 49 unmodified lines
994#endif1004#endif
995#endif1005#endif
996 1006
997struct acpi_gpio_params {
998 unsigned int crs_entry_index;
999 unsigned int line_index;
1000 bool active_low;
1001};
1002
1003struct 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
1021#if defined(CONFIG_ACPI) && defined(CONFIG_GPIOLIB)1007#if defined(CONFIG_ACPI) && defined(CONFIG_GPIOLIB)
1022int acpi_dev_add_driver_gpios(struct acpi_device *adev,
1023 const struct acpi_gpio_mapping *gpios);
1024
1025static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev)
1026{
1027 if (adev)
1028 adev->driver_gpios = NULL;
1029}
1030
1031int devm_acpi_dev_add_driver_gpios(struct device *dev,
1032 const struct acpi_gpio_mapping *gpios);
1033void devm_acpi_dev_remove_driver_gpios(struct device *dev);
1034
1035bool acpi_gpio_get_irq_resource(struct acpi_resource *ares,1008bool acpi_gpio_get_irq_resource(struct acpi_resource *ares,
1036 struct acpi_resource_gpio **agpio);1009 struct acpi_resource_gpio **agpio);
1037int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index);1010int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index);
1038#else1011#else
1039static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
1040 const struct acpi_gpio_mapping *gpios)
1041{
1042 return -ENXIO;
1043}
1044static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) {}
1045
1046static inline int devm_acpi_dev_add_driver_gpios(struct device *dev,
1047 const struct acpi_gpio_mapping *gpios)
1048{
1049 return -ENXIO;
1050}
1051static inline void devm_acpi_dev_remove_driver_gpios(struct device *dev) {}
1052
1053static inline bool acpi_gpio_get_irq_resource(struct acpi_resource *ares,1012static inline bool acpi_gpio_get_irq_resource(struct acpi_resource *ares,
1054 struct acpi_resource_gpio **agpio)1013 struct acpi_resource_gpio **agpio)
1055{1014{
@@ -1302,11 +1261,16 @@ static inline int lpit_read_residency_count_address(u64 *address) · 246 unmodified lines
1302#endif1261#endif
1303 1262
1304#ifdef CONFIG_ACPI_PPTT1263#ifdef CONFIG_ACPI_PPTT
1264int acpi_pptt_cpu_is_thread(unsigned int cpu);
1305int find_acpi_cpu_topology(unsigned int cpu, int level);1265int find_acpi_cpu_topology(unsigned int cpu, int level);
1306int find_acpi_cpu_topology_package(unsigned int cpu);1266int find_acpi_cpu_topology_package(unsigned int cpu);
1307int find_acpi_cpu_topology_hetero_id(unsigned int cpu);1267int find_acpi_cpu_topology_hetero_id(unsigned int cpu);
1308int find_acpi_cpu_cache_topology(unsigned int cpu, int level);1268int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
1309#else1269#else
1270static inline int acpi_pptt_cpu_is_thread(unsigned int cpu)
1271{
1272 return -EINVAL;
1273}
1310static inline int find_acpi_cpu_topology(unsigned int cpu, int level)1274static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
1311{1275{
1312 return -EINVAL;1276 return -EINVAL;
include/linux/alarmtimer.h+2−1
@@ -5,7 +5,8 @@ · 4 unmodified lines
5#include <linux/time.h>5#include <linux/time.h>
6#include <linux/hrtimer.h>6#include <linux/hrtimer.h>
7#include <linux/timerqueue.h>7#include <linux/timerqueue.h>
8#include <linux/rtc.h>8
9struct rtc_device;
9 10
10enum alarmtimer_type {11enum alarmtimer_type {
11 ALARM_REALTIME,12 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
184extern int184extern int
185amd_iommu_update_ga(int cpu, bool is_run, void *data);185amd_iommu_update_ga(int cpu, bool is_run, void *data);
186 186
187extern int amd_iommu_activate_guest_mode(void *data);
188extern int amd_iommu_deactivate_guest_mode(void *data);
189
187#else /* defined(CONFIG_AMD_IOMMU) && defined(CONFIG_IRQ_REMAP) */190#else /* defined(CONFIG_AMD_IOMMU) && defined(CONFIG_IRQ_REMAP) */
188 191
189static inline int192static inline int
@@ -198,6 +201,15 @@ amd_iommu_update_ga(int cpu, bool is_run, void *data) · 8 unmodified lines
198 return 0;201 return 0;
199}202}
200 203
204static inline int amd_iommu_activate_guest_mode(void *data)
205{
206 return 0;
207}
208
209static inline int amd_iommu_deactivate_guest_mode(void *data)
210{
211 return 0;
212}
201#endif /* defined(CONFIG_AMD_IOMMU) && defined(CONFIG_IRQ_REMAP) */213#endif /* defined(CONFIG_AMD_IOMMU) && defined(CONFIG_IRQ_REMAP) */
202 214
203#endif /* _ASM_X86_AMD_IOMMU_H */215#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
33 return per_cpu(freq_scale, cpu);33 return per_cpu(freq_scale, cpu);
34}34}
35 35
36struct 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
47extern 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)
54void init_cpu_topology(void);
55void store_cpu_topology(unsigned int cpuid);
56const struct cpumask *cpu_coregroup_mask(int cpu);
57void update_siblings_masks(unsigned int cpu);
58void remove_cpu_topology(unsigned int cpuid);
59void reset_cpu_topology(void);
60#endif
61
36#endif /* _LINUX_ARCH_TOPOLOGY_H_ */62#endif /* _LINUX_ARCH_TOPOLOGY_H_ */
include/linux/audit.h+7−14
@@ -11,7 +11,6 @@ · 10 unmodified lines
11 11
12#include <linux/sched.h>12#include <linux/sched.h>
13#include <linux/ptrace.h>13#include <linux/ptrace.h>
14#include <linux/namei.h> /* LOOKUP_* */
15#include <uapi/linux/audit.h>14#include <uapi/linux/audit.h>
16 15
17#define AUDIT_INO_UNSET ((unsigned long)-1)16#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
252#define audit_is_compat(arch) false251#define audit_is_compat(arch) false
253#endif252#endif
254 253
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
255#ifdef CONFIG_AUDITSYSCALL258#ifdef CONFIG_AUDITSYSCALL
256#include <asm/syscall.h> /* for syscall_get_arch() */259#include <asm/syscall.h> /* for syscall_get_arch() */
257 260
@@ -265,9 +268,6 @@ extern void __audit_syscall_exit(int ret_success, long ret_value); · 7 unmodified lines
265extern struct filename *__audit_reusename(const __user char *uptr);268extern struct filename *__audit_reusename(const __user char *uptr);
266extern void __audit_getname(struct filename *name);269extern void __audit_getname(struct filename *name);
267 270
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 */
271extern void __audit_inode(struct filename *name, const struct dentry *dentry,271extern void __audit_inode(struct filename *name, const struct dentry *dentry,
272 unsigned int flags);272 unsigned int flags);
273extern void __audit_file(const struct file *);273extern void __audit_file(const struct file *);
@@ -328,16 +328,9 @@ static inline void audit_getname(struct filename *name) · 54 unmodified lines
328}328}
329static inline void audit_inode(struct filename *name,329static inline void audit_inode(struct filename *name,
330 const struct dentry *dentry,330 const struct dentry *dentry,
331 unsigned int flags) {331 unsigned int aflags) {
332 if (unlikely(!audit_dummy_context())) {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;
339 __audit_inode(name, dentry, aflags);333 __audit_inode(name, dentry, aflags);
340 }
341}334}
342static inline void audit_file(struct file *file)335static inline void audit_file(struct file *file)
343{336{
@@ -561,7 +554,7 @@ static inline void __audit_inode_child(struct inode *parent, · 217 unmodified lines
561{ }554{ }
562static inline void audit_inode(struct filename *name,555static inline void audit_inode(struct filename *name,
563 const struct dentry *dentry,556 const struct dentry *dentry,
564 unsigned int parent)557 unsigned int aflags)
565{ }558{ }
566static inline void audit_file(struct file *file)559static inline void audit_file(struct file *file)
567{560{
include/linux/backing-dev-defs.h+23−0
@@ -63,10 +63,31 @@ enum wb_reason { · 62 unmodified lines
63 * so it has a mismatch name.63 * so it has a mismatch name.
64 */64 */
65 WB_REASON_FORKER_THREAD,65 WB_REASON_FORKER_THREAD,
66 WB_REASON_FOREIGN_FLUSH,
66 67
67 WB_REASON_MAX,68 WB_REASON_MAX,
68};69};
69 70
71struct 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
70/*91/*
71 * For cgroup writeback, multiple wb's may map to the same blkcg. Those92 * For cgroup writeback, multiple wb's may map to the same blkcg. Those
72 * wb's can operate mostly independently but should share the congested93 * wb's can operate mostly independently but should share the congested
@@ -165,6 +186,8 @@ struct bdi_writeback { · 92 unmodified lines
165};186};
166 187
167struct backing_dev_info {188struct backing_dev_info {
189 u64 id;
190 struct rb_node rb_node; /* keyed by ->id */
168 struct list_head bdi_list;191 struct list_head bdi_list;
169 unsigned long ra_pages; /* max readahead in PAGE_SIZE units */192 unsigned long ra_pages; /* max readahead in PAGE_SIZE units */
170 unsigned long io_pages; /* max allowed IO size */193 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
24 return bdi;24 return bdi;
25}25}
26 26
27struct backing_dev_info *bdi_get_by_id(u64 id);
27void bdi_put(struct backing_dev_info *bdi);28void bdi_put(struct backing_dev_info *bdi);
28 29
29__printf(2, 3)30__printf(2, 3)
@@ -44,6 +45,8 @@ void wb_start_background_writeback(struct bdi_writeback *wb); · 14 unmodified lines
44void wb_workfn(struct work_struct *work);45void wb_workfn(struct work_struct *work);
45void wb_wakeup_delayed(struct bdi_writeback *wb);46void wb_wakeup_delayed(struct bdi_writeback *wb);
46 47
48void wb_wait_for_completion(struct wb_completion *done);
49
47extern spinlock_t bdi_lock;50extern spinlock_t bdi_lock;
48extern struct list_head bdi_list;51extern struct list_head bdi_list;
49 52
@@ -227,6 +230,8 @@ static inline int bdi_sched_wait(void *word) · 177 unmodified lines
227struct bdi_writeback_congested *230struct bdi_writeback_congested *
228wb_congested_get_create(struct backing_dev_info *bdi, int blkcg_id, gfp_t gfp);231wb_congested_get_create(struct backing_dev_info *bdi, int blkcg_id, gfp_t gfp);
229void wb_congested_put(struct bdi_writeback_congested *congested);232void wb_congested_put(struct bdi_writeback_congested *congested);
233struct bdi_writeback *wb_get_lookup(struct backing_dev_info *bdi,
234 struct cgroup_subsys_state *memcg_css);
230struct bdi_writeback *wb_get_create(struct backing_dev_info *bdi,235struct bdi_writeback *wb_get_create(struct backing_dev_info *bdi,
231 struct cgroup_subsys_state *memcg_css,236 struct cgroup_subsys_state *memcg_css,
232 gfp_t gfp);237 gfp_t gfp);
include/linux/backlight.h+8−0
@@ -46,6 +46,12 @@ enum backlight_notification { · 45 unmodified lines
46 BACKLIGHT_UNREGISTERED,46 BACKLIGHT_UNREGISTERED,
47};47};
48 48
49enum backlight_scale {
50 BACKLIGHT_SCALE_UNKNOWN = 0,
51 BACKLIGHT_SCALE_LINEAR,
52 BACKLIGHT_SCALE_NON_LINEAR,
53};
54
49struct backlight_device;55struct backlight_device;
50struct fb_info;56struct fb_info;
51 57
@@ -80,6 +86,8 @@ struct backlight_properties { · 28 unmodified lines
80 enum backlight_type type;86 enum backlight_type type;
81 /* Flags used to signal drivers of state changes */87 /* Flags used to signal drivers of state changes */
82 unsigned int state;88 unsigned int state;
89 /* Type of the brightness scale (linear, non-linear, ...) */
90 enum backlight_scale scale;
83 91
84#define BL_CORE_SUSPENDED (1 << 0) /* backlight is suspended */92#define BL_CORE_SUSPENDED (1 << 0) /* backlight is suspended */
85#define BL_CORE_FBBLANK (1 << 1) /* backlight is under an fb blank event */93#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
120extern int __bitmap_full(const unsigned long *bitmap, unsigned int nbits);120extern int __bitmap_full(const unsigned long *bitmap, unsigned int nbits);
121extern int __bitmap_equal(const unsigned long *bitmap1,121extern int __bitmap_equal(const unsigned long *bitmap1,
122 const unsigned long *bitmap2, unsigned int nbits);122 const unsigned long *bitmap2, unsigned int nbits);
123extern bool __pure __bitmap_or_equal(const unsigned long *src1,
124 const unsigned long *src2,
125 const unsigned long *src3,
126 unsigned int nbits);
123extern void __bitmap_complement(unsigned long *dst, const unsigned long *src,127extern void __bitmap_complement(unsigned long *dst, const unsigned long *src,
124 unsigned int nbits);128 unsigned int nbits);
125extern void __bitmap_shift_right(unsigned long *dst, const unsigned long *src,129extern 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
321 return __bitmap_equal(src1, src2, nbits);325 return __bitmap_equal(src1, src2, nbits);
322}326}
323 327
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 */
336static 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
324static inline int bitmap_intersects(const unsigned long *src1,347static inline int bitmap_intersects(const unsigned long *src1,
325 const unsigned long *src2, unsigned int nbits)348 const unsigned long *src2, unsigned int nbits)
326{349{
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
149typedef void (blkcg_pol_init_cpd_fn)(struct blkcg_policy_data *cpd);149typedef void (blkcg_pol_init_cpd_fn)(struct blkcg_policy_data *cpd);
150typedef void (blkcg_pol_free_cpd_fn)(struct blkcg_policy_data *cpd);150typedef void (blkcg_pol_free_cpd_fn)(struct blkcg_policy_data *cpd);
151typedef void (blkcg_pol_bind_cpd_fn)(struct blkcg_policy_data *cpd);151typedef void (blkcg_pol_bind_cpd_fn)(struct blkcg_policy_data *cpd);
152typedef struct blkg_policy_data *(blkcg_pol_alloc_pd_fn)(gfp_t gfp, int node);152typedef struct blkg_policy_data *(blkcg_pol_alloc_pd_fn)(gfp_t gfp,
153 struct request_queue *q, struct blkcg *blkcg);
153typedef void (blkcg_pol_init_pd_fn)(struct blkg_policy_data *pd);154typedef void (blkcg_pol_init_pd_fn)(struct blkg_policy_data *pd);
154typedef void (blkcg_pol_online_pd_fn)(struct blkg_policy_data *pd);155typedef void (blkcg_pol_online_pd_fn)(struct blkg_policy_data *pd);
155typedef void (blkcg_pol_offline_pd_fn)(struct blkg_policy_data *pd);156typedef void (blkcg_pol_offline_pd_fn)(struct blkg_policy_data *pd);
@@ -181,6 +182,7 @@ struct blkcg_policy { · 25 unmodified lines
181 182
182extern struct blkcg blkcg_root;183extern struct blkcg blkcg_root;
183extern struct cgroup_subsys_state * const blkcg_root_css;184extern struct cgroup_subsys_state * const blkcg_root_css;
185extern bool blkcg_debug_stats;
184 186
185struct blkcg_gq *blkg_lookup_slowpath(struct blkcg *blkcg,187struct blkcg_gq *blkg_lookup_slowpath(struct blkcg *blkcg,
186 struct request_queue *q, bool update_hint);188 struct request_queue *q, bool update_hint);
@@ -232,6 +234,7 @@ struct blkg_conf_ctx { · 45 unmodified lines
232 char *body;234 char *body;
233};235};
234 236
237struct gendisk *blkcg_conf_get_disk(char **inputp);
235int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,238int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
236 char *input, struct blkg_conf_ctx *ctx);239 char *input, struct blkg_conf_ctx *ctx);
237void blkg_conf_finish(struct blkg_conf_ctx *ctx);240void 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
374 * @q: request_queue of interest377 * @q: request_queue of interest
375 *378 *
376 * Lookup blkg for the @blkcg - @q pair. This function should be called379 * Lookup blkg for the @blkcg - @q pair. This function should be called
377 * under RCU read loc.380 * under RCU read lock.
378 */381 */
379static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg,382static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg,
380 struct request_queue *q)383 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
140typedef int (map_queues_fn)(struct blk_mq_tag_set *set);140typedef int (map_queues_fn)(struct blk_mq_tag_set *set);
141typedef bool (busy_fn)(struct request_queue *);141typedef bool (busy_fn)(struct request_queue *);
142typedef void (complete_fn)(struct request *);142typedef void (complete_fn)(struct request *);
143typedef void (cleanup_rq_fn)(struct request *);
143 144
144 145
145struct blk_mq_ops {146struct blk_mq_ops {
@@ -200,6 +201,12 @@ struct blk_mq_ops { · 54 unmodified lines
200 /* Called from inside blk_get_request() */201 /* Called from inside blk_get_request() */
201 void (*initialize_rq_fn)(struct request *rq);202 void (*initialize_rq_fn)(struct request *rq);
202 203
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
203 /*210 /*
204 * If set, returns whether or not this queue currently is busy211 * If set, returns whether or not this queue currently is busy
205 */212 */
@@ -241,12 +248,12 @@ enum { · 35 unmodified lines
241 248
242struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *);249struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *);
243struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,250struct 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);
245struct request_queue *blk_mq_init_sq_queue(struct blk_mq_tag_set *set,253struct request_queue *blk_mq_init_sq_queue(struct blk_mq_tag_set *set,
246 const struct blk_mq_ops *ops,254 const struct blk_mq_ops *ops,
247 unsigned int queue_depth,255 unsigned int queue_depth,
248 unsigned int set_flags);256 unsigned int set_flags);
249int blk_mq_register_dev(struct device *, struct request_queue *);
250void blk_mq_unregister_dev(struct device *, struct request_queue *);257void blk_mq_unregister_dev(struct device *, struct request_queue *);
251 258
252int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set);259int 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
296 303
297 304
298int blk_mq_request_started(struct request *rq);305int blk_mq_request_started(struct request *rq);
306int blk_mq_request_completed(struct request *rq);
299void blk_mq_start_request(struct request *rq);307void blk_mq_start_request(struct request *rq);
300void blk_mq_end_request(struct request *rq, blk_status_t error);308void blk_mq_end_request(struct request *rq, blk_status_t error);
301void __blk_mq_end_request(struct request *rq, blk_status_t error);309void __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
304void blk_mq_kick_requeue_list(struct request_queue *q);312void blk_mq_kick_requeue_list(struct request_queue *q);
305void blk_mq_delay_kick_requeue_list(struct request_queue *q, unsigned long msecs);313void blk_mq_delay_kick_requeue_list(struct request_queue *q, unsigned long msecs);
306bool blk_mq_complete_request(struct request *rq);314bool blk_mq_complete_request(struct request *rq);
307void blk_mq_complete_request_sync(struct request *rq);
308bool blk_mq_bio_list_merge(struct request_queue *q, struct list_head *list,315bool blk_mq_bio_list_merge(struct request_queue *q, struct list_head *list,
309 struct bio *bio, unsigned int nr_segs);316 struct bio *bio, unsigned int nr_segs);
310bool blk_mq_queue_stopped(struct request_queue *q);317bool 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
321void blk_mq_run_hw_queues(struct request_queue *q, bool async);328void blk_mq_run_hw_queues(struct request_queue *q, bool async);
322void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,329void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
323 busy_tag_iter_fn *fn, void *priv);330 busy_tag_iter_fn *fn, void *priv);
331void blk_mq_tagset_wait_completed_request(struct blk_mq_tag_set *tagset);
324void blk_mq_freeze_queue(struct request_queue *q);332void blk_mq_freeze_queue(struct request_queue *q);
325void blk_mq_unfreeze_queue(struct request_queue *q);333void blk_mq_unfreeze_queue(struct request_queue *q);
326void blk_freeze_queue_start(struct request_queue *q);334void 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
366 BLK_QC_T_INTERNAL;374 BLK_QC_T_INTERNAL;
367}375}
368 376
377static 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
369#endif383#endif
include/linux/blk_types.h+10−1
@@ -169,6 +169,9 @@ struct bio { · 168 unmodified lines
169 */169 */
170 struct blkcg_gq *bi_blkg;170 struct blkcg_gq *bi_blkg;
171 struct bio_issue bi_issue;171 struct bio_issue bi_issue;
172#ifdef CONFIG_BLK_CGROUP_IOCOST
173 u64 bi_iocost_cost;
174#endif
172#endif175#endif
173 union {176 union {
174#if defined(CONFIG_BLK_DEV_INTEGRITY)177#if defined(CONFIG_BLK_DEV_INTEGRITY)
@@ -209,6 +212,7 @@ enum { · 34 unmodified lines
209 BIO_BOUNCED, /* bio is a bounce bio */212 BIO_BOUNCED, /* bio is a bounce bio */
210 BIO_USER_MAPPED, /* contains user pages */213 BIO_USER_MAPPED, /* contains user pages */
211 BIO_NULL_MAPPED, /* contains invalid user pages */214 BIO_NULL_MAPPED, /* contains invalid user pages */
215 BIO_WORKINGSET, /* contains userspace workingset pages */
212 BIO_QUIET, /* Make BIO Quiet */216 BIO_QUIET, /* Make BIO Quiet */
213 BIO_CHAIN, /* chained bio, ->bi_remaining in effect */217 BIO_CHAIN, /* chained bio, ->bi_remaining in effect */
214 BIO_REFFED, /* bio has elevated ->bi_cnt */218 BIO_REFFED, /* bio has elevated ->bi_cnt */
@@ -282,6 +286,8 @@ enum req_opf { · 67 unmodified lines
282 REQ_OP_ZONE_RESET = 6,286 REQ_OP_ZONE_RESET = 6,
283 /* write the same sector many times */287 /* write the same sector many times */
284 REQ_OP_WRITE_SAME = 7,288 REQ_OP_WRITE_SAME = 7,
289 /* reset all the zone present on the device */
290 REQ_OP_ZONE_RESET_ALL = 8,
285 /* write the zero filled sector many times */291 /* write the zero filled sector many times */
286 REQ_OP_WRITE_ZEROES = 9,292 REQ_OP_WRITE_ZEROES = 9,
287 293
@@ -311,6 +317,7 @@ enum req_flag_bits { · 23 unmodified lines
311 __REQ_RAHEAD, /* read ahead, can fail anytime */317 __REQ_RAHEAD, /* read ahead, can fail anytime */
312 __REQ_BACKGROUND, /* background IO */318 __REQ_BACKGROUND, /* background IO */
313 __REQ_NOWAIT, /* Don't wait if request will block */319 __REQ_NOWAIT, /* Don't wait if request will block */
320 __REQ_NOWAIT_INLINE, /* Return would-block error inline */
314 /*321 /*
315 * When a shared kthread needs to issue a bio for a cgroup, doing322 * When a shared kthread needs to issue a bio for a cgroup, doing
316 * so synchronously can lead to priority inversions as the kthread323 * so synchronously can lead to priority inversions as the kthread
@@ -345,6 +352,7 @@ enum req_flag_bits { · 28 unmodified lines
345#define REQ_RAHEAD (1ULL << __REQ_RAHEAD)352#define REQ_RAHEAD (1ULL << __REQ_RAHEAD)
346#define REQ_BACKGROUND (1ULL << __REQ_BACKGROUND)353#define REQ_BACKGROUND (1ULL << __REQ_BACKGROUND)
347#define REQ_NOWAIT (1ULL << __REQ_NOWAIT)354#define REQ_NOWAIT (1ULL << __REQ_NOWAIT)
355#define REQ_NOWAIT_INLINE (1ULL << __REQ_NOWAIT_INLINE)
348#define REQ_CGROUP_PUNT (1ULL << __REQ_CGROUP_PUNT)356#define REQ_CGROUP_PUNT (1ULL << __REQ_CGROUP_PUNT)
349 357
350#define REQ_NOUNMAP (1ULL << __REQ_NOUNMAP)358#define REQ_NOUNMAP (1ULL << __REQ_NOUNMAP)
@@ -418,12 +426,13 @@ static inline int op_stat_group(unsigned int op) · 67 unmodified lines
418 426
419typedef unsigned int blk_qc_t;427typedef unsigned int blk_qc_t;
420#define BLK_QC_T_NONE -1U428#define BLK_QC_T_NONE -1U
429#define BLK_QC_T_EAGAIN -2U
421#define BLK_QC_T_SHIFT 16430#define BLK_QC_T_SHIFT 16
422#define BLK_QC_T_INTERNAL (1U << 31)431#define BLK_QC_T_INTERNAL (1U << 31)
423 432
424static inline bool blk_qc_t_valid(blk_qc_t cookie)433static inline bool blk_qc_t_valid(blk_qc_t cookie)
425{434{
426 return cookie != BLK_QC_T_NONE;435 return cookie != BLK_QC_T_NONE && cookie != BLK_QC_T_EAGAIN;
427}436}
428 437
429static inline unsigned int blk_qc_t_to_queue_num(blk_qc_t cookie)438static 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
194 194
195 struct gendisk *rq_disk;195 struct gendisk *rq_disk;
196 struct hd_struct *part;196 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. */
198 u64 start_time_ns;202 u64 start_time_ns;
199 /* Time that I/O was submitted to the device. */203 /* Time that I/O was submitted to the device. */
200 u64 io_start_time_ns;204 u64 io_start_time_ns;
@@ -202,9 +206,12 @@ struct request { · 1 unmodified line
202#ifdef CONFIG_BLK_WBT206#ifdef CONFIG_BLK_WBT
203 unsigned short wbt_flags;207 unsigned short wbt_flags;
204#endif208#endif
205#ifdef CONFIG_BLK_DEV_THROTTLING_LOW209 /*
206 unsigned short throtl_size;210 * rq sectors used for blk stats. It has the same value
207#endif211 * with blk_rq_sectors(rq), except that it never be zeroed
212 * by completion.
213 */
214 unsigned short stats_sectors;
208 215
209 /*216 /*
210 * Number of scatter-gather DMA addr+len pairs after217 * 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
391#endif /* CONFIG_BLK_DEV_ZONED */398#endif /* CONFIG_BLK_DEV_ZONED */
392 399
393struct request_queue {400struct request_queue {
394 /*
395 * Together with queue_head for cacheline sharing
396 */
397 struct list_head queue_head;
398 struct request *last_merge;401 struct request *last_merge;
399 struct elevator_queue *elevator;402 struct elevator_queue *elevator;
400 403
@@ -496,6 +499,8 @@ struct request_queue { · 95 unmodified lines
496 499
497 struct queue_limits limits;500 struct queue_limits limits;
498 501
502 unsigned int required_elevator_features;
503
499#ifdef CONFIG_BLK_DEV_ZONED504#ifdef CONFIG_BLK_DEV_ZONED
500 /*505 /*
501 * Zoned block device information for request dispatch control.506 * Zoned block device information for request dispatch control.
@@ -539,6 +544,7 @@ struct request_queue { · 37 unmodified lines
539 struct delayed_work requeue_work;544 struct delayed_work requeue_work;
540 545
541 struct mutex sysfs_lock;546 struct mutex sysfs_lock;
547 struct mutex sysfs_dir_lock;
542 548
543 /*549 /*
544 * for reusing dead hctx instance in case of updating550 * for reusing dead hctx instance in case of updating
@@ -611,6 +617,8 @@ struct request_queue { · 66 unmodified lines
611#define QUEUE_FLAG_SCSI_PASSTHROUGH 23 /* queue supports SCSI commands */617#define QUEUE_FLAG_SCSI_PASSTHROUGH 23 /* queue supports SCSI commands */
612#define QUEUE_FLAG_QUIESCED 24 /* queue has been quiesced */618#define QUEUE_FLAG_QUIESCED 24 /* queue has been quiesced */
613#define QUEUE_FLAG_PCI_P2PDMA 25 /* device supports PCI p2p requests */619#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 */
614 622
615#define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \623#define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
616 (1 << QUEUE_FLAG_SAME_COMP))624 (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
630#define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)638#define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
631#define blk_queue_add_random(q) test_bit(QUEUE_FLAG_ADD_RANDOM, &(q)->queue_flags)639#define blk_queue_add_random(q) test_bit(QUEUE_FLAG_ADD_RANDOM, &(q)->queue_flags)
632#define blk_queue_discard(q) test_bit(QUEUE_FLAG_DISCARD, &(q)->queue_flags)640#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)
633#define blk_queue_secure_erase(q) \643#define blk_queue_secure_erase(q) \
634 (test_bit(QUEUE_FLAG_SECERASE, &(q)->queue_flags))644 (test_bit(QUEUE_FLAG_SECERASE, &(q)->queue_flags))
635#define blk_queue_dax(q) test_bit(QUEUE_FLAG_DAX, &(q)->queue_flags)645#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
637 test_bit(QUEUE_FLAG_SCSI_PASSTHROUGH, &(q)->queue_flags)647 test_bit(QUEUE_FLAG_SCSI_PASSTHROUGH, &(q)->queue_flags)
638#define blk_queue_pci_p2pdma(q) \648#define blk_queue_pci_p2pdma(q) \
639 test_bit(QUEUE_FLAG_PCI_P2PDMA, &(q)->queue_flags)649 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
640 656
641#define blk_noretry_request(rq) \657#define blk_noretry_request(rq) \
642 ((rq)->cmd_flags & (REQ_FAILFAST_DEV|REQ_FAILFAST_TRANSPORT| \658 ((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
644#define blk_queue_quiesced(q) test_bit(QUEUE_FLAG_QUIESCED, &(q)->queue_flags)660#define blk_queue_quiesced(q) test_bit(QUEUE_FLAG_QUIESCED, &(q)->queue_flags)
645#define blk_queue_pm_only(q) atomic_read(&(q)->pm_only)661#define blk_queue_pm_only(q) atomic_read(&(q)->pm_only)
646#define blk_queue_fua(q) test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags)662#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)
647 664
648extern void blk_set_pm_only(struct request_queue *q);665extern void blk_set_pm_only(struct request_queue *q);
649extern void blk_clear_pm_only(struct request_queue *q);666extern 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
903 * blk_rq_err_bytes() : bytes left till the next error boundary920 * blk_rq_err_bytes() : bytes left till the next error boundary
904 * blk_rq_sectors() : sectors left in the entire request921 * blk_rq_sectors() : sectors left in the entire request
905 * blk_rq_cur_sectors() : sectors left in the current segment922 * blk_rq_cur_sectors() : sectors left in the current segment
923 * blk_rq_stats_sectors() : sectors of the entire request used for stats
906 */924 */
907static inline sector_t blk_rq_pos(const struct request *rq)925static inline sector_t blk_rq_pos(const struct request *rq)
908{926{
@@ -931,6 +949,11 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq) · 22 unmodified lines
931 return blk_rq_cur_bytes(rq) >> SECTOR_SHIFT;949 return blk_rq_cur_bytes(rq) >> SECTOR_SHIFT;
932}950}
933 951
952static inline unsigned int blk_rq_stats_sectors(const struct request *rq)
953{
954 return rq->stats_sectors;
955}
956
934#ifdef CONFIG_BLK_DEV_ZONED957#ifdef CONFIG_BLK_DEV_ZONED
935static inline unsigned int blk_rq_zone_no(struct request *rq)958static inline unsigned int blk_rq_zone_no(struct request *rq)
936{959{
@@ -1085,6 +1108,10 @@ extern void blk_queue_dma_alignment(struct request_queue *, int); · 148 unmodified lines
1085extern void blk_queue_update_dma_alignment(struct request_queue *, int);1108extern void blk_queue_update_dma_alignment(struct request_queue *, int);
1086extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);1109extern void blk_queue_rq_timeout(struct request_queue *, unsigned int);
1087extern void blk_queue_write_cache(struct request_queue *q, bool enabled, bool fua);1110extern void blk_queue_write_cache(struct request_queue *q, bool enabled, bool fua);
1111extern void blk_queue_required_elevator_features(struct request_queue *q,
1112 unsigned int features);
1113extern bool blk_queue_can_use_dma_map_merging(struct request_queue *q,
1114 struct device *dev);
1088 1115
1089/*1116/*
1090 * Number of physical segments as sent to the device.1117 * Number of physical segments as sent to the device.
@@ -1232,42 +1259,42 @@ enum blk_default_limits { · 141 unmodified lines
1232 BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL,1259 BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL,
1233};1260};
1234 1261
1235static inline unsigned long queue_segment_boundary(struct request_queue *q)1262static inline unsigned long queue_segment_boundary(const struct request_queue *q)
1236{1263{
1237 return q->limits.seg_boundary_mask;1264 return q->limits.seg_boundary_mask;
1238}1265}
1239 1266
1240static inline unsigned long queue_virt_boundary(struct request_queue *q)1267static inline unsigned long queue_virt_boundary(const struct request_queue *q)
1241{1268{
1242 return q->limits.virt_boundary_mask;1269 return q->limits.virt_boundary_mask;
1243}1270}
1244 1271
1245static inline unsigned int queue_max_sectors(struct request_queue *q)1272static inline unsigned int queue_max_sectors(const struct request_queue *q)
1246{1273{
1247 return q->limits.max_sectors;1274 return q->limits.max_sectors;
1248}1275}
1249 1276
1250static inline unsigned int queue_max_hw_sectors(struct request_queue *q)1277static inline unsigned int queue_max_hw_sectors(const struct request_queue *q)
1251{1278{
1252 return q->limits.max_hw_sectors;1279 return q->limits.max_hw_sectors;
1253}1280}
1254 1281
1255static inline unsigned short queue_max_segments(struct request_queue *q)1282static inline unsigned short queue_max_segments(const struct request_queue *q)
1256{1283{
1257 return q->limits.max_segments;1284 return q->limits.max_segments;
1258}1285}
1259 1286
1260static inline unsigned short queue_max_discard_segments(struct request_queue *q)1287static inline unsigned short queue_max_discard_segments(const struct request_queue *q)
1261{1288{
1262 return q->limits.max_discard_segments;1289 return q->limits.max_discard_segments;
1263}1290}
1264 1291
1265static inline unsigned int queue_max_segment_size(struct request_queue *q)1292static inline unsigned int queue_max_segment_size(const struct request_queue *q)
1266{1293{
1267 return q->limits.max_segment_size;1294 return q->limits.max_segment_size;
1268}1295}
1269 1296
1270static inline unsigned short queue_logical_block_size(struct request_queue *q)1297static inline unsigned short queue_logical_block_size(const struct request_queue *q)
1271{1298{
1272 int retval = 512;1299 int retval = 512;
1273 1300
@@ -1282,7 +1309,7 @@ static inline unsigned short bdev_logical_block_size(struct block_device *bdev) · 8 unmodified lines
1282 return queue_logical_block_size(bdev_get_queue(bdev));1309 return queue_logical_block_size(bdev_get_queue(bdev));
1283}1310}
1284 1311
1285static inline unsigned int queue_physical_block_size(struct request_queue *q)1312static inline unsigned int queue_physical_block_size(const struct request_queue *q)
1286{1313{
1287 return q->limits.physical_block_size;1314 return q->limits.physical_block_size;
1288}1315}
@@ -1292,7 +1319,7 @@ static inline unsigned int bdev_physical_block_size(struct block_device *bdev) · 3 unmodified lines
1292 return queue_physical_block_size(bdev_get_queue(bdev));1319 return queue_physical_block_size(bdev_get_queue(bdev));
1293}1320}
1294 1321
1295static inline unsigned int queue_io_min(struct request_queue *q)1322static inline unsigned int queue_io_min(const struct request_queue *q)
1296{1323{
1297 return q->limits.io_min;1324 return q->limits.io_min;
1298}1325}
@@ -1302,7 +1329,7 @@ static inline int bdev_io_min(struct block_device *bdev) · 3 unmodified lines
1302 return queue_io_min(bdev_get_queue(bdev));1329 return queue_io_min(bdev_get_queue(bdev));
1303}1330}
1304 1331
1305static inline unsigned int queue_io_opt(struct request_queue *q)1332static inline unsigned int queue_io_opt(const struct request_queue *q)
1306{1333{
1307 return q->limits.io_opt;1334 return q->limits.io_opt;
1308}1335}
@@ -1312,7 +1339,7 @@ static inline int bdev_io_opt(struct block_device *bdev) · 3 unmodified lines
1312 return queue_io_opt(bdev_get_queue(bdev));1339 return queue_io_opt(bdev_get_queue(bdev));
1313}1340}
1314 1341
1315static inline int queue_alignment_offset(struct request_queue *q)1342static inline int queue_alignment_offset(const struct request_queue *q)
1316{1343{
1317 if (q->limits.misaligned)1344 if (q->limits.misaligned)
1318 return -1;1345 return -1;
@@ -1342,7 +1369,7 @@ static inline int bdev_alignment_offset(struct block_device *bdev) · 23 unmodified lines
1342 return q->limits.alignment_offset;1369 return q->limits.alignment_offset;
1343}1370}
1344 1371
1345static inline int queue_discard_alignment(struct request_queue *q)1372static inline int queue_discard_alignment(const struct request_queue *q)
1346{1373{
1347 if (q->limits.discard_misaligned)1374 if (q->limits.discard_misaligned)
1348 return -1;1375 return -1;
@@ -1432,7 +1459,7 @@ static inline sector_t bdev_zone_sectors(struct block_device *bdev) · 83 unmodified lines
1432 return 0;1459 return 0;
1433}1460}
1434 1461
1435static inline int queue_dma_alignment(struct request_queue *q)1462static inline int queue_dma_alignment(const struct request_queue *q)
1436{1463{
1437 return q ? q->dma_alignment : 511;1464 return q ? q->dma_alignment : 511;
1438}1465}
@@ -1497,10 +1524,14 @@ struct blk_integrity_iter { · 58 unmodified lines
1497};1524};
1498 1525
1499typedef blk_status_t (integrity_processing_fn) (struct blk_integrity_iter *);1526typedef blk_status_t (integrity_processing_fn) (struct blk_integrity_iter *);
1527typedef void (integrity_prepare_fn) (struct request *);
1528typedef void (integrity_complete_fn) (struct request *, unsigned int);
1500 1529
1501struct blk_integrity_profile {1530struct blk_integrity_profile {
1502 integrity_processing_fn *generate_fn;1531 integrity_processing_fn *generate_fn;
1503 integrity_processing_fn *verify_fn;1532 integrity_processing_fn *verify_fn;
1533 integrity_prepare_fn *prepare_fn;
1534 integrity_complete_fn *complete_fn;
1504 const char *name;1535 const char *name;
1505};1536};
1506 1537
@@ -1543,7 +1574,7 @@ static inline void blk_queue_max_integrity_segments(struct request_queue *q, · 36 unmodified lines
1543}1574}
1544 1575
1545static inline unsigned short1576static inline unsigned short
1546queue_max_integrity_segments(struct request_queue *q)1577queue_max_integrity_segments(const struct request_queue *q)
1547{1578{
1548 return q->limits.max_integrity_segments;1579 return q->limits.max_integrity_segments;
1549}1580}
@@ -1626,7 +1657,7 @@ static inline void blk_queue_max_integrity_segments(struct request_queue *q, · 76 unmodified lines
1626 unsigned int segs)1657 unsigned int segs)
1627{1658{
1628}1659}
1629static inline unsigned short queue_max_integrity_segments(struct request_queue *q)1660static inline unsigned short queue_max_integrity_segments(const struct request_queue *q)
1630{1661{
1631 return 0;1662 return 0;
1632}1663}
include/linux/bpf.h+9−7
@@ -24,6 +24,9 @@ struct seq_file; · 23 unmodified lines
24struct btf;24struct btf;
25struct btf_type;25struct btf_type;
26 26
27extern struct idr btf_idr;
28extern spinlock_t btf_idr_lock;
29
27/* map is generic key/value storage optionally accesible by eBPF programs */30/* map is generic key/value storage optionally accesible by eBPF programs */
28struct bpf_map_ops {31struct bpf_map_ops {
29 /* funcs callable from userspace (via syscall) */32 /* 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
647struct bpf_map *bpf_map_get_with_uref(u32 ufd);650struct bpf_map *bpf_map_get_with_uref(u32 ufd);
648struct bpf_map *__bpf_map_get(struct fd f);651struct bpf_map *__bpf_map_get(struct fd f);
649struct bpf_map * __must_check bpf_map_inc(struct bpf_map *map, bool uref);652struct bpf_map * __must_check bpf_map_inc(struct bpf_map *map, bool uref);
653struct bpf_map * __must_check bpf_map_inc_not_zero(struct bpf_map *map,
654 bool uref);
650void bpf_map_put_with_uref(struct bpf_map *map);655void bpf_map_put_with_uref(struct bpf_map *map);
651void bpf_map_put(struct bpf_map *map);656void bpf_map_put(struct bpf_map *map);
652int bpf_map_charge_memlock(struct bpf_map *map, u32 pages);657int bpf_map_charge_memlock(struct bpf_map *map, u32 pages);
@@ -713,7 +718,7 @@ struct xdp_buff; · 60 unmodified lines
713struct sk_buff;718struct sk_buff;
714 719
715struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key);720struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key);
716void __dev_map_insert_ctx(struct bpf_map *map, u32 index);721struct bpf_dtab_netdev *__dev_map_hash_lookup_elem(struct bpf_map *map, u32 key);
717void __dev_map_flush(struct bpf_map *map);722void __dev_map_flush(struct bpf_map *map);
718int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,723int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,
719 struct net_device *dev_rx);724 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
721 struct bpf_prog *xdp_prog);726 struct bpf_prog *xdp_prog);
722 727
723struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key);728struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key);
724void __cpu_map_insert_ctx(struct bpf_map *map, u32 index);
725void __cpu_map_flush(struct bpf_map *map);729void __cpu_map_flush(struct bpf_map *map);
726int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_buff *xdp,730int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_buff *xdp,
727 struct net_device *dev_rx);731 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
801 return NULL;805 return NULL;
802}806}
803 807
804static inline void __dev_map_insert_ctx(struct bpf_map *map, u32 index)808static inline struct net_device *__dev_map_hash_lookup_elem(struct bpf_map *map,
809 u32 key)
805{810{
811 return NULL;
806}812}
807 813
808static inline void __dev_map_flush(struct bpf_map *map)814static 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
834 return NULL;840 return NULL;
835}841}
836 842
837static inline void __cpu_map_insert_ctx(struct bpf_map *map, u32 index)
838{
839}
840
841static inline void __cpu_map_flush(struct bpf_map *map)843static inline void __cpu_map_flush(struct bpf_map *map)
842{844{
843}845}
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
62BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops)62BPF_MAP_TYPE(BPF_MAP_TYPE_HASH_OF_MAPS, htab_of_maps_map_ops)
63#ifdef CONFIG_NET63#ifdef CONFIG_NET
64BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)64BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP, dev_map_ops)
65BPF_MAP_TYPE(BPF_MAP_TYPE_DEVMAP_HASH, dev_map_hash_ops)
65BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)66BPF_MAP_TYPE(BPF_MAP_TYPE_SK_STORAGE, sk_storage_map_ops)
66#if defined(CONFIG_BPF_STREAM_PARSER)67#if defined(CONFIG_BPF_STREAM_PARSER)
67BPF_MAP_TYPE(BPF_MAP_TYPE_SOCKMAP, sock_map_ops)68BPF_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
355 struct bpf_verifier_stack_elem *head; /* stack of verifier states to be processed */355 struct bpf_verifier_stack_elem *head; /* stack of verifier states to be processed */
356 int stack_size; /* number of states to be processed */356 int stack_size; /* number of states to be processed */
357 bool strict_alignment; /* perform strict pointer alignment checks */357 bool strict_alignment; /* perform strict pointer alignment checks */
358 bool test_state_freq; /* test verifier with different pruning frequency */
358 struct bpf_verifier_state *cur_state; /* current verifier state */359 struct bpf_verifier_state *cur_state; /* current verifier state */
359 struct bpf_verifier_state_list **explored_states; /* search pruning optimization */360 struct bpf_verifier_state_list **explored_states; /* search pruning optimization */
360 struct bpf_verifier_state_list *free_list;361 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
47 47
48#else /* !CONFIG_GENERIC_BUG */48#else /* !CONFIG_GENERIC_BUG */
49 49
50static inline void *find_bug(unsigned long bugaddr)
51{
52 return NULL;
53}
54
50static inline enum bug_trap_type report_bug(unsigned long bug_addr,55static inline enum bug_trap_type report_bug(unsigned long bug_addr,
51 struct pt_regs *regs)56 struct pt_regs *regs)
52{57{
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
52enum { RX_ERR, RX_ALL, RX_FIL, RX_INV, RX_MAX };
53
54struct 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
61struct 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) */
2/*2/*
3 * linux/can/core.h3 * linux/can/core.h
4 *4 *
@@ -41,6 +41,14 @@ struct can_proto { · 36 unmodified lines
41 struct proto *prot;41 struct proto *prot;
42};42};
43 43
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
44/* function prototypes for the CAN networklayer core (af_can.c) */52/* function prototypes for the CAN networklayer core (af_can.c) */
45 53
46extern int can_proto_register(const struct can_proto *cp);54extern 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
57 void *data);65 void *data);
58 66
59extern int can_send(struct sk_buff *skb, int loop);67extern int can_send(struct sk_buff *skb, int loop);
60extern int can_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
61 68
62#endif /* !_CAN_CORE_H */69#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
169 169
170void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,170void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
171 unsigned int idx);171 unsigned int idx);
172struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 *len_ptr);172struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx,
173 u8 *len_ptr);
173unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx);174unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx);
174void can_free_echo_skb(struct net_device *dev, unsigned int idx);175void can_free_echo_skb(struct net_device *dev, unsigned int idx);
175 176
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 */
8enum CLKR {
9 CLKR_CLKP1 = 0, /* Peripheral clock (clkp1) */
10 CLKR_CLKP2 = 1, /* Peripheral clock (clkp2) */
11 CLKR_CLKEXT = 3 /* Externally input clock */
12};
13
14struct 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
15struct can_rx_offload {15struct can_rx_offload {
16 struct net_device *dev;16 struct net_device *dev;
17 17
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,
19 u32 *timestamp, unsigned int mb);20 u32 *timestamp, unsigned int mb);
20 21
21 struct sk_buff_head skb_queue;22 struct sk_buff_head skb_queue;
@@ -29,9 +30,13 @@ struct can_rx_offload { · 7 unmodified lines
29 bool inc;30 bool inc;
30};31};
31 32
32int can_rx_offload_add_timestamp(struct net_device *dev, struct can_rx_offload *offload);33int can_rx_offload_add_timestamp(struct net_device *dev,
33int can_rx_offload_add_fifo(struct net_device *dev, struct can_rx_offload *offload, unsigned int weight);34 struct can_rx_offload *offload);
34int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload, u64 reg);35int can_rx_offload_add_fifo(struct net_device *dev,
36 struct can_rx_offload *offload,
37 unsigned int weight);
38int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload,
39 u64 reg);
35int can_rx_offload_irq_offload_fifo(struct can_rx_offload *offload);40int can_rx_offload_irq_offload_fifo(struct can_rx_offload *offload);
36int can_rx_offload_queue_sorted(struct can_rx_offload *offload,41int can_rx_offload_queue_sorted(struct can_rx_offload *offload,
37 struct sk_buff *skb, u32 timestamp);42 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) */
2/*2/*
3 * linux/can/skb.h3 * linux/can/skb.h
4 *4 *
include/linux/ccp.h+2−0
@@ -170,6 +170,8 @@ struct ccp_aes_engine { · 169 unmodified lines
170 enum ccp_aes_mode mode;170 enum ccp_aes_mode mode;
171 enum ccp_aes_action action;171 enum ccp_aes_action action;
172 172
173 u32 authsize;
174
173 struct scatterlist *key;175 struct scatterlist *key;
174 u32 key_len; /* In bytes */176 u32 key_len; /* In bytes */
175 177
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
30 30
31static inline void ceph_buffer_put(struct ceph_buffer *b)31static inline void ceph_buffer_put(struct ceph_buffer *b)
32{32{
33 kref_put(&b->kref, ceph_buffer_release);33 if (b)
34 kref_put(&b->kref, ceph_buffer_release);
34}35}
35 36
36extern int ceph_decode_buffer(struct ceph_buffer **b, void **p, void *end);37extern 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
293struct ceph_entity_addr *ceph_client_addr(struct ceph_client *client);293struct ceph_entity_addr *ceph_client_addr(struct ceph_client *client);
294u64 ceph_client_gid(struct ceph_client *client);294u64 ceph_client_gid(struct ceph_client *client);
295extern void ceph_destroy_client(struct ceph_client *client);295extern void ceph_destroy_client(struct ceph_client *client);
296extern void ceph_reset_client_addr(struct ceph_client *client);
296extern int __ceph_open_session(struct ceph_client *client,297extern int __ceph_open_session(struct ceph_client *client,
297 unsigned long started);298 unsigned long started);
298extern int ceph_open_session(struct ceph_client *client);299extern 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
337extern void ceph_messenger_init(struct ceph_messenger *msgr,337extern void ceph_messenger_init(struct ceph_messenger *msgr,
338 struct ceph_entity_addr *myaddr);338 struct ceph_entity_addr *myaddr);
339extern void ceph_messenger_fini(struct ceph_messenger *msgr);339extern void ceph_messenger_fini(struct ceph_messenger *msgr);
340extern void ceph_messenger_reset_nonce(struct ceph_messenger *msgr);
340 341
341extern void ceph_con_init(struct ceph_connection *con, void *private,342extern void ceph_con_init(struct ceph_connection *con, void *private,
342 const struct ceph_connection_operations *ops,343 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
109 109
110extern int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl);110extern int ceph_monc_init(struct ceph_mon_client *monc, struct ceph_client *cl);
111extern void ceph_monc_stop(struct ceph_mon_client *monc);111extern void ceph_monc_stop(struct ceph_mon_client *monc);
112extern void ceph_monc_reopen_session(struct ceph_mon_client *monc);
112 113
113enum {114enum {
114 CEPH_SUB_MONMAP = 0,115 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
381extern int ceph_osdc_init(struct ceph_osd_client *osdc,381extern int ceph_osdc_init(struct ceph_osd_client *osdc,
382 struct ceph_client *client);382 struct ceph_client *client);
383extern void ceph_osdc_stop(struct ceph_osd_client *osdc);383extern void ceph_osdc_stop(struct ceph_osd_client *osdc);
384extern void ceph_osdc_reopen_osds(struct ceph_osd_client *osdc);
384 385
385extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc,386extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc,
386 struct ceph_msg *msg);387 struct ceph_msg *msg);
@@ -388,6 +389,7 @@ extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, · 1 unmodified line
388 struct ceph_msg *msg);389 struct ceph_msg *msg);
389void ceph_osdc_update_epoch_barrier(struct ceph_osd_client *osdc, u32 eb);390void ceph_osdc_update_epoch_barrier(struct ceph_osd_client *osdc, u32 eb);
390void ceph_osdc_abort_requests(struct ceph_osd_client *osdc, int err);391void ceph_osdc_abort_requests(struct ceph_osd_client *osdc, int err);
392void ceph_osdc_clear_abort_err(struct ceph_osd_client *osdc);
391 393
392#define osd_req_op_data(oreq, whch, typ, fld) \394#define osd_req_op_data(oreq, whch, typ, fld) \
393({ \395({ \
include/linux/cgroup.h+1−0
@@ -150,6 +150,7 @@ struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset, · 149 unmodified lines
150struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset,150struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset,
151 struct cgroup_subsys_state **dst_cssp);151 struct cgroup_subsys_state **dst_cssp);
152 152
153void cgroup_enable_task_cg_lists(void);
153void css_task_iter_start(struct cgroup_subsys_state *css, unsigned int flags,154void css_task_iter_start(struct cgroup_subsys_state *css, unsigned int flags,
154 struct css_task_iter *it);155 struct css_task_iter *it);
155struct task_struct *css_task_iter_next(struct css_task_iter *it);156struct 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
299 * into the clk API299 * into the clk API
300 *300 *
301 * @init: pointer to struct clk_init_data that contains the init data shared301 * @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.
303 */304 */
304struct clk_hw {305struct clk_hw {
305 struct clk_core *core;306 struct clk_core *core;
@@ -817,6 +818,7 @@ unsigned int clk_hw_get_num_parents(const struct clk_hw *hw); · 511 unmodified lines
817struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw);818struct clk_hw *clk_hw_get_parent(const struct clk_hw *hw);
818struct clk_hw *clk_hw_get_parent_by_index(const struct clk_hw *hw,819struct clk_hw *clk_hw_get_parent_by_index(const struct clk_hw *hw,
819 unsigned int index);820 unsigned int index);
821int clk_hw_set_parent(struct clk_hw *hw, struct clk_hw *new_parent);
820unsigned int __clk_get_enable_count(struct clk *clk);822unsigned int __clk_get_enable_count(struct clk *clk);
821unsigned long clk_hw_get_rate(const struct clk_hw *hw);823unsigned long clk_hw_get_rate(const struct clk_hw *hw);
822unsigned long __clk_get_flags(struct clk *clk);824unsigned 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
239 return 0;239 return 0;
240}240}
241 241
242static inline int __must_check clk_bulk_prepare(int num_clks, struct clk_bulk_data *clks)242static inline int __must_check
243clk_bulk_prepare(int num_clks, const struct clk_bulk_data *clks)
243{244{
244 might_sleep();245 might_sleep();
245 return 0;246 return 0;
@@ -263,7 +264,8 @@ static inline void clk_unprepare(struct clk *clk) · 17 unmodified lines
263{264{
264 might_sleep();265 might_sleep();
265}266}
266static inline void clk_bulk_unprepare(int num_clks, struct clk_bulk_data *clks)267static inline void clk_bulk_unprepare(int num_clks,
268 const struct clk_bulk_data *clks)
267{269{
268 might_sleep();270 might_sleep();
269}271}
@@ -359,6 +361,7 @@ int __must_check devm_clk_bulk_get(struct device *dev, int num_clks, · 89 unmodified lines
359/**361/**
360 * devm_clk_bulk_get_optional - managed get multiple optional consumer clocks362 * devm_clk_bulk_get_optional - managed get multiple optional consumer clocks
361 * @dev: device for clock "consumer"363 * @dev: device for clock "consumer"
364 * @num_clks: the number of clk_bulk_data
362 * @clks: pointer to the clk_bulk_data table of consumer365 * @clks: pointer to the clk_bulk_data table of consumer
363 *366 *
364 * Behaves the same as devm_clk_bulk_get() except where there is no clock367 * 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
819 return 0;822 return 0;
820}823}
821 824
822static inline int __must_check clk_bulk_enable(int num_clks, struct clk_bulk_data *clks)825static inline int __must_check clk_bulk_enable(int num_clks,
826 const struct clk_bulk_data *clks)
823{827{
824 return 0;828 return 0;
825}829}
@@ -828,7 +832,7 @@ static inline void clk_disable(struct clk *clk) {} · 2 unmodified lines
828 832
829 833
830static inline void clk_bulk_disable(int num_clks,834static inline void clk_bulk_disable(int num_clks,
831 struct clk_bulk_data *clks) {}835 const struct clk_bulk_data *clks) {}
832 836
833static inline unsigned long clk_get_rate(struct clk *clk)837static inline unsigned long clk_get_rate(struct clk *clk)
834{838{
@@ -917,8 +921,8 @@ static inline void clk_disable_unprepare(struct clk *clk) · 82 unmodified lines
917 clk_unprepare(clk);921 clk_unprepare(clk);
918}922}
919 923
920static inline int __must_check clk_bulk_prepare_enable(int num_clks,924static inline int __must_check
921 struct clk_bulk_data *clks)925clk_bulk_prepare_enable(int num_clks, const struct clk_bulk_data *clks)
922{926{
923 int ret;927 int ret;
924 928
@@ -933,7 +937,7 @@ static inline int __must_check clk_bulk_prepare_enable(int num_clks, · 8 unmodified lines
933}937}
934 938
935static inline void clk_bulk_disable_unprepare(int num_clks,939static inline void clk_bulk_disable_unprepare(int num_clks,
936 struct clk_bulk_data *clks)940 const struct clk_bulk_data *clks)
937{941{
938 clk_bulk_disable(num_clks, clks);942 clk_bulk_disable(num_clks, clks);
939 clk_bulk_unprepare(num_clks, clks);943 clk_bulk_unprepare(num_clks, clks);
include/linux/clk/clk-conf.h+5−0
@@ -4,6 +4,9 @@ · 3 unmodified lines
4 * Sylwester Nawrocki <s.nawrocki@samsung.com>4 * Sylwester Nawrocki <s.nawrocki@samsung.com>
5 */5 */
6 6
7#ifndef __CLK_CONF_H
8#define __CLK_CONF_H
9
7#include <linux/types.h>10#include <linux/types.h>
8 11
9struct device_node;12struct device_node;
@@ -17,3 +20,5 @@ static inline int of_clk_set_defaults(struct device_node *node, · 7 unmodified lines
17 return 0;20 return 0;
18}21}
19#endif22#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
129 return false;129 return false;
130}130}
131 131
132/*132/* Compaction needs reclaim to be performed first, so it can continue. */
133 * Compaction has backed off for some reason. It might be throttling or133static inline bool compaction_needs_reclaim(enum compact_result result)
134 * lock contention. Retrying is still worthwhile.
135 */
136static inline bool compaction_withdrawn(enum compact_result result)
137{134{
138 /*135 /*
139 * Compaction backed off due to watermark checks for order-0136 * 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
142 if (result == COMPACT_SKIPPED)139 if (result == COMPACT_SKIPPED)
143 return true;140 return true;
144 141
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 */
150static inline bool compaction_withdrawn(enum compact_result result)
151{
145 /*152 /*
146 * If compaction is deferred for high-order allocations, it is153 * If compaction is deferred for high-order allocations, it is
147 * because sync compaction recently failed. If this is the case154 * 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
207 return false;214 return false;
208}215}
209 216
217static inline bool compaction_needs_reclaim(enum compact_result result)
218{
219 return false;
220}
221
210static inline bool compaction_withdrawn(enum compact_result result)222static inline bool compaction_withdrawn(enum compact_result result)
211{223{
212 return true;224 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
24 long ______r; \24 long ______r; \
25 static struct ftrace_likely_data \25 static struct ftrace_likely_data \
26 __aligned(4) \26 __aligned(4) \
27 __section("_ftrace_annotated_branch") \27 __section(_ftrace_annotated_branch) \
28 ______f = { \28 ______f = { \
29 .data.func = __func__, \29 .data.func = __func__, \
30 .data.file = __FILE__, \30 .data.file = __FILE__, \
@@ -60,7 +60,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 29 unmodified lines
60#define __trace_if_value(cond) ({ \60#define __trace_if_value(cond) ({ \
61 static struct ftrace_branch_data \61 static struct ftrace_branch_data \
62 __aligned(4) \62 __aligned(4) \
63 __section("_ftrace_branch") \63 __section(_ftrace_branch) \
64 __if_trace = { \64 __if_trace = { \
65 .func = __func__, \65 .func = __func__, \
66 .file = __FILE__, \66 .file = __FILE__, \
@@ -118,7 +118,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, · 51 unmodified lines
118 ".popsection\n\t"118 ".popsection\n\t"
119 119
120/* Annotate a C jump table to allow objtool to follow the code flow */120/* 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)
122 122
123#else123#else
124#define annotate_reachable()124#define annotate_reachable()
@@ -298,7 +298,7 @@ unsigned long read_word_at_a_time(const void *addr) · 173 unmodified lines
298 * visible to the compiler.298 * visible to the compiler.
299 */299 */
300#define __ADDRESSABLE(sym) \300#define __ADDRESSABLE(sym) \
301 static void * __section(".discard.addressable") __used \301 static void * __section(.discard.addressable) __used \
302 __PASTE(__addressable_##sym, __LINE__) = (void *)&sym;302 __PASTE(__addressable_##sym, __LINE__) = (void *)&sym;
303 303
304/**304/**
include/linux/compiler_types.h+30−7
@@ -130,10 +130,6 @@ struct ftrace_likely_data { · 129 unmodified lines
130 130
131/*131/*
132 * Force always-inline if the user requests it so via the .config.132 * 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.
137 * Prefer gnu_inline, so that extern inline functions do not emit an133 * Prefer gnu_inline, so that extern inline functions do not emit an
138 * externally visible function. This makes extern inline behave as per gnu89134 * externally visible function. This makes extern inline behave as per gnu89
139 * semantics rather than c99. This prevents multiple symbol definition errors135 * semantics rather than c99. This prevents multiple symbol definition errors
@@ -144,14 +140,35 @@ struct ftrace_likely_data { · 4 unmodified lines
144 */140 */
145#if !defined(CONFIG_OPTIMIZE_INLINING)141#if !defined(CONFIG_OPTIMIZE_INLINING)
146#define inline inline __attribute__((__always_inline__)) __gnu_inline \142#define inline inline __attribute__((__always_inline__)) __gnu_inline \
147 __maybe_unused notrace143 __inline_maybe_unused notrace
148#else144#else
149#define inline inline __gnu_inline \145#define inline inline __gnu_inline \
150 __maybe_unused notrace146 __inline_maybe_unused notrace
151#endif147#endif
152 148
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 */
153#define __inline__ inline159#define __inline__ inline
154#define __inline inline160
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
155 172
156/*173/*
157 * Rather then using noinline to prevent stack consumption, use174 * Rather then using noinline to prevent stack consumption, use
@@ -189,6 +206,12 @@ struct ftrace_likely_data { · 31 unmodified lines
189#define asm_volatile_goto(x...) asm goto(x)206#define asm_volatile_goto(x...) asm goto(x)
190#endif207#endif
191 208
209#ifdef CONFIG_CC_HAS_ASM_INLINE
210#define asm_inline asm __inline
211#else
212#define asm_inline asm
213#endif
214
192#ifndef __no_fgcse215#ifndef __no_fgcse
193# define __no_fgcse216# define __no_fgcse
194#endif217#endif
include/linux/connector.h+0−1
@@ -50,7 +50,6 @@ struct cn_dev { · 49 unmodified lines
50 50
51 u32 seq, groups;51 u32 seq, groups;
52 struct sock *nls;52 struct sock *nls;
53 void (*input) (struct sk_buff *skb);
54 53
55 struct cn_queue_dev *cbdev;54 struct cn_queue_dev *cbdev;
56};55};
include/linux/container.h+5−0
@@ -6,6 +6,9 @@ · 5 unmodified lines
6 * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>6 * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7 */7 */
8 8
9#ifndef _LINUX_CONTAINER_H
10#define _LINUX_CONTAINER_H
11
9#include <linux/device.h>12#include <linux/device.h>
10 13
11/* drivers/base/power/container.c */14/* drivers/base/power/container.c */
@@ -20,3 +23,5 @@ static inline struct container_dev *to_container_dev(struct device *dev) · 8 unmodified lines
20{23{
21 return container_of(dev, struct container_dev, dev);24 return container_of(dev, struct container_dev, dev);
22}25}
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
179int cpu_report_state(int cpu);179int cpu_report_state(int cpu);
180int cpu_check_up_prepare(int cpu);180int cpu_check_up_prepare(int cpu);
181void cpu_set_state_online(int cpu);181void cpu_set_state_online(int cpu);
182void play_idle(unsigned long duration_ms);182void play_idle(unsigned long duration_us);
183 183
184#ifdef CONFIG_HOTPLUG_CPU184#ifdef CONFIG_HOTPLUG_CPU
185bool cpu_wait_death(unsigned int cpu, int seconds);185bool cpu_wait_death(unsigned int cpu, int seconds);
@@ -201,12 +201,14 @@ enum cpuhp_smt_control { · 15 unmodified lines
201extern enum cpuhp_smt_control cpu_smt_control;201extern enum cpuhp_smt_control cpu_smt_control;
202extern void cpu_smt_disable(bool force);202extern void cpu_smt_disable(bool force);
203extern void cpu_smt_check_topology(void);203extern void cpu_smt_check_topology(void);
204extern bool cpu_smt_possible(void);
204extern int cpuhp_smt_enable(void);205extern int cpuhp_smt_enable(void);
205extern int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval);206extern int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval);
206#else207#else
207# define cpu_smt_control (CPU_SMT_NOT_IMPLEMENTED)208# define cpu_smt_control (CPU_SMT_NOT_IMPLEMENTED)
208static inline void cpu_smt_disable(bool force) { }209static inline void cpu_smt_disable(bool force) { }
209static inline void cpu_smt_check_topology(void) { }210static inline void cpu_smt_check_topology(void) { }
211static inline bool cpu_smt_possible(void) { return false; }
210static inline int cpuhp_smt_enable(void) { return 0; }212static inline int cpuhp_smt_enable(void) { return 0; }
211static inline int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) { return 0; }213static inline int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) { return 0; }
212#endif214#endif
include/linux/cpufreq.h+2−2
@@ -456,8 +456,8 @@ static inline void cpufreq_resume(void) {} · 455 unmodified lines
456#define CPUFREQ_POSTCHANGE (1)456#define CPUFREQ_POSTCHANGE (1)
457 457
458/* Policy Notifiers */458/* Policy Notifiers */
459#define CPUFREQ_ADJUST (0)459#define CPUFREQ_CREATE_POLICY (0)
460#define CPUFREQ_NOTIFY (1)460#define CPUFREQ_REMOVE_POLICY (1)
461 461
462#ifdef CONFIG_CPU_FREQ462#ifdef CONFIG_CPU_FREQ
463int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);463int 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
85 unsigned int cpu;85 unsigned int cpu;
86 ktime_t next_hrtimer;86 ktime_t next_hrtimer;
87 87
88 int last_state_idx;
88 int last_residency;89 int last_residency;
90 u64 poll_limit_ns;
89 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];91 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
90 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];92 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
91 struct cpuidle_driver_kobj *kobj_driver;93 struct cpuidle_driver_kobj *kobj_driver;
@@ -119,6 +121,9 @@ struct cpuidle_driver { · 27 unmodified lines
119 121
120 /* the driver handles the cpus in cpumask */122 /* the driver handles the cpus in cpumask */
121 struct cpumask *cpumask;123 struct cpumask *cpumask;
124
125 /* preferred governor to switch at register time */
126 const char *governor;
122};127};
123 128
124#ifdef CONFIG_CPU_IDLE129#ifdef CONFIG_CPU_IDLE
@@ -132,6 +137,8 @@ extern int cpuidle_select(struct cpuidle_driver *drv, · 7 unmodified lines
132extern int cpuidle_enter(struct cpuidle_driver *drv,137extern int cpuidle_enter(struct cpuidle_driver *drv,
133 struct cpuidle_device *dev, int index);138 struct cpuidle_device *dev, int index);
134extern void cpuidle_reflect(struct cpuidle_device *dev, int index);139extern void cpuidle_reflect(struct cpuidle_device *dev, int index);
140extern u64 cpuidle_poll_time(struct cpuidle_driver *drv,
141 struct cpuidle_device *dev);
135 142
136extern int cpuidle_register_driver(struct cpuidle_driver *drv);143extern int cpuidle_register_driver(struct cpuidle_driver *drv);
137extern struct cpuidle_driver *cpuidle_get_driver(void);144extern struct cpuidle_driver *cpuidle_get_driver(void);
@@ -166,6 +173,9 @@ static inline int cpuidle_enter(struct cpuidle_driver *drv, · 28 unmodified lines
166 struct cpuidle_device *dev, int index)173 struct cpuidle_device *dev, int index)
167{return -ENODEV; }174{return -ENODEV; }
168static inline void cpuidle_reflect(struct cpuidle_device *dev, int index) { }175static inline void cpuidle_reflect(struct cpuidle_device *dev, int index) { }
176static inline u64 cpuidle_poll_time(struct cpuidle_driver *drv,
177 struct cpuidle_device *dev)
178{return 0; }
169static inline int cpuidle_register_driver(struct cpuidle_driver *drv)179static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
170{return -ENODEV; }180{return -ENODEV; }
171static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }181static 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
256{return 0;}266{return 0;}
257#endif267#endif
258 268
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) \
260({ \273({ \
261 int __ret = 0; \274 int __ret = 0; \
262 \275 \
@@ -268,7 +281,7 @@ static inline int cpuidle_register_governor(struct cpuidle_governor *gov) · 5 unmodified lines
268 if (!is_retention) \281 if (!is_retention) \
269 __ret = cpu_pm_enter(); \282 __ret = cpu_pm_enter(); \
270 if (!__ret) { \283 if (!__ret) { \
271 __ret = low_level_idle_enter(idx); \284 __ret = low_level_idle_enter(state); \
272 if (!is_retention) \285 if (!is_retention) \
273 cpu_pm_exit(); \286 cpu_pm_exit(); \
274 } \287 } \
@@ -277,9 +290,15 @@ static inline int cpuidle_register_governor(struct cpuidle_governor *gov) · 2 unmodified lines
277})290})
278 291
279#define CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx) \292#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)
281 294
282#define CPU_PM_CPU_IDLE_ENTER_RETENTION(low_level_idle_enter, idx) \295#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)
284 303
285#endif /* _LINUX_CPUIDLE_H */304#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
8static inline void arch_haltpoll_enable(unsigned int cpu)
9{
10}
11
12static 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
10#include <linux/kernel.h>10#include <linux/kernel.h>
11#include <linux/threads.h>11#include <linux/threads.h>
12#include <linux/bitmap.h>12#include <linux/bitmap.h>
13#include <linux/atomic.h>
13#include <linux/bug.h>14#include <linux/bug.h>
14 15
15/* Don't assign or return these: may not be this big! */16/* Don't assign or return these: may not be this big! */
@@ -95,8 +96,21 @@ extern struct cpumask __cpu_active_mask; · 79 unmodified lines
95#define cpu_present_mask ((const struct cpumask *)&__cpu_present_mask)96#define cpu_present_mask ((const struct cpumask *)&__cpu_present_mask)
96#define cpu_active_mask ((const struct cpumask *)&__cpu_active_mask)97#define cpu_active_mask ((const struct cpumask *)&__cpu_active_mask)
97 98
99extern atomic_t __num_online_cpus;
100
98#if NR_CPUS > 1101#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 */
110static inline unsigned int num_online_cpus(void)
111{
112 return atomic_read(&__num_online_cpus);
113}
100#define num_possible_cpus() cpumask_weight(cpu_possible_mask)114#define num_possible_cpus() cpumask_weight(cpu_possible_mask)
101#define num_present_cpus() cpumask_weight(cpu_present_mask)115#define num_present_cpus() cpumask_weight(cpu_present_mask)
102#define num_active_cpus() cpumask_weight(cpu_active_mask)116#define num_active_cpus() cpumask_weight(cpu_active_mask)
@@ -115,6 +129,8 @@ extern struct cpumask __cpu_active_mask; · 12 unmodified lines
115#define cpu_active(cpu) ((cpu) == 0)129#define cpu_active(cpu) ((cpu) == 0)
116#endif130#endif
117 131
132extern cpumask_t cpus_booted_once_mask;
133
118static inline void cpu_max_bits_warn(unsigned int cpu, unsigned int bits)134static inline void cpu_max_bits_warn(unsigned int cpu, unsigned int bits)
119{135{
120#ifdef CONFIG_DEBUG_PER_CPU_MAPS136#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
184 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)200 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
185#define for_each_cpu_wrap(cpu, mask, start) \201#define for_each_cpu_wrap(cpu, mask, start) \
186 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)(start))202 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)(start))
187#define for_each_cpu_and(cpu, mask, and) \203#define for_each_cpu_and(cpu, mask1, mask2) \
188 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and)204 for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask1, (void)mask2)
189#else205#else
190/**206/**
191 * cpumask_first - get the first cpu in a cpumask207 * 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
274/**290/**
275 * for_each_cpu_and - iterate over every cpu in both masks291 * for_each_cpu_and - iterate over every cpu in both masks
276 * @cpu: the (optionally unsigned) integer iterator292 * @cpu: the (optionally unsigned) integer iterator
277 * @mask: the first cpumask pointer293 * @mask1: the first cpumask pointer
278 * @and: the second cpumask pointer294 * @mask2: the second cpumask pointer
279 *295 *
280 * This saves a temporary CPU mask in many places. It is equivalent to:296 * This saves a temporary CPU mask in many places. It is equivalent to:
281 * struct cpumask tmp;297 * struct cpumask tmp;
282 * cpumask_and(&tmp, &mask, &and);298 * cpumask_and(&tmp, &mask1, &mask2);
283 * for_each_cpu(cpu, &tmp)299 * for_each_cpu(cpu, &tmp)
284 * ...300 * ...
285 *301 *
286 * After the loop, cpu is >= nr_cpu_ids.302 * After the loop, cpu is >= nr_cpu_ids.
287 */303 */
288#define for_each_cpu_and(cpu, mask, and) \304#define for_each_cpu_and(cpu, mask1, mask2) \
289 for ((cpu) = -1; \305 for ((cpu) = -1; \
290 (cpu) = cpumask_next_and((cpu), (mask), (and)), \306 (cpu) = cpumask_next_and((cpu), (mask1), (mask2)), \
291 (cpu) < nr_cpu_ids;)307 (cpu) < nr_cpu_ids;)
292#endif /* SMP */308#endif /* SMP */
293 309
@@ -473,6 +489,20 @@ static inline bool cpumask_equal(const struct cpumask *src1p, · 179 unmodified lines
473 nr_cpumask_bits);489 nr_cpumask_bits);
474}490}
475 491
492/**
493 * cpumask_or_equal - *src1p | *src2p == *src3p
494 * @src1p: the first input
495 * @src2p: the second input
496 * @src3p: the third input
497 */
498static 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
476/**506/**
477 * cpumask_intersects - (*src1p & *src2p) != 0507 * cpumask_intersects - (*src1p & *src2p) != 0
478 * @src1p: the first input508 * @src1p: the first input
@@ -805,14 +835,7 @@ set_cpu_present(unsigned int cpu, bool present) · 326 unmodified lines
805 cpumask_clear_cpu(cpu, &__cpu_present_mask);835 cpumask_clear_cpu(cpu, &__cpu_present_mask);
806}836}
807 837
808static inline void838void set_cpu_online(unsigned int cpu, bool online);
809set_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}
816 839
817static inline void840static inline void
818set_cpu_active(unsigned int cpu, bool active)841set_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
40 40
41static inline void cpuset_inc(void)41static inline void cpuset_inc(void)
42{42{
43 static_branch_inc(&cpusets_pre_enable_key);43 static_branch_inc_cpuslocked(&cpusets_pre_enable_key);
44 static_branch_inc(&cpusets_enabled_key);44 static_branch_inc_cpuslocked(&cpusets_enabled_key);
45}45}
46 46
47static inline void cpuset_dec(void)47static inline void cpuset_dec(void)
48{48{
49 static_branch_dec(&cpusets_enabled_key);49 static_branch_dec_cpuslocked(&cpusets_enabled_key);
50 static_branch_dec(&cpusets_pre_enable_key);50 static_branch_dec_cpuslocked(&cpusets_pre_enable_key);
51}51}
52 52
53extern int cpuset_init(void);53extern int cpuset_init(void);
@@ -55,6 +55,8 @@ extern void cpuset_init_smp(void); · 1 unmodified line
55extern void cpuset_force_rebuild(void);55extern void cpuset_force_rebuild(void);
56extern void cpuset_update_active_cpus(void);56extern void cpuset_update_active_cpus(void);
57extern void cpuset_wait_for_hotplug(void);57extern void cpuset_wait_for_hotplug(void);
58extern void cpuset_read_lock(void);
59extern void cpuset_read_unlock(void);
58extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);60extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);
59extern void cpuset_cpus_allowed_fallback(struct task_struct *p);61extern void cpuset_cpus_allowed_fallback(struct task_struct *p);
60extern nodemask_t cpuset_mems_allowed(struct task_struct *p);62extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
@@ -176,6 +178,9 @@ static inline void cpuset_update_active_cpus(void) · 115 unmodified lines
176 178
177static inline void cpuset_wait_for_hotplug(void) { }179static inline void cpuset_wait_for_hotplug(void) { }
178 180
181static inline void cpuset_read_lock(void) { }
182static inline void cpuset_read_unlock(void) { }
183
179static inline void cpuset_cpus_allowed(struct task_struct *p,184static inline void cpuset_cpus_allowed(struct task_struct *p,
180 struct cpumask *mask)185 struct cpumask *mask)
181{186{
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
115 return -EOPNOTSUPP;115 return -EOPNOTSUPP;
116}116}
117#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */117#endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */
118
119#ifdef CONFIG_PROC_VMCORE
120ssize_t read_from_oldmem(char *buf, size_t count,
121 u64 *ppos, int userbuf,
122 bool encrypted);
123#else
124static 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
118#endif /* LINUX_CRASHDUMP_H */132#endif /* LINUX_CRASHDUMP_H */
include/linux/cred.h+7−2
@@ -145,7 +145,11 @@ struct cred { · 144 unmodified lines
145 struct user_struct *user; /* real user ID subscription */145 struct user_struct *user; /* real user ID subscription */
146 struct user_namespace *user_ns; /* user_ns the caps and keyrings are relative to. */146 struct user_namespace *user_ns; /* user_ns the caps and keyrings are relative to. */
147 struct group_info *group_info; /* supplementary groups for euid/fsgid */147 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 };
149} __randomize_layout;153} __randomize_layout;
150 154
151extern void __put_cred(struct cred *);155extern void __put_cred(struct cred *);
@@ -246,6 +250,7 @@ static inline const struct cred *get_cred(const struct cred *cred) · 94 unmodified lines
246 if (!cred)250 if (!cred)
247 return cred;251 return cred;
248 validate_creds(cred);252 validate_creds(cred);
253 nonconst_cred->non_rcu = 0;
249 return get_new_cred(nonconst_cred);254 return get_new_cred(nonconst_cred);
250}255}
251 256
@@ -257,6 +262,7 @@ static inline const struct cred *get_cred_rcu(const struct cred *cred) · 5 unmodified lines
257 if (!atomic_inc_not_zero(&nonconst_cred->usage))262 if (!atomic_inc_not_zero(&nonconst_cred->usage))
258 return NULL;263 return NULL;
259 validate_creds(cred);264 validate_creds(cred);
265 nonconst_cred->non_rcu = 0;
260 return cred;266 return cred;
261}267}
262 268
@@ -380,7 +386,6 @@ static inline void put_cred(const struct cred *_cred) · 117 unmodified lines
380#define current_fsgid() (current_cred_xxx(fsgid))386#define current_fsgid() (current_cred_xxx(fsgid))
381#define current_cap() (current_cred_xxx(cap_effective))387#define current_cap() (current_cred_xxx(cap_effective))
382#define current_user() (current_cred_xxx(user))388#define current_user() (current_cred_xxx(user))
383#define current_security() (current_cred_xxx(security))
384 389
385extern struct user_namespace init_user_ns;390extern struct user_namespace init_user_ns;
386#ifdef CONFIG_USER_NS391#ifdef CONFIG_USER_NS
include/linux/dcache.h+1−1
@@ -151,7 +151,7 @@ struct dentry_operations { · 150 unmodified lines
151 151
152/*152/*
153 * Locking rules for dentry_operations callbacks are to be found in153 * 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!
155 *155 *
156 * FUrther descriptions are found in Documentation/filesystems/vfs.rst.156 * FUrther descriptions are found in Documentation/filesystems/vfs.rst.
157 * Keep it updated too!157 * Keep it updated too!
include/linux/devfreq-event.h+6−0
@@ -78,14 +78,20 @@ struct devfreq_event_ops { · 77 unmodified lines
78 * struct devfreq_event_desc - the descriptor of devfreq-event device78 * struct devfreq_event_desc - the descriptor of devfreq-event device
79 *79 *
80 * @name : the name of devfreq-event device.80 * @name : the name of devfreq-event device.
81 * @event_type : the type of the event determined and used by driver
81 * @driver_data : the private data for devfreq-event driver.82 * @driver_data : the private data for devfreq-event driver.
82 * @ops : the operation to control devfreq-event device.83 * @ops : the operation to control devfreq-event device.
83 *84 *
84 * Each devfreq-event device is described with a this structure.85 * Each devfreq-event device is described with a this structure.
85 * This structure contains the various data for devfreq-event device.86 * 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/.
86 */91 */
87struct devfreq_event_desc {92struct devfreq_event_desc {
88 const char *name;93 const char *name;
94 u32 event_type;
89 void *driver_data;95 void *driver_data;
90 96
91 const struct devfreq_event_ops *ops;97 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
164struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter);164struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter);
165void subsys_dev_iter_exit(struct subsys_dev_iter *iter);165void subsys_dev_iter_exit(struct subsys_dev_iter *iter);
166 166
167int device_match_name(struct device *dev, const void *name);
167int device_match_of_node(struct device *dev, const void *np);168int device_match_of_node(struct device *dev, const void *np);
169int device_match_fwnode(struct device *dev, const void *fwnode);
170int device_match_devt(struct device *dev, const void *pdevt);
171int device_match_acpi_dev(struct device *dev, const void *adev);
172int device_match_any(struct device *dev, const void *unused);
168 173
169int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,174int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
170 int (*fn)(struct device *dev, void *data));175 int (*fn)(struct device *dev, void *data));
171struct device *bus_find_device(struct bus_type *bus, struct device *start,176struct device *bus_find_device(struct bus_type *bus, struct device *start,
172 const void *data,177 const void *data,
173 int (*match)(struct device *dev, const void *data));178 int (*match)(struct device *dev, const void *data));
174struct device *bus_find_device_by_name(struct bus_type *bus,179/**
175 struct device *start,180 * bus_find_device_by_name - device iterator for locating a particular device
176 const char *name);181 * of a specific name.
182 * @bus: bus type
183 * @start: Device to begin with
184 * @name: name of the device to match
185 */
186static 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 */
199static inline struct device *
200bus_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 */
211static inline struct device *
212bus_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 */
223static 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 */
235static inline struct device *
236bus_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
242struct 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 */
250static inline struct device *
251bus_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
256static inline struct device *
257bus_find_device_by_acpi_dev(struct bus_type *bus, const void *adev)
258{
259 return NULL;
260}
261#endif
262
177struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,263struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id,
178 struct device *hint);264 struct device *hint);
179int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,265int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
@@ -262,6 +348,8 @@ enum probe_type { · 82 unmodified lines
262 * @resume: Called to bring a device from sleep mode.348 * @resume: Called to bring a device from sleep mode.
263 * @groups: Default attributes that get created by the driver core349 * @groups: Default attributes that get created by the driver core
264 * automatically.350 * automatically.
351 * @dev_groups: Additional attributes attached to device instance once the
352 * it is bound to the driver.
265 * @pm: Power management operations of the device which matched353 * @pm: Power management operations of the device which matched
266 * this driver.354 * this driver.
267 * @coredump: Called when sysfs entry is written to. The device driver355 * @coredump: Called when sysfs entry is written to. The device driver
@@ -296,6 +384,7 @@ struct device_driver { · 28 unmodified lines
296 int (*suspend) (struct device *dev, pm_message_t state);384 int (*suspend) (struct device *dev, pm_message_t state);
297 int (*resume) (struct device *dev);385 int (*resume) (struct device *dev);
298 const struct attribute_group **groups;386 const struct attribute_group **groups;
387 const struct attribute_group **dev_groups;
299 388
300 const struct dev_pm_ops *pm;389 const struct dev_pm_ops *pm;
301 void (*coredump) (struct device *dev);390 void (*coredump) (struct device *dev);
@@ -342,6 +431,83 @@ struct device *driver_find_device(struct device_driver *drv, · 40 unmodified lines
342 struct device *start, const void *data,431 struct device *start, const void *data,
343 int (*match)(struct device *dev, const void *data));432 int (*match)(struct device *dev, const void *data));
344 433
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 */
440static 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 */
452static inline struct device *
453driver_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 */
465static inline struct device *
466driver_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 */
478static 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
484static 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 */
497static inline struct device *
498driver_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
504static inline struct device *
505driver_find_device_by_acpi_dev(struct device_driver *drv, const void *adev)
506{
507 return NULL;
508}
509#endif
510
345void driver_deferred_probe_add(struct device *dev);511void driver_deferred_probe_add(struct device *dev);
346int driver_deferred_probe_check_state(struct device *dev);512int driver_deferred_probe_check_state(struct device *dev);
347int driver_deferred_probe_check_state_continue(struct device *dev);513int 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
471 struct device *start, const void *data,637 struct device *start, const void *data,
472 int (*match)(struct device *, const void *));638 int (*match)(struct device *, const void *));
473 639
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 */
646static 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 */
658static inline struct device *
659class_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 */
670static inline struct device *
671class_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 */
683static 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
690struct 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 */
697static inline struct device *
698class_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
703static inline struct device *
704class_find_device_by_acpi_dev(struct class *class, const void *adev)
705{
706 return NULL;
707}
708#endif
709
474struct class_attribute {710struct class_attribute {
475 struct attribute attr;711 struct attribute attr;
476 ssize_t (*show)(struct class *class, struct class_attribute *attr,712 ssize_t (*show)(struct class *class, struct class_attribute *attr,
@@ -778,10 +1014,14 @@ struct device_connection { · 301 unmodified lines
778 struct list_head list;1014 struct list_head list;
779};1015};
780 1016
1017typedef void *(*devcon_match_fn_t)(struct device_connection *con, int ep,
1018 void *data);
1019
1020void *fwnode_connection_find_match(struct fwnode_handle *fwnode,
1021 const char *con_id, void *data,
1022 devcon_match_fn_t match);
781void *device_connection_find_match(struct device *dev, const char *con_id,1023void *device_connection_find_match(struct device *dev, const char *con_id,
782 void *data,1024 void *data, devcon_match_fn_t match);
783 void *(*match)(struct device_connection *con,
784 int ep, void *data));
785 1025
786struct device *device_connection_find(struct device *dev, const char *con_id);1026struct device *device_connection_find(struct device *dev, const char *con_id);
787 1027
@@ -833,12 +1073,13 @@ enum device_link_state { · 45 unmodified lines
833/*1073/*
834 * Device link flags.1074 * Device link flags.
835 *1075 *
836 * STATELESS: The core won't track the presence of supplier/consumer drivers.1076 * STATELESS: The core will not remove this link automatically.
837 * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.1077 * AUTOREMOVE_CONSUMER: Remove the link automatically on consumer driver unbind.
838 * PM_RUNTIME: If set, the runtime PM framework will use this link.1078 * PM_RUNTIME: If set, the runtime PM framework will use this link.
839 * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.1079 * RPM_ACTIVE: Run pm_runtime_get_sync() on the supplier during link creation.
840 * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.1080 * AUTOREMOVE_SUPPLIER: Remove the link automatically on supplier driver unbind.
841 * AUTOPROBE_CONSUMER: Probe consumer driver automatically after supplier binds.1081 * AUTOPROBE_CONSUMER: Probe consumer driver automatically after supplier binds.
1082 * MANAGED: The core tracks presence of supplier/consumer drivers (internal).
842 */1083 */
843#define DL_FLAG_STATELESS BIT(0)1084#define DL_FLAG_STATELESS BIT(0)
844#define DL_FLAG_AUTOREMOVE_CONSUMER BIT(1)1085#define DL_FLAG_AUTOREMOVE_CONSUMER BIT(1)
@@ -846,6 +1087,7 @@ enum device_link_state { · 1 unmodified line
846#define DL_FLAG_RPM_ACTIVE BIT(3)1087#define DL_FLAG_RPM_ACTIVE BIT(3)
847#define DL_FLAG_AUTOREMOVE_SUPPLIER BIT(4)1088#define DL_FLAG_AUTOREMOVE_SUPPLIER BIT(4)
848#define DL_FLAG_AUTOPROBE_CONSUMER BIT(5)1089#define DL_FLAG_AUTOPROBE_CONSUMER BIT(5)
1090#define DL_FLAG_MANAGED BIT(6)
849 1091
850/**1092/**
851 * struct device_link - Device link representation.1093 * struct device_link - Device link representation.
@@ -915,6 +1157,8 @@ struct dev_links_info { · 63 unmodified lines
915 * This identifies the device type and carries type-specific1157 * This identifies the device type and carries type-specific
916 * information.1158 * information.
917 * @mutex: Mutex to synchronize calls to its driver.1159 * @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.
918 * @bus: Type of bus device is on.1162 * @bus: Type of bus device is on.
919 * @driver: Which driver has allocated this1163 * @driver: Which driver has allocated this
920 * @platform_data: Platform data specific to the device.1164 * @platform_data: Platform data specific to the device.
@@ -998,6 +1242,9 @@ struct device { · 77 unmodified lines
998 core doesn't touch it */1242 core doesn't touch it */
999 void *driver_data; /* Driver data, set and get with1243 void *driver_data; /* Driver data, set and get with
1000 dev_set_drvdata/dev_get_drvdata */1244 dev_set_drvdata/dev_get_drvdata */
1245#ifdef CONFIG_PROVE_LOCKING
1246 struct mutex lockdep_mutex;
1247#endif
1001 struct mutex mutex; /* mutex to synchronize calls to1248 struct mutex mutex; /* mutex to synchronize calls to
1002 * its driver.1249 * its driver.
1003 */1250 */
@@ -1383,6 +1630,7 @@ extern int (*platform_notify_remove)(struct device *dev); · 379 unmodified lines
1383 */1630 */
1384extern struct device *get_device(struct device *dev);1631extern struct device *get_device(struct device *dev);
1385extern void put_device(struct device *dev);1632extern void put_device(struct device *dev);
1633extern bool kill_device(struct device *dev);
1386 1634
1387#ifdef CONFIG_DEVTMPFS1635#ifdef CONFIG_DEVTMPFS
1388extern int devtmpfs_create_node(struct device *dev);1636extern 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
272 272
273/* Net DIM */273/* Net DIM */
274 274
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
319static const struct dim_cq_moder
320rx_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
325static const struct dim_cq_moder
326tx_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
331/**275/**
332 * net_dim_get_rx_moderation - provide a CQ moderation object for the given RX profile276 * net_dim_get_rx_moderation - provide a CQ moderation object for the given RX profile
333 * @cq_period_mode: CQ period mode277 * @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
160static inline struct page *dma_alloc_contiguous(struct device *dev, size_t size,160static inline struct page *dma_alloc_contiguous(struct device *dev, size_t size,
161 gfp_t gfp)161 gfp_t gfp)
162{162{
163 int node = dev ? dev_to_node(dev) : NUMA_NO_NODE;163 return NULL;
164 size_t align = get_order(PAGE_ALIGN(size));
165
166 return alloc_pages_node(node, gfp, align);
167}164}
168 165
169static inline void dma_free_contiguous(struct device *dev, struct page *page,166static 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
131 int (*dma_supported)(struct device *dev, u64 mask);131 int (*dma_supported)(struct device *dev, u64 mask);
132 u64 (*get_required_mask)(struct device *dev);132 u64 (*get_required_mask)(struct device *dev);
133 size_t (*max_mapping_size)(struct device *dev);133 size_t (*max_mapping_size)(struct device *dev);
134 unsigned long (*get_merge_boundary)(struct device *dev);
134};135};
135 136
136#define DMA_MAPPING_ERROR (~(dma_addr_t)0)137#define DMA_MAPPING_ERROR (~(dma_addr_t)0)
@@ -149,11 +150,6 @@ static inline int valid_dma_direction(int dma_direction) · 12 unmodified lines
149 (dma_direction == DMA_FROM_DEVICE));150 (dma_direction == DMA_FROM_DEVICE));
150}151}
151 152
152static inline int is_device_dma_capable(struct device *dev)
153{
154 return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE;
155}
156
157#ifdef CONFIG_DMA_DECLARE_COHERENT153#ifdef CONFIG_DMA_DECLARE_COHERENT
158/*154/*
159 * These three functions are only for dma allocator.155 * 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
462int dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma,458int dma_mmap_attrs(struct device *dev, struct vm_area_struct *vma,
463 void *cpu_addr, dma_addr_t dma_addr, size_t size,459 void *cpu_addr, dma_addr_t dma_addr, size_t size,
464 unsigned long attrs);460 unsigned long attrs);
461bool dma_can_mmap(struct device *dev);
465int dma_supported(struct device *dev, u64 mask);462int dma_supported(struct device *dev, u64 mask);
466int dma_set_mask(struct device *dev, u64 mask);463int dma_set_mask(struct device *dev, u64 mask);
467int dma_set_coherent_mask(struct device *dev, u64 mask);464int dma_set_coherent_mask(struct device *dev, u64 mask);
468u64 dma_get_required_mask(struct device *dev);465u64 dma_get_required_mask(struct device *dev);
469size_t dma_max_mapping_size(struct device *dev);466size_t dma_max_mapping_size(struct device *dev);
467unsigned long dma_get_merge_boundary(struct device *dev);
470#else /* CONFIG_HAS_DMA */468#else /* CONFIG_HAS_DMA */
471static inline dma_addr_t dma_map_page_attrs(struct device *dev,469static inline dma_addr_t dma_map_page_attrs(struct device *dev,
472 struct page *page, size_t offset, size_t size,470 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
552{550{
553 return -ENXIO;551 return -ENXIO;
554}552}
553static inline bool dma_can_mmap(struct device *dev)
554{
555 return false;
556}
555static inline int dma_supported(struct device *dev, u64 mask)557static inline int dma_supported(struct device *dev, u64 mask)
556{558{
557 return 0;559 return 0;
@@ -572,6 +574,10 @@ static inline size_t dma_max_mapping_size(struct device *dev) · 14 unmodified lines
572{574{
573 return 0;575 return 0;
574}576}
577static inline unsigned long dma_get_merge_boundary(struct device *dev)
578{
579 return 0;
580}
575#endif /* CONFIG_HAS_DMA */581#endif /* CONFIG_HAS_DMA */
576 582
577static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,583static 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
615 void *cpu_addr, dma_addr_t dma_addr, size_t size,621 void *cpu_addr, dma_addr_t dma_addr, size_t size,
616 unsigned long attrs);622 unsigned long attrs);
617 623
624struct page **dma_common_find_pages(void *cpu_addr);
618void *dma_common_contiguous_remap(struct page *page, size_t size,625void *dma_common_contiguous_remap(struct page *page, size_t size,
619 unsigned long vm_flags,
620 pgprot_t prot, const void *caller);626 pgprot_t prot, const void *caller);
621 627
622void *dma_common_pages_remap(struct page **pages, size_t size,628void *dma_common_pages_remap(struct page **pages, size_t size,
623 unsigned long vm_flags, pgprot_t prot,629 pgprot_t prot, const void *caller);
624 const void *caller);630void dma_common_free_remap(void *cpu_addr, size_t size);
625void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags);
626 631
627int __init dma_atomic_pool_init(gfp_t gfp, pgprot_t prot);
628bool dma_in_atomic_pool(void *start, size_t size);632bool dma_in_atomic_pool(void *start, size_t size);
629void *dma_alloc_from_pool(size_t size, struct page **ret_page, gfp_t flags);633void *dma_alloc_from_pool(size_t size, struct page **ret_page, gfp_t flags);
630bool dma_free_from_pool(void *start, size_t size);634bool 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
689 */693 */
690static inline bool dma_addressing_limited(struct device *dev)694static inline bool dma_addressing_limited(struct device *dev)
691{695{
692 return min_not_zero(*dev->dma_mask, dev->bus_dma_mask) <696 return min_not_zero(dma_get_mask(dev), dev->bus_dma_mask) <
693 dma_get_required_mask(dev);697 dma_get_required_mask(dev);
694}698}
695 699
696#ifdef CONFIG_ARCH_HAS_SETUP_DMA_OPS700#ifdef CONFIG_ARCH_HAS_SETUP_DMA_OPS
@@ -754,7 +758,6 @@ static inline int dma_get_cache_alignment(void) · 57 unmodified lines
754#ifdef CONFIG_DMA_DECLARE_COHERENT758#ifdef CONFIG_DMA_DECLARE_COHERENT
755int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,759int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
756 dma_addr_t device_addr, size_t size);760 dma_addr_t device_addr, size_t size);
757void dma_release_declared_memory(struct device *dev);
758#else761#else
759static inline int762static inline int
760dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,763dma_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
762{765{
763 return -ENOSYS;766 return -ENOSYS;
764}767}
765
766static inline void
767dma_release_declared_memory(struct device *dev)
768{
769}
770#endif /* CONFIG_DMA_DECLARE_COHERENT */768#endif /* CONFIG_DMA_DECLARE_COHERENT */
771 769
772static inline void *dmam_alloc_coherent(struct device *dev, size_t size,770static 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
786 784
787 return dma_alloc_attrs(dev, size, dma_addr, gfp, attrs);785 return dma_alloc_attrs(dev, size, dma_addr, gfp, attrs);
788}786}
789#ifndef dma_alloc_writecombine
790#define dma_alloc_writecombine dma_alloc_wc
791#endif
792 787
793static inline void dma_free_wc(struct device *dev, size_t size,788static inline void dma_free_wc(struct device *dev, size_t size,
794 void *cpu_addr, dma_addr_t dma_addr)789 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
796 return dma_free_attrs(dev, size, cpu_addr, dma_addr,791 return dma_free_attrs(dev, size, cpu_addr, dma_addr,
797 DMA_ATTR_WRITE_COMBINE);792 DMA_ATTR_WRITE_COMBINE);
798}793}
799#ifndef dma_free_writecombine
800#define dma_free_writecombine dma_free_wc
801#endif
802 794
803static inline int dma_mmap_wc(struct device *dev,795static inline int dma_mmap_wc(struct device *dev,
804 struct vm_area_struct *vma,796 struct vm_area_struct *vma,
@@ -808,9 +800,6 @@ static inline int dma_mmap_wc(struct device *dev, · 3 unmodified lines
808 return dma_mmap_attrs(dev, vma, cpu_addr, dma_addr, size,800 return dma_mmap_attrs(dev, vma, cpu_addr, dma_addr, size,
809 DMA_ATTR_WRITE_COMBINE);801 DMA_ATTR_WRITE_COMBINE);
810}802}
811#ifndef dma_mmap_writecombine
812#define dma_mmap_writecombine dma_mmap_wc
813#endif
814 803
815#ifdef CONFIG_NEED_DMA_MAP_STATE804#ifdef CONFIG_NEED_DMA_MAP_STATE
816#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME805#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
3#define _LINUX_DMA_NONCOHERENT_H 13#define _LINUX_DMA_NONCOHERENT_H 1
4 4
5#include <linux/dma-mapping.h>5#include <linux/dma-mapping.h>
6#include <asm/pgtable.h>
6 7
7#ifdef CONFIG_ARCH_HAS_DMA_COHERENCE_H8#ifdef CONFIG_ARCH_HAS_DMA_COHERENCE_H
8#include <asm/dma-coherence.h>9#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
43long arch_dma_coherent_to_pfn(struct device *dev, void *cpu_addr,44long arch_dma_coherent_to_pfn(struct device *dev, void *cpu_addr,
44 dma_addr_t dma_addr);45 dma_addr_t dma_addr);
45 46
46#ifdef CONFIG_ARCH_HAS_DMA_MMAP_PGPROT47#ifdef CONFIG_MMU
47pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,48/*
48 unsigned long attrs);49 * Page protection so that devices that can't snoop CPU caches can use the
49#else50 * memory coherently. We default to pgprot_noncached which is usually used
50# define arch_dma_mmap_pgprot(dev, prot, attrs) pgprot_noncached(prot)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)
51#endif56#endif
52 57
58pgprot_t dma_pgprot(struct device *dev, pgprot_t prot, unsigned long attrs);
59#else
60static 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
53#ifdef CONFIG_DMA_NONCOHERENT_CACHE_SYNC67#ifdef CONFIG_DMA_NONCOHERENT_CACHE_SYNC
54void arch_dma_cache_sync(struct device *dev, void *vaddr, size_t size,68void arch_dma_cache_sync(struct device *dev, void *vaddr, size_t size,
55 enum dma_data_direction direction);69 enum dma_data_direction direction);
include/linux/edac.h+5−5
@@ -440,7 +440,7 @@ struct dimm_info { · 439 unmodified lines
440 char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */440 char label[EDAC_MC_LABEL_LEN + 1]; /* DIMM label on motherboard */
441 441
442 /* Memory location data */442 /* Memory location data */
443 unsigned location[EDAC_MAX_LAYERS];443 unsigned int location[EDAC_MAX_LAYERS];
444 444
445 struct mem_ctl_info *mci; /* the parent */445 struct mem_ctl_info *mci; /* the parent */
446 446
@@ -451,7 +451,7 @@ struct dimm_info { · 4 unmodified lines
451 451
452 u32 nr_pages; /* number of pages on this dimm */452 u32 nr_pages; /* number of pages on this dimm */
453 453
454 unsigned csrow, cschannel; /* Points to the old API data */454 unsigned int csrow, cschannel; /* Points to the old API data */
455 455
456 u16 smbios_handle; /* Handle for SMBIOS type 17 */456 u16 smbios_handle; /* Handle for SMBIOS type 17 */
457};457};
@@ -597,7 +597,7 @@ struct mem_ctl_info { · 139 unmodified lines
597 unsigned long page);597 unsigned long page);
598 int mc_idx;598 int mc_idx;
599 struct csrow_info **csrows;599 struct csrow_info **csrows;
600 unsigned nr_csrows, num_cschannel;600 unsigned int nr_csrows, num_cschannel;
601 601
602 /*602 /*
603 * Memory Controller hierarchy603 * Memory Controller hierarchy
@@ -608,14 +608,14 @@ struct mem_ctl_info { · 4 unmodified lines
608 * of the recent drivers enumerate memories per DIMM, instead.608 * of the recent drivers enumerate memories per DIMM, instead.
609 * When the memory controller is per rank, csbased is true.609 * When the memory controller is per rank, csbased is true.
610 */610 */
611 unsigned n_layers;611 unsigned int n_layers;
612 struct edac_mc_layer *layers;612 struct edac_mc_layer *layers;
613 bool csbased;613 bool csbased;
614 614
615 /*615 /*
616 * DIMM info. Will eventually remove the entire csrows_info some day616 * DIMM info. Will eventually remove the entire csrows_info some day
617 */617 */
618 unsigned tot_dimms;618 unsigned int tot_dimms;
619 struct dimm_info **dimms;619 struct dimm_info **dimms;
620 620
621 /*621 /*
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
18struct dma_chan;
19
20#if defined(CONFIG_TI_EDMA) || defined(CONFIG_TI_EDMA_MODULE)
21bool edma_filter_fn(struct dma_chan *, void *);
22#else
23static 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
692#define LINUX_EFI_TPM_FINAL_LOG_GUID EFI_GUID(0x1e2ed096, 0x30e2, 0x4254, 0xbd, 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25)692#define LINUX_EFI_TPM_FINAL_LOG_GUID EFI_GUID(0x1e2ed096, 0x30e2, 0x4254, 0xbd, 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25)
693#define LINUX_EFI_MEMRESERVE_TABLE_GUID EFI_GUID(0x888eb0c6, 0x8ede, 0x4ff5, 0xa8, 0xf0, 0x9a, 0xee, 0x5c, 0xb9, 0x77, 0xc2)693#define LINUX_EFI_MEMRESERVE_TABLE_GUID EFI_GUID(0x888eb0c6, 0x8ede, 0x4ff5, 0xa8, 0xf0, 0x9a, 0xee, 0x5c, 0xb9, 0x77, 0xc2)
694 694
695/* OEM GUIDs */
696#define DELLEMC_EFI_RCI2_TABLE_GUID EFI_GUID(0x2d9f28a2, 0xa886, 0x456a, 0x97, 0xa8, 0xf1, 0x1e, 0xf2, 0x4f, 0xf4, 0x55)
697
695typedef struct {698typedef struct {
696 efi_guid_t guid;699 efi_guid_t guid;
697 u64 table;700 u64 table;
@@ -984,11 +987,9 @@ extern struct efi { · 286 unmodified lines
984 unsigned long acpi20; /* ACPI table (ACPI 2.0) */987 unsigned long acpi20; /* ACPI table (ACPI 2.0) */
985 unsigned long smbios; /* SMBIOS table (32 bit entry point) */988 unsigned long smbios; /* SMBIOS table (32 bit entry point) */
986 unsigned long smbios3; /* SMBIOS table (64 bit entry point) */989 unsigned long smbios3; /* SMBIOS table (64 bit entry point) */
987 unsigned long sal_systab; /* SAL system table */
988 unsigned long boot_info; /* boot info table */990 unsigned long boot_info; /* boot info table */
989 unsigned long hcdp; /* HCDP table */991 unsigned long hcdp; /* HCDP table */
990 unsigned long uga; /* UGA table */992 unsigned long uga; /* UGA table */
991 unsigned long uv_systab; /* UV system table */
992 unsigned long fw_vendor; /* fw_vendor */993 unsigned long fw_vendor; /* fw_vendor */
993 unsigned long runtime; /* runtime table */994 unsigned long runtime; /* runtime table */
994 unsigned long config_table; /* config tables */995 unsigned long config_table; /* config tables */
@@ -1211,8 +1212,6 @@ static inline bool efi_enabled(int feature) · 216 unmodified lines
1211 return test_bit(feature, &efi.flags) != 0;1212 return test_bit(feature, &efi.flags) != 0;
1212}1213}
1213extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);1214extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused);
1214
1215extern bool efi_is_table_address(unsigned long phys_addr);
1216#else1215#else
1217static inline bool efi_enabled(int feature)1216static inline bool efi_enabled(int feature)
1218{1217{
@@ -1226,11 +1225,6 @@ efi_capsule_pending(int *reset_type) · 7 unmodified lines
1226{1225{
1227 return false;1226 return false;
1228}1227}
1229
1230static inline bool efi_is_table_address(unsigned long phys_addr)
1231{
1232 return false;
1233}
1234#endif1228#endif
1235 1229
1236extern int efi_status_to_err(efi_status_t status);1230extern int efi_status_to_err(efi_status_t status);
@@ -1722,6 +1716,8 @@ struct efi_tcg2_final_events_table { · 485 unmodified lines
1722};1716};
1723extern int efi_tpm_final_log_size;1717extern int efi_tpm_final_log_size;
1724 1718
1719extern unsigned long rci2_table_phys;
1720
1725/*1721/*
1726 * efi_runtime_service() function identifiers.1722 * efi_runtime_service() function identifiers.
1727 * "NONE" is used by efi_recover_from_page_fault() to check if the page1723 * "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
45 struct request *(*dispatch_request)(struct blk_mq_hw_ctx *);45 struct request *(*dispatch_request)(struct blk_mq_hw_ctx *);
46 bool (*has_work)(struct blk_mq_hw_ctx *);46 bool (*has_work)(struct blk_mq_hw_ctx *);
47 void (*completed_request)(struct request *, u64);47 void (*completed_request)(struct request *, u64);
48 void (*started_request)(struct request *);
49 void (*requeue_request)(struct request *);48 void (*requeue_request)(struct request *);
50 struct request *(*former_request)(struct request_queue *, struct request *);49 struct request *(*former_request)(struct request_queue *, struct request *);
51 struct request *(*next_request)(struct request_queue *, struct request *);50 struct request *(*next_request)(struct request_queue *, struct request *);
@@ -77,6 +76,7 @@ struct elevator_type · 25 unmodified lines
77 struct elv_fs_entry *elevator_attrs;76 struct elv_fs_entry *elevator_attrs;
78 const char *elevator_name;77 const char *elevator_name;
79 const char *elevator_alias;78 const char *elevator_alias;
79 const unsigned int elevator_features;
80 struct module *elevator_owner;80 struct module *elevator_owner;
81#ifdef CONFIG_BLK_DEBUG_FS81#ifdef CONFIG_BLK_DEBUG_FS
82 const struct blk_mq_debugfs_attr *queue_debugfs_attrs;82 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
166#define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist)166#define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist)
167#define rq_fifo_clear(rq) list_del_init(&(rq)->queuelist)167#define rq_fifo_clear(rq) list_del_init(&(rq)->queuelist)
168 168
169/*
170 * Elevator features.
171 */
172
173/* Supports zoned block devices sequential write constraint */
174#define ELEVATOR_F_ZBD_SEQ_WRITE (1U << 0)
175
169#endif /* CONFIG_BLOCK */176#endif /* CONFIG_BLOCK */
170#endif177#endif
include/linux/error-injection.h+3−3
@@ -2,16 +2,16 @@ · 1 unmodified line
2#ifndef _LINUX_ERROR_INJECTION_H2#ifndef _LINUX_ERROR_INJECTION_H
3#define _LINUX_ERROR_INJECTION_H3#define _LINUX_ERROR_INJECTION_H
4 4
5#ifdef CONFIG_FUNCTION_ERROR_INJECTION5#include <linux/compiler.h>
6#include <asm-generic/error-injection.h>
6 7
7#include <asm/error-injection.h>8#ifdef CONFIG_FUNCTION_ERROR_INJECTION
8 9
9extern bool within_error_injection_list(unsigned long addr);10extern bool within_error_injection_list(unsigned long addr);
10extern int get_injectable_error_type(unsigned long addr);11extern int get_injectable_error_type(unsigned long addr);
11 12
12#else /* !CONFIG_FUNCTION_ERROR_INJECTION */13#else /* !CONFIG_FUNCTION_ERROR_INJECTION */
13 14
14#include <asm-generic/error-injection.h>
15static inline bool within_error_injection_list(unsigned long addr)15static inline bool within_error_injection_list(unsigned long addr)
16{16{
17 return false;17 return false;
include/linux/export.h+78−32
@@ -18,9 +18,8 @@ extern struct module __this_module; · 17 unmodified lines
18#define THIS_MODULE ((struct module *)0)18#define THIS_MODULE ((struct module *)0)
19#endif19#endif
20 20
21#ifdef CONFIG_MODULES21#define NS_SEPARATOR "."
22 22
23#if defined(__KERNEL__) && !defined(__GENKSYMS__)
24#ifdef CONFIG_MODVERSIONS23#ifdef CONFIG_MODVERSIONS
25/* Mark the CRC weak since genksyms apparently decides not to24/* Mark the CRC weak since genksyms apparently decides not to
26 * generate a checksums for some symbols */25 * generate a checksums for some symbols */
@@ -29,13 +28,13 @@ extern struct module __this_module; · 2 unmodified lines
29 asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \28 asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \
30 " .weak __crc_" #sym " \n" \29 " .weak __crc_" #sym " \n" \
31 " .long __crc_" #sym " - . \n" \30 " .long __crc_" #sym " - . \n" \
32 " .previous \n");31 " .previous \n")
33#else32#else
34#define __CRC_SYMBOL(sym, sec) \33#define __CRC_SYMBOL(sym, sec) \
35 asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \34 asm(" .section \"___kcrctab" sec "+" #sym "\", \"a\" \n" \
36 " .weak __crc_" #sym " \n" \35 " .weak __crc_" #sym " \n" \
37 " .long __crc_" #sym " \n" \36 " .long __crc_" #sym " \n" \
38 " .previous \n");37 " .previous \n")
39#endif38#endif
40#else39#else
41#define __CRC_SYMBOL(sym, sec)40#define __CRC_SYMBOL(sym, sec)
@@ -49,47 +48,89 @@ extern struct module __this_module; · 7 unmodified lines
49 * absolute relocations that require runtime processing on relocatable48 * absolute relocations that require runtime processing on relocatable
50 * kernels.49 * kernels.
51 */50 */
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
52#define __KSYMTAB_ENTRY(sym, sec) \61#define __KSYMTAB_ENTRY(sym, sec) \
53 __ADDRESSABLE(sym) \62 __ADDRESSABLE(sym) \
54 asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \63 asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \
55 " .balign 8 \n" \64 " .balign 4 \n" \
56 "__ksymtab_" #sym ": \n" \65 "__ksymtab_" #sym ": \n" \
57 " .long " #sym "- . \n" \66 " .long " #sym "- . \n" \
58 " .long __kstrtab_" #sym "- . \n" \67 " .long __kstrtab_" #sym "- . \n" \
68 " .long 0 \n" \
59 " .previous \n")69 " .previous \n")
60 70
61struct kernel_symbol {71struct kernel_symbol {
62 int value_offset;72 int value_offset;
63 int name_offset;73 int name_offset;
74 int namespace_offset;
64};75};
65#else76#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
66#define __KSYMTAB_ENTRY(sym, sec) \84#define __KSYMTAB_ENTRY(sym, sec) \
67 static const struct kernel_symbol __ksymtab_##sym \85 static const struct kernel_symbol __ksymtab_##sym \
86 asm("__ksymtab_" #sym) \
68 __attribute__((section("___ksymtab" sec "+" #sym), used)) \87 __attribute__((section("___ksymtab" sec "+" #sym), used)) \
69 = { (unsigned long)&sym, __kstrtab_##sym }88 __aligned(sizeof(void *)) \
89 = { (unsigned long)&sym, __kstrtab_##sym, NULL }
70 90
71struct kernel_symbol {91struct kernel_symbol {
72 unsigned long value;92 unsigned long value;
73 const char *name;93 const char *name;
94 const char *namespace;
74};95};
75#endif96#endif
76 97
77/* For every exported symbol, place a struct in the __ksymtab section */98#ifdef __GENKSYMS__
78#define ___EXPORT_SYMBOL(sym, sec) \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) \
79 extern typeof(sym) sym; \106 extern typeof(sym) sym; \
80 __CRC_SYMBOL(sym, sec) \107 __CRC_SYMBOL(sym, sec); \
81 static const char __kstrtab_##sym[] \108 static const char __kstrtab_##sym[] \
82 __attribute__((section("__ksymtab_strings"), used, aligned(1))) \109 __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); \
84 __KSYMTAB_ENTRY(sym, sec)122 __KSYMTAB_ENTRY(sym, sec)
85 123
86#if defined(__DISABLE_EXPORTS)124#endif
125
126#if !defined(CONFIG_MODULES) || defined(__DISABLE_EXPORTS)
87 127
88/*128/*
89 * Allow symbol exports to be disabled completely so that C code may129 * Allow symbol exports to be disabled completely so that C code may
90 * be reused in other execution contexts such as the UEFI stub or the130 * be reused in other execution contexts such as the UEFI stub or the
91 * decompressor.131 * decompressor.
92 */132 */
133#define __EXPORT_SYMBOL_NS(sym, sec, ns)
93#define __EXPORT_SYMBOL(sym, sec)134#define __EXPORT_SYMBOL(sym, sec)
94 135
95#elif defined(CONFIG_TRIM_UNUSED_KSYMS)136#elif defined(CONFIG_TRIM_UNUSED_KSYMS)
@@ -116,38 +157,43 @@ struct kernel_symbol { · 20 unmodified lines
116#define __cond_export_sym_1(sym, sec) ___EXPORT_SYMBOL(sym, sec)157#define __cond_export_sym_1(sym, sec) ___EXPORT_SYMBOL(sym, sec)
117#define __cond_export_sym_0(sym, sec) /* nothing */158#define __cond_export_sym_0(sym, sec) /* nothing */
118 159
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
119#else170#else
120#define __EXPORT_SYMBOL ___EXPORT_SYMBOL
121#endif
122 171
123#define EXPORT_SYMBOL(sym) \172#define __EXPORT_SYMBOL_NS(sym,sec,ns) ___EXPORT_SYMBOL_NS(sym,sec,ns)
124 __EXPORT_SYMBOL(sym, "")173#define __EXPORT_SYMBOL(sym,sec) ___EXPORT_SYMBOL(sym,sec)
125 174
126#define EXPORT_SYMBOL_GPL(sym) \175#endif /* CONFIG_MODULES */
127 __EXPORT_SYMBOL(sym, "_gpl")
128 176
129#define EXPORT_SYMBOL_GPL_FUTURE(sym) \177#ifdef DEFAULT_SYMBOL_NAMESPACE
130 __EXPORT_SYMBOL(sym, "_gpl_future")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)
131 188
132#ifdef CONFIG_UNUSED_SYMBOLS189#ifdef CONFIG_UNUSED_SYMBOLS
133#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")190#define EXPORT_UNUSED_SYMBOL(sym) __EXPORT_SYMBOL(sym, "_unused")
134#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")191#define EXPORT_UNUSED_SYMBOL_GPL(sym) __EXPORT_SYMBOL(sym, "_unused_gpl")
135#else192#else
136#define EXPORT_UNUSED_SYMBOL(sym)193#define EXPORT_UNUSED_SYMBOL(sym)
137#define EXPORT_UNUSED_SYMBOL_GPL(sym)194#define EXPORT_UNUSED_SYMBOL_GPL(sym)
138#endif195#endif
139 196
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 */
151#endif /* !__ASSEMBLY__ */197#endif /* !__ASSEMBLY__ */
152 198
153#endif /* _LINUX_EXPORT_H */199#endif /* _LINUX_EXPORT_H */
include/linux/exportfs.h+1−1
@@ -139,7 +139,7 @@ struct fid { · 138 unmodified lines
139 * @get_parent: find the parent of a given directory139 * @get_parent: find the parent of a given directory
140 * @commit_metadata: commit metadata changes to stable storage140 * @commit_metadata: commit metadata changes to stable storage
141 *141 *
142 * See Documentation/filesystems/nfs/Exporting for details on how to use142 * See Documentation/filesystems/nfs/exporting.rst for details on how to use
143 * this interface correctly.143 * this interface correctly.
144 *144 *
145 * encode_fh:145 * encode_fh:
include/linux/extable.h+2−0
@@ -19,6 +19,8 @@ void trim_init_extable(struct module *m); · 18 unmodified lines
19 19
20/* Given an address, look for it in the exception tables */20/* Given an address, look for it in the exception tables */
21const struct exception_table_entry *search_exception_tables(unsigned long add);21const struct exception_table_entry *search_exception_tables(unsigned long add);
22const struct exception_table_entry *
23search_kernel_exception_table(unsigned long addr);
22 24
23#ifdef CONFIG_MODULES25#ifdef CONFIG_MODULES
24/* For extable.c to search modules' exception tables. */26/* For extable.c to search modules' exception tables. */
include/linux/f2fs_fs.h+9−1
@@ -36,11 +36,17 @@ · 35 unmodified lines
36 36
37#define F2FS_MAX_QUOTAS 337#define F2FS_MAX_QUOTAS 3
38 38
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
39#define F2FS_IO_SIZE(sbi) (1 << F2FS_OPTION(sbi).write_io_size_bits) /* Blocks */44#define F2FS_IO_SIZE(sbi) (1 << F2FS_OPTION(sbi).write_io_size_bits) /* Blocks */
40#define F2FS_IO_SIZE_KB(sbi) (1 << (F2FS_OPTION(sbi).write_io_size_bits + 2)) /* KB */45#define F2FS_IO_SIZE_KB(sbi) (1 << (F2FS_OPTION(sbi).write_io_size_bits + 2)) /* KB */
41#define F2FS_IO_SIZE_BYTES(sbi) (1 << (F2FS_OPTION(sbi).write_io_size_bits + 12)) /* B */46#define F2FS_IO_SIZE_BYTES(sbi) (1 << (F2FS_OPTION(sbi).write_io_size_bits + 12)) /* B */
42#define F2FS_IO_SIZE_BITS(sbi) (F2FS_OPTION(sbi).write_io_size_bits) /* power of 2 */47#define F2FS_IO_SIZE_BITS(sbi) (F2FS_OPTION(sbi).write_io_size_bits) /* power of 2 */
43#define F2FS_IO_SIZE_MASK(sbi) (F2FS_IO_SIZE(sbi) - 1)48#define F2FS_IO_SIZE_MASK(sbi) (F2FS_IO_SIZE(sbi) - 1)
49#define F2FS_IO_ALIGNED(sbi) (F2FS_IO_SIZE(sbi) > 1)
44 50
45/* This flag is used by node and meta inodes, and by recovery */51/* This flag is used by node and meta inodes, and by recovery */
46#define GFP_F2FS_ZERO (GFP_NOFS | __GFP_ZERO)52#define GFP_F2FS_ZERO (GFP_NOFS | __GFP_ZERO)
@@ -109,7 +115,9 @@ struct f2fs_super_block { · 62 unmodified lines
109 struct f2fs_device devs[MAX_DEVICES]; /* device list */115 struct f2fs_device devs[MAX_DEVICES]; /* device list */
110 __le32 qf_ino[F2FS_MAX_QUOTAS]; /* quota inode numbers */116 __le32 qf_ino[F2FS_MAX_QUOTAS]; /* quota inode numbers */
111 __u8 hot_ext_count; /* # of hot file extension */117 __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 */
113 __le32 crc; /* checksum of superblock */121 __le32 crc; /* checksum of superblock */
114} __packed;122} __packed;
115 123
include/linux/filter.h+13−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
24 24
25#include <net/sch_generic.h>25#include <net/sch_generic.h>
26 26
27#include <asm/byteorder.h>
27#include <uapi/linux/filter.h>28#include <uapi/linux/filter.h>
28#include <uapi/linux/bpf.h>29#include <uapi/linux/bpf.h>
29 30
@@ -747,6 +748,18 @@ bpf_ctx_narrow_access_ok(u32 off, u32 size, u32 size_default) · 717 unmodified lines
747 return size <= size_default && (size & (size - 1)) == 0;748 return size <= size_default && (size & (size - 1)) == 0;
748}749}
749 750
751static inline u8
752bpf_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
750#define bpf_ctx_wide_access_ok(off, size, type, field) \763#define bpf_ctx_wide_access_ok(off, size, type, field) \
751 (size == sizeof(__u64) && \764 (size == sizeof(__u64) && \
752 off >= offsetof(type, field) && \765 off >= offsetof(type, field) && \
include/linux/fips.h+7−0
@@ -4,8 +4,15 @@ · 3 unmodified lines
4 4
5#ifdef CONFIG_CRYPTO_FIPS5#ifdef CONFIG_CRYPTO_FIPS
6extern int fips_enabled;6extern int fips_enabled;
7extern struct atomic_notifier_head fips_fail_notif_chain;
8
9void fips_fail_notify(void);
10
7#else11#else
8#define fips_enabled 012#define fips_enabled 0
13
14static inline void fips_fail_notify(void) {}
15
9#endif16#endif
10 17
11#endif18#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
17struct 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
25struct imx_dsp_ops {
26 void (*handle_reply)(struct imx_dsp_ipc *ipc);
27 void (*handle_request)(struct imx_dsp_ipc *ipc);
28};
29
30struct 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
38static 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
46static 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
56int imx_dsp_ring_doorbell(struct imx_dsp_ipc *dsp, unsigned int chan_idx);
57
58#else
59
60static 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
210#define INTEL_SIP_SMC_FPGA_CONFIG_LOOPBACK \210#define INTEL_SIP_SMC_FPGA_CONFIG_LOOPBACK \
211 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK)211 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_FPGA_CONFIG_LOOPBACK)
212 212
213/*213/**
214 * Request INTEL_SIP_SMC_REG_READ214 * Request INTEL_SIP_SMC_REG_READ
215 *215 *
216 * Read a protected register at EL3216 * 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
229#define INTEL_SIP_SMC_REG_READ \229#define INTEL_SIP_SMC_REG_READ \
230 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_READ)230 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_READ)
231 231
232/*232/**
233 * Request INTEL_SIP_SMC_REG_WRITE233 * Request INTEL_SIP_SMC_REG_WRITE
234 *234 *
235 * Write a protected register at EL3235 * 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
248#define INTEL_SIP_SMC_REG_WRITE \248#define INTEL_SIP_SMC_REG_WRITE \
249 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_WRITE)249 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_WRITE)
250 250
251/*251/**
252 * Request INTEL_SIP_SMC_FUNCID_REG_UPDATE252 * Request INTEL_SIP_SMC_FUNCID_REG_UPDATE
253 *253 *
254 * Update one or more bits in a protected register at EL3 using a254 * 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
269#define INTEL_SIP_SMC_REG_UPDATE \269#define INTEL_SIP_SMC_REG_UPDATE \
270 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_UPDATE)270 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_REG_UPDATE)
271 271
272/*272/**
273 * Request INTEL_SIP_SMC_RSU_STATUS273 * Request INTEL_SIP_SMC_RSU_STATUS
274 *274 *
275 * Request remote status update boot log, call is synchronous.275 * 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
292#define INTEL_SIP_SMC_RSU_STATUS \292#define INTEL_SIP_SMC_RSU_STATUS \
293 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_STATUS)293 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_STATUS)
294 294
295/*295/**
296 * Request INTEL_SIP_SMC_RSU_UPDATE296 * Request INTEL_SIP_SMC_RSU_UPDATE
297 *297 *
298 * Request to set the offset of the bitstream to boot after reboot, call298 * 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
310#define INTEL_SIP_SMC_RSU_UPDATE \310#define INTEL_SIP_SMC_RSU_UPDATE \
311 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_UPDATE)311 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_RSU_UPDATE)
312 312
313/*313/**
314 * Request INTEL_SIP_SMC_ECC_DBE314 * Request INTEL_SIP_SMC_ECC_DBE
315 *315 *
316 * Sync call used by service driver at EL1 to alert EL3 that a Double316 * 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
329 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_ECC_DBE)329 INTEL_SIP_SMC_FAST_CALL_VAL(INTEL_SIP_SMC_FUNCID_ECC_DBE)
330 330
331#endif331#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
95 *95 *
96 * @COMMAND_RSU_UPDATE: set the offset of the bitstream to boot after reboot,96 * @COMMAND_RSU_UPDATE: set the offset of the bitstream to boot after reboot,
97 * return status is SVC_STATUS_RSU_OK or SVC_STATUS_RSU_ERROR97 * 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
98 */105 */
99enum stratix10_svc_command_code {106enum stratix10_svc_command_code {
100 COMMAND_NOOP = 0,107 COMMAND_NOOP = 0,
@@ -103,7 +110,9 @@ enum stratix10_svc_command_code { · 2 unmodified lines
103 COMMAND_RECONFIG_DATA_CLAIM,110 COMMAND_RECONFIG_DATA_CLAIM,
104 COMMAND_RECONFIG_STATUS,111 COMMAND_RECONFIG_STATUS,
105 COMMAND_RSU_STATUS,112 COMMAND_RSU_STATUS,
106 COMMAND_RSU_UPDATE113 COMMAND_RSU_UPDATE,
114 COMMAND_RSU_NOTIFY,
115 COMMAND_RSU_RETRY,
107};116};
108 117
109/**118/**
include/linux/fpga/altera-pr-ip-core.h+1−1
@@ -13,6 +13,6 @@ · 12 unmodified lines
13#include <linux/io.h>13#include <linux/io.h>
14 14
15int alt_pr_register(struct device *dev, void __iomem *reg_base);15int alt_pr_register(struct device *dev, void __iomem *reg_base);
16int alt_pr_unregister(struct device *dev);16void alt_pr_unregister(struct device *dev);
17 17
18#endif /* _ALT_PR_IP_CORE_H */18#endif /* _ALT_PR_IP_CORE_H */
include/linux/fs.h+73−0
@@ -64,6 +64,8 @@ struct workqueue_struct; · 63 unmodified lines
64struct iov_iter;64struct iov_iter;
65struct fscrypt_info;65struct fscrypt_info;
66struct fscrypt_operations;66struct fscrypt_operations;
67struct fsverity_info;
68struct fsverity_operations;
67struct fs_context;69struct fs_context;
68struct fs_parameter_description;70struct fs_parameter_description;
69 71
@@ -427,6 +429,7 @@ int pagecache_write_end(struct file *, struct address_space *mapping, · 357 unmodified lines
427 * @i_pages: Cached pages.429 * @i_pages: Cached pages.
428 * @gfp_mask: Memory allocation flags to use for allocating pages.430 * @gfp_mask: Memory allocation flags to use for allocating pages.
429 * @i_mmap_writable: Number of VM_SHARED mappings.431 * @i_mmap_writable: Number of VM_SHARED mappings.
432 * @nr_thps: Number of THPs in the pagecache (non-shmem only).
430 * @i_mmap: Tree of private and shared mappings.433 * @i_mmap: Tree of private and shared mappings.
431 * @i_mmap_rwsem: Protects @i_mmap and @i_mmap_writable.434 * @i_mmap_rwsem: Protects @i_mmap and @i_mmap_writable.
432 * @nrpages: Number of page entries, protected by the i_pages lock.435 * @nrpages: Number of page entries, protected by the i_pages lock.
@@ -444,6 +447,10 @@ struct address_space { · 11 unmodified lines
444 struct xarray i_pages;447 struct xarray i_pages;
445 gfp_t gfp_mask;448 gfp_t gfp_mask;
446 atomic_t i_mmap_writable;449 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
447 struct rb_root_cached i_mmap;454 struct rb_root_cached i_mmap;
448 struct rw_semaphore i_mmap_rwsem;455 struct rw_semaphore i_mmap_rwsem;
449 unsigned long nrpages;456 unsigned long nrpages;
@@ -723,9 +730,15 @@ struct inode { · 273 unmodified lines
723 struct fscrypt_info *i_crypt_info;730 struct fscrypt_info *i_crypt_info;
724#endif731#endif
725 732
733#ifdef CONFIG_FS_VERITY
734 struct fsverity_info *i_verity_info;
735#endif
736
726 void *i_private; /* fs or device private pointer */737 void *i_private; /* fs or device private pointer */
727} __randomize_layout;738} __randomize_layout;
728 739
740struct timespec64 timestamp_truncate(struct timespec64 t, struct inode *inode);
741
729static inline unsigned int i_blocksize(const struct inode *node)742static inline unsigned int i_blocksize(const struct inode *node)
730{743{
731 return (1 << node->i_blkbits);744 return (1 << node->i_blkbits);
@@ -1155,6 +1168,11 @@ extern void lease_get_mtime(struct inode *, struct timespec64 *time); · 423 unmodified lines
1155extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);1168extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
1156extern int vfs_setlease(struct file *, long, struct file_lock **, void **);1169extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
1157extern int lease_modify(struct file_lock *, int, struct list_head *);1170extern int lease_modify(struct file_lock *, int, struct list_head *);
1171
1172struct notifier_block;
1173extern int lease_register_notifier(struct notifier_block *);
1174extern void lease_unregister_notifier(struct notifier_block *);
1175
1158struct files_struct;1176struct files_struct;
1159extern void show_fd_locks(struct seq_file *f,1177extern void show_fd_locks(struct seq_file *f,
1160 struct file *filp, struct files_struct *files);1178 struct file *filp, struct files_struct *files);
@@ -1427,6 +1445,10 @@ struct super_block { · 266 unmodified lines
1427 const struct xattr_handler **s_xattr;1445 const struct xattr_handler **s_xattr;
1428#ifdef CONFIG_FS_ENCRYPTION1446#ifdef CONFIG_FS_ENCRYPTION
1429 const struct fscrypt_operations *s_cop;1447 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;
1430#endif1452#endif
1431 struct hlist_bl_head s_roots; /* alternate root dentries for NFS */1453 struct hlist_bl_head s_roots; /* alternate root dentries for NFS */
1432 struct list_head s_mounts; /* list of mounts; _not_ for fs use */1454 struct list_head s_mounts; /* list of mounts; _not_ for fs use */
@@ -1448,6 +1470,9 @@ struct super_block { · 15 unmodified lines
1448 1470
1449 /* Granularity of c/m/atime in ns (cannot be worse than a second) */1471 /* Granularity of c/m/atime in ns (cannot be worse than a second) */
1450 u32 s_time_gran;1472 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;
1451#ifdef CONFIG_FSNOTIFY1476#ifdef CONFIG_FSNOTIFY
1452 __u32 s_fsnotify_mask;1477 __u32 s_fsnotify_mask;
1453 struct fsnotify_mark_connector __rcu *s_fsnotify_marks;1478 struct fsnotify_mark_connector __rcu *s_fsnotify_marks;
@@ -1965,6 +1990,7 @@ struct super_operations { · 511 unmodified lines
1965#endif1990#endif
1966#define S_ENCRYPTED 16384 /* Encrypted file (using fs/crypto/) */1991#define S_ENCRYPTED 16384 /* Encrypted file (using fs/crypto/) */
1967#define S_CASEFOLD 32768 /* Casefolded file */1992#define S_CASEFOLD 32768 /* Casefolded file */
1993#define S_VERITY 65536 /* Verity file (using fs/verity/) */
1968 1994
1969/*1995/*
1970 * Note that nosuid etc flags are inode-specific: setting some file-system1996 * 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
2006#define IS_DAX(inode) ((inode)->i_flags & S_DAX)2032#define IS_DAX(inode) ((inode)->i_flags & S_DAX)
2007#define IS_ENCRYPTED(inode) ((inode)->i_flags & S_ENCRYPTED)2033#define IS_ENCRYPTED(inode) ((inode)->i_flags & S_ENCRYPTED)
2008#define IS_CASEFOLDED(inode) ((inode)->i_flags & S_CASEFOLD)2034#define IS_CASEFOLDED(inode) ((inode)->i_flags & S_CASEFOLD)
2035#define IS_VERITY(inode) ((inode)->i_flags & S_VERITY)
2009 2036
2010#define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \2037#define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \
2011 (inode)->i_rdev == WHITEOUT_DEV)2038 (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
2598 void *holder);2625 void *holder);
2599extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode,2626extern struct block_device *blkdev_get_by_dev(dev_t dev, fmode_t mode,
2600 void *holder);2627 void *holder);
2628extern struct block_device *bd_start_claiming(struct block_device *bdev,
2629 void *holder);
2630extern void bd_finish_claiming(struct block_device *bdev,
2631 struct block_device *whole, void *holder);
2632extern void bd_abort_claiming(struct block_device *bdev,
2633 struct block_device *whole, void *holder);
2601extern void blkdev_put(struct block_device *bdev, fmode_t mode);2634extern void blkdev_put(struct block_device *bdev, fmode_t mode);
2602extern int __blkdev_reread_part(struct block_device *bdev);2635extern int __blkdev_reread_part(struct block_device *bdev);
2603extern int blkdev_reread_part(struct block_device *bdev);2636extern 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
2775 return errseq_sample(&mapping->wb_err);2808 return errseq_sample(&mapping->wb_err);
2776}2809}
2777 2810
2811static 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
2820static 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
2829static 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
2778extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,2838extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
2779 int datasync);2839 int datasync);
2780extern int vfs_fsync(struct file *file, int datasync);2840extern int vfs_fsync(struct file *file, int datasync);
@@ -3525,6 +3585,8 @@ extern void inode_nohighmem(struct inode *inode); · 744 unmodified lines
3525/* mm/fadvise.c */3585/* mm/fadvise.c */
3526extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,3586extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,
3527 int advice);3587 int advice);
3588extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,
3589 int advice);
3528 3590
3529#if defined(CONFIG_IO_URING)3591#if defined(CONFIG_IO_URING)
3530extern struct sock *io_uring_get_socket(struct file *file);3592extern 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
3547 fa->fsx_xflags = xflags;3609 fa->fsx_xflags = xflags;
3548}3610}
3549 3611
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 */
3617static 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
3550#endif /* _LINUX_FS_H */3623#endif /* _LINUX_FS_H */
include/linux/fs_context.h+15−2
@@ -88,13 +88,13 @@ struct fs_context { · 87 unmodified lines
88 struct mutex uapi_mutex; /* Userspace access mutex */88 struct mutex uapi_mutex; /* Userspace access mutex */
89 struct file_system_type *fs_type;89 struct file_system_type *fs_type;
90 void *fs_private; /* The filesystem's context */90 void *fs_private; /* The filesystem's context */
91 void *sget_key;
91 struct dentry *root; /* The root and superblock */92 struct dentry *root; /* The root and superblock */
92 struct user_namespace *user_ns; /* The user namespace for this mount */93 struct user_namespace *user_ns; /* The user namespace for this mount */
93 struct net *net_ns; /* The network namespace for this mount */94 struct net *net_ns; /* The network namespace for this mount */
94 const struct cred *cred; /* The mounter's credentials */95 const struct cred *cred; /* The mounter's credentials */
95 struct fc_log *log; /* Logging buffer */96 struct fc_log *log; /* Logging buffer */
96 const char *source; /* The source name (eg. dev path) */97 const char *source; /* The source name (eg. dev path) */
97 const char *subtype; /* The subtype to set on the superblock */
98 void *security; /* Linux S&M options */98 void *security; /* Linux S&M options */
99 void *s_fs_info; /* Proposed s_fs_info */99 void *s_fs_info; /* Proposed s_fs_info */
100 unsigned int sb_flags; /* Proposed superblock flags (SB_*) */100 unsigned int sb_flags; /* Proposed superblock flags (SB_*) */
@@ -136,10 +136,11 @@ extern int vfs_get_tree(struct fs_context *fc); · 35 unmodified lines
136extern void put_fs_context(struct fs_context *fc);136extern void put_fs_context(struct fs_context *fc);
137 137
138/*138/*
139 * sget() wrapper to be called from the ->get_tree() op.139 * sget() wrappers to be called from the ->get_tree() op.
140 */140 */
141enum vfs_get_super_keying {141enum vfs_get_super_keying {
142 vfs_get_single_super, /* Only one such superblock may exist */142 vfs_get_single_super, /* Only one such superblock may exist */
143 vfs_get_single_reconf_super, /* As above, but reconfigure if it exists */
143 vfs_get_keyed_super, /* Superblocks with different s_fs_info keys may exist */144 vfs_get_keyed_super, /* Superblocks with different s_fs_info keys may exist */
144 vfs_get_independent_super, /* Multiple independent superblocks may exist */145 vfs_get_independent_super, /* Multiple independent superblocks may exist */
145};146};
@@ -147,12 +148,24 @@ extern int vfs_get_super(struct fs_context *fc, · 1 unmodified line
147 enum vfs_get_super_keying keying,148 enum vfs_get_super_keying keying,
148 int (*fill_super)(struct super_block *sb,149 int (*fill_super)(struct super_block *sb,
149 struct fs_context *fc));150 struct fs_context *fc));
151
150extern int get_tree_nodev(struct fs_context *fc,152extern int get_tree_nodev(struct fs_context *fc,
151 int (*fill_super)(struct super_block *sb,153 int (*fill_super)(struct super_block *sb,
152 struct fs_context *fc));154 struct fs_context *fc));
153extern int get_tree_single(struct fs_context *fc,155extern int get_tree_single(struct fs_context *fc,
154 int (*fill_super)(struct super_block *sb,156 int (*fill_super)(struct super_block *sb,
155 struct fs_context *fc));157 struct fs_context *fc));
158extern int get_tree_single_reconf(struct fs_context *fc,
159 int (*fill_super)(struct super_block *sb,
160 struct fs_context *fc));
161extern 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
166extern int get_tree_bdev(struct fs_context *fc,
167 int (*fill_super)(struct super_block *sb,
168 struct fs_context *fc));
156 169
157extern const struct file_operations fscontext_fops;170extern const struct file_operations fscontext_fops;
158 171
include/linux/fscrypt.h+52−3
@@ -16,6 +16,7 @@ · 15 unmodified lines
16#include <linux/fs.h>16#include <linux/fs.h>
17#include <linux/mm.h>17#include <linux/mm.h>
18#include <linux/slab.h>18#include <linux/slab.h>
19#include <uapi/linux/fscrypt.h>
19 20
20#define FS_CRYPTO_BLOCK_SIZE 1621#define FS_CRYPTO_BLOCK_SIZE 16
21 22
@@ -42,7 +43,7 @@ struct fscrypt_name { · 20 unmodified lines
42#define fname_len(p) ((p)->disk_name.len)43#define fname_len(p) ((p)->disk_name.len)
43 44
44/* Maximum value for the third parameter of fscrypt_operations.set_context(). */45/* Maximum value for the third parameter of fscrypt_operations.set_context(). */
45#define FSCRYPT_SET_CONTEXT_MAX_SIZE 2846#define FSCRYPT_SET_CONTEXT_MAX_SIZE 40
46 47
47#ifdef CONFIG_FS_ENCRYPTION48#ifdef CONFIG_FS_ENCRYPTION
48/*49/*
@@ -134,13 +135,23 @@ extern void fscrypt_free_bounce_page(struct page *bounce_page); · 85 unmodified lines
134/* policy.c */135/* policy.c */
135extern int fscrypt_ioctl_set_policy(struct file *, const void __user *);136extern int fscrypt_ioctl_set_policy(struct file *, const void __user *);
136extern int fscrypt_ioctl_get_policy(struct file *, void __user *);137extern int fscrypt_ioctl_get_policy(struct file *, void __user *);
138extern int fscrypt_ioctl_get_policy_ex(struct file *, void __user *);
137extern int fscrypt_has_permitted_context(struct inode *, struct inode *);139extern int fscrypt_has_permitted_context(struct inode *, struct inode *);
138extern int fscrypt_inherit_context(struct inode *, struct inode *,140extern int fscrypt_inherit_context(struct inode *, struct inode *,
139 void *, bool);141 void *, bool);
140/* keyinfo.c */142/* keyring.c */
143extern void fscrypt_sb_free(struct super_block *sb);
144extern int fscrypt_ioctl_add_key(struct file *filp, void __user *arg);
145extern int fscrypt_ioctl_remove_key(struct file *filp, void __user *arg);
146extern int fscrypt_ioctl_remove_key_all_users(struct file *filp,
147 void __user *arg);
148extern int fscrypt_ioctl_get_key_status(struct file *filp, void __user *arg);
149
150/* keysetup.c */
141extern int fscrypt_get_encryption_info(struct inode *);151extern int fscrypt_get_encryption_info(struct inode *);
142extern void fscrypt_put_encryption_info(struct inode *);152extern void fscrypt_put_encryption_info(struct inode *);
143extern void fscrypt_free_inode(struct inode *);153extern void fscrypt_free_inode(struct inode *);
154extern int fscrypt_drop_inode(struct inode *inode);
144 155
145/* fname.c */156/* fname.c */
146extern int fscrypt_setup_filename(struct inode *, const struct qstr *,157extern 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
353 return -EOPNOTSUPP;364 return -EOPNOTSUPP;
354}365}
355 366
367static inline int fscrypt_ioctl_get_policy_ex(struct file *filp,
368 void __user *arg)
369{
370 return -EOPNOTSUPP;
371}
372
356static inline int fscrypt_has_permitted_context(struct inode *parent,373static inline int fscrypt_has_permitted_context(struct inode *parent,
357 struct inode *child)374 struct inode *child)
358{375{
@@ -366,7 +383,34 @@ static inline int fscrypt_inherit_context(struct inode *parent, · 7 unmodified lines
366 return -EOPNOTSUPP;383 return -EOPNOTSUPP;
367}384}
368 385
369/* keyinfo.c */386/* keyring.c */
387static inline void fscrypt_sb_free(struct super_block *sb)
388{
389}
390
391static inline int fscrypt_ioctl_add_key(struct file *filp, void __user *arg)
392{
393 return -EOPNOTSUPP;
394}
395
396static inline int fscrypt_ioctl_remove_key(struct file *filp, void __user *arg)
397{
398 return -EOPNOTSUPP;
399}
400
401static inline int fscrypt_ioctl_remove_key_all_users(struct file *filp,
402 void __user *arg)
403{
404 return -EOPNOTSUPP;
405}
406
407static inline int fscrypt_ioctl_get_key_status(struct file *filp,
408 void __user *arg)
409{
410 return -EOPNOTSUPP;
411}
412
413/* keysetup.c */
370static inline int fscrypt_get_encryption_info(struct inode *inode)414static inline int fscrypt_get_encryption_info(struct inode *inode)
371{415{
372 return -EOPNOTSUPP;416 return -EOPNOTSUPP;
@@ -381,6 +425,11 @@ static inline void fscrypt_free_inode(struct inode *inode) · 8 unmodified lines
381{425{
382}426}
383 427
428static inline int fscrypt_drop_inode(struct inode *inode)
429{
430 return 0;
431}
432
384 /* fname.c */433 /* fname.c */
385static inline int fscrypt_setup_filename(struct inode *dir,434static inline int fscrypt_setup_filename(struct inode *dir,
386 const struct qstr *iname,435 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
475extern void fsnotify_detach_mark(struct fsnotify_mark *mark);475extern void fsnotify_detach_mark(struct fsnotify_mark *mark);
476/* free mark */476/* free mark */
477extern void fsnotify_free_mark(struct fsnotify_mark *mark);477extern void fsnotify_free_mark(struct fsnotify_mark *mark);
478/* Wait until all marks queued for destruction are destroyed */
479extern void fsnotify_wait_marks_destroyed(void);
478/* run all the marks in a group, and clear all of the marks attached to given object type */480/* run all the marks in a group, and clear all of the marks attached to given object type */
479extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group, unsigned int type);481extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group, unsigned int type);
480/* run all the marks in a group, and clear all of the vfsmount marks */482/* 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 */
18struct 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
111static 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
119extern int fsverity_ioctl_enable(struct file *filp, const void __user *arg);
120
121/* measure.c */
122
123extern int fsverity_ioctl_measure(struct file *filp, void __user *arg);
124
125/* open.c */
126
127extern int fsverity_file_open(struct inode *inode, struct file *filp);
128extern int fsverity_prepare_setattr(struct dentry *dentry, struct iattr *attr);
129extern void fsverity_cleanup_inode(struct inode *inode);
130
131/* verify.c */
132
133extern bool fsverity_verify_page(struct page *page);
134extern void fsverity_verify_bio(struct bio *bio);
135extern void fsverity_enqueue_verify_work(struct work_struct *work);
136
137#else /* !CONFIG_FS_VERITY */
138
139static inline struct fsverity_info *fsverity_get_info(const struct inode *inode)
140{
141 return NULL;
142}
143
144/* enable.c */
145
146static inline int fsverity_ioctl_enable(struct file *filp,
147 const void __user *arg)
148{
149 return -EOPNOTSUPP;
150}
151
152/* measure.c */
153
154static inline int fsverity_ioctl_measure(struct file *filp, void __user *arg)
155{
156 return -EOPNOTSUPP;
157}
158
159/* open.c */
160
161static inline int fsverity_file_open(struct inode *inode, struct file *filp)
162{
163 return IS_VERITY(inode) ? -EOPNOTSUPP : 0;
164}
165
166static inline int fsverity_prepare_setattr(struct dentry *dentry,
167 struct iattr *attr)
168{
169 return IS_VERITY(d_inode(dentry)) ? -EOPNOTSUPP : 0;
170}
171
172static inline void fsverity_cleanup_inode(struct inode *inode)
173{
174}
175
176/* verify.c */
177
178static inline bool fsverity_verify_page(struct page *page)
179{
180 WARN_ON(1);
181 return false;
182}
183
184static inline void fsverity_verify_bio(struct bio *bio)
185{
186 WARN_ON(1);
187}
188
189static 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 */
206static 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
110 (fwnode ? (fwnode_has_op(fwnode, op) ? \110 (fwnode ? (fwnode_has_op(fwnode, op) ? \
111 (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : -ENXIO) : \111 (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : -ENXIO) : \
112 -EINVAL)112 -EINVAL)
113#define fwnode_call_bool_op(fwnode, op, ...) \113
114 (fwnode ? (fwnode_has_op(fwnode, op) ? \114#define fwnode_call_bool_op(fwnode, op, ...) \
115 (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : false) : \115 (fwnode_has_op(fwnode, op) ? \
116 false)116 (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : false)
117
117#define fwnode_call_ptr_op(fwnode, op, ...) \118#define fwnode_call_ptr_op(fwnode, op, ...) \
118 (fwnode_has_op(fwnode, op) ? \119 (fwnode_has_op(fwnode, op) ? \
119 (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : NULL)120 (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
221 return -EINVAL;221 return -EINVAL;
222}222}
223 223
224static inline int gpiochip_lock_as_irq(struct gpio_chip *chip,
225 unsigned int offset)
226{
227 WARN_ON(1);
228 return -EINVAL;
229}
230
231static inline void gpiochip_unlock_as_irq(struct gpio_chip *chip,
232 unsigned int offset)
233{
234 WARN_ON(1);
235}
236
237static inline int irq_to_gpio(unsigned irq)224static inline int irq_to_gpio(unsigned irq)
238{225{
239 /* irq can never have been returned from gpio_to_irq() */226 /* 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
241 return -EINVAL;228 return -EINVAL;
242}229}
243 230
244static inline int
245gpiochip_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
253static inline int
254gpiochip_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
262static inline void
263gpiochip_remove_pin_ranges(struct gpio_chip *chip)
264{
265 WARN_ON(1);
266}
267
268static inline int devm_gpio_request(struct device *dev, unsigned gpio,231static inline int devm_gpio_request(struct device *dev, unsigned gpio,
269 const char *label)232 const char *label)
270{233{
include/linux/gpio/consumer.h+137−62
@@ -170,18 +170,8 @@ struct gpio_desc *gpio_to_desc(unsigned gpio); · 169 unmodified lines
170int desc_to_gpio(const struct gpio_desc *desc);170int desc_to_gpio(const struct gpio_desc *desc);
171 171
172/* Child properties interface */172/* Child properties interface */
173struct device_node;
174struct fwnode_handle;173struct fwnode_handle;
175 174
176struct 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);
180struct 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);
185struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,175struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
186 const char *propname, int index,176 const char *propname, int index,
187 enum gpiod_flags dflags,177 enum gpiod_flags dflags,
@@ -247,7 +237,7 @@ static inline void gpiod_put(struct gpio_desc *desc) · 59 unmodified lines
247 might_sleep();237 might_sleep();
248 238
249 /* GPIO can never have been requested */239 /* GPIO can never have been requested */
250 WARN_ON(1);240 WARN_ON(desc);
251}241}
252 242
253static inline void devm_gpiod_unhinge(struct device *dev,243static inline void devm_gpiod_unhinge(struct device *dev,
@@ -256,7 +246,7 @@ static inline void devm_gpiod_unhinge(struct device *dev, · 2 unmodified lines
256 might_sleep();246 might_sleep();
257 247
258 /* GPIO can never have been requested */248 /* GPIO can never have been requested */
259 WARN_ON(1);249 WARN_ON(desc);
260}250}
261 251
262static inline void gpiod_put_array(struct gpio_descs *descs)252static 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
264 might_sleep();254 might_sleep();
265 255
266 /* GPIO can never have been requested */256 /* GPIO can never have been requested */
267 WARN_ON(1);257 WARN_ON(descs);
268}258}
269 259
270static inline struct gpio_desc *__must_check260static 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
317 might_sleep();307 might_sleep();
318 308
319 /* GPIO can never have been requested */309 /* GPIO can never have been requested */
320 WARN_ON(1);310 WARN_ON(desc);
321}311}
322 312
323static inline void devm_gpiod_put_array(struct device *dev,313static 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
326 might_sleep();316 might_sleep();
327 317
328 /* GPIO can never have been requested */318 /* GPIO can never have been requested */
329 WARN_ON(1);319 WARN_ON(descs);
330}320}
331 321
332 322
333static inline int gpiod_get_direction(const struct gpio_desc *desc)323static inline int gpiod_get_direction(const struct gpio_desc *desc)
334{324{
335 /* GPIO can never have been requested */325 /* GPIO can never have been requested */
336 WARN_ON(1);326 WARN_ON(desc);
337 return -ENOSYS;327 return -ENOSYS;
338}328}
339static inline int gpiod_direction_input(struct gpio_desc *desc)329static inline int gpiod_direction_input(struct gpio_desc *desc)
340{330{
341 /* GPIO can never have been requested */331 /* GPIO can never have been requested */
342 WARN_ON(1);332 WARN_ON(desc);
343 return -ENOSYS;333 return -ENOSYS;
344}334}
345static inline int gpiod_direction_output(struct gpio_desc *desc, int value)335static inline int gpiod_direction_output(struct gpio_desc *desc, int value)
346{336{
347 /* GPIO can never have been requested */337 /* GPIO can never have been requested */
348 WARN_ON(1);338 WARN_ON(desc);
349 return -ENOSYS;339 return -ENOSYS;
350}340}
351static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)341static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)
352{342{
353 /* GPIO can never have been requested */343 /* GPIO can never have been requested */
354 WARN_ON(1);344 WARN_ON(desc);
355 return -ENOSYS;345 return -ENOSYS;
356}346}
357 347
@@ -359,7 +349,7 @@ static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value) · 1 unmodified line
359static inline int gpiod_get_value(const struct gpio_desc *desc)349static inline int gpiod_get_value(const struct gpio_desc *desc)
360{350{
361 /* GPIO can never have been requested */351 /* GPIO can never have been requested */
362 WARN_ON(1);352 WARN_ON(desc);
363 return 0;353 return 0;
364}354}
365static inline int gpiod_get_array_value(unsigned int array_size,355static 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
368 unsigned long *value_bitmap)358 unsigned long *value_bitmap)
369{359{
370 /* GPIO can never have been requested */360 /* GPIO can never have been requested */
371 WARN_ON(1);361 WARN_ON(desc_array);
372 return 0;362 return 0;
373}363}
374static inline void gpiod_set_value(struct gpio_desc *desc, int value)364static inline void gpiod_set_value(struct gpio_desc *desc, int value)
375{365{
376 /* GPIO can never have been requested */366 /* GPIO can never have been requested */
377 WARN_ON(1);367 WARN_ON(desc);
378}368}
379static inline int gpiod_set_array_value(unsigned int array_size,369static inline int gpiod_set_array_value(unsigned int array_size,
380 struct gpio_desc **desc_array,370 struct gpio_desc **desc_array,
@@ -382,13 +372,13 @@ static inline int gpiod_set_array_value(unsigned int array_size, · 1 unmodified line
382 unsigned long *value_bitmap)372 unsigned long *value_bitmap)
383{373{
384 /* GPIO can never have been requested */374 /* GPIO can never have been requested */
385 WARN_ON(1);375 WARN_ON(desc_array);
386 return 0;376 return 0;
387}377}
388static inline int gpiod_get_raw_value(const struct gpio_desc *desc)378static inline int gpiod_get_raw_value(const struct gpio_desc *desc)
389{379{
390 /* GPIO can never have been requested */380 /* GPIO can never have been requested */
391 WARN_ON(1);381 WARN_ON(desc);
392 return 0;382 return 0;
393}383}
394static inline int gpiod_get_raw_array_value(unsigned int array_size,384static 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
397 unsigned long *value_bitmap)387 unsigned long *value_bitmap)
398{388{
399 /* GPIO can never have been requested */389 /* GPIO can never have been requested */
400 WARN_ON(1);390 WARN_ON(desc_array);
401 return 0;391 return 0;
402}392}
403static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value)393static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value)
404{394{
405 /* GPIO can never have been requested */395 /* GPIO can never have been requested */
406 WARN_ON(1);396 WARN_ON(desc);
407}397}
408static inline int gpiod_set_raw_array_value(unsigned int array_size,398static inline int gpiod_set_raw_array_value(unsigned int array_size,
409 struct gpio_desc **desc_array,399 struct gpio_desc **desc_array,
@@ -411,14 +401,14 @@ static inline int gpiod_set_raw_array_value(unsigned int array_size, · 1 unmodified line
411 unsigned long *value_bitmap)401 unsigned long *value_bitmap)
412{402{
413 /* GPIO can never have been requested */403 /* GPIO can never have been requested */
414 WARN_ON(1);404 WARN_ON(desc_array);
415 return 0;405 return 0;
416}406}
417 407
418static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc)408static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc)
419{409{
420 /* GPIO can never have been requested */410 /* GPIO can never have been requested */
421 WARN_ON(1);411 WARN_ON(desc);
422 return 0;412 return 0;
423}413}
424static inline int gpiod_get_array_value_cansleep(unsigned int array_size,414static 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
427 unsigned long *value_bitmap)417 unsigned long *value_bitmap)
428{418{
429 /* GPIO can never have been requested */419 /* GPIO can never have been requested */
430 WARN_ON(1);420 WARN_ON(desc_array);
431 return 0;421 return 0;
432}422}
433static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value)423static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value)
434{424{
435 /* GPIO can never have been requested */425 /* GPIO can never have been requested */
436 WARN_ON(1);426 WARN_ON(desc);
437}427}
438static inline int gpiod_set_array_value_cansleep(unsigned int array_size,428static inline int gpiod_set_array_value_cansleep(unsigned int array_size,
439 struct gpio_desc **desc_array,429 struct gpio_desc **desc_array,
@@ -441,13 +431,13 @@ static inline int gpiod_set_array_value_cansleep(unsigned int array_size, · 1 unmodified line
441 unsigned long *value_bitmap)431 unsigned long *value_bitmap)
442{432{
443 /* GPIO can never have been requested */433 /* GPIO can never have been requested */
444 WARN_ON(1);434 WARN_ON(desc_array);
445 return 0;435 return 0;
446}436}
447static inline int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc)437static inline int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc)
448{438{
449 /* GPIO can never have been requested */439 /* GPIO can never have been requested */
450 WARN_ON(1);440 WARN_ON(desc);
451 return 0;441 return 0;
452}442}
453static inline int gpiod_get_raw_array_value_cansleep(unsigned int array_size,443static 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
456 unsigned long *value_bitmap)446 unsigned long *value_bitmap)
457{447{
458 /* GPIO can never have been requested */448 /* GPIO can never have been requested */
459 WARN_ON(1);449 WARN_ON(desc_array);
460 return 0;450 return 0;
461}451}
462static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc,452static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc,
463 int value)453 int value)
464{454{
465 /* GPIO can never have been requested */455 /* GPIO can never have been requested */
466 WARN_ON(1);456 WARN_ON(desc);
467}457}
468static inline int gpiod_set_raw_array_value_cansleep(unsigned int array_size,458static inline int gpiod_set_raw_array_value_cansleep(unsigned int array_size,
469 struct gpio_desc **desc_array,459 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
471 unsigned long *value_bitmap)461 unsigned long *value_bitmap)
472{462{
473 /* GPIO can never have been requested */463 /* GPIO can never have been requested */
474 WARN_ON(1);464 WARN_ON(desc_array);
475 return 0;465 return 0;
476}466}
477 467
478static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)468static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
479{469{
480 /* GPIO can never have been requested */470 /* GPIO can never have been requested */
481 WARN_ON(1);471 WARN_ON(desc);
482 return -ENOSYS;472 return -ENOSYS;
483}473}
484 474
485static inline int gpiod_set_transitory(struct gpio_desc *desc, bool transitory)475static inline int gpiod_set_transitory(struct gpio_desc *desc, bool transitory)
486{476{
487 /* GPIO can never have been requested */477 /* GPIO can never have been requested */
488 WARN_ON(1);478 WARN_ON(desc);
489 return -ENOSYS;479 return -ENOSYS;
490}480}
491 481
492static inline int gpiod_is_active_low(const struct gpio_desc *desc)482static inline int gpiod_is_active_low(const struct gpio_desc *desc)
493{483{
494 /* GPIO can never have been requested */484 /* GPIO can never have been requested */
495 WARN_ON(1);485 WARN_ON(desc);
496 return 0;486 return 0;
497}487}
498static inline int gpiod_cansleep(const struct gpio_desc *desc)488static inline int gpiod_cansleep(const struct gpio_desc *desc)
499{489{
500 /* GPIO can never have been requested */490 /* GPIO can never have been requested */
501 WARN_ON(1);491 WARN_ON(desc);
502 return 0;492 return 0;
503}493}
504 494
505static inline int gpiod_to_irq(const struct gpio_desc *desc)495static inline int gpiod_to_irq(const struct gpio_desc *desc)
506{496{
507 /* GPIO can never have been requested */497 /* GPIO can never have been requested */
508 WARN_ON(1);498 WARN_ON(desc);
509 return -EINVAL;499 return -EINVAL;
510}500}
511 501
@@ -513,7 +503,7 @@ static inline int gpiod_set_consumer_name(struct gpio_desc *desc, · 1 unmodified line
513 const char *name)503 const char *name)
514{504{
515 /* GPIO can never have been requested */505 /* GPIO can never have been requested */
516 WARN_ON(1);506 WARN_ON(desc);
517 return -EINVAL;507 return -EINVAL;
518}508}
519 509
@@ -525,33 +515,13 @@ static inline struct gpio_desc *gpio_to_desc(unsigned gpio) · 5 unmodified lines
525static inline int desc_to_gpio(const struct gpio_desc *desc)515static inline int desc_to_gpio(const struct gpio_desc *desc)
526{516{
527 /* GPIO can never have been requested */517 /* GPIO can never have been requested */
528 WARN_ON(1);518 WARN_ON(desc);
529 return -EINVAL;519 return -EINVAL;
530}520}
531 521
532/* Child properties interface */522/* Child properties interface */
533struct device_node;
534struct fwnode_handle;523struct fwnode_handle;
535 524
536static inline
537struct 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
545static inline
546struct 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
555static inline525static inline
556struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,526struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,
557 const char *propname, int index,527 const char *propname, int index,
@@ -584,6 +554,111 @@ struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev, · 26 unmodified lines
584 flags, label);554 flags, label);
585}555}
586 556
557#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_OF_GPIO)
558struct device_node;
559
560struct 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
567struct device_node;
568
569static inline
570struct 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
581struct device_node;
582
583struct 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
591struct device_node;
592
593static inline
594struct 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
605struct acpi_gpio_params {
606 unsigned int crs_entry_index;
607 unsigned int line_index;
608 bool active_low;
609};
610
611struct 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
631struct acpi_device;
632
633int acpi_dev_add_driver_gpios(struct acpi_device *adev,
634 const struct acpi_gpio_mapping *gpios);
635void acpi_dev_remove_driver_gpios(struct acpi_device *adev);
636
637int devm_acpi_dev_add_driver_gpios(struct device *dev,
638 const struct acpi_gpio_mapping *gpios);
639void devm_acpi_dev_remove_driver_gpios(struct device *dev);
640
641#else /* CONFIG_GPIOLIB && CONFIG_ACPI */
642
643struct acpi_device;
644
645static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
646 const struct acpi_gpio_mapping *gpios)
647{
648 return -ENXIO;
649}
650static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) {}
651
652static inline int devm_acpi_dev_add_driver_gpios(struct device *dev,
653 const struct acpi_gpio_mapping *gpios)
654{
655 return -ENXIO;
656}
657static inline void devm_acpi_dev_remove_driver_gpios(struct device *dev) {}
658
659#endif /* CONFIG_GPIOLIB && CONFIG_ACPI */
660
661
587#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)662#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_GPIO_SYSFS)
588 663
589int gpiod_export(struct gpio_desc *desc, bool direction_may_change);664int 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
20enum gpiod_flags;20enum gpiod_flags;
21enum gpio_lookup_flags;21enum gpio_lookup_flags;
22 22
23#ifdef CONFIG_GPIOLIB23struct gpio_chip;
24 24
25#ifdef CONFIG_GPIOLIB_IRQCHIP
26/**25/**
27 * struct gpio_irq_chip - GPIO interrupt controller26 * struct gpio_irq_chip - GPIO interrupt controller
28 */27 */
@@ -49,6 +48,84 @@ struct gpio_irq_chip { · 20 unmodified lines
49 */48 */
50 const struct irq_domain_ops *domain_ops;49 const struct irq_domain_ops *domain_ops;
51 50
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
52 /**129 /**
53 * @handler:130 * @handler:
54 *131 *
@@ -125,11 +202,17 @@ struct gpio_irq_chip { · 70 unmodified lines
125 bool threaded;202 bool threaded;
126 203
127 /**204 /**
128 * @need_valid_mask:205 * @init_valid_mask: optional routine to initialize @valid_mask, to be
129 *206 * used if not all GPIO lines are valid interrupts. Sometimes some
130 * If set core allocates @valid_mask with all bits set to one.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.
131 */212 */
132 bool need_valid_mask;213 void (*init_valid_mask)(struct gpio_chip *chip,
214 unsigned long *valid_mask,
215 unsigned int ngpios);
133 216
134 /**217 /**
135 * @valid_mask:218 * @valid_mask:
@@ -161,7 +244,6 @@ struct gpio_irq_chip { · 25 unmodified lines
161 */244 */
162 void (*irq_disable)(struct irq_data *data);245 void (*irq_disable)(struct irq_data *data);
163};246};
164#endif /* CONFIG_GPIOLIB_IRQCHIP */
165 247
166/**248/**
167 * struct gpio_chip - abstract a GPIO controller249 * struct gpio_chip - abstract a GPIO controller
@@ -282,7 +364,9 @@ struct gpio_chip { · 114 unmodified lines
282 void (*dbg_show)(struct seq_file *s,364 void (*dbg_show)(struct seq_file *s,
283 struct gpio_chip *chip);365 struct gpio_chip *chip);
284 366
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);
286 370
287 int base;371 int base;
288 u16 ngpio;372 u16 ngpio;
@@ -320,15 +404,6 @@ struct gpio_chip { · 31 unmodified lines
320 struct gpio_irq_chip irq;404 struct gpio_irq_chip irq;
321#endif /* CONFIG_GPIOLIB_IRQCHIP */405#endif /* CONFIG_GPIOLIB_IRQCHIP */
322 406
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
332 /**407 /**
333 * @valid_mask:408 * @valid_mask:
334 *409 *
@@ -421,9 +496,6 @@ extern int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *chip, · 86 unmodified lines
421extern struct gpio_chip *gpiochip_find(void *data,496extern struct gpio_chip *gpiochip_find(void *data,
422 int (*match)(struct gpio_chip *chip, void *data));497 int (*match)(struct gpio_chip *chip, void *data));
423 498
424/* lock/unlock as IRQ */
425int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset);
426void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);
427bool gpiochip_line_is_irq(struct gpio_chip *chip, unsigned int offset);499bool gpiochip_line_is_irq(struct gpio_chip *chip, unsigned int offset);
428int gpiochip_reqres_irq(struct gpio_chip *chip, unsigned int offset);500int gpiochip_reqres_irq(struct gpio_chip *chip, unsigned int offset);
429void gpiochip_relres_irq(struct gpio_chip *chip, unsigned int offset);501void 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
441/* get driver data */513/* get driver data */
442void *gpiochip_get_data(struct gpio_chip *chip);514void *gpiochip_get_data(struct gpio_chip *chip);
443 515
444struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc);
445
446struct bgpio_pdata {516struct bgpio_pdata {
447 const char *label;517 const char *label;
448 int base;518 int base;
449 int ngpio;519 int ngpio;
450};520};
451 521
452#if IS_ENABLED(CONFIG_GPIO_GENERIC)522#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
523
524void gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *chip,
525 struct irq_fwspec *fwspec,
526 unsigned int parent_hwirq,
527 unsigned int parent_type);
528void 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
535static 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
542static 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 */
453 550
454int bgpio_init(struct gpio_chip *gc, struct device *dev,551int bgpio_init(struct gpio_chip *gc, struct device *dev,
455 unsigned long sz, void __iomem *dat, void __iomem *set,552 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
463#define BGPIOF_READ_OUTPUT_REG_SET BIT(4) /* reg_set stores output value */560#define BGPIOF_READ_OUTPUT_REG_SET BIT(4) /* reg_set stores output value */
464#define BGPIOF_NO_OUTPUT BIT(5) /* only input */561#define BGPIOF_NO_OUTPUT BIT(5) /* only input */
465 562
466#endif /* CONFIG_GPIO_GENERIC */
467
468#ifdef CONFIG_GPIOLIB_IRQCHIP
469
470int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,563int gpiochip_irq_map(struct irq_domain *d, unsigned int irq,
471 irq_hw_number_t hwirq);564 irq_hw_number_t hwirq);
472void gpiochip_irq_unmap(struct irq_domain *d, unsigned int irq);565void 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
555}648}
556#endif /* CONFIG_LOCKDEP */649#endif /* CONFIG_LOCKDEP */
557 650
558#endif /* CONFIG_GPIOLIB_IRQCHIP */
559
560int gpiochip_generic_request(struct gpio_chip *chip, unsigned offset);651int gpiochip_generic_request(struct gpio_chip *chip, unsigned offset);
561void gpiochip_generic_free(struct gpio_chip *chip, unsigned offset);652void gpiochip_generic_free(struct gpio_chip *chip, unsigned offset);
562int gpiochip_generic_config(struct gpio_chip *chip, unsigned offset,653int gpiochip_generic_config(struct gpio_chip *chip, unsigned offset,
563 unsigned long config);654 unsigned long config);
564 655
565#ifdef CONFIG_PINCTRL
566
567/**656/**
568 * struct gpio_pin_range - pin range controlled by a gpio chip657 * struct gpio_pin_range - pin range controlled by a gpio chip
569 * @node: list for maintaining set of pin ranges, used internally658 * @node: list for maintaining set of pin ranges, used internally
@@ -576,6 +665,8 @@ struct gpio_pin_range { · 6 unmodified lines
576 struct pinctrl_gpio_range range;665 struct pinctrl_gpio_range range;
577};666};
578 667
668#ifdef CONFIG_PINCTRL
669
579int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,670int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
580 unsigned int gpio_offset, unsigned int pin_offset,671 unsigned int gpio_offset, unsigned int pin_offset,
581 unsigned int npins);672 unsigned int npins);
@@ -586,8 +677,6 @@ void gpiochip_remove_pin_ranges(struct gpio_chip *chip); · 4 unmodified lines
586 677
587#else /* ! CONFIG_PINCTRL */678#else /* ! CONFIG_PINCTRL */
588 679
589struct pinctrl_dev;
590
591static inline int680static inline int
592gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,681gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
593 unsigned int gpio_offset, unsigned int pin_offset,682 unsigned int gpio_offset, unsigned int pin_offset,
@@ -619,6 +708,15 @@ void gpiochip_free_own_desc(struct gpio_desc *desc); · 25 unmodified lines
619void devprop_gpiochip_set_names(struct gpio_chip *chip,708void devprop_gpiochip_set_names(struct gpio_chip *chip,
620 const struct fwnode_handle *fwnode);709 const struct fwnode_handle *fwnode);
621 710
711#ifdef CONFIG_GPIOLIB
712
713/* lock/unlock as IRQ */
714int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset);
715void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);
716
717
718struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc);
719
622#else /* CONFIG_GPIOLIB */720#else /* CONFIG_GPIOLIB */
623 721
624static inline struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc)722static 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
628 return ERR_PTR(-ENODEV);726 return ERR_PTR(-ENODEV);
629}727}
630 728
729static inline int gpiochip_lock_as_irq(struct gpio_chip *chip,
730 unsigned int offset)
731{
732 WARN_ON(1);
733 return -EINVAL;
734}
735
736static inline void gpiochip_unlock_as_irq(struct gpio_chip *chip,
737 unsigned int offset)
738{
739 WARN_ON(1);
740}
631#endif /* CONFIG_GPIOLIB */741#endif /* CONFIG_GPIOLIB */
632 742
633#endif743#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
56struct 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
69static inline void greybus_set_drvdata(struct gb_bundle *bundle, void *data)
70{
71 dev_set_drvdata(&bundle->dev, data);
72}
73
74static 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 */
80int greybus_register_driver(struct greybus_driver *driver,
81 struct module *module, const char *mod_name);
82void 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
101int greybus_disabled(void);
102
103void gb_debugfs_init(void);
104void gb_debugfs_cleanup(void);
105struct dentry *gb_debugfs_get(void);
106
107extern struct bus_type greybus_bus_type;
108
109extern struct device_type greybus_hd_type;
110extern struct device_type greybus_module_type;
111extern struct device_type greybus_interface_type;
112extern struct device_type greybus_control_type;
113extern struct device_type greybus_bundle_type;
114extern struct device_type greybus_svc_type;
115
116static inline int is_gb_host_device(const struct device *dev)
117{
118 return dev->type == &greybus_hd_type;
119}
120
121static inline int is_gb_module(const struct device *dev)
122{
123 return dev->type == &greybus_module_type;
124}
125
126static inline int is_gb_interface(const struct device *dev)
127{
128 return dev->type == &greybus_interface_type;
129}
130
131static inline int is_gb_control(const struct device *dev)
132{
133 return dev->type == &greybus_control_type;
134}
135
136static inline int is_gb_bundle(const struct device *dev)
137{
138 return dev->type == &greybus_bundle_type;
139}
140
141static inline int is_gb_svc(const struct device *dev)
142{
143 return dev->type == &greybus_svc_type;
144}
145
146static 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" */
20struct 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" */
40struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id,
41 u8 class);
42int gb_bundle_add(struct gb_bundle *bundle);
43void gb_bundle_destroy(struct gb_bundle *bundle);
44
45/* Bundle Runtime PM wrappers */
46#ifdef CONFIG_PM
47static 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
62static 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
72static inline void gb_pm_runtime_get_noresume(struct gb_bundle *bundle)
73{
74 pm_runtime_get_noresume(&bundle->dev);
75}
76
77static inline void gb_pm_runtime_put_noidle(struct gb_bundle *bundle)
78{
79 pm_runtime_put_noidle(&bundle->dev);
80}
81
82#else
83static inline int gb_pm_runtime_get_sync(struct gb_bundle *bundle)
84{ return 0; }
85static inline int gb_pm_runtime_put_autosuspend(struct gb_bundle *bundle)
86{ return 0; }
87
88static inline void gb_pm_runtime_get_noresume(struct gb_bundle *bundle) {}
89static 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
27enum 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
34struct gb_operation;
35
36typedef int (*gb_request_handler_t)(struct gb_operation *);
37
38struct 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
67struct gb_connection *gb_connection_create_static(struct gb_host_device *hd,
68 u16 hd_cport_id, gb_request_handler_t handler);
69struct gb_connection *gb_connection_create_control(struct gb_interface *intf);
70struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
71 u16 cport_id, gb_request_handler_t handler);
72struct gb_connection *gb_connection_create_flags(struct gb_bundle *bundle,
73 u16 cport_id, gb_request_handler_t handler,
74 unsigned long flags);
75struct gb_connection *gb_connection_create_offloaded(struct gb_bundle *bundle,
76 u16 cport_id, unsigned long flags);
77void gb_connection_destroy(struct gb_connection *connection);
78
79static inline bool gb_connection_is_static(struct gb_connection *connection)
80{
81 return !connection->intf;
82}
83
84int gb_connection_enable(struct gb_connection *connection);
85int gb_connection_enable_tx(struct gb_connection *connection);
86void gb_connection_disable_rx(struct gb_connection *connection);
87void gb_connection_disable(struct gb_connection *connection);
88void gb_connection_disable_forced(struct gb_connection *connection);
89
90void gb_connection_mode_switch_prepare(struct gb_connection *connection);
91void gb_connection_mode_switch_complete(struct gb_connection *connection);
92
93void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id,
94 u8 *data, size_t length);
95
96void gb_connection_latency_tag_enable(struct gb_connection *connection);
97void gb_connection_latency_tag_disable(struct gb_connection *connection);
98
99static inline bool gb_connection_e2efc_enabled(struct gb_connection *connection)
100{
101 return !(connection->flags & GB_CONNECTION_FLAG_CSD);
102}
103
104static inline bool
105gb_connection_flow_control_disabled(struct gb_connection *connection)
106{
107 return connection->flags & GB_CONNECTION_FLAG_NO_FLOWCTRL;
108}
109
110static inline bool gb_connection_is_offloaded(struct gb_connection *connection)
111{
112 return connection->flags & GB_CONNECTION_FLAG_OFFLOADED;
113}
114
115static inline bool gb_connection_is_control(struct gb_connection *connection)
116{
117 return connection->flags & GB_CONNECTION_FLAG_CONTROL;
118}
119
120static inline void *gb_connection_get_data(struct gb_connection *connection)
121{
122 return connection->private;
123}
124
125static 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
15struct 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
32struct gb_control *gb_control_create(struct gb_interface *intf);
33int gb_control_enable(struct gb_control *control);
34void gb_control_disable(struct gb_control *control);
35int gb_control_suspend(struct gb_control *control);
36int gb_control_resume(struct gb_control *control);
37int gb_control_add(struct gb_control *control);
38void gb_control_del(struct gb_control *control);
39struct gb_control *gb_control_get(struct gb_control *control);
40void gb_control_put(struct gb_control *control);
41
42int gb_control_get_bundle_versions(struct gb_control *control);
43int gb_control_connected_operation(struct gb_control *control, u16 cport_id);
44int gb_control_disconnected_operation(struct gb_control *control, u16 cport_id);
45int gb_control_disconnecting_operation(struct gb_control *control,
46 u16 cport_id);
47int gb_control_mode_switch_operation(struct gb_control *control);
48void gb_control_mode_switch_prepare(struct gb_control *control);
49void gb_control_mode_switch_complete(struct gb_control *control);
50int gb_control_get_manifest_size_operation(struct gb_interface *intf);
51int gb_control_get_manifest_operation(struct gb_interface *intf, void *manifest,
52 size_t size);
53int gb_control_bundle_suspend(struct gb_control *control, u8 bundle_id);
54int gb_control_bundle_resume(struct gb_control *control, u8 bundle_id);
55int gb_control_bundle_deactivate(struct gb_control *control, u8 bundle_id);
56int gb_control_bundle_activate(struct gb_control *control, u8 bundle_id);
57int gb_control_interface_suspend_prepare(struct gb_control *control);
58int gb_control_interface_deactivate_prepare(struct gb_control *control);
59int 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
13struct 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
20enum 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
28enum 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
61enum 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
91enum {
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 */
100struct 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 */
110struct 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 */
136struct 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 */
148struct greybus_descriptor_cport {
149 __le16 id;
150 __u8 bundle;
151 __u8 protocol_id; /* enum greybus_protocol */
152} __packed;
153
154struct greybus_descriptor_header {
155 __le16 size;
156 __u8 type; /* enum greybus_descriptor_type */
157 __u8 pad;
158} __packed;
159
160struct 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
170struct greybus_manifest_header {
171 __le16 size;
172 __u8 version_major;
173 __u8 version_minor;
174} __packed;
175
176struct 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 */
46struct 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
59struct 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
89struct gb_control_version_request {
90 __u8 major;
91 __u8 minor;
92} __packed;
93
94struct gb_control_version_response {
95 __u8 major;
96 __u8 minor;
97} __packed;
98
99struct gb_control_bundle_version_request {
100 __u8 bundle_id;
101} __packed;
102
103struct gb_control_bundle_version_response {
104 __u8 major;
105 __u8 minor;
106} __packed;
107
108/* Control protocol manifest get size request has no payload*/
109struct gb_control_get_manifest_size_response {
110 __le16 size;
111} __packed;
112
113/* Control protocol manifest get request has no payload */
114struct gb_control_get_manifest_response {
115 __u8 data[0];
116} __packed;
117
118/* Control protocol [dis]connected request */
119struct gb_control_connected_request {
120 __le16 cport_id;
121} __packed;
122
123struct gb_control_disconnecting_request {
124 __le16 cport_id;
125} __packed;
126/* disconnecting response has no payload */
127
128struct 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
144struct gb_control_bundle_pm_request {
145 __u8 bundle_id;
146} __packed;
147
148struct 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
162struct 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
202struct 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 */
219struct gb_fw_download_find_firmware_request {
220 __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
221} __packed;
222
223struct gb_fw_download_find_firmware_response {
224 __u8 firmware_id;
225 __le32 size;
226} __packed;
227
228/* firmware download fetch firmware request/response */
229struct gb_fw_download_fetch_firmware_request {
230 __u8 firmware_id;
231 __le32 offset;
232 __le32 size;
233} __packed;
234
235struct gb_fw_download_fetch_firmware_response {
236 __u8 data[0];
237} __packed;
238
239/* firmware download release firmware request */
240struct 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 */
279struct 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 */
286struct 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 */
294struct 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 */
303struct gb_fw_mgmt_backend_fw_version_request {
304 __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE];
305} __packed;
306
307struct 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 */
314struct 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 */
321struct 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 */
336struct gb_cap_get_endpoint_uid_response {
337 __u8 uid[8];
338} __packed;
339
340/* CAP get endpoint ims certificate request/response */
341struct gb_cap_get_ims_certificate_request {
342 __le32 certificate_class;
343 __le32 certificate_id;
344} __packed;
345
346struct gb_cap_get_ims_certificate_response {
347 __u8 result_code;
348 __u8 certificate[0];
349} __packed;
350
351/* CAP authenticate request/response */
352struct gb_cap_authenticate_request {
353 __le32 auth_type;
354 __u8 uid[8];
355 __u8 challenge[32];
356} __packed;
357
358struct 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
392struct gb_bootrom_version_request {
393 __u8 major;
394 __u8 minor;
395} __packed;
396
397struct gb_bootrom_version_response {
398 __u8 major;
399 __u8 minor;
400} __packed;
401
402/* Bootrom protocol firmware size request/response */
403struct gb_bootrom_firmware_size_request {
404 __u8 stage;
405} __packed;
406
407struct gb_bootrom_firmware_size_response {
408 __le32 size;
409} __packed;
410
411/* Bootrom protocol get firmware request/response */
412struct gb_bootrom_get_firmware_request {
413 __le32 offset;
414 __le32 size;
415} __packed;
416
417struct gb_bootrom_get_firmware_response {
418 __u8 data[0];
419} __packed;
420
421/* Bootrom protocol Ready to boot request */
422struct 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 */
428struct 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
494struct gb_power_supply_get_supplies_response {
495 __u8 supplies_count;
496} __packed;
497
498struct gb_power_supply_get_description_request {
499 __u8 psy_id;
500} __packed;
501
502struct 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
510struct 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
577struct gb_power_supply_get_property_descriptors_request {
578 __u8 psy_id;
579} __packed;
580
581struct gb_power_supply_get_property_descriptors_response {
582 __u8 properties_count;
583 struct gb_power_supply_props_desc props[];
584} __packed;
585
586struct gb_power_supply_get_property_request {
587 __u8 psy_id;
588 __u8 property;
589} __packed;
590
591struct gb_power_supply_get_property_response {
592 __le32 prop_val;
593};
594
595struct gb_power_supply_set_property_request {
596 __u8 psy_id;
597 __u8 property;
598 __le32 prop_val;
599} __packed;
600
601struct 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 */
626struct 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 */
636struct gb_hid_get_report_request {
637 __u8 report_type;
638 __u8 report_id;
639} __packed;
640
641/* HID set report request */
642struct 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 */
649struct 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 */
661struct 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 */
675struct gb_i2c_transfer_op {
676 __le16 addr;
677 __le16 flags;
678 __le16 size;
679} __packed;
680
681struct gb_i2c_transfer_request {
682 __le16 op_count;
683 struct gb_i2c_transfer_op ops[0]; /* op_count of these */
684} __packed;
685struct 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 */
715struct gb_gpio_line_count_response {
716 __u8 count;
717} __packed;
718
719struct gb_gpio_activate_request {
720 __u8 which;
721} __packed;
722/* activate response has no payload */
723
724struct gb_gpio_deactivate_request {
725 __u8 which;
726} __packed;
727/* deactivate response has no payload */
728
729struct gb_gpio_get_direction_request {
730 __u8 which;
731} __packed;
732struct gb_gpio_get_direction_response {
733 __u8 direction;
734} __packed;
735
736struct gb_gpio_direction_in_request {
737 __u8 which;
738} __packed;
739/* direction in response has no payload */
740
741struct gb_gpio_direction_out_request {
742 __u8 which;
743 __u8 value;
744} __packed;
745/* direction out response has no payload */
746
747struct gb_gpio_get_value_request {
748 __u8 which;
749} __packed;
750struct gb_gpio_get_value_response {
751 __u8 value;
752} __packed;
753
754struct gb_gpio_set_value_request {
755 __u8 which;
756 __u8 value;
757} __packed;
758/* set value response has no payload */
759
760struct gb_gpio_set_debounce_request {
761 __u8 which;
762 __le16 usec;
763} __packed;
764/* debounce response has no payload */
765
766struct gb_gpio_irq_type_request {
767 __u8 which;
768 __u8 type;
769} __packed;
770/* irq type response has no payload */
771
772struct gb_gpio_irq_mask_request {
773 __u8 which;
774} __packed;
775/* irq mask response has no payload */
776
777struct 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 */
783struct 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 */
801struct gb_pwm_count_response {
802 __u8 count;
803} __packed;
804
805struct gb_pwm_activate_request {
806 __u8 which;
807} __packed;
808
809struct gb_pwm_deactivate_request {
810 __u8 which;
811} __packed;
812
813struct gb_pwm_config_request {
814 __u8 which;
815 __le32 duty;
816 __le32 period;
817} __packed;
818
819struct gb_pwm_polarity_request {
820 __u8 which;
821 __u8 polarity;
822} __packed;
823
824struct gb_pwm_enable_request {
825 __u8 which;
826} __packed;
827
828struct 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 */
859struct 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
868struct gb_spi_device_config_request {
869 __u8 chip_select;
870} __packed;
871
872struct 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 */
895struct 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
907struct 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
914struct 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
977struct gb_svc_version_request {
978 __u8 major;
979 __u8 minor;
980} __packed;
981
982struct gb_svc_version_response {
983 __u8 major;
984 __u8 minor;
985} __packed;
986
987/* SVC protocol hello request */
988struct gb_svc_hello_request {
989 __le16 endo_id;
990 __u8 interface_id;
991} __packed;
992/* hello response has no payload */
993
994struct gb_svc_intf_device_id_request {
995 __u8 intf_id;
996 __u8 device_id;
997} __packed;
998/* device id response has no payload */
999
1000struct gb_svc_intf_reset_request {
1001 __u8 intf_id;
1002} __packed;
1003/* interface reset response has no payload */
1004
1005struct gb_svc_intf_eject_request {
1006 __u8 intf_id;
1007} __packed;
1008/* interface eject response has no payload */
1009
1010struct 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
1020struct 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
1028struct gb_svc_dme_peer_get_request {
1029 __u8 intf_id;
1030 __le16 attr;
1031 __le16 selector;
1032} __packed;
1033
1034struct gb_svc_dme_peer_get_response {
1035 __le16 result_code;
1036 __le32 attr_value;
1037} __packed;
1038
1039struct gb_svc_dme_peer_set_request {
1040 __u8 intf_id;
1041 __le16 attr;
1042 __le16 selector;
1043 __le32 value;
1044} __packed;
1045
1046struct 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
1058struct 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
1066struct 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} */
1073struct gb_svc_intf_vsys_request {
1074 __u8 intf_id;
1075} __packed;
1076
1077struct 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} */
1085struct gb_svc_intf_refclk_request {
1086 __u8 intf_id;
1087} __packed;
1088
1089struct 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} */
1097struct gb_svc_intf_unipro_request {
1098 __u8 intf_id;
1099} __packed;
1100
1101struct 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
1141struct 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
1152struct 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
1168struct gb_svc_intf_set_pwrm_response {
1169 __u8 result_code;
1170} __packed;
1171
1172struct 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
1183struct gb_svc_pwrmon_rail_count_get_response {
1184 __u8 rail_count;
1185} __packed;
1186
1187#define GB_SVC_PWRMON_RAIL_NAME_BUFSIZE 32
1188
1189struct 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
1203struct gb_svc_pwrmon_sample_get_request {
1204 __u8 rail_id;
1205 __u8 measurement_type;
1206} __packed;
1207
1208struct gb_svc_pwrmon_sample_get_response {
1209 __u8 result;
1210 __le32 measurement;
1211} __packed;
1212
1213struct gb_svc_pwrmon_intf_sample_get_request {
1214 __u8 intf_id;
1215 __u8 measurement_type;
1216} __packed;
1217
1218struct 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
1225struct 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
1232struct gb_svc_module_removed_request {
1233 __u8 primary_intf_id;
1234} __packed;
1235/* module_removed response has no payload */
1236
1237struct 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
1246struct gb_svc_intf_activate_response {
1247 __u8 status;
1248 __u8 intf_type;
1249} __packed;
1250
1251struct gb_svc_intf_resume_request {
1252 __u8 intf_id;
1253} __packed;
1254
1255struct 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
1263struct 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
1270struct 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
1282struct 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 */
1301struct 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 */
1313struct gb_uart_recv_data_request {
1314 __le16 size;
1315 __u8 flags;
1316 __u8 data[0];
1317} __packed;
1318
1319struct gb_uart_receive_credits_request {
1320 __le16 count;
1321} __packed;
1322
1323struct 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
1347struct gb_uart_set_control_line_state_request {
1348 __u8 control;
1349} __packed;
1350
1351struct 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
1360struct gb_uart_serial_state_request {
1361 __u8 control;
1362} __packed;
1363
1364struct 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 */
1381struct gb_loopback_transfer_request {
1382 __le32 len;
1383 __le32 reserved0;
1384 __le32 reserved1;
1385 __u8 data[0];
1386} __packed;
1387
1388struct 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 */
1404struct 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 */
1437struct 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 */
1499struct 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
1520struct gb_sdio_command_response {
1521 __le32 resp[4];
1522} __packed;
1523
1524/* transfer request */
1525struct 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
1536struct 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 */
1543struct 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 */
1563struct gb_camera_stream_config_request {
1564 __le16 width;
1565 __le16 height;
1566 __le16 format;
1567 __le16 padding;
1568} __packed;
1569
1570struct 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 */
1579struct 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
1590struct 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 */
1600struct 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 */
1609struct gb_camera_flush_response {
1610 __le32 request_id;
1611} __packed;
1612
1613/* Greybus Camera Metadata request payload - operation has no response */
1614struct 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 */
1668struct gb_lights_get_lights_response {
1669 __u8 lights_count;
1670} __packed;
1671
1672/* light config request payload */
1673struct gb_lights_get_light_config_request {
1674 __u8 id;
1675} __packed;
1676
1677/* light config response payload */
1678struct gb_lights_get_light_config_response {
1679 __u8 channel_count;
1680 __u8 name[32];
1681} __packed;
1682
1683/* channel config request payload */
1684struct gb_lights_get_channel_config_request {
1685 __u8 light_id;
1686 __u8 channel_id;
1687} __packed;
1688
1689/* channel flash config request payload */
1690struct gb_lights_get_channel_flash_config_request {
1691 __u8 light_id;
1692 __u8 channel_id;
1693} __packed;
1694
1695/* channel config response payload */
1696struct 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 */
1706struct 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 */
1716struct 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 */
1724struct 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 */
1731struct 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 */
1738struct 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 */
1746struct 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 */
1753struct 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 */
1760struct 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 */
1767struct 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 */
1774struct gb_lights_get_flash_fault_request {
1775 __u8 light_id;
1776 __u8 channel_id;
1777} __packed;
1778
1779/* get flash fault response payload */
1780struct 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
1965struct 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
1974struct 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
1981struct gb_audio_integer {
1982 __le32 min;
1983 __le32 max;
1984 __le32 step;
1985} __packed;
1986
1987struct gb_audio_integer64 {
1988 __le64 min;
1989 __le64 max;
1990 __le64 step;
1991} __packed;
1992
1993struct gb_audio_enumerated {
1994 __le32 items;
1995 __le16 names_length;
1996 __u8 names[0];
1997} __packed;
1998
1999struct 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
2009struct 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
2018struct 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
2029struct 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
2039struct 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
2046struct 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
2065struct gb_audio_get_topology_size_response {
2066 __le16 size;
2067} __packed;
2068
2069struct gb_audio_get_topology_response {
2070 struct gb_audio_topology topology;
2071} __packed;
2072
2073struct gb_audio_get_control_request {
2074 __u8 control_id;
2075 __u8 index;
2076} __packed;
2077
2078struct gb_audio_get_control_response {
2079 struct gb_audio_ctl_elem_value value;
2080} __packed;
2081
2082struct gb_audio_set_control_request {
2083 __u8 control_id;
2084 __u8 index;
2085 struct gb_audio_ctl_elem_value value;
2086} __packed;
2087
2088struct gb_audio_enable_widget_request {
2089 __u8 widget_id;
2090} __packed;
2091
2092struct gb_audio_disable_widget_request {
2093 __u8 widget_id;
2094} __packed;
2095
2096struct gb_audio_get_pcm_request {
2097 __le16 data_cport;
2098} __packed;
2099
2100struct gb_audio_get_pcm_response {
2101 __le32 format;
2102 __le32 rate;
2103 __u8 channels;
2104 __u8 sig_bits;
2105} __packed;
2106
2107struct 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
2115struct gb_audio_set_tx_data_size_request {
2116 __le16 data_cport;
2117 __le16 size;
2118} __packed;
2119
2120struct gb_audio_activate_tx_request {
2121 __le16 data_cport;
2122} __packed;
2123
2124struct gb_audio_deactivate_tx_request {
2125 __le16 data_cport;
2126} __packed;
2127
2128struct gb_audio_set_rx_data_size_request {
2129 __le16 data_cport;
2130 __le16 size;
2131} __packed;
2132
2133struct gb_audio_activate_rx_request {
2134 __le16 data_cport;
2135} __packed;
2136
2137struct gb_audio_deactivate_rx_request {
2138 __le16 data_cport;
2139} __packed;
2140
2141struct gb_audio_jack_event_request {
2142 __u8 widget_id;
2143 __u8 jack_attribute;
2144 __u8 event;
2145} __packed;
2146
2147struct gb_audio_button_event_request {
2148 __u8 widget_id;
2149 __u8 button_id;
2150 __u8 event;
2151} __packed;
2152
2153struct gb_audio_streaming_event_request {
2154 __le16 data_cport;
2155 __u8 event;
2156} __packed;
2157
2158struct 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
2172struct 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
15struct gb_host_device;
16struct gb_message;
17
18struct 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
44struct 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
65int gb_hd_cport_reserve(struct gb_host_device *hd, u16 cport_id);
66void gb_hd_cport_release_reserved(struct gb_host_device *hd, u16 cport_id);
67int gb_hd_cport_allocate(struct gb_host_device *hd, int cport_id,
68 unsigned long flags);
69void gb_hd_cport_release(struct gb_host_device *hd, u16 cport_id);
70
71struct 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);
75int gb_hd_add(struct gb_host_device *hd);
76void gb_hd_del(struct gb_host_device *hd);
77void gb_hd_shutdown(struct gb_host_device *hd);
78void gb_hd_put(struct gb_host_device *hd);
79int gb_hd_output(struct gb_host_device *hd, void *req, u16 size, u8 cmd,
80 bool in_irq);
81
82int gb_hd_init(void);
83void 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
15enum 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
31struct 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
71struct gb_interface *gb_interface_create(struct gb_module *module,
72 u8 interface_id);
73int gb_interface_activate(struct gb_interface *intf);
74void gb_interface_deactivate(struct gb_interface *intf);
75int gb_interface_enable(struct gb_interface *intf);
76void gb_interface_disable(struct gb_interface *intf);
77int gb_interface_add(struct gb_interface *intf);
78void gb_interface_del(struct gb_interface *intf);
79void gb_interface_put(struct gb_interface *intf);
80void gb_interface_mailbox_event(struct gb_interface *intf, u16 result,
81 u32 mailbox);
82
83int 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
14struct gb_interface;
15bool 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
15struct 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
30struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
31 size_t num_interfaces);
32int gb_module_add(struct gb_module *module);
33void gb_module_del(struct gb_module *module);
34void 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
18struct gb_host_device;
19struct 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
30enum 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 */
52struct 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 */
91typedef void (*gb_operation_callback)(struct gb_operation *);
92struct 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
116static inline bool
117gb_operation_is_incoming(struct gb_operation *operation)
118{
119 return operation->flags & GB_OPERATION_FLAG_INCOMING;
120}
121
122static inline bool
123gb_operation_is_unidirectional(struct gb_operation *operation)
124{
125 return operation->flags & GB_OPERATION_FLAG_UNIDIRECTIONAL;
126}
127
128static inline bool
129gb_operation_short_response_allowed(struct gb_operation *operation)
130{
131 return operation->flags & GB_OPERATION_FLAG_SHORT_RESPONSE;
132}
133
134static inline bool gb_operation_is_core(struct gb_operation *operation)
135{
136 return operation->flags & GB_OPERATION_FLAG_CORE;
137}
138
139void gb_connection_recv(struct gb_connection *connection,
140 void *data, size_t size);
141
142int gb_operation_result(struct gb_operation *operation);
143
144size_t gb_operation_get_payload_size_max(struct gb_connection *connection);
145struct gb_operation *
146gb_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
151static inline struct gb_operation *
152gb_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
160struct gb_operation *
161gb_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
166void gb_operation_get(struct gb_operation *operation);
167void gb_operation_put(struct gb_operation *operation);
168
169bool gb_operation_response_alloc(struct gb_operation *operation,
170 size_t response_size, gfp_t gfp);
171
172int gb_operation_request_send(struct gb_operation *operation,
173 gb_operation_callback callback,
174 unsigned int timeout,
175 gfp_t gfp);
176int gb_operation_request_send_sync_timeout(struct gb_operation *operation,
177 unsigned int timeout);
178static inline int
179gb_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
185void gb_operation_cancel(struct gb_operation *operation, int errno);
186void gb_operation_cancel_incoming(struct gb_operation *operation, int errno);
187
188void greybus_message_sent(struct gb_host_device *hd,
189 struct gb_message *message, int status);
190
191int 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);
195int gb_operation_unidirectional_timeout(struct gb_connection *connection,
196 int type, void *request, int request_size,
197 unsigned int timeout);
198
199static 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
208static 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
215static inline void *gb_operation_get_data(struct gb_operation *operation)
216{
217 return operation->private;
218}
219
220static inline void gb_operation_set_data(struct gb_operation *operation,
221 void *data)
222{
223 operation->private = data;
224}
225
226int gb_operation_init(void);
227void 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
15struct 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
21enum gb_svc_state {
22 GB_SVC_STATE_RESET,
23 GB_SVC_STATE_PROTOCOL_VERSION,
24 GB_SVC_STATE_SVC_HELLO,
25};
26
27enum gb_svc_watchdog_bite {
28 GB_SVC_WATCHDOG_BITE_RESET_UNIPRO = 0,
29 GB_SVC_WATCHDOG_BITE_PANIC_KERNEL,
30};
31
32struct gb_svc_watchdog;
33
34struct svc_debugfs_pwrmon_rail {
35 u8 id;
36 struct gb_svc *svc;
37};
38
39struct 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
62struct gb_svc *gb_svc_create(struct gb_host_device *hd);
63int gb_svc_add(struct gb_svc *svc);
64void gb_svc_del(struct gb_svc *svc);
65void gb_svc_put(struct gb_svc *svc);
66
67int gb_svc_pwrmon_intf_sample_get(struct gb_svc *svc, u8 intf_id,
68 u8 measurement_type, u32 *value);
69int gb_svc_intf_device_id(struct gb_svc *svc, u8 intf_id, u8 device_id);
70int gb_svc_route_create(struct gb_svc *svc, u8 intf1_id, u8 dev1_id,
71 u8 intf2_id, u8 dev2_id);
72void gb_svc_route_destroy(struct gb_svc *svc, u8 intf1_id, u8 intf2_id);
73int gb_svc_connection_create(struct gb_svc *svc, u8 intf1_id, u16 cport1_id,
74 u8 intf2_id, u16 cport2_id, u8 cport_flags);
75void gb_svc_connection_destroy(struct gb_svc *svc, u8 intf1_id, u16 cport1_id,
76 u8 intf2_id, u16 cport2_id);
77int gb_svc_intf_eject(struct gb_svc *svc, u8 intf_id);
78int gb_svc_intf_vsys_set(struct gb_svc *svc, u8 intf_id, bool enable);
79int gb_svc_intf_refclk_set(struct gb_svc *svc, u8 intf_id, bool enable);
80int gb_svc_intf_unipro_set(struct gb_svc *svc, u8 intf_id, bool enable);
81int gb_svc_intf_activate(struct gb_svc *svc, u8 intf_id, u8 *intf_type);
82int gb_svc_intf_resume(struct gb_svc *svc, u8 intf_id);
83
84int gb_svc_dme_peer_get(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector,
85 u32 *value);
86int gb_svc_dme_peer_set(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector,
87 u32 value);
88int 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);
95int gb_svc_intf_set_power_mode_hibernate(struct gb_svc *svc, u8 intf_id);
96int gb_svc_ping(struct gb_svc *svc);
97int gb_svc_watchdog_create(struct gb_svc *svc);
98void gb_svc_watchdog_destroy(struct gb_svc *svc);
99bool gb_svc_watchdog_enabled(struct gb_svc *svc);
100int gb_svc_watchdog_enable(struct gb_svc *svc);
101int gb_svc_watchdog_disable(struct gb_svc *svc);
102
103int gb_svc_protocol_init(void);
104void 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
1154#define hid_pidff_init NULL1154#define hid_pidff_init NULL
1155#endif1155#endif
1156 1156
1157#define dbg_hid(format, arg...) \1157#define dbg_hid(fmt, ...) \
1158do { \1158do { \
1159 if (hid_debug) \1159 if (hid_debug) \
1160 printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \1160 printk(KERN_DEBUG "%s: " fmt, __FILE__, ##__VA_ARGS__); \
1161} while (0)1161} while (0)
1162 1162
1163#define hid_printk(level, hid, fmt, arg...) \1163#define hid_err(hid, fmt, ...) \
1164 dev_printk(level, &(hid)->dev, fmt, ##arg)1164 dev_err(&(hid)->dev, fmt, ##__VA_ARGS__)
1165#define hid_emerg(hid, fmt, arg...) \1165#define hid_notice(hid, fmt, ...) \
1166 dev_emerg(&(hid)->dev, fmt, ##arg)1166 dev_notice(&(hid)->dev, fmt, ##__VA_ARGS__)
1167#define hid_crit(hid, fmt, arg...) \1167#define hid_warn(hid, fmt, ...) \
1168 dev_crit(&(hid)->dev, fmt, ##arg)1168 dev_warn(&(hid)->dev, fmt, ##__VA_ARGS__)
1169#define hid_alert(hid, fmt, arg...) \1169#define hid_info(hid, fmt, ...) \
1170 dev_alert(&(hid)->dev, fmt, ##arg)1170 dev_info(&(hid)->dev, fmt, ##__VA_ARGS__)
1171#define hid_err(hid, fmt, arg...) \1171#define hid_dbg(hid, fmt, ...) \
1172 dev_err(&(hid)->dev, fmt, ##arg)1172 dev_dbg(&(hid)->dev, fmt, ##__VA_ARGS__)
1173#define hid_notice(hid, fmt, arg...) \1173
1174 dev_notice(&(hid)->dev, fmt, ##arg)1174#define hid_err_once(hid, fmt, ...) \
1175#define hid_warn(hid, fmt, arg...) \1175 dev_err_once(&(hid)->dev, fmt, ##__VA_ARGS__)
1176 dev_warn(&(hid)->dev, fmt, ##arg)1176#define hid_notice_once(hid, fmt, ...) \
1177#define hid_info(hid, fmt, arg...) \1177 dev_notice_once(&(hid)->dev, fmt, ##__VA_ARGS__)
1178 dev_info(&(hid)->dev, fmt, ##arg)1178#define hid_warn_once(hid, fmt, ...) \
1179#define hid_dbg(hid, fmt, arg...) \1179 dev_warn_once(&(hid)->dev, fmt, ##__VA_ARGS__)
1180 dev_dbg(&(hid)->dev, fmt, ##arg)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__)
1181 1184
1182#endif1185#endif
include/linux/hmm.h+20−159
@@ -84,15 +84,12 @@ · 83 unmodified lines
84 * @notifiers: count of active mmu notifiers84 * @notifiers: count of active mmu notifiers
85 */85 */
86struct hmm {86struct hmm {
87 struct mm_struct *mm;87 struct mmu_notifier mmu_notifier;
88 struct kref kref;
89 spinlock_t ranges_lock;88 spinlock_t ranges_lock;
90 struct list_head ranges;89 struct list_head ranges;
91 struct list_head mirrors;90 struct list_head mirrors;
92 struct mmu_notifier mmu_notifier;
93 struct rw_semaphore mirrors_sem;91 struct rw_semaphore mirrors_sem;
94 wait_queue_head_t wq;92 wait_queue_head_t wq;
95 struct rcu_head rcu;
96 long notifiers;93 long notifiers;
97};94};
98 95
@@ -158,13 +155,11 @@ enum hmm_pfn_value_e { · 59 unmodified lines
158 * @values: pfn value for some special case (none, special, error, ...)155 * @values: pfn value for some special case (none, special, error, ...)
159 * @default_flags: default flags for the range (write, read, ... see hmm doc)156 * @default_flags: default flags for the range (write, read, ... see hmm doc)
160 * @pfn_flags_mask: allows to mask pfn flags so that only default_flags matter157 * @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)
162 * @pfn_shifts: pfn shift value (should be <= PAGE_SHIFT)158 * @pfn_shifts: pfn shift value (should be <= PAGE_SHIFT)
163 * @valid: pfns array did not change since it has been fill by an HMM function159 * @valid: pfns array did not change since it has been fill by an HMM function
164 */160 */
165struct hmm_range {161struct hmm_range {
166 struct hmm *hmm;162 struct hmm *hmm;
167 struct vm_area_struct *vma;
168 struct list_head list;163 struct list_head list;
169 unsigned long start;164 unsigned long start;
170 unsigned long end;165 unsigned long end;
@@ -173,31 +168,10 @@ struct hmm_range { · 2 unmodified lines
173 const uint64_t *values;168 const uint64_t *values;
174 uint64_t default_flags;169 uint64_t default_flags;
175 uint64_t pfn_flags_mask;170 uint64_t pfn_flags_mask;
176 uint8_t page_shift;
177 uint8_t pfn_shift;171 uint8_t pfn_shift;
178 bool valid;172 bool valid;
179};173};
180 174
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 */
186static 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 */
196static inline unsigned long hmm_range_page_size(const struct hmm_range *range)
197{
198 return 1UL << hmm_range_page_shift(range);
199}
200
201/*175/*
202 * hmm_range_wait_until_valid() - wait for range to be valid176 * hmm_range_wait_until_valid() - wait for range to be valid
203 * @range: range affected by invalidation to wait on177 * @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
290 range->flags[HMM_PFN_VALID];264 range->flags[HMM_PFN_VALID];
291}265}
292 266
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 */
303static 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
309static 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
315static 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
321static 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
327/*267/*
328 * Mirroring: how to synchronize device page table with CPU page table.268 * Mirroring: how to synchronize device page table with CPU page table.
329 *269 *
@@ -374,29 +314,6 @@ static inline uint64_t hmm_pfn_from_pfn(const struct hmm_range *range, · 44 unmodified lines
374 314
375struct hmm_mirror;315struct hmm_mirror;
376 316
377/*
378 * enum hmm_update_event - type of update
379 * @HMM_UPDATE_INVALIDATE: invalidate range (no indication as to why)
380 */
381enum 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 */
393struct hmm_update {
394 unsigned long start;
395 unsigned long end;
396 enum hmm_update_event event;
397 bool blockable;
398};
399
400/*317/*
401 * struct hmm_mirror_ops - HMM mirror device operations callback318 * struct hmm_mirror_ops - HMM mirror device operations callback
402 *319 *
@@ -417,9 +334,9 @@ struct hmm_mirror_ops { · 14 unmodified lines
417 /* sync_cpu_device_pagetables() - synchronize page tables334 /* sync_cpu_device_pagetables() - synchronize page tables
418 *335 *
419 * @mirror: pointer to struct hmm_mirror336 * @mirror: pointer to struct hmm_mirror
420 * @update: update information (see struct hmm_update)337 * @update: update information (see struct mmu_notifier_range)
421 * Return: -EAGAIN if update.blockable false and callback need to338 * Return: -EAGAIN if mmu_notifier_range_blockable(update) is false
422 * block, 0 otherwise.339 * and callback needs to block, 0 otherwise.
423 *340 *
424 * This callback ultimately originates from mmu_notifiers when the CPU341 * This callback ultimately originates from mmu_notifiers when the CPU
425 * page table is updated. The device driver must update its page table342 * page table is updated. The device driver must update its page table
@@ -430,8 +347,9 @@ struct hmm_mirror_ops { · 4 unmodified lines
430 * page tables are completely updated (TLBs flushed, etc); this is a347 * page tables are completely updated (TLBs flushed, etc); this is a
431 * synchronous call.348 * synchronous call.
432 */349 */
433 int (*sync_cpu_device_pagetables)(struct hmm_mirror *mirror,350 int (*sync_cpu_device_pagetables)(
434 const struct hmm_update *update);351 struct hmm_mirror *mirror,
352 const struct mmu_notifier_range *update);
435};353};
436 354
437/*355/*
@@ -457,20 +375,24 @@ void hmm_mirror_unregister(struct hmm_mirror *mirror); · 19 unmodified lines
457/*375/*
458 * Please see Documentation/vm/hmm.rst for how to use the range API.376 * Please see Documentation/vm/hmm.rst for how to use the range API.
459 */377 */
460int hmm_range_register(struct hmm_range *range,378int hmm_range_register(struct hmm_range *range, struct hmm_mirror *mirror);
461 struct hmm_mirror *mirror,
462 unsigned long start,
463 unsigned long end,
464 unsigned page_shift);
465void hmm_range_unregister(struct hmm_range *range);379void hmm_range_unregister(struct hmm_range *range);
466long hmm_range_snapshot(struct hmm_range *range);380
467long hmm_range_fault(struct hmm_range *range, bool block);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
389long hmm_range_fault(struct hmm_range *range, unsigned int flags);
390
468long hmm_range_dma_map(struct hmm_range *range,391long hmm_range_dma_map(struct hmm_range *range,
469 struct device *device,392 struct device *device,
470 dma_addr_t *daddrs,393 dma_addr_t *daddrs,
471 bool block);394 unsigned int flags);
472long hmm_range_dma_unmap(struct hmm_range *range,395long hmm_range_dma_unmap(struct hmm_range *range,
473 struct vm_area_struct *vma,
474 struct device *device,396 struct device *device,
475 dma_addr_t *daddrs,397 dma_addr_t *daddrs,
476 bool dirty);398 bool dirty);
@@ -484,67 +406,6 @@ long hmm_range_dma_unmap(struct hmm_range *range, · 7 unmodified lines
484 */406 */
485#define HMM_RANGE_DEFAULT_TIMEOUT 1000407#define HMM_RANGE_DEFAULT_TIMEOUT 1000
486 408
487/* This is a temporary helper to avoid merge conflict between trees. */
488static 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. */
497static 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! */
542static inline void hmm_mm_init(struct mm_struct *mm)
543{
544 mm->hmm = NULL;
545}
546#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */
547static inline void hmm_mm_init(struct mm_struct *mm) {}
548#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */409#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
549 410
550#endif /* LINUX_HMM_H */411#endif /* LINUX_HMM_H */
include/linux/hrtimer.h+44−4
@@ -32,12 +32,15 @@ struct hrtimer_cpu_base; · 31 unmodified lines
32 * when starting the timer)32 * when starting the timer)
33 * HRTIMER_MODE_SOFT - Timer callback function will be executed in33 * HRTIMER_MODE_SOFT - Timer callback function will be executed in
34 * soft irq context34 * soft irq context
35 * HRTIMER_MODE_HARD - Timer callback function will be executed in
36 * hard irq context even on PREEMPT_RT.
35 */37 */
36enum hrtimer_mode {38enum hrtimer_mode {
37 HRTIMER_MODE_ABS = 0x00,39 HRTIMER_MODE_ABS = 0x00,
38 HRTIMER_MODE_REL = 0x01,40 HRTIMER_MODE_REL = 0x01,
39 HRTIMER_MODE_PINNED = 0x02,41 HRTIMER_MODE_PINNED = 0x02,
40 HRTIMER_MODE_SOFT = 0x04,42 HRTIMER_MODE_SOFT = 0x04,
43 HRTIMER_MODE_HARD = 0x08,
41 44
42 HRTIMER_MODE_ABS_PINNED = HRTIMER_MODE_ABS | HRTIMER_MODE_PINNED,45 HRTIMER_MODE_ABS_PINNED = HRTIMER_MODE_ABS | HRTIMER_MODE_PINNED,
43 HRTIMER_MODE_REL_PINNED = HRTIMER_MODE_REL | HRTIMER_MODE_PINNED,46 HRTIMER_MODE_REL_PINNED = HRTIMER_MODE_REL | HRTIMER_MODE_PINNED,
@@ -48,6 +51,11 @@ enum hrtimer_mode { · 4 unmodified lines
48 HRTIMER_MODE_ABS_PINNED_SOFT = HRTIMER_MODE_ABS_PINNED | HRTIMER_MODE_SOFT,51 HRTIMER_MODE_ABS_PINNED_SOFT = HRTIMER_MODE_ABS_PINNED | HRTIMER_MODE_SOFT,
49 HRTIMER_MODE_REL_PINNED_SOFT = HRTIMER_MODE_REL_PINNED | HRTIMER_MODE_SOFT,52 HRTIMER_MODE_REL_PINNED_SOFT = HRTIMER_MODE_REL_PINNED | HRTIMER_MODE_SOFT,
50 53
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,
51};59};
52 60
53/*61/*
@@ -101,6 +109,8 @@ enum hrtimer_restart { · 47 unmodified lines
101 * @state: state information (See bit values above)109 * @state: state information (See bit values above)
102 * @is_rel: Set if the timer was armed relative110 * @is_rel: Set if the timer was armed relative
103 * @is_soft: Set if hrtimer will be expired in soft interrupt context.111 * @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.
104 *114 *
105 * The hrtimer structure must be initialized by hrtimer_init()115 * The hrtimer structure must be initialized by hrtimer_init()
106 */116 */
@@ -112,6 +122,7 @@ struct hrtimer { · 5 unmodified lines
112 u8 state;122 u8 state;
113 u8 is_rel;123 u8 is_rel;
114 u8 is_soft;124 u8 is_soft;
125 u8 is_hard;
115};126};
116 127
117/**128/**
@@ -183,6 +194,10 @@ enum hrtimer_base_type { · 65 unmodified lines
183 * @nr_retries: Total number of hrtimer interrupt retries194 * @nr_retries: Total number of hrtimer interrupt retries
184 * @nr_hangs: Total number of hrtimer interrupt hangs195 * @nr_hangs: Total number of hrtimer interrupt hangs
185 * @max_hang_time: Maximum time spent in hrtimer_interrupt196 * @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.
186 * @expires_next: absolute time of the next event, is required for remote201 * @expires_next: absolute time of the next event, is required for remote
187 * hrtimer enqueue; it is the total first expiry time (hard202 * hrtimer enqueue; it is the total first expiry time (hard
188 * and soft hrtimer are taken into account)203 * and soft hrtimer are taken into account)
@@ -209,6 +224,10 @@ struct hrtimer_cpu_base { · 20 unmodified lines
209 unsigned short nr_retries;224 unsigned short nr_retries;
210 unsigned short nr_hangs;225 unsigned short nr_hangs;
211 unsigned int max_hang_time;226 unsigned int max_hang_time;
227#endif
228#ifdef CONFIG_PREEMPT_RT
229 spinlock_t softirq_expiry_lock;
230 atomic_t timer_waiters;
212#endif231#endif
213 ktime_t expires_next;232 ktime_t expires_next;
214 struct hrtimer *next_timer;233 struct hrtimer *next_timer;
@@ -341,16 +360,29 @@ extern void hrtimers_resume(void); · 126 unmodified lines
341 360
342DECLARE_PER_CPU(struct tick_device, tick_cpu_device);361DECLARE_PER_CPU(struct tick_device, tick_cpu_device);
343 362
363#ifdef CONFIG_PREEMPT_RT
364void hrtimer_cancel_wait_running(const struct hrtimer *timer);
365#else
366static inline void hrtimer_cancel_wait_running(struct hrtimer *timer)
367{
368 cpu_relax();
369}
370#endif
344 371
345/* Exported timer functions: */372/* Exported timer functions: */
346 373
347/* Initialize timers: */374/* Initialize timers: */
348extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,375extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock,
349 enum hrtimer_mode mode);376 enum hrtimer_mode mode);
377extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, clockid_t clock_id,
378 enum hrtimer_mode mode);
350 379
351#ifdef CONFIG_DEBUG_OBJECTS_TIMERS380#ifdef CONFIG_DEBUG_OBJECTS_TIMERS
352extern void hrtimer_init_on_stack(struct hrtimer *timer, clockid_t which_clock,381extern void hrtimer_init_on_stack(struct hrtimer *timer, clockid_t which_clock,
353 enum hrtimer_mode mode);382 enum hrtimer_mode mode);
383extern void hrtimer_init_sleeper_on_stack(struct hrtimer_sleeper *sl,
384 clockid_t clock_id,
385 enum hrtimer_mode mode);
354 386
355extern void destroy_hrtimer_on_stack(struct hrtimer *timer);387extern void destroy_hrtimer_on_stack(struct hrtimer *timer);
356#else388#else
@@ -360,6 +392,14 @@ static inline void hrtimer_init_on_stack(struct hrtimer *timer, · 3 unmodified lines
360{392{
361 hrtimer_init(timer, which_clock, mode);393 hrtimer_init(timer, which_clock, mode);
362}394}
395
396static 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
363static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { }403static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { }
364#endif404#endif
365 405
@@ -395,6 +435,9 @@ static inline void hrtimer_start_expires(struct hrtimer *timer, · 29 unmodified lines
395 hrtimer_start_range_ns(timer, soft, delta, mode);435 hrtimer_start_range_ns(timer, soft, delta, mode);
396}436}
397 437
438void hrtimer_sleeper_start_expires(struct hrtimer_sleeper *sl,
439 enum hrtimer_mode mode);
440
398static inline void hrtimer_restart(struct hrtimer *timer)441static inline void hrtimer_restart(struct hrtimer *timer)
399{442{
400 hrtimer_start_expires(timer, HRTIMER_MODE_ABS);443 hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
@@ -463,11 +506,8 @@ extern long hrtimer_nanosleep(const struct timespec64 *rqtp, · 62 unmodified lines
463 const enum hrtimer_mode mode,506 const enum hrtimer_mode mode,
464 const clockid_t clockid);507 const clockid_t clockid);
465 508
466extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
467 struct task_struct *tsk);
468
469extern int schedule_hrtimeout_range(ktime_t *expires, u64 delta,509extern int schedule_hrtimeout_range(ktime_t *expires, u64 delta,
470 const enum hrtimer_mode mode);510 const enum hrtimer_mode mode);
471extern int schedule_hrtimeout_range_clock(ktime_t *expires,511extern int schedule_hrtimeout_range_clock(ktime_t *expires,
472 u64 delta,512 u64 delta,
473 const enum hrtimer_mode mode,513 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
108 108
109 if (transparent_hugepage_flags & (1 << TRANSPARENT_HUGEPAGE_FLAG))109 if (transparent_hugepage_flags & (1 << TRANSPARENT_HUGEPAGE_FLAG))
110 return true;110 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 */
112 if (vma_is_dax(vma))117 if (vma_is_dax(vma))
113 return true;118 return true;
114 119
@@ -267,6 +272,15 @@ static inline bool thp_migration_supported(void) · 152 unmodified lines
267 return IS_ENABLED(CONFIG_ARCH_ENABLE_THP_MIGRATION);272 return IS_ENABLED(CONFIG_ARCH_ENABLE_THP_MIGRATION);
268}273}
269 274
275static 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
270#else /* CONFIG_TRANSPARENT_HUGEPAGE */284#else /* CONFIG_TRANSPARENT_HUGEPAGE */
271#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })285#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
272#define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })286#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
454static inline struct hstate *page_hstate(struct page *page)454static inline struct hstate *page_hstate(struct page *page)
455{455{
456 VM_BUG_ON_PAGE(!PageHuge(page), page);456 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));
458}458}
459 459
460static inline unsigned hstate_index_to_shift(unsigned index)460static 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
245 } pipe;245 } pipe;
246 } u;246 } u;
247 /*247 /*
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.
249 */252 */
250 u16 sub_channel_index;253 u16 sub_channel_index;
251 u16 reserved3;254 u16 reserved3;
@@ -423,6 +426,9 @@ enum vmbus_channel_message_type { · 171 unmodified lines
423 CHANNELMSG_COUNT426 CHANNELMSG_COUNT
424};427};
425 428
429/* Hyper-V supports about 2048 channels, and the RELIDs start with 1. */
430#define INVALID_RELID U32_MAX
431
426struct vmbus_channel_message_header {432struct vmbus_channel_message_header {
427 enum vmbus_channel_message_type msgtype;433 enum vmbus_channel_message_type msgtype;
428 u32 padding;434 u32 padding;
@@ -934,6 +940,11 @@ static inline bool is_hvsock_channel(const struct vmbus_channel *c) · 505 unmodified lines
934 VMBUS_CHANNEL_TLNPI_PROVIDER_OFFER);940 VMBUS_CHANNEL_TLNPI_PROVIDER_OFFER);
935}941}
936 942
943static inline bool is_sub_channel(const struct vmbus_channel *c)
944{
945 return c->offermsg.offer.sub_channel_index != 0;
946}
947
937static inline void set_channel_affinity_state(struct vmbus_channel *c,948static inline void set_channel_affinity_state(struct vmbus_channel *c,
938 enum hv_numa_policy policy)949 enum hv_numa_policy policy)
939{950{
@@ -1149,6 +1160,9 @@ struct hv_driver { · 209 unmodified lines
1149 int (*remove)(struct hv_device *);1160 int (*remove)(struct hv_device *);
1150 void (*shutdown)(struct hv_device *);1161 void (*shutdown)(struct hv_device *);
1151 1162
1163 int (*suspend)(struct hv_device *);
1164 int (*resume)(struct hv_device *);
1165
1152};1166};
1153 1167
1154/* Base device object */1168/* Base device object */
@@ -1578,4 +1592,33 @@ hv_pkt_iter_next(struct vmbus_channel *channel, · 423 unmodified lines
1578 for (pkt = hv_pkt_iter_first(channel); pkt; \1592 for (pkt = hv_pkt_iter_first(channel); pkt; \
1579 pkt = hv_pkt_iter_next(channel, pkt))1593 pkt = hv_pkt_iter_next(channel, pkt))
1580 1594
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
1604int hyperv_read_cfg_blk(struct pci_dev *dev, void *buf, unsigned int buf_len,
1605 unsigned int block_id, unsigned int *bytes_returned);
1606int hyperv_write_cfg_blk(struct pci_dev *dev, void *buf, unsigned int len,
1607 unsigned int block_id);
1608int hyperv_reg_block_invalidate(struct pci_dev *dev, void *context,
1609 void (*block_invalidate)(void *context,
1610 u64 block_mask));
1611
1612struct 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
1622extern struct hyperv_pci_block_ops hvpci_block_ops;
1623
1581#endif /* _HYPERV_H */1624#endif /* _HYPERV_H */
include/linux/i2c.h+2−2
@@ -473,7 +473,7 @@ extern struct i2c_client * · 472 unmodified lines
473devm_i2c_new_dummy_device(struct device *dev, struct i2c_adapter *adap, u16 address);473devm_i2c_new_dummy_device(struct device *dev, struct i2c_adapter *adap, u16 address);
474 474
475extern struct i2c_client *475extern struct i2c_client *
476i2c_new_secondary_device(struct i2c_client *client,476i2c_new_ancillary_device(struct i2c_client *client,
477 const char *name,477 const char *name,
478 u16 default_addr);478 u16 default_addr);
479 479
@@ -521,7 +521,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info, · 41 unmodified lines
521 *521 *
522 * The return codes from the @master_xfer{_atomic} fields should indicate the522 * The return codes from the @master_xfer{_atomic} fields should indicate the
523 * type of error code that occurred during the transfer, as documented in the523 * 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.
525 */525 */
526struct i2c_algorithm {526struct i2c_algorithm {
527 /*527 /*
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
188struct device *i3cdev_to_dev(struct i3c_device *i3cdev);188struct device *i3cdev_to_dev(struct i3c_device *i3cdev);
189struct i3c_device *dev_to_i3cdev(struct device *dev);189struct i3c_device *dev_to_i3cdev(struct device *dev);
190 190
191const struct i3c_device_id *
192i3c_device_match_id(struct i3c_device *i3cdev,
193 const struct i3c_device_id *id_table);
194
191static inline void i3cdev_set_drvdata(struct i3c_device *i3cdev,195static inline void i3cdev_set_drvdata(struct i3c_device *i3cdev,
192 void *data)196 void *data)
193{197{
include/linux/i3c/master.h+5−0
@@ -71,6 +71,9 @@ struct i2c_dev_boardinfo { · 70 unmodified lines
71 * @common: common part of the I2C device descriptor71 * @common: common part of the I2C device descriptor
72 * @boardinfo: pointer to the boardinfo attached to this I2C device72 * @boardinfo: pointer to the boardinfo attached to this I2C device
73 * @dev: I2C device object registered to the I2C framework73 * @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
74 *77 *
75 * Each I2C device connected on the bus will have an i2c_dev_desc.78 * Each I2C device connected on the bus will have an i2c_dev_desc.
76 * This object is created by the core and later attached to the controller79 * This object is created by the core and later attached to the controller
@@ -84,6 +87,8 @@ struct i2c_dev_desc { · 7 unmodified lines
84 struct i3c_i2c_dev_desc common;87 struct i3c_i2c_dev_desc common;
85 const struct i2c_dev_boardinfo *boardinfo;88 const struct i2c_dev_boardinfo *boardinfo;
86 struct i2c_client *dev;89 struct i2c_client *dev;
90 u16 addr;
91 u8 lvr;
87};92};
88 93
89/**94/**
include/linux/idle_inject.h+4−4
@@ -20,10 +20,10 @@ int idle_inject_start(struct idle_inject_device *ii_dev); · 19 unmodified lines
20void idle_inject_stop(struct idle_inject_device *ii_dev);20void idle_inject_stop(struct idle_inject_device *ii_dev);
21 21
22void idle_inject_set_duration(struct idle_inject_device *ii_dev,22void idle_inject_set_duration(struct idle_inject_device *ii_dev,
23 unsigned int run_duration_ms,23 unsigned int run_duration_us,
24 unsigned int idle_duration_ms);24 unsigned int idle_duration_us);
25 25
26void idle_inject_get_duration(struct idle_inject_device *ii_dev,26void idle_inject_get_duration(struct idle_inject_device *ii_dev,
27 unsigned int *run_duration_ms,27 unsigned int *run_duration_us,
28 unsigned int *idle_duration_ms);28 unsigned int *idle_duration_us);
29#endif /* __IDLE_INJECT_H__ */29#endif /* __IDLE_INJECT_H__ */
include/linux/ieee80211.h+61−2
@@ -881,6 +881,14 @@ struct ieee80211_tpc_report_ie { · 880 unmodified lines
881 u8 link_margin;881 u8 link_margin;
882} __packed;882} __packed;
883 883
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
888struct ieee80211_addba_ext_ie {
889 u8 data;
890} __packed;
891
884struct ieee80211_mgmt {892struct ieee80211_mgmt {
885 __le16 frame_control;893 __le16 frame_control;
886 __le16 duration;894 __le16 duration;
@@ -973,6 +981,8 @@ struct ieee80211_mgmt { · 86 unmodified lines
973 __le16 capab;981 __le16 capab;
974 __le16 timeout;982 __le16 timeout;
975 __le16 start_seq_num;983 __le16 start_seq_num;
984 /* followed by BA Extension */
985 u8 variable[0];
976 } __packed addba_req;986 } __packed addba_req;
977 struct{987 struct{
978 u8 action_code;988 u8 action_code;
@@ -1625,6 +1635,18 @@ struct ieee80211_he_operation { · 646 unmodified lines
1625 u8 optional[0];1635 u8 optional[0];
1626} __packed;1636} __packed;
1627 1637
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 */
1644struct 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
1628/**1650/**
1629 * struct ieee80211_he_mu_edca_param_ac_rec - MU AC Parameter Record field1651 * struct ieee80211_he_mu_edca_param_ac_rec - MU AC Parameter Record field
1630 *1652 *
@@ -2033,8 +2055,8 @@ ieee80211_he_ppe_size(u8 ppe_thres_hdr, const u8 *phy_cap_info) · 402 unmodified lines
2033 * ieee80211_he_oper_size - calculate 802.11ax HE Operations IE size2055 * ieee80211_he_oper_size - calculate 802.11ax HE Operations IE size
2034 * @he_oper_ie: byte data of the He Operations IE, stating from the the byte2056 * @he_oper_ie: byte data of the He Operations IE, stating from the the byte
2035 * after the ext ID byte. It is assumed that he_oper_ie has at least2057 * after the ext ID byte. It is assumed that he_oper_ie has at least
2036 * sizeof(struct ieee80211_he_operation) bytes, checked already in2058 * sizeof(struct ieee80211_he_operation) bytes, the caller must have
2037 * ieee802_11_parse_elems_crc()2059 * validated this.
2038 * @return the actual size of the IE data (not including header), or 0 on error2060 * @return the actual size of the IE data (not including header), or 0 on error
2039 */2061 */
2040static inline u82062static inline u8
@@ -2063,6 +2085,42 @@ ieee80211_he_oper_size(const u8 *he_oper_ie) · 22 unmodified lines
2063 return oper_len;2085 return oper_len;
2064}2086}
2065 2087
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 */
2100static inline u8
2101ieee80211_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
2066/* Authentication algorithms */2124/* Authentication algorithms */
2067#define WLAN_AUTH_OPEN 02125#define WLAN_AUTH_OPEN 0
2068#define WLAN_AUTH_SHARED_KEY 12126#define WLAN_AUTH_SHARED_KEY 1
@@ -2485,6 +2543,7 @@ enum ieee80211_eid_ext { · 416 unmodified lines
2485 WLAN_EID_EXT_HE_OPERATION = 36,2543 WLAN_EID_EXT_HE_OPERATION = 36,
2486 WLAN_EID_EXT_UORA = 37,2544 WLAN_EID_EXT_UORA = 37,
2487 WLAN_EID_EXT_HE_MU_EDCA = 38,2545 WLAN_EID_EXT_HE_MU_EDCA = 38,
2546 WLAN_EID_EXT_HE_SPR = 39,
2488 WLAN_EID_EXT_MAX_CHANNEL_SWITCH_TIME = 52,2547 WLAN_EID_EXT_MAX_CHANNEL_SWITCH_TIME = 52,
2489 WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION = 55,2548 WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION = 55,
2490 WLAN_EID_EXT_NON_INHERITANCE = 56,2549 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
80extern void unregister_pppox_proto(int proto_num);80extern void unregister_pppox_proto(int proto_num);
81extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */81extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
82extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);82extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
83extern int pppox_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
84
85#define PPPOEIOCSFWD32 _IOW(0xB1 ,0, compat_size_t)
83 86
84/* PPPoX socket states */87/* PPPoX socket states */
85enum {88enum {
include/linux/if_rmnet.h+2−2
@@ -41,11 +41,11 @@ struct rmnet_map_ul_csum_header { · 40 unmodified lines
41 __be16 csum_start_offset;41 __be16 csum_start_offset;
42#if defined(__LITTLE_ENDIAN_BITFIELD)42#if defined(__LITTLE_ENDIAN_BITFIELD)
43 u16 csum_insert_offset:14;43 u16 csum_insert_offset:14;
44 u16 udp_ip4_ind:1;44 u16 udp_ind:1;
45 u16 csum_enabled:1;45 u16 csum_enabled:1;
46#elif defined (__BIG_ENDIAN_BITFIELD)46#elif defined (__BIG_ENDIAN_BITFIELD)
47 u16 csum_enabled:1;47 u16 csum_enabled:1;
48 u16 udp_ip4_ind:1;48 u16 udp_ind:1;
49 u16 csum_insert_offset:14;49 u16 csum_insert_offset:14;
50#else50#else
51#error "Please fix <asm/byteorder.h>"51#error "Please fix <asm/byteorder.h>"
include/linux/iio/common/cros_ec_sensors_core.h+28−3
@@ -10,7 +10,8 @@ · 9 unmodified lines
10 10
11#include <linux/iio/iio.h>11#include <linux/iio/iio.h>
12#include <linux/irqreturn.h>12#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>
14 15
15enum {16enum {
16 CROS_EC_SENSOR_X,17 CROS_EC_SENSOR_X,
@@ -62,14 +63,20 @@ struct cros_ec_sensors_core_state { · 45 unmodified lines
62 enum motionsensor_type type;63 enum motionsensor_type type;
63 enum motionsensor_location loc;64 enum motionsensor_location loc;
64 65
65 s16 calib[CROS_EC_SENSOR_MAX_AXIS];66 struct calib_data {
66 67 s16 offset;
68 u16 scale;
69 } calib[CROS_EC_SENSOR_MAX_AXIS];
70 s8 sign[CROS_EC_SENSOR_MAX_AXIS];
67 u8 samples[CROS_EC_SAMPLE_SIZE];71 u8 samples[CROS_EC_SAMPLE_SIZE];
68 72
69 int (*read_ec_sensors_data)(struct iio_dev *indio_dev,73 int (*read_ec_sensors_data)(struct iio_dev *indio_dev,
70 unsigned long scan_mask, s16 *data);74 unsigned long scan_mask, s16 *data);
71 75
72 int curr_sampl_freq;76 int curr_sampl_freq;
77
78 /* Table of known available frequencies : 0, Min and Max in mHz */
79 int frequencies[3];
73};80};
74 81
75/**82/**
@@ -150,6 +157,24 @@ int cros_ec_sensors_core_read(struct cros_ec_sensors_core_state *st, · 74 unmodified lines
150 struct iio_chan_spec const *chan,157 struct iio_chan_spec const *chan,
151 int *val, int *val2, long mask);158 int *val, int *val2, long mask);
152 159
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 */
171int 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
153/**178/**
154 * cros_ec_sensors_core_write() - function to write a value to the sensor179 * cros_ec_sensors_core_write() - function to write a value to the sensor
155 * @st: pointer to state information for device180 * @st: pointer to state information for device
include/linux/iio/common/st_sensors.h+19−47
@@ -16,11 +16,16 @@ · 15 unmodified lines
16#include <linux/iio/trigger.h>16#include <linux/iio/trigger.h>
17#include <linux/bitops.h>17#include <linux/bitops.h>
18#include <linux/regulator/consumer.h>18#include <linux/regulator/consumer.h>
19#include <linux/regmap.h>
19 20
20#include <linux/platform_data/st_sensors_pdata.h>21#include <linux/platform_data/st_sensors_pdata.h>
21 22
22#define ST_SENSORS_TX_MAX_LENGTH 223/*
23#define ST_SENSORS_RX_MAX_LENGTH 624 * 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))
24 29
25#define ST_SENSORS_ODR_LIST_MAX 1030#define ST_SENSORS_ODR_LIST_MAX 10
26#define ST_SENSORS_FULLSCALE_AVL_MAX 1031#define ST_SENSORS_FULLSCALE_AVL_MAX 10
@@ -169,36 +174,6 @@ struct st_sensor_data_ready_irq { · 142 unmodified lines
169 } ig1;174 } ig1;
170};175};
171 176
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 */
180struct 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 */
192struct 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
202/**177/**
203 * struct st_sensor_settings - ST specific sensor settings178 * struct st_sensor_settings - ST specific sensor settings
204 * @wai: Contents of WhoAmI register.179 * @wai: Contents of WhoAmI register.
@@ -242,19 +217,17 @@ struct st_sensor_settings { · 37 unmodified lines
242 * @current_fullscale: Maximum range of measure by the sensor.217 * @current_fullscale: Maximum range of measure by the sensor.
243 * @vdd: Pointer to sensor's Vdd power supply218 * @vdd: Pointer to sensor's Vdd power supply
244 * @vdd_io: Pointer to sensor's Vdd-IO power supply219 * @vdd_io: Pointer to sensor's Vdd-IO power supply
220 * @regmap: Pointer to specific sensor regmap configuration.
245 * @enabled: Status of the sensor (false->off, true->on).221 * @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.
248 * @odr: Output data rate of the sensor [Hz].222 * @odr: Output data rate of the sensor [Hz].
249 * num_data_channels: Number of data channels used in buffer.223 * num_data_channels: Number of data channels used in buffer.
250 * @drdy_int_pin: Redirect DRDY on pin 1 (1) or pin 2 (2).224 * @drdy_int_pin: Redirect DRDY on pin 1 (1) or pin 2 (2).
251 * @int_pin_open_drain: Set the interrupt/DRDY to open drain.225 * @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.226 * @irq: the IRQ number.
253 * @tf: Transfer function structure used by I/O operations.
254 * @tb: Transfer buffers and mutex used by I/O operations.
255 * @edge_irq: the IRQ triggers on edges and need special handling.227 * @edge_irq: the IRQ triggers on edges and need special handling.
256 * @hw_irq_trigger: if we're using the hardware interrupt on the sensor.228 * @hw_irq_trigger: if we're using the hardware interrupt on the sensor.
257 * @hw_timestamp: Latest timestamp from the interrupt handler, when in use.229 * @hw_timestamp: Latest timestamp from the interrupt handler, when in use.
230 * @buffer_data: Data used by buffer part.
258 */231 */
259struct st_sensor_data {232struct st_sensor_data {
260 struct device *dev;233 struct device *dev;
@@ -264,26 +237,22 @@ struct st_sensor_data { · 3 unmodified lines
264 struct st_sensor_fullscale_avl *current_fullscale;237 struct st_sensor_fullscale_avl *current_fullscale;
265 struct regulator *vdd;238 struct regulator *vdd;
266 struct regulator *vdd_io;239 struct regulator *vdd_io;
240 struct regmap *regmap;
267 241
268 bool enabled;242 bool enabled;
269 bool multiread_bit;
270
271 char *buffer_data;
272 243
273 unsigned int odr;244 unsigned int odr;
274 unsigned int num_data_channels;245 unsigned int num_data_channels;
275 246
276 u8 drdy_int_pin;247 u8 drdy_int_pin;
277 bool int_pin_open_drain;248 bool int_pin_open_drain;
278 249 int irq;
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;
283 250
284 bool edge_irq;251 bool edge_irq;
285 bool hw_irq_trigger;252 bool hw_irq_trigger;
286 s64 hw_timestamp;253 s64 hw_timestamp;
254
255 char buffer_data[ST_SENSORS_MAX_BUFFER_SIZE] ____cacheline_aligned;
287};256};
288 257
289#ifdef CONFIG_IIO_BUFFER258#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
334int st_sensors_read_info_raw(struct iio_dev *indio_dev,303int st_sensors_read_info_raw(struct iio_dev *indio_dev,
335 struct iio_chan_spec const *ch, int *val);304 struct iio_chan_spec const *ch, int *val);
336 305
337int st_sensors_check_device_support(struct iio_dev *indio_dev,306int st_sensors_get_settings_index(const char *name,
338 int num_sensors_list, const struct st_sensor_settings *sensor_settings);307 const struct st_sensor_settings *list,
308 const int list_length);
309
310int st_sensors_verify_id(struct iio_dev *indio_dev);
339 311
340ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev,312ssize_t st_sensors_sysfs_sampling_frequency_avail(struct device *dev,
341 struct device_attribute *attr, char *buf);313 struct device_attribute *attr, char *buf);
include/linux/iio/common/st_sensors_i2c.h+2−2
@@ -14,8 +14,8 @@ · 13 unmodified lines
14#include <linux/iio/common/st_sensors.h>14#include <linux/iio/common/st_sensors.h>
15#include <linux/of.h>15#include <linux/of.h>
16 16
17void st_sensors_i2c_configure(struct iio_dev *indio_dev,17int st_sensors_i2c_configure(struct iio_dev *indio_dev,
18 struct i2c_client *client, struct st_sensor_data *sdata);18 struct i2c_client *client);
19 19
20#ifdef CONFIG_ACPI20#ifdef CONFIG_ACPI
21int st_sensors_match_acpi_device(struct device *dev);21int 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
13#include <linux/spi/spi.h>13#include <linux/spi/spi.h>
14#include <linux/iio/common/st_sensors.h>14#include <linux/iio/common/st_sensors.h>
15 15
16void st_sensors_spi_configure(struct iio_dev *indio_dev,16int st_sensors_spi_configure(struct iio_dev *indio_dev,
17 struct spi_device *spi, struct st_sensor_data *sdata);17 struct spi_device *spi);
18 18
19#endif /* ST_SENSORS_SPI_H */19#endif /* ST_SENSORS_SPI_H */
include/linux/iio/imu/adis.h+2−0
@@ -26,6 +26,7 @@ struct adis_burst; · 25 unmodified lines
26 * struct adis_data - ADIS chip variant specific data26 * struct adis_data - ADIS chip variant specific data
27 * @read_delay: SPI delay for read operations in us27 * @read_delay: SPI delay for read operations in us
28 * @write_delay: SPI delay for write operations in us28 * @write_delay: SPI delay for write operations in us
29 * @cs_change_delay: SPI delay between CS changes in us
29 * @glob_cmd_reg: Register address of the GLOB_CMD register30 * @glob_cmd_reg: Register address of the GLOB_CMD register
30 * @msc_ctrl_reg: Register address of the MSC_CTRL register31 * @msc_ctrl_reg: Register address of the MSC_CTRL register
31 * @diag_stat_reg: Register address of the DIAG_STAT register32 * @diag_stat_reg: Register address of the DIAG_STAT register
@@ -35,6 +36,7 @@ struct adis_burst; · 3 unmodified lines
35struct adis_data {36struct adis_data {
36 unsigned int read_delay;37 unsigned int read_delay;
37 unsigned int write_delay;38 unsigned int write_delay;
39 unsigned int cs_change_delay;
38 40
39 unsigned int glob_cmd_reg;41 unsigned int glob_cmd_reg;
40 unsigned int msc_ctrl_reg;42 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
131 return 0;131 return 0;
132}132}
133#endif /* CONFIG_IMA_APPRAISE */133#endif /* CONFIG_IMA_APPRAISE */
134
135#if defined(CONFIG_IMA_APPRAISE) && defined(CONFIG_INTEGRITY_TRUSTED_KEYRING)
136extern bool ima_appraise_signature(enum kernel_read_file_id func);
137#else
138static 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 */
134#endif /* _LINUX_IMA_H */143#endif /* _LINUX_IMA_H */
include/linux/init_task.h+0−11
@@ -36,17 +36,6 @@ extern struct cred init_cred; · 35 unmodified lines
36#define INIT_PREV_CPUTIME(x)36#define INIT_PREV_CPUTIME(x)
37#endif37#endif
38 38
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
50#define INIT_TASK_COMM "swapper"39#define INIT_TASK_COMM "swapper"
51 40
52/* Attach to the init_task data structure for proper alignment */41/* Attach to the init_task data structure for proper alignment */
include/linux/input.h+26−0
@@ -21,6 +21,8 @@ · 20 unmodified lines
21#include <linux/timer.h>21#include <linux/timer.h>
22#include <linux/mod_devicetable.h>22#include <linux/mod_devicetable.h>
23 23
24struct input_dev_poller;
25
24/**26/**
25 * struct input_value - input value representation27 * struct input_value - input value representation
26 * @type: type of value (EV_KEY, EV_ABS, etc)28 * @type: type of value (EV_KEY, EV_ABS, etc)
@@ -33,6 +35,13 @@ struct input_value { · 6 unmodified lines
33 __s32 value;35 __s32 value;
34};36};
35 37
38enum input_clock_type {
39 INPUT_CLK_REAL = 0,
40 INPUT_CLK_MONO,
41 INPUT_CLK_BOOT,
42 INPUT_CLK_MAX
43};
44
36/**45/**
37 * struct input_dev - represents an input device46 * struct input_dev - represents an input device
38 * @name: name of the device47 * @name: name of the device
@@ -64,6 +73,8 @@ struct input_value { · 25 unmodified lines
64 * not sleep73 * not sleep
65 * @ff: force feedback structure associated with the device if device74 * @ff: force feedback structure associated with the device if device
66 * supports force feedback effects75 * supports force feedback effects
76 * @poller: poller structure associated with the device if device is
77 * set up to use polling mode
67 * @repeat_key: stores key code of the last key pressed; used to implement78 * @repeat_key: stores key code of the last key pressed; used to implement
68 * software autorepeat79 * software autorepeat
69 * @timer: timer for software autorepeat80 * @timer: timer for software autorepeat
@@ -114,6 +125,8 @@ struct input_value { · 44 unmodified lines
114 * @vals: array of values queued in the current frame125 * @vals: array of values queued in the current frame
115 * @devres_managed: indicates that devices is managed with devres framework126 * @devres_managed: indicates that devices is managed with devres framework
116 * and needs not be explicitly unregistered or freed.127 * and needs not be explicitly unregistered or freed.
128 * @timestamp: storage for a timestamp set by input_set_timestamp called
129 * by a driver
117 */130 */
118struct input_dev {131struct input_dev {
119 const char *name;132 const char *name;
@@ -147,6 +160,8 @@ struct input_dev { · 27 unmodified lines
147 160
148 struct ff_device *ff;161 struct ff_device *ff;
149 162
163 struct input_dev_poller *poller;
164
150 unsigned int repeat_key;165 unsigned int repeat_key;
151 struct timer_list timer;166 struct timer_list timer;
152 167
@@ -184,6 +199,8 @@ struct input_dev { · 31 unmodified lines
184 struct input_value *vals;199 struct input_value *vals;
185 200
186 bool devres_managed;201 bool devres_managed;
202
203 ktime_t timestamp[INPUT_CLK_MAX];
187};204};
188#define to_input_dev(d) container_of(d, struct input_dev, dev)205#define to_input_dev(d) container_of(d, struct input_dev, dev)
189 206
@@ -361,6 +378,12 @@ void input_unregister_device(struct input_dev *); · 171 unmodified lines
361 378
362void input_reset_device(struct input_dev *);379void input_reset_device(struct input_dev *);
363 380
381int input_setup_polling(struct input_dev *dev,
382 void (*poll_fn)(struct input_dev *dev));
383void input_set_poll_interval(struct input_dev *dev, unsigned int interval);
384void input_set_min_poll_interval(struct input_dev *dev, unsigned int interval);
385void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval);
386
364int __must_check input_register_handler(struct input_handler *);387int __must_check input_register_handler(struct input_handler *);
365void input_unregister_handler(struct input_handler *);388void input_unregister_handler(struct input_handler *);
366 389
@@ -382,6 +405,9 @@ void input_close_device(struct input_handle *); · 15 unmodified lines
382 405
383int input_flush_device(struct input_handle *handle, struct file *file);406int input_flush_device(struct input_handle *handle, struct file *file);
384 407
408void input_set_timestamp(struct input_dev *dev, ktime_t timestamp);
409ktime_t *input_get_timestamp(struct input_dev *dev);
410
385void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);411void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
386void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value);412void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value);
387 413
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 */
23struct 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
48 { "ELAN0618", 0 },48 { "ELAN0618", 0 },
49 { "ELAN0619", 0 },49 { "ELAN0619", 0 },
50 { "ELAN061A", 0 },50 { "ELAN061A", 0 },
51 { "ELAN061B", 0 },51/* { "ELAN061B", 0 }, not working on the Lenovo Legion Y7000 */
52 { "ELAN061C", 0 },52 { "ELAN061C", 0 },
53 { "ELAN061D", 0 },53 { "ELAN061D", 0 },
54 { "ELAN061E", 0 },54 { "ELAN061E", 0 },
include/linux/intel-iommu.h+2−3
@@ -272,6 +272,8 @@ · 271 unmodified lines
272#define dma_frcd_type(d) ((d >> 30) & 1)272#define dma_frcd_type(d) ((d >> 30) & 1)
273#define dma_frcd_fault_reason(c) (c & 0xff)273#define dma_frcd_fault_reason(c) (c & 0xff)
274#define dma_frcd_source_id(c) (c & 0xffff)274#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)
275/* low 64 bit */277/* low 64 bit */
276#define dma_frcd_page_addr(d) (d & (((u64)-1) << PAGE_SHIFT))278#define dma_frcd_page_addr(d) (d & (((u64)-1) << PAGE_SHIFT))
277 279
@@ -346,7 +348,6 @@ enum { · 68 unmodified lines
346#define QI_PC_PASID_SEL (QI_PC_TYPE | QI_PC_GRAN(1))348#define QI_PC_PASID_SEL (QI_PC_TYPE | QI_PC_GRAN(1))
347 349
348#define QI_EIOTLB_ADDR(addr) ((u64)(addr) & VTD_PAGE_MASK)350#define QI_EIOTLB_ADDR(addr) ((u64)(addr) & VTD_PAGE_MASK)
349#define QI_EIOTLB_GL(gl) (((u64)gl) << 7)
350#define QI_EIOTLB_IH(ih) (((u64)ih) << 6)351#define QI_EIOTLB_IH(ih) (((u64)ih) << 6)
351#define QI_EIOTLB_AM(am) (((u64)am))352#define QI_EIOTLB_AM(am) (((u64)am))
352#define QI_EIOTLB_PASID(pasid) (((u64)pasid) << 32)353#define QI_EIOTLB_PASID(pasid) (((u64)pasid) << 32)
@@ -378,8 +379,6 @@ enum { · 25 unmodified lines
378#define QI_RESP_INVALID 0x1379#define QI_RESP_INVALID 0x1
379#define QI_RESP_FAILURE 0xf380#define QI_RESP_FAILURE 0xf
380 381
381#define QI_GRAN_ALL_ALL 0
382#define QI_GRAN_NONG_ALL 1
383#define QI_GRAN_NONG_PASID 2382#define QI_GRAN_NONG_PASID 2
384#define QI_GRAN_PSI_PASID 3383#define QI_GRAN_PSI_PASID 3
385 384
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) */
14enum {
15 MSC_MODE_SINGLE = 0,
16 MSC_MODE_MULTI,
17 MSC_MODE_EXI,
18 MSC_MODE_DEBUG,
19};
20
21struct 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
62int intel_th_msu_buffer_register(const struct msu_buffer *mbuf,
63 struct module *owner);
64void intel_th_msu_buffer_unregister(const struct msu_buffer *mbuf);
65void intel_th_msc_window_unlock(struct device *dev, struct sg_table *sgt);
66
67#define module_intel_th_msu_buffer(__buffer) \
68static int __init __buffer##_init(void) \
69{ \
70 return intel_th_msu_buffer_register(&(__buffer), THIS_MODULE); \
71} \
72module_init(__buffer##_init); \
73static void __exit __buffer##_exit(void) \
74{ \
75 intel_th_msu_buffer_unregister(&(__buffer)); \
76} \
77module_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
36 * @nodes: internal list of the interconnect provider nodes36 * @nodes: internal list of the interconnect provider nodes
37 * @set: pointer to device specific set operation function37 * @set: pointer to device specific set operation function
38 * @aggregate: pointer to device specific aggregate operation function38 * @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)
39 * @xlate: provider-specific callback for mapping nodes from phandle arguments41 * @xlate: provider-specific callback for mapping nodes from phandle arguments
40 * @dev: the device this interconnect provider belongs to42 * @dev: the device this interconnect provider belongs to
41 * @users: count of active users43 * @users: count of active users
@@ -45,8 +47,9 @@ struct icc_provider { · 3 unmodified lines
45 struct list_head provider_list;47 struct list_head provider_list;
46 struct list_head nodes;48 struct list_head nodes;
47 int (*set)(struct icc_node *src, struct icc_node *dst);49 int (*set)(struct icc_node *src, struct icc_node *dst);
48 int (*aggregate)(struct icc_node *node, u32 avg_bw, u32 peak_bw,50 int (*aggregate)(struct icc_node *node, u32 tag, u32 avg_bw,
49 u32 *agg_avg, u32 *agg_peak);51 u32 peak_bw, u32 *agg_avg, u32 *agg_peak);
52 void (*pre_aggregate)(struct icc_node *node);
50 struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data);53 struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data);
51 struct device *dev;54 struct device *dev;
52 int users;55 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
30struct icc_path *of_icc_get(struct device *dev, const char *name);30struct icc_path *of_icc_get(struct device *dev, const char *name);
31void icc_put(struct icc_path *path);31void icc_put(struct icc_path *path);
32int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw);32int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw);
33void icc_set_tag(struct icc_path *path, u32 tag);
33 34
34#else35#else
35 36
@@ -54,6 +55,10 @@ static inline int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw) · 18 unmodified lines
54 return 0;55 return 0;
55}56}
56 57
58static inline void icc_set_tag(struct icc_path *path, u32 tag)
59{
60}
61
57#endif /* CONFIG_INTERCONNECT */62#endif /* CONFIG_INTERCONNECT */
58 63
59#endif /* __LINUX_INTERCONNECT_H */64#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
238/* The following three functions are for the core kernel use only. */238/* The following three functions are for the core kernel use only. */
239extern void suspend_device_irqs(void);239extern void suspend_device_irqs(void);
240extern void resume_device_irqs(void);240extern void resume_device_irqs(void);
241extern void rearm_wake_irq(unsigned int irq);
241 242
242/**243/**
243 * struct irq_affinity_notify - context for notification of IRQ affinity changes244 * 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
472 bool state);473 bool state);
473 474
474#ifdef CONFIG_IRQ_FORCED_THREADING475#ifdef CONFIG_IRQ_FORCED_THREADING
476# ifdef CONFIG_PREEMPT_RT
477# define force_irqthreads (true)
478# else
475extern bool force_irqthreads;479extern bool force_irqthreads;
480# endif
476#else481#else
477#define force_irqthreads (0)482#define force_irqthreads (0)
478#endif483#endif
include/linux/interval_tree_generic.h+2−20
@@ -30,26 +30,8 @@ · 29 unmodified lines
30 \30 \
31/* Callbacks for augmented rbtree insert and remove */ \31/* Callbacks for augmented rbtree insert and remove */ \
32 \32 \
33static inline ITTYPE ITPREFIX ## _compute_subtree_last(ITSTRUCT *node) \33RB_DECLARE_CALLBACKS_MAX(static, ITPREFIX ## _augment, \
34{ \34 ITSTRUCT, ITRB, ITTYPE, ITSUBTREE, ITLAST) \
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 \
51RB_DECLARE_CALLBACKS(static, ITPREFIX ## _augment, ITSTRUCT, ITRB, \
52 ITTYPE, ITSUBTREE, ITPREFIX ## _compute_subtree_last) \
53 \35 \
54/* Insert / remove interval nodes from the tree */ \36/* Insert / remove interval nodes from the tree */ \
55 \37 \
include/linux/io-pgtable.h+44−22
@@ -1,7 +1,9 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __IO_PGTABLE_H2#ifndef __IO_PGTABLE_H
3#define __IO_PGTABLE_H3#define __IO_PGTABLE_H
4
4#include <linux/bitops.h>5#include <linux/bitops.h>
6#include <linux/iommu.h>
5 7
6/*8/*
7 * Public API for use by IOMMU drivers9 * Public API for use by IOMMU drivers
@@ -17,22 +19,31 @@ enum io_pgtable_fmt { · 9 unmodified lines
17};19};
18 20
19/**21/**
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.
21 *23 *
22 * @tlb_flush_all: Synchronously invalidate the entire TLB context.24 * @tlb_flush_all: Synchronously invalidate the entire TLB context.
23 * @tlb_add_flush: Queue up a TLB invalidation for a virtual address range.25 * @tlb_flush_walk: Synchronously invalidate all intermediate TLB state
24 * @tlb_sync: Ensure any queued TLB invalidation has taken effect, and26 * (sometimes referred to as the "walk cache") for a virtual
25 * any corresponding page table updates are visible to the27 * address range.
26 * IOMMU.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.
27 *35 *
28 * Note that these can all be called in atomic context and must therefore36 * Note that these can all be called in atomic context and must therefore
29 * not block.37 * not block.
30 */38 */
31struct iommu_gather_ops {39struct iommu_flush_ops {
32 void (*tlb_flush_all)(void *cookie);40 void (*tlb_flush_all)(void *cookie);
33 void (*tlb_add_flush)(unsigned long iova, size_t size, size_t granule,41 void (*tlb_flush_walk)(unsigned long iova, size_t size, size_t granule,
34 bool leaf, void *cookie);42 void *cookie);
35 void (*tlb_sync)(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);
36};47};
37 48
38/**49/**
@@ -65,10 +76,9 @@ struct io_pgtable_cfg { · 26 unmodified lines
65 * (unmapped) entries but the hardware might do so anyway, perform76 * (unmapped) entries but the hardware might do so anyway, perform
66 * TLB maintenance when mapping as well as when unmapping.77 * TLB maintenance when mapping as well as when unmapping.
67 *78 *
68 * IO_PGTABLE_QUIRK_ARM_MTK_4GB: (ARM v7s format) Set bit 9 in all79 * IO_PGTABLE_QUIRK_ARM_MTK_EXT: (ARM v7s format) MediaTek IOMMUs extend
69 * PTEs, for Mediatek IOMMUs which treat it as a 33rd address bit80 * to support up to 34 bits PA where the bit32 and bit33 are
70 * when the SoC is in "4GB mode" and they can only access the high81 * encoded in the bit9 and bit4 of the PTE respectively.
71 * remap of DRAM (0x1_00000000 to 0x1_ffffffff).
72 *82 *
73 * IO_PGTABLE_QUIRK_NON_STRICT: Skip issuing synchronous leaf TLBIs83 * IO_PGTABLE_QUIRK_NON_STRICT: Skip issuing synchronous leaf TLBIs
74 * on unmap, for DMA domains using the flush queue mechanism for84 * on unmap, for DMA domains using the flush queue mechanism for
@@ -77,14 +87,14 @@ struct io_pgtable_cfg { · 2 unmodified lines
77 #define IO_PGTABLE_QUIRK_ARM_NS BIT(0)87 #define IO_PGTABLE_QUIRK_ARM_NS BIT(0)
78 #define IO_PGTABLE_QUIRK_NO_PERMS BIT(1)88 #define IO_PGTABLE_QUIRK_NO_PERMS BIT(1)
79 #define IO_PGTABLE_QUIRK_TLBI_ON_MAP BIT(2)89 #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)
81 #define IO_PGTABLE_QUIRK_NON_STRICT BIT(4)91 #define IO_PGTABLE_QUIRK_NON_STRICT BIT(4)
82 unsigned long quirks;92 unsigned long quirks;
83 unsigned long pgsize_bitmap;93 unsigned long pgsize_bitmap;
84 unsigned int ias;94 unsigned int ias;
85 unsigned int oas;95 unsigned int oas;
86 bool coherent_walk;96 bool coherent_walk;
87 const struct iommu_gather_ops *tlb;97 const struct iommu_flush_ops *tlb;
88 struct device *iommu_dev;98 struct device *iommu_dev;
89 99
90 /* Low-level data specific to the table format */100 /* Low-level data specific to the table format */
@@ -128,7 +138,7 @@ struct io_pgtable_ops { · 37 unmodified lines
128 int (*map)(struct io_pgtable_ops *ops, unsigned long iova,138 int (*map)(struct io_pgtable_ops *ops, unsigned long iova,
129 phys_addr_t paddr, size_t size, int prot);139 phys_addr_t paddr, size_t size, int prot);
130 size_t (*unmap)(struct io_pgtable_ops *ops, unsigned long iova,140 size_t (*unmap)(struct io_pgtable_ops *ops, unsigned long iova,
131 size_t size);141 size_t size, struct iommu_iotlb_gather *gather);
132 phys_addr_t (*iova_to_phys)(struct io_pgtable_ops *ops,142 phys_addr_t (*iova_to_phys)(struct io_pgtable_ops *ops,
133 unsigned long iova);143 unsigned long iova);
134};144};
@@ -184,15 +194,27 @@ static inline void io_pgtable_tlb_flush_all(struct io_pgtable *iop) · 49 unmodified lines
184 iop->cfg.tlb->tlb_flush_all(iop->cookie);194 iop->cfg.tlb->tlb_flush_all(iop->cookie);
185}195}
186 196
187static inline void io_pgtable_tlb_add_flush(struct io_pgtable *iop,197static inline void
188 unsigned long iova, size_t size, size_t granule, bool leaf)198io_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
204static inline void
205io_pgtable_tlb_flush_leaf(struct io_pgtable *iop, unsigned long iova,
206 size_t size, size_t granule)
189{207{
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);
191}209}
192 210
193static inline void io_pgtable_tlb_sync(struct io_pgtable *iop)211static inline void
212io_pgtable_tlb_add_page(struct io_pgtable *iop,
213 struct iommu_iotlb_gather * gather, unsigned long iova,
214 size_t granule)
194{215{
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);
196}218}
197 219
198/**220/**
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 */
31struct 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 */
155struct 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 */
167struct 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
181extern int ioc4_register_submodule(struct ioc4_submodule *);
182extern 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
188 */188 */
189#define IOMAP_DIO_UNWRITTEN (1 << 0) /* covers unwritten extent(s) */189#define IOMAP_DIO_UNWRITTEN (1 << 0) /* covers unwritten extent(s) */
190#define IOMAP_DIO_COW (1 << 1) /* covers COW extent(s) */190#define IOMAP_DIO_COW (1 << 1) /* covers COW extent(s) */
191typedef int (iomap_dio_end_io_t)(struct kiocb *iocb, ssize_t ret,191
192 unsigned flags);192struct iomap_dio_ops {
193 int (*end_io)(struct kiocb *iocb, ssize_t size, int error,
194 unsigned flags);
195};
196
193ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,197ssize_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);
195int iomap_dio_iopoll(struct kiocb *kiocb, bool spin);199int iomap_dio_iopoll(struct kiocb *kiocb, bool spin);
196 200
197#ifdef CONFIG_SWAP201#ifdef CONFIG_SWAP
include/linux/iommu.h+88−20
@@ -191,6 +191,23 @@ struct iommu_sva_ops { · 190 unmodified lines
191 191
192#ifdef CONFIG_IOMMU_API192#ifdef CONFIG_IOMMU_API
193 193
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 */
205struct iommu_iotlb_gather {
206 unsigned long start;
207 unsigned long end;
208 size_t pgsize;
209};
210
194/**211/**
195 * struct iommu_ops - iommu ops and capabilities212 * struct iommu_ops - iommu ops and capabilities
196 * @capable: check capability213 * @capable: check capability
@@ -201,7 +218,6 @@ struct iommu_sva_ops { · 4 unmodified lines
201 * @map: map a physically contiguous memory region to an iommu domain218 * @map: map a physically contiguous memory region to an iommu domain
202 * @unmap: unmap a physically contiguous memory region from an iommu domain219 * @unmap: unmap a physically contiguous memory region from an iommu domain
203 * @flush_iotlb_all: Synchronously flush all hardware TLBs for this domain220 * @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
205 * @iotlb_sync_map: Sync mappings created recently using @map to the hardware221 * @iotlb_sync_map: Sync mappings created recently using @map to the hardware
206 * @iotlb_sync: Flush all queued ranges from the hardware TLBs and empty flush222 * @iotlb_sync: Flush all queued ranges from the hardware TLBs and empty flush
207 * queue223 * queue
@@ -242,12 +258,11 @@ struct iommu_ops { · 34 unmodified lines
242 int (*map)(struct iommu_domain *domain, unsigned long iova,258 int (*map)(struct iommu_domain *domain, unsigned long iova,
243 phys_addr_t paddr, size_t size, int prot);259 phys_addr_t paddr, size_t size, int prot);
244 size_t (*unmap)(struct iommu_domain *domain, unsigned long iova,260 size_t (*unmap)(struct iommu_domain *domain, unsigned long iova,
245 size_t size);261 size_t size, struct iommu_iotlb_gather *iotlb_gather);
246 void (*flush_iotlb_all)(struct iommu_domain *domain);262 void (*flush_iotlb_all)(struct iommu_domain *domain);
247 void (*iotlb_range_add)(struct iommu_domain *domain,
248 unsigned long iova, size_t size);
249 void (*iotlb_sync_map)(struct iommu_domain *domain);263 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);
251 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova);266 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova);
252 int (*add_device)(struct device *dev);267 int (*add_device)(struct device *dev);
253 void (*remove_device)(struct device *dev);268 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
378 return (struct iommu_device *)dev_get_drvdata(dev);393 return (struct iommu_device *)dev_get_drvdata(dev);
379}394}
380 395
396static 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
381#define IOMMU_GROUP_NOTIFY_ADD_DEVICE 1 /* Device added */403#define IOMMU_GROUP_NOTIFY_ADD_DEVICE 1 /* Device added */
382#define IOMMU_GROUP_NOTIFY_DEL_DEVICE 2 /* Pre Device removed */404#define IOMMU_GROUP_NOTIFY_DEL_DEVICE 2 /* Pre Device removed */
383#define IOMMU_GROUP_NOTIFY_BIND_DRIVER 3 /* Pre Driver bind */405#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
402extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova,424extern size_t iommu_unmap(struct iommu_domain *domain, unsigned long iova,
403 size_t size);425 size_t size);
404extern size_t iommu_unmap_fast(struct iommu_domain *domain,426extern 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);
406extern size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova,429extern size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
407 struct scatterlist *sg,unsigned int nents, int prot);430 struct scatterlist *sg,unsigned int nents, int prot);
408extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova);431extern 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
413extern void iommu_put_resv_regions(struct device *dev, struct list_head *list);436extern void iommu_put_resv_regions(struct device *dev, struct list_head *list);
414extern int iommu_request_dm_for_dev(struct device *dev);437extern int iommu_request_dm_for_dev(struct device *dev);
415extern int iommu_request_dma_domain_for_dev(struct device *dev);438extern int iommu_request_dma_domain_for_dev(struct device *dev);
439extern void iommu_set_default_passthrough(bool cmd_line);
440extern void iommu_set_default_translated(bool cmd_line);
441extern bool iommu_default_passthrough(void);
416extern struct iommu_resv_region *442extern struct iommu_resv_region *
417iommu_alloc_resv_region(phys_addr_t start, size_t length, int prot,443iommu_alloc_resv_region(phys_addr_t start, size_t length, int prot,
418 enum iommu_resv_type type);444 enum iommu_resv_type type);
@@ -476,17 +502,38 @@ static inline void iommu_flush_tlb_all(struct iommu_domain *domain) · 57 unmodified lines
476 domain->ops->flush_iotlb_all(domain);502 domain->ops->flush_iotlb_all(domain);
477}503}
478 504
479static inline void iommu_tlb_range_add(struct iommu_domain *domain,505static inline void iommu_tlb_sync(struct iommu_domain *domain,
480 unsigned long iova, size_t size)506 struct iommu_iotlb_gather *iotlb_gather)
481{507{
482 if (domain->ops->iotlb_range_add)508 if (domain->ops->iotlb_sync)
483 domain->ops->iotlb_range_add(domain, iova, size);509 domain->ops->iotlb_sync(domain, iotlb_gather);
510
511 iommu_iotlb_gather_init(iotlb_gather);
484}512}
485 513
486static inline void iommu_tlb_sync(struct iommu_domain *domain)514static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain,
515 struct iommu_iotlb_gather *gather,
516 unsigned long iova, size_t size)
487{517{
488 if (domain->ops->iotlb_sync)518 unsigned long start = iova, end = start + size;
489 domain->ops->iotlb_sync(domain);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;
490}537}
491 538
492/* PCI device grouping function */539/* PCI device grouping function */
@@ -567,6 +614,7 @@ struct iommu_group {}; · 74 unmodified lines
567struct iommu_fwspec {};614struct iommu_fwspec {};
568struct iommu_device {};615struct iommu_device {};
569struct iommu_fault_param {};616struct iommu_fault_param {};
617struct iommu_iotlb_gather {};
570 618
571static inline bool iommu_present(struct bus_type *bus)619static inline bool iommu_present(struct bus_type *bus)
572{620{
@@ -621,7 +669,8 @@ static inline size_t iommu_unmap(struct iommu_domain *domain, · 48 unmodified lines
621}669}
622 670
623static inline size_t iommu_unmap_fast(struct iommu_domain *domain,671static 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)
625{674{
626 return 0;675 return 0;
627}676}
@@ -637,12 +686,8 @@ static inline void iommu_flush_tlb_all(struct iommu_domain *domain) · 9 unmodified lines
637{686{
638}687}
639 688
640static inline void iommu_tlb_range_add(struct iommu_domain *domain,689static inline void iommu_tlb_sync(struct iommu_domain *domain,
641 unsigned long iova, size_t size)690 struct iommu_iotlb_gather *iotlb_gather)
642{
643}
644
645static inline void iommu_tlb_sync(struct iommu_domain *domain)
646{691{
647}692}
648 693
@@ -694,6 +739,19 @@ static inline int iommu_request_dma_domain_for_dev(struct device *dev) · 45 unmodified lines
694 return -ENODEV;739 return -ENODEV;
695}740}
696 741
742static inline void iommu_set_default_passthrough(bool cmd_line)
743{
744}
745
746static inline void iommu_set_default_translated(bool cmd_line)
747{
748}
749
750static inline bool iommu_default_passthrough(void)
751{
752 return true;
753}
754
697static inline int iommu_attach_group(struct iommu_domain *domain,755static inline int iommu_attach_group(struct iommu_domain *domain,
698 struct iommu_group *group)756 struct iommu_group *group)
699{757{
@@ -827,6 +885,16 @@ static inline struct iommu_device *dev_to_iommu_device(struct device *dev) · 127 unmodified lines
827 return NULL;885 return NULL;
828}886}
829 887
888static inline void iommu_iotlb_gather_init(struct iommu_iotlb_gather *gather)
889{
890}
891
892static 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
830static inline void iommu_device_unregister(struct iommu_device *iommu)898static inline void iommu_device_unregister(struct iommu_device *iommu)
831{899{
832}900}
include/linux/ioport.h+2−0
@@ -297,6 +297,8 @@ static inline bool resource_overlaps(struct resource *r1, struct resource *r2) · 296 unmodified lines
297 297
298struct resource *devm_request_free_mem_region(struct device *dev,298struct resource *devm_request_free_mem_region(struct device *dev,
299 struct resource *base, unsigned long size);299 struct resource *base, unsigned long size);
300struct resource *request_free_mem_region(struct resource *base,
301 unsigned long size, const char *name);
300 302
301#endif /* __ASSEMBLY__ */303#endif /* __ASSEMBLY__ */
302#endif /* _LINUX_IOPORT_H */304#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
155void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to);155void copy_reserved_iova(struct iova_domain *from, struct iova_domain *to);
156void init_iova_domain(struct iova_domain *iovad, unsigned long granule,156void init_iova_domain(struct iova_domain *iovad, unsigned long granule,
157 unsigned long start_pfn);157 unsigned long start_pfn);
158bool has_iova_flush_queue(struct iova_domain *iovad);
158int init_iova_flush_queue(struct iova_domain *iovad,159int init_iova_flush_queue(struct iova_domain *iovad,
159 iova_flush_cb flush_cb, iova_entry_dtor entry_dtor);160 iova_flush_cb flush_cb, iova_entry_dtor entry_dtor);
160struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn);161struct 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
235{236{
236}237}
237 238
239static inline bool has_iova_flush_queue(struct iova_domain *iovad)
240{
241 return false;
242}
243
238static inline int init_iova_flush_queue(struct iova_domain *iovad,244static inline int init_iova_flush_queue(struct iova_domain *iovad,
239 iova_flush_cb flush_cb,245 iova_flush_cb flush_cb,
240 iova_entry_dtor entry_dtor)246 iova_entry_dtor entry_dtor)
include/linux/irqchip/arm-gic-v3.h+29−1
@@ -30,10 +30,22 @@ · 29 unmodified lines
30#define GICD_ICFGR 0x0C0030#define GICD_ICFGR 0x0C00
31#define GICD_IGRPMODR 0x0D0031#define GICD_IGRPMODR 0x0D00
32#define GICD_NSACR 0x0E0032#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
33#define GICD_IROUTER 0x600042#define GICD_IROUTER 0x6000
43#define GICD_IROUTERnE 0x8000
34#define GICD_IDREGS 0xFFD044#define GICD_IDREGS 0xFFD0
35#define GICD_PIDR2 0xFFE845#define GICD_PIDR2 0xFFE8
36 46
47#define ESPI_BASE_INTID 4096
48
37/*49/*
38 * Those registers are actually from GICv2, but the spec demands that they50 * Those registers are actually from GICv2, but the spec demands that they
39 * are implemented as RES0 if ARE is 1 (which we do in KVM's emulated GICv3).51 * are implemented as RES0 if ARE is 1 (which we do in KVM's emulated GICv3).
@@ -69,10 +81,13 @@ · 29 unmodified lines
69#define GICD_TYPER_RSS (1U << 26)81#define GICD_TYPER_RSS (1U << 26)
70#define GICD_TYPER_LPIS (1U << 17)82#define GICD_TYPER_LPIS (1U << 17)
71#define GICD_TYPER_MBIS (1U << 16)83#define GICD_TYPER_MBIS (1U << 16)
84#define GICD_TYPER_ESPI (1U << 8)
72 85
73#define GICD_TYPER_ID_BITS(typer) ((((typer) >> 19) & 0x1f) + 1)86#define GICD_TYPER_ID_BITS(typer) ((((typer) >> 19) & 0x1f) + 1)
74#define GICD_TYPER_NUM_LPIS(typer) ((((typer) >> 11) & 0x1f) + 1)87#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)
76 91
77#define GICD_IROUTER_SPI_MODE_ONE (0U << 31)92#define GICD_IROUTER_SPI_MODE_ONE (0U << 31)
78#define GICD_IROUTER_SPI_MODE_ANY (1U << 31)93#define GICD_IROUTER_SPI_MODE_ANY (1U << 31)
@@ -109,6 +124,18 @@ · 30 unmodified lines
109 124
110#define GICR_TYPER_CPU_NUMBER(r) (((r) >> 8) & 0xffff)125#define GICR_TYPER_CPU_NUMBER(r) (((r) >> 8) & 0xffff)
111 126
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
112#define GICR_WAKER_ProcessorSleep (1U << 1)139#define GICR_WAKER_ProcessorSleep (1U << 1)
113#define GICR_WAKER_ChildrenAsleep (1U << 2)140#define GICR_WAKER_ChildrenAsleep (1U << 2)
114 141
@@ -469,6 +496,7 @@ · 354 unmodified lines
469#define ICC_CTLR_EL1_A3V_SHIFT 15496#define ICC_CTLR_EL1_A3V_SHIFT 15
470#define ICC_CTLR_EL1_A3V_MASK (0x1 << ICC_CTLR_EL1_A3V_SHIFT)497#define ICC_CTLR_EL1_A3V_MASK (0x1 << ICC_CTLR_EL1_A3V_SHIFT)
471#define ICC_CTLR_EL1_RSS (0x1 << 18)498#define ICC_CTLR_EL1_RSS (0x1 << 18)
499#define ICC_CTLR_EL1_ExtRange (0x1 << 19)
472#define ICC_PMR_EL1_SHIFT 0500#define ICC_PMR_EL1_SHIFT 0
473#define ICC_PMR_EL1_MASK (0xff << ICC_PMR_EL1_SHIFT)501#define ICC_PMR_EL1_MASK (0xff << ICC_PMR_EL1_SHIFT)
474#define ICC_BPR0_EL1_SHIFT 0502#define ICC_BPR0_EL1_SHIFT 0
include/linux/irqchip/irq-partition-percpu.h+5−0
@@ -4,6 +4,9 @@ · 3 unmodified lines
4 * Author: Marc Zyngier <marc.zyngier@arm.com>4 * Author: Marc Zyngier <marc.zyngier@arm.com>
5 */5 */
6 6
7#ifndef __LINUX_IRQCHIP_IRQ_PARTITION_PERCPU_H
8#define __LINUX_IRQCHIP_IRQ_PARTITION_PERCPU_H
9
7#include <linux/fwnode.h>10#include <linux/fwnode.h>
8#include <linux/cpumask.h>11#include <linux/cpumask.h>
9#include <linux/irqdomain.h>12#include <linux/irqdomain.h>
@@ -46,3 +49,5 @@ struct irq_domain *partition_get_domain(struct partition_desc *dsc) · 36 unmodified lines
46 return NULL;49 return NULL;
47}50}
48#endif51#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
220 220
221#ifdef CONFIG_IRQ_DOMAIN221#ifdef CONFIG_IRQ_DOMAIN
222struct fwnode_handle *__irq_domain_alloc_fwnode(unsigned int type, int id,222struct 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);
224 224
225enum {225enum {
226 IRQCHIP_FWNODE_REAL,226 IRQCHIP_FWNODE_REAL,
@@ -241,9 +241,9 @@ struct fwnode_handle *irq_domain_alloc_named_id_fwnode(const char *name, int id) · 14 unmodified lines
241 NULL);241 NULL);
242}242}
243 243
244static inline struct fwnode_handle *irq_domain_alloc_fwnode(void *data)244static inline struct fwnode_handle *irq_domain_alloc_fwnode(phys_addr_t *pa)
245{245{
246 return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, data);246 return __irq_domain_alloc_fwnode(IRQCHIP_FWNODE_REAL, 0, NULL, pa);
247}247}
248 248
249void irq_domain_free_fwnode(struct fwnode_handle *fwnode);249void 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
1410extern int jbd2_journal_bmap(journal_t *, unsigned long, unsigned long long *);1410extern int jbd2_journal_bmap(journal_t *, unsigned long, unsigned long long *);
1411extern int jbd2_journal_force_commit(journal_t *);1411extern int jbd2_journal_force_commit(journal_t *);
1412extern int jbd2_journal_force_commit_nested(journal_t *);1412extern int jbd2_journal_force_commit_nested(journal_t *);
1413extern int jbd2_journal_inode_add_write(handle_t *handle, struct jbd2_inode *inode);
1414extern int jbd2_journal_inode_add_wait(handle_t *handle, struct jbd2_inode *inode);
1415extern int jbd2_journal_inode_ranged_write(handle_t *handle,1413extern int jbd2_journal_inode_ranged_write(handle_t *handle,
1416 struct jbd2_inode *inode, loff_t start_byte,1414 struct jbd2_inode *inode, loff_t start_byte,
1417 loff_t length);1415 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
217 * might_sleep - annotation for functions that can sleep217 * might_sleep - annotation for functions that can sleep
218 *218 *
219 * this macro will print a stack trace if it is executed in an atomic219 * 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.
221 *223 *
222 * This is a useful debugging help to be able to catch problems early and not224 * This is a useful debugging help to be able to catch problems early and not
223 * be bitten later when the calling function happens to sleep when it is not225 * 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
233# define cant_sleep() \235# define cant_sleep() \
234 do { __cant_sleep(__FILE__, __LINE__, 0); } while (0)236 do { __cant_sleep(__FILE__, __LINE__, 0); } while (0)
235# define sched_annotate_sleep() (current->task_state_change = 0)237# 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)
236#else255#else
237 static inline void ___might_sleep(const char *file, int line,256 static inline void ___might_sleep(const char *file, int line,
238 int preempt_offset) { }257 int preempt_offset) { }
@@ -241,6 +260,8 @@ extern void __cant_sleep(const char *file, int line, int preempt_offset); · 2 unmodified lines
241# define might_sleep() do { might_resched(); } while (0)260# define might_sleep() do { might_resched(); } while (0)
242# define cant_sleep() do { } while (0)261# define cant_sleep() do { } while (0)
243# define sched_annotate_sleep() do { } while (0)262# define sched_annotate_sleep() do { } while (0)
263# define non_block_start() do { } while (0)
264# define non_block_end() do { } while (0)
244#endif265#endif
245 266
246#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)267#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
125 unsigned long cmdline_len);125 unsigned long cmdline_len);
126typedef int (kexec_cleanup_t)(void *loader_data);126typedef int (kexec_cleanup_t)(void *loader_data);
127 127
128#ifdef CONFIG_KEXEC_VERIFY_SIG128#ifdef CONFIG_KEXEC_SIG
129typedef int (kexec_verify_sig_t)(const char *kernel_buf,129typedef int (kexec_verify_sig_t)(const char *kernel_buf,
130 unsigned long kernel_len);130 unsigned long kernel_len);
131#endif131#endif
@@ -134,7 +134,7 @@ struct kexec_file_ops { · 2 unmodified lines
134 kexec_probe_t *probe;134 kexec_probe_t *probe;
135 kexec_load_t *load;135 kexec_load_t *load;
136 kexec_cleanup_t *cleanup;136 kexec_cleanup_t *cleanup;
137#ifdef CONFIG_KEXEC_VERIFY_SIG137#ifdef CONFIG_KEXEC_SIG
138 kexec_verify_sig_t *verify_sig;138 kexec_verify_sig_t *verify_sig;
139#endif139#endif
140};140};
@@ -183,6 +183,8 @@ int kexec_purgatory_get_set_symbol(struct kimage *image, const char *name, · 42 unmodified lines
183 bool get_value);183 bool get_value);
184void *kexec_purgatory_get_symbol_addr(struct kimage *image, const char *name);184void *kexec_purgatory_get_symbol_addr(struct kimage *image, const char *name);
185 185
186int __weak arch_kexec_kernel_image_probe(struct kimage *image, void *buf,
187 unsigned long buf_len);
186void * __weak arch_kexec_kernel_image_load(struct kimage *image);188void * __weak arch_kexec_kernel_image_load(struct kimage *image);
187int __weak arch_kexec_apply_relocations_add(struct purgatory_info *pi,189int __weak arch_kexec_apply_relocations_add(struct purgatory_info *pi,
188 Elf_Shdr *section,190 Elf_Shdr *section,
@@ -216,6 +218,29 @@ extern int crash_prepare_elf64_headers(struct crash_mem *mem, int kernel_map, · 27 unmodified lines
216 void **addr, unsigned long *sz);218 void **addr, unsigned long *sz);
217#endif /* CONFIG_KEXEC_FILE */219#endif /* CONFIG_KEXEC_FILE */
218 220
221#ifdef CONFIG_KEXEC_ELF
222struct 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
233int kexec_build_elf_info(const char *buf, size_t len, struct elfhdr *ehdr,
234 struct kexec_elf_info *elf_info);
235
236int 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
241void kexec_free_elf_info(struct kexec_elf_info *elf_info);
242int kexec_elf_probe(const char *buf, unsigned long len);
243#endif
219struct kimage {244struct kimage {
220 kimage_entry_t head;245 kimage_entry_t head;
221 kimage_entry_t *entry;246 kimage_entry_t *entry;
include/linux/key.h+17−5
@@ -94,11 +94,11 @@ struct keyring_index_key { · 93 unmodified lines
94 union {94 union {
95 struct {95 struct {
96#ifdef __LITTLE_ENDIAN /* Put desc_len at the LSB of x */96#ifdef __LITTLE_ENDIAN /* Put desc_len at the LSB of x */
97 u8 desc_len;97 u16 desc_len;
98 char desc[sizeof(long) - 1]; /* First few chars of description */98 char desc[sizeof(long) - 2]; /* First few chars of description */
99#else99#else
100 char desc[sizeof(long) - 1]; /* First few chars of description */100 char desc[sizeof(long) - 2]; /* First few chars of description */
101 u8 desc_len;101 u16 desc_len;
102#endif102#endif
103 };103 };
104 unsigned long x;104 unsigned long x;
@@ -324,7 +324,7 @@ static inline struct key *request_key(struct key_type *type, · 219 unmodified lines
324}324}
325 325
326#ifdef CONFIG_NET326#ifdef CONFIG_NET
327/*327/**
328 * request_key_net - Request a key for a net namespace and wait for construction328 * request_key_net - Request a key for a net namespace and wait for construction
329 * @type: Type of key.329 * @type: Type of key.
330 * @description: The searchable description of the key.330 * @description: The searchable description of the key.
@@ -341,6 +341,18 @@ static inline struct key *request_key(struct key_type *type, · 10 unmodified lines
341 */341 */
342#define request_key_net(type, description, net, callout_info) \342#define request_key_net(type, description, net, callout_info) \
343 request_key_tag(type, description, net->key_domain, callout_info);343 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);
344#endif /* CONFIG_NET */356#endif /* CONFIG_NET */
345 357
346extern int wait_for_key_construction(struct key *key, bool intr);358extern 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
326 (raw_smp_processor_id() == atomic_read(&kgdb_active))326 (raw_smp_processor_id() == atomic_read(&kgdb_active))
327extern bool dbg_is_early;327extern bool dbg_is_early;
328extern void __init dbg_late_init(void);328extern void __init dbg_late_init(void);
329extern void kgdb_panic(const char *msg);
329#else /* ! CONFIG_KGDB */330#else /* ! CONFIG_KGDB */
330#define in_dbg_master() (0)331#define in_dbg_master() (0)
331#define dbg_late_init()332#define dbg_late_init()
333static inline void kgdb_panic(const char *msg) {}
332#endif /* ! CONFIG_KGDB */334#endif /* ! CONFIG_KGDB */
333#endif /* _KGDB_H_ */335#endif /* _KGDB_H_ */
include/linux/khugepaged.h+12−0
@@ -15,6 +15,14 @@ extern int __khugepaged_enter(struct mm_struct *mm); · 14 unmodified lines
15extern void __khugepaged_exit(struct mm_struct *mm);15extern void __khugepaged_exit(struct mm_struct *mm);
16extern int khugepaged_enter_vma_merge(struct vm_area_struct *vma,16extern int khugepaged_enter_vma_merge(struct vm_area_struct *vma,
17 unsigned long vm_flags);17 unsigned long vm_flags);
18#ifdef CONFIG_SHMEM
19extern void collapse_pte_mapped_thp(struct mm_struct *mm, unsigned long addr);
20#else
21static inline void collapse_pte_mapped_thp(struct mm_struct *mm,
22 unsigned long addr)
23{
24}
25#endif
18 26
19#define khugepaged_enabled() \27#define khugepaged_enabled() \
20 (transparent_hugepage_flags & \28 (transparent_hugepage_flags & \
@@ -73,6 +81,10 @@ static inline int khugepaged_enter_vma_merge(struct vm_area_struct *vma, · 52 unmodified lines
73{81{
74 return 0;82 return 0;
75}83}
84static inline void collapse_pte_mapped_thp(struct mm_struct *mm,
85 unsigned long addr)
86{
87}
76#endif /* CONFIG_TRANSPARENT_HUGEPAGE */88#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
77 89
78#endif /* _LINUX_KHUGEPAGED_H */90#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
861void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu);861void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu);
862void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu);862void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu);
863 863
864bool kvm_arch_has_vcpu_debugfs(void);864#ifdef __KVM_HAVE_ARCH_VCPU_DEBUGFS
865int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu);865void kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu);
866#endif
866 867
867int kvm_arch_hardware_enable(void);868int kvm_arch_hardware_enable(void);
868void kvm_arch_hardware_disable(void);869void kvm_arch_hardware_disable(void);
@@ -872,6 +873,7 @@ int kvm_arch_check_processor_compat(void); · 3 unmodified lines
872int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);873int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
873bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu);874bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu);
874int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);875int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);
876bool kvm_arch_dy_runnable(struct kvm_vcpu *vcpu);
875 877
876#ifndef __KVM_HAVE_ARCH_VM_ALLOC878#ifndef __KVM_HAVE_ARCH_VM_ALLOC
877/*879/*
include/linux/led-class-flash.h+10−5
@@ -86,15 +86,20 @@ static inline struct led_classdev_flash *lcdev_to_flcdev( · 85 unmodified lines
86}86}
87 87
88/**88/**
89 * led_classdev_flash_register - register a new object of led_classdev class89 * led_classdev_flash_register_ext - register a new object of LED class with
90 * with support for flash LEDs90 * init data and with support for flash LEDs
91 * @parent: the flash LED to register91 * @parent: LED flash controller device this flash LED is driven by
92 * @fled_cdev: the led_classdev_flash structure for this device92 * @fled_cdev: the led_classdev_flash structure for this device
93 * @init_data: the LED class flash device initialization data
93 *94 *
94 * Returns: 0 on success or negative error value on failure95 * Returns: 0 on success or negative error value on failure
95 */96 */
96extern int led_classdev_flash_register(struct device *parent,97extern int led_classdev_flash_register_ext(struct device *parent,
97 struct led_classdev_flash *fled_cdev);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)
98 103
99/**104/**
100 * led_classdev_flash_unregister - unregisters an object of led_classdev class105 * led_classdev_flash_unregister - unregisters an object of led_classdev class
include/linux/leds.h+90−10
@@ -8,6 +8,7 @@ · 7 unmodified lines
8#ifndef __LINUX_LEDS_H_INCLUDED8#ifndef __LINUX_LEDS_H_INCLUDED
9#define __LINUX_LEDS_H_INCLUDED9#define __LINUX_LEDS_H_INCLUDED
10 10
11#include <dt-bindings/leds/common.h>
11#include <linux/device.h>12#include <linux/device.h>
12#include <linux/kernfs.h>13#include <linux/kernfs.h>
13#include <linux/list.h>14#include <linux/list.h>
@@ -30,6 +31,30 @@ enum led_brightness { · 16 unmodified lines
30 LED_FULL = 255,31 LED_FULL = 255,
31};32};
32 33
34struct 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
33struct led_classdev {58struct led_classdev {
34 const char *name;59 const char *name;
35 enum led_brightness brightness;60 enum led_brightness brightness;
@@ -125,16 +150,46 @@ struct led_classdev { · 89 unmodified lines
125 struct mutex led_access;150 struct mutex led_access;
126};151};
127 152
128extern int of_led_classdev_register(struct device *parent,153/**
129 struct device_node *np,154 * led_classdev_register_ext - register a new object of LED class with
130 struct led_classdev *led_cdev);155 * init data
131#define led_classdev_register(parent, led_cdev) \156 * @parent: LED controller device this LED is driven by
132 of_led_classdev_register(parent, NULL, led_cdev)157 * @led_cdev: the led_classdev structure for this device
133extern int devm_of_led_classdev_register(struct device *parent,158 * @init_data: the LED class device initialization data
134 struct device_node *np,159 *
135 struct led_classdev *led_cdev);160 * Register a new object of LED class, with name derived from init_data.
136#define devm_led_classdev_register(parent, led_cdev) \161 *
137 devm_of_led_classdev_register(parent, NULL, led_cdev)162 * Returns: 0 on success or negative error value on failure
163 */
164extern 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 */
178static 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
184extern int devm_led_classdev_register_ext(struct device *parent,
185 struct led_classdev *led_cdev,
186 struct led_init_data *init_data);
187
188static 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}
138extern void led_classdev_unregister(struct led_classdev *led_cdev);193extern void led_classdev_unregister(struct led_classdev *led_cdev);
139extern void devm_led_classdev_unregister(struct device *parent,194extern void devm_led_classdev_unregister(struct device *parent,
140 struct led_classdev *led_cdev);195 struct led_classdev *led_cdev);
@@ -243,6 +298,22 @@ extern void led_sysfs_disable(struct led_classdev *led_cdev); · 102 unmodified lines
243 */298 */
244extern void led_sysfs_enable(struct led_classdev *led_cdev);299extern void led_sysfs_enable(struct led_classdev *led_cdev);
245 300
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 */
314extern int led_compose_name(struct device *dev, struct led_init_data *init_data,
315 char *led_classdev_name);
316
246/**317/**
247 * led_sysfs_is_disabled - check if LED sysfs interface is disabled318 * led_sysfs_is_disabled - check if LED sysfs interface is disabled
248 * @led_cdev: the LED to query319 * @led_cdev: the LED to query
@@ -420,6 +491,15 @@ struct led_platform_data { · 171 unmodified lines
420 struct led_info *leds;491 struct led_info *leds;
421};492};
422 493
494struct 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
423struct gpio_desc;503struct gpio_desc;
424typedef int (*gpio_blink_set_t)(struct gpio_desc *desc, int state,504typedef int (*gpio_blink_set_t)(struct gpio_desc *desc, int state,
425 unsigned long *delay_on,505 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
160 160
161}161}
162 162
163enum nvdimm_security_state {163/*
164 NVDIMM_SECURITY_ERROR = -1,164 * Note that separate bits for locked + unlocked are defined so that
165 * 'flags == 0' corresponds to an error / not-supported state.
166 */
167enum nvdimm_security_bits {
165 NVDIMM_SECURITY_DISABLED,168 NVDIMM_SECURITY_DISABLED,
166 NVDIMM_SECURITY_UNLOCKED,169 NVDIMM_SECURITY_UNLOCKED,
167 NVDIMM_SECURITY_LOCKED,170 NVDIMM_SECURITY_LOCKED,
@@ -182,7 +185,7 @@ enum nvdimm_passphrase_type { · 14 unmodified lines
182};185};
183 186
184struct nvdimm_security_ops {187struct nvdimm_security_ops {
185 enum nvdimm_security_state (*state)(struct nvdimm *nvdimm,188 unsigned long (*get_flags)(struct nvdimm *nvdimm,
186 enum nvdimm_passphrase_type pass_type);189 enum nvdimm_passphrase_type pass_type);
187 int (*freeze)(struct nvdimm *nvdimm);190 int (*freeze)(struct nvdimm *nvdimm);
188 int (*change_key)(struct nvdimm *nvdimm,191 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
88typedef int (nvm_op_set_bb_fn)(struct nvm_dev *, struct ppa_addr *, int, int);88typedef int (nvm_op_set_bb_fn)(struct nvm_dev *, struct ppa_addr *, int, int);
89typedef int (nvm_get_chk_meta_fn)(struct nvm_dev *, sector_t, int,89typedef int (nvm_get_chk_meta_fn)(struct nvm_dev *, sector_t, int,
90 struct nvm_chk_meta *);90 struct nvm_chk_meta *);
91typedef int (nvm_submit_io_fn)(struct nvm_dev *, struct nvm_rq *);91typedef int (nvm_submit_io_fn)(struct nvm_dev *, struct nvm_rq *, void *);
92typedef int (nvm_submit_io_sync_fn)(struct nvm_dev *, struct nvm_rq *);
93typedef void *(nvm_create_dma_pool_fn)(struct nvm_dev *, char *, int);92typedef void *(nvm_create_dma_pool_fn)(struct nvm_dev *, char *, int);
94typedef void (nvm_destroy_dma_pool_fn)(void *);93typedef void (nvm_destroy_dma_pool_fn)(void *);
95typedef void *(nvm_dev_dma_alloc_fn)(struct nvm_dev *, void *, gfp_t,94typedef void *(nvm_dev_dma_alloc_fn)(struct nvm_dev *, void *, gfp_t,
@@ -104,7 +103,6 @@ struct nvm_dev_ops { · 8 unmodified lines
104 nvm_get_chk_meta_fn *get_chk_meta;103 nvm_get_chk_meta_fn *get_chk_meta;
105 104
106 nvm_submit_io_fn *submit_io;105 nvm_submit_io_fn *submit_io;
107 nvm_submit_io_sync_fn *submit_io_sync;
108 106
109 nvm_create_dma_pool_fn *create_dma_pool;107 nvm_create_dma_pool_fn *create_dma_pool;
110 nvm_destroy_dma_pool_fn *destroy_dma_pool;108 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
682 int, struct nvm_chk_meta *);680 int, struct nvm_chk_meta *);
683extern int nvm_set_chunk_meta(struct nvm_tgt_dev *, struct ppa_addr *,681extern int nvm_set_chunk_meta(struct nvm_tgt_dev *, struct ppa_addr *,
684 int, int);682 int, int);
685extern int nvm_submit_io(struct nvm_tgt_dev *, struct nvm_rq *);683extern int nvm_submit_io(struct nvm_tgt_dev *, struct nvm_rq *, void *);
686extern int nvm_submit_io_sync(struct nvm_tgt_dev *, struct nvm_rq *);684extern int nvm_submit_io_sync(struct nvm_tgt_dev *, struct nvm_rq *, void *);
687extern void nvm_end_io(struct nvm_rq *);685extern void nvm_end_io(struct nvm_rq *);
688 686
689#else /* CONFIG_NVM */687#else /* CONFIG_NVM */
include/linux/lockdep.h+4−7
@@ -66,10 +66,7 @@ struct lock_class_key { · 65 unmodified lines
66 66
67extern struct lock_class_key __lockdep_no_validate__;67extern struct lock_class_key __lockdep_no_validate__;
68 68
69struct lock_trace {69struct lock_trace;
70 unsigned int nr_entries;
71 unsigned int offset;
72};
73 70
74#define LOCKSTAT_POINTS 471#define LOCKSTAT_POINTS 4
75 72
@@ -97,7 +94,7 @@ struct lock_class { · 21 unmodified lines
97 */94 */
98 struct list_head locks_after, locks_before;95 struct list_head locks_after, locks_before;
99 96
100 struct lockdep_subclass_key *key;97 const struct lockdep_subclass_key *key;
101 unsigned int subclass;98 unsigned int subclass;
102 unsigned int dep_gen_id;99 unsigned int dep_gen_id;
103 100
@@ -105,7 +102,7 @@ struct lock_class { · 1 unmodified line
105 * IRQ/softirq usage tracking bits:102 * IRQ/softirq usage tracking bits:
106 */103 */
107 unsigned long usage_mask;104 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];
109 106
110 /*107 /*
111 * Generation counter, when doing certain classes of graph walking,108 * Generation counter, when doing certain classes of graph walking,
@@ -193,7 +190,7 @@ struct lock_list { · 81 unmodified lines
193 struct list_head entry;190 struct list_head entry;
194 struct lock_class *class;191 struct lock_class *class;
195 struct lock_class *links_to;192 struct lock_class *links_to;
196 struct lock_trace trace;193 const struct lock_trace *trace;
197 int distance;194 int distance;
198 195
199 /*196 /*
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
117unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,117unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,
118 resource_size_t hw_addr, resource_size_t size);118 resource_size_t hw_addr, resource_size_t size);
119int logic_pio_register_range(struct logic_pio_hwaddr *newrange);119int logic_pio_register_range(struct logic_pio_hwaddr *newrange);
120void logic_pio_unregister_range(struct logic_pio_hwaddr *range);
120resource_size_t logic_pio_to_hwaddr(unsigned long pio);121resource_size_t logic_pio_to_hwaddr(unsigned long pio);
121unsigned long logic_pio_trans_cpuaddr(resource_size_t hw_addr);122unsigned long logic_pio_trans_cpuaddr(resource_size_t hw_addr);
122 123
include/linux/lsm_hooks.h+21−1
@@ -339,6 +339,9 @@ · 338 unmodified lines
339 * Check for permission to change root directory.339 * Check for permission to change root directory.
340 * @path contains the path structure.340 * @path contains the path structure.
341 * Return 0 if permission is granted.341 * 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.
342 * @inode_readlink:345 * @inode_readlink:
343 * Check the permission to read the symbolic link.346 * Check the permission to read the symbolic link.
344 * @dentry contains the dentry structure for the file link.347 * @dentry contains the dentry structure for the file link.
@@ -1446,6 +1449,11 @@ · 1101 unmodified lines
1446 * @bpf_prog_free_security:1449 * @bpf_prog_free_security:
1447 * Clean up the security information stored inside bpf prog.1450 * Clean up the security information stored inside bpf prog.
1448 *1451 *
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
1449 */1457 */
1450union security_list_options {1458union security_list_options {
1451 int (*binder_set_context_mgr)(struct task_struct *mgr);1459 int (*binder_set_context_mgr)(struct task_struct *mgr);
@@ -1535,7 +1543,9 @@ union security_list_options { · 83 unmodified lines
1535 int (*path_chown)(const struct path *path, kuid_t uid, kgid_t gid);1543 int (*path_chown)(const struct path *path, kuid_t uid, kgid_t gid);
1536 int (*path_chroot)(const struct path *path);1544 int (*path_chroot)(const struct path *path);
1537#endif1545#endif
1538 1546 /* Needed for inode based security check */
1547 int (*path_notify)(const struct path *path, u64 mask,
1548 unsigned int obj_type);
1539 int (*inode_alloc_security)(struct inode *inode);1549 int (*inode_alloc_security)(struct inode *inode);
1540 void (*inode_free_security)(struct inode *inode);1550 void (*inode_free_security)(struct inode *inode);
1541 int (*inode_init_security)(struct inode *inode, struct inode *dir,1551 int (*inode_init_security)(struct inode *inode, struct inode *dir,
@@ -1807,6 +1817,7 @@ union security_list_options { · 265 unmodified lines
1807 int (*bpf_prog_alloc_security)(struct bpf_prog_aux *aux);1817 int (*bpf_prog_alloc_security)(struct bpf_prog_aux *aux);
1808 void (*bpf_prog_free_security)(struct bpf_prog_aux *aux);1818 void (*bpf_prog_free_security)(struct bpf_prog_aux *aux);
1809#endif /* CONFIG_BPF_SYSCALL */1819#endif /* CONFIG_BPF_SYSCALL */
1820 int (*locked_down)(enum lockdown_reason what);
1810};1821};
1811 1822
1812struct security_hook_heads {1823struct security_hook_heads {
@@ -1860,6 +1871,8 @@ struct security_hook_heads { · 47 unmodified lines
1860 struct hlist_head path_chown;1871 struct hlist_head path_chown;
1861 struct hlist_head path_chroot;1872 struct hlist_head path_chroot;
1862#endif1873#endif
1874 /* Needed for inode based modules as well */
1875 struct hlist_head path_notify;
1863 struct hlist_head inode_alloc_security;1876 struct hlist_head inode_alloc_security;
1864 struct hlist_head inode_free_security;1877 struct hlist_head inode_free_security;
1865 struct hlist_head inode_init_security;1878 struct hlist_head inode_init_security;
@@ -2046,6 +2059,7 @@ struct security_hook_heads { · 180 unmodified lines
2046 struct hlist_head bpf_prog_alloc_security;2059 struct hlist_head bpf_prog_alloc_security;
2047 struct hlist_head bpf_prog_free_security;2060 struct hlist_head bpf_prog_free_security;
2048#endif /* CONFIG_BPF_SYSCALL */2061#endif /* CONFIG_BPF_SYSCALL */
2062 struct hlist_head locked_down;
2049} __randomize_layout;2063} __randomize_layout;
2050 2064
2051/*2065/*
@@ -2104,12 +2118,18 @@ struct lsm_info { · 52 unmodified lines
2104};2118};
2105 2119
2106extern struct lsm_info __start_lsm_info[], __end_lsm_info[];2120extern struct lsm_info __start_lsm_info[], __end_lsm_info[];
2121extern struct lsm_info __start_early_lsm_info[], __end_early_lsm_info[];
2107 2122
2108#define DEFINE_LSM(lsm) \2123#define DEFINE_LSM(lsm) \
2109 static struct lsm_info __lsm_##lsm \2124 static struct lsm_info __lsm_##lsm \
2110 __used __section(.lsm_info.init) \2125 __used __section(.lsm_info.init) \
2111 __aligned(sizeof(unsigned long))2126 __aligned(sizeof(unsigned long))
2112 2127
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
2113#ifdef CONFIG_SECURITY_SELINUX_DISABLE2133#ifdef CONFIG_SECURITY_SELINUX_DISABLE
2114/*2134/*
2115 * Assuring the safety of deleting a security module is up to2135 * 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
20#define CMDQ_WFE_WAIT BIT(15)20#define CMDQ_WFE_WAIT BIT(15)
21#define CMDQ_WFE_WAIT_VALUE 0x121#define CMDQ_WFE_WAIT_VALUE 0x1
22 22
23/** cmdq event maximum */
24#define CMDQ_MAX_EVENT 0x3ff
25
23/*26/*
24 * CMDQ_CODE_MASK:27 * CMDQ_CODE_MASK:
25 * set write mask28 * set write mask
include/linux/mdio.h+11−0
@@ -68,6 +68,17 @@ struct mdio_driver { · 67 unmodified lines
68#define to_mdio_driver(d) \68#define to_mdio_driver(d) \
69 container_of(to_mdio_common_driver(d), struct mdio_driver, mdiodrv)69 container_of(to_mdio_common_driver(d), struct mdio_driver, mdiodrv)
70 70
71/* device driver data */
72static inline void mdiodev_set_drvdata(struct mdio_device *mdio, void *data)
73{
74 dev_set_drvdata(&mdio->dev, data);
75}
76
77static inline void *mdiodev_get_drvdata(struct mdio_device *mdio)
78{
79 return dev_get_drvdata(&mdio->dev);
80}
81
71void mdio_device_free(struct mdio_device *mdiodev);82void mdio_device_free(struct mdio_device *mdiodev);
72struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr);83struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr);
73int mdio_device_register(struct mdio_device *mdiodev);84int mdio_device_register(struct mdio_device *mdiodev);
include/linux/mem_encrypt.h+1−14
@@ -18,23 +18,10 @@ · 17 unmodified lines
18 18
19#else /* !CONFIG_ARCH_HAS_MEM_ENCRYPT */19#else /* !CONFIG_ARCH_HAS_MEM_ENCRYPT */
20 20
21#define sme_me_mask 0ULL21static inline bool mem_encrypt_active(void) { return false; }
22
23static inline bool sme_active(void) { return false; }
24static inline bool sev_active(void) { return false; }
25 22
26#endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */23#endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
27 24
28static inline bool mem_encrypt_active(void)
29{
30 return sme_me_mask;
31}
32
33static inline u64 sme_get_me_mask(void)
34{
35 return sme_me_mask;
36}
37
38#ifdef CONFIG_AMD_MEM_ENCRYPT25#ifdef CONFIG_AMD_MEM_ENCRYPT
39/*26/*
40 * The __sme_set() and __sme_clr() macros are useful for adding or removing27 * 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
128 128
129 struct mem_cgroup_reclaim_iter iter[DEF_PRIORITY + 1];129 struct mem_cgroup_reclaim_iter iter[DEF_PRIORITY + 1];
130 130
131#ifdef CONFIG_MEMCG_KMEM
132 struct memcg_shrinker_map __rcu *shrinker_map;131 struct memcg_shrinker_map __rcu *shrinker_map;
133#endif132
134 struct rb_node tree_node; /* RB tree node */133 struct rb_node tree_node; /* RB tree node */
135 unsigned long usage_in_excess;/* Set to the value by which */134 unsigned long usage_in_excess;/* Set to the value by which */
136 /* the soft limit is exceeded*/135 /* the soft limit is exceeded*/
@@ -183,6 +182,23 @@ struct memcg_padding { · 46 unmodified lines
183#define MEMCG_PADDING(name)182#define MEMCG_PADDING(name)
184#endif183#endif
185 184
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
195struct 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
186/*202/*
187 * The memory controller data structure. The memory controller controls both203 * The memory controller data structure. The memory controller controls both
188 * page cache and RSS per cgroup. We would eventually like to provide204 * page cache and RSS per cgroup. We would eventually like to provide
@@ -307,12 +323,17 @@ struct mem_cgroup { · 118 unmodified lines
307#ifdef CONFIG_CGROUP_WRITEBACK323#ifdef CONFIG_CGROUP_WRITEBACK
308 struct list_head cgwb_list;324 struct list_head cgwb_list;
309 struct wb_domain cgwb_domain;325 struct wb_domain cgwb_domain;
326 struct memcg_cgwb_frn cgwb_frn[MEMCG_CGWB_FRN_CNT];
310#endif327#endif
311 328
312 /* List of events which userspace want to receive */329 /* List of events which userspace want to receive */
313 struct list_head event_list;330 struct list_head event_list;
314 spinlock_t event_list_lock;331 spinlock_t event_list_lock;
315 332
333#ifdef CONFIG_TRANSPARENT_HUGEPAGE
334 struct deferred_split deferred_split_queue;
335#endif
336
316 struct mem_cgroup_per_node *nodeinfo[0];337 struct mem_cgroup_per_node *nodeinfo[0];
317 /* WARNING: nodeinfo must be the last member here */338 /* WARNING: nodeinfo must be the last member here */
318};339};
@@ -668,6 +689,7 @@ static inline unsigned long lruvec_page_state_local(struct lruvec *lruvec, · 349 unmodified lines
668 689
669void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx,690void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx,
670 int val);691 int val);
692void __mod_lruvec_slab_state(void *p, enum node_stat_item idx, int val);
671 693
672static inline void mod_lruvec_state(struct lruvec *lruvec,694static inline void mod_lruvec_state(struct lruvec *lruvec,
673 enum node_stat_item idx, int val)695 enum node_stat_item idx, int val)
@@ -1072,6 +1094,14 @@ static inline void mod_lruvec_page_state(struct page *page, · 398 unmodified lines
1072 mod_node_page_state(page_pgdat(page), idx, val);1094 mod_node_page_state(page_pgdat(page), idx, val);
1073}1095}
1074 1096
1097static 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
1075static inline1105static inline
1076unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order,1106unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order,
1077 gfp_t gfp_mask,1107 gfp_t gfp_mask,
@@ -1159,6 +1189,16 @@ static inline void __dec_lruvec_page_state(struct page *page, · 81 unmodified lines
1159 __mod_lruvec_page_state(page, idx, -1);1189 __mod_lruvec_page_state(page, idx, -1);
1160}1190}
1161 1191
1192static inline void __inc_lruvec_slab_state(void *p, enum node_stat_item idx)
1193{
1194 __mod_lruvec_slab_state(p, idx, 1);
1195}
1196
1197static inline void __dec_lruvec_slab_state(void *p, enum node_stat_item idx)
1198{
1199 __mod_lruvec_slab_state(p, idx, -1);
1200}
1201
1162/* idx can be of type enum memcg_stat_item or node_stat_item */1202/* idx can be of type enum memcg_stat_item or node_stat_item */
1163static inline void inc_memcg_state(struct mem_cgroup *memcg,1203static inline void inc_memcg_state(struct mem_cgroup *memcg,
1164 int idx)1204 int idx)
@@ -1218,6 +1258,18 @@ void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages, · 53 unmodified lines
1218 unsigned long *pheadroom, unsigned long *pdirty,1258 unsigned long *pheadroom, unsigned long *pdirty,
1219 unsigned long *pwriteback);1259 unsigned long *pwriteback);
1220 1260
1261void mem_cgroup_track_foreign_dirty_slowpath(struct page *page,
1262 struct bdi_writeback *wb);
1263
1264static 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
1271void mem_cgroup_flush_foreign(struct bdi_writeback *wb);
1272
1221#else /* CONFIG_CGROUP_WRITEBACK */1273#else /* CONFIG_CGROUP_WRITEBACK */
1222 1274
1223static inline struct wb_domain *mem_cgroup_wb_domain(struct bdi_writeback *wb)1275static 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
1233{1285{
1234}1286}
1235 1287
1288static inline void mem_cgroup_track_foreign_dirty(struct page *page,
1289 struct bdi_writeback *wb)
1290{
1291}
1292
1293static inline void mem_cgroup_flush_foreign(struct bdi_writeback *wb)
1294{
1295}
1296
1236#endif /* CONFIG_CGROUP_WRITEBACK */1297#endif /* CONFIG_CGROUP_WRITEBACK */
1237 1298
1238struct sock;1299struct sock;
@@ -1253,6 +1314,11 @@ static inline bool mem_cgroup_under_socket_pressure(struct mem_cgroup *memcg) · 14 unmodified lines
1253 } while ((memcg = parent_mem_cgroup(memcg)));1314 } while ((memcg = parent_mem_cgroup(memcg)));
1254 return false;1315 return false;
1255}1316}
1317
1318extern int memcg_expand_shrinker_maps(int new_id);
1319
1320extern void memcg_set_shrinker_bit(struct mem_cgroup *memcg,
1321 int nid, int shrinker_id);
1256#else1322#else
1257#define mem_cgroup_sockets_enabled 01323#define mem_cgroup_sockets_enabled 0
1258static inline void mem_cgroup_sk_alloc(struct sock *sk) { };1324static 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
1261{1327{
1262 return false;1328 return false;
1263}1329}
1330
1331static inline void memcg_set_shrinker_bit(struct mem_cgroup *memcg,
1332 int nid, int shrinker_id)
1333{
1334}
1264#endif1335#endif
1265 1336
1266struct kmem_cache *memcg_kmem_get_cache(struct kmem_cache *cachep);1337struct 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
1332 return memcg ? memcg->kmemcg_id : -1;1403 return memcg ? memcg->kmemcg_id : -1;
1333}1404}
1334 1405
1335extern int memcg_expand_shrinker_maps(int new_id);
1336
1337extern void memcg_set_shrinker_bit(struct mem_cgroup *memcg,
1338 int nid, int shrinker_id);
1339#else1406#else
1340 1407
1341static inline int memcg_kmem_charge(struct page *page, gfp_t gfp, int order)1408static 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
1377{1444{
1378}1445}
1379 1446
1380static inline void memcg_set_shrinker_bit(struct mem_cgroup *memcg,
1381 int nid, int shrinker_id) { }
1382#endif /* CONFIG_MEMCG_KMEM */1447#endif /* CONFIG_MEMCG_KMEM */
1383 1448
1384#endif /* _LINUX_MEMCONTROL_H */1449#endif /* _LINUX_MEMCONTROL_H */
include/linux/memory.h+3−4
@@ -25,7 +25,6 @@ · 24 unmodified lines
25 25
26struct memory_block {26struct memory_block {
27 unsigned long start_section_nr;27 unsigned long start_section_nr;
28 unsigned long end_section_nr;
29 unsigned long state; /* serialized by the dev->lock */28 unsigned long state; /* serialized by the dev->lock */
30 int section_count; /* serialized by mem_sysfs_mutex */29 int section_count; /* serialized by mem_sysfs_mutex */
31 int online_type; /* for passing data to online routine */30 int online_type; /* for passing data to online routine */
@@ -80,9 +79,9 @@ struct mem_section; · 48 unmodified lines
80#define IPC_CALLBACK_PRI 1079#define IPC_CALLBACK_PRI 10
81 80
82#ifndef CONFIG_MEMORY_HOTPLUG_SPARSE81#ifndef CONFIG_MEMORY_HOTPLUG_SPARSE
83static inline int memory_dev_init(void)82static inline void memory_dev_init(void)
84{83{
85 return 0;84 return;
86}85}
87static inline int register_memory_notifier(struct notifier_block *nb)86static inline int register_memory_notifier(struct notifier_block *nb)
88{87{
@@ -113,7 +112,7 @@ extern int register_memory_isolate_notifier(struct notifier_block *nb); · 24 unmodified lines
113extern void unregister_memory_isolate_notifier(struct notifier_block *nb);112extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
114int create_memory_block_devices(unsigned long start, unsigned long size);113int create_memory_block_devices(unsigned long start, unsigned long size);
115void remove_memory_block_devices(unsigned long start, unsigned long size);114void remove_memory_block_devices(unsigned long start, unsigned long size);
116extern int memory_dev_init(void);115extern void memory_dev_init(void);
117extern int memory_notify(unsigned long val, void *v);116extern int memory_notify(unsigned long val, void *v);
118extern int memory_isolate_notify(unsigned long val, void *v);117extern int memory_isolate_notify(unsigned long val, void *v);
119extern struct memory_block *find_memory_block(struct mem_section *);118extern struct memory_block *find_memory_block(struct mem_section *);
include/linux/memremap.h+3−2
@@ -17,6 +17,7 @@ struct device; · 16 unmodified lines
17 */17 */
18struct vmem_altmap {18struct vmem_altmap {
19 const unsigned long base_pfn;19 const unsigned long base_pfn;
20 const unsigned long end_pfn;
20 const unsigned long reserve;21 const unsigned long reserve;
21 unsigned long free;22 unsigned long free;
22 unsigned long align;23 unsigned long align;
@@ -109,10 +110,8 @@ struct dev_pagemap { · 86 unmodified lines
109 struct percpu_ref *ref;110 struct percpu_ref *ref;
110 struct percpu_ref internal_ref;111 struct percpu_ref internal_ref;
111 struct completion done;112 struct completion done;
112 struct device *dev;
113 enum memory_type type;113 enum memory_type type;
114 unsigned int flags;114 unsigned int flags;
115 u64 pci_p2pdma_bus_offset;
116 const struct dev_pagemap_ops *ops;115 const struct dev_pagemap_ops *ops;
117};116};
118 117
@@ -124,6 +123,8 @@ static inline struct vmem_altmap *pgmap_altmap(struct dev_pagemap *pgmap) · 5 unmodified lines
124}123}
125 124
126#ifdef CONFIG_ZONE_DEVICE125#ifdef CONFIG_ZONE_DEVICE
126void *memremap_pages(struct dev_pagemap *pgmap, int nid);
127void memunmap_pages(struct dev_pagemap *pgmap);
127void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);128void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
128void devm_memunmap_pages(struct device *dev, struct dev_pagemap *pgmap);129void devm_memunmap_pages(struct device *dev, struct dev_pagemap *pgmap);
129struct dev_pagemap *get_dev_pagemap(unsigned long pfn,130struct 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
136 136
137 /* for debugfs */137 /* for debugfs */
138 struct dentry *dentry_root;138 struct dentry *dentry_root;
139 struct dentry *dentry_reg;
140};139};
141 140
142struct aat2870_subdev_info {141struct aat2870_subdev_info {
include/linux/mfd/cros_ec.h+0−292
@@ -8,183 +8,11 @@ · 7 unmodified lines
8#ifndef __LINUX_MFD_CROS_EC_H8#ifndef __LINUX_MFD_CROS_EC_H
9#define __LINUX_MFD_CROS_EC_H9#define __LINUX_MFD_CROS_EC_H
10 10
11#include <linux/cdev.h>
12#include <linux/device.h>11#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 */
43enum {
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 */
66struct 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 */
125struct 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 */
166struct 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 */
177struct cros_ec_platform {
178 const char *ec_name;
179 u16 cmd_offset;
180};
181
182struct cros_ec_debugfs;
183 12
184/**13/**
185 * struct cros_ec_dev - ChromeOS EC device entry point.14 * struct cros_ec_dev - ChromeOS EC device entry point.
186 * @class_dev: Device structure used in sysfs.15 * @class_dev: Device structure used in sysfs.
187 * @cdev: Character device structure in /dev.
188 * @ec_dev: cros_ec_device structure to talk to the physical device.16 * @ec_dev: cros_ec_device structure to talk to the physical device.
189 * @dev: Pointer to the platform device.17 * @dev: Pointer to the platform device.
190 * @debug_info: cros_ec_debugfs structure for debugging information.18 * @debug_info: cros_ec_debugfs structure for debugging information.
@@ -194,7 +22,6 @@ struct cros_ec_debugfs; · 3 unmodified lines
194 */22 */
195struct cros_ec_dev {23struct cros_ec_dev {
196 struct device class_dev;24 struct device class_dev;
197 struct cdev cdev;
198 struct cros_ec_device *ec_dev;25 struct cros_ec_device *ec_dev;
199 struct device *dev;26 struct device *dev;
200 struct cros_ec_debugfs *debug_info;27 struct cros_ec_debugfs *debug_info;
@@ -205,123 +32,4 @@ struct cros_ec_dev { · 4 unmodified lines
205 32
206#define to_cros_ec_dev(dev) container_of(dev, struct cros_ec_dev, class_dev)33#define to_cros_ec_dev(dev) container_of(dev, struct cros_ec_dev, class_dev)
207 34
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 */
216int 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 */
226int 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 */
239int 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 */
252int 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 */
265int 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 */
280int 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 */
292int 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 */
301int 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 */
313int 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 */
325u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev);
326
327#endif /* __LINUX_MFD_CROS_EC_H */35#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. */
18enum {
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
48struct da9063;
49
50/* DA9063 platform data */
51struct 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
7#ifndef __MFD_MT6397_CORE_H__7#ifndef __MFD_MT6397_CORE_H__
8#define __MFD_MT6397_CORE_H__8#define __MFD_MT6397_CORE_H__
9 9
10#include <linux/mutex.h>
11
12enum chip_id {
13 MT6323_CHIP_ID = 0x23,
14 MT6391_CHIP_ID = 0x91,
15 MT6397_CHIP_ID = 0x97,
16};
17
10enum mt6397_irq_numbers {18enum mt6397_irq_numbers {
11 MT6397_IRQ_SPKL_AB = 0,19 MT6397_IRQ_SPKL_AB = 0,
12 MT6397_IRQ_SPKR_AB,20 MT6397_IRQ_SPKR_AB,
@@ -54,6 +62,9 @@ struct mt6397_chip { · 41 unmodified lines
54 u16 irq_masks_cache[2];62 u16 irq_masks_cache[2];
55 u16 int_con[2];63 u16 int_con[2];
56 u16 int_status[2];64 u16 int_status[2];
65 u16 chip_id;
57};66};
58 67
68int mt6397_irq_init(struct mt6397_chip *chip);
69
59#endif /* __MFD_MT6397_CORE_H__ */70#endif /* __MFD_MT6397_CORE_H__ */
include/linux/mfd/syscon.h+6−0
@@ -17,12 +17,18 @@ · 16 unmodified lines
17struct device_node;17struct device_node;
18 18
19#ifdef CONFIG_MFD_SYSCON19#ifdef CONFIG_MFD_SYSCON
20extern struct regmap *device_node_to_regmap(struct device_node *np);
20extern struct regmap *syscon_node_to_regmap(struct device_node *np);21extern struct regmap *syscon_node_to_regmap(struct device_node *np);
21extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);22extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s);
22extern struct regmap *syscon_regmap_lookup_by_phandle(23extern struct regmap *syscon_regmap_lookup_by_phandle(
23 struct device_node *np,24 struct device_node *np,
24 const char *property);25 const char *property);
25#else26#else
27static inline struct regmap *device_node_to_regmap(struct device_node *np)
28{
29 return ERR_PTR(-ENOTSUPP);
30}
31
26static inline struct regmap *syscon_node_to_regmap(struct device_node *np)32static inline struct regmap *syscon_node_to_regmap(struct device_node *np)
27{33{
28 return ERR_PTR(-ENOTSUPP);34 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
166#define MIGRATE_PFN_MIGRATE (1UL << 1)166#define MIGRATE_PFN_MIGRATE (1UL << 1)
167#define MIGRATE_PFN_LOCKED (1UL << 2)167#define MIGRATE_PFN_LOCKED (1UL << 2)
168#define MIGRATE_PFN_WRITE (1UL << 3)168#define MIGRATE_PFN_WRITE (1UL << 3)
169#define MIGRATE_PFN_DEVICE (1UL << 4)
170#define MIGRATE_PFN_ERROR (1UL << 5)
171#define MIGRATE_PFN_SHIFT 6169#define MIGRATE_PFN_SHIFT 6
172 170
173static inline struct page *migrate_pfn_to_page(unsigned long mpfn)171static 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
182 return (pfn << MIGRATE_PFN_SHIFT) | MIGRATE_PFN_VALID;180 return (pfn << MIGRATE_PFN_SHIFT) | MIGRATE_PFN_VALID;
183}181}
184 182
185/*183struct migrate_vma {
186 * struct migrate_vma_ops - migrate operation callback184 struct vm_area_struct *vma;
187 *185 /*
188 * @alloc_and_copy: alloc destination memory and copy source memory to it186 * Both src and dst array must be big enough for
189 * @finalize_and_map: allow caller to map the successfully migrated pages187 * (end - start) >> PAGE_SHIFT entries.
190 *188 *
191 *189 * The src array must not be modified by the caller after
192 * The alloc_and_copy() callback happens once all source pages have been locked,190 * migrate_vma_setup(), and must not change the dst array after
193 * unmapped and checked (checked whether pinned or not). All pages that can be191 * migrate_vma_pages() returns.
194 * migrated will have an entry in the src array set with the pfn value of the192 */
195 * page and with the MIGRATE_PFN_VALID and MIGRATE_PFN_MIGRATE flag set (other193 unsigned long *dst;
196 * flags might be set but should be ignored by the callback).194 unsigned long *src;
197 *195 unsigned long cpages;
198 * The alloc_and_copy() callback can then allocate destination memory and copy196 unsigned long npages;
199 * source memory to it for all those entries (ie with MIGRATE_PFN_VALID and197 unsigned long start;
200 * MIGRATE_PFN_MIGRATE flag set). Once these are allocated and copied, the198 unsigned long end;
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 */
251struct 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);
264};199};
265 200
266#if defined(CONFIG_MIGRATE_VMA_HELPER)201int migrate_vma_setup(struct migrate_vma *args);
267int migrate_vma(const struct migrate_vma_ops *ops,202void migrate_vma_pages(struct migrate_vma *migrate);
268 struct vm_area_struct *vma,203void migrate_vma_finalize(struct migrate_vma *migrate);
269 unsigned long start,
270 unsigned long end,
271 unsigned long *src,
272 unsigned long *dst,
273 void *private);
274#else
275static 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) */
286 204
287#endif /* CONFIG_MIGRATION */205#endif /* CONFIG_MIGRATION */
288 206
include/linux/mlx5/device.h+19−2
@@ -328,6 +328,7 @@ enum mlx5_event { · 327 unmodified lines
328 MLX5_EVENT_TYPE_GPIO_EVENT = 0x15,328 MLX5_EVENT_TYPE_GPIO_EVENT = 0x15,
329 MLX5_EVENT_TYPE_PORT_MODULE_EVENT = 0x16,329 MLX5_EVENT_TYPE_PORT_MODULE_EVENT = 0x16,
330 MLX5_EVENT_TYPE_TEMP_WARN_EVENT = 0x17,330 MLX5_EVENT_TYPE_TEMP_WARN_EVENT = 0x17,
331 MLX5_EVENT_TYPE_XRQ_ERROR = 0x18,
331 MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19,332 MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19,
332 MLX5_EVENT_TYPE_GENERAL_EVENT = 0x22,333 MLX5_EVENT_TYPE_GENERAL_EVENT = 0x22,
333 MLX5_EVENT_TYPE_MONITOR_COUNTER = 0x24,334 MLX5_EVENT_TYPE_MONITOR_COUNTER = 0x24,
@@ -345,6 +346,7 @@ enum mlx5_event { · 11 unmodified lines
345 MLX5_EVENT_TYPE_ESW_FUNCTIONS_CHANGED = 0xe,346 MLX5_EVENT_TYPE_ESW_FUNCTIONS_CHANGED = 0xe,
346 347
347 MLX5_EVENT_TYPE_DCT_DRAINED = 0x1c,348 MLX5_EVENT_TYPE_DCT_DRAINED = 0x1c,
349 MLX5_EVENT_TYPE_DCT_KEY_VIOLATION = 0x1d,
348 350
349 MLX5_EVENT_TYPE_FPGA_ERROR = 0x20,351 MLX5_EVENT_TYPE_FPGA_ERROR = 0x20,
350 MLX5_EVENT_TYPE_FPGA_QP_ERROR = 0x21,352 MLX5_EVENT_TYPE_FPGA_QP_ERROR = 0x21,
@@ -446,11 +448,11 @@ enum { · 95 unmodified lines
446};448};
447 449
448enum {450enum {
449 MLX5_OPC_MOD_TLS_TIS_STATIC_PARAMS = 0x20,451 MLX5_OPC_MOD_TLS_TIS_STATIC_PARAMS = 0x1,
450};452};
451 453
452enum {454enum {
453 MLX5_OPC_MOD_TLS_TIS_PROGRESS_PARAMS = 0x20,455 MLX5_OPC_MOD_TLS_TIS_PROGRESS_PARAMS = 0x1,
454};456};
455 457
456enum {458enum {
@@ -584,6 +586,12 @@ struct mlx5_eqe_cq_err { · 127 unmodified lines
584 u8 syndrome;586 u8 syndrome;
585};587};
586 588
589struct mlx5_eqe_xrq_err {
590 __be32 reserved1[5];
591 __be32 type_xrqn;
592 __be32 reserved2;
593};
594
587struct mlx5_eqe_port_state {595struct mlx5_eqe_port_state {
588 u8 reserved0[8];596 u8 reserved0[8];
589 u8 port;597 u8 port;
@@ -698,6 +706,7 @@ union ev_data { · 108 unmodified lines
698 struct mlx5_eqe_pps pps;706 struct mlx5_eqe_pps pps;
699 struct mlx5_eqe_dct dct;707 struct mlx5_eqe_dct dct;
700 struct mlx5_eqe_temp_warning temp_warning;708 struct mlx5_eqe_temp_warning temp_warning;
709 struct mlx5_eqe_xrq_err xrq_err;
701} __packed;710} __packed;
702 711
703struct mlx5_eqe {712struct mlx5_eqe {
@@ -1162,6 +1171,9 @@ enum mlx5_qcam_feature_groups { · 458 unmodified lines
1162#define MLX5_CAP_FLOWTABLE(mdev, cap) \1171#define MLX5_CAP_FLOWTABLE(mdev, cap) \
1163 MLX5_GET(flow_table_nic_cap, mdev->caps.hca_cur[MLX5_CAP_FLOW_TABLE], cap)1172 MLX5_GET(flow_table_nic_cap, mdev->caps.hca_cur[MLX5_CAP_FLOW_TABLE], cap)
1164 1173
1174#define MLX5_CAP64_FLOWTABLE(mdev, cap) \
1175 MLX5_GET64(flow_table_nic_cap, (mdev)->caps.hca_cur[MLX5_CAP_FLOW_TABLE], cap)
1176
1165#define MLX5_CAP_FLOWTABLE_MAX(mdev, cap) \1177#define MLX5_CAP_FLOWTABLE_MAX(mdev, cap) \
1166 MLX5_GET(flow_table_nic_cap, mdev->caps.hca_max[MLX5_CAP_FLOW_TABLE], cap)1178 MLX5_GET(flow_table_nic_cap, mdev->caps.hca_max[MLX5_CAP_FLOW_TABLE], cap)
1167 1179
@@ -1225,6 +1237,10 @@ enum mlx5_qcam_feature_groups { · 57 unmodified lines
1225 MLX5_GET(e_switch_cap, \1237 MLX5_GET(e_switch_cap, \
1226 mdev->caps.hca_cur[MLX5_CAP_ESWITCH], cap)1238 mdev->caps.hca_cur[MLX5_CAP_ESWITCH], cap)
1227 1239
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
1228#define MLX5_CAP_ESW_MAX(mdev, cap) \1244#define MLX5_CAP_ESW_MAX(mdev, cap) \
1229 MLX5_GET(e_switch_cap, \1245 MLX5_GET(e_switch_cap, \
1230 mdev->caps.hca_max[MLX5_CAP_ESWITCH], cap)1246 mdev->caps.hca_max[MLX5_CAP_ESWITCH], cap)
@@ -1309,6 +1325,7 @@ enum { · 78 unmodified lines
1309 MLX5_PER_PRIORITY_COUNTERS_GROUP = 0x10,1325 MLX5_PER_PRIORITY_COUNTERS_GROUP = 0x10,
1310 MLX5_PER_TRAFFIC_CLASS_COUNTERS_GROUP = 0x11,1326 MLX5_PER_TRAFFIC_CLASS_COUNTERS_GROUP = 0x11,
1311 MLX5_PHYSICAL_LAYER_COUNTERS_GROUP = 0x12,1327 MLX5_PHYSICAL_LAYER_COUNTERS_GROUP = 0x12,
1328 MLX5_PER_TRAFFIC_CLASS_CONGESTION_GROUP = 0x13,
1312 MLX5_PHYSICAL_LAYER_STATISTICAL_GROUP = 0x16,1329 MLX5_PHYSICAL_LAYER_STATISTICAL_GROUP = 0x16,
1313 MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20,1330 MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20,
1314};1331};
include/linux/mlx5/driver.h+33−11
@@ -47,6 +47,7 @@ · 46 unmodified lines
47#include <linux/interrupt.h>47#include <linux/interrupt.h>
48#include <linux/idr.h>48#include <linux/idr.h>
49#include <linux/notifier.h>49#include <linux/notifier.h>
50#include <linux/refcount.h>
50 51
51#include <linux/mlx5/device.h>52#include <linux/mlx5/device.h>
52#include <linux/mlx5/doorbell.h>53#include <linux/mlx5/doorbell.h>
@@ -189,7 +190,6 @@ enum mlx5_coredev_type { · 136 unmodified lines
189};190};
190 191
191struct mlx5_field_desc {192struct mlx5_field_desc {
192 struct dentry *dent;
193 int i;193 int i;
194};194};
195 195
@@ -242,11 +242,6 @@ struct mlx5_cmd_msg { · 46 unmodified lines
242 242
243struct mlx5_cmd_debug {243struct mlx5_cmd_debug {
244 struct dentry *dbg_root;244 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;
250 void *in_msg;245 void *in_msg;
251 void *out_msg;246 void *out_msg;
252 u8 status;247 u8 status;
@@ -271,8 +266,6 @@ struct mlx5_cmd_stats { · 18 unmodified lines
271 u64 sum;266 u64 sum;
272 u64 n;267 u64 n;
273 struct dentry *root;268 struct dentry *root;
274 struct dentry *avg;
275 struct dentry *count;
276 /* protect command average calculations */269 /* protect command average calculations */
277 spinlock_t lock;270 spinlock_t lock;
278};271};
@@ -398,7 +391,7 @@ enum mlx5_res_type { · 119 unmodified lines
398 391
399struct mlx5_core_rsc_common {392struct mlx5_core_rsc_common {
400 enum mlx5_res_type res;393 enum mlx5_res_type res;
401 atomic_t refcount;394 refcount_t refcount;
402 struct completion free;395 struct completion free;
403};396};
404 397
@@ -477,6 +470,17 @@ struct mlx5_core_sriov { · 72 unmodified lines
477 u16 max_vfs;470 u16 max_vfs;
478};471};
479 472
473struct 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
480struct mlx5_fc_stats {484struct mlx5_fc_stats {
481 spinlock_t counters_idr_lock; /* protects counters_idr */485 spinlock_t counters_idr_lock; /* protects counters_idr */
482 struct idr counters_idr;486 struct idr counters_idr;
@@ -488,6 +492,8 @@ struct mlx5_fc_stats { · 5 unmodified lines
488 struct delayed_work work;492 struct delayed_work work;
489 unsigned long next_query;493 unsigned long next_query;
490 unsigned long sampling_interval; /* jiffies */494 unsigned long sampling_interval; /* jiffies */
495 u32 *bulk_query_out;
496 struct mlx5_fc_pool fc_pool;
491};497};
492 498
493struct mlx5_events;499struct mlx5_events;
@@ -620,6 +626,11 @@ struct mlx5e_resources { · 126 unmodified lines
620 struct mlx5_sq_bfreg bfreg;626 struct mlx5_sq_bfreg bfreg;
621};627};
622 628
629enum mlx5_sw_icm_type {
630 MLX5_SW_ICM_TYPE_STEERING,
631 MLX5_SW_ICM_TYPE_HEADER_MODIFY,
632};
633
623#define MLX5_MAX_RESERVED_GIDS 8634#define MLX5_MAX_RESERVED_GIDS 8
624 635
625struct mlx5_rsvd_gids {636struct mlx5_rsvd_gids {
@@ -651,9 +662,14 @@ struct mlx5_clock { · 25 unmodified lines
651 struct mlx5_pps pps_info;662 struct mlx5_pps pps_info;
652};663};
653 664
665struct mlx5_dm;
654struct mlx5_fw_tracer;666struct mlx5_fw_tracer;
655struct mlx5_vxlan;667struct mlx5_vxlan;
656struct mlx5_geneve;668struct mlx5_geneve;
669struct 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))
657 673
658struct mlx5_core_dev {674struct mlx5_core_dev {
659 struct device *device;675 struct device *device;
@@ -688,6 +704,7 @@ struct mlx5_core_dev { · 28 unmodified lines
688 atomic_t num_qps;704 atomic_t num_qps;
689 u32 issi;705 u32 issi;
690 struct mlx5e_resources mlx5e_res;706 struct mlx5e_resources mlx5e_res;
707 struct mlx5_dm *dm;
691 struct mlx5_vxlan *vxlan;708 struct mlx5_vxlan *vxlan;
692 struct mlx5_geneve *geneve;709 struct mlx5_geneve *geneve;
693 struct {710 struct {
@@ -701,6 +718,7 @@ struct mlx5_core_dev { · 7 unmodified lines
701 struct mlx5_ib_clock_info *clock_info;718 struct mlx5_ib_clock_info *clock_info;
702 struct mlx5_fw_tracer *tracer;719 struct mlx5_fw_tracer *tracer;
703 u32 vsc_addr;720 u32 vsc_addr;
721 struct mlx5_hv_vhca *hv_vhca;
704};722};
705 723
706struct mlx5_db {724struct mlx5_db {
@@ -959,7 +977,7 @@ int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn, · 252 unmodified lines
959int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn);977int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn);
960int mlx5_core_detach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn);978int mlx5_core_detach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn);
961 979
962int mlx5_qp_debugfs_init(struct mlx5_core_dev *dev);980void mlx5_qp_debugfs_init(struct mlx5_core_dev *dev);
963void mlx5_qp_debugfs_cleanup(struct mlx5_core_dev *dev);981void mlx5_qp_debugfs_cleanup(struct mlx5_core_dev *dev);
964int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in,982int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in,
965 int size_in, void *data_out, int size_out,983 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
971void mlx5_db_free(struct mlx5_core_dev *dev, struct mlx5_db *db);989void mlx5_db_free(struct mlx5_core_dev *dev, struct mlx5_db *db);
972 990
973const char *mlx5_command_str(int command);991const char *mlx5_command_str(int command);
974int mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev);992void mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev);
975void mlx5_cmdif_debugfs_cleanup(struct mlx5_core_dev *dev);993void mlx5_cmdif_debugfs_cleanup(struct mlx5_core_dev *dev);
976int mlx5_core_create_psv(struct mlx5_core_dev *dev, u32 pdn,994int mlx5_core_create_psv(struct mlx5_core_dev *dev, u32 pdn,
977 int npsvs, u32 *sig_index);995 int npsvs, u32 *sig_index);
@@ -1070,6 +1088,10 @@ int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev, · 92 unmodified lines
1070 size_t *offsets);1088 size_t *offsets);
1071struct mlx5_uars_page *mlx5_get_uars_page(struct mlx5_core_dev *mdev);1089struct mlx5_uars_page *mlx5_get_uars_page(struct mlx5_core_dev *mdev);
1072void mlx5_put_uars_page(struct mlx5_core_dev *mdev, struct mlx5_uars_page *up);1090void mlx5_put_uars_page(struct mlx5_core_dev *mdev, struct mlx5_uars_page *up);
1091int 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);
1093int 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);
1073 1095
1074#ifdef CONFIG_MLX5_CORE_IPOIB1096#ifdef CONFIG_MLX5_CORE_IPOIB
1075struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,1097struct 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
44struct mlx5_eswitch_rep {44struct mlx5_eswitch_rep {
45 struct mlx5_eswitch_rep_data rep_data[NUM_REP_TYPES];45 struct mlx5_eswitch_rep_data rep_data[NUM_REP_TYPES];
46 u16 vport;46 u16 vport;
47 u8 hw_id[ETH_ALEN];
48 u16 vlan;47 u16 vlan;
49 /* Only IB rep is using vport_index */48 /* Only IB rep is using vport_index */
50 u16 vport_index;49 u16 vport_index;
@@ -61,7 +60,6 @@ void *mlx5_eswitch_get_proto_dev(struct mlx5_eswitch *esw, · 10 unmodified lines
61struct mlx5_eswitch_rep *mlx5_eswitch_vport_rep(struct mlx5_eswitch *esw,60struct mlx5_eswitch_rep *mlx5_eswitch_vport_rep(struct mlx5_eswitch *esw,
62 u16 vport_num);61 u16 vport_num);
63void *mlx5_eswitch_uplink_get_proto_dev(struct mlx5_eswitch *esw, u8 rep_type);62void *mlx5_eswitch_uplink_get_proto_dev(struct mlx5_eswitch *esw, u8 rep_type);
64u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw);
65struct mlx5_flow_handle *63struct mlx5_flow_handle *
66mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw,64mlx5_eswitch_add_send_to_vport_rule(struct mlx5_eswitch *esw,
67 u16 vport_num, u32 sqn);65 u16 vport_num, u32 sqn);
@@ -75,7 +73,14 @@ mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev); · 7 unmodified lines
75bool mlx5_eswitch_vport_match_metadata_enabled(const struct mlx5_eswitch *esw);73bool mlx5_eswitch_vport_match_metadata_enabled(const struct mlx5_eswitch *esw);
76u32 mlx5_eswitch_get_vport_metadata_for_match(const struct mlx5_eswitch *esw,74u32 mlx5_eswitch_get_vport_metadata_for_match(const struct mlx5_eswitch *esw,
77 u16 vport_num);75 u16 vport_num);
76u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw);
78#else /* CONFIG_MLX5_ESWITCH */77#else /* CONFIG_MLX5_ESWITCH */
78
79static inline u8 mlx5_eswitch_mode(struct mlx5_eswitch *esw)
80{
81 return MLX5_ESWITCH_NONE;
82}
83
79static inline enum devlink_eswitch_encap_mode84static inline enum devlink_eswitch_encap_mode
80mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev)85mlx5_eswitch_get_encap_mode(const struct mlx5_core_dev *dev)
81{86{
include/linux/mlx5/fs.h+23−17
@@ -75,6 +75,7 @@ enum mlx5_flow_namespace_type { · 74 unmodified lines
75 MLX5_FLOW_NAMESPACE_SNIFFER_TX,75 MLX5_FLOW_NAMESPACE_SNIFFER_TX,
76 MLX5_FLOW_NAMESPACE_EGRESS,76 MLX5_FLOW_NAMESPACE_EGRESS,
77 MLX5_FLOW_NAMESPACE_RDMA_RX,77 MLX5_FLOW_NAMESPACE_RDMA_RX,
78 MLX5_FLOW_NAMESPACE_RDMA_RX_KERNEL,
78};79};
79 80
80enum {81enum {
@@ -83,6 +84,8 @@ enum { · 2 unmodified lines
83 FDB_SLOW_PATH,84 FDB_SLOW_PATH,
84};85};
85 86
87struct mlx5_pkt_reformat;
88struct mlx5_modify_hdr;
86struct mlx5_flow_table;89struct mlx5_flow_table;
87struct mlx5_flow_group;90struct mlx5_flow_group;
88struct mlx5_flow_namespace;91struct mlx5_flow_namespace;
@@ -120,12 +123,17 @@ struct mlx5_flow_destination { · 31 unmodified lines
120 struct {123 struct {
121 u16 num;124 u16 num;
122 u16 vhca_id;125 u16 vhca_id;
123 u32 reformat_id;126 struct mlx5_pkt_reformat *pkt_reformat;
124 u8 flags;127 u8 flags;
125 } vport;128 } vport;
126 };129 };
127};130};
128 131
132struct mod_hdr_tbl {
133 struct mutex lock; /* protects hlist */
134 DECLARE_HASHTABLE(hlist, 8);
135};
136
129struct mlx5_flow_namespace *137struct mlx5_flow_namespace *
130mlx5_get_fdb_sub_ns(struct mlx5_core_dev *dev, int n);138mlx5_get_fdb_sub_ns(struct mlx5_core_dev *dev, int n);
131struct mlx5_flow_namespace *139struct mlx5_flow_namespace *
@@ -189,8 +197,8 @@ enum { · 57 unmodified lines
189 197
190struct mlx5_flow_act {198struct mlx5_flow_act {
191 u32 action;199 u32 action;
192 u32 reformat_id;200 struct mlx5_modify_hdr *modify_hdr;
193 u32 modify_id;201 struct mlx5_pkt_reformat *pkt_reformat;
194 uintptr_t esp_id;202 uintptr_t esp_id;
195 u32 flags;203 u32 flags;
196 struct mlx5_fs_vlan vlan[MLX5_FS_VLAN_DEPTH];204 struct mlx5_fs_vlan vlan[MLX5_FS_VLAN_DEPTH];
@@ -199,8 +207,6 @@ struct mlx5_flow_act { · 2 unmodified lines
199 207
200#define MLX5_DECLARE_FLOW_ACT(name) \208#define MLX5_DECLARE_FLOW_ACT(name) \
201 struct mlx5_flow_act name = { .action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,\209 struct mlx5_flow_act name = { .action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST,\
202 .reformat_id = 0, \
203 .modify_id = 0, \
204 .flags = 0, }210 .flags = 0, }
205 211
206/* Single destination per rule.212/* Single destination per rule.
@@ -220,6 +226,7 @@ int mlx5_modify_rule_destination(struct mlx5_flow_handle *handler, · 13 unmodified lines
220 226
221struct mlx5_fc *mlx5_fc_create(struct mlx5_core_dev *dev, bool aging);227struct mlx5_fc *mlx5_fc_create(struct mlx5_core_dev *dev, bool aging);
222void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter);228void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter);
229u64 mlx5_fc_query_lastuse(struct mlx5_fc *counter);
223void mlx5_fc_query_cached(struct mlx5_fc *counter,230void mlx5_fc_query_cached(struct mlx5_fc *counter,
224 u64 *bytes, u64 *packets, u64 *lastuse);231 u64 *bytes, u64 *packets, u64 *lastuse);
225int mlx5_fc_query(struct mlx5_core_dev *dev, struct mlx5_fc *counter,232int 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
229int mlx5_fs_add_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn);236int mlx5_fs_add_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn);
230int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn);237int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn);
231 238
232int mlx5_modify_header_alloc(struct mlx5_core_dev *dev,239struct mlx5_modify_hdr *mlx5_modify_header_alloc(struct mlx5_core_dev *dev,
233 u8 namespace, u8 num_actions,240 u8 ns_type, u8 num_actions,
234 void *modify_actions, u32 *modify_header_id);241 void *modify_actions);
235void mlx5_modify_header_dealloc(struct mlx5_core_dev *dev,242void mlx5_modify_header_dealloc(struct mlx5_core_dev *dev,
236 u32 modify_header_id);243 struct mlx5_modify_hdr *modify_hdr);
237 244
238int mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev,245struct mlx5_pkt_reformat *mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev,
239 int reformat_type,246 int reformat_type,
240 size_t size,247 size_t size,
241 void *reformat_data,248 void *reformat_data,
242 enum mlx5_flow_namespace_type namespace,249 enum mlx5_flow_namespace_type ns_type);
243 u32 *packet_reformat_id);
244void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,250void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,
245 u32 packet_reformat_id);251 struct mlx5_pkt_reformat *reformat);
246 252
247#endif253#endif
include/linux/mlx5/mlx5_ifc.h+271−54
@@ -172,6 +172,8 @@ enum { · 171 unmodified lines
172 MLX5_CMD_OP_QUERY_XRQ_DC_PARAMS_ENTRY = 0x725,172 MLX5_CMD_OP_QUERY_XRQ_DC_PARAMS_ENTRY = 0x725,
173 MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY = 0x726,173 MLX5_CMD_OP_SET_XRQ_DC_PARAMS_ENTRY = 0x726,
174 MLX5_CMD_OP_QUERY_XRQ_ERROR_PARAMS = 0x727,174 MLX5_CMD_OP_QUERY_XRQ_ERROR_PARAMS = 0x727,
175 MLX5_CMD_OP_RELEASE_XRQ_ERROR = 0x729,
176 MLX5_CMD_OP_MODIFY_XRQ = 0x72a,
175 MLX5_CMD_OP_QUERY_ESW_FUNCTIONS = 0x740,177 MLX5_CMD_OP_QUERY_ESW_FUNCTIONS = 0x740,
176 MLX5_CMD_OP_QUERY_VPORT_STATE = 0x750,178 MLX5_CMD_OP_QUERY_VPORT_STATE = 0x750,
177 MLX5_CMD_OP_MODIFY_VPORT_STATE = 0x751,179 MLX5_CMD_OP_MODIFY_VPORT_STATE = 0x751,
@@ -293,6 +295,7 @@ enum { · 115 unmodified lines
293 MLX5_CMD_OP_DESTROY_UCTX = 0xa06,295 MLX5_CMD_OP_DESTROY_UCTX = 0xa06,
294 MLX5_CMD_OP_CREATE_UMEM = 0xa08,296 MLX5_CMD_OP_CREATE_UMEM = 0xa08,
295 MLX5_CMD_OP_DESTROY_UMEM = 0xa0a,297 MLX5_CMD_OP_DESTROY_UMEM = 0xa0a,
298 MLX5_CMD_OP_SYNC_STEERING = 0xb00,
296 MLX5_CMD_OP_MAX299 MLX5_CMD_OP_MAX
297};300};
298 301
@@ -483,7 +486,11 @@ union mlx5_ifc_gre_key_bits { · 184 unmodified lines
483};486};
484 487
485struct mlx5_ifc_fte_match_set_misc_bits {488struct 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];
487 u8 source_sqn[0x18];494 u8 source_sqn[0x18];
488 495
489 u8 source_eswitch_owner_vhca_id[0x10];496 u8 source_eswitch_owner_vhca_id[0x10];
@@ -563,12 +570,38 @@ struct mlx5_ifc_fte_match_set_misc2_bits { · 73 unmodified lines
563 570
564 u8 metadata_reg_a[0x20];571 u8 metadata_reg_a[0x20];
565 572
566 u8 reserved_at_1a0[0x60];573 u8 metadata_reg_b[0x20];
574
575 u8 reserved_at_1c0[0x40];
567};576};
568 577
569struct mlx5_ifc_fte_match_set_misc3_bits {578struct 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
571 u8 geneve_tlv_option_0_data[0x20];603 u8 geneve_tlv_option_0_data[0x20];
604
572 u8 reserved_at_140[0xc0];605 u8 reserved_at_140[0xc0];
573};606};
574 607
@@ -664,7 +697,15 @@ struct mlx5_ifc_flow_table_nic_cap_bits { · 89 unmodified lines
664 697
665 struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_transmit_sniffer;698 struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_transmit_sniffer;
666 699
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];
668};709};
669 710
670enum {711enum {
@@ -696,7 +737,17 @@ struct mlx5_ifc_flow_table_eswitch_cap_bits { · 25 unmodified lines
696 737
697 struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_esw_acl_egress;738 struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_esw_acl_egress;
698 739
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];
700};751};
701 752
702enum {753enum {
@@ -806,7 +857,9 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_bits { · 103 unmodified lines
806 u8 swp_csum[0x1];857 u8 swp_csum[0x1];
807 u8 swp_lso[0x1];858 u8 swp_lso[0x1];
808 u8 cqe_checksum_full[0x1];859 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];
810 u8 max_vxlan_udp_ports[0x8];863 u8 max_vxlan_udp_ports[0x8];
811 u8 reserved_at_38[0x6];864 u8 reserved_at_38[0x6];
812 u8 max_geneve_opt_len[0x1];865 u8 max_geneve_opt_len[0x1];
@@ -845,6 +898,25 @@ struct mlx5_ifc_roce_cap_bits { · 32 unmodified lines
845 u8 reserved_at_100[0x700];898 u8 reserved_at_100[0x700];
846};899};
847 900
901struct 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
911struct 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
848struct mlx5_ifc_device_mem_cap_bits {920struct mlx5_ifc_device_mem_cap_bits {
849 u8 memic[0x1];921 u8 memic[0x1];
850 u8 reserved_at_1[0x1f];922 u8 reserved_at_1[0x1f];
@@ -944,7 +1016,9 @@ struct mlx5_ifc_odp_cap_bits { · 93 unmodified lines
944 1016
945 struct mlx5_ifc_odp_per_transport_service_cap_bits xrc_odp_caps;1017 struct mlx5_ifc_odp_per_transport_service_cap_bits xrc_odp_caps;
946 1018
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];
948};1022};
949 1023
950struct mlx5_ifc_calc_op {1024struct mlx5_ifc_calc_op {
@@ -1035,11 +1109,32 @@ enum { · 84 unmodified lines
1035 MLX5_CAP_UMR_FENCE_NONE = 0x2,1109 MLX5_CAP_UMR_FENCE_NONE = 0x2,
1036};1110};
1037 1111
1112enum {
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
1038enum {1118enum {
1039 MLX5_UCTX_CAP_RAW_TX = 1UL << 0,1119 MLX5_UCTX_CAP_RAW_TX = 1UL << 0,
1040 MLX5_UCTX_CAP_INTERNAL_DEV_RES = 1UL << 1,1120 MLX5_UCTX_CAP_INTERNAL_DEV_RES = 1UL << 1,
1041};1121};
1042 1122
1123#define MLX5_FC_BULK_SIZE_FACTOR 128
1124
1125enum 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
1043struct mlx5_ifc_cmd_hca_cap_bits {1138struct mlx5_ifc_cmd_hca_cap_bits {
1044 u8 reserved_at_0[0x30];1139 u8 reserved_at_0[0x30];
1045 u8 vhca_id[0x10];1140 u8 vhca_id[0x10];
@@ -1099,7 +1194,10 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 53 unmodified lines
1099 u8 cache_line_128byte[0x1];1194 u8 cache_line_128byte[0x1];
1100 u8 reserved_at_165[0x4];1195 u8 reserved_at_165[0x4];
1101 u8 rts2rts_qp_counters_set_id[0x1];1196 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];
1103 u8 qcam_reg[0x1];1201 u8 qcam_reg[0x1];
1104 u8 gid_table_size[0x10];1202 u8 gid_table_size[0x10];
1105 1203
@@ -1228,7 +1326,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 122 unmodified lines
1228 u8 reserved_at_263[0x8];1326 u8 reserved_at_263[0x8];
1229 u8 log_bf_reg_size[0x5];1327 u8 log_bf_reg_size[0x5];
1230 1328
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];
1232 u8 lag_master[0x1];1332 u8 lag_master[0x1];
1233 u8 num_lag_ports[0x4];1333 u8 num_lag_ports[0x4];
1234 1334
@@ -1244,7 +1344,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 9 unmodified lines
1244 u8 reserved_at_2e0[0x7];1344 u8 reserved_at_2e0[0x7];
1245 u8 max_qp_mcg[0x19];1345 u8 max_qp_mcg[0x19];
1246 1346
1247 u8 reserved_at_300[0x18];1347 u8 reserved_at_300[0x10];
1348 u8 flow_counter_bulk_alloc[0x8];
1248 u8 log_max_mcg[0x8];1349 u8 log_max_mcg[0x8];
1249 1350
1250 u8 reserved_at_320[0x3];1351 u8 reserved_at_320[0x3];
@@ -1388,7 +1489,14 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 137 unmodified lines
1388 1489
1389 u8 reserved_at_6c0[0x4];1490 u8 reserved_at_6c0[0x4];
1390 u8 flex_parser_id_geneve_tlv_option_0[0x4];1491 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];
1392 u8 sf_base_id[0x10];1500 u8 sf_base_id[0x10];
1393 1501
1394 u8 reserved_at_700[0x80];1502 u8 reserved_at_700[0x80];
@@ -1853,12 +1961,28 @@ struct mlx5_ifc_ib_port_cntrs_grp_data_layout_bits { · 458 unmodified lines
1853 u8 port_xmit_wait[0x20];1961 u8 port_xmit_wait[0x20];
1854};1962};
1855 1963
1856struct mlx5_ifc_eth_per_traffic_grp_data_layout_bits {1964struct mlx5_ifc_eth_per_tc_prio_grp_data_layout_bits {
1857 u8 transmit_queue_high[0x20];1965 u8 transmit_queue_high[0x20];
1858 1966
1859 u8 transmit_queue_low[0x20];1967 u8 transmit_queue_low[0x20];
1860 1968
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
1976struct 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];
1862};1986};
1863 1987
1864struct mlx5_ifc_eth_per_prio_grp_data_layout_bits {1988struct mlx5_ifc_eth_per_prio_grp_data_layout_bits {
@@ -2626,6 +2750,7 @@ union mlx5_ifc_hca_cap_union_bits { · 761 unmodified lines
2626 struct mlx5_ifc_debug_cap_bits debug_cap;2750 struct mlx5_ifc_debug_cap_bits debug_cap;
2627 struct mlx5_ifc_fpga_cap_bits fpga_cap;2751 struct mlx5_ifc_fpga_cap_bits fpga_cap;
2628 struct mlx5_ifc_tls_cap_bits tls_cap;2752 struct mlx5_ifc_tls_cap_bits tls_cap;
2753 struct mlx5_ifc_device_mem_cap_bits device_mem_cap;
2629 u8 reserved_at_0[0x8000];2754 u8 reserved_at_0[0x8000];
2630};2755};
2631 2756
@@ -2754,7 +2879,11 @@ struct mlx5_ifc_vnic_diagnostic_statistics_bits { · 122 unmodified lines
2754 2879
2755 u8 transmit_discard_vport_down[0x40];2880 u8 transmit_discard_vport_down[0x40];
2756 2881
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];
2758};2887};
2759 2888
2760struct mlx5_ifc_traffic_counter_bits {2889struct mlx5_ifc_traffic_counter_bits {
@@ -2766,7 +2895,7 @@ struct mlx5_ifc_traffic_counter_bits { · 5 unmodified lines
2766struct mlx5_ifc_tisc_bits {2895struct mlx5_ifc_tisc_bits {
2767 u8 strict_lag_tx_port_affinity[0x1];2896 u8 strict_lag_tx_port_affinity[0x1];
2768 u8 tls_en[0x1];2897 u8 tls_en[0x1];
2769 u8 reserved_at_1[0x2];2898 u8 reserved_at_2[0x2];
2770 u8 lag_tx_port_affinity[0x04];2899 u8 lag_tx_port_affinity[0x04];
2771 2900
2772 u8 reserved_at_8[0x4];2901 u8 reserved_at_8[0x4];
@@ -2941,6 +3070,13 @@ enum { · 168 unmodified lines
2941 SCHEDULING_CONTEXT_ELEMENT_TYPE_PARA_VPORT_TC = 0x3,3070 SCHEDULING_CONTEXT_ELEMENT_TYPE_PARA_VPORT_TC = 0x3,
2942};3071};
2943 3072
3073enum {
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
2944struct mlx5_ifc_scheduling_context_bits {3080struct mlx5_ifc_scheduling_context_bits {
2945 u8 element_type[0x8];3081 u8 element_type[0x8];
2946 u8 reserved_at_8[0x18];3082 u8 reserved_at_8[0x18];
@@ -3218,7 +3354,11 @@ struct mlx5_ifc_esw_vport_context_bits { · 271 unmodified lines
3218 u8 cvlan_pcp[0x3];3354 u8 cvlan_pcp[0x3];
3219 u8 cvlan_id[0xc];3355 u8 cvlan_id[0xc];
3220 3356
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];
3222};3362};
3223 3363
3224enum {3364enum {
@@ -3519,7 +3659,8 @@ union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits { · 294 unmodified lines
3519 struct mlx5_ifc_eth_3635_cntrs_grp_data_layout_bits eth_3635_cntrs_grp_data_layout;3659 struct mlx5_ifc_eth_3635_cntrs_grp_data_layout_bits eth_3635_cntrs_grp_data_layout;
3520 struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits eth_extended_cntrs_grp_data_layout;3660 struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits eth_extended_cntrs_grp_data_layout;
3521 struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout;3661 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;
3523 struct mlx5_ifc_ib_port_cntrs_grp_data_layout_bits ib_port_cntrs_grp_data_layout;3664 struct mlx5_ifc_ib_port_cntrs_grp_data_layout_bits ib_port_cntrs_grp_data_layout;
3524 struct mlx5_ifc_phys_layer_cntrs_bits phys_layer_cntrs;3665 struct mlx5_ifc_phys_layer_cntrs_bits phys_layer_cntrs;
3525 struct mlx5_ifc_phys_layer_statistical_cntrs_bits phys_layer_statistical_cntrs;3666 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
4904 u8 reserved_at_20[0x10];5045 u8 reserved_at_20[0x10];
4905 u8 op_mod[0x10];5046 u8 op_mod[0x10];
4906 5047
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
5055struct mlx5_ifc_other_hca_cap_bits {
5056 u8 roce[0x1];
5057 u8 reserved_at_1[0x27f];
5058};
5059
5060struct mlx5_ifc_query_other_hca_cap_out_bits {
5061 u8 status[0x8];
5062 u8 reserved_at_8[0x18];
5063
5064 u8 syndrome[0x20];
5065
4907 u8 reserved_at_40[0x40];5066 u8 reserved_at_40[0x40];
5067
5068 struct mlx5_ifc_other_hca_cap_bits other_capability;
4908};5069};
4909 5070
4910struct mlx5_ifc_query_flow_table_out_bits {5071struct 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
5084struct mlx5_ifc_modify_other_hca_cap_out_bits {
4911 u8 status[0x8];5085 u8 status[0x8];
4912 u8 reserved_at_8[0x18];5086 u8 reserved_at_8[0x18];
4913 5087
4914 u8 syndrome[0x20];5088 u8 syndrome[0x20];
4915 5089
4916 u8 reserved_at_40[0x80];5090 u8 reserved_at_40[0x40];
5091};
4917 5092
4918 u8 reserved_at_c0[0x8];5093struct 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
5107struct 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];
4919 u8 level[0x8];5113 u8 level[0x8];
4920 u8 reserved_at_d0[0x8];5114 u8 reserved_at_10[0x8];
4921 u8 log_size[0x8];5115 u8 log_size[0x8];
4922 5116
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
5131struct 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;
4924};5140};
4925 5141
4926struct mlx5_ifc_query_flow_table_in_bits {5142struct mlx5_ifc_query_flow_table_in_bits {
@@ -5190,7 +5406,7 @@ struct mlx5_ifc_alloc_packet_reformat_context_out_bits { · 263 unmodified lines
5190 u8 reserved_at_60[0x20];5406 u8 reserved_at_60[0x20];
5191};5407};
5192 5408
5193enum {5409enum mlx5_reformat_ctx_type {
5194 MLX5_REFORMAT_TYPE_L2_TO_VXLAN = 0x0,5410 MLX5_REFORMAT_TYPE_L2_TO_VXLAN = 0x0,
5195 MLX5_REFORMAT_TYPE_L2_TO_NVGRE = 0x1,5411 MLX5_REFORMAT_TYPE_L2_TO_NVGRE = 0x1,
5196 MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL = 0x2,5412 MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL = 0x2,
@@ -5286,7 +5502,16 @@ enum { · 89 unmodified lines
5286 MLX5_ACTION_IN_FIELD_OUT_DIPV4 = 0x16,5502 MLX5_ACTION_IN_FIELD_OUT_DIPV4 = 0x16,
5287 MLX5_ACTION_IN_FIELD_OUT_FIRST_VID = 0x17,5503 MLX5_ACTION_IN_FIELD_OUT_FIRST_VID = 0x17,
5288 MLX5_ACTION_IN_FIELD_OUT_IPV6_HOPLIMIT = 0x47,5504 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,
5289 MLX5_ACTION_IN_FIELD_METADATA_REG_C_0 = 0x51,5507 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,
5290};5515};
5291 5516
5292struct mlx5_ifc_alloc_modify_header_context_out_bits {5517struct mlx5_ifc_alloc_modify_header_context_out_bits {
@@ -5975,10 +6200,12 @@ struct mlx5_ifc_modify_cq_in_bits { · 682 unmodified lines
5975 6200
5976 struct mlx5_ifc_cqc_bits cq_context;6201 struct mlx5_ifc_cqc_bits cq_context;
5977 6202
5978 u8 reserved_at_280[0x40];6203 u8 reserved_at_280[0x60];
5979 6204
5980 u8 cq_umem_valid[0x1];6205 u8 cq_umem_valid[0x1];
5981 u8 reserved_at_2c1[0x5bf];6206 u8 reserved_at_2e1[0x1f];
6207
6208 u8 reserved_at_300[0x580];
5982 6209
5983 u8 pas[0][0x40];6210 u8 pas[0][0x40];
5984};6211};
@@ -7332,35 +7559,26 @@ struct mlx5_ifc_create_mkey_in_bits { · 1347 unmodified lines
7332 u8 klm_pas_mtt[0][0x20];7559 u8 klm_pas_mtt[0][0x20];
7333};7560};
7334 7561
7562enum {
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
7335struct mlx5_ifc_create_flow_table_out_bits {7572struct mlx5_ifc_create_flow_table_out_bits {
7336 u8 status[0x8];7573 u8 status[0x8];
7337 u8 reserved_at_8[0x18];7574 u8 icm_address_63_40[0x18];
7338 7575
7339 u8 syndrome[0x20];7576 u8 syndrome[0x20];
7340 7577
7341 u8 reserved_at_40[0x8];7578 u8 icm_address_39_32[0x8];
7342 u8 table_id[0x18];7579 u8 table_id[0x18];
7343 7580
7344 u8 reserved_at_60[0x20];7581 u8 icm_address_31_0[0x20];
7345};
7346
7347struct 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];
7364};7582};
7365 7583
7366struct mlx5_ifc_create_flow_table_in_bits {7584struct mlx5_ifc_create_flow_table_in_bits {
@@ -7815,7 +8033,8 @@ struct mlx5_ifc_alloc_flow_counter_in_bits { · 448 unmodified lines
7815 u8 reserved_at_20[0x10];8033 u8 reserved_at_20[0x10];
7816 u8 op_mod[0x10];8034 u8 op_mod[0x10];
7817 8035
7818 u8 reserved_at_40[0x40];8036 u8 reserved_at_40[0x38];
8037 u8 flow_counter_bulk[0x8];
7819};8038};
7820 8039
7821struct mlx5_ifc_add_vxlan_udp_dport_out_bits {8040struct mlx5_ifc_add_vxlan_udp_dport_out_bits {
@@ -9221,7 +9440,8 @@ union mlx5_ifc_ports_control_registers_document_bits { · 1399 unmodified lines
9221 struct mlx5_ifc_eth_802_3_cntrs_grp_data_layout_bits eth_802_3_cntrs_grp_data_layout;9440 struct mlx5_ifc_eth_802_3_cntrs_grp_data_layout_bits eth_802_3_cntrs_grp_data_layout;
9222 struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits eth_extended_cntrs_grp_data_layout;9441 struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bits eth_extended_cntrs_grp_data_layout;
9223 struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout;9442 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;
9225 struct mlx5_ifc_lane_2_module_mapping_bits lane_2_module_mapping;9445 struct mlx5_ifc_lane_2_module_mapping_bits lane_2_module_mapping;
9226 struct mlx5_ifc_pamp_reg_bits pamp_reg;9446 struct mlx5_ifc_pamp_reg_bits pamp_reg;
9227 struct mlx5_ifc_paos_reg_bits paos_reg;9447 struct mlx5_ifc_paos_reg_bits paos_reg;
@@ -9568,8 +9788,6 @@ struct mlx5_ifc_query_lag_out_bits { · 340 unmodified lines
9568 9788
9569 u8 syndrome[0x20];9789 u8 syndrome[0x20];
9570 9790
9571 u8 reserved_at_40[0x40];
9572
9573 struct mlx5_ifc_lagc_bits ctx;9791 struct mlx5_ifc_lagc_bits ctx;
9574};9792};
9575 9793
@@ -10052,9 +10270,8 @@ struct mlx5_ifc_tls_static_params_bits { · 476 unmodified lines
10052};10270};
10053 10271
10054struct mlx5_ifc_tls_progress_params_bits {10272struct mlx5_ifc_tls_progress_params_bits {
10055 u8 valid[0x1];10273 u8 reserved_at_0[0x8];
10056 u8 reserved_at_1[0x7];10274 u8 tisn[0x18];
10057 u8 pd[0x18];
10058 10275
10059 u8 next_record_tcp_sn[0x20];10276 u8 next_record_tcp_sn[0x20];
10060 10277
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
805 page[1].compound_order = order;805 page[1].compound_order = order;
806}806}
807 807
808/* Returns the number of pages in this potentially compound page. */
809static 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. */
815static 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 */
821static inline unsigned int page_shift(struct page *page)
822{
823 return PAGE_SHIFT + compound_order(page);
824}
825
808void free_compound_page(struct page *page);826void free_compound_page(struct page *page);
809 827
810#ifdef CONFIG_MMU828#ifdef CONFIG_MMU
@@ -1057,8 +1075,9 @@ static inline void put_user_page(struct page *page) · 246 unmodified lines
1057 put_page(page);1075 put_page(page);
1058}1076}
1059 1077
1060void put_user_pages_dirty(struct page **pages, unsigned long npages);1078void put_user_pages_dirty_lock(struct page **pages, unsigned long npages,
1061void put_user_pages_dirty_lock(struct page **pages, unsigned long npages);1079 bool make_dirty);
1080
1062void put_user_pages(struct page **pages, unsigned long npages);1081void put_user_pages(struct page **pages, unsigned long npages);
1063 1082
1064#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)1083#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
@@ -1405,7 +1424,11 @@ extern void pagefault_out_of_memory(void); · 340 unmodified lines
1405 1424
1406extern void show_free_areas(unsigned int flags, nodemask_t *nodemask);1425extern void show_free_areas(unsigned int flags, nodemask_t *nodemask);
1407 1426
1427#ifdef CONFIG_MMU
1408extern bool can_do_mlock(void);1428extern bool can_do_mlock(void);
1429#else
1430static inline bool can_do_mlock(void) { return false; }
1431#endif
1409extern int user_shm_lock(size_t, struct user_struct *);1432extern int user_shm_lock(size_t, struct user_struct *);
1410extern void user_shm_unlock(size_t, struct user_struct *);1433extern void user_shm_unlock(size_t, struct user_struct *);
1411 1434
@@ -1430,54 +1453,8 @@ void zap_page_range(struct vm_area_struct *vma, unsigned long address, · 18 unmodified lines
1430void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma,1453void unmap_vmas(struct mmu_gather *tlb, struct vm_area_struct *start_vma,
1431 unsigned long start, unsigned long end);1454 unsigned long start, unsigned long end);
1432 1455
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 */
1457struct 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
1476struct mmu_notifier_range;1456struct mmu_notifier_range;
1477 1457
1478int walk_page_range(unsigned long addr, unsigned long end,
1479 struct mm_walk *walk);
1480int walk_page_vma(struct vm_area_struct *vma, struct mm_walk *walk);
1481void free_pgd_range(struct mmu_gather *tlb, unsigned long addr,1458void free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
1482 unsigned long end, unsigned long floor, unsigned long ceiling);1459 unsigned long end, unsigned long floor, unsigned long ceiling);
1483int copy_page_range(struct mm_struct *dst, struct mm_struct *src,1460int copy_page_range(struct mm_struct *dst, struct mm_struct *src,
@@ -1972,7 +1949,7 @@ static inline void pgtable_init(void) · 488 unmodified lines
1972 pgtable_cache_init();1949 pgtable_cache_init();
1973}1950}
1974 1951
1975static inline bool pgtable_page_ctor(struct page *page)1952static inline bool pgtable_pte_page_ctor(struct page *page)
1976{1953{
1977 if (!ptlock_init(page))1954 if (!ptlock_init(page))
1978 return false;1955 return false;
@@ -1981,7 +1958,7 @@ static inline bool pgtable_page_ctor(struct page *page) · 2 unmodified lines
1981 return true;1958 return true;
1982}1959}
1983 1960
1984static inline void pgtable_page_dtor(struct page *page)1961static inline void pgtable_pte_page_dtor(struct page *page)
1985{1962{
1986 ptlock_free(page);1963 ptlock_free(page);
1987 __ClearPageTable(page);1964 __ClearPageTable(page);
@@ -2351,6 +2328,8 @@ extern int install_special_mapping(struct mm_struct *mm, · 363 unmodified lines
2351 unsigned long addr, unsigned long len,2328 unsigned long addr, unsigned long len,
2352 unsigned long flags, struct page **pages);2329 unsigned long flags, struct page **pages);
2353 2330
2331unsigned long randomize_stack_top(unsigned long stack_top);
2332
2354extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);2333extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
2355 2334
2356extern unsigned long mmap_region(struct file *file, unsigned long addr,2335extern 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
2614#define FOLL_COW 0x4000 /* internal GUP flag */2593#define FOLL_COW 0x4000 /* internal GUP flag */
2615#define FOLL_ANON 0x8000 /* don't do file mappings */2594#define FOLL_ANON 0x8000 /* don't do file mappings */
2616#define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite: see below */2595#define FOLL_LONGTERM 0x10000 /* mapping lifetime is indefinite: see below */
2596#define FOLL_SPLIT_PMD 0x20000 /* split huge pmd before returning */
2617 2597
2618/*2598/*
2619 * NOTE on FOLL_LONGTERM:2599 * NOTE on FOLL_LONGTERM:
@@ -2891,5 +2871,12 @@ void __init setup_nr_node_ids(void); · 271 unmodified lines
2891static inline void setup_nr_node_ids(void) {}2871static inline void setup_nr_node_ids(void) {}
2892#endif2872#endif
2893 2873
2874extern int memcmp_pages(struct page *page1, struct page *page2);
2875
2876static inline int pages_identical(struct page *page1, struct page *page2)
2877{
2878 return !memcmp_pages(page1, page2);
2879}
2880
2894#endif /* __KERNEL__ */2881#endif /* __KERNEL__ */
2895#endif /* _LINUX_MM_H */2882#endif /* _LINUX_MM_H */
include/linux/mm_types.h+22−10
@@ -25,7 +25,6 @@ · 24 unmodified lines
25 25
26struct address_space;26struct address_space;
27struct mem_cgroup;27struct mem_cgroup;
28struct hmm;
29 28
30/*29/*
31 * Each physical page in the system has a struct page associated with30 * Each physical page in the system has a struct page associated with
@@ -139,6 +138,7 @@ struct page { · 107 unmodified lines
139 struct { /* Second tail page of compound page */138 struct { /* Second tail page of compound page */
140 unsigned long _compound_pad_1; /* compound_head */139 unsigned long _compound_pad_1; /* compound_head */
141 unsigned long _compound_pad_2;140 unsigned long _compound_pad_2;
141 /* For both global and memcg */
142 struct list_head deferred_list;142 struct list_head deferred_list;
143 };143 };
144 struct { /* Page table pages */144 struct { /* Page table pages */
@@ -159,7 +159,16 @@ struct page { · 14 unmodified lines
159 /** @pgmap: Points to the hosting device page map. */159 /** @pgmap: Points to the hosting device page map. */
160 struct dev_pagemap *pgmap;160 struct dev_pagemap *pgmap;
161 void *zone_device_data;161 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 */
163 };172 };
164 173
165 /** @rcu_head: You can use this to free a page by RCU. */174 /** @rcu_head: You can use this to free a page by RCU. */
@@ -374,6 +383,16 @@ struct mm_struct { · 208 unmodified lines
374 unsigned long highest_vm_end; /* highest vma end address */383 unsigned long highest_vm_end; /* highest vma end address */
375 pgd_t * pgd;384 pgd_t * pgd;
376 385
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
377 /**396 /**
378 * @mm_users: The number of users including userspace.397 * @mm_users: The number of users including userspace.
379 *398 *
@@ -443,9 +462,7 @@ struct mm_struct { · 63 unmodified lines
443 unsigned long flags; /* Must use atomic bitops to access */462 unsigned long flags; /* Must use atomic bitops to access */
444 463
445 struct core_state *core_state; /* coredumping support */464 struct core_state *core_state; /* coredumping support */
446#ifdef CONFIG_MEMBARRIER465
447 atomic_t membarrier_state;
448#endif
449#ifdef CONFIG_AIO466#ifdef CONFIG_AIO
450 spinlock_t ioctx_lock;467 spinlock_t ioctx_lock;
451 struct kioctx_table __rcu *ioctx_table;468 struct kioctx_table __rcu *ioctx_table;
@@ -502,11 +519,6 @@ struct mm_struct { · 50 unmodified lines
502 atomic_long_t hugetlb_usage;519 atomic_long_t hugetlb_usage;
503#endif520#endif
504 struct work_struct async_put_work;521 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
510 } __randomize_layout;522 } __randomize_layout;
511 523
512 /*524 /*
include/linux/mm_types_task.h+4−0
@@ -36,6 +36,10 @@ struct vmacache { · 35 unmodified lines
36 struct vm_area_struct *vmas[VMACACHE_SIZE];36 struct vm_area_struct *vmas[VMACACHE_SIZE];
37};37};
38 38
39/*
40 * When updating this, please also update struct resident_page_types[] in
41 * kernel/fork.c
42 */
39enum {43enum {
40 MM_FILEPAGES, /* Resident file mapping pages */44 MM_FILEPAGES, /* Resident file mapping pages */
41 MM_ANONPAGES, /* Resident anonymous pages */45 MM_ANONPAGES, /* Resident anonymous pages */
include/linux/mmc/host.h+12−0
@@ -128,6 +128,7 @@ struct mmc_host_ops { · 127 unmodified lines
128 int (*get_cd)(struct mmc_host *host);128 int (*get_cd)(struct mmc_host *host);
129 129
130 void (*enable_sdio_irq)(struct mmc_host *host, int enable);130 void (*enable_sdio_irq)(struct mmc_host *host, int enable);
131 /* Mandatory callback when using MMC_CAP2_SDIO_IRQ_NOTHREAD. */
131 void (*ack_sdio_irq)(struct mmc_host *host);132 void (*ack_sdio_irq)(struct mmc_host *host);
132 133
133 /* optional callback for HC quirks */134 /* optional callback for HC quirks */
@@ -367,6 +368,7 @@ struct mmc_host { · 233 unmodified lines
367#define MMC_CAP2_CQE (1 << 23) /* Has eMMC command queue engine */368#define MMC_CAP2_CQE (1 << 23) /* Has eMMC command queue engine */
368#define MMC_CAP2_CQE_DCMD (1 << 24) /* CQE can issue a direct command */369#define MMC_CAP2_CQE_DCMD (1 << 24) /* CQE can issue a direct command */
369#define MMC_CAP2_AVOID_3_3V (1 << 25) /* Host must negotiate down from 3.3V */370#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 */
370 372
371 int fixed_drv_type; /* fixed driver type for non-removable media */373 int fixed_drv_type; /* fixed driver type for non-removable media */
372 374
@@ -396,6 +398,7 @@ struct mmc_host { · 23 unmodified lines
396 unsigned int retune_paused:1; /* re-tuning is temporarily disabled */398 unsigned int retune_paused:1; /* re-tuning is temporarily disabled */
397 unsigned int use_blk_mq:1; /* use blk-mq */399 unsigned int use_blk_mq:1; /* use blk-mq */
398 unsigned int retune_crc_disable:1; /* don't trigger retune upon crc */400 unsigned int retune_crc_disable:1; /* don't trigger retune upon crc */
401 unsigned int can_dma_map_merge:1; /* merging can be used */
399 402
400 int rescan_disable; /* disable card detection */403 int rescan_disable; /* disable card detection */
401 int rescan_entered; /* used with nonremovable devices */404 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
493 496
494void mmc_cqe_request_done(struct mmc_host *host, struct mmc_request *mrq);497void mmc_cqe_request_done(struct mmc_host *host, struct mmc_request *mrq);
495 498
499/*
500 * May be called from host driver's system/runtime suspend/resume callbacks,
501 * to know if SDIO IRQs has been claimed.
502 */
503static inline bool sdio_irq_claimed(struct mmc_host *host)
504{
505 return host->sdio_irqs > 0;
506}
507
496static inline void mmc_signal_sdio_irq(struct mmc_host *host)508static inline void mmc_signal_sdio_irq(struct mmc_host *host)
497{509{
498 host->ops->enable_sdio_irq(host, 0);510 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
42 42
43#ifdef CONFIG_MMU_NOTIFIER43#ifdef CONFIG_MMU_NOTIFIER
44 44
45#ifdef CONFIG_LOCKDEP
46extern struct lockdep_map __mmu_notifier_invalidate_range_start_map;
47#endif
48
45/*49/*
46 * The mmu notifier_mm structure is allocated and installed in50 * The mmu notifier_mm structure is allocated and installed in
47 * mm->mmu_notifier_mm inside the mm_take_all_locks() protected51 * mm->mmu_notifier_mm inside the mm_take_all_locks() protected
@@ -211,6 +215,19 @@ struct mmu_notifier_ops { · 163 unmodified lines
211 */215 */
212 void (*invalidate_range)(struct mmu_notifier *mn, struct mm_struct *mm,216 void (*invalidate_range)(struct mmu_notifier *mn, struct mm_struct *mm,
213 unsigned long start, unsigned long end);217 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);
214};231};
215 232
216/*233/*
@@ -227,6 +244,9 @@ struct mmu_notifier_ops { · 10 unmodified lines
227struct mmu_notifier {244struct mmu_notifier {
228 struct hlist_node hlist;245 struct hlist_node hlist;
229 const struct mmu_notifier_ops *ops;246 const struct mmu_notifier_ops *ops;
247 struct mm_struct *mm;
248 struct rcu_head rcu;
249 unsigned int users;
230};250};
231 251
232static inline int mm_has_notifiers(struct mm_struct *mm)252static 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
234 return unlikely(mm->mmu_notifier_mm);254 return unlikely(mm->mmu_notifier_mm);
235}255}
236 256
257struct mmu_notifier *mmu_notifier_get_locked(const struct mmu_notifier_ops *ops,
258 struct mm_struct *mm);
259static inline struct mmu_notifier *
260mmu_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}
269void mmu_notifier_put(struct mmu_notifier *mn);
270void mmu_notifier_synchronize(void);
271
237extern int mmu_notifier_register(struct mmu_notifier *mn,272extern int mmu_notifier_register(struct mmu_notifier *mn,
238 struct mm_struct *mm);273 struct mm_struct *mm);
239extern int __mmu_notifier_register(struct mmu_notifier *mn,274extern int __mmu_notifier_register(struct mmu_notifier *mn,
240 struct mm_struct *mm);275 struct mm_struct *mm);
241extern void mmu_notifier_unregister(struct mmu_notifier *mn,276extern void mmu_notifier_unregister(struct mmu_notifier *mn,
242 struct mm_struct *mm);277 struct mm_struct *mm);
243extern void mmu_notifier_unregister_no_release(struct mmu_notifier *mn,
244 struct mm_struct *mm);
245extern void __mmu_notifier_mm_destroy(struct mm_struct *mm);278extern void __mmu_notifier_mm_destroy(struct mm_struct *mm);
246extern void __mmu_notifier_release(struct mm_struct *mm);279extern void __mmu_notifier_release(struct mm_struct *mm);
247extern int __mmu_notifier_clear_flush_young(struct mm_struct *mm,280extern 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
310static inline void343static inline void
311mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range)344mmu_notifier_invalidate_range_start(struct mmu_notifier_range *range)
312{345{
346 might_sleep();
347
348 lock_map_acquire(&__mmu_notifier_invalidate_range_start_map);
313 if (mm_has_notifiers(range->mm)) {349 if (mm_has_notifiers(range->mm)) {
314 range->flags |= MMU_NOTIFIER_RANGE_BLOCKABLE;350 range->flags |= MMU_NOTIFIER_RANGE_BLOCKABLE;
315 __mmu_notifier_invalidate_range_start(range);351 __mmu_notifier_invalidate_range_start(range);
316 }352 }
353 lock_map_release(&__mmu_notifier_invalidate_range_start_map);
317}354}
318 355
319static inline int356static inline int
320mmu_notifier_invalidate_range_start_nonblock(struct mmu_notifier_range *range)357mmu_notifier_invalidate_range_start_nonblock(struct mmu_notifier_range *range)
321{358{
359 int ret = 0;
360
361 lock_map_acquire(&__mmu_notifier_invalidate_range_start_map);
322 if (mm_has_notifiers(range->mm)) {362 if (mm_has_notifiers(range->mm)) {
323 range->flags &= ~MMU_NOTIFIER_RANGE_BLOCKABLE;363 range->flags &= ~MMU_NOTIFIER_RANGE_BLOCKABLE;
324 return __mmu_notifier_invalidate_range_start(range);364 ret = __mmu_notifier_invalidate_range_start(range);
325 }365 }
326 return 0;366 lock_map_release(&__mmu_notifier_invalidate_range_start_map);
367 return ret;
327}368}
328 369
329static inline void370static inline void
330mmu_notifier_invalidate_range_end(struct mmu_notifier_range *range)371mmu_notifier_invalidate_range_end(struct mmu_notifier_range *range)
331{372{
373 if (mmu_notifier_range_blockable(range))
374 might_sleep();
375
332 if (mm_has_notifiers(range->mm))376 if (mm_has_notifiers(range->mm))
333 __mmu_notifier_invalidate_range_end(range, false);377 __mmu_notifier_invalidate_range_end(range, false);
334}378}
@@ -482,9 +526,6 @@ static inline void mmu_notifier_range_init(struct mmu_notifier_range *range, · 147 unmodified lines
482 set_pte_at(___mm, ___address, __ptep, ___pte); \526 set_pte_at(___mm, ___address, __ptep, ___pte); \
483})527})
484 528
485extern void mmu_notifier_call_srcu(struct rcu_head *rcu,
486 void (*func)(struct rcu_head *rcu));
487
488#else /* CONFIG_MMU_NOTIFIER */529#else /* CONFIG_MMU_NOTIFIER */
489 530
490struct mmu_notifier_range {531struct mmu_notifier_range {
@@ -581,6 +622,10 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm) · 90 unmodified lines
581#define pudp_huge_clear_flush_notify pudp_huge_clear_flush622#define pudp_huge_clear_flush_notify pudp_huge_clear_flush
582#define set_pte_at_notify set_pte_at623#define set_pte_at_notify set_pte_at
583 624
625static inline void mmu_notifier_synchronize(void)
626{
627}
628
584#endif /* CONFIG_MMU_NOTIFIER */629#endif /* CONFIG_MMU_NOTIFIER */
585 630
586#endif /* _LINUX_MMU_NOTIFIER_H */631#endif /* _LINUX_MMU_NOTIFIER_H */
include/linux/mmzone.h+14−5
@@ -215,8 +215,9 @@ enum node_stat_item { · 214 unmodified lines
215 NR_INACTIVE_FILE, /* " " " " " */215 NR_INACTIVE_FILE, /* " " " " " */
216 NR_ACTIVE_FILE, /* " " " " " */216 NR_ACTIVE_FILE, /* " " " " " */
217 NR_UNEVICTABLE, /* " " " " " */217 NR_UNEVICTABLE, /* " " " " " */
218 NR_SLAB_RECLAIMABLE,218 NR_SLAB_RECLAIMABLE, /* Please do not reorder this item */
219 NR_SLAB_UNRECLAIMABLE,219 NR_SLAB_UNRECLAIMABLE, /* and this one without looking at
220 * memcg_flush_percpu_vmstats() first. */
220 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */221 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */
221 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */222 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */
222 WORKINGSET_NODES,223 WORKINGSET_NODES,
@@ -234,6 +235,8 @@ enum node_stat_item { · 11 unmodified lines
234 NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */235 NR_SHMEM, /* shmem pages (included tmpfs/GEM pages) */
235 NR_SHMEM_THPS,236 NR_SHMEM_THPS,
236 NR_SHMEM_PMDMAPPED,237 NR_SHMEM_PMDMAPPED,
238 NR_FILE_THPS,
239 NR_FILE_PMDMAPPED,
237 NR_ANON_THPS,240 NR_ANON_THPS,
238 NR_UNSTABLE_NFS, /* NFS unstable pages */241 NR_UNSTABLE_NFS, /* NFS unstable pages */
239 NR_VMSCAN_WRITE,242 NR_VMSCAN_WRITE,
@@ -676,6 +679,14 @@ struct zonelist { · 436 unmodified lines
676extern struct page *mem_map;679extern struct page *mem_map;
677#endif680#endif
678 681
682#ifdef CONFIG_TRANSPARENT_HUGEPAGE
683struct deferred_split {
684 spinlock_t split_queue_lock;
685 struct list_head split_queue;
686 unsigned long split_queue_len;
687};
688#endif
689
679/*690/*
680 * On NUMA machines, each NUMA node would have a pg_data_t to describe691 * On NUMA machines, each NUMA node would have a pg_data_t to describe
681 * it's memory layout. On UMA machines there is a single pglist_data which692 * 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
755#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */766#endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */
756 767
757#ifdef CONFIG_TRANSPARENT_HUGEPAGE768#ifdef CONFIG_TRANSPARENT_HUGEPAGE
758 spinlock_t split_queue_lock;769 struct deferred_split deferred_split_queue;
759 struct list_head split_queue;
760 unsigned long split_queue_len;
761#endif770#endif
762 771
763 /* Fields commonly accessed by the page reclaim scanner */772 /* 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
814/**814/**
815 * struct wmi_device_id - WMI device identifier815 * struct wmi_device_id - WMI device identifier
816 * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba816 * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba
817 * @context: pointer to driver specific data
817 */818 */
818struct wmi_device_id {819struct wmi_device_id {
819 const char guid_string[UUID_STRING_LEN+1];820 const char guid_string[UUID_STRING_LEN+1];
include/linux/module.h+2−3
@@ -26,9 +26,6 @@ · 25 unmodified lines
26#include <linux/percpu.h>26#include <linux/percpu.h>
27#include <asm/module.h>27#include <asm/module.h>
28 28
29/* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */
30#define MODULE_SIG_STRING "~Module signature appended~\n"
31
32/* Not Yet Implemented */29/* Not Yet Implemented */
33#define MODULE_SUPPORTED_DEVICE(name)30#define MODULE_SUPPORTED_DEVICE(name)
34 31
@@ -276,6 +273,8 @@ extern typeof(name) __mod_##type##__##name##_device_table \ · 241 unmodified lines
276 * files require multiple MODULE_FIRMWARE() specifiers */273 * files require multiple MODULE_FIRMWARE() specifiers */
277#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)274#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
278 275
276#define MODULE_IMPORT_NS(ns) MODULE_INFO(import_ns, #ns)
277
279struct notifier_block;278struct notifier_block;
280 279
281#ifdef CONFIG_MODULES280#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
17enum 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 */
33struct 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
43int 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
18enum turris_mox_cpu_module_id {
19 TURRIS_MOX_CPU_ID_EMMC = 0x00,
20 TURRIS_MOX_CPU_ID_SD = 0x10,
21};
22
23enum 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
38extern struct bus_type moxtet_type;
39
40struct 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
61struct moxtet_driver {
62 const enum turris_mox_module_id *id_table;
63 struct device_driver driver;
64};
65
66static inline struct moxtet_driver *
67to_moxtet_driver(struct device_driver *drv)
68{
69 if (!drv)
70 return NULL;
71 return container_of(drv, struct moxtet_driver, driver);
72}
73
74extern int __moxtet_register_driver(struct module *owner,
75 struct moxtet_driver *mdrv);
76
77static 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
90struct moxtet_device {
91 struct device dev;
92 struct moxtet *moxtet;
93 enum turris_mox_module_id id;
94 unsigned int idx;
95};
96
97extern int moxtet_device_read(struct device *dev);
98extern int moxtet_device_write(struct device *dev, u8 val);
99extern int moxtet_device_written(struct device *dev);
100
101static inline struct moxtet_device *
102to_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
189 */189 */
190struct mtd_debug_info {190struct mtd_debug_info {
191 struct dentry *dfs_dir;191 struct dentry *dfs_dir;
192
193 const char *partname;
194 const char *partid;
192};195};
193 196
194struct mtd_info {197struct 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
346}346}
347 347
348/**348/**
349 * nanddev_neraseblocks() - Get the total number of erasablocks349 * nanddev_neraseblocks() - Get the total number of eraseblocks
350 * @nand: NAND device350 * @nand: NAND device
351 *351 *
352 * Return: the total number of eraseblocks exposed by @nand.352 * Return: the total number of eraseblocks exposed by @nand.
include/linux/mtd/sharpsl.h+5−0
@@ -5,6 +5,9 @@ · 4 unmodified lines
5 * Copyright (C) 2008 Dmitry Baryshkov5 * Copyright (C) 2008 Dmitry Baryshkov
6 */6 */
7 7
8#ifndef _MTD_SHARPSL_H
9#define _MTD_SHARPSL_H
10
8#include <linux/mtd/rawnand.h>11#include <linux/mtd/rawnand.h>
9#include <linux/mtd/nand_ecc.h>12#include <linux/mtd/nand_ecc.h>
10#include <linux/mtd/partitions.h>13#include <linux/mtd/partitions.h>
@@ -16,3 +19,5 @@ struct sharpsl_nand_platform_data { · 5 unmodified lines
16 unsigned int nr_partitions;19 unsigned int nr_partitions;
17 const char *const *part_parsers;20 const char *const *part_parsers;
18};21};
22
23#endif /* _MTD_SHARPSL_H */
include/linux/mtd/spi-nor.h+209−82
@@ -9,6 +9,7 @@ · 8 unmodified lines
9#include <linux/bitops.h>9#include <linux/bitops.h>
10#include <linux/mtd/cfi.h>10#include <linux/mtd/cfi.h>
11#include <linux/mtd/mtd.h>11#include <linux/mtd/mtd.h>
12#include <linux/spi/spi-mem.h>
12 13
13/*14/*
14 * Manufacturer IDs15 * Manufacturer IDs
@@ -224,7 +225,6 @@ static inline u8 spi_nor_get_protocol_width(enum spi_nor_protocol proto) · 209 unmodified lines
224 return spi_nor_get_protocol_data_nbits(proto);225 return spi_nor_get_protocol_data_nbits(proto);
225}226}
226 227
227#define SPI_NOR_MAX_CMD_SIZE 8
228enum spi_nor_ops {228enum spi_nor_ops {
229 SPI_NOR_OPS_READ = 0,229 SPI_NOR_OPS_READ = 0,
230 SPI_NOR_OPS_WRITE,230 SPI_NOR_OPS_WRITE,
@@ -237,12 +237,12 @@ enum spi_nor_option_flags { · 6 unmodified lines
237 SNOR_F_USE_FSR = BIT(0),237 SNOR_F_USE_FSR = BIT(0),
238 SNOR_F_HAS_SR_TB = BIT(1),238 SNOR_F_HAS_SR_TB = BIT(1),
239 SNOR_F_NO_OP_CHIP_ERASE = BIT(2),239 SNOR_F_NO_OP_CHIP_ERASE = BIT(2),
240 SNOR_F_S3AN_ADDR_DEFAULT = BIT(3),240 SNOR_F_READY_XSR_RDY = BIT(3),
241 SNOR_F_READY_XSR_RDY = BIT(4),241 SNOR_F_USE_CLSR = BIT(4),
242 SNOR_F_USE_CLSR = BIT(5),242 SNOR_F_BROKEN_RESET = BIT(5),
243 SNOR_F_BROKEN_RESET = BIT(6),243 SNOR_F_4B_OPCODES = BIT(6),
244 SNOR_F_4B_OPCODES = BIT(7),244 SNOR_F_HAS_4BAIT = BIT(7),
245 SNOR_F_HAS_4BAIT = BIT(8),245 SNOR_F_HAS_LOCK = BIT(8),
246};246};
247 247
248/**248/**
@@ -333,6 +333,195 @@ struct spi_nor_erase_map { · 84 unmodified lines
333 u8 uniform_erase_type;333 u8 uniform_erase_type;
334};334};
335 335
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 */
341struct 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
411struct 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
418struct spi_nor_pp_command {
419 u8 opcode;
420 enum spi_nor_protocol proto;
421};
422
423enum 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
449enum 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' */
466struct 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 */
474struct 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 */
507struct 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
336/**525/**
337 * struct flash_info - Forward declaration of a structure used internally by526 * struct flash_info - Forward declaration of a structure used internally by
338 * spi_nor_scan()527 * spi_nor_scan()
@@ -344,6 +533,10 @@ struct flash_info; · 5 unmodified lines
344 * @mtd: point to a mtd_info structure533 * @mtd: point to a mtd_info structure
345 * @lock: the lock for the read/write/erase/lock/unlock operations534 * @lock: the lock for the read/write/erase/lock/unlock operations
346 * @dev: point to a spi device, or a spi nor controller device.535 * @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
347 * @info: spi-nor part JDEC MFR id and other info540 * @info: spi-nor part JDEC MFR id and other info
348 * @page_size: the page size of the SPI NOR541 * @page_size: the page size of the SPI NOR
349 * @addr_width: number of address bytes542 * @addr_width: number of address bytes
@@ -356,8 +549,6 @@ struct flash_info; · 6 unmodified lines
356 * @read_proto: the SPI protocol for read operations549 * @read_proto: the SPI protocol for read operations
357 * @write_proto: the SPI protocol for write operations550 * @write_proto: the SPI protocol for write operations
358 * @reg_proto the SPI protocol for read_reg/write_reg/erase operations551 * @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
361 * @prepare: [OPTIONAL] do some preparations for the552 * @prepare: [OPTIONAL] do some preparations for the
362 * read/write/erase/lock/unlock operations553 * read/write/erase/lock/unlock operations
363 * @unprepare: [OPTIONAL] do some post work after the554 * @unprepare: [OPTIONAL] do some post work after the
@@ -369,19 +560,21 @@ struct flash_info; · 5 unmodified lines
369 * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR560 * @erase: [DRIVER-SPECIFIC] erase a sector of the SPI NOR
370 * at the offset @offs; if not provided by the driver,561 * at the offset @offs; if not provided by the driver,
371 * spi-nor will send the erase opcode via write_reg()562 * 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
376 * @clear_sr_bp: [FLASH-SPECIFIC] clears the Block Protection Bits from563 * @clear_sr_bp: [FLASH-SPECIFIC] clears the Block Protection Bits from
377 * the SPI NOR Status Register.564 * the SPI NOR Status Register.
378 * completely locked565 * @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.
379 * @priv: the private data569 * @priv: the private data
380 */570 */
381struct spi_nor {571struct spi_nor {
382 struct mtd_info mtd;572 struct mtd_info mtd;
383 struct mutex lock;573 struct mutex lock;
384 struct device *dev;574 struct device *dev;
575 struct spi_mem *spimem;
576 u8 *bouncebuf;
577 size_t bouncebuf_size;
385 const struct flash_info *info;578 const struct flash_info *info;
386 u32 page_size;579 u32 page_size;
387 u8 addr_width;580 u8 addr_width;
@@ -394,8 +587,6 @@ struct spi_nor { · 6 unmodified lines
394 enum spi_nor_protocol reg_proto;587 enum spi_nor_protocol reg_proto;
395 bool sst_write_second;588 bool sst_write_second;
396 u32 flags;589 u32 flags;
397 u8 cmd_buf[SPI_NOR_MAX_CMD_SIZE];
398 struct spi_nor_erase_map erase_map;
399 590
400 int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops);591 int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops);
401 void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops);592 void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops);
@@ -408,11 +599,8 @@ struct spi_nor { · 6 unmodified lines
408 size_t len, const u_char *write_buf);599 size_t len, const u_char *write_buf);
409 int (*erase)(struct spi_nor *nor, loff_t offs);600 int (*erase)(struct spi_nor *nor, loff_t offs);
410 601
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);
415 int (*clear_sr_bp)(struct spi_nor *nor);602 int (*clear_sr_bp)(struct spi_nor *nor);
603 struct spi_nor_flash_parameter params;
416 604
417 void *priv;605 void *priv;
418};606};
@@ -443,7 +631,7 @@ spi_nor_region_mark_overlay(struct spi_nor_erase_region *region) · 24 unmodified lines
443 631
444static bool __maybe_unused spi_nor_has_uniform_erase(const struct spi_nor *nor)632static bool __maybe_unused spi_nor_has_uniform_erase(const struct spi_nor *nor)
445{633{
446 return !!nor->erase_map.uniform_erase_type;634 return !!nor->params.erase_map.uniform_erase_type;
447}635}
448 636
449static inline void spi_nor_set_flash_node(struct spi_nor *nor,637static 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
457 return mtd_get_of_node(&nor->mtd);645 return mtd_get_of_node(&nor->mtd);
458}646}
459 647
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 */
465struct 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
521/**648/**
522 * spi_nor_scan() - scan the SPI NOR649 * spi_nor_scan() - scan the SPI NOR
523 * @nor: the spi_nor structure650 * @nor: the spi_nor structure
include/linux/mtd/super.h+3−3
@@ -14,9 +14,9 @@ · 13 unmodified lines
14#include <linux/fs.h>14#include <linux/fs.h>
15#include <linux/mount.h>15#include <linux/mount.h>
16 16
17extern struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,17extern int get_tree_mtd(struct fs_context *fc,
18 const char *dev_name, void *data,18 int (*fill_super)(struct super_block *sb,
19 int (*fill_super)(struct super_block *, void *, int));19 struct fs_context *fc));
20extern void kill_mtd_super(struct super_block *sb);20extern void kill_mtd_super(struct super_block *sb);
21 21
22 22
include/linux/mutex.h+3−22
@@ -65,16 +65,6 @@ struct mutex { · 64 unmodified lines
65#endif65#endif
66};66};
67 67
68/*
69 * Internal helper function; C doesn't allow us to hide it :/
70 *
71 * DO NOT USE (outside of mutex code).
72 */
73static inline struct task_struct *__mutex_owner(struct mutex *lock)
74{
75 return (struct task_struct *)(atomic_long_read(&lock->owner) & ~0x07);
76}
77
78/*68/*
79 * This is the control structure for tasks blocked on mutex,69 * This is the control structure for tasks blocked on mutex,
80 * which resides on the blocked task's kernel stack:70 * 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
144 *134 *
145 * Returns true if the mutex is locked, false if unlocked.135 * Returns true if the mutex is locked, false if unlocked.
146 */136 */
147static inline bool mutex_is_locked(struct mutex *lock)137extern bool mutex_is_locked(struct mutex *lock);
148{
149 return __mutex_owner(lock) != NULL;
150}
151 138
152/*139/*
153 * See kernel/locking/mutex.c for detailed documentation of these APIs.140 * See kernel/locking/mutex.c for detailed documentation of these APIs.
@@ -220,13 +207,7 @@ enum mutex_trylock_recursive_enum { · 66 unmodified lines
220 * - MUTEX_TRYLOCK_SUCCESS - lock acquired,207 * - MUTEX_TRYLOCK_SUCCESS - lock acquired,
221 * - MUTEX_TRYLOCK_RECURSIVE - we already owned the lock.208 * - MUTEX_TRYLOCK_RECURSIVE - we already owned the lock.
222 */209 */
223static inline /* __deprecated */ __must_check enum mutex_trylock_recursive_enum210extern /* __deprecated */ __must_check enum mutex_trylock_recursive_enum
224mutex_trylock_recursive(struct mutex *lock)211mutex_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}
231 212
232#endif /* __LINUX_MUTEX_H */213#endif /* __LINUX_MUTEX_H */
include/linux/namei.h+18−45
@@ -16,39 +16,28 @@ enum { MAX_NESTED_LINKS = 8 }; · 15 unmodified lines
16 */16 */
17enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};17enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
18 18
19/*19/* pathwalk mode */
20 * The bitmask for a lookup event:20#define LOOKUP_FOLLOW 0x0001 /* follow links at the end */
21 * - follow links at the end21#define LOOKUP_DIRECTORY 0x0002 /* require a directory */
22 * - require a directory22#define LOOKUP_AUTOMOUNT 0x0004 /* force terminal automount */
23 * - ending slashes ok even for nonexistent files23#define LOOKUP_EMPTY 0x4000 /* accept empty path [user_... only] */
24 * - internal "there are more path components" flag24#define LOOKUP_DOWN 0x8000 /* follow mounts in the starting point */
25 * - dentry cache is untrusted; force a real lookup25
26 * - suppress terminal automount26#define LOOKUP_REVAL 0x0020 /* tell ->d_revalidate() to trust no cache */
27 * - skip revalidation27#define LOOKUP_RCU 0x0040 /* RCU pathwalk mode; semi-internal */
28 * - don't fetch xattrs on audit_inode28
29 */29/* These tell filesystem methods that we are dealing with the final component... */
30#define LOOKUP_FOLLOW 0x000130#define LOOKUP_OPEN 0x0100 /* ... in open */
31#define LOOKUP_DIRECTORY 0x000231#define LOOKUP_CREATE 0x0200 /* ... in object creation */
32#define LOOKUP_AUTOMOUNT 0x000432#define LOOKUP_EXCL 0x0400 /* ... in exclusive creation */
33 33#define LOOKUP_RENAME_TARGET 0x0800 /* ... in destination of rename() */
34
35/* internal use only */
34#define LOOKUP_PARENT 0x001036#define LOOKUP_PARENT 0x0010
35#define LOOKUP_REVAL 0x0020
36#define LOOKUP_RCU 0x0040
37#define LOOKUP_NO_REVAL 0x008037#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
48#define LOOKUP_JUMPED 0x100038#define LOOKUP_JUMPED 0x1000
49#define LOOKUP_ROOT 0x200039#define LOOKUP_ROOT 0x2000
50#define LOOKUP_EMPTY 0x400040#define LOOKUP_ROOT_GRABBED 0x0008
51#define LOOKUP_DOWN 0x8000
52 41
53extern int path_pts(struct path *path);42extern int path_pts(struct path *path);
54 43
@@ -60,22 +49,6 @@ static inline int user_path_at(int dfd, const char __user *name, unsigned flags, · 5 unmodified lines
60 return user_path_at_empty(dfd, name, flags, path, NULL);49 return user_path_at_empty(dfd, name, flags, path, NULL);
61}50}
62 51
63static 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
68static 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
73static 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
79extern int kern_path(const char *, unsigned, struct path *);52extern int kern_path(const char *, unsigned, struct path *);
80 53
81extern struct dentry *kern_path_create(int, const char *, struct path *, unsigned int);54extern 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
332 struct net_device *dev;332 struct net_device *dev;
333 struct gro_list gro_hash[GRO_HASH_BUCKETS];333 struct gro_list gro_hash[GRO_HASH_BUCKETS];
334 struct sk_buff *skb;334 struct sk_buff *skb;
335 struct list_head rx_list; /* Pending GRO_NORMAL skbs */
336 int rx_count; /* length of rx_list */
335 struct hrtimer timer;337 struct hrtimer timer;
336 struct list_head dev_list;338 struct list_head dev_list;
337 struct hlist_node napi_hash_node;339 struct hlist_node napi_hash_node;
@@ -845,6 +847,7 @@ enum tc_setup_type { · 507 unmodified lines
845 TC_SETUP_QDISC_ETF,847 TC_SETUP_QDISC_ETF,
846 TC_SETUP_ROOT_QDISC,848 TC_SETUP_ROOT_QDISC,
847 TC_SETUP_QDISC_GRED,849 TC_SETUP_QDISC_GRED,
850 TC_SETUP_QDISC_TAPRIO,
848};851};
849 852
850/* These structures hold the attributes of bpf state that are being passed853/* These structures hold the attributes of bpf state that are being passed
@@ -899,6 +902,10 @@ struct netdev_bpf { · 48 unmodified lines
899 };902 };
900};903};
901 904
905/* Flags for ndo_xsk_wakeup. */
906#define XDP_WAKEUP_RX (1 << 0)
907#define XDP_WAKEUP_TX (1 << 1)
908
902#ifdef CONFIG_XFRM_OFFLOAD909#ifdef CONFIG_XFRM_OFFLOAD
903struct xfrmdev_ops {910struct xfrmdev_ops {
904 int (*xdo_dev_state_add) (struct xfrm_state *x);911 int (*xdo_dev_state_add) (struct xfrm_state *x);
@@ -1225,6 +1232,12 @@ struct tlsdev_ops; · 320 unmodified lines
1225 * that got dropped are freed/returned via xdp_return_frame().1232 * that got dropped are freed/returned via xdp_return_frame().
1226 * Returns negative number, means general error invoking ndo, meaning1233 * Returns negative number, means general error invoking ndo, meaning
1227 * no frames were xmit'ed and core-caller will free all frames.1234 * 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.
1228 * struct devlink_port *(*ndo_get_devlink_port)(struct net_device *dev);1241 * struct devlink_port *(*ndo_get_devlink_port)(struct net_device *dev);
1229 * Get devlink port instance associated with a given netdev.1242 * Get devlink port instance associated with a given netdev.
1230 * Called with a reference on the netdevice and devlink locks only,1243 * Called with a reference on the netdevice and devlink locks only,
@@ -1424,8 +1437,8 @@ struct net_device_ops { · 193 unmodified lines
1424 int (*ndo_xdp_xmit)(struct net_device *dev, int n,1437 int (*ndo_xdp_xmit)(struct net_device *dev, int n,
1425 struct xdp_frame **xdp,1438 struct xdp_frame **xdp,
1426 u32 flags);1439 u32 flags);
1427 int (*ndo_xsk_async_xmit)(struct net_device *dev,1440 int (*ndo_xsk_wakeup)(struct net_device *dev,
1428 u32 queue_id);1441 u32 queue_id, u32 flags);
1429 struct devlink_port * (*ndo_get_devlink_port)(struct net_device *dev);1442 struct devlink_port * (*ndo_get_devlink_port)(struct net_device *dev);
1430};1443};
1431 1444
@@ -3270,7 +3283,7 @@ static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue, · 1838 unmodified lines
3270 */3283 */
3271 smp_mb();3284 smp_mb();
3272 3285
3273 if (dql_avail(&dev_queue->dql) < 0)3286 if (unlikely(dql_avail(&dev_queue->dql) < 0))
3274 return;3287 return;
3275 3288
3276 if (test_and_clear_bit(__QUEUE_STATE_STACK_XOFF, &dev_queue->state))3289 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
4239extern int dev_weight_tx_bias;4252extern int dev_weight_tx_bias;
4240extern int dev_rx_weight;4253extern int dev_rx_weight;
4241extern int dev_tx_weight;4254extern int dev_tx_weight;
4255extern int gro_normal_batch;
4242 4256
4243bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);4257bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);
4244struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev,4258struct 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
15#include <linux/netdevice.h>15#include <linux/netdevice.h>
16#include <net/net_namespace.h>16#include <net/net_namespace.h>
17 17
18#ifdef CONFIG_NETFILTER
19static inline int NF_DROP_GETERR(int verdict)18static inline int NF_DROP_GETERR(int verdict)
20{19{
21 return -(verdict >> NF_VERDICT_QBITS);20 return -(verdict >> NF_VERDICT_QBITS);
@@ -118,6 +117,7 @@ struct nf_hook_entries { · 96 unmodified lines
118 */117 */
119};118};
120 119
120#ifdef CONFIG_NETFILTER
121static inline struct nf_hook_ops **nf_hook_entries_get_hook_ops(const struct nf_hook_entries *e)121static inline struct nf_hook_ops **nf_hook_entries_get_hook_ops(const struct nf_hook_entries *e)
122{122{
123 unsigned int n = e->num_hook_entries;123 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
422}422}
423#endif /*CONFIG_NETFILTER*/423#endif /*CONFIG_NETFILTER*/
424 424
425#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)425#if IS_ENABLED(CONFIG_NF_CONNTRACK)
426#include <linux/netfilter/nf_conntrack_zones_common.h>426#include <linux/netfilter/nf_conntrack_zones_common.h>
427 427
428extern void (*ip_ct_attach)(struct sk_buff *, const struct sk_buff *) __rcu;428extern 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
452 return 4 * ((((b - a + 8) / 8) + 3) / 4);452 return 4 * ((((b - a + 8) / 8) + 3) / 4);
453}453}
454 454
455#include <linux/netfilter/ipset/ip_set_timeout.h>455/* How often should the gc be run by default */
456#include <linux/netfilter/ipset/ip_set_comment.h>456#define IPSET_GC_TIME (3 * 60)
457#include <linux/netfilter/ipset/ip_set_counter.h>457
458#include <linux/netfilter/ipset/ip_set_skbinfo.h>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
474static inline unsigned int
475ip_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
486static inline bool
487ip_set_timeout_expired(const unsigned long *t)
488{
489 return *t != IPSET_ELEM_PERMANENT && time_is_before_jiffies(*t);
490}
491
492static inline void
493ip_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
509static inline u32
510ip_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
522static inline char*
523ip_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 */
531static inline void
532ip_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() */
556static inline int
557ip_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 */
571static inline void
572ip_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
584static inline void
585ip_set_add_bytes(u64 bytes, struct ip_set_counter *counter)
586{
587 atomic64_add((long long)bytes, &(counter)->bytes);
588}
589
590static inline void
591ip_set_add_packets(u64 packets, struct ip_set_counter *counter)
592{
593 atomic64_add((long long)packets, &(counter)->packets);
594}
595
596static inline u64
597ip_set_get_bytes(const struct ip_set_counter *counter)
598{
599 return (u64)atomic64_read(&(counter)->bytes);
600}
601
602static inline u64
603ip_set_get_packets(const struct ip_set_counter *counter)
604{
605 return (u64)atomic64_read(&(counter)->packets);
606}
607
608static inline bool
609ip_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
626static inline void
627ip_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
637static inline bool
638ip_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
648static inline void
649ip_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
658static inline void
659ip_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
666static inline bool
667ip_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
683static inline void
684ip_set_init_skbinfo(struct ip_set_skbinfo *skbinfo,
685 const struct ip_set_ext *ext)
686{
687 *skbinfo = ext->skbinfo;
688}
459 689
460#define IP_SET_INIT_KEXT(skb, opt, set) \690#define IP_SET_INIT_KEXT(skb, opt, set) \
461 { .bytes = (skb)->len, .packets = 1, \691 { .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
10static inline char*
11ip_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 */
19static inline void
20ip_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() */
44static inline int
45ip_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 */
59static inline void
60ip_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
9static inline void
10ip_set_add_bytes(u64 bytes, struct ip_set_counter *counter)
11{
12 atomic64_add((long long)bytes, &(counter)->bytes);
13}
14
15static inline void
16ip_set_add_packets(u64 packets, struct ip_set_counter *counter)
17{
18 atomic64_add((long long)packets, &(counter)->packets);
19}
20
21static inline u64
22ip_set_get_bytes(const struct ip_set_counter *counter)
23{
24 return (u64)atomic64_read(&(counter)->bytes);
25}
26
27static inline u64
28ip_set_get_packets(const struct ip_set_counter *counter)
29{
30 return (u64)atomic64_read(&(counter)->packets);
31}
32
33static inline bool
34ip_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
51static inline void
52ip_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
62static inline bool
63ip_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
73static inline void
74ip_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
2#ifndef _IP_SET_GETPORT_H2#ifndef _IP_SET_GETPORT_H
3#define _IP_SET_GETPORT_H3#define _IP_SET_GETPORT_H
4 4
5#include <linux/skbuff.h>
6#include <linux/types.h>
7#include <uapi/linux/in.h>
8
5extern bool ip_set_get_ip4_port(const struct sk_buff *skb, bool src,9extern bool ip_set_get_ip4_port(const struct sk_buff *skb, bool src,
6 __be16 *port, u8 *proto);10 __be16 *port, u8 *proto);
7 11
8#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)12#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
9extern bool ip_set_get_ip6_port(const struct sk_buff *skb, bool src,13extern bool ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
10 __be16 *port, u8 *proto);14 __be16 *port, u8 *proto);
11#else15#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
9static inline void
10ip_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
17static inline bool
18ip_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
34static inline void
35ip_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
28static inline unsigned int
29ip_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
40static inline bool
41ip_set_timeout_expired(const unsigned long *t)
42{
43 return *t != IPSET_ELEM_PERMANENT && time_is_before_jiffies(*t);
44}
45
46static inline void
47ip_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
63static inline u32
64ip_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
3#define _NF_CONNTRACK_AMANDA_H3#define _NF_CONNTRACK_AMANDA_H
4/* AMANDA tracking. */4/* AMANDA tracking. */
5 5
6#include <linux/netfilter.h>
7#include <linux/skbuff.h>
8#include <net/netfilter/nf_conntrack_expect.h>
9
6extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff *skb,10extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff *skb,
7 enum ip_conntrack_info ctinfo,11 enum ip_conntrack_info ctinfo,
8 unsigned int protoff,12 unsigned int protoff,
include/linux/netfilter/nf_conntrack_common.h+20−0
@@ -2,6 +2,7 @@ · 1 unmodified line
2#ifndef _NF_CONNTRACK_COMMON_H2#ifndef _NF_CONNTRACK_COMMON_H
3#define _NF_CONNTRACK_COMMON_H3#define _NF_CONNTRACK_COMMON_H
4 4
5#include <linux/atomic.h>
5#include <uapi/linux/netfilter/nf_conntrack_common.h>6#include <uapi/linux/netfilter/nf_conntrack_common.h>
6 7
7struct ip_conntrack_stat {8struct ip_conntrack_stat {
@@ -19,4 +20,23 @@ struct ip_conntrack_stat { · 11 unmodified lines
19 unsigned int search_restart;20 unsigned int search_restart;
20};21};
21 22
23#define NFCT_INFOMASK 7UL
24#define NFCT_PTRMASK ~(NFCT_INFOMASK)
25
26struct nf_conntrack {
27 atomic_t use;
28};
29
30void nf_conntrack_destroy(struct nf_conntrack *nfct);
31static 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}
36static inline void nf_conntrack_get(struct nf_conntrack *nfct)
37{
38 if (nfct)
39 atomic_inc(&nfct->use);
40}
41
22#endif /* _NF_CONNTRACK_COMMON_H */42#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
25};25};
26#define CT_DCCP_ROLE_MAX (__CT_DCCP_ROLE_MAX - 1)26#define CT_DCCP_ROLE_MAX (__CT_DCCP_ROLE_MAX - 1)
27 27
28#ifdef __KERNEL__
29#include <linux/netfilter/nf_conntrack_tuple_common.h>28#include <linux/netfilter/nf_conntrack_tuple_common.h>
30 29
31struct nf_ct_dccp {30struct nf_ct_dccp {
@@ -36,6 +35,4 @@ struct nf_ct_dccp { · 4 unmodified lines
36 u_int64_t handshake_seq;35 u_int64_t handshake_seq;
37};36};
38 37
39#endif /* __KERNEL__ */
40
41#endif /* _NF_CONNTRACK_DCCP_H */38#endif /* _NF_CONNTRACK_DCCP_H */
include/linux/netfilter/nf_conntrack_ftp.h+5−3
@@ -2,8 +2,12 @@ · 1 unmodified line
2#ifndef _NF_CONNTRACK_FTP_H2#ifndef _NF_CONNTRACK_FTP_H
3#define _NF_CONNTRACK_FTP_H3#define _NF_CONNTRACK_FTP_H
4 4
5#include <linux/netfilter.h>
6#include <linux/skbuff.h>
7#include <linux/types.h>
8#include <net/netfilter/nf_conntrack_expect.h>
5#include <uapi/linux/netfilter/nf_conntrack_ftp.h>9#include <uapi/linux/netfilter/nf_conntrack_ftp.h>
6 10#include <uapi/linux/netfilter/nf_conntrack_tuple_common.h>
7 11
8#define FTP_PORT 2112#define FTP_PORT 21
9 13
@@ -20,8 +24,6 @@ struct nf_ct_ftp_master { · 10 unmodified lines
20 u_int16_t flags[IP_CT_DIR_MAX];24 u_int16_t flags[IP_CT_DIR_MAX];
21};25};
22 26
23struct nf_conntrack_expect;
24
25/* For NAT to hook in when we find a packet which describes what other27/* For NAT to hook in when we find a packet which describes what other
26 * connection we should expect. */28 * connection we should expect. */
27extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb,29extern 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
2#ifndef _NF_CONNTRACK_H323_H2#ifndef _NF_CONNTRACK_H323_H
3#define _NF_CONNTRACK_H323_H3#define _NF_CONNTRACK_H323_H
4 4
5#ifdef __KERNEL__5#include <linux/netfilter.h>
6 6#include <linux/skbuff.h>
7#include <linux/types.h>
7#include <linux/netfilter/nf_conntrack_h323_asn1.h>8#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>
8 11
9#define RAS_PORT 171912#define RAS_PORT 1719
10#define Q931_PORT 172013#define Q931_PORT 1720
@@ -28,8 +31,6 @@ struct nf_ct_h323_master { · 17 unmodified lines
28 };31 };
29};32};
30 33
31struct nf_conn;
32
33int get_h225_addr(struct nf_conn *ct, unsigned char *data,34int get_h225_addr(struct nf_conn *ct, unsigned char *data,
34 TransportAddress *taddr, union nf_inet_addr *addr,35 TransportAddress *taddr, union nf_inet_addr *addr,
35 __be16 *port);36 __be16 *port);
@@ -94,5 +95,3 @@ extern int (*nat_q931_hook) (struct sk_buff *skb, struct nf_conn *ct, · 58 unmodified lines
94 struct nf_conntrack_expect *exp);95 struct nf_conntrack_expect *exp);
95 96
96#endif97#endif
97
98#endif
include/linux/netfilter/nf_conntrack_h323_asn1.h+3−2
@@ -1,7 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0-only */1/* SPDX-License-Identifier: GPL-2.0-only */
2/****************************************************************************2/****************************************************************************
3 * ip_conntrack_h323_asn1.h - BER and PER decoding library for H.3233 * BER and PER decoding library for H.323 conntrack/NAT module.
4 * conntrack/NAT module.
5 *4 *
6 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net>5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net>
7 *6 *
@@ -38,6 +37,8 @@ · 30 unmodified lines
38/*****************************************************************************37/*****************************************************************************
39 * H.323 Types38 * H.323 Types
40 ****************************************************************************/39 ****************************************************************************/
40
41#include <linux/types.h>
41#include <linux/netfilter/nf_conntrack_h323_types.h>42#include <linux/netfilter/nf_conntrack_h323_types.h>
42 43
43typedef struct {44typedef struct {
include/linux/netfilter/nf_conntrack_h323_types.h+5−0
@@ -4,6 +4,9 @@ · 3 unmodified lines
4 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net>4 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net>
5 */5 */
6 6
7#ifndef _NF_CONNTRACK_H323_TYPES_H
8#define _NF_CONNTRACK_H323_TYPES_H
9
7typedef struct TransportAddress_ipAddress { /* SEQUENCE */10typedef struct TransportAddress_ipAddress { /* SEQUENCE */
8 int options; /* No use */11 int options; /* No use */
9 unsigned int ip;12 unsigned int ip;
@@ -931,3 +934,5 @@ typedef struct RasMessage { /* CHOICE */ · 921 unmodified lines
931 InfoRequestResponse infoRequestResponse;934 InfoRequestResponse infoRequestResponse;
932 };935 };
933} RasMessage;936} 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
2#ifndef _NF_CONNTRACK_IRC_H2#ifndef _NF_CONNTRACK_IRC_H
3#define _NF_CONNTRACK_IRC_H3#define _NF_CONNTRACK_IRC_H
4 4
5#ifdef __KERNEL__5#include <linux/netfilter.h>
6#include <linux/skbuff.h>
7#include <net/netfilter/nf_conntrack_expect.h>
6 8
7#define IRC_PORT 66679#define IRC_PORT 6667
8 10
@@ -13,5 +15,4 @@ extern unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb, · 4 unmodified lines
13 unsigned int matchlen,15 unsigned int matchlen,
14 struct nf_conntrack_expect *exp);16 struct nf_conntrack_expect *exp);
15 17
16#endif /* __KERNEL__ */
17#endif /* _NF_CONNTRACK_IRC_H */18#endif /* _NF_CONNTRACK_IRC_H */
include/linux/netfilter/nf_conntrack_pptp.h+5−7
@@ -3,7 +3,12 @@ · 2 unmodified lines
3#ifndef _NF_CONNTRACK_PPTP_H3#ifndef _NF_CONNTRACK_PPTP_H
4#define _NF_CONNTRACK_PPTP_H4#define _NF_CONNTRACK_PPTP_H
5 5
6#include <linux/netfilter.h>
7#include <linux/skbuff.h>
8#include <linux/types.h>
6#include <linux/netfilter/nf_conntrack_common.h>9#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>
7 12
8extern const char *const pptp_msg_name[];13extern const char *const pptp_msg_name[];
9 14
@@ -45,8 +50,6 @@ struct nf_nat_pptp { · 35 unmodified lines
45 __be16 pac_call_id; /* NAT'ed PAC call id */50 __be16 pac_call_id; /* NAT'ed PAC call id */
46};51};
47 52
48#ifdef __KERNEL__
49
50#define PPTP_CONTROL_PORT 172353#define PPTP_CONTROL_PORT 1723
51 54
52#define PPTP_PACKET_CONTROL 155#define PPTP_PACKET_CONTROL 1
@@ -297,10 +300,6 @@ union pptp_ctrl_union { · 244 unmodified lines
297 struct PptpSetLinkInfo setlink;300 struct PptpSetLinkInfo setlink;
298};301};
299 302
300/* crap needed for nf_conntrack_compat.h */
301struct nf_conn;
302struct nf_conntrack_expect;
303
304extern int303extern int
305(*nf_nat_pptp_hook_outbound)(struct sk_buff *skb,304(*nf_nat_pptp_hook_outbound)(struct sk_buff *skb,
306 struct nf_conn *ct, enum ip_conntrack_info ctinfo,305 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
@@ -323,5 +322,4 @@ extern void · 16 unmodified lines
323(*nf_nat_pptp_hook_expectfn)(struct nf_conn *ct,322(*nf_nat_pptp_hook_expectfn)(struct nf_conn *ct,
324 struct nf_conntrack_expect *exp);323 struct nf_conntrack_expect *exp);
325 324
326#endif /* __KERNEL__ */
327#endif /* _NF_CONNTRACK_PPTP_H */325#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
10 unsigned int timeout;10 unsigned int timeout;
11};11};
12 12
13#ifdef __KERNEL__
14#include <net/netfilter/nf_conntrack_tuple.h>13#include <net/netfilter/nf_conntrack_tuple.h>
15 14
16struct nf_conn;15struct nf_conn;
@@ -32,5 +31,4 @@ void nf_ct_gre_keymap_destroy(struct nf_conn *ct); · 15 unmodified lines
32 31
33bool gre_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff,32bool gre_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff,
34 struct net *net, struct nf_conntrack_tuple *tuple);33 struct net *net, struct nf_conntrack_tuple *tuple);
35#endif /* __KERNEL__ */
36#endif /* _CONNTRACK_PROTO_GRE_H */34#endif /* _CONNTRACK_PROTO_GRE_H */
include/linux/netfilter/nf_conntrack_sane.h+0−4
@@ -3,8 +3,6 @@ · 2 unmodified lines
3#define _NF_CONNTRACK_SANE_H3#define _NF_CONNTRACK_SANE_H
4/* SANE tracking. */4/* SANE tracking. */
5 5
6#ifdef __KERNEL__
7
8#define SANE_PORT 65666#define SANE_PORT 6566
9 7
10enum sane_state {8enum sane_state {
@@ -17,6 +15,4 @@ struct nf_ct_sane_master { · 6 unmodified lines
17 enum sane_state state;15 enum sane_state state;
18};16};
19 17
20#endif /* __KERNEL__ */
21
22#endif /* _NF_CONNTRACK_SANE_H */18#endif /* _NF_CONNTRACK_SANE_H */
include/linux/netfilter/nf_conntrack_sip.h+2−4
@@ -1,11 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __NF_CONNTRACK_SIP_H__2#ifndef __NF_CONNTRACK_SIP_H__
3#define __NF_CONNTRACK_SIP_H__3#define __NF_CONNTRACK_SIP_H__
4#ifdef __KERNEL__
5
6#include <net/netfilter/nf_conntrack_expect.h>
7 4
5#include <linux/skbuff.h>
8#include <linux/types.h>6#include <linux/types.h>
7#include <net/netfilter/nf_conntrack_expect.h>
9 8
10#define SIP_PORT 50609#define SIP_PORT 5060
11#define SIP_TIMEOUT 360010#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
196 enum sdp_header_types term,195 enum sdp_header_types term,
197 unsigned int *matchoff, unsigned int *matchlen);196 unsigned int *matchoff, unsigned int *matchlen);
198 197
199#endif /* __KERNEL__ */
200#endif /* __NF_CONNTRACK_SIP_H__ */198#endif /* __NF_CONNTRACK_SIP_H__ */
include/linux/netfilter/nf_conntrack_snmp.h+3−0
@@ -2,6 +2,9 @@ · 1 unmodified line
2#ifndef _NF_CONNTRACK_SNMP_H2#ifndef _NF_CONNTRACK_SNMP_H
3#define _NF_CONNTRACK_SNMP_H3#define _NF_CONNTRACK_SNMP_H
4 4
5#include <linux/netfilter.h>
6#include <linux/skbuff.h>
7
5extern int (*nf_nat_snmp_hook)(struct sk_buff *skb,8extern int (*nf_nat_snmp_hook)(struct sk_buff *skb,
6 unsigned int protoff,9 unsigned int protoff,
7 struct nf_conn *ct,10 struct nf_conn *ct,
include/linux/netfilter/nf_conntrack_tftp.h+5−0
@@ -4,6 +4,11 @@ · 3 unmodified lines
4 4
5#define TFTP_PORT 695#define TFTP_PORT 69
6 6
7#include <linux/netfilter.h>
8#include <linux/skbuff.h>
9#include <linux/types.h>
10#include <net/netfilter/nf_conntrack_expect.h>
11
7struct tftphdr {12struct tftphdr {
8 __be16 opcode;13 __be16 opcode;
9};14};
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
336 336
337/**337/**
338 * xt_recseq - recursive seqcount for netfilter use338 * xt_recseq - recursive seqcount for netfilter use
339 * 339 *
340 * Packet processing changes the seqcount only if no recursion happened340 * Packet processing changes the seqcount only if no recursion happened
341 * get_counters() can use read_seqcount_begin()/read_seqcount_retry(),341 * get_counters() can use read_seqcount_begin()/read_seqcount_retry(),
342 * because we use the normal seqcount convention :342 * 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
5#include <uapi/linux/netfilter_bridge.h>5#include <uapi/linux/netfilter_bridge.h>
6#include <linux/skbuff.h>6#include <linux/skbuff.h>
7 7
8struct nf_bridge_frag_data {
9 char mac[ETH_HLEN];
10 bool vlan_present;
11 u16 vlan_tci;
12 __be16 vlan_proto;
13};
14
8#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)15#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
9 16
10int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb);17int 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
8static 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
105 105
106#define EBT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) & \106#define EBT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) & \
107 ~(__alignof__(struct _xt_align)-1))107 ~(__alignof__(struct _xt_align)-1))
108
108extern int ebt_register_table(struct net *net,109extern int ebt_register_table(struct net *net,
109 const struct ebt_table *table,110 const struct ebt_table *table,
110 const struct nf_hook_ops *ops,111 const struct nf_hook_ops *ops,
include/linux/netfilter_ipv4/ip_tables.h+1−4
@@ -17,14 +17,11 @@ · 16 unmodified lines
17 17
18#include <linux/if.h>18#include <linux/if.h>
19#include <linux/in.h>19#include <linux/in.h>
20#include <linux/init.h>
20#include <linux/ip.h>21#include <linux/ip.h>
21#include <linux/skbuff.h>22#include <linux/skbuff.h>
22
23#include <linux/init.h>
24#include <uapi/linux/netfilter_ipv4/ip_tables.h>23#include <uapi/linux/netfilter_ipv4/ip_tables.h>
25 24
26extern void ipt_init(void) __init;
27
28int ipt_register_table(struct net *net, const struct xt_table *table,25int ipt_register_table(struct net *net, const struct xt_table *table,
29 const struct ipt_replace *repl,26 const struct ipt_replace *repl,
30 const struct nf_hook_ops *ops, struct xt_table **res);27 const struct nf_hook_ops *ops, struct xt_table **res);
include/linux/netfilter_ipv6.h+20−8
@@ -1,7 +1,7 @@
1/* IPv6-specific defines for netfilter. 1/* IPv6-specific defines for netfilter.
2 * (C)1998 Rusty Russell -- This code is GPL.2 * (C)1998 Rusty Russell -- This code is GPL.
3 * (C)1999 David Jeffery3 * (C)1999 David Jeffery
4 * this header was blatantly ripped from netfilter_ipv4.h 4 * this header was blatantly ripped from netfilter_ipv4.h
5 * it's amazing what adding a bunch of 6s can do =8^)5 * it's amazing what adding a bunch of 6s can do =8^)
6 */6 */
7#ifndef __LINUX_IP6_NETFILTER_H7#ifndef __LINUX_IP6_NETFILTER_H
@@ -10,6 +10,18 @@ · 2 unmodified lines
10#include <uapi/linux/netfilter_ipv6.h>10#include <uapi/linux/netfilter_ipv6.h>
11#include <net/tcp.h>11#include <net/tcp.h>
12 12
13/* Check for an extension */
14static inline int
15nf_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
13/* Extra routing may needed on local out, as the QUEUE target never returns25/* Extra routing may needed on local out, as the QUEUE target never returns
14 * control to the table.26 * control to the table.
15 */27 */
@@ -20,7 +32,7 @@ struct ip6_rt_info { · 4 unmodified lines
20};32};
21 33
22struct nf_queue_entry;34struct nf_queue_entry;
23struct nf_ct_bridge_frag_data;35struct nf_bridge_frag_data;
24 36
25/*37/*
26 * Hook functions for ipv6 to allow xt_* modules to be built-in even38 * Hook functions for ipv6 to allow xt_* modules to be built-in even
@@ -49,9 +61,9 @@ struct nf_ipv6_ops { · 22 unmodified lines
49 int (*br_defrag)(struct net *net, struct sk_buff *skb, u32 user);61 int (*br_defrag)(struct net *net, struct sk_buff *skb, u32 user);
50 int (*br_fragment)(struct net *net, struct sock *sk,62 int (*br_fragment)(struct net *net, struct sock *sk,
51 struct sk_buff *skb,63 struct sk_buff *skb,
52 struct nf_ct_bridge_frag_data *data,64 struct nf_bridge_frag_data *data,
53 int (*output)(struct net *, struct sock *sk,65 int (*output)(struct net *, struct sock *sk,
54 const struct nf_ct_bridge_frag_data *data,66 const struct nf_bridge_frag_data *data,
55 struct sk_buff *));67 struct sk_buff *));
56#endif68#endif
57};69};
@@ -123,16 +135,16 @@ static inline int nf_ipv6_br_defrag(struct net *net, struct sk_buff *skb, · 65 unmodified lines
123}135}
124 136
125int br_ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,137int 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,
127 int (*output)(struct net *, struct sock *sk,139 int (*output)(struct net *, struct sock *sk,
128 const struct nf_ct_bridge_frag_data *data,140 const struct nf_bridge_frag_data *data,
129 struct sk_buff *));141 struct sk_buff *));
130 142
131static inline int nf_br_ip6_fragment(struct net *net, struct sock *sk,143static inline int nf_br_ip6_fragment(struct net *net, struct sock *sk,
132 struct sk_buff *skb,144 struct sk_buff *skb,
133 struct nf_ct_bridge_frag_data *data,145 struct nf_bridge_frag_data *data,
134 int (*output)(struct net *, struct sock *sk,146 int (*output)(struct net *, struct sock *sk,
135 const struct nf_ct_bridge_frag_data *data,147 const struct nf_bridge_frag_data *data,
136 struct sk_buff *))148 struct sk_buff *))
137{149{
138#if IS_MODULE(CONFIG_IPV6)150#if IS_MODULE(CONFIG_IPV6)
include/linux/netfilter_ipv6/ip6_tables.h+2−16
@@ -17,15 +17,13 @@ · 16 unmodified lines
17 17
18#include <linux/if.h>18#include <linux/if.h>
19#include <linux/in6.h>19#include <linux/in6.h>
20#include <linux/init.h>
20#include <linux/ipv6.h>21#include <linux/ipv6.h>
21#include <linux/skbuff.h>22#include <linux/skbuff.h>
22
23#include <linux/init.h>
24#include <uapi/linux/netfilter_ipv6/ip6_tables.h>23#include <uapi/linux/netfilter_ipv6/ip6_tables.h>
25 24
26extern void ip6t_init(void) __init;
27
28extern void *ip6t_alloc_initial_table(const struct xt_table *);25extern void *ip6t_alloc_initial_table(const struct xt_table *);
26
29int ip6t_register_table(struct net *net, const struct xt_table *table,27int ip6t_register_table(struct net *net, const struct xt_table *table,
30 const struct ip6t_replace *repl,28 const struct ip6t_replace *repl,
31 const struct nf_hook_ops *ops, struct xt_table **res);29 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
35 const struct nf_hook_state *state,33 const struct nf_hook_state *state,
36 struct xt_table *table);34 struct xt_table *table);
37 35
38/* Check for an extension */
39static inline int
40ip6t_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
50#ifdef CONFIG_COMPAT36#ifdef CONFIG_COMPAT
51#include <net/compat.h>37#include <net/compat.h>
52 38
include/linux/nfs_fs.h+3−0
@@ -490,6 +490,9 @@ extern const struct file_operations nfs_dir_operations; · 489 unmodified lines
490extern const struct dentry_operations nfs_dentry_operations;490extern const struct dentry_operations nfs_dentry_operations;
491 491
492extern void nfs_force_lookup_revalidate(struct inode *dir);492extern void nfs_force_lookup_revalidate(struct inode *dir);
493extern struct dentry *nfs_add_or_obtain(struct dentry *dentry,
494 struct nfs_fh *fh, struct nfs_fattr *fattr,
495 struct nfs4_label *label);
493extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh,496extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh,
494 struct nfs_fattr *fattr, struct nfs4_label *label);497 struct nfs_fattr *fattr, struct nfs4_label *label);
495extern int nfs_may_open(struct inode *inode, const struct cred *cred, int openflags);498extern 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
6#ifndef _NVME_FC_DRIVER_H6#ifndef _NVME_FC_DRIVER_H
7#define _NVME_FC_DRIVER_H 17#define _NVME_FC_DRIVER_H 1
8 8
9#include <linux/scatterlist.h>
10
9 11
10/*12/*
11 * ********************** LLDD FC-NVME Host API ********************13 * ********************** LLDD FC-NVME Host API ********************
include/linux/nvme.h+4−1
@@ -140,6 +140,7 @@ enum { · 139 unmodified lines
140 * Submission and Completion Queue Entry Sizes for the NVM command set.140 * Submission and Completion Queue Entry Sizes for the NVM command set.
141 * (In bytes and specified as a power of two (2^n)).141 * (In bytes and specified as a power of two (2^n)).
142 */142 */
143#define NVME_ADM_SQES 6
143#define NVME_NVM_IOSQES 6144#define NVME_NVM_IOSQES 6
144#define NVME_NVM_IOCQES 4145#define NVME_NVM_IOCQES 4
145 146
@@ -814,6 +815,7 @@ enum nvme_admin_opcode { · 668 unmodified lines
814 nvme_admin_security_send = 0x81,815 nvme_admin_security_send = 0x81,
815 nvme_admin_security_recv = 0x82,816 nvme_admin_security_recv = 0x82,
816 nvme_admin_sanitize_nvm = 0x84,817 nvme_admin_sanitize_nvm = 0x84,
818 nvme_admin_get_lba_status = 0x86,
817};819};
818 820
819#define nvme_admin_opcode_name(opcode) { opcode, #opcode }821#define nvme_admin_opcode_name(opcode) { opcode, #opcode }
@@ -840,7 +842,8 @@ enum nvme_admin_opcode { · 20 unmodified lines
840 nvme_admin_opcode_name(nvme_admin_format_nvm), \842 nvme_admin_opcode_name(nvme_admin_format_nvm), \
841 nvme_admin_opcode_name(nvme_admin_security_send), \843 nvme_admin_opcode_name(nvme_admin_security_send), \
842 nvme_admin_opcode_name(nvme_admin_security_recv), \844 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))
844 847
845enum {848enum {
846 NVME_QUEUE_PHYS_CONTIG = (1 << 0),849 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
1164}1164}
1165 1165
1166/**1166/**
1167 * of_property_read_bool - Findfrom a property1167 * of_property_read_bool - Find a property
1168 * @np: device node from which the property value is to be read.1168 * @np: device node from which the property value is to be read.
1169 * @propname: name of the property to be searched.1169 * @propname: name of the property to be searched.
1170 *1170 *
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
61}61}
62extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc);62extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc);
63 63
64extern int of_gpio_simple_xlate(struct gpio_chip *gc,
65 const struct of_phandle_args *gpiospec,
66 u32 *flags);
67
68#else /* CONFIG_OF_GPIO */64#else /* CONFIG_OF_GPIO */
69 65
70/* Drivers may not strictly depend on the GPIO support, so let them link. */66/* 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
77 return -ENOSYS;73 return -ENOSYS;
78}74}
79 75
80static 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
87#endif /* CONFIG_OF_GPIO */76#endif /* CONFIG_OF_GPIO */
88 77
89/**78/**
include/linux/omap-dma.h+0−2
@@ -1,8 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __LINUX_OMAP_DMA_H2#ifndef __LINUX_OMAP_DMA_H
3#define __LINUX_OMAP_DMA_H3#define __LINUX_OMAP_DMA_H
4#include <linux/omap-dmaengine.h>
5
6/*4/*
7 * Legacy OMAP DMA handling defines and functions5 * Legacy OMAP DMA handling defines and functions
8 *6 *
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
8struct dma_chan;
9
10#if defined(CONFIG_DMA_OMAP) || (defined(CONFIG_DMA_OMAP_MODULE) && defined(MODULE))
11bool omap_dma_filter_fn(struct dma_chan *, void *);
12#else
13static 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
10#ifndef _OMAP_IOMMU_H_10#ifndef _OMAP_IOMMU_H_
11#define _OMAP_IOMMU_H_11#define _OMAP_IOMMU_H_
12 12
13struct iommu_domain;
14
13#ifdef CONFIG_OMAP_IOMMU15#ifdef CONFIG_OMAP_IOMMU
14extern void omap_iommu_save_ctx(struct device *dev);16extern void omap_iommu_save_ctx(struct device *dev);
15extern void omap_iommu_restore_ctx(struct device *dev);17extern void omap_iommu_restore_ctx(struct device *dev);
18
19int omap_iommu_domain_deactivate(struct iommu_domain *domain);
20int omap_iommu_domain_activate(struct iommu_domain *domain);
16#else21#else
17static inline void omap_iommu_save_ctx(struct device *dev) {}22static inline void omap_iommu_save_ctx(struct device *dev) {}
18static inline void omap_iommu_restore_ctx(struct device *dev) {}23static inline void omap_iommu_restore_ctx(struct device *dev) {}
24
25static inline int omap_iommu_domain_deactivate(struct iommu_domain *domain)
26{
27 return -ENODEV;
28}
29
30static inline int omap_iommu_domain_activate(struct iommu_domain *domain)
31{
32 return -ENODEV;
33}
19#endif34#endif
20 35
21#endif36#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
4struct 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
12#include <linux/workqueue.h>12#include <linux/workqueue.h>
13#include <linux/spinlock.h>13#include <linux/spinlock.h>
14#include <linux/list.h>14#include <linux/list.h>
15#include <linux/timer.h>
16#include <linux/notifier.h>15#include <linux/notifier.h>
17#include <linux/kobject.h>16#include <linux/kobject.h>
18 17
@@ -36,6 +35,7 @@ struct padata_priv { · 17 unmodified lines
36 struct parallel_data *pd;35 struct parallel_data *pd;
37 int cb_cpu;36 int cb_cpu;
38 int cpu;37 int cpu;
38 unsigned int seq_nr;
39 int info;39 int info;
40 void (*parallel)(struct padata_priv *padata);40 void (*parallel)(struct padata_priv *padata);
41 void (*serial)(struct padata_priv *padata);41 void (*serial)(struct padata_priv *padata);
@@ -73,20 +73,14 @@ struct padata_serial_queue { · 31 unmodified lines
73 * @serial: List to wait for serialization after reordering.73 * @serial: List to wait for serialization after reordering.
74 * @pwork: work struct for parallelization.74 * @pwork: work struct for parallelization.
75 * @swork: work struct for serialization.75 * @swork: work struct for serialization.
76 * @pd: Backpointer to the internal control structure.
77 * @work: work struct for parallelization.76 * @work: work struct for parallelization.
78 * @reorder_work: work struct for reordering.
79 * @num_obj: Number of objects that are processed by this cpu.77 * @num_obj: Number of objects that are processed by this cpu.
80 * @cpu_index: Index of the cpu.
81 */78 */
82struct padata_parallel_queue {79struct padata_parallel_queue {
83 struct padata_list parallel;80 struct padata_list parallel;
84 struct padata_list reorder;81 struct padata_list reorder;
85 struct parallel_data *pd;
86 struct work_struct work;82 struct work_struct work;
87 struct work_struct reorder_work;
88 atomic_t num_obj;83 atomic_t num_obj;
89 int cpu_index;
90};84};
91 85
92/**86/**
@@ -110,10 +104,11 @@ struct padata_cpumask { · 17 unmodified lines
110 * @reorder_objects: Number of objects waiting in the reorder queues.104 * @reorder_objects: Number of objects waiting in the reorder queues.
111 * @refcnt: Number of objects holding a reference on this parallel_data.105 * @refcnt: Number of objects holding a reference on this parallel_data.
112 * @max_seq_nr: Maximal used sequence number.106 * @max_seq_nr: Maximal used sequence number.
107 * @processed: Number of already processed objects.
108 * @cpu: Next CPU to be processed.
113 * @cpumask: The cpumasks in use for parallel and serial workers.109 * @cpumask: The cpumasks in use for parallel and serial workers.
110 * @reorder_work: work struct for reordering.
114 * @lock: Reorder lock.111 * @lock: Reorder lock.
115 * @processed: Number of already processed objects.
116 * @timer: Reorder timer.
117 */112 */
118struct parallel_data {113struct parallel_data {
119 struct padata_instance *pinst;114 struct padata_instance *pinst;
@@ -122,17 +117,19 @@ struct parallel_data { · 2 unmodified lines
122 atomic_t reorder_objects;117 atomic_t reorder_objects;
123 atomic_t refcnt;118 atomic_t refcnt;
124 atomic_t seq_nr;119 atomic_t seq_nr;
120 unsigned int processed;
121 int cpu;
125 struct padata_cpumask cpumask;122 struct padata_cpumask cpumask;
123 struct work_struct reorder_work;
126 spinlock_t lock ____cacheline_aligned;124 spinlock_t lock ____cacheline_aligned;
127 unsigned int processed;
128 struct timer_list timer;
129};125};
130 126
131/**127/**
132 * struct padata_instance - The overall control structure.128 * struct padata_instance - The overall control structure.
133 *129 *
134 * @cpu_notifier: cpu hotplug notifier.130 * @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.
136 * @pd: The internal control structure.133 * @pd: The internal control structure.
137 * @cpumask: User supplied cpumasks for parallel and serial works.134 * @cpumask: User supplied cpumasks for parallel and serial works.
138 * @cpumask_change_notifier: Notifiers chain for user-defined notify135 * @cpumask_change_notifier: Notifiers chain for user-defined notify
@@ -144,7 +141,8 @@ struct parallel_data { · 5 unmodified lines
144 */141 */
145struct padata_instance {142struct padata_instance {
146 struct hlist_node node;143 struct hlist_node node;
147 struct workqueue_struct *wq;144 struct workqueue_struct *parallel_wq;
145 struct workqueue_struct *serial_wq;
148 struct parallel_data *pd;146 struct parallel_data *pd;
149 struct padata_cpumask cpumask;147 struct padata_cpumask cpumask;
150 struct blocking_notifier_head cpumask_change_notifier;148 struct blocking_notifier_head cpumask_change_notifier;
@@ -156,11 +154,10 @@ struct padata_instance { · 5 unmodified lines
156#define PADATA_INVALID 4154#define PADATA_INVALID 4
157};155};
158 156
159extern struct padata_instance *padata_alloc_possible(157extern struct padata_instance *padata_alloc_possible(const char *name);
160 struct workqueue_struct *wq);
161extern void padata_free(struct padata_instance *pinst);158extern void padata_free(struct padata_instance *pinst);
162extern int padata_do_parallel(struct padata_instance *pinst,159extern int padata_do_parallel(struct padata_instance *pinst,
163 struct padata_priv *padata, int cb_cpu);160 struct padata_priv *padata, int *cb_cpu);
164extern void padata_do_serial(struct padata_priv *padata);161extern void padata_do_serial(struct padata_priv *padata);
165extern int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,162extern int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,
166 cpumask_var_t cpumask);163 cpumask_var_t cpumask);
include/linux/page-flags-layout.h+11−7
@@ -32,6 +32,7 @@ · 31 unmodified lines
32 32
33#endif /* CONFIG_SPARSEMEM */33#endif /* CONFIG_SPARSEMEM */
34 34
35#ifndef BUILD_VDSO32_64
35/*36/*
36 * page->flags layout:37 * page->flags layout:
37 *38 *
@@ -76,20 +77,22 @@ · 38 unmodified lines
76#define LAST_CPUPID_SHIFT 077#define LAST_CPUPID_SHIFT 0
77#endif78#endif
78 79
79#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT+LAST_CPUPID_SHIFT <= BITS_PER_LONG - NR_PAGEFLAGS80#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
80#define LAST_CPUPID_WIDTH LAST_CPUPID_SHIFT88#define LAST_CPUPID_WIDTH LAST_CPUPID_SHIFT
81#else89#else
82#define LAST_CPUPID_WIDTH 090#define LAST_CPUPID_WIDTH 0
83#endif91#endif
84 92
85#ifdef CONFIG_KASAN_SW_TAGS
86#define KASAN_TAG_WIDTH 8
87#if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH+LAST_CPUPID_WIDTH+KASAN_TAG_WIDTH \93#if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH+LAST_CPUPID_WIDTH+KASAN_TAG_WIDTH \
88 > BITS_PER_LONG - NR_PAGEFLAGS94 > BITS_PER_LONG - NR_PAGEFLAGS
89#error "KASAN: not enough bits in page flags for tag"95#error "Not enough bits in page flags"
90#endif
91#else
92#define KASAN_TAG_WIDTH 0
93#endif96#endif
94 97
95/*98/*
@@ -104,4 +107,5 @@ · 8 unmodified lines
104#define LAST_CPUPID_NOT_IN_PAGE_FLAGS107#define LAST_CPUPID_NOT_IN_PAGE_FLAGS
105#endif108#endif
106 109
110#endif
107#endif /* _LINUX_PAGE_FLAGS_LAYOUT */111#endif /* _LINUX_PAGE_FLAGS_LAYOUT */
include/linux/page-flags.h+4−0
@@ -152,6 +152,8 @@ enum pageflags { · 151 unmodified lines
152 PG_savepinned = PG_dirty,152 PG_savepinned = PG_dirty,
153 /* Has a grant mapping of another (foreign) domain's page. */153 /* Has a grant mapping of another (foreign) domain's page. */
154 PG_foreign = PG_owner_priv_1,154 PG_foreign = PG_owner_priv_1,
155 /* Remapped by swiotlb-xen. */
156 PG_xen_remapped = PG_owner_priv_1,
155 157
156 /* SLOB */158 /* SLOB */
157 PG_slob_free = PG_private,159 PG_slob_free = PG_private,
@@ -329,6 +331,8 @@ PAGEFLAG(Pinned, pinned, PF_NO_COMPOUND) · 171 unmodified lines
329 TESTSCFLAG(Pinned, pinned, PF_NO_COMPOUND)331 TESTSCFLAG(Pinned, pinned, PF_NO_COMPOUND)
330PAGEFLAG(SavePinned, savepinned, PF_NO_COMPOUND);332PAGEFLAG(SavePinned, savepinned, PF_NO_COMPOUND);
331PAGEFLAG(Foreign, foreign, PF_NO_COMPOUND);333PAGEFLAG(Foreign, foreign, PF_NO_COMPOUND);
334PAGEFLAG(XenRemapped, xen_remapped, PF_NO_COMPOUND)
335 TESTCLEARFLAG(XenRemapped, xen_remapped, PF_NO_COMPOUND)
332 336
333PAGEFLAG(Reserved, reserved, PF_NO_COMPOUND)337PAGEFLAG(Reserved, reserved, PF_NO_COMPOUND)
334 __CLEARPAGEFLAG(Reserved, reserved, PF_NO_COMPOUND)338 __CLEARPAGEFLAG(Reserved, reserved, PF_NO_COMPOUND)
include/linux/page_ext.h+1−0
@@ -18,6 +18,7 @@ struct page_ext_operations { · 17 unmodified lines
18 18
19enum page_ext_flags {19enum page_ext_flags {
20 PAGE_EXT_OWNER,20 PAGE_EXT_OWNER,
21 PAGE_EXT_OWNER_ACTIVE,
21#if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT)22#if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT)
22 PAGE_EXT_YOUNG,23 PAGE_EXT_YOUNG,
23 PAGE_EXT_IDLE,24 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
333 mapping_gfp_mask(mapping));333 mapping_gfp_mask(mapping));
334}334}
335 335
336static 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
336struct page *find_get_entry(struct address_space *mapping, pgoff_t offset);346struct page *find_get_entry(struct address_space *mapping, pgoff_t offset);
337struct page *find_lock_entry(struct address_space *mapping, pgoff_t offset);347struct page *find_lock_entry(struct address_space *mapping, pgoff_t offset);
338unsigned find_get_entries(struct address_space *mapping, pgoff_t start,348unsigned 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
7struct 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 */
28struct 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 */
53struct 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
60int walk_page_range(struct mm_struct *mm, unsigned long start,
61 unsigned long end, const struct mm_walk_ops *ops,
62 void *private);
63int 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
27int pci_disable_link_state(struct pci_dev *pdev, int state);
28int pci_disable_link_state_locked(struct pci_dev *pdev, int state);
29void pcie_no_aspm(void);
30#else
31static inline int pci_disable_link_state(struct pci_dev *pdev, int state)
32{ return 0; }
33static 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
30 unsigned int *nents, u32 length);30 unsigned int *nents, u32 length);
31void pci_p2pmem_free_sgl(struct pci_dev *pdev, struct scatterlist *sgl);31void pci_p2pmem_free_sgl(struct pci_dev *pdev, struct scatterlist *sgl);
32void pci_p2pmem_publish(struct pci_dev *pdev, bool publish);32void pci_p2pmem_publish(struct pci_dev *pdev, bool publish);
33int pci_p2pdma_map_sg(struct device *dev, struct scatterlist *sg, int nents,33int pci_p2pdma_map_sg_attrs(struct device *dev, struct scatterlist *sg,
34 enum dma_data_direction dir);34 int nents, enum dma_data_direction dir, unsigned long attrs);
35void pci_p2pdma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg,
36 int nents, enum dma_data_direction dir, unsigned long attrs);
35int pci_p2pdma_enable_store(const char *page, struct pci_dev **p2p_dev,37int pci_p2pdma_enable_store(const char *page, struct pci_dev **p2p_dev,
36 bool *use_p2pdma);38 bool *use_p2pdma);
37ssize_t pci_p2pdma_enable_show(char *page, struct pci_dev *p2p_dev,39ssize_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
81static inline void pci_p2pmem_publish(struct pci_dev *pdev, bool publish)83static inline void pci_p2pmem_publish(struct pci_dev *pdev, bool publish)
82{84{
83}85}
84static inline int pci_p2pdma_map_sg(struct device *dev,86static inline int pci_p2pdma_map_sg_attrs(struct device *dev,
85 struct scatterlist *sg, int nents, enum dma_data_direction dir)87 struct scatterlist *sg, int nents, enum dma_data_direction dir,
88 unsigned long attrs)
86{89{
87 return 0;90 return 0;
88}91}
92static 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}
89static inline int pci_p2pdma_enable_store(const char *page,97static inline int pci_p2pdma_enable_store(const char *page,
90 struct pci_dev **p2p_dev, bool *use_p2pdma)98 struct pci_dev **p2p_dev, bool *use_p2pdma)
91{99{
@@ -111,4 +119,16 @@ static inline struct pci_dev *pci_p2pmem_find(struct device *client) · 19 unmodified lines
111 return pci_p2pmem_find_many(&client, 1);119 return pci_p2pmem_find_many(&client, 1);
112}120}
113 121
122static 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
128static 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
114#endif /* _LINUX_PCI_P2P_H */134#endif /* _LINUX_PCI_P2P_H */
include/linux/pci.h+51−84
@@ -6,12 +6,18 @@ · 5 unmodified lines
6 * Copyright 1994, Drew Eckhardt6 * Copyright 1994, Drew Eckhardt
7 * Copyright 1997--1999 Martin Mares <mj@ucw.cz>7 * Copyright 1997--1999 Martin Mares <mj@ucw.cz>
8 *8 *
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 *
9 * For more information, please consult the following manuals (look at14 * For more information, please consult the following manuals (look at
10 * http://www.pcisig.com/ for how to get them):15 * http://www.pcisig.com/ for how to get them):
11 *16 *
12 * PCI BIOS Specification17 * PCI BIOS Specification
13 * PCI Local Bus Specification18 * PCI Local Bus Specification
14 * PCI to PCI Bridge Specification19 * PCI to PCI Bridge Specification
20 * PCI Express Specification
15 * PCI System Design Guide21 * PCI System Design Guide
16 */22 */
17#ifndef LINUX_PCI_H23#ifndef LINUX_PCI_H
@@ -145,11 +151,6 @@ static inline const char *pci_power_name(pci_power_t state) · 127 unmodified lines
145 return pci_power_names[1 + (__force int) state];151 return pci_power_names[1 + (__force int) state];
146}152}
147 153
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
153/**154/**
154 * typedef pci_channel_state_t155 * typedef pci_channel_state_t
155 *156 *
@@ -418,7 +419,6 @@ struct pci_dev { · 262 unmodified lines
418 unsigned int broken_intx_masking:1; /* INTx masking can't be used */419 unsigned int broken_intx_masking:1; /* INTx masking can't be used */
419 unsigned int io_window_1k:1; /* Intel bridge 1K I/O windows */420 unsigned int io_window_1k:1; /* Intel bridge 1K I/O windows */
420 unsigned int irq_managed:1;421 unsigned int irq_managed:1;
421 unsigned int has_secondary_link:1;
422 unsigned int non_compliant_bars:1; /* Broken BARs; ignore them */422 unsigned int non_compliant_bars:1; /* Broken BARs; ignore them */
423 unsigned int is_probed:1; /* Device probing in progress */423 unsigned int is_probed:1; /* Device probing in progress */
424 unsigned int link_active_reporting:1;/* Device capable of reporting link active */424 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
649 return dev->bus->self;649 return dev->bus->self;
650}650}
651 651
652struct device *pci_get_host_bridge_device(struct pci_dev *dev);
653void pci_put_host_bridge_device(struct device *dev);
654
655#ifdef CONFIG_PCI_MSI652#ifdef CONFIG_PCI_MSI
656static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev)653static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev)
657{654{
@@ -925,6 +922,11 @@ enum { · 267 unmodified lines
925 PCI_SCAN_ALL_PCIE_DEVS = 0x00000040, /* Scan all, not just dev 0 */922 PCI_SCAN_ALL_PCIE_DEVS = 0x00000040, /* Scan all, not just dev 0 */
926};923};
927 924
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
928/* These external functions are only available when PCI support is enabled */930/* These external functions are only available when PCI support is enabled */
929#ifdef CONFIG_PCI931#ifdef CONFIG_PCI
930 932
@@ -969,7 +971,7 @@ resource_size_t pcibios_align_resource(void *, const struct resource *, · 38 unmodified lines
969 resource_size_t,971 resource_size_t,
970 resource_size_t);972 resource_size_t);
971 973
972/* Weak but can be overriden by arch */974/* Weak but can be overridden by arch */
973void pci_fixup_cardbus(struct pci_bus *);975void pci_fixup_cardbus(struct pci_bus *);
974 976
975/* Generic PCI functions used internally */977/* Generic PCI functions used internally */
@@ -995,7 +997,6 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, · 19 unmodified lines
995int pci_scan_root_bus_bridge(struct pci_host_bridge *bridge);997int pci_scan_root_bus_bridge(struct pci_host_bridge *bridge);
996struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,998struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
997 int busnr);999 int busnr);
998void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
999struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,1000struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
1000 const char *name,1001 const char *name,
1001 struct hotplug_slot *hotplug);1002 struct hotplug_slot *hotplug);
@@ -1241,19 +1242,12 @@ int pci_wake_from_d3(struct pci_dev *dev, bool enable); · 239 unmodified lines
1241int pci_prepare_to_sleep(struct pci_dev *dev);1242int pci_prepare_to_sleep(struct pci_dev *dev);
1242int pci_back_from_sleep(struct pci_dev *dev);1243int pci_back_from_sleep(struct pci_dev *dev);
1243bool pci_dev_run_wake(struct pci_dev *dev);1244bool pci_dev_run_wake(struct pci_dev *dev);
1244bool pci_check_pme_status(struct pci_dev *dev);
1245void pci_pme_wakeup_bus(struct pci_bus *bus);
1246void pci_d3cold_enable(struct pci_dev *dev);1245void pci_d3cold_enable(struct pci_dev *dev);
1247void pci_d3cold_disable(struct pci_dev *dev);1246void pci_d3cold_disable(struct pci_dev *dev);
1248bool pcie_relaxed_ordering_enabled(struct pci_dev *dev);1247bool pcie_relaxed_ordering_enabled(struct pci_dev *dev);
1249void pci_wakeup_bus(struct pci_bus *bus);1248void pci_wakeup_bus(struct pci_bus *bus);
1250void pci_bus_set_current_state(struct pci_bus *bus, pci_power_t state);1249void pci_bus_set_current_state(struct pci_bus *bus, pci_power_t state);
1251 1250
1252/* PCI Virtual Channel */
1253int pci_save_vc_state(struct pci_dev *dev);
1254void pci_restore_vc_state(struct pci_dev *dev);
1255void pci_allocate_vc_save_buffers(struct pci_dev *dev);
1256
1257/* For use by arch with custom probe code */1251/* For use by arch with custom probe code */
1258void set_pcie_port_type(struct pci_dev *pdev);1252void set_pcie_port_type(struct pci_dev *pdev);
1259void set_pcie_hotplug_bridge(struct pci_dev *pdev);1253void 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
1297void pci_release_selected_regions(struct pci_dev *, int);1291void pci_release_selected_regions(struct pci_dev *, int);
1298 1292
1299/* drivers/pci/bus.c */1293/* drivers/pci/bus.c */
1300struct pci_bus *pci_bus_get(struct pci_bus *bus);
1301void pci_bus_put(struct pci_bus *bus);
1302void pci_add_resource(struct list_head *resources, struct resource *res);1294void pci_add_resource(struct list_head *resources, struct resource *res);
1303void pci_add_resource_offset(struct list_head *resources, struct resource *res,1295void pci_add_resource_offset(struct list_head *resources, struct resource *res,
1304 resource_size_t offset);1296 resource_size_t offset);
@@ -1408,11 +1400,6 @@ resource_size_t pcibios_window_alignment(struct pci_bus *bus, · 103 unmodified lines
1408int pci_set_vga_state(struct pci_dev *pdev, bool decode,1400int pci_set_vga_state(struct pci_dev *pdev, bool decode,
1409 unsigned int command_bits, u32 flags);1401 unsigned int command_bits, u32 flags);
1410 1402
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
1416/*1403/*
1417 * Virtual interrupts allow for more interrupts to be allocated1404 * Virtual interrupts allow for more interrupts to be allocated
1418 * than the device has interrupts for. These are not programmed1405 * 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
1517}1504}
1518#endif1505#endif
1519 1506
1520static inline int
1521pci_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
1528/**1507/**
1529 * pci_irqd_intx_xlate() - Translate PCI INTx value to an IRQ domain hwirq1508 * pci_irqd_intx_xlate() - Translate PCI INTx value to an IRQ domain hwirq
1530 * @d: the INTx IRQ domain1509 * @d: the INTx IRQ domain
@@ -1565,10 +1544,24 @@ extern bool pcie_ports_native; · 34 unmodified lines
1565#define pcie_ports_native false1544#define pcie_ports_native false
1566#endif1545#endif
1567 1546
1547#define PCIE_LINK_STATE_L0S 1
1548#define PCIE_LINK_STATE_L1 2
1549#define PCIE_LINK_STATE_CLKPM 4
1550
1568#ifdef CONFIG_PCIEASPM1551#ifdef CONFIG_PCIEASPM
1552int pci_disable_link_state(struct pci_dev *pdev, int state);
1553int pci_disable_link_state_locked(struct pci_dev *pdev, int state);
1554void pcie_no_aspm(void);
1569bool pcie_aspm_support_enabled(void);1555bool pcie_aspm_support_enabled(void);
1556bool pcie_aspm_enabled(struct pci_dev *pdev);
1570#else1557#else
1558static inline int pci_disable_link_state(struct pci_dev *pdev, int state)
1559{ return 0; }
1560static inline int pci_disable_link_state_locked(struct pci_dev *pdev, int state)
1561{ return 0; }
1562static inline void pcie_no_aspm(void) { }
1571static inline bool pcie_aspm_support_enabled(void) { return false; }1563static inline bool pcie_aspm_support_enabled(void) { return false; }
1564static inline bool pcie_aspm_enabled(struct pci_dev *pdev) { return false; }
1572#endif1565#endif
1573 1566
1574#ifdef CONFIG_PCIEAER1567#ifdef CONFIG_PCIEAER
@@ -1577,23 +1570,8 @@ bool pci_aer_available(void); · 2 unmodified lines
1577static inline bool pci_aer_available(void) { return false; }1570static inline bool pci_aer_available(void) { return false; }
1578#endif1571#endif
1579 1572
1580#ifdef CONFIG_PCIE_ECRC
1581void pcie_set_ecrc_checking(struct pci_dev *dev);
1582void pcie_ecrc_get_policy(char *str);
1583#else
1584static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { }
1585static inline void pcie_ecrc_get_policy(char *str) { }
1586#endif
1587
1588bool pci_ats_disabled(void);1573bool pci_ats_disabled(void);
1589 1574
1590#ifdef CONFIG_PCIE_PTM
1591int pci_enable_ptm(struct pci_dev *dev, u8 *granularity);
1592#else
1593static inline int pci_enable_ptm(struct pci_dev *dev, u8 *granularity)
1594{ return -EINVAL; }
1595#endif
1596
1597void pci_cfg_access_lock(struct pci_dev *dev);1575void pci_cfg_access_lock(struct pci_dev *dev);
1598bool pci_cfg_access_trylock(struct pci_dev *dev);1576bool pci_cfg_access_trylock(struct pci_dev *dev);
1599void pci_cfg_access_unlock(struct pci_dev *dev);1577void 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
1747 1725
1748static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }1726static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
1749 1727
1750static inline void pci_block_cfg_access(struct pci_dev *dev) { }
1751static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
1752{ return 0; }
1753static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
1754
1755static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)1728static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
1756{ return NULL; }1729{ return NULL; }
1757static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,1730static 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
1780 struct pci_dev *dev)1753 struct pci_dev *dev)
1781{ return NULL; }1754{ return NULL; }
1782static inline bool pci_ats_disabled(void) { return true; }1755static inline bool pci_ats_disabled(void) { return true; }
1756
1757static inline int pci_irq_vector(struct pci_dev *dev, unsigned int nr)
1758{
1759 return -EINVAL;
1760}
1761
1762static inline int
1763pci_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}
1783#endif /* CONFIG_PCI */1769#endif /* CONFIG_PCI */
1784 1770
1771static inline int
1772pci_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
1785#ifdef CONFIG_PCI_ATS1779#ifdef CONFIG_PCI_ATS
1786/* Address Translation Service */1780/* Address Translation Service */
1787void pci_ats_init(struct pci_dev *dev);
1788int pci_enable_ats(struct pci_dev *dev, int ps);1781int pci_enable_ats(struct pci_dev *dev, int ps);
1789void pci_disable_ats(struct pci_dev *dev);1782void pci_disable_ats(struct pci_dev *dev);
1790int pci_ats_queue_depth(struct pci_dev *dev);1783int pci_ats_queue_depth(struct pci_dev *dev);
1791int pci_ats_page_aligned(struct pci_dev *dev);1784int pci_ats_page_aligned(struct pci_dev *dev);
1792#else1785#else
1793static inline void pci_ats_init(struct pci_dev *d) { }
1794static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }1786static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }
1795static inline void pci_disable_ats(struct pci_dev *d) { }1787static inline void pci_disable_ats(struct pci_dev *d) { }
1796static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; }1788static 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
1801 1793
1802#include <asm/pci.h>1794#include <asm/pci.h>
1803 1795
1804/* These two functions provide almost identical functionality. Depennding1796/* These two functions provide almost identical functionality. Depending
1805 * on the architecture, one will be implemented as a wrapper around the1797 * on the architecture, one will be implemented as a wrapper around the
1806 * other (in drivers/pci/mmap.c).1798 * other (in drivers/pci/mmap.c).
1807 *1799 *
@@ -1870,25 +1862,9 @@ static inline const char *pci_name(const struct pci_dev *pdev) · 62 unmodified lines
1870 return dev_name(&pdev->dev);1862 return dev_name(&pdev->dev);
1871}1863}
1872 1864
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
1879void pci_resource_to_user(const struct pci_dev *dev, int bar,1865void pci_resource_to_user(const struct pci_dev *dev, int bar,
1880 const struct resource *rsrc,1866 const struct resource *rsrc,
1881 resource_size_t *start, resource_size_t *end);1867 resource_size_t *start, resource_size_t *end);
1882#else
1883static 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
1892 1868
1893/*1869/*
1894 * The world is not perfect and supplies us with broken PCI devices.1870 * 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
2030extern u8 pci_dfl_cache_line_size;2006extern u8 pci_dfl_cache_line_size;
2031extern u8 pci_cache_line_size;2007extern u8 pci_cache_line_size;
2032 2008
2033extern unsigned long pci_hotplug_io_size;
2034extern unsigned long pci_hotplug_mem_size;
2035extern unsigned long pci_hotplug_bus_size;
2036
2037/* Architecture-specific versions may override these (weak) */2009/* Architecture-specific versions may override these (weak) */
2038void pcibios_disable_device(struct pci_dev *dev);2010void pcibios_disable_device(struct pci_dev *dev);
2039void pcibios_set_master(struct pci_dev *dev);2011void 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
2303#ifdef CONFIG_OF2275#ifdef CONFIG_OF
2304struct device_node;2276struct device_node;
2305struct irq_domain;2277struct irq_domain;
2306void pci_set_of_node(struct pci_dev *dev);
2307void pci_release_of_node(struct pci_dev *dev);
2308void pci_set_bus_of_node(struct pci_bus *bus);
2309void pci_release_bus_of_node(struct pci_bus *bus);
2310struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus);2278struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus);
2311int pci_parse_request_of_pci_ranges(struct device *dev,2279int pci_parse_request_of_pci_ranges(struct device *dev,
2312 struct list_head *resources,2280 struct list_head *resources,
@@ -2316,10 +2284,6 @@ int pci_parse_request_of_pci_ranges(struct device *dev, · 3 unmodified lines
2316struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus);2284struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus);
2317 2285
2318#else /* CONFIG_OF */2286#else /* CONFIG_OF */
2319static inline void pci_set_of_node(struct pci_dev *dev) { }
2320static inline void pci_release_of_node(struct pci_dev *dev) { }
2321static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
2322static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
2323static inline struct irq_domain *2287static inline struct irq_domain *
2324pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; }2288pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; }
2325static inline int pci_parse_request_of_pci_ranges(struct device *dev,2289static 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
2433#define pci_notice_ratelimited(pdev, fmt, arg...) \2397#define pci_notice_ratelimited(pdev, fmt, arg...) \
2434 dev_notice_ratelimited(&(pdev)->dev, fmt, ##arg)2398 dev_notice_ratelimited(&(pdev)->dev, fmt, ##arg)
2435 2399
2400#define pci_info_ratelimited(pdev, fmt, arg...) \
2401 dev_info_ratelimited(&(pdev)->dev, fmt, ##arg)
2402
2436#endif /* LINUX_PCI_H */2403#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
86#define pci_hp_initialize(slot, bus, nr, name) \86#define pci_hp_initialize(slot, bus, nr, name) \
87 __pci_hp_initialize(slot, bus, nr, name, THIS_MODULE, KBUILD_MODNAME)87 __pci_hp_initialize(slot, bus, nr, name, THIS_MODULE, KBUILD_MODNAME)
88 88
89/* PCI Setting Record (Type 0) */
90struct 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) */
99struct 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) */
107struct 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 */
130struct 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
147struct 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
154enum 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
166enum 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
172enum 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
181#ifdef CONFIG_ACPI89#ifdef CONFIG_ACPI
182#include <linux/acpi.h>90#include <linux/acpi.h>
183int pci_acpi_program_hp_params(struct pci_dev *dev,
184 const struct hotplug_program_ops *hp_ops);
185bool pciehp_is_native(struct pci_dev *bridge);91bool pciehp_is_native(struct pci_dev *bridge);
186int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge);92int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge);
187bool shpchp_is_native(struct pci_dev *bridge);93bool shpchp_is_native(struct pci_dev *bridge);
188int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle);94int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle);
189int acpi_pci_detect_ejectable(acpi_handle handle);95int acpi_pci_detect_ejectable(acpi_handle handle);
190#else96#else
191static 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
197static inline int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge)97static inline int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge)
198{98{
199 return 0;99 return 0;
include/linux/pci_ids.h+8−1
@@ -548,6 +548,7 @@ · 547 unmodified lines
548#define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463548#define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463
549#define PCI_DEVICE_ID_AMD_17H_M10H_DF_F3 0x15eb549#define PCI_DEVICE_ID_AMD_17H_M10H_DF_F3 0x15eb
550#define PCI_DEVICE_ID_AMD_17H_M30H_DF_F3 0x1493550#define PCI_DEVICE_ID_AMD_17H_M30H_DF_F3 0x1493
551#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F3 0x1443
551#define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703552#define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703
552#define PCI_DEVICE_ID_AMD_LANCE 0x2000553#define PCI_DEVICE_ID_AMD_LANCE 0x2000
553#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001554#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001
@@ -1070,7 +1071,6 @@ · 516 unmodified lines
1070#define PCI_VENDOR_ID_SGI 0x10a91071#define PCI_VENDOR_ID_SGI 0x10a9
1071#define PCI_DEVICE_ID_SGI_IOC3 0x00031072#define PCI_DEVICE_ID_SGI_IOC3 0x0003
1072#define PCI_DEVICE_ID_SGI_LITHIUM 0x10021073#define PCI_DEVICE_ID_SGI_LITHIUM 0x1002
1073#define PCI_DEVICE_ID_SGI_IOC4 0x100a
1074 1074
1075#define PCI_VENDOR_ID_WINBOND 0x10ad1075#define PCI_VENDOR_ID_WINBOND 0x10ad
1076#define PCI_DEVICE_ID_WINBOND_82C105 0x01051076#define PCI_DEVICE_ID_WINBOND_82C105 0x0105
@@ -1951,6 +1951,8 @@ · 874 unmodified lines
1951#define PCI_VENDOR_ID_DIGIGRAM 0x13691951#define PCI_VENDOR_ID_DIGIGRAM 0x1369
1952#define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_SERIAL_SUBSYSTEM 0xc0011952#define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_SERIAL_SUBSYSTEM 0xc001
1953#define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_CAE_SERIAL_SUBSYSTEM 0xc0021953#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
1954 1956
1955#define PCI_VENDOR_ID_KAWASAKI 0x136b1957#define PCI_VENDOR_ID_KAWASAKI 0x136b
1956#define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff011958#define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01
@@ -2132,6 +2134,7 @@ · 175 unmodified lines
2132#define PCI_VENDOR_ID_MYRICOM 0x14c12134#define PCI_VENDOR_ID_MYRICOM 0x14c1
2133 2135
2134#define PCI_VENDOR_ID_MEDIATEK 0x14c32136#define PCI_VENDOR_ID_MEDIATEK 0x14c3
2137#define PCI_DEVICE_ID_MEDIATEK_7629 0x7629
2135 2138
2136#define PCI_VENDOR_ID_TITAN 0x14D22139#define PCI_VENDOR_ID_TITAN 0x14D2
2137#define PCI_DEVICE_ID_TITAN_010L 0x80012140#define PCI_DEVICE_ID_TITAN_010L 0x8001
@@ -2405,6 +2408,8 @@ · 267 unmodified lines
2405#define PCI_DEVICE_ID_RDC_R6061 0x60612408#define PCI_DEVICE_ID_RDC_R6061 0x6061
2406#define PCI_DEVICE_ID_RDC_D1010 0x10102409#define PCI_DEVICE_ID_RDC_D1010 0x1010
2407 2410
2411#define PCI_VENDOR_ID_GLI 0x17a0
2412
2408#define PCI_VENDOR_ID_LENOVO 0x17aa2413#define PCI_VENDOR_ID_LENOVO 0x17aa
2409 2414
2410#define PCI_VENDOR_ID_QCOM 0x17cb2415#define PCI_VENDOR_ID_QCOM 0x17cb
@@ -2570,6 +2575,8 @@ · 159 unmodified lines
2570 2575
2571#define PCI_VENDOR_ID_ASMEDIA 0x1b212576#define PCI_VENDOR_ID_ASMEDIA 0x1b21
2572 2577
2578#define PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS 0x1c36
2579
2573#define PCI_VENDOR_ID_CIRCUITCO 0x1cc82580#define PCI_VENDOR_ID_CIRCUITCO 0x1cc8
2574#define PCI_SUBSYSTEM_ID_CIRCUITCO_MINNOWBOARD 0x00012581#define PCI_SUBSYSTEM_ID_CIRCUITCO_MINNOWBOARD 0x0001
2575 2582
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
105 int nr_units);105 int nr_units);
106extern void __init pcpu_free_alloc_info(struct pcpu_alloc_info *ai);106extern void __init pcpu_free_alloc_info(struct pcpu_alloc_info *ai);
107 107
108extern int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,108extern void __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
109 void *base_addr);109 void *base_addr);
110 110
111#ifdef CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK111#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
246#define PERF_PMU_CAP_ITRACE 0x20246#define PERF_PMU_CAP_ITRACE 0x20
247#define PERF_PMU_CAP_HETEROGENEOUS_CPUS 0x40247#define PERF_PMU_CAP_HETEROGENEOUS_CPUS 0x40
248#define PERF_PMU_CAP_NO_EXCLUDE 0x80248#define PERF_PMU_CAP_NO_EXCLUDE 0x80
249#define PERF_PMU_CAP_AUX_OUTPUT 0x100
249 250
250/**251/**
251 * struct pmu - generic performance monitoring unit252 * struct pmu - generic performance monitoring unit
@@ -446,6 +447,16 @@ struct pmu { · 194 unmodified lines
446 void (*addr_filters_sync) (struct perf_event *event);447 void (*addr_filters_sync) (struct perf_event *event);
447 /* optional */448 /* optional */
448 449
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
449 /*460 /*
450 * Filter events for PMU-specific reasons.461 * Filter events for PMU-specific reasons.
451 */462 */
@@ -681,6 +692,9 @@ struct perf_event { · 229 unmodified lines
681 struct perf_addr_filter_range *addr_filter_ranges;692 struct perf_addr_filter_range *addr_filter_ranges;
682 unsigned long addr_filters_gen;693 unsigned long addr_filters_gen;
683 694
695 /* for aux_output events */
696 struct perf_event *aux_event;
697
684 void (*destroy)(struct perf_event *);698 void (*destroy)(struct perf_event *);
685 struct rcu_head rcu_head;699 struct rcu_head rcu_head;
686 700
include/linux/phy.h+13−2
@@ -403,6 +403,8 @@ struct phy_device { · 402 unmodified lines
403 __ETHTOOL_DECLARE_LINK_MODE_MASK(supported);403 __ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
404 __ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);404 __ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
405 __ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising);405 __ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising);
406 /* used with phy_speed_down */
407 __ETHTOOL_DECLARE_LINK_MODE_MASK(adv_old);
406 408
407 /* Energy efficient ethernet modes which should be prohibited */409 /* Energy efficient ethernet modes which should be prohibited */
408 u32 eee_broken_modes;410 u32 eee_broken_modes;
@@ -665,6 +667,7 @@ size_t phy_speeds(unsigned int *speeds, size_t size, · 256 unmodified lines
665 unsigned long *mask);667 unsigned long *mask);
666void of_set_phy_supported(struct phy_device *phydev);668void of_set_phy_supported(struct phy_device *phydev);
667void of_set_phy_eee_broken(struct phy_device *phydev);669void of_set_phy_eee_broken(struct phy_device *phydev);
670int phy_speed_down_core(struct phy_device *phydev);
668 671
669/**672/**
670 * phy_is_started - Convenience function to check whether PHY is started673 * 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
984int phy_restore_page(struct phy_device *phydev, int oldpage, int ret);987int phy_restore_page(struct phy_device *phydev, int oldpage, int ret);
985int phy_read_paged(struct phy_device *phydev, int page, u32 regnum);988int phy_read_paged(struct phy_device *phydev, int page, u32 regnum);
986int phy_write_paged(struct phy_device *phydev, int page, u32 regnum, u16 val);989int phy_write_paged(struct phy_device *phydev, int page, u32 regnum, u16 val);
990int phy_modify_paged_changed(struct phy_device *phydev, int page, u32 regnum,
991 u16 mask, u16 set);
987int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum,992int phy_modify_paged(struct phy_device *phydev, int page, u32 regnum,
988 u16 mask, u16 set);993 u16 mask, u16 set);
989 994
@@ -1064,12 +1069,11 @@ void phy_attached_print(struct phy_device *phydev, const char *fmt, ...) · 74 unmodified lines
1064void phy_attached_info(struct phy_device *phydev);1069void phy_attached_info(struct phy_device *phydev);
1065 1070
1066/* Clause 22 PHY */1071/* Clause 22 PHY */
1067int genphy_config_init(struct phy_device *phydev);
1068int genphy_read_abilities(struct phy_device *phydev);1072int genphy_read_abilities(struct phy_device *phydev);
1069int genphy_setup_forced(struct phy_device *phydev);1073int genphy_setup_forced(struct phy_device *phydev);
1070int genphy_restart_aneg(struct phy_device *phydev);1074int genphy_restart_aneg(struct phy_device *phydev);
1071int genphy_config_eee_advert(struct phy_device *phydev);1075int genphy_config_eee_advert(struct phy_device *phydev);
1072int genphy_config_aneg(struct phy_device *phydev);1076int __genphy_config_aneg(struct phy_device *phydev, bool changed);
1073int genphy_aneg_done(struct phy_device *phydev);1077int genphy_aneg_done(struct phy_device *phydev);
1074int genphy_update_link(struct phy_device *phydev);1078int genphy_update_link(struct phy_device *phydev);
1075int genphy_read_status(struct phy_device *phydev);1079int genphy_read_status(struct phy_device *phydev);
@@ -1077,6 +1081,12 @@ int genphy_suspend(struct phy_device *phydev); · 1 unmodified line
1077int genphy_resume(struct phy_device *phydev);1081int genphy_resume(struct phy_device *phydev);
1078int genphy_loopback(struct phy_device *phydev, bool enable);1082int genphy_loopback(struct phy_device *phydev, bool enable);
1079int genphy_soft_reset(struct phy_device *phydev);1083int genphy_soft_reset(struct phy_device *phydev);
1084
1085static inline int genphy_config_aneg(struct phy_device *phydev)
1086{
1087 return __genphy_config_aneg(phydev, false);
1088}
1089
1080static inline int genphy_no_soft_reset(struct phy_device *phydev)1090static inline int genphy_no_soft_reset(struct phy_device *phydev)
1081{1091{
1082 return 0;1092 return 0;
@@ -1107,6 +1117,7 @@ int genphy_c45_an_disable_aneg(struct phy_device *phydev); · 24 unmodified lines
1107int genphy_c45_read_mdix(struct phy_device *phydev);1117int genphy_c45_read_mdix(struct phy_device *phydev);
1108int genphy_c45_pma_read_abilities(struct phy_device *phydev);1118int genphy_c45_pma_read_abilities(struct phy_device *phydev);
1109int genphy_c45_read_status(struct phy_device *phydev);1119int genphy_c45_read_status(struct phy_device *phydev);
1120int genphy_c45_config_aneg(struct phy_device *phydev);
1110 1121
1111/* The gen10g_* functions are the old Clause 45 stub */1122/* The gen10g_* functions are the old Clause 45 stub */
1112int gen10g_config_aneg(struct phy_device *phydev);1123int 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
11};11};
12 12
13struct device_node;13struct device_node;
14struct gpio_desc;
14 15
15#if IS_ENABLED(CONFIG_FIXED_PHY)16#if IS_ENABLED(CONFIG_FIXED_PHY)
16extern int fixed_phy_change_carrier(struct net_device *dev, bool new_carrier);17extern 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
72 72
73extern const struct file_operations pidfd_fops;73extern const struct file_operations pidfd_fops;
74 74
75struct file;
76
77extern struct pid *pidfd_pid(const struct file *file);
78
75static inline struct pid *get_pid(struct pid *pid)79static inline struct pid *get_pid(struct pid *pid)
76{80{
77 if (pid)81 if (pid)
include/linux/pinctrl/consumer.h+6−0
@@ -24,6 +24,7 @@ struct device; · 23 unmodified lines
24#ifdef CONFIG_PINCTRL24#ifdef CONFIG_PINCTRL
25 25
26/* External interface to pin control */26/* External interface to pin control */
27extern bool pinctrl_gpio_can_use_line(unsigned gpio);
27extern int pinctrl_gpio_request(unsigned gpio);28extern int pinctrl_gpio_request(unsigned gpio);
28extern void pinctrl_gpio_free(unsigned gpio);29extern void pinctrl_gpio_free(unsigned gpio);
29extern int pinctrl_gpio_direction_input(unsigned gpio);30extern 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
61 62
62#else /* !CONFIG_PINCTRL */63#else /* !CONFIG_PINCTRL */
63 64
65static inline bool pinctrl_gpio_can_use_line(unsigned gpio)
66{
67 return true;
68}
69
64static inline int pinctrl_gpio_request(unsigned gpio)70static inline int pinctrl_gpio_request(unsigned gpio)
65{71{
66 return 0;72 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 */
27struct 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
5513 uint8_t seed[FP_CONTEXT_TPM_BYTES];5513 uint8_t seed[FP_CONTEXT_TPM_BYTES];
5514} __ec_align4;5514} __ec_align4;
5515 5515
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
5521struct 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
5516/*****************************************************************************/5528/*****************************************************************************/
5517/* Touchpad MCU commands: range 0x0500-0x05FF */5529/* Touchpad MCU commands: range 0x0500-0x05FF */
5518 5530
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 */
43enum {
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 */
66struct 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 */
129struct 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 */
174struct 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 */
185struct 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 */
198int 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 */
208int 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 */
221int 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 */
234int 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 */
247int 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 */
262int 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 */
274int 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 */
284int 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 */
293int 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 */
305int 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 */
317u32 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
18struct 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
24struct 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 */
32struct 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 */
53struct 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 */
83struct 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
100struct 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
39enum 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
9struct 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
50 int num_chips;50 int num_chips;
51};51};
52 52
53/* Determine the wakeup irq, to be called during early resume */
54extern int htc_egpio_get_wakeup_irq(struct device *dev);
55
56#endif53#endif
include/linux/platform_data/iommu-omap.h+4−0
@@ -13,4 +13,8 @@ struct iommu_platform_data { · 12 unmodified lines
13 const char *reset_name;13 const char *reset_name;
14 int (*assert_reset)(struct platform_device *pdev, const char *name);14 int (*assert_reset)(struct platform_device *pdev, const char *name);
15 int (*deassert_reset)(struct platform_device *pdev, const char *name);15 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);
16};20};
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
7extern void mfp_set_groupi(struct device *dev);
8
9struct 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
12struct netxbig_gpio_ext {
13 unsigned *addr;
14 int num_addr;
15 unsigned *data;
16 int num_data;
17 unsigned enable;
18};
19
20enum 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
31struct netxbig_led_timer {
32 unsigned long delay_on;
33 unsigned long delay_off;
34 enum netxbig_led_mode mode;
35};
36
37struct 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
46struct 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
13struct 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 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef _PINCTRL_SINGLE_H
4#define _PINCTRL_SINGLE_H
5
2/**6/**
3 * irq: optional wake-up interrupt7 * irq: optional wake-up interrupt
4 * rearm: optional soc specific rearm function8 * rearm: optional soc specific rearm function
@@ -11,3 +15,5 @@ struct pcs_pdata { · 6 unmodified lines
11 int irq;15 int irq;
12 void (*rearm)(void);16 void (*rearm)(void);
13};17};
18
19#endif /* _PINCTRL_SINGLE_H */
include/linux/platform_data/sc18is602.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
4 *4 *
5 * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>5 * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net>
6 *6 *
7 * For further information, see the Documentation/spi/spi-sc18is602 file.7 * For further information, see the Documentation/spi/spi-sc18is602.rst file.
8 */8 */
9 9
10/**10/**
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
9struct 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
11extern void mfp_set_groupg(struct device *dev, const char *subname);
12
13struct 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
25struct 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
1#ifndef __TI_SYSC_DATA_H__3#ifndef __TI_SYSC_DATA_H__
2#define __TI_SYSC_DATA_H__4#define __TI_SYSC_DATA_H__
3 5
@@ -47,6 +49,7 @@ struct sysc_regbits { · 43 unmodified lines
47 s8 emufree_shift;49 s8 emufree_shift;
48};50};
49 51
52#define SYSC_MODULE_QUIRK_SGX BIT(18)
50#define SYSC_MODULE_QUIRK_HDQ1W BIT(17)53#define SYSC_MODULE_QUIRK_HDQ1W BIT(17)
51#define SYSC_MODULE_QUIRK_I2C BIT(16)54#define SYSC_MODULE_QUIRK_I2C BIT(16)
52#define SYSC_MODULE_QUIRK_WDT BIT(15)55#define SYSC_MODULE_QUIRK_WDT BIT(15)
@@ -70,7 +73,7 @@ struct sysc_regbits { · 17 unmodified lines
70 73
71/**74/**
72 * struct sysc_capabilities - capabilities for an interconnect target module75 * struct sysc_capabilities - capabilities for an interconnect target module
73 *76 * @type: sysc type identifier for the module
74 * @sysc_mask: bitmask of supported SYSCONFIG register bits77 * @sysc_mask: bitmask of supported SYSCONFIG register bits
75 * @regbits: bitmask of SYSCONFIG register bits78 * @regbits: bitmask of SYSCONFIG register bits
76 * @mod_quirks: bitmask of module specific quirks79 * @mod_quirks: bitmask of module specific quirks
@@ -85,8 +88,9 @@ struct sysc_capabilities { · 8 unmodified lines
85/**88/**
86 * struct sysc_config - configuration for an interconnect target module89 * struct sysc_config - configuration for an interconnect target module
87 * @sysc_val: configured value for sysc register90 * @sysc_val: configured value for sysc register
91 * @syss_mask: configured mask value for SYSSTATUS register
88 * @midlemodes: bitmask of supported master idle modes92 * @midlemodes: bitmask of supported master idle modes
89 * @sidlemodes: bitmask of supported master idle modes93 * @sidlemodes: bitmask of supported slave idle modes
90 * @srst_udelay: optional delay needed after OCP soft reset94 * @srst_udelay: optional delay needed after OCP soft reset
91 * @quirks: bitmask of enabled quirks95 * @quirks: bitmask of enabled quirks
92 */96 */
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 */
18struct 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 */
38struct 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
66struct 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
77extern 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
12#define ASUS_WMI_METHODID_GPID 0x44495047 /* Get Panel ID?? (Resol) */12#define ASUS_WMI_METHODID_GPID 0x44495047 /* Get Panel ID?? (Resol) */
13#define ASUS_WMI_METHODID_QMOD 0x444F4D51 /* Quiet MODe */13#define ASUS_WMI_METHODID_QMOD 0x444F4D51 /* Quiet MODe */
14#define ASUS_WMI_METHODID_SPLV 0x4C425053 /* Set Panel Light Value */14#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 */
16#define ASUS_WMI_METHODID_SFUN 0x4E554653 /* FUNCtionalities */16#define ASUS_WMI_METHODID_SFUN 0x4E554653 /* FUNCtionalities */
17#define ASUS_WMI_METHODID_SDSP 0x50534453 /* Set DiSPlay output */17#define ASUS_WMI_METHODID_SDSP 0x50534453 /* Set DiSPlay output */
18#define ASUS_WMI_METHODID_GDSP 0x50534447 /* Get DiSPlay output */18#define ASUS_WMI_METHODID_GDSP 0x50534447 /* Get DiSPlay output */
@@ -72,7 +72,8 @@ · 53 unmodified lines
72 72
73/* Fan, Thermal */73/* Fan, Thermal */
74#define ASUS_WMI_DEVID_THERMAL_CTRL 0x0011001174#define ASUS_WMI_DEVID_THERMAL_CTRL 0x00110011
75#define ASUS_WMI_DEVID_FAN_CTRL 0x0011001275#define ASUS_WMI_DEVID_FAN_CTRL 0x00110012 /* deprecated */
76#define ASUS_WMI_DEVID_CPU_FAN_CTRL 0x00110013
76 77
77/* Power */78/* Power */
78#define ASUS_WMI_DEVID_PROCESSOR_STATE 0x0012001279#define ASUS_WMI_DEVID_PROCESSOR_STATE 0x00120012
@@ -80,6 +81,9 @@ · 1 unmodified line
80/* Deep S3 / Resume on LID open */81/* Deep S3 / Resume on LID open */
81#define ASUS_WMI_DEVID_LID_RESUME 0x0012003182#define ASUS_WMI_DEVID_LID_RESUME 0x00120031
82 83
84/* Maximum charging percentage */
85#define ASUS_WMI_DEVID_RSOC 0x00120057
86
83/* DSTS masks */87/* DSTS masks */
84#define ASUS_WMI_DSTS_STATUS_BIT 0x0000000188#define ASUS_WMI_DSTS_STATUS_BIT 0x00000001
85#define ASUS_WMI_DSTS_UNKNOWN_BIT 0x0000000289#define ASUS_WMI_DSTS_UNKNOWN_BIT 0x00000002
include/linux/platform_device.h+5−1
@@ -24,6 +24,7 @@ struct platform_device { · 23 unmodified lines
24 int id;24 int id;
25 bool id_auto;25 bool id_auto;
26 struct device dev;26 struct device dev;
27 u64 dma_mask;
27 u32 num_resources;28 u32 num_resources;
28 struct resource *resource;29 struct resource *resource;
29 30
@@ -48,13 +49,16 @@ extern void platform_device_unregister(struct platform_device *); · 18 unmodified lines
48extern struct bus_type platform_bus_type;49extern struct bus_type platform_bus_type;
49extern struct device platform_bus;50extern struct device platform_bus;
50 51
51extern void arch_setup_pdev_archdata(struct platform_device *);
52extern struct resource *platform_get_resource(struct platform_device *,52extern struct resource *platform_get_resource(struct platform_device *,
53 unsigned int, unsigned int);53 unsigned int, unsigned int);
54extern struct device *
55platform_find_device_by_driver(struct device *start,
56 const struct device_driver *drv);
54extern void __iomem *57extern void __iomem *
55devm_platform_ioremap_resource(struct platform_device *pdev,58devm_platform_ioremap_resource(struct platform_device *pdev,
56 unsigned int index);59 unsigned int index);
57extern int platform_get_irq(struct platform_device *, unsigned int);60extern int platform_get_irq(struct platform_device *, unsigned int);
61extern int platform_get_irq_optional(struct platform_device *, unsigned int);
58extern int platform_irq_count(struct platform_device *);62extern int platform_irq_count(struct platform_device *);
59extern struct resource *platform_get_resource_byname(struct platform_device *,63extern struct resource *platform_get_resource_byname(struct platform_device *,
60 unsigned int,64 unsigned int,
include/linux/pm.h+0−4
@@ -712,8 +712,6 @@ struct dev_pm_domain { · 711 unmodified lines
712extern void device_pm_lock(void);712extern void device_pm_lock(void);
713extern void dpm_resume_start(pm_message_t state);713extern void dpm_resume_start(pm_message_t state);
714extern void dpm_resume_end(pm_message_t state);714extern void dpm_resume_end(pm_message_t state);
715extern void dpm_noirq_resume_devices(pm_message_t state);
716extern void dpm_noirq_end(void);
717extern void dpm_resume_noirq(pm_message_t state);715extern void dpm_resume_noirq(pm_message_t state);
718extern void dpm_resume_early(pm_message_t state);716extern void dpm_resume_early(pm_message_t state);
719extern void dpm_resume(pm_message_t state);717extern void dpm_resume(pm_message_t state);
@@ -722,8 +720,6 @@ extern void dpm_complete(pm_message_t state); · 2 unmodified lines
722extern void device_pm_unlock(void);720extern void device_pm_unlock(void);
723extern int dpm_suspend_end(pm_message_t state);721extern int dpm_suspend_end(pm_message_t state);
724extern int dpm_suspend_start(pm_message_t state);722extern int dpm_suspend_start(pm_message_t state);
725extern void dpm_noirq_begin(void);
726extern int dpm_noirq_suspend_devices(pm_message_t state);
727extern int dpm_suspend_noirq(pm_message_t state);723extern int dpm_suspend_noirq(pm_message_t state);
728extern int dpm_suspend_late(pm_message_t state);724extern int dpm_suspend_late(pm_message_t state);
729extern int dpm_suspend(pm_message_t state);725extern 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
197int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev);197int pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev);
198int pm_genpd_remove_device(struct device *dev);198int pm_genpd_remove_device(struct device *dev);
199int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,199int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
200 struct generic_pm_domain *new_subdomain);200 struct generic_pm_domain *subdomain);
201int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,201int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
202 struct generic_pm_domain *target);202 struct generic_pm_domain *subdomain);
203int pm_genpd_init(struct generic_pm_domain *genpd,203int pm_genpd_init(struct generic_pm_domain *genpd,
204 struct dev_power_governor *gov, bool is_off);204 struct dev_power_governor *gov, bool is_off);
205int pm_genpd_remove(struct generic_pm_domain *genpd);205int 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
226 return -ENOSYS;226 return -ENOSYS;
227}227}
228static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,228static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
229 struct generic_pm_domain *new_sd)229 struct generic_pm_domain *subdomain)
230{230{
231 return -ENOSYS;231 return -ENOSYS;
232}232}
233static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,233static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
234 struct generic_pm_domain *target)234 struct generic_pm_domain *subdomain)
235{235{
236 return -ENOSYS;236 return -ENOSYS;
237}237}
@@ -282,8 +282,8 @@ int of_genpd_add_provider_onecell(struct device_node *np, · 44 unmodified lines
282 struct genpd_onecell_data *data);282 struct genpd_onecell_data *data);
283void of_genpd_del_provider(struct device_node *np);283void of_genpd_del_provider(struct device_node *np);
284int of_genpd_add_device(struct of_phandle_args *args, struct device *dev);284int of_genpd_add_device(struct of_phandle_args *args, struct device *dev);
285int of_genpd_add_subdomain(struct of_phandle_args *parent,285int of_genpd_add_subdomain(struct of_phandle_args *parent_spec,
286 struct of_phandle_args *new_subdomain);286 struct of_phandle_args *subdomain_spec);
287struct generic_pm_domain *of_genpd_remove_last(struct device_node *np);287struct generic_pm_domain *of_genpd_remove_last(struct device_node *np);
288int of_genpd_parse_idle_states(struct device_node *dn,288int of_genpd_parse_idle_states(struct device_node *dn,
289 struct genpd_power_state **states, int *n);289 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
316 return -ENODEV;316 return -ENODEV;
317}317}
318 318
319static inline int of_genpd_add_subdomain(struct of_phandle_args *parent,319static inline int of_genpd_add_subdomain(struct of_phandle_args *parent_spec,
320 struct of_phandle_args *new_subdomain)320 struct of_phandle_args *subdomain_spec)
321{321{
322 return -ENODEV;322 return -ENODEV;
323}323}
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
96struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,96struct dev_pm_opp *dev_pm_opp_find_freq_exact(struct device *dev,
97 unsigned long freq,97 unsigned long freq,
98 bool available);98 bool available);
99struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev,
100 unsigned int level);
99 101
100struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,102struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
101 unsigned long *freq);103 unsigned long *freq);
@@ -128,7 +130,7 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char * name); · 26 unmodified lines
128void dev_pm_opp_put_clkname(struct opp_table *opp_table);130void dev_pm_opp_put_clkname(struct opp_table *opp_table);
129struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data));131struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev, int (*set_opp)(struct dev_pm_set_opp_data *data));
130void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table);132void dev_pm_opp_unregister_set_opp_helper(struct opp_table *opp_table);
131struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names);133struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs);
132void dev_pm_opp_detach_genpd(struct opp_table *opp_table);134void dev_pm_opp_detach_genpd(struct opp_table *opp_table);
133int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate);135int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate);
134int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq);136int 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
200 return ERR_PTR(-ENOTSUPP);202 return ERR_PTR(-ENOTSUPP);
201}203}
202 204
205static 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
203static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,211static inline struct dev_pm_opp *dev_pm_opp_find_freq_floor(struct device *dev,
204 unsigned long *freq)212 unsigned long *freq)
205{213{
@@ -292,7 +300,7 @@ static inline struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const · 86 unmodified lines
292 300
293static inline void dev_pm_opp_put_clkname(struct opp_table *opp_table) {}301static inline void dev_pm_opp_put_clkname(struct opp_table *opp_table) {}
294 302
295static inline struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names)303static inline struct opp_table *dev_pm_opp_attach_genpd(struct device *dev, const char **names, struct device ***virt_devs)
296{304{
297 return ERR_PTR(-ENOTSUPP);305 return ERR_PTR(-ENOTSUPP);
298}306}
include/linux/pm_qos.h+0−6
@@ -13,9 +13,6 @@ · 12 unmodified lines
13enum {13enum {
14 PM_QOS_RESERVED = 0,14 PM_QOS_RESERVED = 0,
15 PM_QOS_CPU_DMA_LATENCY,15 PM_QOS_CPU_DMA_LATENCY,
16 PM_QOS_NETWORK_LATENCY,
17 PM_QOS_NETWORK_THROUGHPUT,
18 PM_QOS_MEMORY_BANDWIDTH,
19 16
20 /* insert new class ID */17 /* insert new class ID */
21 PM_QOS_NUM_CLASSES,18 PM_QOS_NUM_CLASSES,
@@ -33,9 +30,6 @@ enum pm_qos_flags_status { · 11 unmodified lines
33#define PM_QOS_LATENCY_ANY_NS ((s64)PM_QOS_LATENCY_ANY * NSEC_PER_USEC)30#define PM_QOS_LATENCY_ANY_NS ((s64)PM_QOS_LATENCY_ANY * NSEC_PER_USEC)
34 31
35#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)32#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
39#define PM_QOS_RESUME_LATENCY_DEFAULT_VALUE PM_QOS_LATENCY_ANY33#define PM_QOS_RESUME_LATENCY_DEFAULT_VALUE PM_QOS_LATENCY_ANY
40#define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT PM_QOS_LATENCY_ANY34#define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT PM_QOS_LATENCY_ANY
41#define PM_QOS_RESUME_LATENCY_NO_CONSTRAINT_NS PM_QOS_LATENCY_ANY_NS35#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
21 * struct wakeup_source - Representation of wakeup sources21 * struct wakeup_source - Representation of wakeup sources
22 *22 *
23 * @name: Name of the wakeup source23 * @name: Name of the wakeup source
24 * @id: Wakeup source id
24 * @entry: Wakeup source list entry25 * @entry: Wakeup source list entry
25 * @lock: Wakeup source lock26 * @lock: Wakeup source lock
26 * @wakeirq: Optional device specific wakeirq27 * @wakeirq: Optional device specific wakeirq
@@ -35,11 +36,13 @@ struct wake_irq; · 8 unmodified lines
35 * @relax_count: Number of times the wakeup source was deactivated.36 * @relax_count: Number of times the wakeup source was deactivated.
36 * @expire_count: Number of times the wakeup source's timeout has expired.37 * @expire_count: Number of times the wakeup source's timeout has expired.
37 * @wakeup_count: Number of times the wakeup source might abort suspend.38 * @wakeup_count: Number of times the wakeup source might abort suspend.
39 * @dev: Struct device for sysfs statistics about the wakeup source.
38 * @active: Status of the wakeup source.40 * @active: Status of the wakeup source.
39 * @autosleep_enabled: Autosleep is active, so update @prevent_sleep_time.41 * @autosleep_enabled: Autosleep is active, so update @prevent_sleep_time.
40 */42 */
41struct wakeup_source {43struct wakeup_source {
42 const char *name;44 const char *name;
45 int id;
43 struct list_head entry;46 struct list_head entry;
44 spinlock_t lock;47 spinlock_t lock;
45 struct wake_irq *wakeirq;48 struct wake_irq *wakeirq;
@@ -55,6 +58,7 @@ struct wakeup_source { · 9 unmodified lines
55 unsigned long relax_count;58 unsigned long relax_count;
56 unsigned long expire_count;59 unsigned long expire_count;
57 unsigned long wakeup_count;60 unsigned long wakeup_count;
61 struct device *dev;
58 bool active:1;62 bool active:1;
59 bool autosleep_enabled:1;63 bool autosleep_enabled:1;
60};64};
@@ -81,12 +85,12 @@ static inline void device_set_wakeup_path(struct device *dev) · 20 unmodified lines
81}85}
82 86
83/* drivers/base/power/wakeup.c */87/* drivers/base/power/wakeup.c */
84extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name);
85extern struct wakeup_source *wakeup_source_create(const char *name);88extern struct wakeup_source *wakeup_source_create(const char *name);
86extern void wakeup_source_destroy(struct wakeup_source *ws);89extern void wakeup_source_destroy(struct wakeup_source *ws);
87extern void wakeup_source_add(struct wakeup_source *ws);90extern void wakeup_source_add(struct wakeup_source *ws);
88extern void wakeup_source_remove(struct wakeup_source *ws);91extern void wakeup_source_remove(struct wakeup_source *ws);
89extern struct wakeup_source *wakeup_source_register(const char *name);92extern struct wakeup_source *wakeup_source_register(struct device *dev,
93 const char *name);
90extern void wakeup_source_unregister(struct wakeup_source *ws);94extern void wakeup_source_unregister(struct wakeup_source *ws);
91extern int device_wakeup_enable(struct device *dev);95extern int device_wakeup_enable(struct device *dev);
92extern int device_wakeup_disable(struct device *dev);96extern int device_wakeup_disable(struct device *dev);
@@ -112,9 +116,6 @@ static inline bool device_can_wakeup(struct device *dev) · 19 unmodified lines
112 return dev->power.can_wakeup;116 return dev->power.can_wakeup;
113}117}
114 118
115static inline void wakeup_source_prepare(struct wakeup_source *ws,
116 const char *name) {}
117
118static inline struct wakeup_source *wakeup_source_create(const char *name)119static inline struct wakeup_source *wakeup_source_create(const char *name)
119{120{
120 return NULL;121 return NULL;
@@ -126,7 +127,8 @@ static inline void wakeup_source_add(struct wakeup_source *ws) {} · 5 unmodified lines
126 127
127static inline void wakeup_source_remove(struct wakeup_source *ws) {}128static inline void wakeup_source_remove(struct wakeup_source *ws) {}
128 129
129static inline struct wakeup_source *wakeup_source_register(const char *name)130static inline struct wakeup_source *wakeup_source_register(struct device *dev,
131 const char *name)
130{132{
131 return NULL;133 return NULL;
132}134}
@@ -181,13 +183,6 @@ static inline void pm_wakeup_dev_event(struct device *dev, unsigned int msec, · 48 unmodified lines
181 183
182#endif /* !CONFIG_PM_SLEEP */184#endif /* !CONFIG_PM_SLEEP */
183 185
184static 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
191static inline void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec)186static inline void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec)
192{187{
193 return pm_wakeup_ws_event(ws, msec, false);188 return pm_wakeup_ws_event(ws, msec, false);
include/linux/posix-timers.h+117−14
@@ -4,18 +4,11 @@ · 3 unmodified lines
4 4
5#include <linux/spinlock.h>5#include <linux/spinlock.h>
6#include <linux/list.h>6#include <linux/list.h>
7#include <linux/sched.h>
8#include <linux/timex.h>
9#include <linux/alarmtimer.h>7#include <linux/alarmtimer.h>
8#include <linux/timerqueue.h>
10 9
11struct siginfo;10struct kernel_siginfo;
12 11struct task_struct;
13struct cpu_timer_list {
14 struct list_head entry;
15 u64 expires;
16 struct task_struct *task;
17 int firing;
18};
19 12
20/*13/*
21 * Bit fields within a clockid:14 * Bit fields within a clockid:
@@ -63,6 +56,115 @@ static inline int clockid_to_fd(const clockid_t clk) · 41 unmodified lines
63 return ~(clk >> 3);56 return ~(clk >> 3);
64}57}
65 58
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 */
69struct 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
77static 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
84static 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
92static inline u64 cpu_timer_getexpires(struct cpu_timer *ctmr)
93{
94 return ctmr->node.expires;
95}
96
97static 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 */
107struct 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 */
122struct posix_cputimers {
123 struct posix_cputimer_base bases[CPUCLOCK_MAX];
124 unsigned int timers_active;
125 unsigned int expiry_active;
126};
127
128static 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
136void posix_cputimers_group_init(struct posix_cputimers *pct, u64 cpu_limit);
137
138static 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
160struct posix_cputimers { };
161struct cpu_timer { };
162#define INIT_CPU_TIMERS(s)
163static inline void posix_cputimers_init(struct posix_cputimers *pct) { }
164static inline void posix_cputimers_group_init(struct posix_cputimers *pct,
165 u64 cpu_limit) { }
166#endif
167
66#define REQUEUE_PENDING 1168#define REQUEUE_PENDING 1
67 169
68/**170/**
@@ -85,7 +187,8 @@ static inline int clockid_to_fd(const clockid_t clk) · 16 unmodified lines
85 * @it_process: The task to wakeup on clock_nanosleep (CPU timers)187 * @it_process: The task to wakeup on clock_nanosleep (CPU timers)
86 * @sigq: Pointer to preallocated sigqueue188 * @sigq: Pointer to preallocated sigqueue
87 * @it: Union representing the various posix timer type189 * @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.
89 */192 */
90struct k_itimer {193struct k_itimer {
91 struct list_head list;194 struct list_head list;
@@ -110,15 +213,15 @@ struct k_itimer { · 18 unmodified lines
110 struct {213 struct {
111 struct hrtimer timer;214 struct hrtimer timer;
112 } real;215 } real;
113 struct cpu_timer_list cpu;216 struct cpu_timer cpu;
114 struct {217 struct {
115 struct alarm alarmtimer;218 struct alarm alarmtimer;
116 } alarm;219 } alarm;
117 struct rcu_head rcu;
118 } it;220 } it;
221 struct rcu_head rcu;
119};222};
120 223
121void run_posix_cpu_timers(struct task_struct *task);224void run_posix_cpu_timers(void);
122void posix_cpu_timers_exit(struct task_struct *task);225void posix_cpu_timers_exit(struct task_struct *task);
123void posix_cpu_timers_exit_group(struct task_struct *task);226void posix_cpu_timers_exit_group(struct task_struct *task);
124void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx,227void 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
182 182
183#define preemptible() (preempt_count() == 0 && !irqs_disabled())183#define preemptible() (preempt_count() == 0 && !irqs_disabled())
184 184
185#ifdef CONFIG_PREEMPT185#ifdef CONFIG_PREEMPTION
186#define preempt_enable() \186#define preempt_enable() \
187do { \187do { \
188 barrier(); \188 barrier(); \
@@ -203,7 +203,7 @@ do { \ · 14 unmodified lines
203 __preempt_schedule(); \203 __preempt_schedule(); \
204} while (0)204} while (0)
205 205
206#else /* !CONFIG_PREEMPT */206#else /* !CONFIG_PREEMPTION */
207#define preempt_enable() \207#define preempt_enable() \
208do { \208do { \
209 barrier(); \209 barrier(); \
@@ -217,7 +217,7 @@ do { \ · 7 unmodified lines
217} while (0)217} while (0)
218 218
219#define preempt_check_resched() do { } while (0)219#define preempt_check_resched() do { } while (0)
220#endif /* CONFIG_PREEMPT */220#endif /* CONFIG_PREEMPTION */
221 221
222#define preempt_disable_notrace() \222#define preempt_disable_notrace() \
223do { \223do { \
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
488extern void print_hex_dump(const char *level, const char *prefix_str,488extern void print_hex_dump(const char *level, const char *prefix_str,
489 int prefix_type, int rowsize, int groupsize,489 int prefix_type, int rowsize, int groupsize,
490 const void *buf, size_t len, bool ascii);490 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
495extern 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) */
498#else491#else
499static inline void print_hex_dump(const char *level, const char *prefix_str,492static inline void print_hex_dump(const char *level, const char *prefix_str,
500 int prefix_type, int rowsize, int groupsize,493 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
526}519}
527#endif520#endif
528 521
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
529#endif537#endif
include/linux/property.h+4−0
@@ -421,6 +421,10 @@ bool is_software_node(const struct fwnode_handle *fwnode); · 420 unmodified lines
421const struct software_node *to_software_node(struct fwnode_handle *fwnode);421const struct software_node *to_software_node(struct fwnode_handle *fwnode);
422struct fwnode_handle *software_node_fwnode(const struct software_node *node);422struct fwnode_handle *software_node_fwnode(const struct software_node *node);
423 423
424const struct software_node *
425software_node_find_by_name(const struct software_node *parent,
426 const char *name);
427
424int software_node_register_nodes(const struct software_node *nodes);428int software_node_register_nodes(const struct software_node *nodes);
425void software_node_unregister_nodes(const struct software_node *nodes);429void software_node_unregister_nodes(const struct software_node *nodes);
426 430
include/linux/psci.h+2−2
@@ -15,8 +15,8 @@ · 14 unmodified lines
15 15
16bool psci_tos_resident_on(int cpu);16bool psci_tos_resident_on(int cpu);
17 17
18int psci_cpu_init_idle(unsigned int cpu);18int psci_cpu_suspend_enter(u32 state);
19int psci_cpu_suspend_enter(unsigned long index);19bool psci_power_state_is_valid(u32 state);
20 20
21enum psci_conduit {21enum psci_conduit {
22 PSCI_CONDUIT_NONE,22 PSCI_CONDUIT_NONE,
include/linux/pwm.h+2−2
@@ -262,7 +262,7 @@ struct pwm_ops { · 261 unmodified lines
262 int (*capture)(struct pwm_chip *chip, struct pwm_device *pwm,262 int (*capture)(struct pwm_chip *chip, struct pwm_device *pwm,
263 struct pwm_capture *result, unsigned long timeout);263 struct pwm_capture *result, unsigned long timeout);
264 int (*apply)(struct pwm_chip *chip, struct pwm_device *pwm,264 int (*apply)(struct pwm_chip *chip, struct pwm_device *pwm,
265 struct pwm_state *state);265 const struct pwm_state *state);
266 void (*get_state)(struct pwm_chip *chip, struct pwm_device *pwm,266 void (*get_state)(struct pwm_chip *chip, struct pwm_device *pwm,
267 struct pwm_state *state);267 struct pwm_state *state);
268 struct module *owner;268 struct module *owner;
@@ -316,7 +316,7 @@ struct pwm_capture { · 47 unmodified lines
316/* PWM user APIs */316/* PWM user APIs */
317struct pwm_device *pwm_request(int pwm_id, const char *label);317struct pwm_device *pwm_request(int pwm_id, const char *label);
318void pwm_free(struct pwm_device *pwm);318void pwm_free(struct pwm_device *pwm);
319int pwm_apply_state(struct pwm_device *pwm, struct pwm_state *state);319int pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state);
320int pwm_adjust_config(struct pwm_device *pwm);320int pwm_adjust_config(struct pwm_device *pwm);
321 321
322/**322/**
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
49extern int qcom_scm_pas_auth_and_reset(u32 peripheral);49extern int qcom_scm_pas_auth_and_reset(u32 peripheral);
50extern int qcom_scm_pas_shutdown(u32 peripheral);50extern int qcom_scm_pas_shutdown(u32 peripheral);
51extern int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,51extern int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
52 unsigned int *src, struct qcom_scm_vmperm *newvm,52 unsigned int *src,
53 int dest_cnt);53 const struct qcom_scm_vmperm *newvm,
54 unsigned int dest_cnt);
54extern void qcom_scm_cpu_power_down(u32 flags);55extern void qcom_scm_cpu_power_down(u32 flags);
55extern u32 qcom_scm_get_version(void);56extern u32 qcom_scm_get_version(void);
56extern int qcom_scm_set_remote_state(u32 state, u32 id);57extern 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
87static inline int qcom_scm_pas_shutdown(u32 peripheral) { return -ENODEV; }88static inline int qcom_scm_pas_shutdown(u32 peripheral) { return -ENODEV; }
88static inline int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,89static inline int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz,
89 unsigned int *src,90 unsigned int *src,
90 struct qcom_scm_vmperm *newvm,91 const struct qcom_scm_vmperm *newvm,
91 int dest_cnt) { return -ENODEV; }92 unsigned int dest_cnt) { return -ENODEV; }
92static inline void qcom_scm_cpu_power_down(u32 flags) {}93static inline void qcom_scm_cpu_power_down(u32 flags) {}
93static inline u32 qcom_scm_get_version(void) { return 0; }94static inline u32 qcom_scm_get_version(void) { return 0; }
94static inline u3295static inline u32
include/linux/qed/qed_if.h+30−1
@@ -689,7 +689,7 @@ enum qed_link_mode_bits { · 688 unmodified lines
689 QED_LM_40000baseLR4_Full_BIT = BIT(9),689 QED_LM_40000baseLR4_Full_BIT = BIT(9),
690 QED_LM_50000baseKR2_Full_BIT = BIT(10),690 QED_LM_50000baseKR2_Full_BIT = BIT(10),
691 QED_LM_100000baseKR4_Full_BIT = BIT(11),691 QED_LM_100000baseKR4_Full_BIT = BIT(11),
692 QED_LM_2500baseX_Full_BIT = BIT(12),692 QED_LM_TP_BIT = BIT(12),
693 QED_LM_Backplane_BIT = BIT(13),693 QED_LM_Backplane_BIT = BIT(13),
694 QED_LM_1000baseKX_Full_BIT = BIT(14),694 QED_LM_1000baseKX_Full_BIT = BIT(14),
695 QED_LM_10000baseKX4_Full_BIT = BIT(15),695 QED_LM_10000baseKX4_Full_BIT = BIT(15),
@@ -804,6 +804,7 @@ enum qed_nvm_flash_cmd { · 108 unmodified lines
804 QED_NVM_FLASH_CMD_FILE_DATA = 0x2,804 QED_NVM_FLASH_CMD_FILE_DATA = 0x2,
805 QED_NVM_FLASH_CMD_FILE_START = 0x3,805 QED_NVM_FLASH_CMD_FILE_START = 0x3,
806 QED_NVM_FLASH_CMD_NVM_CHANGE = 0x4,806 QED_NVM_FLASH_CMD_NVM_CHANGE = 0x4,
807 QED_NVM_FLASH_CMD_NVM_CFG_ID = 0x5,
807 QED_NVM_FLASH_CMD_NVM_MAX,808 QED_NVM_FLASH_CMD_NVM_MAX,
808};809};
809 810
@@ -1131,6 +1132,34 @@ struct qed_common_ops { · 321 unmodified lines
1131 * @param cdev1132 * @param cdev
1132 */1133 */
1133 u8 (*get_affin_hwfn_idx)(struct qed_dev *cdev);1134 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);
1134};1163};
1135 1164
1136#define MASK_FIELD(_name, _value) \1165#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
225 225
226struct qed_rdma_add_user_out_params {226struct qed_rdma_add_user_out_params {
227 u16 dpi;227 u16 dpi;
228 u64 dpi_addr;228 void __iomem *dpi_addr;
229 u64 dpi_phys_addr;229 u64 dpi_phys_addr;
230 u32 dpi_size;230 u32 dpi_size;
231 u16 wid_count;231 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
17struct quicklist {
18 void *page;
19 int nr_pages;
20};
21
22DECLARE_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 */
34static 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
56static 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
68static inline void quicklist_free(int nr, void (*dtor)(void *), void *pp)
69{
70 __quicklist_free(nr, dtor, pp, virt_to_page(pp));
71}
72
73static 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
79void quicklist_trim(int nr, void (*dtor)(void *),
80 unsigned long min_pages, unsigned long max_free);
81
82unsigned long quicklist_total_size(void);
83
84#else
85
86static 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
22/* i_mutex must being held */22/* i_mutex must being held */
23static inline bool is_quota_modification(struct inode *inode, struct iattr *ia)23static inline bool is_quota_modification(struct inode *inode, struct iattr *ia)
24{24{
25 return (ia->ia_valid & ATTR_SIZE && ia->ia_size != inode->i_size) ||25 return (ia->ia_valid & ATTR_SIZE) ||
26 (ia->ia_valid & ATTR_UID && !uid_eq(ia->ia_uid, inode->i_uid)) ||26 (ia->ia_valid & ATTR_UID && !uid_eq(ia->ia_uid, inode->i_uid)) ||
27 (ia->ia_valid & ATTR_GID && !gid_eq(ia->ia_gid, inode->i_gid));27 (ia->ia_valid & ATTR_GID && !gid_eq(ia->ia_gid, inode->i_gid));
28}28}
include/linux/ramfs.h+2−4
@@ -4,8 +4,7 @@ · 3 unmodified lines
4 4
5struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,5struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
6 umode_t mode, dev_t dev);6 umode_t mode, dev_t dev);
7extern struct dentry *ramfs_mount(struct file_system_type *fs_type,7extern int ramfs_init_fs_context(struct fs_context *fc);
8 int flags, const char *dev_name, void *data);
9 8
10#ifdef CONFIG_MMU9#ifdef CONFIG_MMU
11static inline int10static inline int
@@ -17,9 +16,8 @@ ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) · 5 unmodified lines
17extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize);16extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize);
18#endif17#endif
19 18
19extern const struct fs_parameter_description ramfs_fs_parameters;
20extern const struct file_operations ramfs_file_operations;20extern const struct file_operations ramfs_file_operations;
21extern const struct vm_operations_struct generic_file_vm_ops;21extern const struct vm_operations_struct generic_file_vm_ops;
22 22
23int ramfs_fill_super(struct super_block *sb, void *data, int silent);
24
25#endif23#endif
include/linux/random.h+1−0
@@ -19,6 +19,7 @@ struct random_ready_callback { · 18 unmodified lines
19};19};
20 20
21extern void add_device_randomness(const void *, unsigned int);21extern void add_device_randomness(const void *, unsigned int);
22extern void add_bootloader_randomness(const void *, unsigned int);
22 23
23#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__)24#if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__)
24static inline void add_latent_entropy(void)25static 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
60 rb_insert_augmented(node, &root->rb_root, augment);60 rb_insert_augmented(node, &root->rb_root, augment);
61}61}
62 62
63#define RB_DECLARE_CALLBACKS(rbstatic, rbname, rbstruct, rbfield, \63/*
64 rbtype, rbaugmented, rbcompute) \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) \
65static inline void \76static inline void \
66rbname ## _propagate(struct rb_node *rb, struct rb_node *stop) \77RBNAME ## _propagate(struct rb_node *rb, struct rb_node *stop) \
67{ \78{ \
68 while (rb != stop) { \79 while (rb != stop) { \
69 rbstruct *node = rb_entry(rb, rbstruct, rbfield); \80 RBSTRUCT *node = rb_entry(rb, RBSTRUCT, RBFIELD); \
70 rbtype augmented = rbcompute(node); \81 if (RBCOMPUTE(node, true)) \
71 if (node->rbaugmented == augmented) \
72 break; \82 break; \
73 node->rbaugmented = augmented; \83 rb = rb_parent(&node->RBFIELD); \
74 rb = rb_parent(&node->rbfield); \
75 } \84 } \
76} \85} \
77static inline void \86static inline void \
78rbname ## _copy(struct rb_node *rb_old, struct rb_node *rb_new) \87RBNAME ## _copy(struct rb_node *rb_old, struct rb_node *rb_new) \
79{ \88{ \
80 rbstruct *old = rb_entry(rb_old, rbstruct, rbfield); \89 RBSTRUCT *old = rb_entry(rb_old, RBSTRUCT, RBFIELD); \
81 rbstruct *new = rb_entry(rb_new, rbstruct, rbfield); \90 RBSTRUCT *new = rb_entry(rb_new, RBSTRUCT, RBFIELD); \
82 new->rbaugmented = old->rbaugmented; \91 new->RBAUGMENTED = old->RBAUGMENTED; \
83} \92} \
84static void \93static void \
85rbname ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new) \94RBNAME ## _rotate(struct rb_node *rb_old, struct rb_node *rb_new) \
86{ \95{ \
87 rbstruct *old = rb_entry(rb_old, rbstruct, rbfield); \96 RBSTRUCT *old = rb_entry(rb_old, RBSTRUCT, RBFIELD); \
88 rbstruct *new = rb_entry(rb_new, rbstruct, rbfield); \97 RBSTRUCT *new = rb_entry(rb_new, RBSTRUCT, RBFIELD); \
89 new->rbaugmented = old->rbaugmented; \98 new->RBAUGMENTED = old->RBAUGMENTED; \
90 old->rbaugmented = rbcompute(old); \99 RBCOMPUTE(old, false); \
91} \100} \
92rbstatic const struct rb_augment_callbacks rbname = { \101RBSTATIC const struct rb_augment_callbacks RBNAME = { \
93 .propagate = rbname ## _propagate, \102 .propagate = RBNAME ## _propagate, \
94 .copy = rbname ## _copy, \103 .copy = RBNAME ## _copy, \
95 .rotate = rbname ## _rotate \104 .rotate = RBNAME ## _rotate \
96};105};
97 106
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) \
122static 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} \
141RB_DECLARE_CALLBACKS(RBSTATIC, RBNAME, \
142 RBSTRUCT, RBFIELD, RBAUGMENTED, RBNAME ## _compute_max)
143
98 144
99#define RB_RED 0145#define RB_RED 0
100#define RB_BLACK 1146#define RB_BLACK 1
include/linux/rcu_segcblist.h+9−0
@@ -14,6 +14,9 @@ · 13 unmodified lines
14#ifndef __INCLUDE_LINUX_RCU_SEGCBLIST_H14#ifndef __INCLUDE_LINUX_RCU_SEGCBLIST_H
15#define __INCLUDE_LINUX_RCU_SEGCBLIST_H15#define __INCLUDE_LINUX_RCU_SEGCBLIST_H
16 16
17#include <linux/types.h>
18#include <linux/atomic.h>
19
17/* Simple unsegmented callback lists. */20/* Simple unsegmented callback lists. */
18struct rcu_cblist {21struct rcu_cblist {
19 struct rcu_head *head;22 struct rcu_head *head;
@@ -65,8 +68,14 @@ struct rcu_segcblist { · 45 unmodified lines
65 struct rcu_head *head;68 struct rcu_head *head;
66 struct rcu_head **tails[RCU_CBLIST_NSEGS];69 struct rcu_head **tails[RCU_CBLIST_NSEGS];
67 unsigned long gp_seq[RCU_CBLIST_NSEGS];70 unsigned long gp_seq[RCU_CBLIST_NSEGS];
71#ifdef CONFIG_RCU_NOCB_CPU
72 atomic_long_t len;
73#else
68 long len;74 long len;
75#endif
69 long len_lazy;76 long len_lazy;
77 u8 enabled;
78 u8 offloaded;
70};79};
71 80
72#define RCU_SEGCBLIST_INITIALIZER(n) \81#define RCU_SEGCBLIST_INITIALIZER(n) \
include/linux/rcu_sync.h+1−3
@@ -31,9 +31,7 @@ struct rcu_sync { · 30 unmodified lines
31 */31 */
32static inline bool rcu_sync_is_idle(struct rcu_sync *rsp)32static inline bool rcu_sync_is_idle(struct rcu_sync *rsp)
33{33{
34 RCU_LOCKDEP_WARN(!rcu_read_lock_held() &&34 RCU_LOCKDEP_WARN(!rcu_read_lock_any_held(),
35 !rcu_read_lock_bh_held() &&
36 !rcu_read_lock_sched_held(),
37 "suspicious rcu_sync_is_idle() usage");35 "suspicious rcu_sync_is_idle() usage");
38 return !READ_ONCE(rsp->gp_state); /* GP_IDLE */36 return !READ_ONCE(rsp->gp_state); /* GP_IDLE */
39}37}
include/linux/rculist.h+29−7
@@ -40,6 +40,24 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list) · 39 unmodified lines
40 */40 */
41#define list_next_rcu(list) (*((struct list_head __rcu **)(&(list)->next)))41#define list_next_rcu(list) (*((struct list_head __rcu **)(&(list)->next)))
42 42
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
43/*61/*
44 * Insert a new entry between two known consecutive entries.62 * Insert a new entry between two known consecutive entries.
45 *63 *
@@ -343,14 +361,16 @@ static inline void list_splice_tail_init_rcu(struct list_head *list, · 297 unmodified lines
343 * @pos: the type * to use as a loop cursor.361 * @pos: the type * to use as a loop cursor.
344 * @head: the head for your list.362 * @head: the head for your list.
345 * @member: the name of the list_head within the struct.363 * @member: the name of the list_head within the struct.
364 * @cond: optional lockdep expression if called from non-RCU protection.
346 *365 *
347 * This list-traversal primitive may safely run concurrently with366 * This list-traversal primitive may safely run concurrently with
348 * the _rcu list-mutation primitives such as list_add_rcu()367 * the _rcu list-mutation primitives such as list_add_rcu()
349 * as long as the traversal is guarded by rcu_read_lock().368 * as long as the traversal is guarded by rcu_read_lock().
350 */369 */
351#define list_for_each_entry_rcu(pos, head, member) \370#define list_for_each_entry_rcu(pos, head, member, cond...) \
352 for (pos = list_entry_rcu((head)->next, typeof(*pos), member); \371 for (__list_check_rcu(dummy, ## cond, 0), \
353 &pos->member != (head); \372 pos = list_entry_rcu((head)->next, typeof(*pos), member); \
373 &pos->member != (head); \
354 pos = list_entry_rcu(pos->member.next, typeof(*pos), member))374 pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
355 375
356/**376/**
@@ -616,13 +636,15 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, · 259 unmodified lines
616 * @pos: the type * to use as a loop cursor.636 * @pos: the type * to use as a loop cursor.
617 * @head: the head for your list.637 * @head: the head for your list.
618 * @member: the name of the hlist_node within the struct.638 * @member: the name of the hlist_node within the struct.
639 * @cond: optional lockdep expression if called from non-RCU protection.
619 *640 *
620 * This list-traversal primitive may safely run concurrently with641 * This list-traversal primitive may safely run concurrently with
621 * the _rcu list-mutation primitives such as hlist_add_head_rcu()642 * the _rcu list-mutation primitives such as hlist_add_head_rcu()
622 * as long as the traversal is guarded by rcu_read_lock().643 * as long as the traversal is guarded by rcu_read_lock().
623 */644 */
624#define hlist_for_each_entry_rcu(pos, head, member) \645#define hlist_for_each_entry_rcu(pos, head, member, cond...) \
625 for (pos = hlist_entry_safe (rcu_dereference_raw(hlist_first_rcu(head)),\646 for (__list_check_rcu(dummy, ## cond, 0), \
647 pos = hlist_entry_safe(rcu_dereference_raw(hlist_first_rcu(head)),\
626 typeof(*(pos)), member); \648 typeof(*(pos)), member); \
627 pos; \649 pos; \
628 pos = hlist_entry_safe(rcu_dereference_raw(hlist_next_rcu(\650 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
642 * not do any RCU debugging or tracing.664 * not do any RCU debugging or tracing.
643 */665 */
644#define hlist_for_each_entry_rcu_notrace(pos, head, member) \666#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)),\
646 typeof(*(pos)), member); \668 typeof(*(pos)), member); \
647 pos; \669 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(\
649 &(pos)->member)), typeof(*(pos)), member))671 &(pos)->member)), typeof(*(pos)), member))
650 672
651/**673/**
include/linux/rcupdate.h+9−2
@@ -221,6 +221,7 @@ int debug_lockdep_rcu_enabled(void); · 220 unmodified lines
221int rcu_read_lock_held(void);221int rcu_read_lock_held(void);
222int rcu_read_lock_bh_held(void);222int rcu_read_lock_bh_held(void);
223int rcu_read_lock_sched_held(void);223int rcu_read_lock_sched_held(void);
224int rcu_read_lock_any_held(void);
224 225
225#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */226#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
226 227
@@ -241,6 +242,12 @@ static inline int rcu_read_lock_sched_held(void) · 14 unmodified lines
241{242{
242 return !preemptible();243 return !preemptible();
243}244}
245
246static inline int rcu_read_lock_any_held(void)
247{
248 return !preemptible();
249}
250
244#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */251#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
245 252
246#ifdef CONFIG_PROVE_RCU253#ifdef CONFIG_PROVE_RCU
@@ -476,7 +483,7 @@ do { \ · 229 unmodified lines
476 * The no-tracing version of rcu_dereference_raw() must not call483 * The no-tracing version of rcu_dereference_raw() must not call
477 * rcu_read_lock_held().484 * rcu_read_lock_held().
478 */485 */
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)
480 487
481/**488/**
482 * rcu_dereference_protected() - fetch RCU pointer when updates prevented489 * rcu_dereference_protected() - fetch RCU pointer when updates prevented
@@ -578,7 +585,7 @@ do { \ · 95 unmodified lines
578 *585 *
579 * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU),586 * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU),
580 * it is illegal to block while in an RCU read-side critical section.587 * it is illegal to block while in an RCU read-side critical section.
581 * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPT588 * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPTION
582 * kernel builds, RCU read-side critical sections may be preempted,589 * kernel builds, RCU read-side critical sections may be preempted,
583 * but explicit blocking is illegal. Finally, in preemptible RCU590 * but explicit blocking is illegal. Finally, in preemptible RCU
584 * implementations in real-time (with -rt patchset) kernel builds, RCU591 * implementations in real-time (with -rt patchset) kernel builds, RCU
include/linux/rcutiny.h+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
12#ifndef __LINUX_TINY_H12#ifndef __LINUX_TINY_H
13#define __LINUX_TINY_H13#define __LINUX_TINY_H
14 14
15#include <linux/ktime.h>15#include <asm/param.h> /* for HZ */
16 16
17/* Never flag non-existent other CPUs! */17/* Never flag non-existent other CPUs! */
18static inline bool rcu_eqs_special_set(int cpu) { return false; }18static 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
53extern int rcu_scheduler_active __read_mostly;53extern int rcu_scheduler_active __read_mostly;
54void rcu_end_inkernel_boot(void);54void rcu_end_inkernel_boot(void);
55bool rcu_is_watching(void);55bool rcu_is_watching(void);
56#ifndef CONFIG_PREEMPT56#ifndef CONFIG_PREEMPTION
57void rcu_all_qs(void);57void rcu_all_qs(void);
58#endif58#endif
59 59
include/linux/rcuwait.h+4−16
@@ -6,16 +6,11 @@ · 5 unmodified lines
6 6
7/*7/*
8 * rcuwait provides a way of blocking and waking up a single8 * rcuwait provides a way of blocking and waking up a single
9 * task in an rcu-safe manner; where it is forbidden to use9 * task in an rcu-safe manner.
10 * after exit_notify(). task_struct is not properly rcu protected,
11 * unless dealing with rcu-aware lists, ie: find_task_by_*().
12 *10 *
13 * Alternatively we have task_rcu_dereference(), but the return11 * The only time @task is non-nil is when a user is blocked (or
14 * semantics have different implications which would break the12 * checking if it needs to) on a condition, and reset as soon as we
15 * wakeup side. The only time @task is non-nil is when a user is13 * know that the condition has succeeded and are awoken.
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.
19 */14 */
20struct rcuwait {15struct rcuwait {
21 struct task_struct __rcu *task;16 struct task_struct __rcu *task;
@@ -37,13 +32,6 @@ extern void rcuwait_wake_up(struct rcuwait *w); · 15 unmodified lines
37 */32 */
38#define rcuwait_wait_event(w, condition) \33#define rcuwait_wait_event(w, condition) \
39({ \34({ \
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 \
47 rcu_assign_pointer((w)->task, current); \35 rcu_assign_pointer((w)->task, current); \
48 for (;;) { \36 for (;;) { \
49 /* \37 /* \
include/linux/regulator/consumer.h+13−0
@@ -281,6 +281,12 @@ void devm_regulator_unregister_notifier(struct regulator *regulator, · 280 unmodified lines
281void *regulator_get_drvdata(struct regulator *regulator);281void *regulator_get_drvdata(struct regulator *regulator);
282void regulator_set_drvdata(struct regulator *regulator, void *data);282void regulator_set_drvdata(struct regulator *regulator, void *data);
283 283
284/* misc helpers */
285
286void regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers,
287 const char *const *supply_names,
288 unsigned int num_supplies);
289
284#else290#else
285 291
286/*292/*
@@ -580,6 +586,13 @@ static inline int regulator_list_voltage(struct regulator *regulator, unsigned s · 293 unmodified lines
580 return -EINVAL;586 return -EINVAL;
581}587}
582 588
589static inline void
590regulator_bulk_set_supply_names(struct regulator_bulk_data *consumers,
591 const char *const *supply_names,
592 unsigned int num_supplies)
593{
594}
595
583#endif596#endif
584 597
585static inline int regulator_set_voltage_triplet(struct regulator *regulator,598static 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
9enum {
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
8 8
9enum {9enum {
10 Root_NFS = MKDEV(UNNAMED_MAJOR, 255),10 Root_NFS = MKDEV(UNNAMED_MAJOR, 255),
11 Root_CIFS = MKDEV(UNNAMED_MAJOR, 254),
11 Root_RAM0 = MKDEV(RAMDISK_MAJOR, 0),12 Root_RAM0 = MKDEV(RAMDISK_MAJOR, 0),
12 Root_RAM1 = MKDEV(RAMDISK_MAJOR, 1),13 Root_RAM1 = MKDEV(RAMDISK_MAJOR, 1),
13 Root_FD0 = MKDEV(FLOPPY_MAJOR, 0),14 Root_FD0 = MKDEV(FLOPPY_MAJOR, 0),
include/linux/rwsem.h+10−0
@@ -45,6 +45,9 @@ struct rw_semaphore { · 44 unmodified lines
45#endif45#endif
46 raw_spinlock_t wait_lock;46 raw_spinlock_t wait_lock;
47 struct list_head wait_list;47 struct list_head wait_list;
48#ifdef CONFIG_DEBUG_RWSEMS
49 void *magic;
50#endif
48#ifdef CONFIG_DEBUG_LOCK_ALLOC51#ifdef CONFIG_DEBUG_LOCK_ALLOC
49 struct lockdep_map dep_map;52 struct lockdep_map dep_map;
50#endif53#endif
@@ -73,6 +76,12 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) · 22 unmodified lines
73# define __RWSEM_DEP_MAP_INIT(lockname)76# define __RWSEM_DEP_MAP_INIT(lockname)
74#endif77#endif
75 78
79#ifdef CONFIG_DEBUG_RWSEMS
80# define __DEBUG_RWSEM_INITIALIZER(lockname) , .magic = &lockname
81#else
82# define __DEBUG_RWSEM_INITIALIZER(lockname)
83#endif
84
76#ifdef CONFIG_RWSEM_SPIN_ON_OWNER85#ifdef CONFIG_RWSEM_SPIN_ON_OWNER
77#define __RWSEM_OPT_INIT(lockname) , .osq = OSQ_LOCK_UNLOCKED86#define __RWSEM_OPT_INIT(lockname) , .osq = OSQ_LOCK_UNLOCKED
78#else87#else
@@ -85,6 +94,7 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) · 6 unmodified lines
85 .wait_list = LIST_HEAD_INIT((name).wait_list), \94 .wait_list = LIST_HEAD_INIT((name).wait_list), \
86 .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock) \95 .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock) \
87 __RWSEM_OPT_INIT(name) \96 __RWSEM_OPT_INIT(name) \
97 __DEBUG_RWSEM_INITIALIZER(name) \
88 __RWSEM_DEP_MAP_INIT(name) }98 __RWSEM_DEP_MAP_INIT(name) }
89 99
90#define DECLARE_RWSEM(name) \100#define DECLARE_RWSEM(name) \
include/linux/sched.h+33−31
@@ -25,9 +25,11 @@ · 24 unmodified lines
25#include <linux/resource.h>25#include <linux/resource.h>
26#include <linux/latencytop.h>26#include <linux/latencytop.h>
27#include <linux/sched/prio.h>27#include <linux/sched/prio.h>
28#include <linux/sched/types.h>
28#include <linux/signal_types.h>29#include <linux/signal_types.h>
29#include <linux/mm_types_task.h>30#include <linux/mm_types_task.h>
30#include <linux/task_io_accounting.h>31#include <linux/task_io_accounting.h>
32#include <linux/posix-timers.h>
31#include <linux/rseq.h>33#include <linux/rseq.h>
32 34
33/* task_struct member predeclarations (sorted alphabetically): */35/* task_struct member predeclarations (sorted alphabetically): */
@@ -244,27 +246,6 @@ struct prev_cputime { · 210 unmodified lines
244#endif246#endif
245};247};
246 248
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 */
257struct 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
268enum vtime_state {249enum vtime_state {
269 /* Task is sleeping or running in a CPU with VTIME inactive: */250 /* Task is sleeping or running in a CPU with VTIME inactive: */
270 VTIME_INACTIVE = 0,251 VTIME_INACTIVE = 0,
@@ -295,6 +276,11 @@ enum uclamp_id { · 24 unmodified lines
295 UCLAMP_CNT276 UCLAMP_CNT
296};277};
297 278
279#ifdef CONFIG_SMP
280extern struct root_domain def_root_domain;
281extern struct mutex sched_domains_mutex;
282#endif
283
298struct sched_info {284struct sched_info {
299#ifdef CONFIG_SCHED_INFO285#ifdef CONFIG_SCHED_INFO
300 /* Cumulative counters: */286 /* Cumulative counters: */
@@ -876,10 +862,8 @@ struct task_struct { · 575 unmodified lines
876 unsigned long min_flt;862 unsigned long min_flt;
877 unsigned long maj_flt;863 unsigned long maj_flt;
878 864
879#ifdef CONFIG_POSIX_TIMERS865 /* Empty if CONFIG_POSIX_CPUTIMERS=n */
880 struct task_cputime cputime_expires;866 struct posix_cputimers posix_cputimers;
881 struct list_head cpu_timers[3];
882#endif
883 867
884 /* Process credentials: */868 /* Process credentials: */
885 869
@@ -974,6 +958,10 @@ struct task_struct { · 88 unmodified lines
974 struct mutex_waiter *blocked_on;958 struct mutex_waiter *blocked_on;
975#endif959#endif
976 960
961#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
962 int non_block_count;
963#endif
964
977#ifdef CONFIG_TRACE_IRQFLAGS965#ifdef CONFIG_TRACE_IRQFLAGS
978 unsigned int irq_events;966 unsigned int irq_events;
979 unsigned long hardirq_enable_ip;967 unsigned long hardirq_enable_ip;
@@ -1092,7 +1080,15 @@ struct task_struct { · 112 unmodified lines
1092 u64 last_sum_exec_runtime;1080 u64 last_sum_exec_runtime;
1093 struct callback_head numa_work;1081 struct callback_head numa_work;
1094 1082
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;
1096 1092
1097 /*1093 /*
1098 * numa_faults is an array split into four regions:1094 * numa_faults is an array split into four regions:
@@ -1134,7 +1130,10 @@ struct task_struct { · 35 unmodified lines
1134 1130
1135 struct tlbflush_unmap_batch tlb_ubc;1131 struct tlbflush_unmap_batch tlb_ubc;
1136 1132
1137 struct rcu_head rcu;1133 union {
1134 refcount_t rcu_users;
1135 struct rcu_head rcu;
1136 };
1138 1137
1139 /* Cache last used pipe for splice(): */1138 /* Cache last used pipe for splice(): */
1140 struct pipe_inode_info *splice_pipe;1139 struct pipe_inode_info *splice_pipe;
@@ -1759,7 +1758,7 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) · 618 unmodified lines
1759 * value indicates whether a reschedule was done in fact.1758 * value indicates whether a reschedule was done in fact.
1760 * cond_resched_lock() will drop the spinlock before scheduling,1759 * cond_resched_lock() will drop the spinlock before scheduling,
1761 */1760 */
1762#ifndef CONFIG_PREEMPT1761#ifndef CONFIG_PREEMPTION
1763extern int _cond_resched(void);1762extern int _cond_resched(void);
1764#else1763#else
1765static inline int _cond_resched(void) { return 0; }1764static inline int _cond_resched(void) { return 0; }
@@ -1788,12 +1787,12 @@ static inline void cond_resched_rcu(void) · 22 unmodified lines
1788 1787
1789/*1788/*
1790 * Does a critical section need to be broken due to another1789 * 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,
1792 * but a general need for low latency)1791 * but a general need for low latency)
1793 */1792 */
1794static inline int spin_needbreak(spinlock_t *lock)1793static inline int spin_needbreak(spinlock_t *lock)
1795{1794{
1796#ifdef CONFIG_PREEMPT1795#ifdef CONFIG_PREEMPTION
1797 return spin_is_contended(lock);1796 return spin_is_contended(lock);
1798#else1797#else
1799 return 0;1798 return 0;
@@ -1843,7 +1842,10 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) · 43 unmodified lines
1843 * running or not.1842 * running or not.
1844 */1843 */
1845#ifndef vcpu_is_preempted1844#ifndef vcpu_is_preempted
1846# define vcpu_is_preempted(cpu) false1845static inline bool vcpu_is_preempted(int cpu)
1846{
1847 return false;
1848}
1847#endif1849#endif
1848 1850
1849extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);1851extern 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
61 * Thread group CPU time accounting.61 * Thread group CPU time accounting.
62 */62 */
63void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);63void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
64void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);64void thread_group_sample_cputime(struct task_struct *tsk, u64 *samples);
65
66 65
67/*66/*
68 * The following are functions that support scheduler-internal time accounting.67 * 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
71 */70 */
72 71
73/**72/**
74 * get_running_cputimer - return &tsk->signal->cputimer if cputimer is running73 * get_running_cputimer - return &tsk->signal->cputimer if cputimers are active
75 *74 *
76 * @tsk: Pointer to target task.75 * @tsk: Pointer to target task.
77 */76 */
@@ -81,8 +80,11 @@ struct thread_group_cputimer *get_running_cputimer(struct task_struct *tsk) · 3 unmodified lines
81{80{
82 struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;81 struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
83 82
84 /* Check if cputimer isn't running. This is accessed without locking. */83 /*
85 if (!READ_ONCE(cputimer->running))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))
86 return NULL;88 return NULL;
87 89
88 /*90 /*
include/linux/sched/deadline.h+8−0
@@ -24,3 +24,11 @@ static inline bool dl_time_before(u64 a, u64 b) · 23 unmodified lines
24{24{
25 return (s64)(a - b) < 0;25 return (s64)(a - b) < 0;
26}26}
27
28#ifdef CONFIG_SMP
29
30struct root_domain;
31extern void dl_add_task_root_domain(struct task_struct *p);
32extern 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
362 362
363static inline void membarrier_mm_sync_core_before_usermode(struct mm_struct *mm)363static inline void membarrier_mm_sync_core_before_usermode(struct mm_struct *mm)
364{364{
365 if (current->mm != mm)
366 return;
365 if (likely(!(atomic_read(&mm->membarrier_state) &367 if (likely(!(atomic_read(&mm->membarrier_state) &
366 MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE)))368 MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE)))
367 return;369 return;
368 sync_core_before_usermode();370 sync_core_before_usermode();
369}371}
370 372
371static inline void membarrier_execve(struct task_struct *t)373extern void membarrier_exec_mmap(struct mm_struct *mm);
372{374
373 atomic_set(&t->mm->membarrier_state, 0);
374}
375#else375#else
376#ifdef CONFIG_ARCH_HAS_MEMBARRIER_CALLBACKS376#ifdef CONFIG_ARCH_HAS_MEMBARRIER_CALLBACKS
377static inline void membarrier_arch_switch_mm(struct mm_struct *prev,377static 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
380{380{
381}381}
382#endif382#endif
383static inline void membarrier_execve(struct task_struct *t)383static inline void membarrier_exec_mmap(struct mm_struct *mm)
384{384{
385}385}
386static inline void membarrier_mm_sync_core_before_usermode(struct mm_struct *mm)386static 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
19extern void task_numa_fault(int last_node, int node, int pages, int flags);19extern void task_numa_fault(int last_node, int node, int pages, int flags);
20extern pid_t task_numa_group_id(struct task_struct *p);20extern pid_t task_numa_group_id(struct task_struct *p);
21extern void set_numabalancing_state(bool enabled);21extern void set_numabalancing_state(bool enabled);
22extern void task_numa_free(struct task_struct *p);22extern void task_numa_free(struct task_struct *p, bool final);
23extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page,23extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page,
24 int src_nid, int dst_cpu);24 int src_nid, int dst_cpu);
25#else25#else
@@ -34,7 +34,7 @@ static inline pid_t task_numa_group_id(struct task_struct *p) · 8 unmodified lines
34static inline void set_numabalancing_state(bool enabled)34static inline void set_numabalancing_state(bool enabled)
35{35{
36}36}
37static inline void task_numa_free(struct task_struct *p)37static inline void task_numa_free(struct task_struct *p, bool final)
38{38{
39}39}
40static inline bool should_numa_migrate_memory(struct task_struct *p,40static inline bool should_numa_migrate_memory(struct task_struct *p,
include/linux/sched/signal.h+3−11
@@ -9,6 +9,7 @@ · 8 unmodified lines
9#include <linux/sched/task.h>9#include <linux/sched/task.h>
10#include <linux/cred.h>10#include <linux/cred.h>
11#include <linux/refcount.h>11#include <linux/refcount.h>
12#include <linux/posix-timers.h>
12 13
13/*14/*
14 * Types defining task->signal and task->sighand and APIs using them:15 * Types defining task->signal and task->sighand and APIs using them:
@@ -56,18 +57,12 @@ struct task_cputime_atomic { · 41 unmodified lines
56/**57/**
57 * struct thread_group_cputimer - thread group interval timer counts58 * struct thread_group_cputimer - thread group interval timer counts
58 * @cputime_atomic: atomic thread group interval timers.59 * @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.
63 *60 *
64 * This structure contains the version of task_cputime, above, that is61 * This structure contains the version of task_cputime, above, that is
65 * used for thread group CPU timer calculations.62 * used for thread group CPU timer calculations.
66 */63 */
67struct thread_group_cputimer {64struct thread_group_cputimer {
68 struct task_cputime_atomic cputime_atomic;65 struct task_cputime_atomic cputime_atomic;
69 bool running;
70 bool checking_timer;
71};66};
72 67
73struct multiprocess_signals {68struct multiprocess_signals {
@@ -148,12 +143,9 @@ struct signal_struct { · 74 unmodified lines
148 */143 */
149 struct thread_group_cputimer cputimer;144 struct thread_group_cputimer cputimer;
150 145
151 /* Earliest-expiration cache. */
152 struct task_cputime cputime_expires;
153
154 struct list_head cpu_timers[3];
155
156#endif146#endif
147 /* Empty if CONFIG_POSIX_TIMERS=n */
148 struct posix_cputimers posix_cputimers;
157 149
158 /* PID/PID hash table linkage. */150 /* PID/PID hash table linkage. */
159 struct pid *pids[PIDTYPE_MAX];151 struct pid *pids[PIDTYPE_MAX];
include/linux/sched/task.h+6−2
@@ -105,7 +105,11 @@ extern void sched_exec(void); · 104 unmodified lines
105#define sched_exec() {}105#define sched_exec() {}
106#endif106#endif
107 107
108#define get_task_struct(tsk) do { refcount_inc(&(tsk)->usage); } while(0)108static inline struct task_struct *get_task_struct(struct task_struct *t)
109{
110 refcount_inc(&t->usage);
111 return t;
112}
109 113
110extern void __put_task_struct(struct task_struct *t);114extern void __put_task_struct(struct task_struct *t);
111 115
@@ -115,7 +119,7 @@ static inline void put_task_struct(struct task_struct *t) · 3 unmodified lines
115 __put_task_struct(t);119 __put_task_struct(t);
116}120}
117 121
118struct task_struct *task_rcu_dereference(struct task_struct **ptask);122void put_task_struct_rcu_user(struct task_struct *task);
119 123
120#ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT124#ifdef CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT
121extern int arch_task_struct_size __read_mostly;125extern 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
150 return to_cpumask(sd->span);150 return to_cpumask(sd->span);
151}151}
152 152
153extern void partition_sched_domains_locked(int ndoms_new,
154 cpumask_var_t doms_new[],
155 struct sched_domain_attr *dattr_new);
156
153extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],157extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
154 struct sched_domain_attr *dattr_new);158 struct sched_domain_attr *dattr_new);
155 159
@@ -194,6 +198,12 @@ extern void set_sched_topology(struct sched_domain_topology_level *tl); · 38 unmodified lines
194 198
195struct sched_domain_attr;199struct sched_domain_attr;
196 200
201static inline void
202partition_sched_domains_locked(int ndoms_new, cpumask_var_t doms_new[],
203 struct sched_domain_attr *dattr_new)
204{
205}
206
197static inline void207static inline void
198partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],208partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[],
199 struct sched_domain_attr *dattr_new)209 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 */
17struct 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.01/* SPDX-License-Identifier: GPL-2.0-only */
2/*2/*
3 * SCMI Message Protocol driver header3 * SCMI Message Protocol driver header
4 *4 *
@@ -71,7 +71,7 @@ struct scmi_clk_ops { · 66 unmodified lines
71 int (*rate_get)(const struct scmi_handle *handle, u32 clk_id,71 int (*rate_get)(const struct scmi_handle *handle, u32 clk_id,
72 u64 *rate);72 u64 *rate);
73 int (*rate_set)(const struct scmi_handle *handle, u32 clk_id,73 int (*rate_set)(const struct scmi_handle *handle, u32 clk_id,
74 u32 config, u64 rate);74 u64 rate);
75 int (*enable)(const struct scmi_handle *handle, u32 clk_id);75 int (*enable)(const struct scmi_handle *handle, u32 clk_id);
76 int (*disable)(const struct scmi_handle *handle, u32 clk_id);76 int (*disable)(const struct scmi_handle *handle, u32 clk_id);
77};77};
@@ -145,6 +145,8 @@ struct scmi_sensor_info { · 67 unmodified lines
145 u32 id;145 u32 id;
146 u8 type;146 u8 type;
147 s8 scale;147 s8 scale;
148 u8 num_trip_points;
149 bool async;
148 char name[SCMI_MAX_STR_SIZE];150 char name[SCMI_MAX_STR_SIZE];
149};151};
150 152
@@ -167,9 +169,9 @@ enum scmi_sensor_class { · 16 unmodified lines
167 *169 *
168 * @count_get: get the count of sensors provided by SCMI170 * @count_get: get the count of sensors provided by SCMI
169 * @info_get: get the information of the specified sensor171 * @info_get: get the information of the specified sensor
170 * @configuration_set: control notifications on cross-over events for172 * @trip_point_notify: control notifications on cross-over events for
171 * the trip-points173 * the trip-points
172 * @trip_point_set: selects and configures a trip-point of interest174 * @trip_point_config: selects and configures a trip-point of interest
173 * @reading_get: gets the current value of the sensor175 * @reading_get: gets the current value of the sensor
174 */176 */
175struct scmi_sensor_ops {177struct scmi_sensor_ops {
@@ -177,12 +179,32 @@ struct scmi_sensor_ops { · 1 unmodified line
177 179
178 const struct scmi_sensor_info *(*info_get)180 const struct scmi_sensor_info *(*info_get)
179 (const struct scmi_handle *handle, u32 sensor_id);181 (const struct scmi_handle *handle, u32 sensor_id);
180 int (*configuration_set)(const struct scmi_handle *handle,182 int (*trip_point_notify)(const struct scmi_handle *handle,
181 u32 sensor_id);183 u32 sensor_id, bool enable);
182 int (*trip_point_set)(const struct scmi_handle *handle, u32 sensor_id,184 int (*trip_point_config)(const struct scmi_handle *handle,
183 u8 trip_id, u64 trip_value);185 u32 sensor_id, u8 trip_id, u64 trip_value);
184 int (*reading_get)(const struct scmi_handle *handle, u32 sensor_id,186 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 */
201struct 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);
186};208};
187 209
188/**210/**
@@ -194,6 +216,7 @@ struct scmi_sensor_ops { · 5 unmodified lines
194 * @perf_ops: pointer to set of performance protocol operations216 * @perf_ops: pointer to set of performance protocol operations
195 * @clk_ops: pointer to set of clock protocol operations217 * @clk_ops: pointer to set of clock protocol operations
196 * @sensor_ops: pointer to set of sensor protocol operations218 * @sensor_ops: pointer to set of sensor protocol operations
219 * @reset_ops: pointer to set of reset protocol operations
197 * @perf_priv: pointer to private data structure specific to performance220 * @perf_priv: pointer to private data structure specific to performance
198 * protocol(for internal use only)221 * protocol(for internal use only)
199 * @clk_priv: pointer to private data structure specific to clock222 * @clk_priv: pointer to private data structure specific to clock
@@ -202,6 +225,8 @@ struct scmi_sensor_ops { · 2 unmodified lines
202 * protocol(for internal use only)225 * protocol(for internal use only)
203 * @sensor_priv: pointer to private data structure specific to sensors226 * @sensor_priv: pointer to private data structure specific to sensors
204 * protocol(for internal use only)227 * protocol(for internal use only)
228 * @reset_priv: pointer to private data structure specific to reset
229 * protocol(for internal use only)
205 */230 */
206struct scmi_handle {231struct scmi_handle {
207 struct device *dev;232 struct device *dev;
@@ -210,11 +235,13 @@ struct scmi_handle { · 2 unmodified lines
210 struct scmi_clk_ops *clk_ops;235 struct scmi_clk_ops *clk_ops;
211 struct scmi_power_ops *power_ops;236 struct scmi_power_ops *power_ops;
212 struct scmi_sensor_ops *sensor_ops;237 struct scmi_sensor_ops *sensor_ops;
238 struct scmi_reset_ops *reset_ops;
213 /* for protocol internal use */239 /* for protocol internal use */
214 void *perf_priv;240 void *perf_priv;
215 void *clk_priv;241 void *clk_priv;
216 void *power_priv;242 void *power_priv;
217 void *sensor_priv;243 void *sensor_priv;
244 void *reset_priv;
218};245};
219 246
220enum scmi_std_protocol {247enum scmi_std_protocol {
@@ -224,6 +251,7 @@ enum scmi_std_protocol { · 3 unmodified lines
224 SCMI_PROTOCOL_PERF = 0x13,251 SCMI_PROTOCOL_PERF = 0x13,
225 SCMI_PROTOCOL_CLOCK = 0x14,252 SCMI_PROTOCOL_CLOCK = 0x14,
226 SCMI_PROTOCOL_SENSOR = 0x15,253 SCMI_PROTOCOL_SENSOR = 0x15,
254 SCMI_PROTOCOL_RESET = 0x16,
227};255};
228 256
229struct scmi_device {257struct scmi_device {
include/linux/security.h+67−2
@@ -77,6 +77,54 @@ enum lsm_event { · 76 unmodified lines
77 LSM_POLICY_CHANGE,77 LSM_POLICY_CHANGE,
78};78};
79 79
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 */
104enum 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
80/* These functions are in security/commoncap.c */128/* These functions are in security/commoncap.c */
81extern int cap_capable(const struct cred *cred, struct user_namespace *ns,129extern int cap_capable(const struct cred *cred, struct user_namespace *ns,
82 int cap, unsigned int opts);130 int cap, unsigned int opts);
@@ -195,6 +243,7 @@ int unregister_blocking_lsm_notifier(struct notifier_block *nb); · 112 unmodified lines
195 243
196/* prototypes */244/* prototypes */
197extern int security_init(void);245extern int security_init(void);
246extern int early_security_init(void);
198 247
199/* Security operations */248/* Security operations */
200int security_binder_set_context_mgr(struct task_struct *mgr);249int 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
259 struct qstr *name,308 struct qstr *name,
260 const struct cred *old,309 const struct cred *old,
261 struct cred *new);310 struct cred *new);
262 311int security_path_notify(const struct path *path, u64 mask,
312 unsigned int obj_type);
263int security_inode_alloc(struct inode *inode);313int security_inode_alloc(struct inode *inode);
264void security_inode_free(struct inode *inode);314void security_inode_free(struct inode *inode);
265int security_inode_init_security(struct inode *inode, struct inode *dir,315int security_inode_init_security(struct inode *inode, struct inode *dir,
@@ -387,11 +437,11 @@ int security_ismaclabel(const char *name); · 121 unmodified lines
387int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);437int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
388int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);438int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);
389void security_release_secctx(char *secdata, u32 seclen);439void security_release_secctx(char *secdata, u32 seclen);
390
391void security_inode_invalidate_secctx(struct inode *inode);440void security_inode_invalidate_secctx(struct inode *inode);
392int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen);441int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen);
393int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen);442int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen);
394int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen);443int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen);
444int security_locked_down(enum lockdown_reason what);
395#else /* CONFIG_SECURITY */445#else /* CONFIG_SECURITY */
396 446
397static inline int call_blocking_lsm_notifier(enum lsm_event event, void *data)447static 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
423 return 0;473 return 0;
424}474}
425 475
476static inline int early_security_init(void)
477{
478 return 0;
479}
480
426static inline int security_binder_set_context_mgr(struct task_struct *mgr)481static inline int security_binder_set_context_mgr(struct task_struct *mgr)
427{482{
428 return 0;483 return 0;
@@ -621,6 +676,12 @@ static inline int security_move_mount(const struct path *from_path, · 192 unmodified lines
621 return 0;676 return 0;
622}677}
623 678
679static inline int security_path_notify(const struct path *path, u64 mask,
680 unsigned int obj_type)
681{
682 return 0;
683}
684
624static inline int security_inode_alloc(struct inode *inode)685static inline int security_inode_alloc(struct inode *inode)
625{686{
626 return 0;687 return 0;
@@ -1204,6 +1265,10 @@ static inline int security_inode_getsecctx(struct inode *inode, void **ctx, u32 · 577 unmodified lines
1204{1265{
1205 return -EOPNOTSUPP;1266 return -EOPNOTSUPP;
1206}1267}
1268static inline int security_locked_down(enum lockdown_reason what)
1269{
1270 return 0;
1271}
1207#endif /* CONFIG_SECURITY */1272#endif /* CONFIG_SECURITY */
1208 1273
1209#ifdef CONFIG_SECURITY_NETWORK1274#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
23extern int sha256_init(struct sha256_state *sctx);
24extern int sha256_update(struct sha256_state *sctx, const u8 *input,
25 unsigned int length);
26extern 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
49/*49/*
50 * Functions in mm/shmem.c called directly from elsewhere:50 * Functions in mm/shmem.c called directly from elsewhere:
51 */51 */
52extern const struct fs_parameter_description shmem_fs_parameters;
52extern int shmem_init(void);53extern int shmem_init(void);
53extern int shmem_fill_super(struct super_block *sb, void *data, int silent);54extern int shmem_init_fs_context(struct fs_context *fc);
54extern struct file *shmem_file_setup(const char *name,55extern struct file *shmem_file_setup(const char *name,
55 loff_t size, unsigned long flags);56 loff_t size, unsigned long flags);
56extern struct file *shmem_kernel_file_setup(const char *name, loff_t size,57extern 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
69 69
70 /* These are for internal use */70 /* These are for internal use */
71 struct list_head list;71 struct list_head list;
72#ifdef CONFIG_MEMCG_KMEM72#ifdef CONFIG_MEMCG
73 /* ID in shrinker_idr */73 /* ID in shrinker_idr */
74 int id;74 int id;
75#endif75#endif
@@ -81,6 +81,11 @@ struct shrinker { · 5 unmodified lines
81/* Flags */81/* Flags */
82#define SHRINKER_NUMA_AWARE (1 << 0)82#define SHRINKER_NUMA_AWARE (1 << 0)
83#define SHRINKER_MEMCG_AWARE (1 << 1)83#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)
84 89
85extern int prealloc_shrinker(struct shrinker *shrinker);90extern int prealloc_shrinker(struct shrinker *shrinker);
86extern void register_shrinker_prepared(struct shrinker *shrinker);91extern 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
282extern void exit_signals(struct task_struct *tsk);282extern void exit_signals(struct task_struct *tsk);
283extern void kernel_sigaction(int, __sighandler_t);283extern void kernel_sigaction(int, __sighandler_t);
284 284
285#define SIG_KTHREAD ((__force __sighandler_t)2)
286#define SIG_KTHREAD_KERNEL ((__force __sighandler_t)3)
287
285static inline void allow_signal(int sig)288static inline void allow_signal(int sig)
286{289{
287 /*290 /*
@@ -289,7 +292,17 @@ static inline void allow_signal(int sig) · 1 unmodified line
289 * know it'll be handled, so that they don't get converted to292 * know it'll be handled, so that they don't get converted to
290 * SIGKILL or just silently dropped.293 * SIGKILL or just silently dropped.
291 */294 */
292 kernel_sigaction(sig, (__force __sighandler_t)2);295 kernel_sigaction(sig, SIG_KTHREAD);
296}
297
298static 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);
293}306}
294 307
295static inline void disallow_signal(int sig)308static inline void disallow_signal(int sig)
include/linux/skbuff.h+117−50
@@ -14,6 +14,7 @@ · 13 unmodified lines
14#include <linux/compiler.h>14#include <linux/compiler.h>
15#include <linux/time.h>15#include <linux/time.h>
16#include <linux/bug.h>16#include <linux/bug.h>
17#include <linux/bvec.h>
17#include <linux/cache.h>18#include <linux/cache.h>
18#include <linux/rbtree.h>19#include <linux/rbtree.h>
19#include <linux/socket.h>20#include <linux/socket.h>
@@ -36,6 +37,9 @@ · 16 unmodified lines
36#include <linux/in6.h>37#include <linux/in6.h>
37#include <linux/if_packet.h>38#include <linux/if_packet.h>
38#include <net/flow.h>39#include <net/flow.h>
40#if IS_ENABLED(CONFIG_NF_CONNTRACK)
41#include <linux/netfilter/nf_conntrack_common.h>
42#endif
39 43
40/* The interface for checksum offload between the stack and networking drivers44/* The interface for checksum offload between the stack and networking drivers
41 * is as follows...45 * is as follows...
@@ -243,12 +247,6 @@ struct bpf_prog; · 201 unmodified lines
243union bpf_attr;247union bpf_attr;
244struct skb_ext;248struct skb_ext;
245 249
246#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
247struct nf_conntrack {
248 atomic_t use;
249};
250#endif
251
252#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)250#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
253struct nf_bridge_info {251struct nf_bridge_info {
254 enum {252 enum {
@@ -278,6 +276,16 @@ struct nf_bridge_info { · 23 unmodified lines
278};276};
279#endif277#endif
280 278
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 */
284struct tc_skb_ext {
285 __u32 chain;
286};
287#endif
288
281struct sk_buff_head {289struct sk_buff_head {
282 /* These two members must be first. */290 /* These two members must be first. */
283 struct sk_buff *next;291 struct sk_buff *next;
@@ -308,58 +316,45 @@ extern int sysctl_max_skb_frags; · 24 unmodified lines
308 */316 */
309#define GSO_BY_FRAGS 0xFFFF317#define GSO_BY_FRAGS 0xFFFF
310 318
311typedef struct skb_frag_struct skb_frag_t;319typedef struct bio_vec skb_frag_t;
312
313struct 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};
325 320
326/**321/**
327 * skb_frag_size - Returns the size of a skb fragment322 * skb_frag_size() - Returns the size of a skb fragment
328 * @frag: skb fragment323 * @frag: skb fragment
329 */324 */
330static inline unsigned int skb_frag_size(const skb_frag_t *frag)325static inline unsigned int skb_frag_size(const skb_frag_t *frag)
331{326{
332 return frag->size;327 return frag->bv_len;
333}328}
334 329
335/**330/**
336 * skb_frag_size_set - Sets the size of a skb fragment331 * skb_frag_size_set() - Sets the size of a skb fragment
337 * @frag: skb fragment332 * @frag: skb fragment
338 * @size: size of fragment333 * @size: size of fragment
339 */334 */
340static inline void skb_frag_size_set(skb_frag_t *frag, unsigned int size)335static inline void skb_frag_size_set(skb_frag_t *frag, unsigned int size)
341{336{
342 frag->size = size;337 frag->bv_len = size;
343}338}
344 339
345/**340/**
346 * skb_frag_size_add - Incrementes the size of a skb fragment by %delta341 * skb_frag_size_add() - Increments the size of a skb fragment by @delta
347 * @frag: skb fragment342 * @frag: skb fragment
348 * @delta: value to add343 * @delta: value to add
349 */344 */
350static inline void skb_frag_size_add(skb_frag_t *frag, int delta)345static inline void skb_frag_size_add(skb_frag_t *frag, int delta)
351{346{
352 frag->size += delta;347 frag->bv_len += delta;
353}348}
354 349
355/**350/**
356 * skb_frag_size_sub - Decrements the size of a skb fragment by %delta351 * skb_frag_size_sub() - Decrements the size of a skb fragment by @delta
357 * @frag: skb fragment352 * @frag: skb fragment
358 * @delta: value to subtract353 * @delta: value to subtract
359 */354 */
360static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)355static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
361{356{
362 frag->size -= delta;357 frag->bv_len -= delta;
363}358}
364 359
365/**360/**
@@ -379,7 +374,7 @@ static inline bool skb_frag_must_loop(struct page *p) · 13 unmodified lines
379 * skb_frag_foreach_page - loop over pages in a fragment374 * skb_frag_foreach_page - loop over pages in a fragment
380 *375 *
381 * @f: skb frag to operate on376 * @f: skb frag to operate on
382 * @f_off: offset from start of f->page.p377 * @f_off: offset from start of f->bv_page
383 * @f_len: length from f_off to loop over378 * @f_len: length from f_off to loop over
384 * @p: (temp var) current page379 * @p: (temp var) current page
385 * @p_off: (temp var) offset from start of current page,380 * @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
916#define SKB_DST_NOREF 1UL911#define SKB_DST_NOREF 1UL
917#define SKB_DST_PTRMASK ~(SKB_DST_NOREF)912#define SKB_DST_PTRMASK ~(SKB_DST_NOREF)
918 913
919#define SKB_NFCT_PTRMASK ~(7UL)
920/**914/**
921 * skb_dst - returns skb dst_entry915 * skb_dst - returns skb dst_entry
922 * @skb: buffer916 * @skb: buffer
@@ -1283,7 +1277,7 @@ static inline int skb_flow_dissector_bpf_prog_detach(const union bpf_attr *attr) · 360 unmodified lines
1283 1277
1284struct bpf_flow_dissector;1278struct bpf_flow_dissector;
1285bool bpf_flow_dissect(struct bpf_prog *prog, struct bpf_flow_dissector *ctx,1279bool 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);
1287 1281
1288bool __skb_flow_dissect(const struct net *net,1282bool __skb_flow_dissect(const struct net *net,
1289 const struct sk_buff *skb,1283 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
1374 to->l4_hash = from->l4_hash;1368 to->l4_hash = from->l4_hash;
1375};1369};
1376 1370
1371static 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
1377#ifdef NET_SKBUFF_DATA_USES_OFFSET1379#ifdef NET_SKBUFF_DATA_USES_OFFSET
1378static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)1380static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
1379{1381{
@@ -2089,8 +2091,8 @@ static inline void __skb_fill_page_desc(struct sk_buff *skb, int i, · 709 unmodified lines
2089 * that not all callers have unique ownership of the page but rely2091 * that not all callers have unique ownership of the page but rely
2090 * on page_is_pfmemalloc doing the right thing(tm).2092 * on page_is_pfmemalloc doing the right thing(tm).
2091 */2093 */
2092 frag->page.p = page;2094 frag->bv_page = page;
2093 frag->page_offset = off;2095 frag->bv_offset = off;
2094 skb_frag_size_set(frag, size);2096 skb_frag_size_set(frag, size);
2095 2097
2096 page = compound_head(page);2098 page = compound_head(page);
@@ -2869,6 +2871,46 @@ static inline void skb_propagate_pfmemalloc(struct page *page, · 772 unmodified lines
2869 skb->pfmemalloc = true;2871 skb->pfmemalloc = true;
2870}2872}
2871 2873
2874/**
2875 * skb_frag_off() - Returns the offset of a skb fragment
2876 * @frag: the paged fragment
2877 */
2878static 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 */
2888static 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 */
2898static 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 */
2908static 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
2872/**2914/**
2873 * skb_frag_page - retrieve the page referred to by a paged fragment2915 * skb_frag_page - retrieve the page referred to by a paged fragment
2874 * @frag: the paged fragment2916 * @frag: the paged fragment
@@ -2877,7 +2919,7 @@ static inline void skb_propagate_pfmemalloc(struct page *page, · 2 unmodified lines
2877 */2919 */
2878static inline struct page *skb_frag_page(const skb_frag_t *frag)2920static inline struct page *skb_frag_page(const skb_frag_t *frag)
2879{2921{
2880 return frag->page.p;2922 return frag->bv_page;
2881}2923}
2882 2924
2883/**2925/**
@@ -2935,7 +2977,7 @@ static inline void skb_frag_unref(struct sk_buff *skb, int f) · 51 unmodified lines
2935 */2977 */
2936static inline void *skb_frag_address(const skb_frag_t *frag)2978static inline void *skb_frag_address(const skb_frag_t *frag)
2937{2979{
2938 return page_address(skb_frag_page(frag)) + frag->page_offset;2980 return page_address(skb_frag_page(frag)) + skb_frag_off(frag);
2939}2981}
2940 2982
2941/**2983/**
@@ -2951,7 +2993,18 @@ static inline void *skb_frag_address_safe(const skb_frag_t *frag) · 9 unmodified lines
2951 if (unlikely(!ptr))2993 if (unlikely(!ptr))
2952 return NULL;2994 return NULL;
2953 2995
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 */
3004static inline void skb_frag_page_copy(skb_frag_t *fragto,
3005 const skb_frag_t *fragfrom)
3006{
3007 fragto->bv_page = fragfrom->bv_page;
2955}3008}
2956 3009
2957/**3010/**
@@ -2963,7 +3016,7 @@ static inline void *skb_frag_address_safe(const skb_frag_t *frag) · 5 unmodified lines
2963 */3016 */
2964static inline void __skb_frag_set_page(skb_frag_t *frag, struct page *page)3017static inline void __skb_frag_set_page(skb_frag_t *frag, struct page *page)
2965{3018{
2966 frag->page.p = page;3019 frag->bv_page = page;
2967}3020}
2968 3021
2969/**3022/**
@@ -2999,7 +3052,7 @@ static inline dma_addr_t skb_frag_dma_map(struct device *dev, · 29 unmodified lines
2999 enum dma_data_direction dir)3052 enum dma_data_direction dir)
3000{3053{
3001 return dma_map_page(dev, skb_frag_page(frag),3054 return dma_map_page(dev, skb_frag_page(frag),
3002 frag->page_offset + offset, size, dir);3055 skb_frag_off(frag) + offset, size, dir);
3003}3056}
3004 3057
3005static inline struct sk_buff *pskb_copy(struct sk_buff *skb,3058static 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
3166 if (skb_zcopy(skb))3219 if (skb_zcopy(skb))
3167 return false;3220 return false;
3168 if (i) {3221 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];
3170 3223
3171 return page == skb_frag_page(frag) &&3224 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);
3173 }3226 }
3174 return false;3227 return false;
3175}3228}
@@ -3983,25 +4036,27 @@ static inline void skb_remcsum_process(struct sk_buff *skb, void *ptr, · 807 unmodified lines
3983static inline struct nf_conntrack *skb_nfct(const struct sk_buff *skb)4036static inline struct nf_conntrack *skb_nfct(const struct sk_buff *skb)
3984{4037{
3985#if IS_ENABLED(CONFIG_NF_CONNTRACK)4038#if IS_ENABLED(CONFIG_NF_CONNTRACK)
3986 return (void *)(skb->_nfct & SKB_NFCT_PTRMASK);4039 return (void *)(skb->_nfct & NFCT_PTRMASK);
3987#else4040#else
3988 return NULL;4041 return NULL;
3989#endif4042#endif
3990}4043}
3991 4044
3992#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)4045static inline unsigned long skb_get_nfct(const struct sk_buff *skb)
3993void nf_conntrack_destroy(struct nf_conntrack *nfct);
3994static inline void nf_conntrack_put(struct nf_conntrack *nfct)
3995{4046{
3996 if (nfct && atomic_dec_and_test(&nfct->use))4047#if IS_ENABLED(CONFIG_NF_CONNTRACK)
3997 nf_conntrack_destroy(nfct);4048 return skb->_nfct;
4049#else
4050 return 0UL;
4051#endif
3998}4052}
3999static inline void nf_conntrack_get(struct nf_conntrack *nfct)4053
4054static inline void skb_set_nfct(struct sk_buff *skb, unsigned long nfct)
4000{4055{
4001 if (nfct)4056#if IS_ENABLED(CONFIG_NF_CONNTRACK)
4002 atomic_inc(&nfct->use);4057 skb->_nfct = nfct;
4003}
4004#endif4058#endif
4059}
4005 4060
4006#ifdef CONFIG_SKB_EXTENSIONS4061#ifdef CONFIG_SKB_EXTENSIONS
4007enum skb_ext_id {4062enum skb_ext_id {
@@ -4010,6 +4065,9 @@ enum skb_ext_id { · 2 unmodified lines
4010#endif4065#endif
4011#ifdef CONFIG_XFRM4066#ifdef CONFIG_XFRM
4012 SKB_EXT_SEC_PATH,4067 SKB_EXT_SEC_PATH,
4068#endif
4069#if IS_ENABLED(CONFIG_NET_TC_SKB_EXT)
4070 TC_SKB_EXT,
4013#endif4071#endif
4014 SKB_EXT_NUM, /* must be last */4072 SKB_EXT_NUM, /* must be last */
4015};4073};
@@ -4086,8 +4144,17 @@ static inline void *skb_ext_find(const struct sk_buff *skb, enum skb_ext_id id) · 70 unmodified lines
4086 4144
4087 return NULL;4145 return NULL;
4088}4146}
4147
4148static 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}
4089#else4155#else
4090static inline void skb_ext_put(struct sk_buff *skb) {}4156static inline void skb_ext_put(struct sk_buff *skb) {}
4157static inline void skb_ext_reset(struct sk_buff *skb) {}
4091static inline void skb_ext_del(struct sk_buff *skb, int unused) {}4158static inline void skb_ext_del(struct sk_buff *skb, int unused) {}
4092static inline void __skb_ext_copy(struct sk_buff *d, const struct sk_buff *s) {}4159static inline void __skb_ext_copy(struct sk_buff *d, const struct sk_buff *s) {}
4093static inline void skb_ext_copy(struct sk_buff *dst, const struct sk_buff *s) {}4160static 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
354 sk->sk_write_space = psock->saved_write_space;354 sk->sk_write_space = psock->saved_write_space;
355 355
356 if (psock->sk_proto) {356 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;
358 psock->sk_proto = NULL;364 psock->sk_proto = NULL;
359 }365 }
360}366}
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
595 return __kmalloc_node(size, flags, node);595 return __kmalloc_node(size, flags, node);
596}596}
597 597
598struct 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 */
636struct 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
660int memcg_update_all_caches(int num_memcgs);598int memcg_update_all_caches(int num_memcgs);
661 599
662/**600/**
include/linux/soc/mediatek/mtk-cmdq.h+7−10
@@ -13,9 +13,6 @@ · 12 unmodified lines
13 13
14#define CMDQ_NO_TIMEOUT 0xffffffffu14#define CMDQ_NO_TIMEOUT 0xffffffffu
15 15
16/** cmdq event maximum */
17#define CMDQ_MAX_EVENT 0x3ff
18
19struct cmdq_pkt;16struct cmdq_pkt;
20 17
21struct cmdq_client {18struct cmdq_client {
@@ -63,26 +60,26 @@ void cmdq_pkt_destroy(struct cmdq_pkt *pkt); · 41 unmodified lines
63/**60/**
64 * cmdq_pkt_write() - append write command to the CMDQ packet61 * cmdq_pkt_write() - append write command to the CMDQ packet
65 * @pkt: the CMDQ packet62 * @pkt: the CMDQ packet
66 * @value: the specified target register value
67 * @subsys: the CMDQ sub system code63 * @subsys: the CMDQ sub system code
68 * @offset: register offset from CMDQ sub system64 * @offset: register offset from CMDQ sub system
65 * @value: the specified target register value
69 *66 *
70 * Return: 0 for success; else the error code is returned67 * Return: 0 for success; else the error code is returned
71 */68 */
72int cmdq_pkt_write(struct cmdq_pkt *pkt, u32 value, u32 subsys, u32 offset);69int cmdq_pkt_write(struct cmdq_pkt *pkt, u8 subsys, u16 offset, u32 value);
73 70
74/**71/**
75 * cmdq_pkt_write_mask() - append write command with mask to the CMDQ packet72 * cmdq_pkt_write_mask() - append write command with mask to the CMDQ packet
76 * @pkt: the CMDQ packet73 * @pkt: the CMDQ packet
77 * @value: the specified target register value
78 * @subsys: the CMDQ sub system code74 * @subsys: the CMDQ sub system code
79 * @offset: register offset from CMDQ sub system75 * @offset: register offset from CMDQ sub system
76 * @value: the specified target register value
80 * @mask: the specified target register mask77 * @mask: the specified target register mask
81 *78 *
82 * Return: 0 for success; else the error code is returned79 * Return: 0 for success; else the error code is returned
83 */80 */
84int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u32 value,81int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys,
85 u32 subsys, u32 offset, u32 mask);82 u16 offset, u32 value, u32 mask);
86 83
87/**84/**
88 * cmdq_pkt_wfe() - append wait for event command to the CMDQ packet85 * 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
91 *88 *
92 * Return: 0 for success; else the error code is returned89 * Return: 0 for success; else the error code is returned
93 */90 */
94int cmdq_pkt_wfe(struct cmdq_pkt *pkt, u32 event);91int cmdq_pkt_wfe(struct cmdq_pkt *pkt, u16 event);
95 92
96/**93/**
97 * cmdq_pkt_clear_event() - append clear event command to the CMDQ packet94 * 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
100 *97 *
101 * Return: 0 for success; else the error code is returned98 * Return: 0 for success; else the error code is returned
102 */99 */
103int cmdq_pkt_clear_event(struct cmdq_pkt *pkt, u32 event);100int cmdq_pkt_clear_event(struct cmdq_pkt *pkt, u16 event);
104 101
105/**102/**
106 * cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the CMDQ103 * 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
15extern u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr);
16extern void lpc32xx_set_phy_interface_mode(phy_interface_t mode);
17extern void lpc32xx_loopback_set(resource_size_t mapbase, int state);
18#else
19static inline u32 lpc32xx_return_iram(void __iomem **mapbase, dma_addr_t *dmaaddr)
20{
21 *mapbase = NULL;
22 *dmaaddr = 0;
23 return 0;
24}
25static inline void lpc32xx_set_phy_interface_mode(phy_interface_t mode)
26{
27}
28static 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
97 */97 */
98struct ti_sci_dev_ops {98struct ti_sci_dev_ops {
99 int (*get_device)(const struct ti_sci_handle *handle, u32 id);99 int (*get_device)(const struct ti_sci_handle *handle, u32 id);
100 int (*get_device_exclusive)(const struct ti_sci_handle *handle, u32 id);
100 int (*idle_device)(const struct ti_sci_handle *handle, u32 id);101 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);
101 int (*put_device)(const struct ti_sci_handle *handle, u32 id);104 int (*put_device)(const struct ti_sci_handle *handle, u32 id);
102 int (*is_valid)(const struct ti_sci_handle *handle, u32 id);105 int (*is_valid)(const struct ti_sci_handle *handle, u32 id);
103 int (*get_context_loss_count)(const struct ti_sci_handle *handle,106 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
292#define MSG_BATCH 0x40000 /* sendmmsg(): more messages coming */292#define MSG_BATCH 0x40000 /* sendmmsg(): more messages coming */
293#define MSG_EOF MSG_FIN293#define MSG_EOF MSG_FIN
294#define MSG_NO_SHARED_FRAGS 0x80000 /* sendpage() internal : page frags are not shared */294#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 */
295 298
296#define MSG_ZEROCOPY 0x4000000 /* Use user data in kernel path */299#define MSG_ZEROCOPY 0x4000000 /* Use user data in kernel path */
297#define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */300#define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */
include/linux/sort.h+5−0
@@ -4,6 +4,11 @@ · 3 unmodified lines
4 4
5#include <linux/types.h>5#include <linux/types.h>
6 6
7void 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
7void sort(void *base, size_t num, size_t size,12void sort(void *base, size_t num, size_t size,
8 int (*cmp)(const void *, const void *),13 int (*cmp)(const void *, const void *),
9 void (*swap)(void *, void *, int));14 void (*swap)(void *, void *, int));
include/linux/soundwire/sdw.h+18−2
@@ -4,6 +4,8 @@ · 3 unmodified lines
4#ifndef __SOUNDWIRE_H4#ifndef __SOUNDWIRE_H
5#define __SOUNDWIRE_H5#define __SOUNDWIRE_H
6 6
7#include <linux/mod_devicetable.h>
8
7struct sdw_bus;9struct sdw_bus;
8struct sdw_slave;10struct sdw_slave;
9 11
@@ -377,6 +379,8 @@ struct sdw_slave_prop { · 367 unmodified lines
377 * @dynamic_frame: Dynamic frame shape supported379 * @dynamic_frame: Dynamic frame shape supported
378 * @err_threshold: Number of times that software may retry sending a single380 * @err_threshold: Number of times that software may retry sending a single
379 * command381 * 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
380 */384 */
381struct sdw_master_prop {385struct sdw_master_prop {
382 u32 revision;386 u32 revision;
@@ -391,6 +395,8 @@ struct sdw_master_prop { · 8 unmodified lines
391 u32 default_col;395 u32 default_col;
392 bool dynamic_frame;396 bool dynamic_frame;
393 u32 err_threshold;397 u32 err_threshold;
398 u32 mclk_freq;
399 bool hw_disabled;
394};400};
395 401
396int sdw_master_read_prop(struct sdw_bus *bus);402int sdw_master_read_prop(struct sdw_bus *bus);
@@ -538,6 +544,7 @@ struct sdw_slave_ops { · 141 unmodified lines
538 * @bus: Bus handle544 * @bus: Bus handle
539 * @ops: Slave callback ops545 * @ops: Slave callback ops
540 * @prop: Slave properties546 * @prop: Slave properties
547 * @debugfs: Slave debugfs
541 * @node: node for bus list548 * @node: node for bus list
542 * @port_ready: Port ready completion flag for each Slave port549 * @port_ready: Port ready completion flag for each Slave port
543 * @dev_num: Device Number assigned by Bus550 * @dev_num: Device Number assigned by Bus
@@ -549,6 +556,9 @@ struct sdw_slave { · 5 unmodified lines
549 struct sdw_bus *bus;556 struct sdw_bus *bus;
550 const struct sdw_slave_ops *ops;557 const struct sdw_slave_ops *ops;
551 struct sdw_slave_prop prop;558 struct sdw_slave_prop prop;
559#ifdef CONFIG_DEBUG_FS
560 struct dentry *debugfs;
561#endif
552 struct list_head node;562 struct list_head node;
553 struct completion *port_ready;563 struct completion *port_ready;
554 u16 dev_num;564 u16 dev_num;
@@ -718,6 +728,7 @@ struct sdw_master_ops { · 163 unmodified lines
718 * Bit set implies used number, bit clear implies unused number.728 * Bit set implies used number, bit clear implies unused number.
719 * @bus_lock: bus lock729 * @bus_lock: bus lock
720 * @msg_lock: message lock730 * @msg_lock: message lock
731 * @compute_params: points to Bus resource management implementation
721 * @ops: Master callback ops732 * @ops: Master callback ops
722 * @port_ops: Master port callback ops733 * @port_ops: Master port callback ops
723 * @params: Current bus parameters734 * @params: Current bus parameters
@@ -725,6 +736,7 @@ struct sdw_master_ops { · 1 unmodified line
725 * @m_rt_list: List of Master instance of all stream(s) running on Bus. This736 * @m_rt_list: List of Master instance of all stream(s) running on Bus. This
726 * is used to compute and program bus bandwidth, clock, frame shape,737 * is used to compute and program bus bandwidth, clock, frame shape,
727 * transport and port parameters738 * transport and port parameters
739 * @debugfs: Bus debugfs
728 * @defer_msg: Defer message740 * @defer_msg: Defer message
729 * @clk_stop_timeout: Clock stop timeout computed741 * @clk_stop_timeout: Clock stop timeout computed
730 * @bank_switch_timeout: Bank switch timeout computed742 * @bank_switch_timeout: Bank switch timeout computed
@@ -739,11 +751,15 @@ struct sdw_bus { · 8 unmodified lines
739 DECLARE_BITMAP(assigned, SDW_MAX_DEVICES);751 DECLARE_BITMAP(assigned, SDW_MAX_DEVICES);
740 struct mutex bus_lock;752 struct mutex bus_lock;
741 struct mutex msg_lock;753 struct mutex msg_lock;
754 int (*compute_params)(struct sdw_bus *bus);
742 const struct sdw_master_ops *ops;755 const struct sdw_master_ops *ops;
743 const struct sdw_master_port_ops *port_ops;756 const struct sdw_master_port_ops *port_ops;
744 struct sdw_bus_params params;757 struct sdw_bus_params params;
745 struct sdw_master_prop prop;758 struct sdw_master_prop prop;
746 struct list_head m_rt_list;759 struct list_head m_rt_list;
760#ifdef CONFIG_DEBUG_FS
761 struct dentry *debugfs;
762#endif
747 struct sdw_defer defer_msg;763 struct sdw_defer defer_msg;
748 unsigned int clk_stop_timeout;764 unsigned int clk_stop_timeout;
749 u32 bank_switch_timeout;765 u32 bank_switch_timeout;
@@ -828,7 +844,7 @@ struct sdw_stream_params { · 78 unmodified lines
828 * @m_rt_count: Count of Master runtime(s) in this stream844 * @m_rt_count: Count of Master runtime(s) in this stream
829 */845 */
830struct sdw_stream_runtime {846struct sdw_stream_runtime {
831 char *name;847 const char *name;
832 struct sdw_stream_params params;848 struct sdw_stream_params params;
833 enum sdw_stream_state state;849 enum sdw_stream_state state;
834 enum sdw_stream_type type;850 enum sdw_stream_type type;
@@ -836,7 +852,7 @@ struct sdw_stream_runtime { · 1 unmodified line
836 int m_rt_count;852 int m_rt_count;
837};853};
838 854
839struct sdw_stream_runtime *sdw_alloc_stream(char *stream_name);855struct sdw_stream_runtime *sdw_alloc_stream(const char *stream_name);
840void sdw_release_stream(struct sdw_stream_runtime *stream);856void sdw_release_stream(struct sdw_stream_runtime *stream);
841int sdw_stream_add_master(struct sdw_bus *bus,857int sdw_stream_add_master(struct sdw_bus *bus,
842 struct sdw_stream_config *stream_config,858 struct sdw_stream_config *stream_config,
include/linux/soundwire/sdw_intel.h+1−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
8 * struct sdw_intel_ops: Intel audio driver callback ops8 * struct sdw_intel_ops: Intel audio driver callback ops
9 *9 *
10 * @config_stream: configure the stream with the hw_params10 * @config_stream: configure the stream with the hw_params
11 * the first argument containing the context is mandatory
11 */12 */
12struct sdw_intel_ops {13struct sdw_intel_ops {
13 int (*config_stream)(void *arg, void *substream,14 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
214 214
215/*215/*
216 * Define the various spin_lock methods. Note we define these216 * Define the various spin_lock methods. Note we define these
217 * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The217 * regardless of whether CONFIG_SMP or CONFIG_PREEMPTION are set. The
218 * various methods are defined as nops in the case they are not218 * various methods are defined as nops in the case they are not
219 * required.219 * required.
220 */220 */
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
96 96
97/*97/*
98 * If lockdep is enabled then we use the non-preemption spin-ops98 * If lockdep is enabled then we use the non-preemption spin-ops
99 * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are99 * even on CONFIG_PREEMPTION, because lockdep assumes that interrupts are
100 * not re-enabled during lock-acquire (which the preempt-spin-ops do):100 * not re-enabled during lock-acquire (which the preempt-spin-ops do):
101 */101 */
102#if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC)102#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
9struct pt_regs;9struct pt_regs;
10 10
11#ifdef CONFIG_STACKTRACE11#ifdef CONFIG_STACKTRACE
12void stack_trace_print(unsigned long *trace, unsigned int nr_entries,12void stack_trace_print(const unsigned long *trace, unsigned int nr_entries,
13 int spaces);13 int spaces);
14int stack_trace_snprint(char *buf, size_t size, unsigned long *entries,14int stack_trace_snprint(char *buf, size_t size, const unsigned long *entries,
15 unsigned int nr_entries, int spaces);15 unsigned int nr_entries, int spaces);
16unsigned int stack_trace_save(unsigned long *store, unsigned int size,16unsigned int stack_trace_save(unsigned long *store, unsigned int size,
17 unsigned int skipnr);17 unsigned int skipnr);
include/linux/stmmac.h+4−0
@@ -81,6 +81,7 @@ struct stmmac_mdio_bus_data { · 80 unmodified lines
81 unsigned int phy_mask;81 unsigned int phy_mask;
82 int *irqs;82 int *irqs;
83 int probed_phy_irq;83 int probed_phy_irq;
84 bool needs_reset;
84};85};
85 86
86struct stmmac_dma_cfg {87struct stmmac_dma_cfg {
@@ -130,6 +131,7 @@ struct plat_stmmacenet_data { · 43 unmodified lines
130 int bus_id;131 int bus_id;
131 int phy_addr;132 int phy_addr;
132 int interface;133 int interface;
134 int phy_interface;
133 struct stmmac_mdio_bus_data *mdio_bus_data;135 struct stmmac_mdio_bus_data *mdio_bus_data;
134 struct device_node *phy_node;136 struct device_node *phy_node;
135 struct device_node *phylink_node;137 struct device_node *phylink_node;
@@ -167,11 +169,13 @@ struct plat_stmmacenet_data { · 31 unmodified lines
167 struct clk *clk_ptp_ref;169 struct clk *clk_ptp_ref;
168 unsigned int clk_ptp_rate;170 unsigned int clk_ptp_rate;
169 unsigned int clk_ref_rate;171 unsigned int clk_ref_rate;
172 s32 ptp_max_adj;
170 struct reset_control *stmmac_rst;173 struct reset_control *stmmac_rst;
171 struct stmmac_axi *axi;174 struct stmmac_axi *axi;
172 int has_gmac4;175 int has_gmac4;
173 bool has_sun8i;176 bool has_sun8i;
174 bool tso_en;177 bool tso_en;
178 int rss_en;
175 int mac_port_sel_speed;179 int mac_port_sel_speed;
176 bool en_tx_lpi_clockgating;180 bool en_tx_lpi_clockgating;
177 int has_xgmac;181 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
474 * But this can lead to bugs due to typos, or if prefix is a pointer474 * But this can lead to bugs due to typos, or if prefix is a pointer
475 * and not a constant. Instead use str_has_prefix().475 * and not a constant. Instead use str_has_prefix().
476 *476 *
477 * Returns: 0 if @str does not start with @prefix477 * Returns:
478 strlen(@prefix) if @str does start with @prefix478 * * strlen(@prefix) if @str starts with @prefix
479 * * 0 if @str does not start with @prefix
479 */480 */
480static __always_inline size_t str_has_prefix(const char *str, const char *prefix)481static __always_inline size_t str_has_prefix(const char *str, const char *prefix)
481{482{
include/linux/sunrpc/cache.h+4−3
@@ -87,6 +87,7 @@ struct cache_detail { · 86 unmodified lines
87 int has_died);87 int has_died);
88 88
89 struct cache_head * (*alloc)(void);89 struct cache_head * (*alloc)(void);
90 void (*flush)(void);
90 int (*match)(struct cache_head *orig, struct cache_head *new);91 int (*match)(struct cache_head *orig, struct cache_head *new);
91 void (*init)(struct cache_head *orig, struct cache_head *new);92 void (*init)(struct cache_head *orig, struct cache_head *new);
92 void (*update)(struct cache_head *orig, struct cache_head *new);93 void (*update)(struct cache_head *orig, struct cache_head *new);
@@ -107,9 +108,9 @@ struct cache_detail { · 14 unmodified lines
107 /* fields for communication over channel */108 /* fields for communication over channel */
108 struct list_head queue;109 struct list_head queue;
109 110
110 atomic_t readers; /* how many time is /chennel open */111 atomic_t writers; /* how many time is /channel open */
111 time_t last_close; /* if no readers, when did last close */112 time_t last_close; /* if no writers, when did last close */
112 time_t last_warn; /* when we last warned about no readers */113 time_t last_warn; /* when we last warned about no writers */
113 114
114 union {115 union {
115 struct proc_dir_entry *procfs;116 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
98 98
99struct rpc_call_ops {99struct rpc_call_ops {
100 void (*rpc_call_prepare)(struct rpc_task *, void *);100 void (*rpc_call_prepare)(struct rpc_task *, void *);
101 void (*rpc_call_prepare_transmit)(struct rpc_task *, void *);
102 void (*rpc_call_done)(struct rpc_task *, void *);101 void (*rpc_call_done)(struct rpc_task *, void *);
103 void (*rpc_count_stats)(struct rpc_task *, void *);102 void (*rpc_count_stats)(struct rpc_task *, void *);
104 void (*rpc_release)(void *);103 void (*rpc_release)(void *);
@@ -243,9 +242,6 @@ void rpc_sleep_on_priority_timeout(struct rpc_wait_queue *queue, · 138 unmodified lines
243void rpc_sleep_on_priority(struct rpc_wait_queue *,242void rpc_sleep_on_priority(struct rpc_wait_queue *,
244 struct rpc_task *,243 struct rpc_task *,
245 int priority);244 int priority);
246void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq,
247 struct rpc_wait_queue *queue,
248 struct rpc_task *task);
249void rpc_wake_up_queued_task(struct rpc_wait_queue *,245void rpc_wake_up_queued_task(struct rpc_wait_queue *,
250 struct rpc_task *);246 struct rpc_task *);
251void rpc_wake_up_queued_task_set_status(struct rpc_wait_queue *,247void 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
42 42
43#ifndef SVC_RDMA_H43#ifndef SVC_RDMA_H
44#define SVC_RDMA_H44#define SVC_RDMA_H
45#include <linux/llist.h>
45#include <linux/sunrpc/xdr.h>46#include <linux/sunrpc/xdr.h>
46#include <linux/sunrpc/svcsock.h>47#include <linux/sunrpc/svcsock.h>
47#include <linux/sunrpc/rpc_rdma.h>48#include <linux/sunrpc/rpc_rdma.h>
@@ -107,8 +108,7 @@ struct svcxprt_rdma { · 59 unmodified lines
107 struct list_head sc_read_complete_q;108 struct list_head sc_read_complete_q;
108 struct work_struct sc_work;109 struct work_struct sc_work;
109 110
110 spinlock_t sc_recv_lock;111 struct llist_head sc_recv_ctxts;
111 struct list_head sc_recv_ctxts;
112};112};
113/* sc_flags */113/* sc_flags */
114#define RDMAXPRT_CONN_PENDING 3114#define RDMAXPRT_CONN_PENDING 3
@@ -125,6 +125,7 @@ enum { · 10 unmodified lines
125#define RPCSVC_MAXPAYLOAD_RDMA RPCSVC_MAXPAYLOAD125#define RPCSVC_MAXPAYLOAD_RDMA RPCSVC_MAXPAYLOAD
126 126
127struct svc_rdma_recv_ctxt {127struct svc_rdma_recv_ctxt {
128 struct llist_node rc_node;
128 struct list_head rc_list;129 struct list_head rc_list;
129 struct ib_recv_wr rc_recv_wr;130 struct ib_recv_wr rc_recv_wr;
130 struct ib_cqe rc_cqe;131 struct ib_cqe rc_cqe;
@@ -200,7 +201,6 @@ extern struct svc_xprt_class svc_rdma_bc_class; · 69 unmodified lines
200#endif201#endif
201 202
202/* svc_rdma.c */203/* svc_rdma.c */
203extern struct workqueue_struct *svc_rdma_wq;
204extern int svc_rdma_init(void);204extern int svc_rdma_init(void);
205extern void svc_rdma_cleanup(void);205extern void svc_rdma_cleanup(void);
206 206
include/linux/sunrpc/xdr.h+1−1
@@ -186,7 +186,7 @@ xdr_adjust_iovec(struct kvec *iov, __be32 *p) · 185 unmodified lines
186extern void xdr_shift_buf(struct xdr_buf *, size_t);186extern void xdr_shift_buf(struct xdr_buf *, size_t);
187extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *);187extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *);
188extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int);188extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, unsigned int, unsigned int);
189extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, unsigned int);189extern int xdr_buf_read_mic(struct xdr_buf *, struct xdr_netobj *, unsigned int);
190extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);190extern int read_bytes_from_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
191extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);191extern int write_bytes_to_xdr_buf(struct xdr_buf *, unsigned int, void *, unsigned int);
192 192
include/linux/sunrpc/xprt.h+1−0
@@ -352,6 +352,7 @@ bool xprt_prepare_transmit(struct rpc_task *task); · 351 unmodified lines
352void xprt_request_enqueue_transmit(struct rpc_task *task);352void xprt_request_enqueue_transmit(struct rpc_task *task);
353void xprt_request_enqueue_receive(struct rpc_task *task);353void xprt_request_enqueue_receive(struct rpc_task *task);
354void xprt_request_wait_receive(struct rpc_task *task);354void xprt_request_wait_receive(struct rpc_task *task);
355void xprt_request_dequeue_xprt(struct rpc_task *task);
355bool xprt_request_need_retransmit(struct rpc_task *task);356bool xprt_request_need_retransmit(struct rpc_task *task);
356void xprt_transmit(struct rpc_task *task);357void xprt_transmit(struct rpc_task *task);
357void xprt_end_transmit(struct rpc_task *task);358void xprt_end_transmit(struct rpc_task *task);
include/linux/sunrpc/xprtrdma.h+2−2
@@ -49,9 +49,9 @@ · 48 unmodified lines
49 * fully-chunked NFS message (read chunks are the largest). Note only49 * fully-chunked NFS message (read chunks are the largest). Note only
50 * a single chunk type per message is supported currently.50 * a single chunk type per message is supported currently.
51 */51 */
52#define RPCRDMA_MIN_SLOT_TABLE (2U)52#define RPCRDMA_MIN_SLOT_TABLE (4U)
53#define RPCRDMA_DEF_SLOT_TABLE (128U)53#define RPCRDMA_DEF_SLOT_TABLE (128U)
54#define RPCRDMA_MAX_SLOT_TABLE (256U)54#define RPCRDMA_MAX_SLOT_TABLE (16384U)
55 55
56#define RPCRDMA_MIN_INLINE (1024) /* min inline thresh */56#define RPCRDMA_MIN_INLINE (1024) /* min inline thresh */
57#define RPCRDMA_DEF_INLINE (4096) /* default inline thresh */57#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
190struct platform_s2idle_ops {190struct platform_s2idle_ops {
191 int (*begin)(void);191 int (*begin)(void);
192 int (*prepare)(void);192 int (*prepare)(void);
193 int (*prepare_late)(void);
193 void (*wake)(void);194 void (*wake)(void);
194 void (*sync)(void);195 void (*restore_early)(void);
195 void (*restore)(void);196 void (*restore)(void);
196 void (*end)(void);197 void (*end)(void);
197};198};
@@ -336,6 +337,7 @@ static inline void pm_set_suspend_via_firmware(void) {} · 138 unmodified lines
336static inline void pm_set_resume_via_firmware(void) {}337static inline void pm_set_resume_via_firmware(void) {}
337static inline bool pm_suspend_via_firmware(void) { return false; }338static inline bool pm_suspend_via_firmware(void) { return false; }
338static inline bool pm_resume_via_firmware(void) { return false; }339static inline bool pm_resume_via_firmware(void) { return false; }
340static inline bool pm_suspend_no_platform(void) { return false; }
339static inline bool pm_suspend_default_s2idle(void) { return false; }341static inline bool pm_suspend_default_s2idle(void) { return false; }
340 342
341static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {}343static 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
340extern void lru_add_drain_all(void);340extern void lru_add_drain_all(void);
341extern void rotate_reclaimable_page(struct page *page);341extern void rotate_reclaimable_page(struct page *page);
342extern void deactivate_file_page(struct page *page);342extern void deactivate_file_page(struct page *page);
343extern void deactivate_page(struct page *page);
343extern void mark_page_lazyfree(struct page *page);344extern void mark_page_lazyfree(struct page *page);
344extern void swap_setup(void);345extern void swap_setup(void);
345 346
@@ -364,6 +365,7 @@ extern int vm_swappiness; · 18 unmodified lines
364extern int remove_mapping(struct address_space *mapping, struct page *page);365extern int remove_mapping(struct address_space *mapping, struct page *page);
365extern unsigned long vm_total_pages;366extern unsigned long vm_total_pages;
366 367
368extern unsigned long reclaim_pages(struct list_head *page_list);
367#ifdef CONFIG_NUMA369#ifdef CONFIG_NUMA
368extern int node_reclaim_mode;370extern int node_reclaim_mode;
369extern int sysctl_min_unmapped_ratio;371extern int sysctl_min_unmapped_ratio;
include/linux/swiotlb.h+6−2
@@ -46,13 +46,17 @@ enum dma_sync_target { · 45 unmodified lines
46 46
47extern phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,47extern phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
48 dma_addr_t tbl_dma_addr,48 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,
50 enum dma_data_direction dir,52 enum dma_data_direction dir,
51 unsigned long attrs);53 unsigned long attrs);
52 54
53extern void swiotlb_tbl_unmap_single(struct device *hwdev,55extern void swiotlb_tbl_unmap_single(struct device *hwdev,
54 phys_addr_t tlb_addr,56 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,
56 unsigned long attrs);60 unsigned long attrs);
57 61
58extern void swiotlb_tbl_sync_single(struct device *hwdev,62extern 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
12 const char *machine;12 const char *machine;
13 const char *family;13 const char *family;
14 const char *revision;14 const char *revision;
15 const char *serial_number;
15 const char *soc_id;16 const char *soc_id;
16 const void *data;17 const void *data;
17};18};
include/linux/syscalls.h+19−0
@@ -1402,4 +1402,23 @@ static inline unsigned int ksys_personality(unsigned int personality) · 1401 unmodified lines
1402 return old;1402 return old;
1403}1403}
1404 1404
1405/* for __ARCH_WANT_SYS_IPC */
1406long ksys_semtimedop(int semid, struct sembuf __user *tsops,
1407 unsigned int nsops,
1408 const struct __kernel_timespec __user *timeout);
1409long ksys_semget(key_t key, int nsems, int semflg);
1410long ksys_old_semctl(int semid, int semnum, int cmd, unsigned long arg);
1411long ksys_msgget(key_t key, int msgflg);
1412long ksys_old_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
1413long ksys_msgrcv(int msqid, struct msgbuf __user *msgp, size_t msgsz,
1414 long msgtyp, int msgflg);
1415long ksys_msgsnd(int msqid, struct msgbuf __user *msgp, size_t msgsz,
1416 int msgflg);
1417long ksys_shmget(key_t key, size_t size, int shmflg);
1418long ksys_shmdt(char __user *shmaddr);
1419long ksys_old_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
1420long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems,
1421 unsigned int nsops,
1422 const struct old_timespec32 __user *timeout);
1423
1405#endif1424#endif
include/linux/sysfs.h+9−0
@@ -196,6 +196,12 @@ struct bin_attribute { · 195 unmodified lines
196 .size = _size, \196 .size = _size, \
197}197}
198 198
199#define __BIN_ATTR_WO(_name) { \
200 .attr = { .name = __stringify(_name), .mode = 0200 }, \
201 .store = _name##_store, \
202 .size = _size, \
203}
204
199#define __BIN_ATTR_RW(_name, _size) \205#define __BIN_ATTR_RW(_name, _size) \
200 __BIN_ATTR(_name, 0644, _name##_read, _name##_write, _size)206 __BIN_ATTR(_name, 0644, _name##_read, _name##_write, _size)
201 207
@@ -208,6 +214,9 @@ struct bin_attribute bin_attr_##_name = __BIN_ATTR(_name, _mode, _read, \ · 6 unmodified lines
208#define BIN_ATTR_RO(_name, _size) \214#define BIN_ATTR_RO(_name, _size) \
209struct bin_attribute bin_attr_##_name = __BIN_ATTR_RO(_name, _size)215struct bin_attribute bin_attr_##_name = __BIN_ATTR_RO(_name, _size)
210 216
217#define BIN_ATTR_WO(_name, _size) \
218struct bin_attribute bin_attr_##_name = __BIN_ATTR_WO(_name, _size)
219
211#define BIN_ATTR_RW(_name, _size) \220#define BIN_ATTR_RW(_name, _size) \
212struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size)221struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size)
213 222
include/linux/t10-pi.h+0−14
@@ -53,18 +53,4 @@ extern const struct blk_integrity_profile t10_pi_type1_ip; · 52 unmodified lines
53extern const struct blk_integrity_profile t10_pi_type3_crc;53extern const struct blk_integrity_profile t10_pi_type3_crc;
54extern const struct blk_integrity_profile t10_pi_type3_ip;54extern const struct blk_integrity_profile t10_pi_type3_ip;
55 55
56#ifdef CONFIG_BLK_DEV_INTEGRITY
57extern void t10_pi_prepare(struct request *rq, u8 protection_type);
58extern void t10_pi_complete(struct request *rq, u8 protection_type,
59 unsigned int intervals);
60#else
61static inline void t10_pi_complete(struct request *rq, u8 protection_type,
62 unsigned int intervals)
63{
64}
65static inline void t10_pi_prepare(struct request *rq, u8 protection_type)
66{
67}
68#endif
69
70#endif56#endif
include/linux/tcp.h+2−0
@@ -354,6 +354,8 @@ struct tcp_sock { · 353 unmodified lines
354#define BPF_SOCK_OPS_TEST_FLAG(TP, ARG) 0354#define BPF_SOCK_OPS_TEST_FLAG(TP, ARG) 0
355#endif355#endif
356 356
357 u32 rcv_ooopack; /* Received out-of-order packets, for tcpinfo */
358
357/* Receiver side RTT estimation */359/* Receiver side RTT estimation */
358 u32 rcv_rtt_last_tsecr;360 u32 rcv_rtt_last_tsecr;
359 struct {361 struct {
include/linux/thermal.h+2−2
@@ -251,7 +251,7 @@ struct thermal_bind_params { · 250 unmodified lines
251 * platform characterization. This value is relative to the251 * platform characterization. This value is relative to the
252 * rest of the weights so a cooling device whose weight is252 * rest of the weights so a cooling device whose weight is
253 * double that of another cooling device is twice as253 * double that of another cooling device is twice as
254 * effective. See Documentation/thermal/sysfs-api.rst for more254 * effective. See Documentation/driver-api/thermal/sysfs-api.rst for more
255 * information.255 * information.
256 */256 */
257 int weight;257 int weight;
@@ -259,7 +259,7 @@ struct thermal_bind_params { · 1 unmodified line
259 /*259 /*
260 * This is a bit mask that gives the binding relation between this260 * This is a bit mask that gives the binding relation between this
261 * thermal zone and cdev, for a particular trip point.261 * 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.
263 */263 */
264 int trip_mask;264 int trip_mask;
265 265
include/linux/thread_info.h+1−1
@@ -134,7 +134,7 @@ static inline void copy_overflow(int size, unsigned long count) · 133 unmodified lines
134 WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);134 WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count);
135}135}
136 136
137static __always_inline bool137static __always_inline __must_check bool
138check_copy_size(const void *addr, size_t bytes, bool is_source)138check_copy_size(const void *addr, size_t bytes, bool is_source)
139{139{
140 int sz = __compiletime_object_size(addr);140 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
429 * @lock: Must be held during ring creation/destruction. Is acquired by429 * @lock: Must be held during ring creation/destruction. Is acquired by
430 * interrupt_work when dispatching interrupts to individual rings.430 * interrupt_work when dispatching interrupts to individual rings.
431 * @pdev: Pointer to the PCI device431 * @pdev: Pointer to the PCI device
432 * @ops: NHI specific optional ops
432 * @iobase: MMIO space of the NHI433 * @iobase: MMIO space of the NHI
433 * @tx_rings: All Tx rings available on this host controller434 * @tx_rings: All Tx rings available on this host controller
434 * @rx_rings: All Rx rings available on this host controller435 * @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
442struct tb_nhi {443struct tb_nhi {
443 spinlock_t lock;444 spinlock_t lock;
444 struct pci_dev *pdev;445 struct pci_dev *pdev;
446 const struct tb_nhi_ops *ops;
445 void __iomem *iobase;447 void __iomem *iobase;
446 struct tb_ring **tx_rings;448 struct tb_ring **tx_rings;
447 struct tb_ring **rx_rings;449 struct tb_ring **rx_rings;
include/linux/time64.h+2−0
@@ -30,6 +30,8 @@ struct itimerspec64 { · 29 unmodified lines
30 30
31/* Located here for timespec[64]_valid_strict */31/* Located here for timespec[64]_valid_strict */
32#define TIME64_MAX ((s64)~((u64)1 << 63))32#define TIME64_MAX ((s64)~((u64)1 << 63))
33#define TIME64_MIN (-TIME64_MAX - 1)
34
33#define KTIME_MAX ((s64)~((u64)1 << 63))35#define KTIME_MAX ((s64)~((u64)1 << 63))
34#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)36#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
35 37
include/linux/timekeeper_internal.h+5−0
@@ -57,6 +57,7 @@ struct tk_read_base { · 56 unmodified lines
57 * @cs_was_changed_seq: The sequence number of clocksource change events57 * @cs_was_changed_seq: The sequence number of clocksource change events
58 * @next_leap_ktime: CLOCK_MONOTONIC time value of a pending leap-second58 * @next_leap_ktime: CLOCK_MONOTONIC time value of a pending leap-second
59 * @raw_sec: CLOCK_MONOTONIC_RAW time in seconds59 * @raw_sec: CLOCK_MONOTONIC_RAW time in seconds
60 * @monotonic_to_boot: CLOCK_MONOTONIC to CLOCK_BOOTTIME offset
60 * @cycle_interval: Number of clock cycles in one NTP interval61 * @cycle_interval: Number of clock cycles in one NTP interval
61 * @xtime_interval: Number of clock shifted nano seconds in one NTP62 * @xtime_interval: Number of clock shifted nano seconds in one NTP
62 * interval.63 * interval.
@@ -84,6 +85,9 @@ struct tk_read_base { · 21 unmodified lines
84 *85 *
85 * wall_to_monotonic is no longer the boot time, getboottime must be86 * wall_to_monotonic is no longer the boot time, getboottime must be
86 * used instead.87 * used instead.
88 *
89 * @monotonic_to_boottime is a timespec64 representation of @offs_boot to
90 * accelerate the VDSO update for CLOCK_BOOTTIME.
87 */91 */
88struct timekeeper {92struct timekeeper {
89 struct tk_read_base tkr_mono;93 struct tk_read_base tkr_mono;
@@ -99,6 +103,7 @@ struct timekeeper { · 9 unmodified lines
99 u8 cs_was_changed_seq;103 u8 cs_was_changed_seq;
100 ktime_t next_leap_ktime;104 ktime_t next_leap_ktime;
101 u64 raw_sec;105 u64 raw_sec;
106 struct timespec64 monotonic_to_boot;
102 107
103 /* The following members are for timekeeping internal use */108 /* The following members are for timekeeping internal use */
104 u64 cycle_interval;109 u64 cycle_interval;
include/linux/timer.h+1−1
@@ -183,7 +183,7 @@ extern void add_timer(struct timer_list *timer); · 182 unmodified lines
183 183
184extern int try_to_del_timer_sync(struct timer_list *timer);184extern int try_to_del_timer_sync(struct timer_list *timer);
185 185
186#ifdef CONFIG_SMP186#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)
187 extern int del_timer_sync(struct timer_list *timer);187 extern int del_timer_sync(struct timer_list *timer);
188#else188#else
189# define del_timer_sync(t) del_timer(t)189# define del_timer_sync(t) del_timer(t)
include/linux/timeriomem-rng.h+5−0
@@ -5,6 +5,9 @@ · 4 unmodified lines
5 * Copyright (c) 2009 Alexander Clouter <alex@digriz.org.uk>5 * Copyright (c) 2009 Alexander Clouter <alex@digriz.org.uk>
6 */6 */
7 7
8#ifndef _LINUX_TIMERIOMEM_RNG_H
9#define _LINUX_TIMERIOMEM_RNG_H
10
8struct timeriomem_rng_data {11struct timeriomem_rng_data {
9 void __iomem *address;12 void __iomem *address;
10 13
@@ -14,3 +17,5 @@ struct timeriomem_rng_data { · 3 unmodified lines
14 /* bits of entropy per 1024 bits read */17 /* bits of entropy per 1024 bits read */
15 unsigned int quality;18 unsigned int quality;
16};19};
20
21#endif /* _LINUX_TIMERIOMEM_RNG_H */
include/linux/timerqueue.h+16−7
@@ -12,8 +12,7 @@ struct timerqueue_node { · 11 unmodified lines
12};12};
13 13
14struct timerqueue_head {14struct timerqueue_head {
15 struct rb_root head;15 struct rb_root_cached rb_root;
16 struct timerqueue_node *next;
17};16};
18 17
19 18
@@ -29,13 +28,14 @@ extern struct timerqueue_node *timerqueue_iterate_next( · 9 unmodified lines
29 *28 *
30 * @head: head of timerqueue29 * @head: head of timerqueue
31 *30 *
32 * Returns a pointer to the timer node that has the31 * Returns a pointer to the timer node that has the earliest expiration time.
33 * earliest expiration time.
34 */32 */
35static inline33static inline
36struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head)34struct timerqueue_node *timerqueue_getnext(struct timerqueue_head *head)
37{35{
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);
39}39}
40 40
41static inline void timerqueue_init(struct timerqueue_node *node)41static inline void timerqueue_init(struct timerqueue_node *node)
@@ -43,9 +43,18 @@ static inline void timerqueue_init(struct timerqueue_node *node) · 1 unmodified line
43 RB_CLEAR_NODE(&node->node);43 RB_CLEAR_NODE(&node->node);
44}44}
45 45
46static inline bool timerqueue_node_queued(struct timerqueue_node *node)
47{
48 return !RB_EMPTY_NODE(&node->node);
49}
50
51static inline bool timerqueue_node_expires(struct timerqueue_node *node)
52{
53 return node->expires;
54}
55
46static inline void timerqueue_init_head(struct timerqueue_head *head)56static inline void timerqueue_init_head(struct timerqueue_head *head)
47{57{
48 head->head = RB_ROOT;58 head->rb_root = RB_ROOT_CACHED;
49 head->next = NULL;
50}59}
51#endif /* _LINUX_TIMERQUEUE_H */60#endif /* _LINUX_TIMERQUEUE_H */
include/linux/tnum.h+6−0
@@ -5,6 +5,10 @@ · 4 unmodified lines
5 * propagate the unknown bits such that the tnum result represents all the5 * propagate the unknown bits such that the tnum result represents all the
6 * possible results for possible values of the operands.6 * possible results for possible values of the operands.
7 */7 */
8
9#ifndef _LINUX_TNUM_H
10#define _LINUX_TNUM_H
11
8#include <linux/types.h>12#include <linux/types.h>
9 13
10struct tnum {14struct tnum {
@@ -81,3 +85,5 @@ bool tnum_in(struct tnum a, struct tnum b); · 70 unmodified lines
81int tnum_strn(char *str, size_t size, struct tnum a);85int tnum_strn(char *str, size_t size, struct tnum a);
82/* Format a tnum as tristate binary expansion */86/* Format a tnum as tristate binary expansion */
83int tnum_sbin(char *str, size_t size, struct tnum a);87int 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
27#ifndef _LINUX_TOPOLOGY_H27#ifndef _LINUX_TOPOLOGY_H
28#define _LINUX_TOPOLOGY_H28#define _LINUX_TOPOLOGY_H
29 29
30#include <linux/arch_topology.h>
30#include <linux/cpumask.h>31#include <linux/cpumask.h>
31#include <linux/bitops.h>32#include <linux/bitops.h>
32#include <linux/mmzone.h>33#include <linux/mmzone.h>
@@ -59,6 +60,20 @@ int arch_update_cpu_topology(void); · 26 unmodified lines
59 */60 */
60#define RECLAIM_DISTANCE 3061#define RECLAIM_DISTANCE 30
61#endif62#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 */
75extern int __read_mostly node_reclaim_distance;
76
62#ifndef PENALTY_FOR_NODE_WITH_CPUS77#ifndef PENALTY_FOR_NODE_WITH_CPUS
63#define PENALTY_FOR_NODE_WITH_CPUS (1)78#define PENALTY_FOR_NODE_WITH_CPUS (1)
64#endif79#endif
include/linux/torture.h+1−1
@@ -86,7 +86,7 @@ void _torture_stop_kthread(char *m, struct task_struct **tp); · 85 unmodified lines
86#define torture_stop_kthread(n, tp) \86#define torture_stop_kthread(n, tp) \
87 _torture_stop_kthread("Stopping " #n " task", &(tp))87 _torture_stop_kthread("Stopping " #n " task", &(tp))
88 88
89#ifdef CONFIG_PREEMPT89#ifdef CONFIG_PREEMPTION
90#define torture_preempt_schedule() preempt_schedule()90#define torture_preempt_schedule() preempt_schedule()
91#else91#else
92#define torture_preempt_schedule()92#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
548 548
549#define is_signed_type(type) (((type)(-1)) < (type)1)549#define is_signed_type(type) (((type)(-1)) < (type)1)
550 550
551int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set);
551int trace_set_clr_event(const char *system, const char *event, int set);552int trace_set_clr_event(const char *system, const char *event, int set);
552 553
553/*554/*
include/linux/uaccess.h+11−10
@@ -55,7 +55,7 @@ · 54 unmodified lines
55 * as usual) and both source and destination can trigger faults.55 * as usual) and both source and destination can trigger faults.
56 */56 */
57 57
58static __always_inline unsigned long58static __always_inline __must_check unsigned long
59__copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)59__copy_from_user_inatomic(void *to, const void __user *from, unsigned long n)
60{60{
61 kasan_check_write(to, n);61 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
63 return raw_copy_from_user(to, from, n);63 return raw_copy_from_user(to, from, n);
64}64}
65 65
66static __always_inline unsigned long66static __always_inline __must_check unsigned long
67__copy_from_user(void *to, const void __user *from, unsigned long n)67__copy_from_user(void *to, const void __user *from, unsigned long n)
68{68{
69 might_fault();69 might_fault();
@@ -85,7 +85,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n) · 15 unmodified lines
85 * The caller should also make sure he pins the user space address85 * The caller should also make sure he pins the user space address
86 * so that we don't result in page fault and sleep.86 * so that we don't result in page fault and sleep.
87 */87 */
88static __always_inline unsigned long88static __always_inline __must_check unsigned long
89__copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)89__copy_to_user_inatomic(void __user *to, const void *from, unsigned long n)
90{90{
91 kasan_check_read(from, n);91 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
93 return raw_copy_to_user(to, from, n);93 return raw_copy_to_user(to, from, n);
94}94}
95 95
96static __always_inline unsigned long96static __always_inline __must_check unsigned long
97__copy_to_user(void __user *to, const void *from, unsigned long n)97__copy_to_user(void __user *to, const void *from, unsigned long n)
98{98{
99 might_fault();99 might_fault();
@@ -103,7 +103,7 @@ __copy_to_user(void __user *to, const void *from, unsigned long n) · 3 unmodified lines
103}103}
104 104
105#ifdef INLINE_COPY_FROM_USER105#ifdef INLINE_COPY_FROM_USER
106static inline unsigned long106static inline __must_check unsigned long
107_copy_from_user(void *to, const void __user *from, unsigned long n)107_copy_from_user(void *to, const void __user *from, unsigned long n)
108{108{
109 unsigned long res = n;109 unsigned long res = n;
@@ -117,12 +117,12 @@ _copy_from_user(void *to, const void __user *from, unsigned long n) · 7 unmodified lines
117 return res;117 return res;
118}118}
119#else119#else
120extern unsigned long120extern __must_check unsigned long
121_copy_from_user(void *, const void __user *, unsigned long);121_copy_from_user(void *, const void __user *, unsigned long);
122#endif122#endif
123 123
124#ifdef INLINE_COPY_TO_USER124#ifdef INLINE_COPY_TO_USER
125static inline unsigned long125static inline __must_check unsigned long
126_copy_to_user(void __user *to, const void *from, unsigned long n)126_copy_to_user(void __user *to, const void *from, unsigned long n)
127{127{
128 might_fault();128 might_fault();
@@ -133,7 +133,7 @@ _copy_to_user(void __user *to, const void *from, unsigned long n) · 4 unmodified lines
133 return n;133 return n;
134}134}
135#else135#else
136extern unsigned long136extern __must_check unsigned long
137_copy_to_user(void __user *, const void *, unsigned long);137_copy_to_user(void __user *, const void *, unsigned long);
138#endif138#endif
139 139
@@ -222,8 +222,9 @@ static inline bool pagefault_disabled(void) · 82 unmodified lines
222 222
223#ifndef ARCH_HAS_NOCACHE_UACCESS223#ifndef ARCH_HAS_NOCACHE_UACCESS
224 224
225static inline unsigned long __copy_from_user_inatomic_nocache(void *to,225static inline __must_check unsigned long
226 const void __user *from, unsigned long n)226__copy_from_user_inatomic_nocache(void *to, const void __user *from,
227 unsigned long n)
227{228{
228 return __copy_from_user_inatomic(to, from, n);229 return __copy_from_user_inatomic(to, from, n);
229}230}
include/linux/usb.h+7−2
@@ -426,7 +426,6 @@ struct usb_bus { · 425 unmodified lines
426 struct device *sysdev; /* as seen from firmware or bus */426 struct device *sysdev; /* as seen from firmware or bus */
427 int busnum; /* Bus number (in order of reg) */427 int busnum; /* Bus number (in order of reg) */
428 const char *bus_name; /* stable id (PCI slot_name etc) */428 const char *bus_name; /* stable id (PCI slot_name etc) */
429 u8 uses_dma; /* Does the host controller use DMA? */
430 u8 uses_pio_for_control; /*429 u8 uses_pio_for_control; /*
431 * Does the host controller use PIO430 * Does the host controller use PIO
432 * for control transfers?431 * for control transfers?
@@ -1151,6 +1150,8 @@ struct usbdrv_wrap { · 718 unmodified lines
1151 * @id_table: USB drivers use ID table to support hotplugging.1150 * @id_table: USB drivers use ID table to support hotplugging.
1152 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set1151 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
1153 * or your driver's probe function will never get called.1152 * 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.
1154 * @dynids: used internally to hold the list of dynamically added device1155 * @dynids: used internally to hold the list of dynamically added device
1155 * ids for this driver.1156 * ids for this driver.
1156 * @drvwrap: Driver-model core structure wrapper.1157 * @drvwrap: Driver-model core structure wrapper.
@@ -1198,6 +1199,7 @@ struct usb_driver { · 41 unmodified lines
1198 int (*post_reset)(struct usb_interface *intf);1199 int (*post_reset)(struct usb_interface *intf);
1199 1200
1200 const struct usb_device_id *id_table;1201 const struct usb_device_id *id_table;
1202 const struct attribute_group **dev_groups;
1201 1203
1202 struct usb_dynids dynids;1204 struct usb_dynids dynids;
1203 struct usbdrv_wrap drvwrap;1205 struct usbdrv_wrap drvwrap;
@@ -1221,6 +1223,8 @@ struct usb_driver { · 17 unmodified lines
1221 * module is being unloaded.1223 * module is being unloaded.
1222 * @suspend: Called when the device is going to be suspended by the system.1224 * @suspend: Called when the device is going to be suspended by the system.
1223 * @resume: Called when the device is being resumed by the system.1225 * @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.
1224 * @drvwrap: Driver-model core structure wrapper.1228 * @drvwrap: Driver-model core structure wrapper.
1225 * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend1229 * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend
1226 * for devices bound to this driver.1230 * for devices bound to this driver.
@@ -1235,6 +1239,7 @@ struct usb_device_driver { · 8 unmodified lines
1235 1239
1236 int (*suspend) (struct usb_device *udev, pm_message_t message);1240 int (*suspend) (struct usb_device *udev, pm_message_t message);
1237 int (*resume) (struct usb_device *udev, pm_message_t message);1241 int (*resume) (struct usb_device *udev, pm_message_t message);
1242 const struct attribute_group **dev_groups;
1238 struct usbdrv_wrap drvwrap;1243 struct usbdrv_wrap drvwrap;
1239 unsigned int supports_autosuspend:1;1244 unsigned int supports_autosuspend:1;
1240};1245};
@@ -1457,7 +1462,7 @@ typedef void (*usb_complete_t)(struct urb *); · 216 unmodified lines
1457 * field rather than determining a dma address themselves.1462 * field rather than determining a dma address themselves.
1458 *1463 *
1459 * Note that transfer_buffer must still be set if the controller1464 * Note that transfer_buffer must still be set if the controller
1460 * does not support DMA (as indicated by bus.uses_dma) and when talking1465 * does not support DMA (as indicated by hcd_uses_dma()) and when talking
1461 * to root hub. If you have to trasfer between highmem zone and the device1466 * to root hub. If you have to trasfer between highmem zone and the device
1462 * on such controller, create a bounce buffer or bail out with an error.1467 * on such controller, create a bounce buffer or bail out with an error.
1463 * If transfer_buffer cannot be set (is in highmem) and the controller is DMA1468 * 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 */
26struct 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] */
45enum {
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 */
56enum {
57 CBAF_IFACECLASS = 0xef,
58 CBAF_IFACESUBCLASS = 0x03,
59 CBAF_IFACEPROTOCOL = 0x01,
60};
61
62/* Association Information (AMS1.0[T4-3]) */
63struct 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]) */
71struct wusb_cbaf_assoc_request {
72 __u8 AssociationDataIndex;
73 __u8 Reserved;
74 __le16 AssociationTypeId;
75 __le16 AssociationSubTypeId;
76 __le32 AssociationTypeInfoSize;
77} __attribute__((packed));
78
79enum {
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]) */
86struct 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...) */
92struct 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 */
110struct 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]) */
124struct 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]) */
140struct 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
70 */70 */
71extern const char *usb_state_string(enum usb_device_state state);71extern const char *usb_state_string(enum usb_device_state state);
72 72
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 */
95extern 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
73#endif /* __LINUX_USB_CH9_H */100#endif /* __LINUX_USB_CH9_H */
include/linux/usb/gadget.h+3−0
@@ -291,6 +291,9 @@ struct usb_dcd_config_params { · 290 unmodified lines
291#define USB_DEFAULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */291#define USB_DEFAULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */
292 __le16 bU2DevExitLat; /* U2 Device exit Latency */292 __le16 bU2DevExitLat; /* U2 Device exit Latency */
293#define USB_DEFAULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */293#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 */
294};297};
295 298
296 299
include/linux/usb/hcd.h+10−0
@@ -256,6 +256,7 @@ struct hc_driver { · 255 unmodified lines
256 256
257 int flags;257 int flags;
258#define HCD_MEMORY 0x0001 /* HC regs use memory (else I/O) */258#define HCD_MEMORY 0x0001 /* HC regs use memory (else I/O) */
259#define HCD_DMA 0x0002 /* HC uses DMA */
259#define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */260#define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */
260#define HCD_USB11 0x0010 /* USB 1.1 */261#define HCD_USB11 0x0010 /* USB 1.1 */
261#define HCD_USB2 0x0020 /* USB 2.0 */262#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
422 return hcd->high_prio_bh.completing_ep == ep;423 return hcd->high_prio_bh.completing_ep == ep;
423}424}
424 425
426static inline bool hcd_uses_dma(struct usb_hcd *hcd)
427{
428 return IS_ENABLED(CONFIG_HAS_DMA) && (hcd->driver->flags & HCD_DMA);
429}
430
425extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);431extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
426extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb,432extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb,
427 int status);433 int status);
@@ -591,6 +597,10 @@ extern void usb_ep0_reinit(struct usb_device *); · 163 unmodified lines
591#define GetPortStatus HUB_CLASS_REQ(USB_DIR_IN, USB_RT_PORT, USB_REQ_GET_STATUS)597#define GetPortStatus HUB_CLASS_REQ(USB_DIR_IN, USB_RT_PORT, USB_REQ_GET_STATUS)
592#define SetHubFeature HUB_CLASS_REQ(USB_DIR_OUT, USB_RT_HUB, USB_REQ_SET_FEATURE)598#define SetHubFeature HUB_CLASS_REQ(USB_DIR_OUT, USB_RT_HUB, USB_REQ_SET_FEATURE)
593#define SetPortFeature HUB_CLASS_REQ(USB_DIR_OUT, USB_RT_PORT, USB_REQ_SET_FEATURE)599#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)
594 604
595 605
596/*-------------------------------------------------------------------------*/606/*-------------------------------------------------------------------------*/
include/linux/usb/role.h+37−0
@@ -42,14 +42,51 @@ struct usb_role_switch_desc { · 41 unmodified lines
42 bool allow_userspace_control;42 bool allow_userspace_control;
43};43};
44 44
45
46#if IS_ENABLED(CONFIG_USB_ROLE_SWITCH)
45int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role);47int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role);
46enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw);48enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw);
47struct usb_role_switch *usb_role_switch_get(struct device *dev);49struct usb_role_switch *usb_role_switch_get(struct device *dev);
50struct usb_role_switch *fwnode_usb_role_switch_get(struct fwnode_handle *node);
48void usb_role_switch_put(struct usb_role_switch *sw);51void usb_role_switch_put(struct usb_role_switch *sw);
49 52
50struct usb_role_switch *53struct usb_role_switch *
51usb_role_switch_register(struct device *parent,54usb_role_switch_register(struct device *parent,
52 const struct usb_role_switch_desc *desc);55 const struct usb_role_switch_desc *desc);
53void usb_role_switch_unregister(struct usb_role_switch *sw);56void usb_role_switch_unregister(struct usb_role_switch *sw);
57#else
58static inline int usb_role_switch_set_role(struct usb_role_switch *sw,
59 enum usb_role role)
60{
61 return 0;
62}
63
64static inline enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw)
65{
66 return USB_ROLE_NONE;
67}
68
69static inline struct usb_role_switch *usb_role_switch_get(struct device *dev)
70{
71 return ERR_PTR(-ENODEV);
72}
73
74static inline struct usb_role_switch *
75fwnode_usb_role_switch_get(struct fwnode_handle *node)
76{
77 return ERR_PTR(-ENODEV);
78}
79
80static inline void usb_role_switch_put(struct usb_role_switch *sw) { }
81
82static inline struct usb_role_switch *
83usb_role_switch_register(struct device *parent,
84 const struct usb_role_switch_desc *desc)
85{
86 return ERR_PTR(-ENODEV);
87}
88
89static inline void usb_role_switch_unregister(struct usb_role_switch *sw) { }
90#endif
54 91
55#endif /* __LINUX_USB_ROLE_H */92#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
14enum 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
113 u32 ll_ltssm_ctrl1;113 u32 ll_ltssm_ctrl1;
114 u32 ll_ltssm_ctrl2;114 u32 ll_ltssm_ctrl2;
115 u32 ll_ltssm_ctrl3;115 u32 ll_ltssm_ctrl3;
116 u32 unused[2];116 u32 unused1;
117
118 /* 0x710 */
119 u32 unused2;
117 u32 ll_general_ctrl0;120 u32 ll_general_ctrl0;
118 u32 ll_general_ctrl1;121 u32 ll_general_ctrl1;
119#define PM_U3_AUTO_EXIT 29122#define PM_U3_AUTO_EXIT 29
@@ -136,29 +139,41 @@ struct usb338x_ll_regs { · 16 unmodified lines
136 u32 ll_general_ctrl2;139 u32 ll_general_ctrl2;
137#define SELECT_INVERT_LANE_POLARITY 7140#define SELECT_INVERT_LANE_POLARITY 7
138#define FORCE_INVERT_LANE_POLARITY 6141#define FORCE_INVERT_LANE_POLARITY 6
142
143 /* 0x720 */
139 u32 ll_general_ctrl3;144 u32 ll_general_ctrl3;
140 u32 ll_general_ctrl4;145 u32 ll_general_ctrl4;
141 u32 ll_error_gen;146 u32 ll_error_gen;
142} __packed;147 u32 unused3;
148
149 /* 0x730 */
150 u32 unused4[4];
143 151
144struct usb338x_ll_lfps_regs {152 /* 0x740 */
145 /* offset 0x748 */153 u32 unused5[2];
146 u32 ll_lfps_5;154 u32 ll_lfps_5;
147#define TIMER_LFPS_6US 16155#define TIMER_LFPS_6US 16
148 u32 ll_lfps_6;156 u32 ll_lfps_6;
149#define TIMER_LFPS_80US 0157#define TIMER_LFPS_80US 0
150} __packed;
151 158
152struct usb338x_ll_tsn_regs {159 /* 0x750 */
153 /* offset 0x77C */160 u32 unused6[8];
161
162 /* 0x770 */
163 u32 unused7[3];
154 u32 ll_tsn_counters_2;164 u32 ll_tsn_counters_2;
155#define HOT_TX_NORESET_TS2 24165#define HOT_TX_NORESET_TS2 24
166
167 /* 0x780 */
156 u32 ll_tsn_counters_3;168 u32 ll_tsn_counters_3;
157#define HOT_RX_RESET_TS2 0169#define HOT_RX_RESET_TS2 0
158} __packed;170 u32 unused8[3];
159 171
160struct usb338x_ll_chi_regs {172 /* 0x790 */
161 /* offset 0x79C */173 u32 unused9;
174 u32 ll_lfps_timers_2;
175#define LFPS_TIMERS_2_WORKAROUND_VALUE 0x084d
176 u32 unused10;
162 u32 ll_tsn_chicken_bit;177 u32 ll_tsn_chicken_bit;
163#define RECOVERY_IDLE_TO_RECOVER_FMW 3178#define RECOVERY_IDLE_TO_RECOVER_FMW 3
164} __packed;179} __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 */
41enum {
42 WA_EXEC_RC_CMD = 40, /* Radio Control command Request */
43};
44
45/* Wireless Adapter Requests ([WUSB] table 8-51) */
46enum {
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) */
60enum {
61 WUSB_TIME_ADJ = 0,
62 WUSB_TIME_BPST = 1,
63 WUSB_TIME_WUSB = 2,
64};
65
66enum {
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