aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h22
-rw-r--r--include/linux/arm-smccc.h10
-rw-r--r--include/linux/assoc_array.h2
-rw-r--r--include/linux/assoc_array_priv.h2
-rw-r--r--include/linux/atmdev.h15
-rw-r--r--include/linux/backing-dev-defs.h2
-rw-r--r--include/linux/backlight.h4
-rw-r--r--include/linux/bio.h1
-rw-r--r--include/linux/blk-mq.h2
-rw-r--r--include/linux/blkdev.h8
-rw-r--r--include/linux/bpf-cgroup.h26
-rw-r--r--include/linux/bpf.h20
-rw-r--r--include/linux/bpf_lirc.h5
-rw-r--r--include/linux/cacheinfo.h25
-rw-r--r--include/linux/ceph/ceph_fs.h1
-rw-r--r--include/linux/ceph/osd_client.h8
-rw-r--r--include/linux/ceph/osdmap.h8
-rw-r--r--include/linux/circ_buf.h2
-rw-r--r--include/linux/clk-provider.h23
-rw-r--r--include/linux/clk/davinci.h40
-rw-r--r--include/linux/compat.h8
-rw-r--r--include/linux/compiler-gcc.h54
-rw-r--r--include/linux/compiler_types.h18
-rw-r--r--include/linux/dax.h14
-rw-r--r--include/linux/device-mapper.h5
-rw-r--r--include/linux/dma-contiguous.h2
-rw-r--r--include/linux/dma/sprd-dma.h61
-rw-r--r--include/linux/filter.h61
-rw-r--r--include/linux/fs.h26
-rw-r--r--include/linux/fscrypt_notsupp.h13
-rw-r--r--include/linux/fscrypt_supp.h5
-rw-r--r--include/linux/fsnotify_backend.h79
-rw-r--r--include/linux/ftrace.h4
-rw-r--r--include/linux/gpio/consumer.h10
-rw-r--r--include/linux/gpio/machine.h31
-rw-r--r--include/linux/hid.h2
-rw-r--r--include/linux/hwspinlock.h68
-rw-r--r--include/linux/hyperv.h12
-rw-r--r--include/linux/i2c-pnx.h38
-rw-r--r--include/linux/i2c.h12
-rw-r--r--include/linux/iio/adc/ad_sigma_delta.h24
-rw-r--r--include/linux/iio/adc/stm32-dfsdm-adc.h2
-rw-r--r--include/linux/iio/buffer-dma.h2
-rw-r--r--include/linux/iio/common/cros_ec_sensors_core.h180
-rw-r--r--include/linux/iio/iio.h24
-rw-r--r--include/linux/input/mt.h2
-rw-r--r--include/linux/intel-iommu.h1
-rw-r--r--include/linux/irq.h8
-rw-r--r--include/linux/irqdesc.h5
-rw-r--r--include/linux/kcov.h14
-rw-r--r--include/linux/kernel.h18
-rw-r--r--include/linux/kthread.h1
-rw-r--r--include/linux/kvm_host.h19
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/linkage.h12
-rw-r--r--include/linux/log2.h35
-rw-r--r--include/linux/memcontrol.h26
-rw-r--r--include/linux/memory.h1
-rw-r--r--include/linux/memremap.h36
-rw-r--r--include/linux/mfd/abx500.h1
-rw-r--r--include/linux/mfd/abx500/ab8500-bm.h2
-rw-r--r--include/linux/mfd/abx500/ux500_chargalg.h4
-rw-r--r--include/linux/mfd/arizona/pdata.h3
-rw-r--r--include/linux/mfd/as3711.h4
-rw-r--r--include/linux/mfd/axp20x.h10
-rw-r--r--include/linux/mfd/bd9571mwv.h5
-rw-r--r--include/linux/mfd/cros_ec.h20
-rw-r--r--include/linux/mfd/lp8788.h16
-rw-r--r--include/linux/mfd/rave-sp.h1
-rw-r--r--include/linux/mfd/samsung/core.h4
-rw-r--r--include/linux/mfd/stm32-timers.h70
-rw-r--r--include/linux/mfd/syscon/exynos4-pmu.h21
-rw-r--r--include/linux/mfd/syscon/exynos5-pmu.h19
-rw-r--r--include/linux/mfd/tps65090.h8
-rw-r--r--include/linux/mfd/tps65218.h4
-rw-r--r--include/linux/mfd/tps6586x.h1
-rw-r--r--include/linux/mfd/tps68470.h17
-rw-r--r--include/linux/mlx5/eswitch.h2
-rw-r--r--include/linux/mlx5/mlx5_ifc.h2
-rw-r--r--include/linux/mm.h76
-rw-r--r--include/linux/mod_devicetable.h1
-rw-r--r--include/linux/mtd/nand.h3
-rw-r--r--include/linux/mtd/rawnand.h35
-rw-r--r--include/linux/mtd/spi-nor.h2
-rw-r--r--include/linux/namei.h1
-rw-r--r--include/linux/net.h1
-rw-r--r--include/linux/netdevice.h20
-rw-r--r--include/linux/netfilter.h2
-rw-r--r--include/linux/netfilter/ipset/ip_set_timeout.h20
-rw-r--r--include/linux/nfs_fs_sb.h2
-rw-r--r--include/linux/nfs_xdr.h17
-rw-r--r--include/linux/of_clk.h30
-rw-r--r--include/linux/perf/arm_pmu.h2
-rw-r--r--include/linux/platform_data/gpio-dwapb.h3
-rw-r--r--include/linux/platform_data/i2c-gpio.h (renamed from include/linux/i2c-gpio.h)0
-rw-r--r--include/linux/platform_data/i2c-mux-gpio.h (renamed from include/linux/i2c-mux-gpio.h)0
-rw-r--r--include/linux/platform_data/i2c-ocores.h (renamed from include/linux/i2c-ocores.h)0
-rw-r--r--include/linux/platform_data/i2c-omap.h (renamed from include/linux/i2c-omap.h)0
-rw-r--r--include/linux/platform_data/i2c-pca-platform.h (renamed from include/linux/i2c-pca-platform.h)0
-rw-r--r--include/linux/platform_data/i2c-xiic.h (renamed from include/linux/i2c-xiic.h)0
-rw-r--r--include/linux/platform_data/media/ir-rx51.h9
-rw-r--r--include/linux/platform_data/mlxreg.h3
-rw-r--r--include/linux/platform_data/mtd-davinci.h10
-rw-r--r--include/linux/platform_data/sc18is602.h2
-rw-r--r--include/linux/platform_data/shmob_drm.h4
-rw-r--r--include/linux/platform_data/spi-imx.h29
-rw-r--r--include/linux/platform_data/ti-aemif.h25
-rw-r--r--include/linux/platform_data/ti-sysc.h1
-rw-r--r--include/linux/platform_data/tsl2772.h101
-rw-r--r--include/linux/pm_domain.h21
-rw-r--r--include/linux/pm_runtime.h6
-rw-r--r--include/linux/poll.h12
-rw-r--r--include/linux/power/bq27xxx_battery.h3
-rw-r--r--include/linux/proc_fs.h12
-rw-r--r--include/linux/pstore.h2
-rw-r--r--include/linux/pwm_backlight.h2
-rw-r--r--include/linux/qcom-geni-se.h425
-rw-r--r--include/linux/rculist.h13
-rw-r--r--include/linux/rculist_nulls.h2
-rw-r--r--include/linux/rcupdate.h4
-rw-r--r--include/linux/refcount.h4
-rw-r--r--include/linux/regulator/ab8500.h157
-rw-r--r--include/linux/regulator/arizona-ldo1.h3
-rw-r--r--include/linux/regulator/consumer.h1
-rw-r--r--include/linux/regulator/driver.h27
-rw-r--r--include/linux/regulator/machine.h4
-rw-r--r--include/linux/regulator/max8952.h1
-rw-r--r--include/linux/rmi.h2
-rw-r--r--include/linux/rpmsg.h27
-rw-r--r--include/linux/rpmsg/qcom_glink.h2
-rw-r--r--include/linux/rtc.h2
-rw-r--r--include/linux/scatterlist.h18
-rw-r--r--include/linux/sched.h147
-rw-r--r--include/linux/scmi_protocol.h18
-rw-r--r--include/linux/skbuff.h3
-rw-r--r--include/linux/slab.h1
-rw-r--r--include/linux/slub_def.h4
-rw-r--r--include/linux/soc/qcom/smem.h2
-rw-r--r--include/linux/soc/ti/ti_sci_protocol.h10
-rw-r--r--include/linux/spinlock.h5
-rw-r--r--include/linux/stackprotector.h2
-rw-r--r--include/linux/stat.h8
-rw-r--r--include/linux/ste_modem_shm.h56
-rw-r--r--include/linux/string_helpers.h1
-rw-r--r--include/linux/sunrpc/rpc_rdma.h1
-rw-r--r--include/linux/sunrpc/svc_rdma.h95
-rw-r--r--include/linux/sunrpc/xprt.h6
-rw-r--r--include/linux/sunrpc/xprtrdma.h1
-rw-r--r--include/linux/syscalls.h8
-rw-r--r--include/linux/thermal.h17
-rw-r--r--include/linux/thread_info.h11
-rw-r--r--include/linux/tracepoint.h2
-rw-r--r--include/linux/uio.h2
-rw-r--r--include/linux/virtio_net.h11
-rw-r--r--include/linux/virtio_ring.h4
155 files changed, 2128 insertions, 811 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 8758a2a9e6c1..e54f40974eb0 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -443,6 +443,9 @@ int acpi_check_resource_conflict(const struct resource *res);
443int acpi_check_region(resource_size_t start, resource_size_t n, 443int acpi_check_region(resource_size_t start, resource_size_t n,
444 const char *name); 444 const char *name);
445 445
446acpi_status acpi_release_memory(acpi_handle handle, struct resource *res,
447 u32 level);
448
446int acpi_resources_are_enforced(void); 449int acpi_resources_are_enforced(void);
447 450
448#ifdef CONFIG_HIBERNATION 451#ifdef CONFIG_HIBERNATION
@@ -1299,4 +1302,23 @@ static inline int lpit_read_residency_count_address(u64 *address)
1299} 1302}
1300#endif 1303#endif
1301 1304
1305#ifdef CONFIG_ACPI_PPTT
1306int find_acpi_cpu_topology(unsigned int cpu, int level);
1307int find_acpi_cpu_topology_package(unsigned int cpu);
1308int find_acpi_cpu_cache_topology(unsigned int cpu, int level);
1309#else
1310static inline int find_acpi_cpu_topology(unsigned int cpu, int level)
1311{
1312 return -EINVAL;
1313}
1314static inline int find_acpi_cpu_topology_package(unsigned int cpu)
1315{
1316 return -EINVAL;
1317}
1318static inline int find_acpi_cpu_cache_topology(unsigned int cpu, int level)
1319{
1320 return -EINVAL;
1321}
1322#endif
1323
1302#endif /*_LINUX_ACPI_H*/ 1324#endif /*_LINUX_ACPI_H*/
diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index a031897fca76..ca1d2cc2cdfa 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -80,6 +80,11 @@
80 ARM_SMCCC_SMC_32, \ 80 ARM_SMCCC_SMC_32, \
81 0, 0x8000) 81 0, 0x8000)
82 82
83#define ARM_SMCCC_ARCH_WORKAROUND_2 \
84 ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
85 ARM_SMCCC_SMC_32, \
86 0, 0x7fff)
87
83#ifndef __ASSEMBLY__ 88#ifndef __ASSEMBLY__
84 89
85#include <linux/linkage.h> 90#include <linux/linkage.h>
@@ -291,5 +296,10 @@ asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1,
291 */ 296 */
292#define arm_smccc_1_1_hvc(...) __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__) 297#define arm_smccc_1_1_hvc(...) __arm_smccc_1_1(SMCCC_HVC_INST, __VA_ARGS__)
293 298
299/* Return codes defined in ARM DEN 0070A */
300#define SMCCC_RET_SUCCESS 0
301#define SMCCC_RET_NOT_SUPPORTED -1
302#define SMCCC_RET_NOT_REQUIRED -2
303
294#endif /*__ASSEMBLY__*/ 304#endif /*__ASSEMBLY__*/
295#endif /*__LINUX_ARM_SMCCC_H*/ 305#endif /*__LINUX_ARM_SMCCC_H*/
diff --git a/include/linux/assoc_array.h b/include/linux/assoc_array.h
index a89df3be1686..65e3832f96b2 100644
--- a/include/linux/assoc_array.h
+++ b/include/linux/assoc_array.h
@@ -1,6 +1,6 @@
1/* Generic associative array implementation. 1/* Generic associative array implementation.
2 * 2 *
3 * See Documentation/assoc_array.txt for information. 3 * See Documentation/core-api/assoc_array.rst for information.
4 * 4 *
5 * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved. 5 * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved.
6 * Written by David Howells (dhowells@redhat.com) 6 * Written by David Howells (dhowells@redhat.com)
diff --git a/include/linux/assoc_array_priv.h b/include/linux/assoc_array_priv.h
index 711275e6681c..a00a06550c10 100644
--- a/include/linux/assoc_array_priv.h
+++ b/include/linux/assoc_array_priv.h
@@ -1,6 +1,6 @@
1/* Private definitions for the generic associative array implementation. 1/* Private definitions for the generic associative array implementation.
2 * 2 *
3 * See Documentation/assoc_array.txt for information. 3 * See Documentation/core-api/assoc_array.rst for information.
4 * 4 *
5 * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved. 5 * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved.
6 * Written by David Howells (dhowells@redhat.com) 6 * Written by David Howells (dhowells@redhat.com)
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 0c27515d2cf6..8124815eb121 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -214,6 +214,7 @@ struct atmphy_ops {
214struct atm_skb_data { 214struct atm_skb_data {
215 struct atm_vcc *vcc; /* ATM VCC */ 215 struct atm_vcc *vcc; /* ATM VCC */
216 unsigned long atm_options; /* ATM layer options */ 216 unsigned long atm_options; /* ATM layer options */
217 unsigned int acct_truesize; /* truesize accounted to vcc */
217}; 218};
218 219
219#define VCC_HTABLE_SIZE 32 220#define VCC_HTABLE_SIZE 32
@@ -241,6 +242,20 @@ void vcc_insert_socket(struct sock *sk);
241 242
242void atm_dev_release_vccs(struct atm_dev *dev); 243void atm_dev_release_vccs(struct atm_dev *dev);
243 244
245static inline void atm_account_tx(struct atm_vcc *vcc, struct sk_buff *skb)
246{
247 /*
248 * Because ATM skbs may not belong to a sock (and we don't
249 * necessarily want to), skb->truesize may be adjusted,
250 * escaping the hack in pskb_expand_head() which avoids
251 * doing so for some cases. So stash the value of truesize
252 * at the time we accounted it, and atm_pop_raw() can use
253 * that value later, in case it changes.
254 */
255 refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
256 ATM_SKB(skb)->acct_truesize = skb->truesize;
257 ATM_SKB(skb)->atm_options = vcc->atm_options;
258}
244 259
245static inline void atm_force_charge(struct atm_vcc *vcc,int truesize) 260static inline void atm_force_charge(struct atm_vcc *vcc,int truesize)
246{ 261{
diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index 0bd432a4d7bd..24251762c20c 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -22,7 +22,6 @@ struct dentry;
22 */ 22 */
23enum wb_state { 23enum wb_state {
24 WB_registered, /* bdi_register() was done */ 24 WB_registered, /* bdi_register() was done */
25 WB_shutting_down, /* wb_shutdown() in progress */
26 WB_writeback_running, /* Writeback is in progress */ 25 WB_writeback_running, /* Writeback is in progress */
27 WB_has_dirty_io, /* Dirty inodes on ->b_{dirty|io|more_io} */ 26 WB_has_dirty_io, /* Dirty inodes on ->b_{dirty|io|more_io} */
28 WB_start_all, /* nr_pages == 0 (all) work pending */ 27 WB_start_all, /* nr_pages == 0 (all) work pending */
@@ -189,6 +188,7 @@ struct backing_dev_info {
189#ifdef CONFIG_CGROUP_WRITEBACK 188#ifdef CONFIG_CGROUP_WRITEBACK
190 struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */ 189 struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */
191 struct rb_root cgwb_congested_tree; /* their congested states */ 190 struct rb_root cgwb_congested_tree; /* their congested states */
191 struct mutex cgwb_release_mutex; /* protect shutdown of wb structs */
192#else 192#else
193 struct bdi_writeback_congested *wb_congested; 193 struct bdi_writeback_congested *wb_congested;
194#endif 194#endif
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index 2baab6f3861d..7fbf0539e14a 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -84,10 +84,6 @@ struct backlight_properties {
84 84
85#define BL_CORE_SUSPENDED (1 << 0) /* backlight is suspended */ 85#define BL_CORE_SUSPENDED (1 << 0) /* backlight is suspended */
86#define BL_CORE_FBBLANK (1 << 1) /* backlight is under an fb blank event */ 86#define BL_CORE_FBBLANK (1 << 1) /* backlight is under an fb blank event */
87#define BL_CORE_DRIVER4 (1 << 28) /* reserved for driver specific use */
88#define BL_CORE_DRIVER3 (1 << 29) /* reserved for driver specific use */
89#define BL_CORE_DRIVER2 (1 << 30) /* reserved for driver specific use */
90#define BL_CORE_DRIVER1 (1 << 31) /* reserved for driver specific use */
91 87
92}; 88};
93 89
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 397a38aca182..f08f5fe7bd08 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -422,6 +422,7 @@ enum {
422extern int bioset_init(struct bio_set *, unsigned int, unsigned int, int flags); 422extern int bioset_init(struct bio_set *, unsigned int, unsigned int, int flags);
423extern void bioset_exit(struct bio_set *); 423extern void bioset_exit(struct bio_set *);
424extern int biovec_init_pool(mempool_t *pool, int pool_entries); 424extern int biovec_init_pool(mempool_t *pool, int pool_entries);
425extern int bioset_init_from_src(struct bio_set *bs, struct bio_set *src);
425 426
426extern struct bio *bio_alloc_bioset(gfp_t, unsigned int, struct bio_set *); 427extern struct bio *bio_alloc_bioset(gfp_t, unsigned int, struct bio_set *);
427extern void bio_put(struct bio *); 428extern void bio_put(struct bio *);
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index fb355173f3c7..e3147eb74222 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -281,8 +281,6 @@ void blk_freeze_queue_start(struct request_queue *q);
281void blk_mq_freeze_queue_wait(struct request_queue *q); 281void blk_mq_freeze_queue_wait(struct request_queue *q);
282int blk_mq_freeze_queue_wait_timeout(struct request_queue *q, 282int blk_mq_freeze_queue_wait_timeout(struct request_queue *q,
283 unsigned long timeout); 283 unsigned long timeout);
284int blk_mq_tagset_iter(struct blk_mq_tag_set *set, void *data,
285 int (reinit_request)(void *, struct request *));
286 284
287int blk_mq_map_queues(struct blk_mq_tag_set *set); 285int blk_mq_map_queues(struct blk_mq_tag_set *set);
288void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues); 286void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index bca3a92eb55f..79226ca8f80f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -127,6 +127,8 @@ typedef __u32 __bitwise req_flags_t;
127#define RQF_ZONE_WRITE_LOCKED ((__force req_flags_t)(1 << 19)) 127#define RQF_ZONE_WRITE_LOCKED ((__force req_flags_t)(1 << 19))
128/* already slept for hybrid poll */ 128/* already slept for hybrid poll */
129#define RQF_MQ_POLL_SLEPT ((__force req_flags_t)(1 << 20)) 129#define RQF_MQ_POLL_SLEPT ((__force req_flags_t)(1 << 20))
130/* ->timeout has been called, don't expire again */
131#define RQF_TIMED_OUT ((__force req_flags_t)(1 << 21))
130 132
131/* flags that prevent us from merging requests: */ 133/* flags that prevent us from merging requests: */
132#define RQF_NOMERGE_FLAGS \ 134#define RQF_NOMERGE_FLAGS \
@@ -560,7 +562,6 @@ struct request_queue {
560 unsigned int dma_alignment; 562 unsigned int dma_alignment;
561 563
562 struct blk_queue_tag *queue_tags; 564 struct blk_queue_tag *queue_tags;
563 struct list_head tag_busy_list;
564 565
565 unsigned int nr_sorted; 566 unsigned int nr_sorted;
566 unsigned int in_flight[2]; 567 unsigned int in_flight[2];
@@ -1118,8 +1119,8 @@ static inline unsigned int blk_max_size_offset(struct request_queue *q,
1118 if (!q->limits.chunk_sectors) 1119 if (!q->limits.chunk_sectors)
1119 return q->limits.max_sectors; 1120 return q->limits.max_sectors;
1120 1121
1121 return q->limits.chunk_sectors - 1122 return min(q->limits.max_sectors, (unsigned int)(q->limits.chunk_sectors -
1122 (offset & (q->limits.chunk_sectors - 1)); 1123 (offset & (q->limits.chunk_sectors - 1))));
1123} 1124}
1124 1125
1125static inline unsigned int blk_rq_get_max_sectors(struct request *rq, 1126static inline unsigned int blk_rq_get_max_sectors(struct request *rq,
@@ -1373,7 +1374,6 @@ extern void blk_queue_end_tag(struct request_queue *, struct request *);
1373extern int blk_queue_init_tags(struct request_queue *, int, struct blk_queue_tag *, int); 1374extern int blk_queue_init_tags(struct request_queue *, int, struct blk_queue_tag *, int);
1374extern void blk_queue_free_tags(struct request_queue *); 1375extern void blk_queue_free_tags(struct request_queue *);
1375extern int blk_queue_resize_tags(struct request_queue *, int); 1376extern int blk_queue_resize_tags(struct request_queue *, int);
1376extern void blk_queue_invalidate_tags(struct request_queue *);
1377extern struct blk_queue_tag *blk_init_tags(int, int); 1377extern struct blk_queue_tag *blk_init_tags(int, int);
1378extern void blk_free_tags(struct blk_queue_tag *); 1378extern void blk_free_tags(struct blk_queue_tag *);
1379 1379
diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h
index 975fb4cf1bb7..79795c5fa7c3 100644
--- a/include/linux/bpf-cgroup.h
+++ b/include/linux/bpf-cgroup.h
@@ -188,12 +188,38 @@ int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor,
188 \ 188 \
189 __ret; \ 189 __ret; \
190}) 190})
191int cgroup_bpf_prog_attach(const union bpf_attr *attr,
192 enum bpf_prog_type ptype, struct bpf_prog *prog);
193int cgroup_bpf_prog_detach(const union bpf_attr *attr,
194 enum bpf_prog_type ptype);
195int cgroup_bpf_prog_query(const union bpf_attr *attr,
196 union bpf_attr __user *uattr);
191#else 197#else
192 198
199struct bpf_prog;
193struct cgroup_bpf {}; 200struct cgroup_bpf {};
194static inline void cgroup_bpf_put(struct cgroup *cgrp) {} 201static inline void cgroup_bpf_put(struct cgroup *cgrp) {}
195static inline int cgroup_bpf_inherit(struct cgroup *cgrp) { return 0; } 202static inline int cgroup_bpf_inherit(struct cgroup *cgrp) { return 0; }
196 203
204static inline int cgroup_bpf_prog_attach(const union bpf_attr *attr,
205 enum bpf_prog_type ptype,
206 struct bpf_prog *prog)
207{
208 return -EINVAL;
209}
210
211static inline int cgroup_bpf_prog_detach(const union bpf_attr *attr,
212 enum bpf_prog_type ptype)
213{
214 return -EINVAL;
215}
216
217static inline int cgroup_bpf_prog_query(const union bpf_attr *attr,
218 union bpf_attr __user *uattr)
219{
220 return -EINVAL;
221}
222
197#define cgroup_bpf_enabled (0) 223#define cgroup_bpf_enabled (0)
198#define BPF_CGROUP_PRE_CONNECT_ENABLED(sk) (0) 224#define BPF_CGROUP_PRE_CONNECT_ENABLED(sk) (0)
199#define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk,skb) ({ 0; }) 225#define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk,skb) ({ 0; })
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 995c3b1e59bf..8827e797ff97 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -488,12 +488,15 @@ void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth);
488 488
489/* Map specifics */ 489/* Map specifics */
490struct xdp_buff; 490struct xdp_buff;
491struct sk_buff;
491 492
492struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key); 493struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key);
493void __dev_map_insert_ctx(struct bpf_map *map, u32 index); 494void __dev_map_insert_ctx(struct bpf_map *map, u32 index);
494void __dev_map_flush(struct bpf_map *map); 495void __dev_map_flush(struct bpf_map *map);
495int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, 496int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,
496 struct net_device *dev_rx); 497 struct net_device *dev_rx);
498int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb,
499 struct bpf_prog *xdp_prog);
497 500
498struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key); 501struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key);
499void __cpu_map_insert_ctx(struct bpf_map *map, u32 index); 502void __cpu_map_insert_ctx(struct bpf_map *map, u32 index);
@@ -586,6 +589,15 @@ int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,
586 return 0; 589 return 0;
587} 590}
588 591
592struct sk_buff;
593
594static inline int dev_map_generic_redirect(struct bpf_dtab_netdev *dst,
595 struct sk_buff *skb,
596 struct bpf_prog *xdp_prog)
597{
598 return 0;
599}
600
589static inline 601static inline
590struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key) 602struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key)
591{ 603{
@@ -684,6 +696,8 @@ static inline void bpf_map_offload_map_free(struct bpf_map *map)
684struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key); 696struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key);
685struct sock *__sock_hash_lookup_elem(struct bpf_map *map, void *key); 697struct sock *__sock_hash_lookup_elem(struct bpf_map *map, void *key);
686int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type); 698int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type);
699int sockmap_get_from_fd(const union bpf_attr *attr, int type,
700 struct bpf_prog *prog);
687#else 701#else
688static inline struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key) 702static inline struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key)
689{ 703{
@@ -702,6 +716,12 @@ static inline int sock_map_prog(struct bpf_map *map,
702{ 716{
703 return -EOPNOTSUPP; 717 return -EOPNOTSUPP;
704} 718}
719
720static inline int sockmap_get_from_fd(const union bpf_attr *attr, int type,
721 struct bpf_prog *prog)
722{
723 return -EINVAL;
724}
705#endif 725#endif
706 726
707#if defined(CONFIG_XDP_SOCKETS) 727#if defined(CONFIG_XDP_SOCKETS)
diff --git a/include/linux/bpf_lirc.h b/include/linux/bpf_lirc.h
index 5f8a4283092d..9d9ff755ec29 100644
--- a/include/linux/bpf_lirc.h
+++ b/include/linux/bpf_lirc.h
@@ -5,11 +5,12 @@
5#include <uapi/linux/bpf.h> 5#include <uapi/linux/bpf.h>
6 6
7#ifdef CONFIG_BPF_LIRC_MODE2 7#ifdef CONFIG_BPF_LIRC_MODE2
8int lirc_prog_attach(const union bpf_attr *attr); 8int lirc_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog);
9int lirc_prog_detach(const union bpf_attr *attr); 9int lirc_prog_detach(const union bpf_attr *attr);
10int lirc_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr); 10int lirc_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr);
11#else 11#else
12static inline int lirc_prog_attach(const union bpf_attr *attr) 12static inline int lirc_prog_attach(const union bpf_attr *attr,
13 struct bpf_prog *prog)
13{ 14{
14 return -EINVAL; 15 return -EINVAL;
15} 16}
diff --git a/include/linux/cacheinfo.h b/include/linux/cacheinfo.h
index 3d9805297cda..70e19bc6cc9f 100644
--- a/include/linux/cacheinfo.h
+++ b/include/linux/cacheinfo.h
@@ -34,9 +34,8 @@ enum cache_type {
34 * @shared_cpu_map: logical cpumask representing all the cpus sharing 34 * @shared_cpu_map: logical cpumask representing all the cpus sharing
35 * this cache node 35 * this cache node
36 * @attributes: bitfield representing various cache attributes 36 * @attributes: bitfield representing various cache attributes
37 * @of_node: if devicetree is used, this represents either the cpu node in 37 * @fw_token: Unique value used to determine if different cacheinfo
38 * case there's no explicit cache node or the cache node itself in the 38 * structures represent a single hardware cache instance.
39 * device tree
40 * @disable_sysfs: indicates whether this node is visible to the user via 39 * @disable_sysfs: indicates whether this node is visible to the user via
41 * sysfs or not 40 * sysfs or not
42 * @priv: pointer to any private data structure specific to particular 41 * @priv: pointer to any private data structure specific to particular
@@ -65,8 +64,7 @@ struct cacheinfo {
65#define CACHE_ALLOCATE_POLICY_MASK \ 64#define CACHE_ALLOCATE_POLICY_MASK \
66 (CACHE_READ_ALLOCATE | CACHE_WRITE_ALLOCATE) 65 (CACHE_READ_ALLOCATE | CACHE_WRITE_ALLOCATE)
67#define CACHE_ID BIT(4) 66#define CACHE_ID BIT(4)
68 67 void *fw_token;
69 struct device_node *of_node;
70 bool disable_sysfs; 68 bool disable_sysfs;
71 void *priv; 69 void *priv;
72}; 70};
@@ -99,6 +97,23 @@ int func(unsigned int cpu) \
99struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu); 97struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu);
100int init_cache_level(unsigned int cpu); 98int init_cache_level(unsigned int cpu);
101int populate_cache_leaves(unsigned int cpu); 99int populate_cache_leaves(unsigned int cpu);
100int cache_setup_acpi(unsigned int cpu);
101#ifndef CONFIG_ACPI_PPTT
102/*
103 * acpi_find_last_cache_level is only called on ACPI enabled
104 * platforms using the PPTT for topology. This means that if
105 * the platform supports other firmware configuration methods
106 * we need to stub out the call when ACPI is disabled.
107 * ACPI enabled platforms not using PPTT won't be making calls
108 * to this function so we need not worry about them.
109 */
110static inline int acpi_find_last_cache_level(unsigned int cpu)
111{
112 return 0;
113}
114#else
115int acpi_find_last_cache_level(unsigned int cpu);
116#endif
102 117
103const struct attribute_group *cache_get_priv_group(struct cacheinfo *this_leaf); 118const struct attribute_group *cache_get_priv_group(struct cacheinfo *this_leaf);
104 119
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index 7ecfc88314d8..4903deb0777a 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -628,6 +628,7 @@ int ceph_flags_to_mode(int flags);
628 CEPH_CAP_XATTR_SHARED) 628 CEPH_CAP_XATTR_SHARED)
629#define CEPH_STAT_CAP_INLINE_DATA (CEPH_CAP_FILE_SHARED | \ 629#define CEPH_STAT_CAP_INLINE_DATA (CEPH_CAP_FILE_SHARED | \
630 CEPH_CAP_FILE_RD) 630 CEPH_CAP_FILE_RD)
631#define CEPH_STAT_RSTAT CEPH_CAP_FILE_WREXTEND
631 632
632#define CEPH_CAP_ANY_SHARED (CEPH_CAP_AUTH_SHARED | \ 633#define CEPH_CAP_ANY_SHARED (CEPH_CAP_AUTH_SHARED | \
633 CEPH_CAP_LINK_SHARED | \ 634 CEPH_CAP_LINK_SHARED | \
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 96bb32285989..0d6ee04b4c41 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -170,6 +170,7 @@ struct ceph_osd_request {
170 u64 r_tid; /* unique for this client */ 170 u64 r_tid; /* unique for this client */
171 struct rb_node r_node; 171 struct rb_node r_node;
172 struct rb_node r_mc_node; /* map check */ 172 struct rb_node r_mc_node; /* map check */
173 struct work_struct r_complete_work;
173 struct ceph_osd *r_osd; 174 struct ceph_osd *r_osd;
174 175
175 struct ceph_osd_request_target r_t; 176 struct ceph_osd_request_target r_t;
@@ -201,7 +202,6 @@ struct ceph_osd_request {
201 struct timespec r_mtime; /* ditto */ 202 struct timespec r_mtime; /* ditto */
202 u64 r_data_offset; /* ditto */ 203 u64 r_data_offset; /* ditto */
203 bool r_linger; /* don't resend on failure */ 204 bool r_linger; /* don't resend on failure */
204 bool r_abort_on_full; /* return ENOSPC when full */
205 205
206 /* internal */ 206 /* internal */
207 unsigned long r_stamp; /* jiffies, send or check time */ 207 unsigned long r_stamp; /* jiffies, send or check time */
@@ -347,6 +347,8 @@ struct ceph_osd_client {
347 struct rb_root linger_map_checks; 347 struct rb_root linger_map_checks;
348 atomic_t num_requests; 348 atomic_t num_requests;
349 atomic_t num_homeless; 349 atomic_t num_homeless;
350 bool abort_on_full; /* abort w/ ENOSPC when full */
351 int abort_err;
350 struct delayed_work timeout_work; 352 struct delayed_work timeout_work;
351 struct delayed_work osds_timeout_work; 353 struct delayed_work osds_timeout_work;
352#ifdef CONFIG_DEBUG_FS 354#ifdef CONFIG_DEBUG_FS
@@ -359,6 +361,7 @@ struct ceph_osd_client {
359 struct ceph_msgpool msgpool_op_reply; 361 struct ceph_msgpool msgpool_op_reply;
360 362
361 struct workqueue_struct *notify_wq; 363 struct workqueue_struct *notify_wq;
364 struct workqueue_struct *completion_wq;
362}; 365};
363 366
364static inline bool ceph_osdmap_flag(struct ceph_osd_client *osdc, int flag) 367static inline bool ceph_osdmap_flag(struct ceph_osd_client *osdc, int flag)
@@ -378,6 +381,7 @@ extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc,
378extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, 381extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc,
379 struct ceph_msg *msg); 382 struct ceph_msg *msg);
380void ceph_osdc_update_epoch_barrier(struct ceph_osd_client *osdc, u32 eb); 383void ceph_osdc_update_epoch_barrier(struct ceph_osd_client *osdc, u32 eb);
384void ceph_osdc_abort_requests(struct ceph_osd_client *osdc, int err);
381 385
382extern void osd_req_op_init(struct ceph_osd_request *osd_req, 386extern void osd_req_op_init(struct ceph_osd_request *osd_req,
383 unsigned int which, u16 opcode, u32 flags); 387 unsigned int which, u16 opcode, u32 flags);
@@ -440,7 +444,7 @@ extern void osd_req_op_cls_response_data_pages(struct ceph_osd_request *,
440 struct page **pages, u64 length, 444 struct page **pages, u64 length,
441 u32 alignment, bool pages_from_pool, 445 u32 alignment, bool pages_from_pool,
442 bool own_pages); 446 bool own_pages);
443extern void osd_req_op_cls_init(struct ceph_osd_request *osd_req, 447extern int osd_req_op_cls_init(struct ceph_osd_request *osd_req,
444 unsigned int which, u16 opcode, 448 unsigned int which, u16 opcode,
445 const char *class, const char *method); 449 const char *class, const char *method);
446extern int osd_req_op_xattr_init(struct ceph_osd_request *osd_req, unsigned int which, 450extern int osd_req_op_xattr_init(struct ceph_osd_request *osd_req, unsigned int which,
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
index e71fb222c7c3..5675b1f09bc5 100644
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -279,10 +279,10 @@ bool ceph_osds_changed(const struct ceph_osds *old_acting,
279 const struct ceph_osds *new_acting, 279 const struct ceph_osds *new_acting,
280 bool any_change); 280 bool any_change);
281 281
282int __ceph_object_locator_to_pg(struct ceph_pg_pool_info *pi, 282void __ceph_object_locator_to_pg(struct ceph_pg_pool_info *pi,
283 const struct ceph_object_id *oid, 283 const struct ceph_object_id *oid,
284 const struct ceph_object_locator *oloc, 284 const struct ceph_object_locator *oloc,
285 struct ceph_pg *raw_pgid); 285 struct ceph_pg *raw_pgid);
286int ceph_object_locator_to_pg(struct ceph_osdmap *osdmap, 286int ceph_object_locator_to_pg(struct ceph_osdmap *osdmap,
287 const struct ceph_object_id *oid, 287 const struct ceph_object_id *oid,
288 const struct ceph_object_locator *oloc, 288 const struct ceph_object_locator *oloc,
diff --git a/include/linux/circ_buf.h b/include/linux/circ_buf.h
index 7cf262a421c3..b3233e8202f9 100644
--- a/include/linux/circ_buf.h
+++ b/include/linux/circ_buf.h
@@ -1,6 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: GPL-2.0 */
2/* 2/*
3 * See Documentation/circular-buffers.txt for more information. 3 * See Documentation/core-api/circular-buffers.rst for more information.
4 */ 4 */
5 5
6#ifndef _LINUX_CIRC_BUF_H 6#ifndef _LINUX_CIRC_BUF_H
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 1d25e149c1c5..b7cfa037e593 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -13,6 +13,7 @@
13 13
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/of.h> 15#include <linux/of.h>
16#include <linux/of_clk.h>
16 17
17#ifdef CONFIG_COMMON_CLK 18#ifdef CONFIG_COMMON_CLK
18 19
@@ -218,7 +219,7 @@ struct clk_ops {
218 int (*get_phase)(struct clk_hw *hw); 219 int (*get_phase)(struct clk_hw *hw);
219 int (*set_phase)(struct clk_hw *hw, int degrees); 220 int (*set_phase)(struct clk_hw *hw, int degrees);
220 void (*init)(struct clk_hw *hw); 221 void (*init)(struct clk_hw *hw);
221 int (*debug_init)(struct clk_hw *hw, struct dentry *dentry); 222 void (*debug_init)(struct clk_hw *hw, struct dentry *dentry);
222}; 223};
223 224
224/** 225/**
@@ -805,8 +806,6 @@ unsigned long clk_hw_round_rate(struct clk_hw *hw, unsigned long rate);
805 806
806struct of_device_id; 807struct of_device_id;
807 808
808typedef void (*of_clk_init_cb_t)(struct device_node *);
809
810struct clk_onecell_data { 809struct clk_onecell_data {
811 struct clk **clks; 810 struct clk **clks;
812 unsigned int clk_num; 811 unsigned int clk_num;
@@ -893,13 +892,10 @@ struct clk_hw *of_clk_hw_simple_get(struct of_phandle_args *clkspec,
893struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); 892struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
894struct clk_hw *of_clk_hw_onecell_get(struct of_phandle_args *clkspec, 893struct clk_hw *of_clk_hw_onecell_get(struct of_phandle_args *clkspec,
895 void *data); 894 void *data);
896unsigned int of_clk_get_parent_count(struct device_node *np);
897int of_clk_parent_fill(struct device_node *np, const char **parents, 895int of_clk_parent_fill(struct device_node *np, const char **parents,
898 unsigned int size); 896 unsigned int size);
899const char *of_clk_get_parent_name(struct device_node *np, int index);
900int of_clk_detect_critical(struct device_node *np, int index, 897int of_clk_detect_critical(struct device_node *np, int index,
901 unsigned long *flags); 898 unsigned long *flags);
902void of_clk_init(const struct of_device_id *matches);
903 899
904#else /* !CONFIG_OF */ 900#else /* !CONFIG_OF */
905 901
@@ -946,26 +942,16 @@ of_clk_hw_onecell_get(struct of_phandle_args *clkspec, void *data)
946{ 942{
947 return ERR_PTR(-ENOENT); 943 return ERR_PTR(-ENOENT);
948} 944}
949static inline unsigned int of_clk_get_parent_count(struct device_node *np)
950{
951 return 0;
952}
953static inline int of_clk_parent_fill(struct device_node *np, 945static inline int of_clk_parent_fill(struct device_node *np,
954 const char **parents, unsigned int size) 946 const char **parents, unsigned int size)
955{ 947{
956 return 0; 948 return 0;
957} 949}
958static inline const char *of_clk_get_parent_name(struct device_node *np,
959 int index)
960{
961 return NULL;
962}
963static inline int of_clk_detect_critical(struct device_node *np, int index, 950static inline int of_clk_detect_critical(struct device_node *np, int index,
964 unsigned long *flags) 951 unsigned long *flags)
965{ 952{
966 return 0; 953 return 0;
967} 954}
968static inline void of_clk_init(const struct of_device_id *matches) {}
969#endif /* CONFIG_OF */ 955#endif /* CONFIG_OF */
970 956
971/* 957/*
@@ -999,10 +985,5 @@ static inline void clk_writel(u32 val, u32 __iomem *reg)
999 985
1000#endif /* platform dependent I/O accessors */ 986#endif /* platform dependent I/O accessors */
1001 987
1002#ifdef CONFIG_DEBUG_FS
1003struct dentry *clk_debugfs_add_file(struct clk_hw *hw, char *name, umode_t mode,
1004 void *data, const struct file_operations *fops);
1005#endif
1006
1007#endif /* CONFIG_COMMON_CLK */ 988#endif /* CONFIG_COMMON_CLK */
1008#endif /* CLK_PROVIDER_H */ 989#endif /* CLK_PROVIDER_H */
diff --git a/include/linux/clk/davinci.h b/include/linux/clk/davinci.h
new file mode 100644
index 000000000000..8a7b5cd7eac0
--- /dev/null
+++ b/include/linux/clk/davinci.h
@@ -0,0 +1,40 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Clock drivers for TI DaVinci PLL and PSC controllers
4 *
5 * Copyright (C) 2018 David Lechner <david@lechnology.com>
6 */
7
8#ifndef __LINUX_CLK_DAVINCI_PLL_H___
9#define __LINUX_CLK_DAVINCI_PLL_H___
10
11#include <linux/device.h>
12#include <linux/regmap.h>
13
14/* function for registering clocks in early boot */
15
16#ifdef CONFIG_ARCH_DAVINCI_DA830
17int da830_pll_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
18#endif
19#ifdef CONFIG_ARCH_DAVINCI_DA850
20int da850_pll0_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
21#endif
22#ifdef CONFIG_ARCH_DAVINCI_DM355
23int dm355_pll1_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
24int dm355_psc_init(struct device *dev, void __iomem *base);
25#endif
26#ifdef CONFIG_ARCH_DAVINCI_DM365
27int dm365_pll1_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
28int dm365_pll2_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
29int dm365_psc_init(struct device *dev, void __iomem *base);
30#endif
31#ifdef CONFIG_ARCH_DAVINCI_DM644x
32int dm644x_pll1_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
33int dm644x_psc_init(struct device *dev, void __iomem *base);
34#endif
35#ifdef CONFIG_ARCH_DAVINCI_DM646x
36int dm646x_pll1_init(struct device *dev, void __iomem *base, struct regmap *cfgchip);
37int dm646x_psc_init(struct device *dev, void __iomem *base);
38#endif
39
40#endif /* __LINUX_CLK_DAVINCI_PLL_H___ */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index b1a5562b3215..c68acc47da57 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -72,6 +72,9 @@
72 */ 72 */
73#ifndef COMPAT_SYSCALL_DEFINEx 73#ifndef COMPAT_SYSCALL_DEFINEx
74#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ 74#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
75 __diag_push(); \
76 __diag_ignore(GCC, 8, "-Wattribute-alias", \
77 "Type aliasing is used to sanitize syscall arguments");\
75 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ 78 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
76 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ 79 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
77 __attribute__((alias(__stringify(__se_compat_sys##name)))); \ 80 __attribute__((alias(__stringify(__se_compat_sys##name)))); \
@@ -80,8 +83,11 @@
80 asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \ 83 asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
81 asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ 84 asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
82 { \ 85 { \
83 return __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\ 86 long ret = __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\
87 __MAP(x,__SC_TEST,__VA_ARGS__); \
88 return ret; \
84 } \ 89 } \
90 __diag_pop(); \
85 static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) 91 static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
86#endif /* COMPAT_SYSCALL_DEFINEx */ 92#endif /* COMPAT_SYSCALL_DEFINEx */
87 93
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index f1a7492a5cc8..573f5a7d42d4 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -66,25 +66,40 @@
66#endif 66#endif
67 67
68/* 68/*
69 * Feature detection for gnu_inline (gnu89 extern inline semantics). Either
70 * __GNUC_STDC_INLINE__ is defined (not using gnu89 extern inline semantics,
71 * and we opt in to the gnu89 semantics), or __GNUC_STDC_INLINE__ is not
72 * defined so the gnu89 semantics are the default.
73 */
74#ifdef __GNUC_STDC_INLINE__
75# define __gnu_inline __attribute__((gnu_inline))
76#else
77# define __gnu_inline
78#endif
79
80/*
69 * Force always-inline if the user requests it so via the .config, 81 * Force always-inline if the user requests it so via the .config,
70 * or if gcc is too old. 82 * or if gcc is too old.
71 * GCC does not warn about unused static inline functions for 83 * GCC does not warn about unused static inline functions for
72 * -Wunused-function. This turns out to avoid the need for complex #ifdef 84 * -Wunused-function. This turns out to avoid the need for complex #ifdef
73 * directives. Suppress the warning in clang as well by using "unused" 85 * directives. Suppress the warning in clang as well by using "unused"
74 * function attribute, which is redundant but not harmful for gcc. 86 * function attribute, which is redundant but not harmful for gcc.
87 * Prefer gnu_inline, so that extern inline functions do not emit an
88 * externally visible function. This makes extern inline behave as per gnu89
89 * semantics rather than c99. This prevents multiple symbol definition errors
90 * of extern inline functions at link time.
91 * A lot of inline functions can cause havoc with function tracing.
75 */ 92 */
76#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ 93#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
77 !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) 94 !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
78#define inline inline __attribute__((always_inline,unused)) notrace 95#define inline \
79#define __inline__ __inline__ __attribute__((always_inline,unused)) notrace 96 inline __attribute__((always_inline, unused)) notrace __gnu_inline
80#define __inline __inline __attribute__((always_inline,unused)) notrace
81#else 97#else
82/* A lot of inline functions can cause havoc with function tracing */ 98#define inline inline __attribute__((unused)) notrace __gnu_inline
83#define inline inline __attribute__((unused)) notrace
84#define __inline__ __inline__ __attribute__((unused)) notrace
85#define __inline __inline __attribute__((unused)) notrace
86#endif 99#endif
87 100
101#define __inline__ inline
102#define __inline inline
88#define __always_inline inline __attribute__((always_inline)) 103#define __always_inline inline __attribute__((always_inline))
89#define noinline __attribute__((noinline)) 104#define noinline __attribute__((noinline))
90 105
@@ -347,3 +362,28 @@
347#if GCC_VERSION >= 50100 362#if GCC_VERSION >= 50100
348#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1 363#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
349#endif 364#endif
365
366/*
367 * Turn individual warnings and errors on and off locally, depending
368 * on version.
369 */
370#define __diag_GCC(version, severity, s) \
371 __diag_GCC_ ## version(__diag_GCC_ ## severity s)
372
373/* Severity used in pragma directives */
374#define __diag_GCC_ignore ignored
375#define __diag_GCC_warn warning
376#define __diag_GCC_error error
377
378/* Compilers before gcc-4.6 do not understand "#pragma GCC diagnostic push" */
379#if GCC_VERSION >= 40600
380#define __diag_str1(s) #s
381#define __diag_str(s) __diag_str1(s)
382#define __diag(s) _Pragma(__diag_str(GCC diagnostic s))
383#endif
384
385#if GCC_VERSION >= 80000
386#define __diag_GCC_8(s) __diag(s)
387#else
388#define __diag_GCC_8(s)
389#endif
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 6b79a9bba9a7..a8ba6b04152c 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -271,4 +271,22 @@ struct ftrace_likely_data {
271# define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) 271# define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
272#endif 272#endif
273 273
274#ifndef __diag
275#define __diag(string)
276#endif
277
278#ifndef __diag_GCC
279#define __diag_GCC(version, severity, string)
280#endif
281
282#define __diag_push() __diag(push)
283#define __diag_pop() __diag(pop)
284
285#define __diag_ignore(compiler, version, option, comment) \
286 __diag_ ## compiler(version, ignore, option)
287#define __diag_warn(compiler, version, option, comment) \
288 __diag_ ## compiler(version, warn, option)
289#define __diag_error(compiler, version, option, comment) \
290 __diag_ ## compiler(version, error, option)
291
274#endif /* __LINUX_COMPILER_TYPES_H */ 292#endif /* __LINUX_COMPILER_TYPES_H */
diff --git a/include/linux/dax.h b/include/linux/dax.h
index 88504e87cd6c..deb0f663252f 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -20,6 +20,9 @@ struct dax_operations {
20 /* copy_from_iter: required operation for fs-dax direct-i/o */ 20 /* copy_from_iter: required operation for fs-dax direct-i/o */
21 size_t (*copy_from_iter)(struct dax_device *, pgoff_t, void *, size_t, 21 size_t (*copy_from_iter)(struct dax_device *, pgoff_t, void *, size_t,
22 struct iov_iter *); 22 struct iov_iter *);
23 /* copy_to_iter: required operation for fs-dax direct-i/o */
24 size_t (*copy_to_iter)(struct dax_device *, pgoff_t, void *, size_t,
25 struct iov_iter *);
23}; 26};
24 27
25extern struct attribute_group dax_attribute_group; 28extern struct attribute_group dax_attribute_group;
@@ -83,6 +86,8 @@ static inline void fs_put_dax(struct dax_device *dax_dev)
83struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev); 86struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev);
84int dax_writeback_mapping_range(struct address_space *mapping, 87int dax_writeback_mapping_range(struct address_space *mapping,
85 struct block_device *bdev, struct writeback_control *wbc); 88 struct block_device *bdev, struct writeback_control *wbc);
89
90struct page *dax_layout_busy_page(struct address_space *mapping);
86#else 91#else
87static inline bool bdev_dax_supported(struct block_device *bdev, 92static inline bool bdev_dax_supported(struct block_device *bdev,
88 int blocksize) 93 int blocksize)
@@ -104,6 +109,11 @@ static inline struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev)
104 return NULL; 109 return NULL;
105} 110}
106 111
112static inline struct page *dax_layout_busy_page(struct address_space *mapping)
113{
114 return NULL;
115}
116
107static inline int dax_writeback_mapping_range(struct address_space *mapping, 117static inline int dax_writeback_mapping_range(struct address_space *mapping,
108 struct block_device *bdev, struct writeback_control *wbc) 118 struct block_device *bdev, struct writeback_control *wbc)
109{ 119{
@@ -119,11 +129,13 @@ long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
119 void **kaddr, pfn_t *pfn); 129 void **kaddr, pfn_t *pfn);
120size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, 130size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
121 size_t bytes, struct iov_iter *i); 131 size_t bytes, struct iov_iter *i);
132size_t dax_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
133 size_t bytes, struct iov_iter *i);
122void dax_flush(struct dax_device *dax_dev, void *addr, size_t size); 134void dax_flush(struct dax_device *dax_dev, void *addr, size_t size);
123 135
124ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, 136ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
125 const struct iomap_ops *ops); 137 const struct iomap_ops *ops);
126int dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size, 138vm_fault_t dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size,
127 pfn_t *pfnp, int *errp, const struct iomap_ops *ops); 139 pfn_t *pfnp, int *errp, const struct iomap_ops *ops);
128vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf, 140vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf,
129 enum page_entry_size pe_size, pfn_t pfn); 141 enum page_entry_size pe_size, pfn_t pfn);
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 31fef7c34185..6fb0808e87c8 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -133,7 +133,7 @@ typedef int (*dm_busy_fn) (struct dm_target *ti);
133 */ 133 */
134typedef long (*dm_dax_direct_access_fn) (struct dm_target *ti, pgoff_t pgoff, 134typedef long (*dm_dax_direct_access_fn) (struct dm_target *ti, pgoff_t pgoff,
135 long nr_pages, void **kaddr, pfn_t *pfn); 135 long nr_pages, void **kaddr, pfn_t *pfn);
136typedef size_t (*dm_dax_copy_from_iter_fn)(struct dm_target *ti, pgoff_t pgoff, 136typedef size_t (*dm_dax_copy_iter_fn)(struct dm_target *ti, pgoff_t pgoff,
137 void *addr, size_t bytes, struct iov_iter *i); 137 void *addr, size_t bytes, struct iov_iter *i);
138#define PAGE_SECTORS (PAGE_SIZE / 512) 138#define PAGE_SECTORS (PAGE_SIZE / 512)
139 139
@@ -184,7 +184,8 @@ struct target_type {
184 dm_iterate_devices_fn iterate_devices; 184 dm_iterate_devices_fn iterate_devices;
185 dm_io_hints_fn io_hints; 185 dm_io_hints_fn io_hints;
186 dm_dax_direct_access_fn direct_access; 186 dm_dax_direct_access_fn direct_access;
187 dm_dax_copy_from_iter_fn dax_copy_from_iter; 187 dm_dax_copy_iter_fn dax_copy_from_iter;
188 dm_dax_copy_iter_fn dax_copy_to_iter;
188 189
189 /* For internal device-mapper use. */ 190 /* For internal device-mapper use. */
190 struct list_head list; 191 struct list_head list;
diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h
index b67bf6ac907d..3c5a4cb3eb95 100644
--- a/include/linux/dma-contiguous.h
+++ b/include/linux/dma-contiguous.h
@@ -48,7 +48,7 @@
48 * CMA should not be used by the device drivers directly. It is 48 * CMA should not be used by the device drivers directly. It is
49 * only a helper framework for dma-mapping subsystem. 49 * only a helper framework for dma-mapping subsystem.
50 * 50 *
51 * For more information, see kernel-docs in drivers/base/dma-contiguous.c 51 * For more information, see kernel-docs in kernel/dma/contiguous.c
52 */ 52 */
53 53
54#ifdef __KERNEL__ 54#ifdef __KERNEL__
diff --git a/include/linux/dma/sprd-dma.h b/include/linux/dma/sprd-dma.h
new file mode 100644
index 000000000000..b0115e340fbc
--- /dev/null
+++ b/include/linux/dma/sprd-dma.h
@@ -0,0 +1,61 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef _SPRD_DMA_H_
4#define _SPRD_DMA_H_
5
6#define SPRD_DMA_REQ_SHIFT 16
7#define SPRD_DMA_FLAGS(req_mode, int_type) \
8 ((req_mode) << SPRD_DMA_REQ_SHIFT | (int_type))
9
10/*
11 * enum sprd_dma_req_mode: define the DMA request mode
12 * @SPRD_DMA_FRAG_REQ: fragment request mode
13 * @SPRD_DMA_BLK_REQ: block request mode
14 * @SPRD_DMA_TRANS_REQ: transaction request mode
15 * @SPRD_DMA_LIST_REQ: link-list request mode
16 *
17 * We have 4 types request mode: fragment mode, block mode, transaction mode
18 * and linklist mode. One transaction can contain several blocks, one block can
19 * contain several fragments. Link-list mode means we can save several DMA
20 * configuration into one reserved memory, then DMA can fetch each DMA
21 * configuration automatically to start transfer.
22 */
23enum sprd_dma_req_mode {
24 SPRD_DMA_FRAG_REQ,
25 SPRD_DMA_BLK_REQ,
26 SPRD_DMA_TRANS_REQ,
27 SPRD_DMA_LIST_REQ,
28};
29
30/*
31 * enum sprd_dma_int_type: define the DMA interrupt type
32 * @SPRD_DMA_NO_INT: do not need generate DMA interrupts.
33 * @SPRD_DMA_FRAG_INT: fragment done interrupt when one fragment request
34 * is done.
35 * @SPRD_DMA_BLK_INT: block done interrupt when one block request is done.
36 * @SPRD_DMA_BLK_FRAG_INT: block and fragment interrupt when one fragment
37 * or one block request is done.
38 * @SPRD_DMA_TRANS_INT: tansaction done interrupt when one transaction
39 * request is done.
40 * @SPRD_DMA_TRANS_FRAG_INT: transaction and fragment interrupt when one
41 * transaction request or fragment request is done.
42 * @SPRD_DMA_TRANS_BLK_INT: transaction and block interrupt when one
43 * transaction request or block request is done.
44 * @SPRD_DMA_LIST_INT: link-list done interrupt when one link-list request
45 * is done.
46 * @SPRD_DMA_CFGERR_INT: configure error interrupt when configuration is
47 * incorrect.
48 */
49enum sprd_dma_int_type {
50 SPRD_DMA_NO_INT,
51 SPRD_DMA_FRAG_INT,
52 SPRD_DMA_BLK_INT,
53 SPRD_DMA_BLK_FRAG_INT,
54 SPRD_DMA_TRANS_INT,
55 SPRD_DMA_TRANS_FRAG_INT,
56 SPRD_DMA_TRANS_BLK_INT,
57 SPRD_DMA_LIST_INT,
58 SPRD_DMA_CFGERR_INT,
59};
60
61#endif
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 45fc0f5000d8..300baad62c88 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -19,6 +19,7 @@
19#include <linux/cryptohash.h> 19#include <linux/cryptohash.h>
20#include <linux/set_memory.h> 20#include <linux/set_memory.h>
21#include <linux/kallsyms.h> 21#include <linux/kallsyms.h>
22#include <linux/if_vlan.h>
22 23
23#include <net/sch_generic.h> 24#include <net/sch_generic.h>
24 25
@@ -469,15 +470,16 @@ struct sock_fprog_kern {
469}; 470};
470 471
471struct bpf_binary_header { 472struct bpf_binary_header {
472 unsigned int pages; 473 u32 pages;
473 u8 image[]; 474 /* Some arches need word alignment for their instructions */
475 u8 image[] __aligned(4);
474}; 476};
475 477
476struct bpf_prog { 478struct bpf_prog {
477 u16 pages; /* Number of allocated pages */ 479 u16 pages; /* Number of allocated pages */
478 u16 jited:1, /* Is our filter JIT'ed? */ 480 u16 jited:1, /* Is our filter JIT'ed? */
479 jit_requested:1,/* archs need to JIT the prog */ 481 jit_requested:1,/* archs need to JIT the prog */
480 locked:1, /* Program image locked? */ 482 undo_set_mem:1, /* Passed set_memory_ro() checkpoint */
481 gpl_compatible:1, /* Is filter GPL compatible? */ 483 gpl_compatible:1, /* Is filter GPL compatible? */
482 cb_access:1, /* Is control block accessed? */ 484 cb_access:1, /* Is control block accessed? */
483 dst_needed:1, /* Do we need dst entry? */ 485 dst_needed:1, /* Do we need dst entry? */
@@ -671,50 +673,27 @@ bpf_ctx_narrow_access_ok(u32 off, u32 size, u32 size_default)
671 673
672#define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0])) 674#define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0]))
673 675
674#ifdef CONFIG_ARCH_HAS_SET_MEMORY
675static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
676{
677 fp->locked = 1;
678 WARN_ON_ONCE(set_memory_ro((unsigned long)fp, fp->pages));
679}
680
681static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
682{
683 if (fp->locked) {
684 WARN_ON_ONCE(set_memory_rw((unsigned long)fp, fp->pages));
685 /* In case set_memory_rw() fails, we want to be the first
686 * to crash here instead of some random place later on.
687 */
688 fp->locked = 0;
689 }
690}
691
692static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr)
693{
694 WARN_ON_ONCE(set_memory_ro((unsigned long)hdr, hdr->pages));
695}
696
697static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr)
698{
699 WARN_ON_ONCE(set_memory_rw((unsigned long)hdr, hdr->pages));
700}
701#else
702static inline void bpf_prog_lock_ro(struct bpf_prog *fp) 676static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
703{ 677{
678 fp->undo_set_mem = 1;
679 set_memory_ro((unsigned long)fp, fp->pages);
704} 680}
705 681
706static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) 682static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
707{ 683{
684 if (fp->undo_set_mem)
685 set_memory_rw((unsigned long)fp, fp->pages);
708} 686}
709 687
710static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr) 688static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr)
711{ 689{
690 set_memory_ro((unsigned long)hdr, hdr->pages);
712} 691}
713 692
714static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr) 693static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr)
715{ 694{
695 set_memory_rw((unsigned long)hdr, hdr->pages);
716} 696}
717#endif /* CONFIG_ARCH_HAS_SET_MEMORY */
718 697
719static inline struct bpf_binary_header * 698static inline struct bpf_binary_header *
720bpf_jit_binary_hdr(const struct bpf_prog *fp) 699bpf_jit_binary_hdr(const struct bpf_prog *fp)
@@ -786,6 +765,21 @@ static inline bool bpf_dump_raw_ok(void)
786struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, 765struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off,
787 const struct bpf_insn *patch, u32 len); 766 const struct bpf_insn *patch, u32 len);
788 767
768static inline int __xdp_generic_ok_fwd_dev(struct sk_buff *skb,
769 struct net_device *fwd)
770{
771 unsigned int len;
772
773 if (unlikely(!(fwd->flags & IFF_UP)))
774 return -ENETDOWN;
775
776 len = fwd->mtu + fwd->hard_header_len + VLAN_HLEN;
777 if (skb->len > len)
778 return -EMSGSIZE;
779
780 return 0;
781}
782
789/* The pair of xdp_do_redirect and xdp_do_flush_map MUST be called in the 783/* The pair of xdp_do_redirect and xdp_do_flush_map MUST be called in the
790 * same cpu context. Further for best results no more than a single map 784 * same cpu context. Further for best results no more than a single map
791 * for the do_redirect/do_flush pair should be used. This limitation is 785 * for the do_redirect/do_flush pair should be used. This limitation is
@@ -961,6 +955,9 @@ static inline void bpf_prog_kallsyms_del(struct bpf_prog *fp)
961} 955}
962#endif /* CONFIG_BPF_JIT */ 956#endif /* CONFIG_BPF_JIT */
963 957
958void bpf_prog_kallsyms_del_subprogs(struct bpf_prog *fp);
959void bpf_prog_kallsyms_del_all(struct bpf_prog *fp);
960
964#define BPF_ANC BIT(15) 961#define BPF_ANC BIT(15)
965 962
966static inline bool bpf_needs_clear_a(const struct sock_filter *first) 963static inline bool bpf_needs_clear_a(const struct sock_filter *first)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7207de8c4e9a..d78d146a98da 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -207,9 +207,9 @@ struct iattr {
207 kuid_t ia_uid; 207 kuid_t ia_uid;
208 kgid_t ia_gid; 208 kgid_t ia_gid;
209 loff_t ia_size; 209 loff_t ia_size;
210 struct timespec ia_atime; 210 struct timespec64 ia_atime;
211 struct timespec ia_mtime; 211 struct timespec64 ia_mtime;
212 struct timespec ia_ctime; 212 struct timespec64 ia_ctime;
213 213
214 /* 214 /*
215 * Not an attribute, but an auxiliary info for filesystems wanting to 215 * Not an attribute, but an auxiliary info for filesystems wanting to
@@ -604,9 +604,9 @@ struct inode {
604 }; 604 };
605 dev_t i_rdev; 605 dev_t i_rdev;
606 loff_t i_size; 606 loff_t i_size;
607 struct timespec i_atime; 607 struct timespec64 i_atime;
608 struct timespec i_mtime; 608 struct timespec64 i_mtime;
609 struct timespec i_ctime; 609 struct timespec64 i_ctime;
610 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 610 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
611 unsigned short i_bytes; 611 unsigned short i_bytes;
612 unsigned int i_blkbits; 612 unsigned int i_blkbits;
@@ -1093,7 +1093,7 @@ extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct
1093extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); 1093extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
1094extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl); 1094extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl);
1095extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type); 1095extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);
1096extern void lease_get_mtime(struct inode *, struct timespec *time); 1096extern void lease_get_mtime(struct inode *, struct timespec64 *time);
1097extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); 1097extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
1098extern int vfs_setlease(struct file *, long, struct file_lock **, void **); 1098extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
1099extern int lease_modify(struct file_lock *, int, struct list_head *); 1099extern int lease_modify(struct file_lock *, int, struct list_head *);
@@ -1208,7 +1208,8 @@ static inline int __break_lease(struct inode *inode, unsigned int mode, unsigned
1208 return 0; 1208 return 0;
1209} 1209}
1210 1210
1211static inline void lease_get_mtime(struct inode *inode, struct timespec *time) 1211static inline void lease_get_mtime(struct inode *inode,
1212 struct timespec64 *time)
1212{ 1213{
1213 return; 1214 return;
1214} 1215}
@@ -1478,7 +1479,8 @@ static inline void i_gid_write(struct inode *inode, gid_t gid)
1478 inode->i_gid = make_kgid(inode->i_sb->s_user_ns, gid); 1479 inode->i_gid = make_kgid(inode->i_sb->s_user_ns, gid);
1479} 1480}
1480 1481
1481extern struct timespec current_time(struct inode *inode); 1482extern struct timespec64 timespec64_trunc(struct timespec64 t, unsigned gran);
1483extern struct timespec64 current_time(struct inode *inode);
1482 1484
1483/* 1485/*
1484 * Snapshotting support. 1486 * Snapshotting support.
@@ -1718,8 +1720,6 @@ struct file_operations {
1718 int (*iterate) (struct file *, struct dir_context *); 1720 int (*iterate) (struct file *, struct dir_context *);
1719 int (*iterate_shared) (struct file *, struct dir_context *); 1721 int (*iterate_shared) (struct file *, struct dir_context *);
1720 __poll_t (*poll) (struct file *, struct poll_table_struct *); 1722 __poll_t (*poll) (struct file *, struct poll_table_struct *);
1721 struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t);
1722 __poll_t (*poll_mask) (struct file *, __poll_t);
1723 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 1723 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
1724 long (*compat_ioctl) (struct file *, unsigned int, unsigned long); 1724 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
1725 int (*mmap) (struct file *, struct vm_area_struct *); 1725 int (*mmap) (struct file *, struct vm_area_struct *);
@@ -1773,7 +1773,7 @@ struct inode_operations {
1773 ssize_t (*listxattr) (struct dentry *, char *, size_t); 1773 ssize_t (*listxattr) (struct dentry *, char *, size_t);
1774 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, 1774 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
1775 u64 len); 1775 u64 len);
1776 int (*update_time)(struct inode *, struct timespec *, int); 1776 int (*update_time)(struct inode *, struct timespec64 *, int);
1777 int (*atomic_open)(struct inode *, struct dentry *, 1777 int (*atomic_open)(struct inode *, struct dentry *,
1778 struct file *, unsigned open_flag, 1778 struct file *, unsigned open_flag,
1779 umode_t create_mode, int *opened); 1779 umode_t create_mode, int *opened);
@@ -2217,7 +2217,7 @@ extern int current_umask(void);
2217 2217
2218extern void ihold(struct inode * inode); 2218extern void ihold(struct inode * inode);
2219extern void iput(struct inode *); 2219extern void iput(struct inode *);
2220extern int generic_update_time(struct inode *, struct timespec *, int); 2220extern int generic_update_time(struct inode *, struct timespec64 *, int);
2221 2221
2222/* /sys/fs */ 2222/* /sys/fs */
2223extern struct kobject *fs_kobj; 2223extern struct kobject *fs_kobj;
diff --git a/include/linux/fscrypt_notsupp.h b/include/linux/fscrypt_notsupp.h
index 25b6492de6e5..ee8b43e4c15a 100644
--- a/include/linux/fscrypt_notsupp.h
+++ b/include/linux/fscrypt_notsupp.h
@@ -25,6 +25,10 @@ static inline bool fscrypt_dummy_context_enabled(struct inode *inode)
25} 25}
26 26
27/* crypto.c */ 27/* crypto.c */
28static inline void fscrypt_enqueue_decrypt_work(struct work_struct *work)
29{
30}
31
28static inline struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode, 32static inline struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *inode,
29 gfp_t gfp_flags) 33 gfp_t gfp_flags)
30{ 34{
@@ -150,10 +154,13 @@ static inline bool fscrypt_match_name(const struct fscrypt_name *fname,
150} 154}
151 155
152/* bio.c */ 156/* bio.c */
153static inline void fscrypt_decrypt_bio_pages(struct fscrypt_ctx *ctx, 157static inline void fscrypt_decrypt_bio(struct bio *bio)
154 struct bio *bio) 158{
159}
160
161static inline void fscrypt_enqueue_decrypt_bio(struct fscrypt_ctx *ctx,
162 struct bio *bio)
155{ 163{
156 return;
157} 164}
158 165
159static inline void fscrypt_pullback_bio_page(struct page **page, bool restore) 166static inline void fscrypt_pullback_bio_page(struct page **page, bool restore)
diff --git a/include/linux/fscrypt_supp.h b/include/linux/fscrypt_supp.h
index 5080cb1bec4c..6456c6b2005f 100644
--- a/include/linux/fscrypt_supp.h
+++ b/include/linux/fscrypt_supp.h
@@ -59,6 +59,7 @@ static inline bool fscrypt_dummy_context_enabled(struct inode *inode)
59} 59}
60 60
61/* crypto.c */ 61/* crypto.c */
62extern void fscrypt_enqueue_decrypt_work(struct work_struct *);
62extern struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *, gfp_t); 63extern struct fscrypt_ctx *fscrypt_get_ctx(const struct inode *, gfp_t);
63extern void fscrypt_release_ctx(struct fscrypt_ctx *); 64extern void fscrypt_release_ctx(struct fscrypt_ctx *);
64extern struct page *fscrypt_encrypt_page(const struct inode *, struct page *, 65extern struct page *fscrypt_encrypt_page(const struct inode *, struct page *,
@@ -174,7 +175,9 @@ static inline bool fscrypt_match_name(const struct fscrypt_name *fname,
174} 175}
175 176
176/* bio.c */ 177/* bio.c */
177extern void fscrypt_decrypt_bio_pages(struct fscrypt_ctx *, struct bio *); 178extern void fscrypt_decrypt_bio(struct bio *);
179extern void fscrypt_enqueue_decrypt_bio(struct fscrypt_ctx *ctx,
180 struct bio *bio);
178extern void fscrypt_pullback_bio_page(struct page **, bool); 181extern void fscrypt_pullback_bio_page(struct page **, bool);
179extern int fscrypt_zeroout_range(const struct inode *, pgoff_t, sector_t, 182extern int fscrypt_zeroout_range(const struct inode *, pgoff_t, sector_t,
180 unsigned int); 183 unsigned int);
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index e64c0294f50b..b38964a7a521 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -98,8 +98,6 @@ struct fsnotify_iter_info;
98struct fsnotify_ops { 98struct fsnotify_ops {
99 int (*handle_event)(struct fsnotify_group *group, 99 int (*handle_event)(struct fsnotify_group *group,
100 struct inode *inode, 100 struct inode *inode,
101 struct fsnotify_mark *inode_mark,
102 struct fsnotify_mark *vfsmount_mark,
103 u32 mask, const void *data, int data_type, 101 u32 mask, const void *data, int data_type,
104 const unsigned char *file_name, u32 cookie, 102 const unsigned char *file_name, u32 cookie,
105 struct fsnotify_iter_info *iter_info); 103 struct fsnotify_iter_info *iter_info);
@@ -201,6 +199,57 @@ struct fsnotify_group {
201#define FSNOTIFY_EVENT_PATH 1 199#define FSNOTIFY_EVENT_PATH 1
202#define FSNOTIFY_EVENT_INODE 2 200#define FSNOTIFY_EVENT_INODE 2
203 201
202enum fsnotify_obj_type {
203 FSNOTIFY_OBJ_TYPE_INODE,
204 FSNOTIFY_OBJ_TYPE_VFSMOUNT,
205 FSNOTIFY_OBJ_TYPE_COUNT,
206 FSNOTIFY_OBJ_TYPE_DETACHED = FSNOTIFY_OBJ_TYPE_COUNT
207};
208
209#define FSNOTIFY_OBJ_TYPE_INODE_FL (1U << FSNOTIFY_OBJ_TYPE_INODE)
210#define FSNOTIFY_OBJ_TYPE_VFSMOUNT_FL (1U << FSNOTIFY_OBJ_TYPE_VFSMOUNT)
211#define FSNOTIFY_OBJ_ALL_TYPES_MASK ((1U << FSNOTIFY_OBJ_TYPE_COUNT) - 1)
212
213struct fsnotify_iter_info {
214 struct fsnotify_mark *marks[FSNOTIFY_OBJ_TYPE_COUNT];
215 unsigned int report_mask;
216 int srcu_idx;
217};
218
219static inline bool fsnotify_iter_should_report_type(
220 struct fsnotify_iter_info *iter_info, int type)
221{
222 return (iter_info->report_mask & (1U << type));
223}
224
225static inline void fsnotify_iter_set_report_type(
226 struct fsnotify_iter_info *iter_info, int type)
227{
228 iter_info->report_mask |= (1U << type);
229}
230
231static inline void fsnotify_iter_set_report_type_mark(
232 struct fsnotify_iter_info *iter_info, int type,
233 struct fsnotify_mark *mark)
234{
235 iter_info->marks[type] = mark;
236 iter_info->report_mask |= (1U << type);
237}
238
239#define FSNOTIFY_ITER_FUNCS(name, NAME) \
240static inline struct fsnotify_mark *fsnotify_iter_##name##_mark( \
241 struct fsnotify_iter_info *iter_info) \
242{ \
243 return (iter_info->report_mask & FSNOTIFY_OBJ_TYPE_##NAME##_FL) ? \
244 iter_info->marks[FSNOTIFY_OBJ_TYPE_##NAME] : NULL; \
245}
246
247FSNOTIFY_ITER_FUNCS(inode, INODE)
248FSNOTIFY_ITER_FUNCS(vfsmount, VFSMOUNT)
249
250#define fsnotify_foreach_obj_type(type) \
251 for (type = 0; type < FSNOTIFY_OBJ_TYPE_COUNT; type++)
252
204/* 253/*
205 * Inode / vfsmount point to this structure which tracks all marks attached to 254 * Inode / vfsmount point to this structure which tracks all marks attached to
206 * the inode / vfsmount. The reference to inode / vfsmount is held by this 255 * the inode / vfsmount. The reference to inode / vfsmount is held by this
@@ -209,11 +258,7 @@ struct fsnotify_group {
209 */ 258 */
210struct fsnotify_mark_connector { 259struct fsnotify_mark_connector {
211 spinlock_t lock; 260 spinlock_t lock;
212#define FSNOTIFY_OBJ_TYPE_INODE 0x01 261 unsigned int type; /* Type of object [lock] */
213#define FSNOTIFY_OBJ_TYPE_VFSMOUNT 0x02
214#define FSNOTIFY_OBJ_ALL_TYPES (FSNOTIFY_OBJ_TYPE_INODE | \
215 FSNOTIFY_OBJ_TYPE_VFSMOUNT)
216 unsigned int flags; /* Type of object [lock] */
217 union { /* Object pointer [lock] */ 262 union { /* Object pointer [lock] */
218 struct inode *inode; 263 struct inode *inode;
219 struct vfsmount *mnt; 264 struct vfsmount *mnt;
@@ -356,7 +401,21 @@ extern struct fsnotify_mark *fsnotify_find_mark(
356extern int fsnotify_add_mark(struct fsnotify_mark *mark, struct inode *inode, 401extern int fsnotify_add_mark(struct fsnotify_mark *mark, struct inode *inode,
357 struct vfsmount *mnt, int allow_dups); 402 struct vfsmount *mnt, int allow_dups);
358extern int fsnotify_add_mark_locked(struct fsnotify_mark *mark, 403extern int fsnotify_add_mark_locked(struct fsnotify_mark *mark,
359 struct inode *inode, struct vfsmount *mnt, int allow_dups); 404 struct inode *inode, struct vfsmount *mnt,
405 int allow_dups);
406/* attach the mark to the inode */
407static inline int fsnotify_add_inode_mark(struct fsnotify_mark *mark,
408 struct inode *inode,
409 int allow_dups)
410{
411 return fsnotify_add_mark(mark, inode, NULL, allow_dups);
412}
413static inline int fsnotify_add_inode_mark_locked(struct fsnotify_mark *mark,
414 struct inode *inode,
415 int allow_dups)
416{
417 return fsnotify_add_mark_locked(mark, inode, NULL, allow_dups);
418}
360/* given a group and a mark, flag mark to be freed when all references are dropped */ 419/* given a group and a mark, flag mark to be freed when all references are dropped */
361extern void fsnotify_destroy_mark(struct fsnotify_mark *mark, 420extern void fsnotify_destroy_mark(struct fsnotify_mark *mark,
362 struct fsnotify_group *group); 421 struct fsnotify_group *group);
@@ -369,12 +428,12 @@ extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group, unsigned
369/* run all the marks in a group, and clear all of the vfsmount marks */ 428/* run all the marks in a group, and clear all of the vfsmount marks */
370static inline void fsnotify_clear_vfsmount_marks_by_group(struct fsnotify_group *group) 429static inline void fsnotify_clear_vfsmount_marks_by_group(struct fsnotify_group *group)
371{ 430{
372 fsnotify_clear_marks_by_group(group, FSNOTIFY_OBJ_TYPE_VFSMOUNT); 431 fsnotify_clear_marks_by_group(group, FSNOTIFY_OBJ_TYPE_VFSMOUNT_FL);
373} 432}
374/* run all the marks in a group, and clear all of the inode marks */ 433/* run all the marks in a group, and clear all of the inode marks */
375static inline void fsnotify_clear_inode_marks_by_group(struct fsnotify_group *group) 434static inline void fsnotify_clear_inode_marks_by_group(struct fsnotify_group *group)
376{ 435{
377 fsnotify_clear_marks_by_group(group, FSNOTIFY_OBJ_TYPE_INODE); 436 fsnotify_clear_marks_by_group(group, FSNOTIFY_OBJ_TYPE_INODE_FL);
378} 437}
379extern void fsnotify_get_mark(struct fsnotify_mark *mark); 438extern void fsnotify_get_mark(struct fsnotify_mark *mark);
380extern void fsnotify_put_mark(struct fsnotify_mark *mark); 439extern void fsnotify_put_mark(struct fsnotify_mark *mark);
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 9c3c9a319e48..ebb77674be90 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -1,7 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: GPL-2.0 */
2/* 2/*
3 * Ftrace header. For implementation details beyond the random comments 3 * Ftrace header. For implementation details beyond the random comments
4 * scattered below, see: Documentation/trace/ftrace-design.txt 4 * scattered below, see: Documentation/trace/ftrace-design.rst
5 */ 5 */
6 6
7#ifndef _LINUX_FTRACE_H 7#ifndef _LINUX_FTRACE_H
@@ -223,7 +223,6 @@ extern enum ftrace_tracing_type_t ftrace_tracing_type;
223 */ 223 */
224int register_ftrace_function(struct ftrace_ops *ops); 224int register_ftrace_function(struct ftrace_ops *ops);
225int unregister_ftrace_function(struct ftrace_ops *ops); 225int unregister_ftrace_function(struct ftrace_ops *ops);
226void clear_ftrace_function(void);
227 226
228extern void ftrace_stub(unsigned long a0, unsigned long a1, 227extern void ftrace_stub(unsigned long a0, unsigned long a1,
229 struct ftrace_ops *op, struct pt_regs *regs); 228 struct ftrace_ops *op, struct pt_regs *regs);
@@ -239,7 +238,6 @@ static inline int ftrace_nr_registered_ops(void)
239{ 238{
240 return 0; 239 return 0;
241} 240}
242static inline void clear_ftrace_function(void) { }
243static inline void ftrace_kill(void) { } 241static inline void ftrace_kill(void) { }
244static inline void ftrace_free_init_mem(void) { } 242static inline void ftrace_free_init_mem(void) { }
245static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { } 243static inline void ftrace_free_mem(struct module *mod, void *start, void *end) { }
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index dbd065963296..243112c7fa7d 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -116,7 +116,7 @@ int gpiod_get_raw_array_value(unsigned int array_size,
116 struct gpio_desc **desc_array, 116 struct gpio_desc **desc_array,
117 int *value_array); 117 int *value_array);
118void gpiod_set_raw_value(struct gpio_desc *desc, int value); 118void gpiod_set_raw_value(struct gpio_desc *desc, int value);
119void gpiod_set_raw_array_value(unsigned int array_size, 119int gpiod_set_raw_array_value(unsigned int array_size,
120 struct gpio_desc **desc_array, 120 struct gpio_desc **desc_array,
121 int *value_array); 121 int *value_array);
122 122
@@ -134,7 +134,7 @@ int gpiod_get_raw_array_value_cansleep(unsigned int array_size,
134 struct gpio_desc **desc_array, 134 struct gpio_desc **desc_array,
135 int *value_array); 135 int *value_array);
136void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value); 136void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value);
137void gpiod_set_raw_array_value_cansleep(unsigned int array_size, 137int gpiod_set_raw_array_value_cansleep(unsigned int array_size,
138 struct gpio_desc **desc_array, 138 struct gpio_desc **desc_array,
139 int *value_array); 139 int *value_array);
140 140
@@ -369,12 +369,13 @@ static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value)
369 /* GPIO can never have been requested */ 369 /* GPIO can never have been requested */
370 WARN_ON(1); 370 WARN_ON(1);
371} 371}
372static inline void gpiod_set_raw_array_value(unsigned int array_size, 372static inline int gpiod_set_raw_array_value(unsigned int array_size,
373 struct gpio_desc **desc_array, 373 struct gpio_desc **desc_array,
374 int *value_array) 374 int *value_array)
375{ 375{
376 /* GPIO can never have been requested */ 376 /* GPIO can never have been requested */
377 WARN_ON(1); 377 WARN_ON(1);
378 return 0;
378} 379}
379 380
380static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc) 381static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc)
@@ -423,12 +424,13 @@ static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc,
423 /* GPIO can never have been requested */ 424 /* GPIO can never have been requested */
424 WARN_ON(1); 425 WARN_ON(1);
425} 426}
426static inline void gpiod_set_raw_array_value_cansleep(unsigned int array_size, 427static inline int gpiod_set_raw_array_value_cansleep(unsigned int array_size,
427 struct gpio_desc **desc_array, 428 struct gpio_desc **desc_array,
428 int *value_array) 429 int *value_array)
429{ 430{
430 /* GPIO can never have been requested */ 431 /* GPIO can never have been requested */
431 WARN_ON(1); 432 WARN_ON(1);
433 return 0;
432} 434}
433 435
434static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce) 436static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
diff --git a/include/linux/gpio/machine.h b/include/linux/gpio/machine.h
index b2f2dc638463..daa44eac9241 100644
--- a/include/linux/gpio/machine.h
+++ b/include/linux/gpio/machine.h
@@ -39,6 +39,23 @@ struct gpiod_lookup_table {
39 struct gpiod_lookup table[]; 39 struct gpiod_lookup table[];
40}; 40};
41 41
42/**
43 * struct gpiod_hog - GPIO line hog table
44 * @chip_label: name of the chip the GPIO belongs to
45 * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO
46 * @line_name: consumer name for the hogged line
47 * @lflags: mask of GPIO lookup flags
48 * @dflags: GPIO flags used to specify the direction and value
49 */
50struct gpiod_hog {
51 struct list_head list;
52 const char *chip_label;
53 u16 chip_hwnum;
54 const char *line_name;
55 enum gpio_lookup_flags lflags;
56 int dflags;
57};
58
42/* 59/*
43 * Simple definition of a single GPIO under a con_id 60 * Simple definition of a single GPIO under a con_id
44 */ 61 */
@@ -59,10 +76,23 @@ struct gpiod_lookup_table {
59 .flags = _flags, \ 76 .flags = _flags, \
60} 77}
61 78
79/*
80 * Simple definition of a single GPIO hog in an array.
81 */
82#define GPIO_HOG(_chip_label, _chip_hwnum, _line_name, _lflags, _dflags) \
83{ \
84 .chip_label = _chip_label, \
85 .chip_hwnum = _chip_hwnum, \
86 .line_name = _line_name, \
87 .lflags = _lflags, \
88 .dflags = _dflags, \
89}
90
62#ifdef CONFIG_GPIOLIB 91#ifdef CONFIG_GPIOLIB
63void gpiod_add_lookup_table(struct gpiod_lookup_table *table); 92void gpiod_add_lookup_table(struct gpiod_lookup_table *table);
64void gpiod_add_lookup_tables(struct gpiod_lookup_table **tables, size_t n); 93void gpiod_add_lookup_tables(struct gpiod_lookup_table **tables, size_t n);
65void gpiod_remove_lookup_table(struct gpiod_lookup_table *table); 94void gpiod_remove_lookup_table(struct gpiod_lookup_table *table);
95void gpiod_add_hogs(struct gpiod_hog *hogs);
66#else 96#else
67static inline 97static inline
68void gpiod_add_lookup_table(struct gpiod_lookup_table *table) {} 98void gpiod_add_lookup_table(struct gpiod_lookup_table *table) {}
@@ -70,6 +100,7 @@ static inline
70void gpiod_add_lookup_tables(struct gpiod_lookup_table **tables, size_t n) {} 100void gpiod_add_lookup_tables(struct gpiod_lookup_table **tables, size_t n) {}
71static inline 101static inline
72void gpiod_remove_lookup_table(struct gpiod_lookup_table *table) {} 102void gpiod_remove_lookup_table(struct gpiod_lookup_table *table) {}
103static inline void gpiod_add_hogs(struct gpiod_hog *hogs) {}
73#endif 104#endif
74 105
75#endif /* __LINUX_GPIO_MACHINE_H */ 106#endif /* __LINUX_GPIO_MACHINE_H */
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 773bcb1d4044..938d9ba6d7cd 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -894,6 +894,8 @@ const struct hid_device_id *hid_match_id(const struct hid_device *hdev,
894 const struct hid_device_id *id); 894 const struct hid_device_id *id);
895const struct hid_device_id *hid_match_device(struct hid_device *hdev, 895const struct hid_device_id *hid_match_device(struct hid_device *hdev,
896 struct hid_driver *hdrv); 896 struct hid_driver *hdrv);
897bool hid_compare_device_paths(struct hid_device *hdev_a,
898 struct hid_device *hdev_b, char separator);
897s32 hid_snto32(__u32 value, unsigned n); 899s32 hid_snto32(__u32 value, unsigned n);
898__u32 hid_field_extract(const struct hid_device *hid, __u8 *report, 900__u32 hid_field_extract(const struct hid_device *hid, __u8 *report,
899 unsigned offset, unsigned n); 901 unsigned offset, unsigned n);
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h
index 859d673d98c8..57537e67b468 100644
--- a/include/linux/hwspinlock.h
+++ b/include/linux/hwspinlock.h
@@ -1,18 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 */
1/* 2/*
2 * Hardware spinlock public header 3 * Hardware spinlock public header
3 * 4 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com 5 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
5 * 6 *
6 * Contact: Ohad Ben-Cohen <ohad@wizery.com> 7 * Contact: Ohad Ben-Cohen <ohad@wizery.com>
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 version 2 as published
10 * 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 */ 8 */
17 9
18#ifndef __LINUX_HWSPINLOCK_H 10#ifndef __LINUX_HWSPINLOCK_H
@@ -24,6 +16,7 @@
24/* hwspinlock mode argument */ 16/* hwspinlock mode argument */
25#define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */ 17#define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */
26#define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */ 18#define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */
19#define HWLOCK_RAW 0x03
27 20
28struct device; 21struct device;
29struct device_node; 22struct device_node;
@@ -176,6 +169,25 @@ static inline int hwspin_trylock_irq(struct hwspinlock *hwlock)
176} 169}
177 170
178/** 171/**
172 * hwspin_trylock_raw() - attempt to lock a specific hwspinlock
173 * @hwlock: an hwspinlock which we want to trylock
174 *
175 * This function attempts to lock an hwspinlock, and will immediately fail
176 * if the hwspinlock is already taken.
177 *
178 * Caution: User must protect the routine of getting hardware lock with mutex
179 * or spinlock to avoid dead-lock, that will let user can do some time-consuming
180 * or sleepable operations under the hardware lock.
181 *
182 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
183 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
184 */
185static inline int hwspin_trylock_raw(struct hwspinlock *hwlock)
186{
187 return __hwspin_trylock(hwlock, HWLOCK_RAW, NULL);
188}
189
190/**
179 * hwspin_trylock() - attempt to lock a specific hwspinlock 191 * hwspin_trylock() - attempt to lock a specific hwspinlock
180 * @hwlock: an hwspinlock which we want to trylock 192 * @hwlock: an hwspinlock which we want to trylock
181 * 193 *
@@ -243,6 +255,29 @@ int hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int to)
243} 255}
244 256
245/** 257/**
258 * hwspin_lock_timeout_raw() - lock an hwspinlock with timeout limit
259 * @hwlock: the hwspinlock to be locked
260 * @to: timeout value in msecs
261 *
262 * This function locks the underlying @hwlock. If the @hwlock
263 * is already taken, the function will busy loop waiting for it to
264 * be released, but give up when @timeout msecs have elapsed.
265 *
266 * Caution: User must protect the routine of getting hardware lock with mutex
267 * or spinlock to avoid dead-lock, that will let user can do some time-consuming
268 * or sleepable operations under the hardware lock.
269 *
270 * Returns 0 when the @hwlock was successfully taken, and an appropriate
271 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
272 * busy after @timeout msecs). The function will never sleep.
273 */
274static inline
275int hwspin_lock_timeout_raw(struct hwspinlock *hwlock, unsigned int to)
276{
277 return __hwspin_lock_timeout(hwlock, to, HWLOCK_RAW, NULL);
278}
279
280/**
246 * hwspin_lock_timeout() - lock an hwspinlock with timeout limit 281 * hwspin_lock_timeout() - lock an hwspinlock with timeout limit
247 * @hwlock: the hwspinlock to be locked 282 * @hwlock: the hwspinlock to be locked
248 * @to: timeout value in msecs 283 * @to: timeout value in msecs
@@ -302,6 +337,21 @@ static inline void hwspin_unlock_irq(struct hwspinlock *hwlock)
302} 337}
303 338
304/** 339/**
340 * hwspin_unlock_raw() - unlock hwspinlock
341 * @hwlock: a previously-acquired hwspinlock which we want to unlock
342 *
343 * This function will unlock a specific hwspinlock.
344 *
345 * @hwlock must be already locked (e.g. by hwspin_trylock()) before calling
346 * this function: it is a bug to call unlock on a @hwlock that is already
347 * unlocked.
348 */
349static inline void hwspin_unlock_raw(struct hwspinlock *hwlock)
350{
351 __hwspin_unlock(hwlock, HWLOCK_RAW, NULL);
352}
353
354/**
305 * hwspin_unlock() - unlock hwspinlock 355 * hwspin_unlock() - unlock hwspinlock
306 * @hwlock: a previously-acquired hwspinlock which we want to unlock 356 * @hwlock: a previously-acquired hwspinlock which we want to unlock
307 * 357 *
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 11b5612dc066..3a3012f57be4 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -35,6 +35,7 @@
35#include <linux/device.h> 35#include <linux/device.h>
36#include <linux/mod_devicetable.h> 36#include <linux/mod_devicetable.h>
37#include <linux/interrupt.h> 37#include <linux/interrupt.h>
38#include <linux/reciprocal_div.h>
38 39
39#define MAX_PAGE_BUFFER_COUNT 32 40#define MAX_PAGE_BUFFER_COUNT 32
40#define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */ 41#define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
@@ -120,6 +121,7 @@ struct hv_ring_buffer {
120struct hv_ring_buffer_info { 121struct hv_ring_buffer_info {
121 struct hv_ring_buffer *ring_buffer; 122 struct hv_ring_buffer *ring_buffer;
122 u32 ring_size; /* Include the shared header */ 123 u32 ring_size; /* Include the shared header */
124 struct reciprocal_value ring_size_div10_reciprocal;
123 spinlock_t ring_lock; 125 spinlock_t ring_lock;
124 126
125 u32 ring_datasize; /* < ring_size */ 127 u32 ring_datasize; /* < ring_size */
@@ -154,6 +156,16 @@ static inline u32 hv_get_bytes_to_write(const struct hv_ring_buffer_info *rbi)
154 return write; 156 return write;
155} 157}
156 158
159static inline u32 hv_get_avail_to_write_percent(
160 const struct hv_ring_buffer_info *rbi)
161{
162 u32 avail_write = hv_get_bytes_to_write(rbi);
163
164 return reciprocal_divide(
165 (avail_write << 3) + (avail_write << 1),
166 rbi->ring_size_div10_reciprocal);
167}
168
157/* 169/*
158 * VMBUS version is 32 bit entity broken up into 170 * VMBUS version is 32 bit entity broken up into
159 * two 16 bit quantities: major_number. minor_number. 171 * two 16 bit quantities: major_number. minor_number.
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
deleted file mode 100644
index 5388326fbbff..000000000000
--- a/include/linux/i2c-pnx.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * Header file for I2C support on PNX010x/4008.
3 *
4 * Author: Dennis Kovalev <dkovalev@ru.mvista.com>
5 *
6 * 2004-2006 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#ifndef __I2C_PNX_H__
13#define __I2C_PNX_H__
14
15struct platform_device;
16struct clk;
17
18struct i2c_pnx_mif {
19 int ret; /* Return value */
20 int mode; /* Interface mode */
21 struct completion complete; /* I/O completion */
22 struct timer_list timer; /* Timeout */
23 u8 * buf; /* Data buffer */
24 int len; /* Length of data buffer */
25 int order; /* RX Bytes to order via TX */
26};
27
28struct i2c_pnx_algo_data {
29 void __iomem *ioaddr;
30 struct i2c_pnx_mif mif;
31 int last;
32 struct clk *clk;
33 struct i2c_adapter adapter;
34 int irq;
35 u32 timeout;
36};
37
38#endif /* __I2C_PNX_H__ */
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 44ad14e016b5..254cd34eeae2 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -394,7 +394,6 @@ static inline bool i2c_detect_slave_mode(struct device *dev) { return false; }
394 * @addr: stored in i2c_client.addr 394 * @addr: stored in i2c_client.addr
395 * @dev_name: Overrides the default <busnr>-<addr> dev_name if set 395 * @dev_name: Overrides the default <busnr>-<addr> dev_name if set
396 * @platform_data: stored in i2c_client.dev.platform_data 396 * @platform_data: stored in i2c_client.dev.platform_data
397 * @archdata: copied into i2c_client.dev.archdata
398 * @of_node: pointer to OpenFirmware device node 397 * @of_node: pointer to OpenFirmware device node
399 * @fwnode: device node supplied by the platform firmware 398 * @fwnode: device node supplied by the platform firmware
400 * @properties: additional device properties for the device 399 * @properties: additional device properties for the device
@@ -419,7 +418,6 @@ struct i2c_board_info {
419 unsigned short addr; 418 unsigned short addr;
420 const char *dev_name; 419 const char *dev_name;
421 void *platform_data; 420 void *platform_data;
422 struct dev_archdata *archdata;
423 struct device_node *of_node; 421 struct device_node *of_node;
424 struct fwnode_handle *fwnode; 422 struct fwnode_handle *fwnode;
425 const struct property_entry *properties; 423 const struct property_entry *properties;
@@ -903,6 +901,9 @@ extern const struct of_device_id
903*i2c_of_match_device(const struct of_device_id *matches, 901*i2c_of_match_device(const struct of_device_id *matches,
904 struct i2c_client *client); 902 struct i2c_client *client);
905 903
904int of_i2c_get_board_info(struct device *dev, struct device_node *node,
905 struct i2c_board_info *info);
906
906#else 907#else
907 908
908static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node) 909static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
@@ -927,6 +928,13 @@ static inline const struct of_device_id
927 return NULL; 928 return NULL;
928} 929}
929 930
931static inline int of_i2c_get_board_info(struct device *dev,
932 struct device_node *node,
933 struct i2c_board_info *info)
934{
935 return -ENOTSUPP;
936}
937
930#endif /* CONFIG_OF */ 938#endif /* CONFIG_OF */
931 939
932#if IS_ENABLED(CONFIG_ACPI) 940#if IS_ENABLED(CONFIG_ACPI)
diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h
index 1fc7abd28b0b..730ead1a46df 100644
--- a/include/linux/iio/adc/ad_sigma_delta.h
+++ b/include/linux/iio/adc/ad_sigma_delta.h
@@ -127,7 +127,7 @@ void ad_sd_cleanup_buffer_and_trigger(struct iio_dev *indio_dev);
127int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig); 127int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig);
128 128
129#define __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \ 129#define __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
130 _storagebits, _shift, _extend_name, _type) \ 130 _storagebits, _shift, _extend_name, _type, _mask_all) \
131 { \ 131 { \
132 .type = (_type), \ 132 .type = (_type), \
133 .differential = (_channel2 == -1 ? 0 : 1), \ 133 .differential = (_channel2 == -1 ? 0 : 1), \
@@ -139,7 +139,7 @@ int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig);
139 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ 139 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
140 BIT(IIO_CHAN_INFO_OFFSET), \ 140 BIT(IIO_CHAN_INFO_OFFSET), \
141 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ 141 .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
142 .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ 142 .info_mask_shared_by_all = _mask_all, \
143 .scan_index = (_si), \ 143 .scan_index = (_si), \
144 .scan_type = { \ 144 .scan_type = { \
145 .sign = 'u', \ 145 .sign = 'u', \
@@ -153,25 +153,35 @@ int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig);
153#define AD_SD_DIFF_CHANNEL(_si, _channel1, _channel2, _address, _bits, \ 153#define AD_SD_DIFF_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
154 _storagebits, _shift) \ 154 _storagebits, _shift) \
155 __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \ 155 __AD_SD_CHANNEL(_si, _channel1, _channel2, _address, _bits, \
156 _storagebits, _shift, NULL, IIO_VOLTAGE) 156 _storagebits, _shift, NULL, IIO_VOLTAGE, \
157 BIT(IIO_CHAN_INFO_SAMP_FREQ))
157 158
158#define AD_SD_SHORTED_CHANNEL(_si, _channel, _address, _bits, \ 159#define AD_SD_SHORTED_CHANNEL(_si, _channel, _address, _bits, \
159 _storagebits, _shift) \ 160 _storagebits, _shift) \
160 __AD_SD_CHANNEL(_si, _channel, _channel, _address, _bits, \ 161 __AD_SD_CHANNEL(_si, _channel, _channel, _address, _bits, \
161 _storagebits, _shift, "shorted", IIO_VOLTAGE) 162 _storagebits, _shift, "shorted", IIO_VOLTAGE, \
163 BIT(IIO_CHAN_INFO_SAMP_FREQ))
162 164
163#define AD_SD_CHANNEL(_si, _channel, _address, _bits, \ 165#define AD_SD_CHANNEL(_si, _channel, _address, _bits, \
164 _storagebits, _shift) \ 166 _storagebits, _shift) \
165 __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \ 167 __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \
166 _storagebits, _shift, NULL, IIO_VOLTAGE) 168 _storagebits, _shift, NULL, IIO_VOLTAGE, \
169 BIT(IIO_CHAN_INFO_SAMP_FREQ))
170
171#define AD_SD_CHANNEL_NO_SAMP_FREQ(_si, _channel, _address, _bits, \
172 _storagebits, _shift) \
173 __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \
174 _storagebits, _shift, NULL, IIO_VOLTAGE, 0)
167 175
168#define AD_SD_TEMP_CHANNEL(_si, _address, _bits, _storagebits, _shift) \ 176#define AD_SD_TEMP_CHANNEL(_si, _address, _bits, _storagebits, _shift) \
169 __AD_SD_CHANNEL(_si, 0, -1, _address, _bits, \ 177 __AD_SD_CHANNEL(_si, 0, -1, _address, _bits, \
170 _storagebits, _shift, NULL, IIO_TEMP) 178 _storagebits, _shift, NULL, IIO_TEMP, \
179 BIT(IIO_CHAN_INFO_SAMP_FREQ))
171 180
172#define AD_SD_SUPPLY_CHANNEL(_si, _channel, _address, _bits, _storagebits, \ 181#define AD_SD_SUPPLY_CHANNEL(_si, _channel, _address, _bits, _storagebits, \
173 _shift) \ 182 _shift) \
174 __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \ 183 __AD_SD_CHANNEL(_si, _channel, -1, _address, _bits, \
175 _storagebits, _shift, "supply", IIO_VOLTAGE) 184 _storagebits, _shift, "supply", IIO_VOLTAGE, \
185 BIT(IIO_CHAN_INFO_SAMP_FREQ))
176 186
177#endif 187#endif
diff --git a/include/linux/iio/adc/stm32-dfsdm-adc.h b/include/linux/iio/adc/stm32-dfsdm-adc.h
index e7dc7a542a4e..0da298b41737 100644
--- a/include/linux/iio/adc/stm32-dfsdm-adc.h
+++ b/include/linux/iio/adc/stm32-dfsdm-adc.h
@@ -9,6 +9,8 @@
9#ifndef STM32_DFSDM_ADC_H 9#ifndef STM32_DFSDM_ADC_H
10#define STM32_DFSDM_ADC_H 10#define STM32_DFSDM_ADC_H
11 11
12#include <linux/iio/iio.h>
13
12int stm32_dfsdm_get_buff_cb(struct iio_dev *iio_dev, 14int stm32_dfsdm_get_buff_cb(struct iio_dev *iio_dev,
13 int (*cb)(const void *data, size_t size, 15 int (*cb)(const void *data, size_t size,
14 void *private), 16 void *private),
diff --git a/include/linux/iio/buffer-dma.h b/include/linux/iio/buffer-dma.h
index 767467d886de..67c75372b691 100644
--- a/include/linux/iio/buffer-dma.h
+++ b/include/linux/iio/buffer-dma.h
@@ -141,7 +141,7 @@ int iio_dma_buffer_read(struct iio_buffer *buffer, size_t n,
141 char __user *user_buffer); 141 char __user *user_buffer);
142size_t iio_dma_buffer_data_available(struct iio_buffer *buffer); 142size_t iio_dma_buffer_data_available(struct iio_buffer *buffer);
143int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd); 143int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd);
144int iio_dma_buffer_set_length(struct iio_buffer *buffer, int length); 144int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length);
145int iio_dma_buffer_request_update(struct iio_buffer *buffer); 145int iio_dma_buffer_request_update(struct iio_buffer *buffer);
146 146
147int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue, 147int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue,
diff --git a/include/linux/iio/common/cros_ec_sensors_core.h b/include/linux/iio/common/cros_ec_sensors_core.h
new file mode 100644
index 000000000000..ce16445411ac
--- /dev/null
+++ b/include/linux/iio/common/cros_ec_sensors_core.h
@@ -0,0 +1,180 @@
1/*
2 * ChromeOS EC sensor hub
3 *
4 * Copyright (C) 2016 Google, Inc
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef __CROS_EC_SENSORS_CORE_H
17#define __CROS_EC_SENSORS_CORE_H
18
19#include <linux/iio/iio.h>
20#include <linux/irqreturn.h>
21#include <linux/mfd/cros_ec.h>
22
23enum {
24 CROS_EC_SENSOR_X,
25 CROS_EC_SENSOR_Y,
26 CROS_EC_SENSOR_Z,
27 CROS_EC_SENSOR_MAX_AXIS,
28};
29
30/* EC returns sensor values using signed 16 bit registers */
31#define CROS_EC_SENSOR_BITS 16
32
33/*
34 * 4 16 bit channels are allowed.
35 * Good enough for current sensors, they use up to 3 16 bit vectors.
36 */
37#define CROS_EC_SAMPLE_SIZE (sizeof(s64) * 2)
38
39/* Minimum sampling period to use when device is suspending */
40#define CROS_EC_MIN_SUSPEND_SAMPLING_FREQUENCY 1000 /* 1 second */
41
42/**
43 * struct cros_ec_sensors_core_state - state data for EC sensors IIO driver
44 * @ec: cros EC device structure
45 * @cmd_lock: lock used to prevent simultaneous access to the
46 * commands.
47 * @msg: cros EC command structure
48 * @param: motion sensor parameters structure
49 * @resp: motion sensor response structure
50 * @type: type of motion sensor
51 * @loc: location where the motion sensor is placed
52 * @calib: calibration parameters. Note that trigger
53 * captured data will always provide the calibrated
54 * data
55 * @samples: static array to hold data from a single capture.
56 * For each channel we need 2 bytes, except for
57 * the timestamp. The timestamp is always last and
58 * is always 8-byte aligned.
59 * @read_ec_sensors_data: function used for accessing sensors values
60 * @cuur_sampl_freq: current sampling period
61 */
62struct cros_ec_sensors_core_state {
63 struct cros_ec_device *ec;
64 struct mutex cmd_lock;
65
66 struct cros_ec_command *msg;
67 struct ec_params_motion_sense param;
68 struct ec_response_motion_sense *resp;
69
70 enum motionsensor_type type;
71 enum motionsensor_location loc;
72
73 s16 calib[CROS_EC_SENSOR_MAX_AXIS];
74
75 u8 samples[CROS_EC_SAMPLE_SIZE];
76
77 int (*read_ec_sensors_data)(struct iio_dev *indio_dev,
78 unsigned long scan_mask, s16 *data);
79
80 int curr_sampl_freq;
81};
82
83/**
84 * cros_ec_sensors_read_lpc() - retrieve data from EC shared memory
85 * @indio_dev: pointer to IIO device
86 * @scan_mask: bitmap of the sensor indices to scan
87 * @data: location to store data
88 *
89 * This is the safe function for reading the EC data. It guarantees that the
90 * data sampled was not modified by the EC while being read.
91 *
92 * Return: 0 on success, -errno on failure.
93 */
94int cros_ec_sensors_read_lpc(struct iio_dev *indio_dev, unsigned long scan_mask,
95 s16 *data);
96
97/**
98 * cros_ec_sensors_read_cmd() - retrieve data using the EC command protocol
99 * @indio_dev: pointer to IIO device
100 * @scan_mask: bitmap of the sensor indices to scan
101 * @data: location to store data
102 *
103 * Return: 0 on success, -errno on failure.
104 */
105int cros_ec_sensors_read_cmd(struct iio_dev *indio_dev, unsigned long scan_mask,
106 s16 *data);
107
108struct platform_device;
109/**
110 * cros_ec_sensors_core_init() - basic initialization of the core structure
111 * @pdev: platform device created for the sensors
112 * @indio_dev: iio device structure of the device
113 * @physical_device: true if the device refers to a physical device
114 *
115 * Return: 0 on success, -errno on failure.
116 */
117int cros_ec_sensors_core_init(struct platform_device *pdev,
118 struct iio_dev *indio_dev, bool physical_device);
119
120/**
121 * cros_ec_sensors_capture() - the trigger handler function
122 * @irq: the interrupt number.
123 * @p: a pointer to the poll function.
124 *
125 * On a trigger event occurring, if the pollfunc is attached then this
126 * handler is called as a threaded interrupt (and hence may sleep). It
127 * is responsible for grabbing data from the device and pushing it into
128 * the associated buffer.
129 *
130 * Return: IRQ_HANDLED
131 */
132irqreturn_t cros_ec_sensors_capture(int irq, void *p);
133
134/**
135 * cros_ec_motion_send_host_cmd() - send motion sense host command
136 * @st: pointer to state information for device
137 * @opt_length: optional length to reduce the response size, useful on the data
138 * path. Otherwise, the maximal allowed response size is used
139 *
140 * When called, the sub-command is assumed to be set in param->cmd.
141 *
142 * Return: 0 on success, -errno on failure.
143 */
144int cros_ec_motion_send_host_cmd(struct cros_ec_sensors_core_state *st,
145 u16 opt_length);
146
147/**
148 * cros_ec_sensors_core_read() - function to request a value from the sensor
149 * @st: pointer to state information for device
150 * @chan: channel specification structure table
151 * @val: will contain one element making up the returned value
152 * @val2: will contain another element making up the returned value
153 * @mask: specifies which values to be requested
154 *
155 * Return: the type of value returned by the device
156 */
157int cros_ec_sensors_core_read(struct cros_ec_sensors_core_state *st,
158 struct iio_chan_spec const *chan,
159 int *val, int *val2, long mask);
160
161/**
162 * cros_ec_sensors_core_write() - function to write a value to the sensor
163 * @st: pointer to state information for device
164 * @chan: channel specification structure table
165 * @val: first part of value to write
166 * @val2: second part of value to write
167 * @mask: specifies which values to write
168 *
169 * Return: the type of value returned by the device
170 */
171int cros_ec_sensors_core_write(struct cros_ec_sensors_core_state *st,
172 struct iio_chan_spec const *chan,
173 int val, int val2, long mask);
174
175extern const struct dev_pm_ops cros_ec_sensors_pm_ops;
176
177/* List of extended channel specification for all sensors */
178extern const struct iio_chan_spec_ext_info cros_ec_sensors_ext_info[];
179
180#endif /* __CROS_EC_SENSORS_CORE_H */
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 11579fd4126e..a74cb177dc6f 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -183,18 +183,18 @@ struct iio_event_spec {
183 * @address: Driver specific identifier. 183 * @address: Driver specific identifier.
184 * @scan_index: Monotonic index to give ordering in scans when read 184 * @scan_index: Monotonic index to give ordering in scans when read
185 * from a buffer. 185 * from a buffer.
186 * @scan_type: sign: 's' or 'u' to specify signed or unsigned 186 * @scan_type: struct describing the scan type
187 * realbits: Number of valid bits of data 187 * @scan_type.sign: 's' or 'u' to specify signed or unsigned
188 * storagebits: Realbits + padding 188 * @scan_type.realbits: Number of valid bits of data
189 * shift: Shift right by this before masking out 189 * @scan_type.storagebits: Realbits + padding
190 * realbits. 190 * @scan_type.shift: Shift right by this before masking out
191 * repeat: Number of times real/storage bits 191 * realbits.
192 * repeats. When the repeat element is 192 * @scan_type.repeat: Number of times real/storage bits repeats.
193 * more than 1, then the type element in 193 * When the repeat element is more than 1, then
194 * sysfs will show a repeat value. 194 * the type element in sysfs will show a repeat
195 * Otherwise, the number of repetitions is 195 * value. Otherwise, the number of repetitions
196 * omitted. 196 * is omitted.
197 * endianness: little or big endian 197 * @scan_type.endianness: little or big endian
198 * @info_mask_separate: What information is to be exported that is specific to 198 * @info_mask_separate: What information is to be exported that is specific to
199 * this channel. 199 * this channel.
200 * @info_mask_separate_available: What availability information is to be 200 * @info_mask_separate_available: What availability information is to be
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h
index d7188de4db96..3f4bf60b0bb5 100644
--- a/include/linux/input/mt.h
+++ b/include/linux/input/mt.h
@@ -100,7 +100,7 @@ static inline bool input_is_mt_axis(int axis)
100 return axis == ABS_MT_SLOT || input_is_mt_value(axis); 100 return axis == ABS_MT_SLOT || input_is_mt_value(axis);
101} 101}
102 102
103void input_mt_report_slot_state(struct input_dev *dev, 103bool input_mt_report_slot_state(struct input_dev *dev,
104 unsigned int tool_type, bool active); 104 unsigned int tool_type, bool active);
105 105
106void input_mt_report_finger_count(struct input_dev *dev, int count); 106void input_mt_report_finger_count(struct input_dev *dev, int count);
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index ef169d67df92..1df940196ab2 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -121,7 +121,6 @@
121#define ecap_srs(e) ((e >> 31) & 0x1) 121#define ecap_srs(e) ((e >> 31) & 0x1)
122#define ecap_ers(e) ((e >> 30) & 0x1) 122#define ecap_ers(e) ((e >> 30) & 0x1)
123#define ecap_prs(e) ((e >> 29) & 0x1) 123#define ecap_prs(e) ((e >> 29) & 0x1)
124#define ecap_broken_pasid(e) ((e >> 28) & 0x1)
125#define ecap_dis(e) ((e >> 27) & 0x1) 124#define ecap_dis(e) ((e >> 27) & 0x1)
126#define ecap_nest(e) ((e >> 26) & 0x1) 125#define ecap_nest(e) ((e >> 26) & 0x1)
127#define ecap_mts(e) ((e >> 25) & 0x1) 126#define ecap_mts(e) ((e >> 25) & 0x1)
diff --git a/include/linux/irq.h b/include/linux/irq.h
index b2067083aa94..201de12a9957 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -503,6 +503,7 @@ struct irq_chip {
503 * IRQCHIP_SKIP_SET_WAKE: Skip chip.irq_set_wake(), for this irq chip 503 * IRQCHIP_SKIP_SET_WAKE: Skip chip.irq_set_wake(), for this irq chip
504 * IRQCHIP_ONESHOT_SAFE: One shot does not require mask/unmask 504 * IRQCHIP_ONESHOT_SAFE: One shot does not require mask/unmask
505 * IRQCHIP_EOI_THREADED: Chip requires eoi() on unmask in threaded mode 505 * IRQCHIP_EOI_THREADED: Chip requires eoi() on unmask in threaded mode
506 * IRQCHIP_SUPPORTS_LEVEL_MSI Chip can provide two doorbells for Level MSIs
506 */ 507 */
507enum { 508enum {
508 IRQCHIP_SET_TYPE_MASKED = (1 << 0), 509 IRQCHIP_SET_TYPE_MASKED = (1 << 0),
@@ -552,7 +553,12 @@ extern int irq_affinity_online_cpu(unsigned int cpu);
552#endif 553#endif
553 554
554#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ) 555#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ)
555void irq_move_irq(struct irq_data *data); 556void __irq_move_irq(struct irq_data *data);
557static inline void irq_move_irq(struct irq_data *data)
558{
559 if (unlikely(irqd_is_setaffinity_pending(data)))
560 __irq_move_irq(data);
561}
556void irq_move_masked_irq(struct irq_data *data); 562void irq_move_masked_irq(struct irq_data *data);
557void irq_force_complete_move(struct irq_desc *desc); 563void irq_force_complete_move(struct irq_desc *desc);
558#else 564#else
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 25b33b664537..dd1e40ddac7d 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -145,11 +145,6 @@ static inline void *irq_desc_get_handler_data(struct irq_desc *desc)
145 return desc->irq_common_data.handler_data; 145 return desc->irq_common_data.handler_data;
146} 146}
147 147
148static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
149{
150 return desc->irq_common_data.msi_desc;
151}
152
153/* 148/*
154 * Architectures call this to let the generic IRQ layer 149 * Architectures call this to let the generic IRQ layer
155 * handle an interrupt. 150 * handle an interrupt.
diff --git a/include/linux/kcov.h b/include/linux/kcov.h
index 3ecf6f5e3a5f..b76a1807028d 100644
--- a/include/linux/kcov.h
+++ b/include/linux/kcov.h
@@ -22,13 +22,27 @@ enum kcov_mode {
22 KCOV_MODE_TRACE_CMP = 3, 22 KCOV_MODE_TRACE_CMP = 3,
23}; 23};
24 24
25#define KCOV_IN_CTXSW (1 << 30)
26
25void kcov_task_init(struct task_struct *t); 27void kcov_task_init(struct task_struct *t);
26void kcov_task_exit(struct task_struct *t); 28void kcov_task_exit(struct task_struct *t);
27 29
30#define kcov_prepare_switch(t) \
31do { \
32 (t)->kcov_mode |= KCOV_IN_CTXSW; \
33} while (0)
34
35#define kcov_finish_switch(t) \
36do { \
37 (t)->kcov_mode &= ~KCOV_IN_CTXSW; \
38} while (0)
39
28#else 40#else
29 41
30static inline void kcov_task_init(struct task_struct *t) {} 42static inline void kcov_task_init(struct task_struct *t) {}
31static inline void kcov_task_exit(struct task_struct *t) {} 43static inline void kcov_task_exit(struct task_struct *t) {}
44static inline void kcov_prepare_switch(struct task_struct *t) {}
45static inline void kcov_finish_switch(struct task_struct *t) {}
32 46
33#endif /* CONFIG_KCOV */ 47#endif /* CONFIG_KCOV */
34#endif /* _LINUX_KCOV_H */ 48#endif /* _LINUX_KCOV_H */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 7c4e8f1f72d8..941dc0a5a877 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -666,7 +666,7 @@ do { \
666 * your code. (Extra memory is used for special buffers that are 666 * your code. (Extra memory is used for special buffers that are
667 * allocated when trace_printk() is used.) 667 * allocated when trace_printk() is used.)
668 * 668 *
669 * A little optization trick is done here. If there's only one 669 * A little optimization trick is done here. If there's only one
670 * argument, there's no need to scan the string for printf formats. 670 * argument, there's no need to scan the string for printf formats.
671 * The trace_puts() will suffice. But how can we take advantage of 671 * The trace_puts() will suffice. But how can we take advantage of
672 * using trace_puts() when trace_printk() has only one argument? 672 * using trace_puts() when trace_printk() has only one argument?
@@ -966,6 +966,22 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
966 "pointer type mismatch in container_of()"); \ 966 "pointer type mismatch in container_of()"); \
967 ((type *)(__mptr - offsetof(type, member))); }) 967 ((type *)(__mptr - offsetof(type, member))); })
968 968
969/**
970 * container_of_safe - cast a member of a structure out to the containing structure
971 * @ptr: the pointer to the member.
972 * @type: the type of the container struct this is embedded in.
973 * @member: the name of the member within the struct.
974 *
975 * If IS_ERR_OR_NULL(ptr), ptr is returned unchanged.
976 */
977#define container_of_safe(ptr, type, member) ({ \
978 void *__mptr = (void *)(ptr); \
979 BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
980 !__same_type(*(ptr), void), \
981 "pointer type mismatch in container_of()"); \
982 IS_ERR_OR_NULL(__mptr) ? ERR_CAST(__mptr) : \
983 ((type *)(__mptr - offsetof(type, member))); })
984
969/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ 985/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */
970#ifdef CONFIG_FTRACE_MCOUNT_RECORD 986#ifdef CONFIG_FTRACE_MCOUNT_RECORD
971# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD 987# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index 2803264c512f..c1961761311d 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -62,7 +62,6 @@ void *kthread_probe_data(struct task_struct *k);
62int kthread_park(struct task_struct *k); 62int kthread_park(struct task_struct *k);
63void kthread_unpark(struct task_struct *k); 63void kthread_unpark(struct task_struct *k);
64void kthread_parkme(void); 64void kthread_parkme(void);
65void kthread_park_complete(struct task_struct *k);
66 65
67int kthreadd(void *unused); 66int kthreadd(void *unused);
68extern struct task_struct *kthreadd_task; 67extern struct task_struct *kthreadd_task;
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 6d6e79c59e68..4ee7bc548a83 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -19,6 +19,7 @@
19#include <linux/preempt.h> 19#include <linux/preempt.h>
20#include <linux/msi.h> 20#include <linux/msi.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/vmalloc.h>
22#include <linux/rcupdate.h> 23#include <linux/rcupdate.h>
23#include <linux/ratelimit.h> 24#include <linux/ratelimit.h>
24#include <linux/err.h> 25#include <linux/err.h>
@@ -730,13 +731,16 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
730 731
731void kvm_flush_remote_tlbs(struct kvm *kvm); 732void kvm_flush_remote_tlbs(struct kvm *kvm);
732void kvm_reload_remote_mmus(struct kvm *kvm); 733void kvm_reload_remote_mmus(struct kvm *kvm);
734
735bool kvm_make_vcpus_request_mask(struct kvm *kvm, unsigned int req,
736 unsigned long *vcpu_bitmap, cpumask_var_t tmp);
733bool kvm_make_all_cpus_request(struct kvm *kvm, unsigned int req); 737bool kvm_make_all_cpus_request(struct kvm *kvm, unsigned int req);
734 738
735long kvm_arch_dev_ioctl(struct file *filp, 739long kvm_arch_dev_ioctl(struct file *filp,
736 unsigned int ioctl, unsigned long arg); 740 unsigned int ioctl, unsigned long arg);
737long kvm_arch_vcpu_ioctl(struct file *filp, 741long kvm_arch_vcpu_ioctl(struct file *filp,
738 unsigned int ioctl, unsigned long arg); 742 unsigned int ioctl, unsigned long arg);
739int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf); 743vm_fault_t kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf);
740 744
741int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext); 745int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext);
742 746
@@ -808,6 +812,10 @@ bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu);
808int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu); 812int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);
809 813
810#ifndef __KVM_HAVE_ARCH_VM_ALLOC 814#ifndef __KVM_HAVE_ARCH_VM_ALLOC
815/*
816 * All architectures that want to use vzalloc currently also
817 * need their own kvm_arch_alloc_vm implementation.
818 */
811static inline struct kvm *kvm_arch_alloc_vm(void) 819static inline struct kvm *kvm_arch_alloc_vm(void)
812{ 820{
813 return kzalloc(sizeof(struct kvm), GFP_KERNEL); 821 return kzalloc(sizeof(struct kvm), GFP_KERNEL);
@@ -1270,4 +1278,13 @@ static inline long kvm_arch_vcpu_async_ioctl(struct file *filp,
1270void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, 1278void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
1271 unsigned long start, unsigned long end); 1279 unsigned long start, unsigned long end);
1272 1280
1281#ifdef CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE
1282int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu);
1283#else
1284static inline int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu)
1285{
1286 return 0;
1287}
1288#endif /* CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE */
1289
1273#endif 1290#endif
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 9db904344c75..8b8946dd63b9 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1130,6 +1130,8 @@ extern void ata_sas_async_probe(struct ata_port *ap);
1130extern int ata_sas_sync_probe(struct ata_port *ap); 1130extern int ata_sas_sync_probe(struct ata_port *ap);
1131extern int ata_sas_port_init(struct ata_port *); 1131extern int ata_sas_port_init(struct ata_port *);
1132extern int ata_sas_port_start(struct ata_port *ap); 1132extern int ata_sas_port_start(struct ata_port *ap);
1133extern int ata_sas_tport_add(struct device *parent, struct ata_port *ap);
1134extern void ata_sas_tport_delete(struct ata_port *ap);
1133extern void ata_sas_port_stop(struct ata_port *ap); 1135extern void ata_sas_port_stop(struct ata_port *ap);
1134extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *); 1136extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *);
1135extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap); 1137extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap);
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index f68db9e450eb..d7618c41f74c 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -24,16 +24,16 @@
24 24
25#ifndef cond_syscall 25#ifndef cond_syscall
26#define cond_syscall(x) asm( \ 26#define cond_syscall(x) asm( \
27 ".weak " VMLINUX_SYMBOL_STR(x) "\n\t" \ 27 ".weak " __stringify(x) "\n\t" \
28 ".set " VMLINUX_SYMBOL_STR(x) "," \ 28 ".set " __stringify(x) "," \
29 VMLINUX_SYMBOL_STR(sys_ni_syscall)) 29 __stringify(sys_ni_syscall))
30#endif 30#endif
31 31
32#ifndef SYSCALL_ALIAS 32#ifndef SYSCALL_ALIAS
33#define SYSCALL_ALIAS(alias, name) asm( \ 33#define SYSCALL_ALIAS(alias, name) asm( \
34 ".globl " VMLINUX_SYMBOL_STR(alias) "\n\t" \ 34 ".globl " __stringify(alias) "\n\t" \
35 ".set " VMLINUX_SYMBOL_STR(alias) "," \ 35 ".set " __stringify(alias) "," \
36 VMLINUX_SYMBOL_STR(name)) 36 __stringify(name))
37#endif 37#endif
38 38
39#define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE) 39#define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)
diff --git a/include/linux/log2.h b/include/linux/log2.h
index 41a1ae010993..2af7f77866d0 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -72,16 +72,13 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
72} 72}
73 73
74/** 74/**
75 * ilog2 - log base 2 of 32-bit or a 64-bit unsigned value 75 * const_ilog2 - log base 2 of 32-bit or a 64-bit constant unsigned value
76 * @n: parameter 76 * @n: parameter
77 * 77 *
78 * constant-capable log of base 2 calculation 78 * Use this where sparse expects a true constant expression, e.g. for array
79 * - this can be used to initialise global variables from constant data, hence 79 * indices.
80 * the massive ternary operator construction
81 *
82 * selects the appropriately-sized optimised version depending on sizeof(n)
83 */ 80 */
84#define ilog2(n) \ 81#define const_ilog2(n) \
85( \ 82( \
86 __builtin_constant_p(n) ? ( \ 83 __builtin_constant_p(n) ? ( \
87 (n) < 2 ? 0 : \ 84 (n) < 2 ? 0 : \
@@ -147,10 +144,26 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
147 (n) & (1ULL << 4) ? 4 : \ 144 (n) & (1ULL << 4) ? 4 : \
148 (n) & (1ULL << 3) ? 3 : \ 145 (n) & (1ULL << 3) ? 3 : \
149 (n) & (1ULL << 2) ? 2 : \ 146 (n) & (1ULL << 2) ? 2 : \
150 1 ) : \ 147 1) : \
151 (sizeof(n) <= 4) ? \ 148 -1)
152 __ilog2_u32(n) : \ 149
153 __ilog2_u64(n) \ 150/**
151 * ilog2 - log base 2 of 32-bit or a 64-bit unsigned value
152 * @n: parameter
153 *
154 * constant-capable log of base 2 calculation
155 * - this can be used to initialise global variables from constant data, hence
156 * the massive ternary operator construction
157 *
158 * selects the appropriately-sized optimised version depending on sizeof(n)
159 */
160#define ilog2(n) \
161( \
162 __builtin_constant_p(n) ? \
163 const_ilog2(n) : \
164 (sizeof(n) <= 4) ? \
165 __ilog2_u32(n) : \
166 __ilog2_u64(n) \
154 ) 167 )
155 168
156/** 169/**
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 4f52ec755725..6c6fb116e925 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -53,6 +53,7 @@ enum memcg_memory_event {
53 MEMCG_HIGH, 53 MEMCG_HIGH,
54 MEMCG_MAX, 54 MEMCG_MAX,
55 MEMCG_OOM, 55 MEMCG_OOM,
56 MEMCG_OOM_KILL,
56 MEMCG_SWAP_MAX, 57 MEMCG_SWAP_MAX,
57 MEMCG_SWAP_FAIL, 58 MEMCG_SWAP_FAIL,
58 MEMCG_NR_MEMORY_EVENTS, 59 MEMCG_NR_MEMORY_EVENTS,
@@ -720,11 +721,8 @@ static inline void count_memcg_event_mm(struct mm_struct *mm,
720 721
721 rcu_read_lock(); 722 rcu_read_lock();
722 memcg = mem_cgroup_from_task(rcu_dereference(mm->owner)); 723 memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
723 if (likely(memcg)) { 724 if (likely(memcg))
724 count_memcg_events(memcg, idx, 1); 725 count_memcg_events(memcg, idx, 1);
725 if (idx == OOM_KILL)
726 cgroup_file_notify(&memcg->events_file);
727 }
728 rcu_read_unlock(); 726 rcu_read_unlock();
729} 727}
730 728
@@ -735,6 +733,21 @@ static inline void memcg_memory_event(struct mem_cgroup *memcg,
735 cgroup_file_notify(&memcg->events_file); 733 cgroup_file_notify(&memcg->events_file);
736} 734}
737 735
736static inline void memcg_memory_event_mm(struct mm_struct *mm,
737 enum memcg_memory_event event)
738{
739 struct mem_cgroup *memcg;
740
741 if (mem_cgroup_disabled())
742 return;
743
744 rcu_read_lock();
745 memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
746 if (likely(memcg))
747 memcg_memory_event(memcg, event);
748 rcu_read_unlock();
749}
750
738#ifdef CONFIG_TRANSPARENT_HUGEPAGE 751#ifdef CONFIG_TRANSPARENT_HUGEPAGE
739void mem_cgroup_split_huge_fixup(struct page *head); 752void mem_cgroup_split_huge_fixup(struct page *head);
740#endif 753#endif
@@ -756,6 +769,11 @@ static inline void memcg_memory_event(struct mem_cgroup *memcg,
756{ 769{
757} 770}
758 771
772static inline void memcg_memory_event_mm(struct mm_struct *mm,
773 enum memcg_memory_event event)
774{
775}
776
759static inline enum mem_cgroup_protection mem_cgroup_protected( 777static inline enum mem_cgroup_protection mem_cgroup_protected(
760 struct mem_cgroup *root, struct mem_cgroup *memcg) 778 struct mem_cgroup *root, struct mem_cgroup *memcg)
761{ 779{
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 31ca3e28b0eb..a6ddefc60517 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -38,6 +38,7 @@ struct memory_block {
38 38
39int arch_get_memory_phys_device(unsigned long start_pfn); 39int arch_get_memory_phys_device(unsigned long start_pfn);
40unsigned long memory_block_size_bytes(void); 40unsigned long memory_block_size_bytes(void);
41int set_memory_block_size_order(unsigned int order);
41 42
42/* These states are exposed to userspace as text strings in sysfs */ 43/* These states are exposed to userspace as text strings in sysfs */
43#define MEM_ONLINE (1<<0) /* exposed to userspace */ 44#define MEM_ONLINE (1<<0) /* exposed to userspace */
diff --git a/include/linux/memremap.h b/include/linux/memremap.h
index 74ea5e2310a8..f91f9e763557 100644
--- a/include/linux/memremap.h
+++ b/include/linux/memremap.h
@@ -1,7 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_MEMREMAP_H_ 2#ifndef _LINUX_MEMREMAP_H_
3#define _LINUX_MEMREMAP_H_ 3#define _LINUX_MEMREMAP_H_
4#include <linux/mm.h>
5#include <linux/ioport.h> 4#include <linux/ioport.h>
6#include <linux/percpu-refcount.h> 5#include <linux/percpu-refcount.h>
7 6
@@ -30,13 +29,6 @@ struct vmem_altmap {
30 * Specialize ZONE_DEVICE memory into multiple types each having differents 29 * Specialize ZONE_DEVICE memory into multiple types each having differents
31 * usage. 30 * usage.
32 * 31 *
33 * MEMORY_DEVICE_HOST:
34 * Persistent device memory (pmem): struct page might be allocated in different
35 * memory and architecture might want to perform special actions. It is similar
36 * to regular memory, in that the CPU can access it transparently. However,
37 * it is likely to have different bandwidth and latency than regular memory.
38 * See Documentation/nvdimm/nvdimm.txt for more information.
39 *
40 * MEMORY_DEVICE_PRIVATE: 32 * MEMORY_DEVICE_PRIVATE:
41 * Device memory that is not directly addressable by the CPU: CPU can neither 33 * Device memory that is not directly addressable by the CPU: CPU can neither
42 * read nor write private memory. In this case, we do still have struct pages 34 * read nor write private memory. In this case, we do still have struct pages
@@ -53,11 +45,19 @@ struct vmem_altmap {
53 * driver can hotplug the device memory using ZONE_DEVICE and with that memory 45 * driver can hotplug the device memory using ZONE_DEVICE and with that memory
54 * type. Any page of a process can be migrated to such memory. However no one 46 * type. Any page of a process can be migrated to such memory. However no one
55 * should be allow to pin such memory so that it can always be evicted. 47 * should be allow to pin such memory so that it can always be evicted.
48 *
49 * MEMORY_DEVICE_FS_DAX:
50 * Host memory that has similar access semantics as System RAM i.e. DMA
51 * coherent and supports page pinning. In support of coordinating page
52 * pinning vs other operations MEMORY_DEVICE_FS_DAX arranges for a
53 * wakeup event whenever a page is unpinned and becomes idle. This
54 * wakeup is used to coordinate physical address space management (ex:
55 * fs truncate/hole punch) vs pinned pages (ex: device dma).
56 */ 56 */
57enum memory_type { 57enum memory_type {
58 MEMORY_DEVICE_HOST = 0, 58 MEMORY_DEVICE_PRIVATE = 1,
59 MEMORY_DEVICE_PRIVATE,
60 MEMORY_DEVICE_PUBLIC, 59 MEMORY_DEVICE_PUBLIC,
60 MEMORY_DEVICE_FS_DAX,
61}; 61};
62 62
63/* 63/*
@@ -129,8 +129,6 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn,
129 129
130unsigned long vmem_altmap_offset(struct vmem_altmap *altmap); 130unsigned long vmem_altmap_offset(struct vmem_altmap *altmap);
131void vmem_altmap_free(struct vmem_altmap *altmap, unsigned long nr_pfns); 131void vmem_altmap_free(struct vmem_altmap *altmap, unsigned long nr_pfns);
132
133static inline bool is_zone_device_page(const struct page *page);
134#else 132#else
135static inline void *devm_memremap_pages(struct device *dev, 133static inline void *devm_memremap_pages(struct device *dev,
136 struct dev_pagemap *pgmap) 134 struct dev_pagemap *pgmap)
@@ -161,20 +159,6 @@ static inline void vmem_altmap_free(struct vmem_altmap *altmap,
161} 159}
162#endif /* CONFIG_ZONE_DEVICE */ 160#endif /* CONFIG_ZONE_DEVICE */
163 161
164#if defined(CONFIG_DEVICE_PRIVATE) || defined(CONFIG_DEVICE_PUBLIC)
165static inline bool is_device_private_page(const struct page *page)
166{
167 return is_zone_device_page(page) &&
168 page->pgmap->type == MEMORY_DEVICE_PRIVATE;
169}
170
171static inline bool is_device_public_page(const struct page *page)
172{
173 return is_zone_device_page(page) &&
174 page->pgmap->type == MEMORY_DEVICE_PUBLIC;
175}
176#endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */
177
178static inline void put_dev_pagemap(struct dev_pagemap *pgmap) 162static inline void put_dev_pagemap(struct dev_pagemap *pgmap)
179{ 163{
180 if (pgmap) 164 if (pgmap)
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 44412c9d26e1..aa09414756db 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -271,7 +271,6 @@ struct abx500_bm_data {
271 bool autopower_cfg; 271 bool autopower_cfg;
272 bool ac_enabled; 272 bool ac_enabled;
273 bool usb_enabled; 273 bool usb_enabled;
274 bool usb_power_path;
275 bool no_maintenance; 274 bool no_maintenance;
276 bool capacity_scaling; 275 bool capacity_scaling;
277 bool chg_unknown_bat; 276 bool chg_unknown_bat;
diff --git a/include/linux/mfd/abx500/ab8500-bm.h b/include/linux/mfd/abx500/ab8500-bm.h
index e63681eb6c62..c06daf3d490a 100644
--- a/include/linux/mfd/abx500/ab8500-bm.h
+++ b/include/linux/mfd/abx500/ab8500-bm.h
@@ -248,8 +248,6 @@ enum bup_vch_sel {
248#define BAT_CTRL_20U_ENA 0x02 248#define BAT_CTRL_20U_ENA 0x02
249#define BAT_CTRL_18U_ENA 0x01 249#define BAT_CTRL_18U_ENA 0x01
250#define BAT_CTRL_16U_ENA 0x02 250#define BAT_CTRL_16U_ENA 0x02
251#define BAT_CTRL_60U_ENA 0x01
252#define BAT_CTRL_120U_ENA 0x02
253#define BAT_CTRL_CMP_ENA 0x04 251#define BAT_CTRL_CMP_ENA 0x04
254#define FORCE_BAT_CTRL_CMP_HIGH 0x08 252#define FORCE_BAT_CTRL_CMP_HIGH 0x08
255#define BAT_CTRL_PULL_UP_ENA 0x10 253#define BAT_CTRL_PULL_UP_ENA 0x10
diff --git a/include/linux/mfd/abx500/ux500_chargalg.h b/include/linux/mfd/abx500/ux500_chargalg.h
index 67703f23e7ba..669894f434f5 100644
--- a/include/linux/mfd/abx500/ux500_chargalg.h
+++ b/include/linux/mfd/abx500/ux500_chargalg.h
@@ -25,8 +25,6 @@ struct ux500_charger_ops {
25 int (*check_enable) (struct ux500_charger *, int, int); 25 int (*check_enable) (struct ux500_charger *, int, int);
26 int (*kick_wd) (struct ux500_charger *); 26 int (*kick_wd) (struct ux500_charger *);
27 int (*update_curr) (struct ux500_charger *, int); 27 int (*update_curr) (struct ux500_charger *, int);
28 int (*pp_enable) (struct ux500_charger *, bool);
29 int (*pre_chg_enable) (struct ux500_charger *, bool);
30}; 28};
31 29
32/** 30/**
@@ -37,7 +35,6 @@ struct ux500_charger_ops {
37 * @max_out_curr maximum output charger current in mA 35 * @max_out_curr maximum output charger current in mA
38 * @enabled indicates if this charger is used or not 36 * @enabled indicates if this charger is used or not
39 * @external external charger unit (pm2xxx) 37 * @external external charger unit (pm2xxx)
40 * @power_path USB power path support
41 */ 38 */
42struct ux500_charger { 39struct ux500_charger {
43 struct power_supply *psy; 40 struct power_supply *psy;
@@ -47,7 +44,6 @@ struct ux500_charger {
47 int wdt_refresh; 44 int wdt_refresh;
48 bool enabled; 45 bool enabled;
49 bool external; 46 bool external;
50 bool power_path;
51}; 47};
52 48
53extern struct blocking_notifier_head charger_notifier_list; 49extern struct blocking_notifier_head charger_notifier_list;
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index f72dc53848d7..0013075d4cda 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -56,6 +56,7 @@
56#define ARIZONA_MAX_PDM_SPK 2 56#define ARIZONA_MAX_PDM_SPK 2
57 57
58struct regulator_init_data; 58struct regulator_init_data;
59struct gpio_desc;
59 60
60struct arizona_micbias { 61struct arizona_micbias {
61 int mV; /** Regulated voltage */ 62 int mV; /** Regulated voltage */
@@ -77,7 +78,7 @@ struct arizona_micd_range {
77}; 78};
78 79
79struct arizona_pdata { 80struct arizona_pdata {
80 int reset; /** GPIO controlling /RESET, if any */ 81 struct gpio_desc *reset; /** GPIO controlling /RESET, if any */
81 82
82 /** Regulator configuration for MICVDD */ 83 /** Regulator configuration for MICVDD */
83 struct arizona_micsupp_pdata micvdd; 84 struct arizona_micsupp_pdata micvdd;
diff --git a/include/linux/mfd/as3711.h b/include/linux/mfd/as3711.h
index 34cc85864be5..ddd0b953323b 100644
--- a/include/linux/mfd/as3711.h
+++ b/include/linux/mfd/as3711.h
@@ -108,9 +108,9 @@ struct as3711_regulator_pdata {
108}; 108};
109 109
110struct as3711_bl_pdata { 110struct as3711_bl_pdata {
111 const char *su1_fb; 111 bool su1_fb;
112 int su1_max_uA; 112 int su1_max_uA;
113 const char *su2_fb; 113 bool su2_fb;
114 int su2_max_uA; 114 int su2_max_uA;
115 enum as3711_su2_feedback su2_feedback; 115 enum as3711_su2_feedback su2_feedback;
116 enum as3711_su2_fbprot su2_fbprot; 116 enum as3711_su2_fbprot su2_fbprot;
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index 82bf7747b312..517e60eecbcb 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -592,11 +592,11 @@ enum axp806_irqs {
592 AXP806_IRQ_DCDCC_V_LOW, 592 AXP806_IRQ_DCDCC_V_LOW,
593 AXP806_IRQ_DCDCD_V_LOW, 593 AXP806_IRQ_DCDCD_V_LOW,
594 AXP806_IRQ_DCDCE_V_LOW, 594 AXP806_IRQ_DCDCE_V_LOW,
595 AXP806_IRQ_PWROK_LONG, 595 AXP806_IRQ_POK_LONG,
596 AXP806_IRQ_PWROK_SHORT, 596 AXP806_IRQ_POK_SHORT,
597 AXP806_IRQ_WAKEUP, 597 AXP806_IRQ_WAKEUP,
598 AXP806_IRQ_PWROK_FALL, 598 AXP806_IRQ_POK_FALL,
599 AXP806_IRQ_PWROK_RISE, 599 AXP806_IRQ_POK_RISE,
600}; 600};
601 601
602enum axp809_irqs { 602enum axp809_irqs {
@@ -642,7 +642,7 @@ struct axp20x_dev {
642 struct regmap_irq_chip_data *regmap_irqc; 642 struct regmap_irq_chip_data *regmap_irqc;
643 long variant; 643 long variant;
644 int nr_cells; 644 int nr_cells;
645 struct mfd_cell *cells; 645 const struct mfd_cell *cells;
646 const struct regmap_config *regmap_cfg; 646 const struct regmap_config *regmap_cfg;
647 const struct regmap_irq_chip *regmap_irq_chip; 647 const struct regmap_irq_chip *regmap_irq_chip;
648}; 648};
diff --git a/include/linux/mfd/bd9571mwv.h b/include/linux/mfd/bd9571mwv.h
index f0708ba4cbba..eb05569f752b 100644
--- a/include/linux/mfd/bd9571mwv.h
+++ b/include/linux/mfd/bd9571mwv.h
@@ -33,6 +33,11 @@
33#define BD9571MWV_I2C_MD2_E1_BIT_2 0x12 33#define BD9571MWV_I2C_MD2_E1_BIT_2 0x12
34 34
35#define BD9571MWV_BKUP_MODE_CNT 0x20 35#define BD9571MWV_BKUP_MODE_CNT 0x20
36#define BD9571MWV_BKUP_MODE_CNT_KEEPON_MASK GENMASK(3, 0)
37#define BD9571MWV_BKUP_MODE_CNT_KEEPON_DDR0 BIT(0)
38#define BD9571MWV_BKUP_MODE_CNT_KEEPON_DDR1 BIT(1)
39#define BD9571MWV_BKUP_MODE_CNT_KEEPON_DDR0C BIT(2)
40#define BD9571MWV_BKUP_MODE_CNT_KEEPON_DDR1C BIT(3)
36#define BD9571MWV_BKUP_MODE_STATUS 0x21 41#define BD9571MWV_BKUP_MODE_STATUS 0x21
37#define BD9571MWV_BKUP_RECOVERY_CNT 0x22 42#define BD9571MWV_BKUP_RECOVERY_CNT 0x22
38#define BD9571MWV_BKUP_CTRL_TIM_CNT 0x23 43#define BD9571MWV_BKUP_CTRL_TIM_CNT 0x23
diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h
index f09e9cf2e4ab..32421dfeb996 100644
--- a/include/linux/mfd/cros_ec.h
+++ b/include/linux/mfd/cros_ec.h
@@ -329,23 +329,7 @@ extern struct attribute_group cros_ec_vbc_attr_group;
329/* debugfs stuff */ 329/* debugfs stuff */
330int cros_ec_debugfs_init(struct cros_ec_dev *ec); 330int cros_ec_debugfs_init(struct cros_ec_dev *ec);
331void cros_ec_debugfs_remove(struct cros_ec_dev *ec); 331void cros_ec_debugfs_remove(struct cros_ec_dev *ec);
332 332void cros_ec_debugfs_suspend(struct cros_ec_dev *ec);
333/* ACPI GPE handler */ 333void cros_ec_debugfs_resume(struct cros_ec_dev *ec);
334#ifdef CONFIG_ACPI
335
336int cros_ec_acpi_install_gpe_handler(struct device *dev);
337void cros_ec_acpi_remove_gpe_handler(void);
338void cros_ec_acpi_clear_gpe(void);
339
340#else /* CONFIG_ACPI */
341
342static inline int cros_ec_acpi_install_gpe_handler(struct device *dev)
343{
344 return -ENODEV;
345}
346static inline void cros_ec_acpi_remove_gpe_handler(void) {}
347static inline void cros_ec_acpi_clear_gpe(void) {}
348
349#endif /* CONFIG_ACPI */
350 334
351#endif /* __LINUX_MFD_CROS_EC_H */ 335#endif /* __LINUX_MFD_CROS_EC_H */
diff --git a/include/linux/mfd/lp8788.h b/include/linux/mfd/lp8788.h
index 786bf6679a28..2010e0de3e34 100644
--- a/include/linux/mfd/lp8788.h
+++ b/include/linux/mfd/lp8788.h
@@ -182,20 +182,6 @@ struct lp8788_buck2_dvs {
182}; 182};
183 183
184/* 184/*
185 * struct lp8788_ldo_enable_pin
186 *
187 * Basically, all LDOs are enabled through the I2C commands.
188 * But ALDO 1 ~ 5, 7, DLDO 7, 9, 11 can be enabled by external gpio pins.
189 *
190 * @gpio : gpio number which is used for enabling ldos
191 * @init_state : initial gpio state (ex. GPIOF_OUT_INIT_LOW)
192 */
193struct lp8788_ldo_enable_pin {
194 int gpio;
195 int init_state;
196};
197
198/*
199 * struct lp8788_chg_param 185 * struct lp8788_chg_param
200 * @addr : charging control register address (range : 0x11 ~ 0x1C) 186 * @addr : charging control register address (range : 0x11 ~ 0x1C)
201 * @val : charging parameter value 187 * @val : charging parameter value
@@ -288,7 +274,6 @@ struct lp8788_vib_platform_data {
288 * @aldo_data : regulator initial data for analog ldo 274 * @aldo_data : regulator initial data for analog ldo
289 * @buck1_dvs : gpio configurations for buck1 dvs 275 * @buck1_dvs : gpio configurations for buck1 dvs
290 * @buck2_dvs : gpio configurations for buck2 dvs 276 * @buck2_dvs : gpio configurations for buck2 dvs
291 * @ldo_pin : gpio configurations for enabling LDOs
292 * @chg_pdata : platform data for charger driver 277 * @chg_pdata : platform data for charger driver
293 * @alarm_sel : rtc alarm selection (1 or 2) 278 * @alarm_sel : rtc alarm selection (1 or 2)
294 * @bl_pdata : configurable data for backlight driver 279 * @bl_pdata : configurable data for backlight driver
@@ -306,7 +291,6 @@ struct lp8788_platform_data {
306 struct regulator_init_data *aldo_data[LP8788_NUM_ALDOS]; 291 struct regulator_init_data *aldo_data[LP8788_NUM_ALDOS];
307 struct lp8788_buck1_dvs *buck1_dvs; 292 struct lp8788_buck1_dvs *buck1_dvs;
308 struct lp8788_buck2_dvs *buck2_dvs; 293 struct lp8788_buck2_dvs *buck2_dvs;
309 struct lp8788_ldo_enable_pin *ldo_pin[EN_LDOS_MAX];
310 294
311 /* charger */ 295 /* charger */
312 struct lp8788_charger_platform_data *chg_pdata; 296 struct lp8788_charger_platform_data *chg_pdata;
diff --git a/include/linux/mfd/rave-sp.h b/include/linux/mfd/rave-sp.h
index 796fb9794c9e..fe0ce7bc59cf 100644
--- a/include/linux/mfd/rave-sp.h
+++ b/include/linux/mfd/rave-sp.h
@@ -21,6 +21,7 @@ enum rave_sp_command {
21 RAVE_SP_CMD_STATUS = 0xA0, 21 RAVE_SP_CMD_STATUS = 0xA0,
22 RAVE_SP_CMD_SW_WDT = 0xA1, 22 RAVE_SP_CMD_SW_WDT = 0xA1,
23 RAVE_SP_CMD_PET_WDT = 0xA2, 23 RAVE_SP_CMD_PET_WDT = 0xA2,
24 RAVE_SP_CMD_SET_BACKLIGHT = 0xA6,
24 RAVE_SP_CMD_RESET = 0xA7, 25 RAVE_SP_CMD_RESET = 0xA7,
25 RAVE_SP_CMD_RESET_REASON = 0xA8, 26 RAVE_SP_CMD_RESET_REASON = 0xA8,
26 27
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index 5a23dd4df432..28f4ae76271d 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -39,6 +39,8 @@
39#define STEP_12_5_MV 12500 39#define STEP_12_5_MV 12500
40#define STEP_6_25_MV 6250 40#define STEP_6_25_MV 6250
41 41
42struct gpio_desc;
43
42enum sec_device_type { 44enum sec_device_type {
43 S5M8751X, 45 S5M8751X,
44 S5M8763X, 46 S5M8763X,
@@ -151,7 +153,7 @@ struct sec_regulator_data {
151 int id; 153 int id;
152 struct regulator_init_data *initdata; 154 struct regulator_init_data *initdata;
153 struct device_node *reg_node; 155 struct device_node *reg_node;
154 int ext_control_gpio; 156 struct gpio_desc *ext_control_gpiod;
155}; 157};
156 158
157/* 159/*
diff --git a/include/linux/mfd/stm32-timers.h b/include/linux/mfd/stm32-timers.h
index 2aadab6f34a1..067d14655c28 100644
--- a/include/linux/mfd/stm32-timers.h
+++ b/include/linux/mfd/stm32-timers.h
@@ -8,6 +8,8 @@
8#define _LINUX_STM32_GPTIMER_H_ 8#define _LINUX_STM32_GPTIMER_H_
9 9
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/dmaengine.h>
12#include <linux/dma-mapping.h>
11#include <linux/regmap.h> 13#include <linux/regmap.h>
12 14
13#define TIM_CR1 0x00 /* Control Register 1 */ 15#define TIM_CR1 0x00 /* Control Register 1 */
@@ -27,6 +29,8 @@
27#define TIM_CCR3 0x3C /* Capt/Comp Register 3 */ 29#define TIM_CCR3 0x3C /* Capt/Comp Register 3 */
28#define TIM_CCR4 0x40 /* Capt/Comp Register 4 */ 30#define TIM_CCR4 0x40 /* Capt/Comp Register 4 */
29#define TIM_BDTR 0x44 /* Break and Dead-Time Reg */ 31#define TIM_BDTR 0x44 /* Break and Dead-Time Reg */
32#define TIM_DCR 0x48 /* DMA control register */
33#define TIM_DMAR 0x4C /* DMA register for transfer */
30 34
31#define TIM_CR1_CEN BIT(0) /* Counter Enable */ 35#define TIM_CR1_CEN BIT(0) /* Counter Enable */
32#define TIM_CR1_DIR BIT(4) /* Counter Direction */ 36#define TIM_CR1_DIR BIT(4) /* Counter Direction */
@@ -36,17 +40,35 @@
36#define TIM_SMCR_SMS (BIT(0) | BIT(1) | BIT(2)) /* Slave mode selection */ 40#define TIM_SMCR_SMS (BIT(0) | BIT(1) | BIT(2)) /* Slave mode selection */
37#define TIM_SMCR_TS (BIT(4) | BIT(5) | BIT(6)) /* Trigger selection */ 41#define TIM_SMCR_TS (BIT(4) | BIT(5) | BIT(6)) /* Trigger selection */
38#define TIM_DIER_UIE BIT(0) /* Update interrupt */ 42#define TIM_DIER_UIE BIT(0) /* Update interrupt */
43#define TIM_DIER_UDE BIT(8) /* Update DMA request Enable */
44#define TIM_DIER_CC1DE BIT(9) /* CC1 DMA request Enable */
45#define TIM_DIER_CC2DE BIT(10) /* CC2 DMA request Enable */
46#define TIM_DIER_CC3DE BIT(11) /* CC3 DMA request Enable */
47#define TIM_DIER_CC4DE BIT(12) /* CC4 DMA request Enable */
48#define TIM_DIER_COMDE BIT(13) /* COM DMA request Enable */
49#define TIM_DIER_TDE BIT(14) /* Trigger DMA request Enable */
39#define TIM_SR_UIF BIT(0) /* Update interrupt flag */ 50#define TIM_SR_UIF BIT(0) /* Update interrupt flag */
40#define TIM_EGR_UG BIT(0) /* Update Generation */ 51#define TIM_EGR_UG BIT(0) /* Update Generation */
41#define TIM_CCMR_PE BIT(3) /* Channel Preload Enable */ 52#define TIM_CCMR_PE BIT(3) /* Channel Preload Enable */
42#define TIM_CCMR_M1 (BIT(6) | BIT(5)) /* Channel PWM Mode 1 */ 53#define TIM_CCMR_M1 (BIT(6) | BIT(5)) /* Channel PWM Mode 1 */
54#define TIM_CCMR_CC1S (BIT(0) | BIT(1)) /* Capture/compare 1 sel */
55#define TIM_CCMR_IC1PSC GENMASK(3, 2) /* Input capture 1 prescaler */
56#define TIM_CCMR_CC2S (BIT(8) | BIT(9)) /* Capture/compare 2 sel */
57#define TIM_CCMR_IC2PSC GENMASK(11, 10) /* Input capture 2 prescaler */
58#define TIM_CCMR_CC1S_TI1 BIT(0) /* IC1/IC3 selects TI1/TI3 */
59#define TIM_CCMR_CC1S_TI2 BIT(1) /* IC1/IC3 selects TI2/TI4 */
60#define TIM_CCMR_CC2S_TI2 BIT(8) /* IC2/IC4 selects TI2/TI4 */
61#define TIM_CCMR_CC2S_TI1 BIT(9) /* IC2/IC4 selects TI1/TI3 */
43#define TIM_CCER_CC1E BIT(0) /* Capt/Comp 1 out Ena */ 62#define TIM_CCER_CC1E BIT(0) /* Capt/Comp 1 out Ena */
44#define TIM_CCER_CC1P BIT(1) /* Capt/Comp 1 Polarity */ 63#define TIM_CCER_CC1P BIT(1) /* Capt/Comp 1 Polarity */
45#define TIM_CCER_CC1NE BIT(2) /* Capt/Comp 1N out Ena */ 64#define TIM_CCER_CC1NE BIT(2) /* Capt/Comp 1N out Ena */
46#define TIM_CCER_CC1NP BIT(3) /* Capt/Comp 1N Polarity */ 65#define TIM_CCER_CC1NP BIT(3) /* Capt/Comp 1N Polarity */
47#define TIM_CCER_CC2E BIT(4) /* Capt/Comp 2 out Ena */ 66#define TIM_CCER_CC2E BIT(4) /* Capt/Comp 2 out Ena */
67#define TIM_CCER_CC2P BIT(5) /* Capt/Comp 2 Polarity */
48#define TIM_CCER_CC3E BIT(8) /* Capt/Comp 3 out Ena */ 68#define TIM_CCER_CC3E BIT(8) /* Capt/Comp 3 out Ena */
69#define TIM_CCER_CC3P BIT(9) /* Capt/Comp 3 Polarity */
49#define TIM_CCER_CC4E BIT(12) /* Capt/Comp 4 out Ena */ 70#define TIM_CCER_CC4E BIT(12) /* Capt/Comp 4 out Ena */
71#define TIM_CCER_CC4P BIT(13) /* Capt/Comp 4 Polarity */
50#define TIM_CCER_CCXE (BIT(0) | BIT(4) | BIT(8) | BIT(12)) 72#define TIM_CCER_CCXE (BIT(0) | BIT(4) | BIT(8) | BIT(12))
51#define TIM_BDTR_BKE BIT(12) /* Break input enable */ 73#define TIM_BDTR_BKE BIT(12) /* Break input enable */
52#define TIM_BDTR_BKP BIT(13) /* Break input polarity */ 74#define TIM_BDTR_BKP BIT(13) /* Break input polarity */
@@ -56,8 +78,11 @@
56#define TIM_BDTR_BK2F (BIT(20) | BIT(21) | BIT(22) | BIT(23)) 78#define TIM_BDTR_BK2F (BIT(20) | BIT(21) | BIT(22) | BIT(23))
57#define TIM_BDTR_BK2E BIT(24) /* Break 2 input enable */ 79#define TIM_BDTR_BK2E BIT(24) /* Break 2 input enable */
58#define TIM_BDTR_BK2P BIT(25) /* Break 2 input polarity */ 80#define TIM_BDTR_BK2P BIT(25) /* Break 2 input polarity */
81#define TIM_DCR_DBA GENMASK(4, 0) /* DMA base addr */
82#define TIM_DCR_DBL GENMASK(12, 8) /* DMA burst len */
59 83
60#define MAX_TIM_PSC 0xFFFF 84#define MAX_TIM_PSC 0xFFFF
85#define MAX_TIM_ICPSC 0x3
61#define TIM_CR2_MMS_SHIFT 4 86#define TIM_CR2_MMS_SHIFT 4
62#define TIM_CR2_MMS2_SHIFT 20 87#define TIM_CR2_MMS2_SHIFT 20
63#define TIM_SMCR_TS_SHIFT 4 88#define TIM_SMCR_TS_SHIFT 4
@@ -65,9 +90,54 @@
65#define TIM_BDTR_BKF_SHIFT 16 90#define TIM_BDTR_BKF_SHIFT 16
66#define TIM_BDTR_BK2F_SHIFT 20 91#define TIM_BDTR_BK2F_SHIFT 20
67 92
93enum stm32_timers_dmas {
94 STM32_TIMERS_DMA_CH1,
95 STM32_TIMERS_DMA_CH2,
96 STM32_TIMERS_DMA_CH3,
97 STM32_TIMERS_DMA_CH4,
98 STM32_TIMERS_DMA_UP,
99 STM32_TIMERS_DMA_TRIG,
100 STM32_TIMERS_DMA_COM,
101 STM32_TIMERS_MAX_DMAS,
102};
103
104/**
105 * struct stm32_timers_dma - STM32 timer DMA handling.
106 * @completion: end of DMA transfer completion
107 * @phys_base: control registers physical base address
108 * @lock: protect DMA access
109 * @chan: DMA channel in use
110 * @chans: DMA channels available for this timer instance
111 */
112struct stm32_timers_dma {
113 struct completion completion;
114 phys_addr_t phys_base;
115 struct mutex lock;
116 struct dma_chan *chan;
117 struct dma_chan *chans[STM32_TIMERS_MAX_DMAS];
118};
119
68struct stm32_timers { 120struct stm32_timers {
69 struct clk *clk; 121 struct clk *clk;
70 struct regmap *regmap; 122 struct regmap *regmap;
71 u32 max_arr; 123 u32 max_arr;
124 struct stm32_timers_dma dma; /* Only to be used by the parent */
72}; 125};
126
127#if IS_REACHABLE(CONFIG_MFD_STM32_TIMERS)
128int stm32_timers_dma_burst_read(struct device *dev, u32 *buf,
129 enum stm32_timers_dmas id, u32 reg,
130 unsigned int num_reg, unsigned int bursts,
131 unsigned long tmo_ms);
132#else
133static inline int stm32_timers_dma_burst_read(struct device *dev, u32 *buf,
134 enum stm32_timers_dmas id,
135 u32 reg,
136 unsigned int num_reg,
137 unsigned int bursts,
138 unsigned long tmo_ms)
139{
140 return -ENODEV;
141}
142#endif
73#endif 143#endif
diff --git a/include/linux/mfd/syscon/exynos4-pmu.h b/include/linux/mfd/syscon/exynos4-pmu.h
deleted file mode 100644
index 278b1b1549e9..000000000000
--- a/include/linux/mfd/syscon/exynos4-pmu.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * Copyright (C) 2015 Samsung Electronics Co., Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _LINUX_MFD_SYSCON_PMU_EXYNOS4_H_
10#define _LINUX_MFD_SYSCON_PMU_EXYNOS4_H_
11
12/* Exynos4 PMU register definitions */
13
14/* MIPI_PHYn_CONTROL register offset: n = 0..1 */
15#define EXYNOS4_MIPI_PHY_CONTROL(n) (0x710 + (n) * 4)
16#define EXYNOS4_MIPI_PHY_ENABLE (1 << 0)
17#define EXYNOS4_MIPI_PHY_SRESETN (1 << 1)
18#define EXYNOS4_MIPI_PHY_MRESETN (1 << 2)
19#define EXYNOS4_MIPI_PHY_RESET_MASK (3 << 1)
20
21#endif /* _LINUX_MFD_SYSCON_PMU_EXYNOS4_H_ */
diff --git a/include/linux/mfd/syscon/exynos5-pmu.h b/include/linux/mfd/syscon/exynos5-pmu.h
deleted file mode 100644
index b4942a32b81d..000000000000
--- a/include/linux/mfd/syscon/exynos5-pmu.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Exynos5 SoC series Power Management Unit (PMU) register offsets
3 * and bit definitions.
4 *
5 * Copyright (C) 2014 Samsung Electronics Co., Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef _LINUX_MFD_SYSCON_PMU_EXYNOS5_H_
13#define _LINUX_MFD_SYSCON_PMU_EXYNOS5_H_
14
15#define EXYNOS5_PHY_ENABLE BIT(0)
16#define EXYNOS5_MIPI_PHY_S_RESETN BIT(1)
17#define EXYNOS5_MIPI_PHY_M_RESETN BIT(2)
18
19#endif /* _LINUX_MFD_SYSCON_PMU_EXYNOS5_H_ */
diff --git a/include/linux/mfd/tps65090.h b/include/linux/mfd/tps65090.h
index 67d144b3b8f9..f05bf4a146e2 100644
--- a/include/linux/mfd/tps65090.h
+++ b/include/linux/mfd/tps65090.h
@@ -83,6 +83,8 @@ enum {
83#define TPS65090_MAX_REG TPS65090_REG_AD_OUT2 83#define TPS65090_MAX_REG TPS65090_REG_AD_OUT2
84#define TPS65090_NUM_REGS (TPS65090_MAX_REG + 1) 84#define TPS65090_NUM_REGS (TPS65090_MAX_REG + 1)
85 85
86struct gpio_desc;
87
86struct tps65090 { 88struct tps65090 {
87 struct device *dev; 89 struct device *dev;
88 struct regmap *rmap; 90 struct regmap *rmap;
@@ -95,8 +97,8 @@ struct tps65090 {
95 * @reg_init_data: The regulator init data. 97 * @reg_init_data: The regulator init data.
96 * @enable_ext_control: Enable extrenal control or not. Only available for 98 * @enable_ext_control: Enable extrenal control or not. Only available for
97 * DCDC1, DCDC2 and DCDC3. 99 * DCDC1, DCDC2 and DCDC3.
98 * @gpio: Gpio number if external control is enabled and controlled through 100 * @gpiod: Gpio descriptor if external control is enabled and controlled through
99 * gpio. 101 * gpio
100 * @overcurrent_wait_valid: True if the overcurrent_wait should be applied. 102 * @overcurrent_wait_valid: True if the overcurrent_wait should be applied.
101 * @overcurrent_wait: Value to set as the overcurrent wait time. This is the 103 * @overcurrent_wait: Value to set as the overcurrent wait time. This is the
102 * actual bitfield value, not a time in ms (valid value are 0 - 3). 104 * actual bitfield value, not a time in ms (valid value are 0 - 3).
@@ -104,7 +106,7 @@ struct tps65090 {
104struct tps65090_regulator_plat_data { 106struct tps65090_regulator_plat_data {
105 struct regulator_init_data *reg_init_data; 107 struct regulator_init_data *reg_init_data;
106 bool enable_ext_control; 108 bool enable_ext_control;
107 int gpio; 109 struct gpio_desc *gpiod;
108 bool overcurrent_wait_valid; 110 bool overcurrent_wait_valid;
109 int overcurrent_wait; 111 int overcurrent_wait;
110}; 112};
diff --git a/include/linux/mfd/tps65218.h b/include/linux/mfd/tps65218.h
index f069c518c0ed..c204d9a79436 100644
--- a/include/linux/mfd/tps65218.h
+++ b/include/linux/mfd/tps65218.h
@@ -205,10 +205,10 @@ enum tps65218_regulator_id {
205 TPS65218_DCDC_4, 205 TPS65218_DCDC_4,
206 TPS65218_DCDC_5, 206 TPS65218_DCDC_5,
207 TPS65218_DCDC_6, 207 TPS65218_DCDC_6,
208 /* LS's */
209 TPS65218_LS_3,
210 /* LDOs */ 208 /* LDOs */
211 TPS65218_LDO_1, 209 TPS65218_LDO_1,
210 /* LS's */
211 TPS65218_LS_3,
212}; 212};
213 213
214#define TPS65218_MAX_REG_ID TPS65218_LDO_1 214#define TPS65218_MAX_REG_ID TPS65218_LDO_1
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index 2fe68e481230..b19c2801a30e 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -18,6 +18,7 @@
18#define TPS658621A 0x15 18#define TPS658621A 0x15
19#define TPS658621CD 0x2c 19#define TPS658621CD 0x2c
20#define TPS658623 0x1b 20#define TPS658623 0x1b
21#define TPS658624 0x0a
21#define TPS658640 0x01 22#define TPS658640 0x01
22#define TPS658640v2 0x02 23#define TPS658640v2 0x02
23#define TPS658643 0x03 24#define TPS658643 0x03
diff --git a/include/linux/mfd/tps68470.h b/include/linux/mfd/tps68470.h
index 44f9d9f647ed..ffe81127d91c 100644
--- a/include/linux/mfd/tps68470.h
+++ b/include/linux/mfd/tps68470.h
@@ -1,17 +1,6 @@
1/* 1/* SPDX-License-Identifier: GPL-2.0 */
2 * Copyright (c) 2017 Intel Corporation 2/* Copyright (C) 2017 Intel Corporation */
3 * 3/* Functions to access TPS68470 power management chip. */
4 * Functions to access TPS68470 power management chip.
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 4
16#ifndef __LINUX_MFD_TPS68470_H 5#ifndef __LINUX_MFD_TPS68470_H
17#define __LINUX_MFD_TPS68470_H 6#define __LINUX_MFD_TPS68470_H
diff --git a/include/linux/mlx5/eswitch.h b/include/linux/mlx5/eswitch.h
index d3c9db492b30..fab5121ffb8f 100644
--- a/include/linux/mlx5/eswitch.h
+++ b/include/linux/mlx5/eswitch.h
@@ -8,6 +8,8 @@
8 8
9#include <linux/mlx5/driver.h> 9#include <linux/mlx5/driver.h>
10 10
11#define MLX5_ESWITCH_MANAGER(mdev) MLX5_CAP_GEN(mdev, eswitch_manager)
12
11enum { 13enum {
12 SRIOV_NONE, 14 SRIOV_NONE,
13 SRIOV_LEGACY, 15 SRIOV_LEGACY,
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 27134c4fcb76..ac281f5ec9b8 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -922,7 +922,7 @@ struct mlx5_ifc_cmd_hca_cap_bits {
922 u8 vnic_env_queue_counters[0x1]; 922 u8 vnic_env_queue_counters[0x1];
923 u8 ets[0x1]; 923 u8 ets[0x1];
924 u8 nic_flow_table[0x1]; 924 u8 nic_flow_table[0x1];
925 u8 eswitch_flow_table[0x1]; 925 u8 eswitch_manager[0x1];
926 u8 device_memory[0x1]; 926 u8 device_memory[0x1];
927 u8 mcam_reg[0x1]; 927 u8 mcam_reg[0x1];
928 u8 pcam_reg[0x1]; 928 u8 pcam_reg[0x1];
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 4c3881b44ef1..a0fbb9ffe380 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -575,6 +575,11 @@ static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags)
575 return kvmalloc(bytes, flags); 575 return kvmalloc(bytes, flags);
576} 576}
577 577
578static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
579{
580 return kvmalloc_array(n, size, flags | __GFP_ZERO);
581}
582
578extern void kvfree(const void *addr); 583extern void kvfree(const void *addr);
579 584
580static inline atomic_t *compound_mapcount_ptr(struct page *page) 585static inline atomic_t *compound_mapcount_ptr(struct page *page)
@@ -830,27 +835,65 @@ static inline bool is_zone_device_page(const struct page *page)
830} 835}
831#endif 836#endif
832 837
833#if defined(CONFIG_DEVICE_PRIVATE) || defined(CONFIG_DEVICE_PUBLIC) 838#ifdef CONFIG_DEV_PAGEMAP_OPS
834void put_zone_device_private_or_public_page(struct page *page); 839void dev_pagemap_get_ops(void);
835DECLARE_STATIC_KEY_FALSE(device_private_key); 840void dev_pagemap_put_ops(void);
836#define IS_HMM_ENABLED static_branch_unlikely(&device_private_key) 841void __put_devmap_managed_page(struct page *page);
837static inline bool is_device_private_page(const struct page *page); 842DECLARE_STATIC_KEY_FALSE(devmap_managed_key);
838static inline bool is_device_public_page(const struct page *page); 843static inline bool put_devmap_managed_page(struct page *page)
839#else /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */
840static inline void put_zone_device_private_or_public_page(struct page *page)
841{ 844{
845 if (!static_branch_unlikely(&devmap_managed_key))
846 return false;
847 if (!is_zone_device_page(page))
848 return false;
849 switch (page->pgmap->type) {
850 case MEMORY_DEVICE_PRIVATE:
851 case MEMORY_DEVICE_PUBLIC:
852 case MEMORY_DEVICE_FS_DAX:
853 __put_devmap_managed_page(page);
854 return true;
855 default:
856 break;
857 }
858 return false;
842} 859}
843#define IS_HMM_ENABLED 0 860
844static inline bool is_device_private_page(const struct page *page) 861static inline bool is_device_private_page(const struct page *page)
845{ 862{
846 return false; 863 return is_zone_device_page(page) &&
864 page->pgmap->type == MEMORY_DEVICE_PRIVATE;
847} 865}
866
848static inline bool is_device_public_page(const struct page *page) 867static inline bool is_device_public_page(const struct page *page)
849{ 868{
869 return is_zone_device_page(page) &&
870 page->pgmap->type == MEMORY_DEVICE_PUBLIC;
871}
872
873#else /* CONFIG_DEV_PAGEMAP_OPS */
874static inline void dev_pagemap_get_ops(void)
875{
876}
877
878static inline void dev_pagemap_put_ops(void)
879{
880}
881
882static inline bool put_devmap_managed_page(struct page *page)
883{
884 return false;
885}
886
887static inline bool is_device_private_page(const struct page *page)
888{
850 return false; 889 return false;
851} 890}
852#endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */
853 891
892static inline bool is_device_public_page(const struct page *page)
893{
894 return false;
895}
896#endif /* CONFIG_DEV_PAGEMAP_OPS */
854 897
855static inline void get_page(struct page *page) 898static inline void get_page(struct page *page)
856{ 899{
@@ -868,16 +911,13 @@ static inline void put_page(struct page *page)
868 page = compound_head(page); 911 page = compound_head(page);
869 912
870 /* 913 /*
871 * For private device pages we need to catch refcount transition from 914 * For devmap managed pages we need to catch refcount transition from
872 * 2 to 1, when refcount reach one it means the private device page is 915 * 2 to 1, when refcount reach one it means the page is free and we
873 * free and we need to inform the device driver through callback. See 916 * need to inform the device driver through callback. See
874 * include/linux/memremap.h and HMM for details. 917 * include/linux/memremap.h and HMM for details.
875 */ 918 */
876 if (IS_HMM_ENABLED && unlikely(is_device_private_page(page) || 919 if (put_devmap_managed_page(page))
877 unlikely(is_device_public_page(page)))) {
878 put_zone_device_private_or_public_page(page);
879 return; 920 return;
880 }
881 921
882 if (put_page_testzero(page)) 922 if (put_page_testzero(page))
883 __put_page(page); 923 __put_page(page);
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 2014bd19f28e..96a71a648eed 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -501,6 +501,7 @@ enum dmi_field {
501 DMI_PRODUCT_VERSION, 501 DMI_PRODUCT_VERSION,
502 DMI_PRODUCT_SERIAL, 502 DMI_PRODUCT_SERIAL,
503 DMI_PRODUCT_UUID, 503 DMI_PRODUCT_UUID,
504 DMI_PRODUCT_SKU,
504 DMI_PRODUCT_FAMILY, 505 DMI_PRODUCT_FAMILY,
505 DMI_BOARD_VENDOR, 506 DMI_BOARD_VENDOR,
506 DMI_BOARD_NAME, 507 DMI_BOARD_NAME,
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 792ea5c26329..abe975c87b90 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -86,6 +86,7 @@ struct nand_pos {
86 * @ooboffs: the OOB offset within the page 86 * @ooboffs: the OOB offset within the page
87 * @ooblen: the number of OOB bytes to read from/write to this page 87 * @ooblen: the number of OOB bytes to read from/write to this page
88 * @oobbuf: buffer to store OOB data in or get OOB data from 88 * @oobbuf: buffer to store OOB data in or get OOB data from
89 * @mode: one of the %MTD_OPS_XXX mode
89 * 90 *
90 * This object is used to pass per-page I/O requests to NAND sub-layers. This 91 * This object is used to pass per-page I/O requests to NAND sub-layers. This
91 * way all useful information are already formatted in a useful way and 92 * way all useful information are already formatted in a useful way and
@@ -106,6 +107,7 @@ struct nand_page_io_req {
106 const void *out; 107 const void *out;
107 void *in; 108 void *in;
108 } oobbuf; 109 } oobbuf;
110 int mode;
109}; 111};
110 112
111/** 113/**
@@ -599,6 +601,7 @@ static inline void nanddev_io_iter_init(struct nand_device *nand,
599{ 601{
600 struct mtd_info *mtd = nanddev_to_mtd(nand); 602 struct mtd_info *mtd = nanddev_to_mtd(nand);
601 603
604 iter->req.mode = req->mode;
602 iter->req.dataoffs = nanddev_offs_to_pos(nand, offs, &iter->req.pos); 605 iter->req.dataoffs = nanddev_offs_to_pos(nand, offs, &iter->req.pos);
603 iter->req.ooboffs = req->ooboffs; 606 iter->req.ooboffs = req->ooboffs;
604 iter->oobbytes_per_page = mtd_oobavail(mtd, req); 607 iter->oobbytes_per_page = mtd_oobavail(mtd, req);
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 17c919436f48..3e8ec3b8a39c 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -28,7 +28,14 @@ struct nand_flash_dev;
28struct device_node; 28struct device_node;
29 29
30/* Scan and identify a NAND device */ 30/* Scan and identify a NAND device */
31int nand_scan(struct mtd_info *mtd, int max_chips); 31int nand_scan_with_ids(struct mtd_info *mtd, int max_chips,
32 struct nand_flash_dev *ids);
33
34static inline int nand_scan(struct mtd_info *mtd, int max_chips)
35{
36 return nand_scan_with_ids(mtd, max_chips, NULL);
37}
38
32/* 39/*
33 * Separate phases of nand_scan(), allowing board driver to intervene 40 * Separate phases of nand_scan(), allowing board driver to intervene
34 * and override command or ECC setup according to flash type. 41 * and override command or ECC setup according to flash type.
@@ -740,8 +747,9 @@ enum nand_data_interface_type {
740 747
741/** 748/**
742 * struct nand_data_interface - NAND interface timing 749 * struct nand_data_interface - NAND interface timing
743 * @type: type of the timing 750 * @type: type of the timing
744 * @timings: The timing, type according to @type 751 * @timings: The timing, type according to @type
752 * @timings.sdr: Use it when @type is %NAND_SDR_IFACE.
745 */ 753 */
746struct nand_data_interface { 754struct nand_data_interface {
747 enum nand_data_interface_type type; 755 enum nand_data_interface_type type;
@@ -798,8 +806,9 @@ struct nand_op_addr_instr {
798/** 806/**
799 * struct nand_op_data_instr - Definition of a data instruction 807 * struct nand_op_data_instr - Definition of a data instruction
800 * @len: number of data bytes to move 808 * @len: number of data bytes to move
801 * @in: buffer to fill when reading from the NAND chip 809 * @buf: buffer to fill
802 * @out: buffer to read from when writing to the NAND chip 810 * @buf.in: buffer to fill when reading from the NAND chip
811 * @buf.out: buffer to read from when writing to the NAND chip
803 * @force_8bit: force 8-bit access 812 * @force_8bit: force 8-bit access
804 * 813 *
805 * Please note that "in" and "out" are inverted from the ONFI specification 814 * Please note that "in" and "out" are inverted from the ONFI specification
@@ -842,9 +851,13 @@ enum nand_op_instr_type {
842/** 851/**
843 * struct nand_op_instr - Instruction object 852 * struct nand_op_instr - Instruction object
844 * @type: the instruction type 853 * @type: the instruction type
845 * @cmd/@addr/@data/@waitrdy: extra data associated to the instruction. 854 * @ctx: extra data associated to the instruction. You'll have to use the
846 * You'll have to use the appropriate element 855 * appropriate element depending on @type
847 * depending on @type 856 * @ctx.cmd: use it if @type is %NAND_OP_CMD_INSTR
857 * @ctx.addr: use it if @type is %NAND_OP_ADDR_INSTR
858 * @ctx.data: use it if @type is %NAND_OP_DATA_IN_INSTR
859 * or %NAND_OP_DATA_OUT_INSTR
860 * @ctx.waitrdy: use it if @type is %NAND_OP_WAITRDY_INSTR
848 * @delay_ns: delay the controller should apply after the instruction has been 861 * @delay_ns: delay the controller should apply after the instruction has been
849 * issued on the bus. Most modern controllers have internal timings 862 * issued on the bus. Most modern controllers have internal timings
850 * control logic, and in this case, the controller driver can ignore 863 * control logic, and in this case, the controller driver can ignore
@@ -1003,7 +1016,9 @@ struct nand_op_parser_data_constraints {
1003 * struct nand_op_parser_pattern_elem - One element of a pattern 1016 * struct nand_op_parser_pattern_elem - One element of a pattern
1004 * @type: the instructuction type 1017 * @type: the instructuction type
1005 * @optional: whether this element of the pattern is optional or mandatory 1018 * @optional: whether this element of the pattern is optional or mandatory
1006 * @addr/@data: address or data constraint (number of cycles or data length) 1019 * @ctx: address or data constraint
1020 * @ctx.addr: address constraint (number of cycles)
1021 * @ctx.data: data constraint (data length)
1007 */ 1022 */
1008struct nand_op_parser_pattern_elem { 1023struct nand_op_parser_pattern_elem {
1009 enum nand_op_instr_type type; 1024 enum nand_op_instr_type type;
@@ -1230,6 +1245,8 @@ int nand_op_parser_exec_op(struct nand_chip *chip,
1230 * devices. 1245 * devices.
1231 * @priv: [OPTIONAL] pointer to private chip data 1246 * @priv: [OPTIONAL] pointer to private chip data
1232 * @manufacturer: [INTERN] Contains manufacturer information 1247 * @manufacturer: [INTERN] Contains manufacturer information
1248 * @manufacturer.desc: [INTERN] Contains manufacturer's description
1249 * @manufacturer.priv: [INTERN] Contains manufacturer private information
1233 */ 1250 */
1234 1251
1235struct nand_chip { 1252struct nand_chip {
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
index de36969eb359..e60da0d34cc1 100644
--- a/include/linux/mtd/spi-nor.h
+++ b/include/linux/mtd/spi-nor.h
@@ -62,6 +62,8 @@
62#define SPINOR_OP_RDCR 0x35 /* Read configuration register */ 62#define SPINOR_OP_RDCR 0x35 /* Read configuration register */
63#define SPINOR_OP_RDFSR 0x70 /* Read flag status register */ 63#define SPINOR_OP_RDFSR 0x70 /* Read flag status register */
64#define SPINOR_OP_CLFSR 0x50 /* Clear flag status register */ 64#define SPINOR_OP_CLFSR 0x50 /* Clear flag status register */
65#define SPINOR_OP_RDEAR 0xc8 /* Read Extended Address Register */
66#define SPINOR_OP_WREAR 0xc5 /* Write Extended Address Register */
65 67
66/* 4-byte address opcodes - used on Spansion and some Macronix flashes. */ 68/* 4-byte address opcodes - used on Spansion and some Macronix flashes. */
67#define SPINOR_OP_READ_4B 0x13 /* Read data bytes (low frequency) */ 69#define SPINOR_OP_READ_4B 0x13 /* Read data bytes (low frequency) */
diff --git a/include/linux/namei.h b/include/linux/namei.h
index a982bb7cd480..a78606e8e3df 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -81,6 +81,7 @@ extern void done_path_create(struct path *, struct dentry *);
81extern struct dentry *kern_path_locked(const char *, struct path *); 81extern struct dentry *kern_path_locked(const char *, struct path *);
82extern int kern_path_mountpoint(int, const char *, struct path *, unsigned int); 82extern int kern_path_mountpoint(int, const char *, struct path *, unsigned int);
83 83
84extern struct dentry *try_lookup_one_len(const char *, struct dentry *, int);
84extern struct dentry *lookup_one_len(const char *, struct dentry *, int); 85extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
85extern struct dentry *lookup_one_len_unlocked(const char *, struct dentry *, int); 86extern struct dentry *lookup_one_len_unlocked(const char *, struct dentry *, int);
86 87
diff --git a/include/linux/net.h b/include/linux/net.h
index 08b6eb964dd6..6554d3ba4396 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -147,7 +147,6 @@ struct proto_ops {
147 int (*getname) (struct socket *sock, 147 int (*getname) (struct socket *sock,
148 struct sockaddr *addr, 148 struct sockaddr *addr,
149 int peer); 149 int peer);
150 __poll_t (*poll_mask) (struct socket *sock, __poll_t events);
151 __poll_t (*poll) (struct file *file, struct socket *sock, 150 __poll_t (*poll) (struct file *file, struct socket *sock,
152 struct poll_table_struct *wait); 151 struct poll_table_struct *wait);
153 int (*ioctl) (struct socket *sock, unsigned int cmd, 152 int (*ioctl) (struct socket *sock, unsigned int cmd,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3ec9850c7936..3d0cc0b5cec2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2789,11 +2789,31 @@ static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp,
2789 if (PTR_ERR(pp) != -EINPROGRESS) 2789 if (PTR_ERR(pp) != -EINPROGRESS)
2790 NAPI_GRO_CB(skb)->flush |= flush; 2790 NAPI_GRO_CB(skb)->flush |= flush;
2791} 2791}
2792static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb,
2793 struct sk_buff **pp,
2794 int flush,
2795 struct gro_remcsum *grc)
2796{
2797 if (PTR_ERR(pp) != -EINPROGRESS) {
2798 NAPI_GRO_CB(skb)->flush |= flush;
2799 skb_gro_remcsum_cleanup(skb, grc);
2800 skb->remcsum_offload = 0;
2801 }
2802}
2792#else 2803#else
2793static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush) 2804static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush)
2794{ 2805{
2795 NAPI_GRO_CB(skb)->flush |= flush; 2806 NAPI_GRO_CB(skb)->flush |= flush;
2796} 2807}
2808static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb,
2809 struct sk_buff **pp,
2810 int flush,
2811 struct gro_remcsum *grc)
2812{
2813 NAPI_GRO_CB(skb)->flush |= flush;
2814 skb_gro_remcsum_cleanup(skb, grc);
2815 skb->remcsum_offload = 0;
2816}
2797#endif 2817#endif
2798 2818
2799static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, 2819static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 04551af2ff23..dd2052f0efb7 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -345,7 +345,7 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
345 345
346 rcu_read_lock(); 346 rcu_read_lock();
347 nat_hook = rcu_dereference(nf_nat_hook); 347 nat_hook = rcu_dereference(nf_nat_hook);
348 if (nat_hook->decode_session) 348 if (nat_hook && nat_hook->decode_session)
349 nat_hook->decode_session(skb, fl); 349 nat_hook->decode_session(skb, fl);
350 rcu_read_unlock(); 350 rcu_read_unlock();
351#endif 351#endif
diff --git a/include/linux/netfilter/ipset/ip_set_timeout.h b/include/linux/netfilter/ipset/ip_set_timeout.h
index bfb3531fd88a..8ce271e187b6 100644
--- a/include/linux/netfilter/ipset/ip_set_timeout.h
+++ b/include/linux/netfilter/ipset/ip_set_timeout.h
@@ -23,6 +23,9 @@
23/* Set is defined with timeout support: timeout value may be 0 */ 23/* Set is defined with timeout support: timeout value may be 0 */
24#define IPSET_NO_TIMEOUT UINT_MAX 24#define IPSET_NO_TIMEOUT UINT_MAX
25 25
26/* Max timeout value, see msecs_to_jiffies() in jiffies.h */
27#define IPSET_MAX_TIMEOUT (UINT_MAX >> 1)/MSEC_PER_SEC
28
26#define ip_set_adt_opt_timeout(opt, set) \ 29#define ip_set_adt_opt_timeout(opt, set) \
27((opt)->ext.timeout != IPSET_NO_TIMEOUT ? (opt)->ext.timeout : (set)->timeout) 30((opt)->ext.timeout != IPSET_NO_TIMEOUT ? (opt)->ext.timeout : (set)->timeout)
28 31
@@ -32,11 +35,10 @@ ip_set_timeout_uget(struct nlattr *tb)
32 unsigned int timeout = ip_set_get_h32(tb); 35 unsigned int timeout = ip_set_get_h32(tb);
33 36
34 /* Normalize to fit into jiffies */ 37 /* Normalize to fit into jiffies */
35 if (timeout > UINT_MAX/MSEC_PER_SEC) 38 if (timeout > IPSET_MAX_TIMEOUT)
36 timeout = UINT_MAX/MSEC_PER_SEC; 39 timeout = IPSET_MAX_TIMEOUT;
37 40
38 /* Userspace supplied TIMEOUT parameter: adjust crazy size */ 41 return timeout;
39 return timeout == IPSET_NO_TIMEOUT ? IPSET_NO_TIMEOUT - 1 : timeout;
40} 42}
41 43
42static inline bool 44static inline bool
@@ -65,8 +67,14 @@ ip_set_timeout_set(unsigned long *timeout, u32 value)
65static inline u32 67static inline u32
66ip_set_timeout_get(const unsigned long *timeout) 68ip_set_timeout_get(const unsigned long *timeout)
67{ 69{
68 return *timeout == IPSET_ELEM_PERMANENT ? 0 : 70 u32 t;
69 jiffies_to_msecs(*timeout - jiffies)/MSEC_PER_SEC; 71
72 if (*timeout == IPSET_ELEM_PERMANENT)
73 return 0;
74
75 t = jiffies_to_msecs(*timeout - jiffies)/MSEC_PER_SEC;
76 /* Zero value in userspace means no timeout */
77 return t == 0 ? 1 : t;
70} 78}
71 79
72#endif /* __KERNEL__ */ 80#endif /* __KERNEL__ */
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 4e735be53e70..74ae3e1d19a0 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -28,6 +28,7 @@ struct nfs41_impl_id;
28struct nfs_client { 28struct nfs_client {
29 refcount_t cl_count; 29 refcount_t cl_count;
30 atomic_t cl_mds_count; 30 atomic_t cl_mds_count;
31 seqcount_t cl_callback_count;
31 int cl_cons_state; /* current construction state (-ve: init error) */ 32 int cl_cons_state; /* current construction state (-ve: init error) */
32#define NFS_CS_READY 0 /* ready to be used */ 33#define NFS_CS_READY 0 /* ready to be used */
33#define NFS_CS_INITING 1 /* busy initialising */ 34#define NFS_CS_INITING 1 /* busy initialising */
@@ -235,6 +236,7 @@ struct nfs_server {
235#define NFS_CAP_ACLS (1U << 3) 236#define NFS_CAP_ACLS (1U << 3)
236#define NFS_CAP_ATOMIC_OPEN (1U << 4) 237#define NFS_CAP_ATOMIC_OPEN (1U << 4)
237/* #define NFS_CAP_CHANGE_ATTR (1U << 5) */ 238/* #define NFS_CAP_CHANGE_ATTR (1U << 5) */
239#define NFS_CAP_LGOPEN (1U << 5)
238#define NFS_CAP_FILEID (1U << 6) 240#define NFS_CAP_FILEID (1U << 6)
239#define NFS_CAP_MODE (1U << 7) 241#define NFS_CAP_MODE (1U << 7)
240#define NFS_CAP_NLINK (1U << 8) 242#define NFS_CAP_NLINK (1U << 8)
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 34d28564ecf3..712eed156d09 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -259,6 +259,7 @@ struct nfs4_layoutget_args {
259 259
260struct nfs4_layoutget_res { 260struct nfs4_layoutget_res {
261 struct nfs4_sequence_res seq_res; 261 struct nfs4_sequence_res seq_res;
262 int status;
262 __u32 return_on_close; 263 __u32 return_on_close;
263 struct pnfs_layout_range range; 264 struct pnfs_layout_range range;
264 __u32 type; 265 __u32 type;
@@ -270,6 +271,7 @@ struct nfs4_layoutget {
270 struct nfs4_layoutget_args args; 271 struct nfs4_layoutget_args args;
271 struct nfs4_layoutget_res res; 272 struct nfs4_layoutget_res res;
272 struct rpc_cred *cred; 273 struct rpc_cred *cred;
274 unsigned callback_count;
273 gfp_t gfp_flags; 275 gfp_t gfp_flags;
274}; 276};
275 277
@@ -435,6 +437,7 @@ struct nfs_openargs {
435 enum createmode4 createmode; 437 enum createmode4 createmode;
436 const struct nfs4_label *label; 438 const struct nfs4_label *label;
437 umode_t umask; 439 umode_t umask;
440 struct nfs4_layoutget_args *lg_args;
438}; 441};
439 442
440struct nfs_openres { 443struct nfs_openres {
@@ -457,6 +460,7 @@ struct nfs_openres {
457 __u32 access_request; 460 __u32 access_request;
458 __u32 access_supported; 461 __u32 access_supported;
459 __u32 access_result; 462 __u32 access_result;
463 struct nfs4_layoutget_res *lg_res;
460}; 464};
461 465
462/* 466/*
@@ -1434,6 +1438,8 @@ enum {
1434 NFS_IOHDR_EOF, 1438 NFS_IOHDR_EOF,
1435 NFS_IOHDR_REDO, 1439 NFS_IOHDR_REDO,
1436 NFS_IOHDR_STAT, 1440 NFS_IOHDR_STAT,
1441 NFS_IOHDR_RESEND_PNFS,
1442 NFS_IOHDR_RESEND_MDS,
1437}; 1443};
1438 1444
1439struct nfs_io_completion; 1445struct nfs_io_completion;
@@ -1577,7 +1583,8 @@ struct nfs_rpc_ops {
1577 struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *, 1583 struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *,
1578 struct nfs_subversion *); 1584 struct nfs_subversion *);
1579 int (*getattr) (struct nfs_server *, struct nfs_fh *, 1585 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1580 struct nfs_fattr *, struct nfs4_label *); 1586 struct nfs_fattr *, struct nfs4_label *,
1587 struct inode *);
1581 int (*setattr) (struct dentry *, struct nfs_fattr *, 1588 int (*setattr) (struct dentry *, struct nfs_fattr *,
1582 struct iattr *); 1589 struct iattr *);
1583 int (*lookup) (struct inode *, const struct qstr *, 1590 int (*lookup) (struct inode *, const struct qstr *,
@@ -1591,7 +1598,7 @@ struct nfs_rpc_ops {
1591 int (*create) (struct inode *, struct dentry *, 1598 int (*create) (struct inode *, struct dentry *,
1592 struct iattr *, int); 1599 struct iattr *, int);
1593 int (*remove) (struct inode *, struct dentry *); 1600 int (*remove) (struct inode *, struct dentry *);
1594 void (*unlink_setup) (struct rpc_message *, struct dentry *); 1601 void (*unlink_setup) (struct rpc_message *, struct dentry *, struct inode *);
1595 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *); 1602 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
1596 int (*unlink_done) (struct rpc_task *, struct inode *); 1603 int (*unlink_done) (struct rpc_task *, struct inode *);
1597 void (*rename_setup) (struct rpc_message *msg, 1604 void (*rename_setup) (struct rpc_message *msg,
@@ -1620,9 +1627,11 @@ struct nfs_rpc_ops {
1620 struct nfs_pgio_header *); 1627 struct nfs_pgio_header *);
1621 void (*read_setup)(struct nfs_pgio_header *, struct rpc_message *); 1628 void (*read_setup)(struct nfs_pgio_header *, struct rpc_message *);
1622 int (*read_done)(struct rpc_task *, struct nfs_pgio_header *); 1629 int (*read_done)(struct rpc_task *, struct nfs_pgio_header *);
1623 void (*write_setup)(struct nfs_pgio_header *, struct rpc_message *); 1630 void (*write_setup)(struct nfs_pgio_header *, struct rpc_message *,
1631 struct rpc_clnt **);
1624 int (*write_done)(struct rpc_task *, struct nfs_pgio_header *); 1632 int (*write_done)(struct rpc_task *, struct nfs_pgio_header *);
1625 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *); 1633 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *,
1634 struct rpc_clnt **);
1626 void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *); 1635 void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
1627 int (*commit_done) (struct rpc_task *, struct nfs_commit_data *); 1636 int (*commit_done) (struct rpc_task *, struct nfs_commit_data *);
1628 int (*lock)(struct file *, int, struct file_lock *); 1637 int (*lock)(struct file *, int, struct file_lock *);
diff --git a/include/linux/of_clk.h b/include/linux/of_clk.h
new file mode 100644
index 000000000000..b27da9f164cb
--- /dev/null
+++ b/include/linux/of_clk.h
@@ -0,0 +1,30 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * OF clock helpers
4 */
5
6#ifndef __LINUX_OF_CLK_H
7#define __LINUX_OF_CLK_H
8
9#if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF)
10
11unsigned int of_clk_get_parent_count(struct device_node *np);
12const char *of_clk_get_parent_name(struct device_node *np, int index);
13void of_clk_init(const struct of_device_id *matches);
14
15#else /* !CONFIG_COMMON_CLK || !CONFIG_OF */
16
17static inline unsigned int of_clk_get_parent_count(struct device_node *np)
18{
19 return 0;
20}
21static inline const char *of_clk_get_parent_name(struct device_node *np,
22 int index)
23{
24 return NULL;
25}
26static inline void of_clk_init(const struct of_device_id *matches) {}
27
28#endif /* !CONFIG_COMMON_CLK || !CONFIG_OF */
29
30#endif /* __LINUX_OF_CLK_H */
diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h
index 40036a57d072..ad5444491975 100644
--- a/include/linux/perf/arm_pmu.h
+++ b/include/linux/perf/arm_pmu.h
@@ -78,7 +78,7 @@ struct arm_pmu {
78 struct pmu pmu; 78 struct pmu pmu;
79 cpumask_t supported_cpus; 79 cpumask_t supported_cpus;
80 char *name; 80 char *name;
81 irqreturn_t (*handle_irq)(int irq_num, void *dev); 81 irqreturn_t (*handle_irq)(struct arm_pmu *pmu);
82 void (*enable)(struct perf_event *event); 82 void (*enable)(struct perf_event *event);
83 void (*disable)(struct perf_event *event); 83 void (*disable)(struct perf_event *event);
84 int (*get_event_idx)(struct pmu_hw_events *hw_events, 84 int (*get_event_idx)(struct pmu_hw_events *hw_events,
diff --git a/include/linux/platform_data/gpio-dwapb.h b/include/linux/platform_data/gpio-dwapb.h
index 2dc7f4a8ab09..419cfacb4b42 100644
--- a/include/linux/platform_data/gpio-dwapb.h
+++ b/include/linux/platform_data/gpio-dwapb.h
@@ -19,7 +19,8 @@ struct dwapb_port_property {
19 unsigned int idx; 19 unsigned int idx;
20 unsigned int ngpio; 20 unsigned int ngpio;
21 unsigned int gpio_base; 21 unsigned int gpio_base;
22 unsigned int irq; 22 int irq[32];
23 bool has_irq;
23 bool irq_shared; 24 bool irq_shared;
24}; 25};
25 26
diff --git a/include/linux/i2c-gpio.h b/include/linux/platform_data/i2c-gpio.h
index 352c1426fd4d..352c1426fd4d 100644
--- a/include/linux/i2c-gpio.h
+++ b/include/linux/platform_data/i2c-gpio.h
diff --git a/include/linux/i2c-mux-gpio.h b/include/linux/platform_data/i2c-mux-gpio.h
index 4406108201fe..4406108201fe 100644
--- a/include/linux/i2c-mux-gpio.h
+++ b/include/linux/platform_data/i2c-mux-gpio.h
diff --git a/include/linux/i2c-ocores.h b/include/linux/platform_data/i2c-ocores.h
index 01edd96fe1f7..01edd96fe1f7 100644
--- a/include/linux/i2c-ocores.h
+++ b/include/linux/platform_data/i2c-ocores.h
diff --git a/include/linux/i2c-omap.h b/include/linux/platform_data/i2c-omap.h
index 3444265ee8ee..3444265ee8ee 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/platform_data/i2c-omap.h
diff --git a/include/linux/i2c-pca-platform.h b/include/linux/platform_data/i2c-pca-platform.h
index c37329432a8e..c37329432a8e 100644
--- a/include/linux/i2c-pca-platform.h
+++ b/include/linux/platform_data/i2c-pca-platform.h
diff --git a/include/linux/i2c-xiic.h b/include/linux/platform_data/i2c-xiic.h
index 4f9f2256a97e..4f9f2256a97e 100644
--- a/include/linux/i2c-xiic.h
+++ b/include/linux/platform_data/i2c-xiic.h
diff --git a/include/linux/platform_data/media/ir-rx51.h b/include/linux/platform_data/media/ir-rx51.h
deleted file mode 100644
index 9d127aa648e7..000000000000
--- a/include/linux/platform_data/media/ir-rx51.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _IR_RX51_H
3#define _IR_RX51_H
4
5struct ir_rx51_platform_data {
6 int(*set_max_mpu_wakeup_lat)(struct device *dev, long t);
7};
8
9#endif
diff --git a/include/linux/platform_data/mlxreg.h b/include/linux/platform_data/mlxreg.h
index 2744cff1b297..19f5cb618c55 100644
--- a/include/linux/platform_data/mlxreg.h
+++ b/include/linux/platform_data/mlxreg.h
@@ -58,11 +58,10 @@ struct mlxreg_hotplug_device {
58 * struct mlxreg_core_data - attributes control data: 58 * struct mlxreg_core_data - attributes control data:
59 * 59 *
60 * @label: attribute label; 60 * @label: attribute label;
61 * @label: attribute register offset;
62 * @reg: attribute register; 61 * @reg: attribute register;
63 * @mask: attribute access mask; 62 * @mask: attribute access mask;
64 * @mode: access mode;
65 * @bit: attribute effective bit; 63 * @bit: attribute effective bit;
64 * @mode: access mode;
66 * @np - pointer to node platform associated with attribute; 65 * @np - pointer to node platform associated with attribute;
67 * @hpdev - hotplug device data; 66 * @hpdev - hotplug device data;
68 * @health_cntr: dynamic device health indication counter; 67 * @health_cntr: dynamic device health indication counter;
diff --git a/include/linux/platform_data/mtd-davinci.h b/include/linux/platform_data/mtd-davinci.h
index f1a2cf655bdb..1bbfa27cccb4 100644
--- a/include/linux/platform_data/mtd-davinci.h
+++ b/include/linux/platform_data/mtd-davinci.h
@@ -56,6 +56,16 @@ struct davinci_nand_pdata { /* platform_data */
56 uint32_t mask_ale; 56 uint32_t mask_ale;
57 uint32_t mask_cle; 57 uint32_t mask_cle;
58 58
59 /*
60 * 0-indexed chip-select number of the asynchronous
61 * interface to which the NAND device has been connected.
62 *
63 * So, if you have NAND connected to CS3 of DA850, you
64 * will pass '1' here. Since the asynchronous interface
65 * on DA850 starts from CS2.
66 */
67 uint32_t core_chipsel;
68
59 /* for packages using two chipselects */ 69 /* for packages using two chipselects */
60 uint32_t mask_chipsel; 70 uint32_t mask_chipsel;
61 71
diff --git a/include/linux/platform_data/sc18is602.h b/include/linux/platform_data/sc18is602.h
index 997b06634152..18602cab7799 100644
--- a/include/linux/platform_data/sc18is602.h
+++ b/include/linux/platform_data/sc18is602.h
@@ -7,7 +7,7 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 * 9 *
10 * For further information, see the Documentation/spi/sc18is602 file. 10 * For further information, see the Documentation/spi/spi-sc18is602 file.
11 */ 11 */
12 12
13/** 13/**
diff --git a/include/linux/platform_data/shmob_drm.h b/include/linux/platform_data/shmob_drm.h
index 7c686d335c12..ee495d707f17 100644
--- a/include/linux/platform_data/shmob_drm.h
+++ b/include/linux/platform_data/shmob_drm.h
@@ -18,9 +18,6 @@
18 18
19#include <drm/drm_mode.h> 19#include <drm/drm_mode.h>
20 20
21struct sh_mobile_meram_cfg;
22struct sh_mobile_meram_info;
23
24enum shmob_drm_clk_source { 21enum shmob_drm_clk_source {
25 SHMOB_DRM_CLK_BUS, 22 SHMOB_DRM_CLK_BUS,
26 SHMOB_DRM_CLK_PERIPHERAL, 23 SHMOB_DRM_CLK_PERIPHERAL,
@@ -93,7 +90,6 @@ struct shmob_drm_platform_data {
93 struct shmob_drm_interface_data iface; 90 struct shmob_drm_interface_data iface;
94 struct shmob_drm_panel_data panel; 91 struct shmob_drm_panel_data panel;
95 struct shmob_drm_backlight_data backlight; 92 struct shmob_drm_backlight_data backlight;
96 const struct sh_mobile_meram_cfg *meram;
97}; 93};
98 94
99#endif /* __SHMOB_DRM_H__ */ 95#endif /* __SHMOB_DRM_H__ */
diff --git a/include/linux/platform_data/spi-imx.h b/include/linux/platform_data/spi-imx.h
index 6f012fefa1a2..328f670d10bd 100644
--- a/include/linux/platform_data/spi-imx.h
+++ b/include/linux/platform_data/spi-imx.h
@@ -5,24 +5,29 @@
5 5
6/* 6/*
7 * struct spi_imx_master - device.platform_data for SPI controller devices. 7 * struct spi_imx_master - device.platform_data for SPI controller devices.
8 * @chipselect: Array of chipselects for this master. Numbers >= 0 mean gpio 8 * @chipselect: Array of chipselects for this master or NULL. Numbers >= 0
9 * pins, numbers < 0 mean internal CSPI chipselects according 9 * mean GPIO pins, -ENOENT means internal CSPI chipselect
10 * to MXC_SPI_CS(). Normally you want to use gpio based chip 10 * matching the position in the array. E.g., if chipselect[1] =
11 * selects as the CSPI module tries to be intelligent about 11 * -ENOENT then a SPI slave using chip select 1 will use the
12 * when to assert the chipselect: The CSPI module deasserts the 12 * native SS1 line of the CSPI. Omitting the array will use
13 * chipselect once it runs out of input data. The other problem 13 * all native chip selects.
14 * is that it is not possible to mix between high active and low 14
15 * active chipselects on one single bus using the internal 15 * Normally you want to use gpio based chip selects as the CSPI
16 * chipselects. Unfortunately Freescale decided to put some 16 * module tries to be intelligent about when to assert the
17 * chipselect: The CSPI module deasserts the chipselect once it
18 * runs out of input data. The other problem is that it is not
19 * possible to mix between high active and low active chipselects
20 * on one single bus using the internal chipselects.
21 * Unfortunately, on some SoCs, Freescale decided to put some
17 * chipselects on dedicated pins which are not usable as gpios, 22 * chipselects on dedicated pins which are not usable as gpios,
18 * so we have to support the internal chipselects. 23 * so we have to support the internal chipselects.
19 * @num_chipselect: ARRAY_SIZE(chipselect) 24 *
25 * @num_chipselect: If @chipselect is specified, ARRAY_SIZE(chipselect),
26 * otherwise the number of native chip selects.
20 */ 27 */
21struct spi_imx_master { 28struct spi_imx_master {
22 int *chipselect; 29 int *chipselect;
23 int num_chipselect; 30 int num_chipselect;
24}; 31};
25 32
26#define MXC_SPI_CS(no) ((no) - 32)
27
28#endif /* __MACH_SPI_H_*/ 33#endif /* __MACH_SPI_H_*/
diff --git a/include/linux/platform_data/ti-aemif.h b/include/linux/platform_data/ti-aemif.h
index ac72e115093c..e6407bafcbf8 100644
--- a/include/linux/platform_data/ti-aemif.h
+++ b/include/linux/platform_data/ti-aemif.h
@@ -16,8 +16,33 @@
16 16
17#include <linux/of_platform.h> 17#include <linux/of_platform.h>
18 18
19/**
20 * struct aemif_abus_data - Async bus configuration parameters.
21 *
22 * @cs - Chip-select number.
23 */
24struct aemif_abus_data {
25 u32 cs;
26};
27
28/**
29 * struct aemif_platform_data - Data to set up the TI aemif driver.
30 *
31 * @dev_lookup: of_dev_auxdata passed to of_platform_populate() for aemif
32 * subdevices.
33 * @cs_offset: Lowest allowed chip-select number.
34 * @abus_data: Array of async bus configuration entries.
35 * @num_abus_data: Number of abus entries.
36 * @sub_devices: Array of platform subdevices.
37 * @num_sub_devices: Number of subdevices.
38 */
19struct aemif_platform_data { 39struct aemif_platform_data {
20 struct of_dev_auxdata *dev_lookup; 40 struct of_dev_auxdata *dev_lookup;
41 u32 cs_offset;
42 struct aemif_abus_data *abus_data;
43 size_t num_abus_data;
44 struct platform_device *sub_devices;
45 size_t num_sub_devices;
21}; 46};
22 47
23#endif /* __TI_DAVINCI_AEMIF_DATA_H__ */ 48#endif /* __TI_DAVINCI_AEMIF_DATA_H__ */
diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h
index 80ce28d40832..990aad477458 100644
--- a/include/linux/platform_data/ti-sysc.h
+++ b/include/linux/platform_data/ti-sysc.h
@@ -45,6 +45,7 @@ struct sysc_regbits {
45 s8 emufree_shift; 45 s8 emufree_shift;
46}; 46};
47 47
48#define SYSC_QUIRK_RESOURCE_PROVIDER BIT(9)
48#define SYSC_QUIRK_LEGACY_IDLE BIT(8) 49#define SYSC_QUIRK_LEGACY_IDLE BIT(8)
49#define SYSC_QUIRK_RESET_STATUS BIT(7) 50#define SYSC_QUIRK_RESET_STATUS BIT(7)
50#define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6) 51#define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6)
diff --git a/include/linux/platform_data/tsl2772.h b/include/linux/platform_data/tsl2772.h
new file mode 100644
index 000000000000..f8ade15a35e2
--- /dev/null
+++ b/include/linux/platform_data/tsl2772.h
@@ -0,0 +1,101 @@
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Device driver for monitoring ambient light intensity (lux)
4 * and proximity (prox) within the TAOS TSL2772 family of devices.
5 *
6 * Copyright (c) 2012, TAOS Corporation.
7 * Copyright (c) 2017-2018 Brian Masney <masneyb@onstation.org>
8 */
9
10#ifndef __TSL2772_H
11#define __TSL2772_H
12
13struct tsl2772_lux {
14 unsigned int ch0;
15 unsigned int ch1;
16};
17
18/* Max number of segments allowable in LUX table */
19#define TSL2772_MAX_LUX_TABLE_SIZE 6
20/* The default LUX tables all have 3 elements. */
21#define TSL2772_DEF_LUX_TABLE_SZ 3
22#define TSL2772_DEFAULT_TABLE_BYTES (sizeof(struct tsl2772_lux) * \
23 TSL2772_DEF_LUX_TABLE_SZ)
24
25/* Proximity diode to use */
26#define TSL2772_DIODE0 0x01
27#define TSL2772_DIODE1 0x02
28#define TSL2772_DIODE_BOTH 0x03
29
30/* LED Power */
31#define TSL2772_100_mA 0x00
32#define TSL2772_50_mA 0x01
33#define TSL2772_25_mA 0x02
34#define TSL2772_13_mA 0x03
35
36/**
37 * struct tsl2772_settings - Settings for the tsl2772 driver
38 * @als_time: Integration time of the ALS channel ADCs in 2.73 ms
39 * increments. Total integration time is
40 * (256 - als_time) * 2.73.
41 * @als_gain: Index into the tsl2772_als_gain array.
42 * @als_gain_trim: Default gain trim to account for aperture effects.
43 * @wait_time: Time between proximity and ALS cycles in 2.73
44 * periods.
45 * @prox_time: Integration time of the proximity ADC in 2.73 ms
46 * increments. Total integration time is
47 * (256 - prx_time) * 2.73.
48 * @prox_gain: Index into the tsl2772_prx_gain array.
49 * @als_prox_config: The value of the ALS / Proximity configuration
50 * register.
51 * @als_cal_target: Known external ALS reading for calibration.
52 * @als_persistence: H/W Filters, Number of 'out of limits' ALS readings.
53 * @als_interrupt_en: Enable/Disable ALS interrupts
54 * @als_thresh_low: CH0 'low' count to trigger interrupt.
55 * @als_thresh_high: CH0 'high' count to trigger interrupt.
56 * @prox_persistence: H/W Filters, Number of 'out of limits' proximity
57 * readings.
58 * @prox_interrupt_en: Enable/Disable proximity interrupts.
59 * @prox_thres_low: Low threshold proximity detection.
60 * @prox_thres_high: High threshold proximity detection.
61 * @prox_pulse_count: Number if proximity emitter pulses.
62 * @prox_max_samples_cal: The number of samples that are taken when performing
63 * a proximity calibration.
64 * @prox_diode Which diode(s) to use for driving the external
65 * LED(s) for proximity sensing.
66 * @prox_power The amount of power to use for the external LED(s).
67 */
68struct tsl2772_settings {
69 int als_time;
70 int als_gain;
71 int als_gain_trim;
72 int wait_time;
73 int prox_time;
74 int prox_gain;
75 int als_prox_config;
76 int als_cal_target;
77 u8 als_persistence;
78 bool als_interrupt_en;
79 int als_thresh_low;
80 int als_thresh_high;
81 u8 prox_persistence;
82 bool prox_interrupt_en;
83 int prox_thres_low;
84 int prox_thres_high;
85 int prox_pulse_count;
86 int prox_max_samples_cal;
87 int prox_diode;
88 int prox_power;
89};
90
91/**
92 * struct tsl2772_platform_data - Platform callback, glass and defaults
93 * @platform_lux_table: Device specific glass coefficents
94 * @platform_default_settings: Device specific power on defaults
95 */
96struct tsl2772_platform_data {
97 struct tsl2772_lux platform_lux_table[TSL2772_MAX_LUX_TABLE_SIZE];
98 struct tsl2772_settings *platform_default_settings;
99};
100
101#endif /* __TSL2772_H */
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 42e0d649e653..cb8d84090cfb 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -234,9 +234,11 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np);
234int of_genpd_parse_idle_states(struct device_node *dn, 234int of_genpd_parse_idle_states(struct device_node *dn,
235 struct genpd_power_state **states, int *n); 235 struct genpd_power_state **states, int *n);
236unsigned int of_genpd_opp_to_performance_state(struct device *dev, 236unsigned int of_genpd_opp_to_performance_state(struct device *dev,
237 struct device_node *opp_node); 237 struct device_node *np);
238 238
239int genpd_dev_pm_attach(struct device *dev); 239int genpd_dev_pm_attach(struct device *dev);
240struct device *genpd_dev_pm_attach_by_id(struct device *dev,
241 unsigned int index);
240#else /* !CONFIG_PM_GENERIC_DOMAINS_OF */ 242#else /* !CONFIG_PM_GENERIC_DOMAINS_OF */
241static inline int of_genpd_add_provider_simple(struct device_node *np, 243static inline int of_genpd_add_provider_simple(struct device_node *np,
242 struct generic_pm_domain *genpd) 244 struct generic_pm_domain *genpd)
@@ -272,9 +274,9 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn,
272 274
273static inline unsigned int 275static inline unsigned int
274of_genpd_opp_to_performance_state(struct device *dev, 276of_genpd_opp_to_performance_state(struct device *dev,
275 struct device_node *opp_node) 277 struct device_node *np)
276{ 278{
277 return -ENODEV; 279 return 0;
278} 280}
279 281
280static inline int genpd_dev_pm_attach(struct device *dev) 282static inline int genpd_dev_pm_attach(struct device *dev)
@@ -282,6 +284,12 @@ static inline int genpd_dev_pm_attach(struct device *dev)
282 return 0; 284 return 0;
283} 285}
284 286
287static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev,
288 unsigned int index)
289{
290 return NULL;
291}
292
285static inline 293static inline
286struct generic_pm_domain *of_genpd_remove_last(struct device_node *np) 294struct generic_pm_domain *of_genpd_remove_last(struct device_node *np)
287{ 295{
@@ -291,6 +299,8 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np)
291 299
292#ifdef CONFIG_PM 300#ifdef CONFIG_PM
293int dev_pm_domain_attach(struct device *dev, bool power_on); 301int dev_pm_domain_attach(struct device *dev, bool power_on);
302struct device *dev_pm_domain_attach_by_id(struct device *dev,
303 unsigned int index);
294void dev_pm_domain_detach(struct device *dev, bool power_off); 304void dev_pm_domain_detach(struct device *dev, bool power_off);
295void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd); 305void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd);
296#else 306#else
@@ -298,6 +308,11 @@ static inline int dev_pm_domain_attach(struct device *dev, bool power_on)
298{ 308{
299 return 0; 309 return 0;
300} 310}
311static inline struct device *dev_pm_domain_attach_by_id(struct device *dev,
312 unsigned int index)
313{
314 return NULL;
315}
301static inline void dev_pm_domain_detach(struct device *dev, bool power_off) {} 316static inline void dev_pm_domain_detach(struct device *dev, bool power_off) {}
302static inline void dev_pm_domain_set(struct device *dev, 317static inline void dev_pm_domain_set(struct device *dev,
303 struct dev_pm_domain *pd) {} 318 struct dev_pm_domain *pd) {}
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index db5dbbf7a48d..f0fc4700b6ff 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -56,7 +56,8 @@ extern void pm_runtime_update_max_time_suspended(struct device *dev,
56 s64 delta_ns); 56 s64 delta_ns);
57extern void pm_runtime_set_memalloc_noio(struct device *dev, bool enable); 57extern void pm_runtime_set_memalloc_noio(struct device *dev, bool enable);
58extern void pm_runtime_clean_up_links(struct device *dev); 58extern void pm_runtime_clean_up_links(struct device *dev);
59extern void pm_runtime_resume_suppliers(struct device *dev); 59extern void pm_runtime_get_suppliers(struct device *dev);
60extern void pm_runtime_put_suppliers(struct device *dev);
60extern void pm_runtime_new_link(struct device *dev); 61extern void pm_runtime_new_link(struct device *dev);
61extern void pm_runtime_drop_link(struct device *dev); 62extern void pm_runtime_drop_link(struct device *dev);
62 63
@@ -172,7 +173,8 @@ static inline unsigned long pm_runtime_autosuspend_expiration(
172static inline void pm_runtime_set_memalloc_noio(struct device *dev, 173static inline void pm_runtime_set_memalloc_noio(struct device *dev,
173 bool enable){} 174 bool enable){}
174static inline void pm_runtime_clean_up_links(struct device *dev) {} 175static inline void pm_runtime_clean_up_links(struct device *dev) {}
175static inline void pm_runtime_resume_suppliers(struct device *dev) {} 176static inline void pm_runtime_get_suppliers(struct device *dev) {}
177static inline void pm_runtime_put_suppliers(struct device *dev) {}
176static inline void pm_runtime_new_link(struct device *dev) {} 178static inline void pm_runtime_new_link(struct device *dev) {}
177static inline void pm_runtime_drop_link(struct device *dev) {} 179static inline void pm_runtime_drop_link(struct device *dev) {}
178 180
diff --git a/include/linux/poll.h b/include/linux/poll.h
index fdf86b4cbc71..7e0fdcf905d2 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -74,18 +74,18 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc)
74 pt->_key = ~(__poll_t)0; /* all events enabled */ 74 pt->_key = ~(__poll_t)0; /* all events enabled */
75} 75}
76 76
77static inline bool file_has_poll_mask(struct file *file) 77static inline bool file_can_poll(struct file *file)
78{ 78{
79 return file->f_op->get_poll_head && file->f_op->poll_mask; 79 return file->f_op->poll;
80} 80}
81 81
82static inline bool file_can_poll(struct file *file) 82static inline __poll_t vfs_poll(struct file *file, struct poll_table_struct *pt)
83{ 83{
84 return file->f_op->poll || file_has_poll_mask(file); 84 if (unlikely(!file->f_op->poll))
85 return DEFAULT_POLLMASK;
86 return file->f_op->poll(file, pt);
85} 87}
86 88
87__poll_t vfs_poll(struct file *file, struct poll_table_struct *pt);
88
89struct poll_table_entry { 89struct poll_table_entry {
90 struct file *filp; 90 struct file *filp;
91 __poll_t key; 91 __poll_t key;
diff --git a/include/linux/power/bq27xxx_battery.h b/include/linux/power/bq27xxx_battery.h
index 01fbf1b16258..d6355f49fbae 100644
--- a/include/linux/power/bq27xxx_battery.h
+++ b/include/linux/power/bq27xxx_battery.h
@@ -24,8 +24,9 @@ enum bq27xxx_chip {
24 BQ27546, 24 BQ27546,
25 BQ27742, 25 BQ27742,
26 BQ27545, /* bq27545 */ 26 BQ27545, /* bq27545 */
27 BQ27421, /* bq27421, bq27425, bq27441, bq27621 */ 27 BQ27421, /* bq27421, bq27441, bq27621 */
28 BQ27425, 28 BQ27425,
29 BQ27426,
29 BQ27441, 30 BQ27441,
30 BQ27621, 31 BQ27621,
31}; 32};
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index e518352137e7..626fc65c4336 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -14,6 +14,8 @@ struct seq_operations;
14 14
15#ifdef CONFIG_PROC_FS 15#ifdef CONFIG_PROC_FS
16 16
17typedef int (*proc_write_t)(struct file *, char *, size_t);
18
17extern void proc_root_init(void); 19extern void proc_root_init(void);
18extern void proc_flush_task(struct task_struct *); 20extern void proc_flush_task(struct task_struct *);
19 21
@@ -61,6 +63,16 @@ struct proc_dir_entry *proc_create_net_data(const char *name, umode_t mode,
61struct proc_dir_entry *proc_create_net_single(const char *name, umode_t mode, 63struct proc_dir_entry *proc_create_net_single(const char *name, umode_t mode,
62 struct proc_dir_entry *parent, 64 struct proc_dir_entry *parent,
63 int (*show)(struct seq_file *, void *), void *data); 65 int (*show)(struct seq_file *, void *), void *data);
66struct proc_dir_entry *proc_create_net_data_write(const char *name, umode_t mode,
67 struct proc_dir_entry *parent,
68 const struct seq_operations *ops,
69 proc_write_t write,
70 unsigned int state_size, void *data);
71struct proc_dir_entry *proc_create_net_single_write(const char *name, umode_t mode,
72 struct proc_dir_entry *parent,
73 int (*show)(struct seq_file *, void *),
74 proc_write_t write,
75 void *data);
64 76
65#else /* CONFIG_PROC_FS */ 77#else /* CONFIG_PROC_FS */
66 78
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index 61f806a7fe29..a15bc4d48752 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -71,7 +71,7 @@ struct pstore_record {
71 struct pstore_info *psi; 71 struct pstore_info *psi;
72 enum pstore_type_id type; 72 enum pstore_type_id type;
73 u64 id; 73 u64 id;
74 struct timespec time; 74 struct timespec64 time;
75 char *buf; 75 char *buf;
76 ssize_t size; 76 ssize_t size;
77 ssize_t ecc_notice_size; 77 ssize_t ecc_notice_size;
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index e8afbd71a140..8ea265a022fd 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -14,6 +14,8 @@ struct platform_pwm_backlight_data {
14 unsigned int lth_brightness; 14 unsigned int lth_brightness;
15 unsigned int pwm_period_ns; 15 unsigned int pwm_period_ns;
16 unsigned int *levels; 16 unsigned int *levels;
17 unsigned int post_pwm_on_delay;
18 unsigned int pwm_off_delay;
17 /* TODO remove once all users are switched to gpiod_* API */ 19 /* TODO remove once all users are switched to gpiod_* API */
18 int enable_gpio; 20 int enable_gpio;
19 int (*init)(struct device *dev); 21 int (*init)(struct device *dev);
diff --git a/include/linux/qcom-geni-se.h b/include/linux/qcom-geni-se.h
new file mode 100644
index 000000000000..5d6144977828
--- /dev/null
+++ b/include/linux/qcom-geni-se.h
@@ -0,0 +1,425 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
4 */
5
6#ifndef _LINUX_QCOM_GENI_SE
7#define _LINUX_QCOM_GENI_SE
8
9/* Transfer mode supported by GENI Serial Engines */
10enum geni_se_xfer_mode {
11 GENI_SE_INVALID,
12 GENI_SE_FIFO,
13 GENI_SE_DMA,
14};
15
16/* Protocols supported by GENI Serial Engines */
17enum geni_se_protocol_type {
18 GENI_SE_NONE,
19 GENI_SE_SPI,
20 GENI_SE_UART,
21 GENI_SE_I2C,
22 GENI_SE_I3C,
23};
24
25struct geni_wrapper;
26struct clk;
27
28/**
29 * struct geni_se - GENI Serial Engine
30 * @base: Base Address of the Serial Engine's register block
31 * @dev: Pointer to the Serial Engine device
32 * @wrapper: Pointer to the parent QUP Wrapper core
33 * @clk: Handle to the core serial engine clock
34 * @num_clk_levels: Number of valid clock levels in clk_perf_tbl
35 * @clk_perf_tbl: Table of clock frequency input to serial engine clock
36 */
37struct geni_se {
38 void __iomem *base;
39 struct device *dev;
40 struct geni_wrapper *wrapper;
41 struct clk *clk;
42 unsigned int num_clk_levels;
43 unsigned long *clk_perf_tbl;
44};
45
46/* Common SE registers */
47#define GENI_FORCE_DEFAULT_REG 0x20
48#define SE_GENI_STATUS 0x40
49#define GENI_SER_M_CLK_CFG 0x48
50#define GENI_SER_S_CLK_CFG 0x4c
51#define GENI_FW_REVISION_RO 0x68
52#define SE_GENI_CLK_SEL 0x7c
53#define SE_GENI_DMA_MODE_EN 0x258
54#define SE_GENI_M_CMD0 0x600
55#define SE_GENI_M_CMD_CTRL_REG 0x604
56#define SE_GENI_M_IRQ_STATUS 0x610
57#define SE_GENI_M_IRQ_EN 0x614
58#define SE_GENI_M_IRQ_CLEAR 0x618
59#define SE_GENI_S_CMD0 0x630
60#define SE_GENI_S_CMD_CTRL_REG 0x634
61#define SE_GENI_S_IRQ_STATUS 0x640
62#define SE_GENI_S_IRQ_EN 0x644
63#define SE_GENI_S_IRQ_CLEAR 0x648
64#define SE_GENI_TX_FIFOn 0x700
65#define SE_GENI_RX_FIFOn 0x780
66#define SE_GENI_TX_FIFO_STATUS 0x800
67#define SE_GENI_RX_FIFO_STATUS 0x804
68#define SE_GENI_TX_WATERMARK_REG 0x80c
69#define SE_GENI_RX_WATERMARK_REG 0x810
70#define SE_GENI_RX_RFR_WATERMARK_REG 0x814
71#define SE_GENI_IOS 0x908
72#define SE_DMA_TX_IRQ_STAT 0xc40
73#define SE_DMA_TX_IRQ_CLR 0xc44
74#define SE_DMA_TX_FSM_RST 0xc58
75#define SE_DMA_RX_IRQ_STAT 0xd40
76#define SE_DMA_RX_IRQ_CLR 0xd44
77#define SE_DMA_RX_FSM_RST 0xd58
78#define SE_HW_PARAM_0 0xe24
79#define SE_HW_PARAM_1 0xe28
80
81/* GENI_FORCE_DEFAULT_REG fields */
82#define FORCE_DEFAULT BIT(0)
83
84/* GENI_STATUS fields */
85#define M_GENI_CMD_ACTIVE BIT(0)
86#define S_GENI_CMD_ACTIVE BIT(12)
87
88/* GENI_SER_M_CLK_CFG/GENI_SER_S_CLK_CFG */
89#define SER_CLK_EN BIT(0)
90#define CLK_DIV_MSK GENMASK(15, 4)
91#define CLK_DIV_SHFT 4
92
93/* GENI_FW_REVISION_RO fields */
94#define FW_REV_PROTOCOL_MSK GENMASK(15, 8)
95#define FW_REV_PROTOCOL_SHFT 8
96
97/* GENI_CLK_SEL fields */
98#define CLK_SEL_MSK GENMASK(2, 0)
99
100/* SE_GENI_DMA_MODE_EN */
101#define GENI_DMA_MODE_EN BIT(0)
102
103/* GENI_M_CMD0 fields */
104#define M_OPCODE_MSK GENMASK(31, 27)
105#define M_OPCODE_SHFT 27
106#define M_PARAMS_MSK GENMASK(26, 0)
107
108/* GENI_M_CMD_CTRL_REG */
109#define M_GENI_CMD_CANCEL BIT(2)
110#define M_GENI_CMD_ABORT BIT(1)
111#define M_GENI_DISABLE BIT(0)
112
113/* GENI_S_CMD0 fields */
114#define S_OPCODE_MSK GENMASK(31, 27)
115#define S_OPCODE_SHFT 27
116#define S_PARAMS_MSK GENMASK(26, 0)
117
118/* GENI_S_CMD_CTRL_REG */
119#define S_GENI_CMD_CANCEL BIT(2)
120#define S_GENI_CMD_ABORT BIT(1)
121#define S_GENI_DISABLE BIT(0)
122
123/* GENI_M_IRQ_EN fields */
124#define M_CMD_DONE_EN BIT(0)
125#define M_CMD_OVERRUN_EN BIT(1)
126#define M_ILLEGAL_CMD_EN BIT(2)
127#define M_CMD_FAILURE_EN BIT(3)
128#define M_CMD_CANCEL_EN BIT(4)
129#define M_CMD_ABORT_EN BIT(5)
130#define M_TIMESTAMP_EN BIT(6)
131#define M_RX_IRQ_EN BIT(7)
132#define M_GP_SYNC_IRQ_0_EN BIT(8)
133#define M_GP_IRQ_0_EN BIT(9)
134#define M_GP_IRQ_1_EN BIT(10)
135#define M_GP_IRQ_2_EN BIT(11)
136#define M_GP_IRQ_3_EN BIT(12)
137#define M_GP_IRQ_4_EN BIT(13)
138#define M_GP_IRQ_5_EN BIT(14)
139#define M_IO_DATA_DEASSERT_EN BIT(22)
140#define M_IO_DATA_ASSERT_EN BIT(23)
141#define M_RX_FIFO_RD_ERR_EN BIT(24)
142#define M_RX_FIFO_WR_ERR_EN BIT(25)
143#define M_RX_FIFO_WATERMARK_EN BIT(26)
144#define M_RX_FIFO_LAST_EN BIT(27)
145#define M_TX_FIFO_RD_ERR_EN BIT(28)
146#define M_TX_FIFO_WR_ERR_EN BIT(29)
147#define M_TX_FIFO_WATERMARK_EN BIT(30)
148#define M_SEC_IRQ_EN BIT(31)
149#define M_COMMON_GENI_M_IRQ_EN (GENMASK(6, 1) | \
150 M_IO_DATA_DEASSERT_EN | \
151 M_IO_DATA_ASSERT_EN | M_RX_FIFO_RD_ERR_EN | \
152 M_RX_FIFO_WR_ERR_EN | M_TX_FIFO_RD_ERR_EN | \
153 M_TX_FIFO_WR_ERR_EN)
154
155/* GENI_S_IRQ_EN fields */
156#define S_CMD_DONE_EN BIT(0)
157#define S_CMD_OVERRUN_EN BIT(1)
158#define S_ILLEGAL_CMD_EN BIT(2)
159#define S_CMD_FAILURE_EN BIT(3)
160#define S_CMD_CANCEL_EN BIT(4)
161#define S_CMD_ABORT_EN BIT(5)
162#define S_GP_SYNC_IRQ_0_EN BIT(8)
163#define S_GP_IRQ_0_EN BIT(9)
164#define S_GP_IRQ_1_EN BIT(10)
165#define S_GP_IRQ_2_EN BIT(11)
166#define S_GP_IRQ_3_EN BIT(12)
167#define S_GP_IRQ_4_EN BIT(13)
168#define S_GP_IRQ_5_EN BIT(14)
169#define S_IO_DATA_DEASSERT_EN BIT(22)
170#define S_IO_DATA_ASSERT_EN BIT(23)
171#define S_RX_FIFO_RD_ERR_EN BIT(24)
172#define S_RX_FIFO_WR_ERR_EN BIT(25)
173#define S_RX_FIFO_WATERMARK_EN BIT(26)
174#define S_RX_FIFO_LAST_EN BIT(27)
175#define S_COMMON_GENI_S_IRQ_EN (GENMASK(5, 1) | GENMASK(13, 9) | \
176 S_RX_FIFO_RD_ERR_EN | S_RX_FIFO_WR_ERR_EN)
177
178/* GENI_/TX/RX/RX_RFR/_WATERMARK_REG fields */
179#define WATERMARK_MSK GENMASK(5, 0)
180
181/* GENI_TX_FIFO_STATUS fields */
182#define TX_FIFO_WC GENMASK(27, 0)
183
184/* GENI_RX_FIFO_STATUS fields */
185#define RX_LAST BIT(31)
186#define RX_LAST_BYTE_VALID_MSK GENMASK(30, 28)
187#define RX_LAST_BYTE_VALID_SHFT 28
188#define RX_FIFO_WC_MSK GENMASK(24, 0)
189
190/* SE_GENI_IOS fields */
191#define IO2_DATA_IN BIT(1)
192#define RX_DATA_IN BIT(0)
193
194/* SE_DMA_TX_IRQ_STAT Register fields */
195#define TX_DMA_DONE BIT(0)
196#define TX_EOT BIT(1)
197#define TX_SBE BIT(2)
198#define TX_RESET_DONE BIT(3)
199
200/* SE_DMA_RX_IRQ_STAT Register fields */
201#define RX_DMA_DONE BIT(0)
202#define RX_EOT BIT(1)
203#define RX_SBE BIT(2)
204#define RX_RESET_DONE BIT(3)
205#define RX_FLUSH_DONE BIT(4)
206#define RX_GENI_GP_IRQ GENMASK(10, 5)
207#define RX_GENI_CANCEL_IRQ BIT(11)
208#define RX_GENI_GP_IRQ_EXT GENMASK(13, 12)
209
210/* SE_HW_PARAM_0 fields */
211#define TX_FIFO_WIDTH_MSK GENMASK(29, 24)
212#define TX_FIFO_WIDTH_SHFT 24
213#define TX_FIFO_DEPTH_MSK GENMASK(21, 16)
214#define TX_FIFO_DEPTH_SHFT 16
215
216/* SE_HW_PARAM_1 fields */
217#define RX_FIFO_WIDTH_MSK GENMASK(29, 24)
218#define RX_FIFO_WIDTH_SHFT 24
219#define RX_FIFO_DEPTH_MSK GENMASK(21, 16)
220#define RX_FIFO_DEPTH_SHFT 16
221
222#define HW_VER_MAJOR_MASK GENMASK(31, 28)
223#define HW_VER_MAJOR_SHFT 28
224#define HW_VER_MINOR_MASK GENMASK(27, 16)
225#define HW_VER_MINOR_SHFT 16
226#define HW_VER_STEP_MASK GENMASK(15, 0)
227
228#if IS_ENABLED(CONFIG_QCOM_GENI_SE)
229
230u32 geni_se_get_qup_hw_version(struct geni_se *se);
231
232#define geni_se_get_wrapper_version(se, major, minor, step) do { \
233 u32 ver; \
234\
235 ver = geni_se_get_qup_hw_version(se); \
236 major = (ver & HW_VER_MAJOR_MASK) >> HW_VER_MAJOR_SHFT; \
237 minor = (ver & HW_VER_MINOR_MASK) >> HW_VER_MINOR_SHFT; \
238 step = version & HW_VER_STEP_MASK; \
239} while (0)
240
241/**
242 * geni_se_read_proto() - Read the protocol configured for a serial engine
243 * @se: Pointer to the concerned serial engine.
244 *
245 * Return: Protocol value as configured in the serial engine.
246 */
247static inline u32 geni_se_read_proto(struct geni_se *se)
248{
249 u32 val;
250
251 val = readl_relaxed(se->base + GENI_FW_REVISION_RO);
252
253 return (val & FW_REV_PROTOCOL_MSK) >> FW_REV_PROTOCOL_SHFT;
254}
255
256/**
257 * geni_se_setup_m_cmd() - Setup the primary sequencer
258 * @se: Pointer to the concerned serial engine.
259 * @cmd: Command/Operation to setup in the primary sequencer.
260 * @params: Parameter for the sequencer command.
261 *
262 * This function is used to configure the primary sequencer with the
263 * command and its associated parameters.
264 */
265static inline void geni_se_setup_m_cmd(struct geni_se *se, u32 cmd, u32 params)
266{
267 u32 m_cmd;
268
269 m_cmd = (cmd << M_OPCODE_SHFT) | (params & M_PARAMS_MSK);
270 writel_relaxed(m_cmd, se->base + SE_GENI_M_CMD0);
271}
272
273/**
274 * geni_se_setup_s_cmd() - Setup the secondary sequencer
275 * @se: Pointer to the concerned serial engine.
276 * @cmd: Command/Operation to setup in the secondary sequencer.
277 * @params: Parameter for the sequencer command.
278 *
279 * This function is used to configure the secondary sequencer with the
280 * command and its associated parameters.
281 */
282static inline void geni_se_setup_s_cmd(struct geni_se *se, u32 cmd, u32 params)
283{
284 u32 s_cmd;
285
286 s_cmd = readl_relaxed(se->base + SE_GENI_S_CMD0);
287 s_cmd &= ~(S_OPCODE_MSK | S_PARAMS_MSK);
288 s_cmd |= (cmd << S_OPCODE_SHFT);
289 s_cmd |= (params & S_PARAMS_MSK);
290 writel_relaxed(s_cmd, se->base + SE_GENI_S_CMD0);
291}
292
293/**
294 * geni_se_cancel_m_cmd() - Cancel the command configured in the primary
295 * sequencer
296 * @se: Pointer to the concerned serial engine.
297 *
298 * This function is used to cancel the currently configured command in the
299 * primary sequencer.
300 */
301static inline void geni_se_cancel_m_cmd(struct geni_se *se)
302{
303 writel_relaxed(M_GENI_CMD_CANCEL, se->base + SE_GENI_M_CMD_CTRL_REG);
304}
305
306/**
307 * geni_se_cancel_s_cmd() - Cancel the command configured in the secondary
308 * sequencer
309 * @se: Pointer to the concerned serial engine.
310 *
311 * This function is used to cancel the currently configured command in the
312 * secondary sequencer.
313 */
314static inline void geni_se_cancel_s_cmd(struct geni_se *se)
315{
316 writel_relaxed(S_GENI_CMD_CANCEL, se->base + SE_GENI_S_CMD_CTRL_REG);
317}
318
319/**
320 * geni_se_abort_m_cmd() - Abort the command configured in the primary sequencer
321 * @se: Pointer to the concerned serial engine.
322 *
323 * This function is used to force abort the currently configured command in the
324 * primary sequencer.
325 */
326static inline void geni_se_abort_m_cmd(struct geni_se *se)
327{
328 writel_relaxed(M_GENI_CMD_ABORT, se->base + SE_GENI_M_CMD_CTRL_REG);
329}
330
331/**
332 * geni_se_abort_s_cmd() - Abort the command configured in the secondary
333 * sequencer
334 * @se: Pointer to the concerned serial engine.
335 *
336 * This function is used to force abort the currently configured command in the
337 * secondary sequencer.
338 */
339static inline void geni_se_abort_s_cmd(struct geni_se *se)
340{
341 writel_relaxed(S_GENI_CMD_ABORT, se->base + SE_GENI_S_CMD_CTRL_REG);
342}
343
344/**
345 * geni_se_get_tx_fifo_depth() - Get the TX fifo depth of the serial engine
346 * @se: Pointer to the concerned serial engine.
347 *
348 * This function is used to get the depth i.e. number of elements in the
349 * TX fifo of the serial engine.
350 *
351 * Return: TX fifo depth in units of FIFO words.
352 */
353static inline u32 geni_se_get_tx_fifo_depth(struct geni_se *se)
354{
355 u32 val;
356
357 val = readl_relaxed(se->base + SE_HW_PARAM_0);
358
359 return (val & TX_FIFO_DEPTH_MSK) >> TX_FIFO_DEPTH_SHFT;
360}
361
362/**
363 * geni_se_get_tx_fifo_width() - Get the TX fifo width of the serial engine
364 * @se: Pointer to the concerned serial engine.
365 *
366 * This function is used to get the width i.e. word size per element in the
367 * TX fifo of the serial engine.
368 *
369 * Return: TX fifo width in bits
370 */
371static inline u32 geni_se_get_tx_fifo_width(struct geni_se *se)
372{
373 u32 val;
374
375 val = readl_relaxed(se->base + SE_HW_PARAM_0);
376
377 return (val & TX_FIFO_WIDTH_MSK) >> TX_FIFO_WIDTH_SHFT;
378}
379
380/**
381 * geni_se_get_rx_fifo_depth() - Get the RX fifo depth of the serial engine
382 * @se: Pointer to the concerned serial engine.
383 *
384 * This function is used to get the depth i.e. number of elements in the
385 * RX fifo of the serial engine.
386 *
387 * Return: RX fifo depth in units of FIFO words
388 */
389static inline u32 geni_se_get_rx_fifo_depth(struct geni_se *se)
390{
391 u32 val;
392
393 val = readl_relaxed(se->base + SE_HW_PARAM_1);
394
395 return (val & RX_FIFO_DEPTH_MSK) >> RX_FIFO_DEPTH_SHFT;
396}
397
398void geni_se_init(struct geni_se *se, u32 rx_wm, u32 rx_rfr);
399
400void geni_se_select_mode(struct geni_se *se, enum geni_se_xfer_mode mode);
401
402void geni_se_config_packing(struct geni_se *se, int bpw, int pack_words,
403 bool msb_to_lsb, bool tx_cfg, bool rx_cfg);
404
405int geni_se_resources_off(struct geni_se *se);
406
407int geni_se_resources_on(struct geni_se *se);
408
409int geni_se_clk_tbl_get(struct geni_se *se, unsigned long **tbl);
410
411int geni_se_clk_freq_match(struct geni_se *se, unsigned long req_freq,
412 unsigned int *index, unsigned long *res_freq,
413 bool exact);
414
415int geni_se_tx_dma_prep(struct geni_se *se, void *buf, size_t len,
416 dma_addr_t *iova);
417
418int geni_se_rx_dma_prep(struct geni_se *se, void *buf, size_t len,
419 dma_addr_t *iova);
420
421void geni_se_tx_dma_unprep(struct geni_se *se, dma_addr_t iova, size_t len);
422
423void geni_se_rx_dma_unprep(struct geni_se *se, dma_addr_t iova, size_t len);
424#endif
425#endif
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 127f534fec94..36df6ccbc874 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -404,6 +404,19 @@ static inline void list_splice_tail_init_rcu(struct list_head *list,
404 pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) 404 pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
405 405
406/** 406/**
407 * list_for_each_entry_from_rcu - iterate over a list from current point
408 * @pos: the type * to use as a loop cursor.
409 * @head: the head for your list.
410 * @member: the name of the list_node within the struct.
411 *
412 * Iterate over the tail of a list starting from a given position,
413 * which must have been in the list when the RCU read lock was taken.
414 */
415#define list_for_each_entry_from_rcu(pos, head, member) \
416 for (; &(pos)->member != (head); \
417 pos = list_entry_rcu(pos->member.next, typeof(*(pos)), member))
418
419/**
407 * hlist_del_rcu - deletes entry from hash list without re-initialization 420 * hlist_del_rcu - deletes entry from hash list without re-initialization
408 * @n: the element to delete from the hash list. 421 * @n: the element to delete from the hash list.
409 * 422 *
diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h
index e4b257ff881b..bc8206a8f30e 100644
--- a/include/linux/rculist_nulls.h
+++ b/include/linux/rculist_nulls.h
@@ -109,7 +109,7 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n,
109 * 109 *
110 * The barrier() is needed to make sure compiler doesn't cache first element [1], 110 * The barrier() is needed to make sure compiler doesn't cache first element [1],
111 * as this loop can be restarted [2] 111 * as this loop can be restarted [2]
112 * [1] Documentation/atomic_ops.txt around line 114 112 * [1] Documentation/core-api/atomic_ops.rst around line 114
113 * [2] Documentation/RCU/rculist_nulls.txt around line 146 113 * [2] Documentation/RCU/rculist_nulls.txt around line 146
114 */ 114 */
115#define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ 115#define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index e679b175b411..65163aa0bb04 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -652,9 +652,7 @@ static inline void rcu_read_lock(void)
652 * Unfortunately, this function acquires the scheduler's runqueue and 652 * Unfortunately, this function acquires the scheduler's runqueue and
653 * priority-inheritance spinlocks. This means that deadlock could result 653 * priority-inheritance spinlocks. This means that deadlock could result
654 * if the caller of rcu_read_unlock() already holds one of these locks or 654 * if the caller of rcu_read_unlock() already holds one of these locks or
655 * any lock that is ever acquired while holding them; or any lock which 655 * any lock that is ever acquired while holding them.
656 * can be taken from interrupt context because rcu_boost()->rt_mutex_lock()
657 * does not disable irqs while taking ->wait_lock.
658 * 656 *
659 * That said, RCU readers are never priority boosted unless they were 657 * That said, RCU readers are never priority boosted unless they were
660 * preempted. Therefore, one way to avoid deadlock is to make sure 658 * preempted. Therefore, one way to avoid deadlock is to make sure
diff --git a/include/linux/refcount.h b/include/linux/refcount.h
index 4193c41e383a..a685da2c4522 100644
--- a/include/linux/refcount.h
+++ b/include/linux/refcount.h
@@ -98,5 +98,7 @@ extern __must_check bool refcount_dec_if_one(refcount_t *r);
98extern __must_check bool refcount_dec_not_one(refcount_t *r); 98extern __must_check bool refcount_dec_not_one(refcount_t *r);
99extern __must_check bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock); 99extern __must_check bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock);
100extern __must_check bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock); 100extern __must_check bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock);
101 101extern __must_check bool refcount_dec_and_lock_irqsave(refcount_t *r,
102 spinlock_t *lock,
103 unsigned long *flags);
102#endif /* _LINUX_REFCOUNT_H */ 104#endif /* _LINUX_REFCOUNT_H */
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
index d8ecefaf63ca..6d46f962685d 100644
--- a/include/linux/regulator/ab8500.h
+++ b/include/linux/regulator/ab8500.h
@@ -49,47 +49,7 @@ enum ab8505_regulator_id {
49 AB8505_NUM_REGULATORS, 49 AB8505_NUM_REGULATORS,
50}; 50};
51 51
52/* AB9540 regulators */ 52/* AB8500 and AB8505 register initialization */
53enum ab9540_regulator_id {
54 AB9540_LDO_AUX1,
55 AB9540_LDO_AUX2,
56 AB9540_LDO_AUX3,
57 AB9540_LDO_AUX4,
58 AB9540_LDO_INTCORE,
59 AB9540_LDO_TVOUT,
60 AB9540_LDO_USB,
61 AB9540_LDO_AUDIO,
62 AB9540_LDO_ANAMIC1,
63 AB9540_LDO_ANAMIC2,
64 AB9540_LDO_DMIC,
65 AB9540_LDO_ANA,
66 AB9540_SYSCLKREQ_2,
67 AB9540_SYSCLKREQ_4,
68 AB9540_NUM_REGULATORS,
69};
70
71/* AB8540 regulators */
72enum ab8540_regulator_id {
73 AB8540_LDO_AUX1,
74 AB8540_LDO_AUX2,
75 AB8540_LDO_AUX3,
76 AB8540_LDO_AUX4,
77 AB8540_LDO_AUX5,
78 AB8540_LDO_AUX6,
79 AB8540_LDO_INTCORE,
80 AB8540_LDO_TVOUT,
81 AB8540_LDO_AUDIO,
82 AB8540_LDO_ANAMIC1,
83 AB8540_LDO_ANAMIC2,
84 AB8540_LDO_DMIC,
85 AB8540_LDO_ANA,
86 AB8540_LDO_SDIO,
87 AB8540_SYSCLKREQ_2,
88 AB8540_SYSCLKREQ_4,
89 AB8540_NUM_REGULATORS,
90};
91
92/* AB8500, AB8505, and AB9540 register initialization */
93struct ab8500_regulator_reg_init { 53struct ab8500_regulator_reg_init {
94 int id; 54 int id;
95 u8 mask; 55 u8 mask;
@@ -185,121 +145,6 @@ enum ab8505_regulator_reg {
185 AB8505_NUM_REGULATOR_REGISTERS, 145 AB8505_NUM_REGULATOR_REGISTERS,
186}; 146};
187 147
188/* AB9540 registers */
189enum ab9540_regulator_reg {
190 AB9540_REGUREQUESTCTRL1,
191 AB9540_REGUREQUESTCTRL2,
192 AB9540_REGUREQUESTCTRL3,
193 AB9540_REGUREQUESTCTRL4,
194 AB9540_REGUSYSCLKREQ1HPVALID1,
195 AB9540_REGUSYSCLKREQ1HPVALID2,
196 AB9540_REGUHWHPREQ1VALID1,
197 AB9540_REGUHWHPREQ1VALID2,
198 AB9540_REGUHWHPREQ2VALID1,
199 AB9540_REGUHWHPREQ2VALID2,
200 AB9540_REGUSWHPREQVALID1,
201 AB9540_REGUSWHPREQVALID2,
202 AB9540_REGUSYSCLKREQVALID1,
203 AB9540_REGUSYSCLKREQVALID2,
204 AB9540_REGUVAUX4REQVALID,
205 AB9540_REGUMISC1,
206 AB9540_VAUDIOSUPPLY,
207 AB9540_REGUCTRL1VAMIC,
208 AB9540_VSMPS1REGU,
209 AB9540_VSMPS2REGU,
210 AB9540_VSMPS3REGU, /* NOTE! PRCMU register */
211 AB9540_VPLLVANAREGU,
212 AB9540_EXTSUPPLYREGU,
213 AB9540_VAUX12REGU,
214 AB9540_VRF1VAUX3REGU,
215 AB9540_VSMPS1SEL1,
216 AB9540_VSMPS1SEL2,
217 AB9540_VSMPS1SEL3,
218 AB9540_VSMPS2SEL1,
219 AB9540_VSMPS2SEL2,
220 AB9540_VSMPS2SEL3,
221 AB9540_VSMPS3SEL1, /* NOTE! PRCMU register */
222 AB9540_VSMPS3SEL2, /* NOTE! PRCMU register */
223 AB9540_VAUX1SEL,
224 AB9540_VAUX2SEL,
225 AB9540_VRF1VAUX3SEL,
226 AB9540_REGUCTRL2SPARE,
227 AB9540_VAUX4REQCTRL,
228 AB9540_VAUX4REGU,
229 AB9540_VAUX4SEL,
230 AB9540_REGUCTRLDISCH,
231 AB9540_REGUCTRLDISCH2,
232 AB9540_REGUCTRLDISCH3,
233 AB9540_NUM_REGULATOR_REGISTERS,
234};
235
236/* AB8540 registers */
237enum ab8540_regulator_reg {
238 AB8540_REGUREQUESTCTRL1,
239 AB8540_REGUREQUESTCTRL2,
240 AB8540_REGUREQUESTCTRL3,
241 AB8540_REGUREQUESTCTRL4,
242 AB8540_REGUSYSCLKREQ1HPVALID1,
243 AB8540_REGUSYSCLKREQ1HPVALID2,
244 AB8540_REGUHWHPREQ1VALID1,
245 AB8540_REGUHWHPREQ1VALID2,
246 AB8540_REGUHWHPREQ2VALID1,
247 AB8540_REGUHWHPREQ2VALID2,
248 AB8540_REGUSWHPREQVALID1,
249 AB8540_REGUSWHPREQVALID2,
250 AB8540_REGUSYSCLKREQVALID1,
251 AB8540_REGUSYSCLKREQVALID2,
252 AB8540_REGUVAUX4REQVALID,
253 AB8540_REGUVAUX5REQVALID,
254 AB8540_REGUVAUX6REQVALID,
255 AB8540_REGUVCLKBREQVALID,
256 AB8540_REGUVRF1REQVALID,
257 AB8540_REGUMISC1,
258 AB8540_VAUDIOSUPPLY,
259 AB8540_REGUCTRL1VAMIC,
260 AB8540_VHSIC,
261 AB8540_VSDIO,
262 AB8540_VSMPS1REGU,
263 AB8540_VSMPS2REGU,
264 AB8540_VSMPS3REGU,
265 AB8540_VPLLVANAREGU,
266 AB8540_EXTSUPPLYREGU,
267 AB8540_VAUX12REGU,
268 AB8540_VRF1VAUX3REGU,
269 AB8540_VSMPS1SEL1,
270 AB8540_VSMPS1SEL2,
271 AB8540_VSMPS1SEL3,
272 AB8540_VSMPS2SEL1,
273 AB8540_VSMPS2SEL2,
274 AB8540_VSMPS2SEL3,
275 AB8540_VSMPS3SEL1,
276 AB8540_VSMPS3SEL2,
277 AB8540_VAUX1SEL,
278 AB8540_VAUX2SEL,
279 AB8540_VRF1VAUX3SEL,
280 AB8540_REGUCTRL2SPARE,
281 AB8540_VAUX4REQCTRL,
282 AB8540_VAUX4REGU,
283 AB8540_VAUX4SEL,
284 AB8540_VAUX5REQCTRL,
285 AB8540_VAUX5REGU,
286 AB8540_VAUX5SEL,
287 AB8540_VAUX6REQCTRL,
288 AB8540_VAUX6REGU,
289 AB8540_VAUX6SEL,
290 AB8540_VCLKBREQCTRL,
291 AB8540_VCLKBREGU,
292 AB8540_VCLKBSEL,
293 AB8540_VRF1REQCTRL,
294 AB8540_REGUCTRLDISCH,
295 AB8540_REGUCTRLDISCH2,
296 AB8540_REGUCTRLDISCH3,
297 AB8540_REGUCTRLDISCH4,
298 AB8540_VSIMSYSCLKCTRL,
299 AB8540_VANAVPLLSEL,
300 AB8540_NUM_REGULATOR_REGISTERS,
301};
302
303/* AB8500 external regulators */ 148/* AB8500 external regulators */
304struct ab8500_ext_regulator_cfg { 149struct ab8500_ext_regulator_cfg {
305 bool hwreq; /* requires hw mode or high power mode */ 150 bool hwreq; /* requires hw mode or high power mode */
diff --git a/include/linux/regulator/arizona-ldo1.h b/include/linux/regulator/arizona-ldo1.h
index c685f1277c63..fe74ab9990e6 100644
--- a/include/linux/regulator/arizona-ldo1.h
+++ b/include/linux/regulator/arizona-ldo1.h
@@ -14,9 +14,6 @@
14struct regulator_init_data; 14struct regulator_init_data;
15 15
16struct arizona_ldo1_pdata { 16struct arizona_ldo1_pdata {
17 /** GPIO controlling LDOENA, if any */
18 int ldoena;
19
20 /** Regulator configuration for LDO1 */ 17 /** Regulator configuration for LDO1 */
21 const struct regulator_init_data *init_data; 18 const struct regulator_init_data *init_data;
22}; 19};
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index df176d7c2b87..25602afd4844 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -80,6 +80,7 @@ struct regmap;
80 * These modes can be OR'ed together to make up a mask of valid register modes. 80 * These modes can be OR'ed together to make up a mask of valid register modes.
81 */ 81 */
82 82
83#define REGULATOR_MODE_INVALID 0x0
83#define REGULATOR_MODE_FAST 0x1 84#define REGULATOR_MODE_FAST 0x1
84#define REGULATOR_MODE_NORMAL 0x2 85#define REGULATOR_MODE_NORMAL 0x2
85#define REGULATOR_MODE_IDLE 0x4 86#define REGULATOR_MODE_IDLE 0x4
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 4fc96cb8e5d7..fc2dc8df476f 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -15,6 +15,8 @@
15#ifndef __LINUX_REGULATOR_DRIVER_H_ 15#ifndef __LINUX_REGULATOR_DRIVER_H_
16#define __LINUX_REGULATOR_DRIVER_H_ 16#define __LINUX_REGULATOR_DRIVER_H_
17 17
18#define MAX_COUPLED 4
19
18#include <linux/device.h> 20#include <linux/device.h>
19#include <linux/notifier.h> 21#include <linux/notifier.h>
20#include <linux/regulator/consumer.h> 22#include <linux/regulator/consumer.h>
@@ -81,9 +83,12 @@ struct regulator_linear_range {
81 * @set_voltage_sel: Set the voltage for the regulator using the specified 83 * @set_voltage_sel: Set the voltage for the regulator using the specified
82 * selector. 84 * selector.
83 * @map_voltage: Convert a voltage into a selector 85 * @map_voltage: Convert a voltage into a selector
84 * @get_voltage: Return the currently configured voltage for the regulator. 86 * @get_voltage: Return the currently configured voltage for the regulator;
87 * return -ENOTRECOVERABLE if regulator can't be read at
88 * bootup and hasn't been set yet.
85 * @get_voltage_sel: Return the currently configured voltage selector for the 89 * @get_voltage_sel: Return the currently configured voltage selector for the
86 * regulator. 90 * regulator; return -ENOTRECOVERABLE if regulator can't
91 * be read at bootup and hasn't been set yet.
87 * @list_voltage: Return one of the supported voltages, in microvolts; zero 92 * @list_voltage: Return one of the supported voltages, in microvolts; zero
88 * if the selector indicates a voltage that is unusable on this system; 93 * if the selector indicates a voltage that is unusable on this system;
89 * or negative errno. Selectors range from zero to one less than 94 * or negative errno. Selectors range from zero to one less than
@@ -407,6 +412,20 @@ struct regulator_config {
407}; 412};
408 413
409/* 414/*
415 * struct coupling_desc
416 *
417 * Describes coupling of regulators. Each regulator should have
418 * at least a pointer to itself in coupled_rdevs array.
419 * When a new coupled regulator is resolved, n_resolved is
420 * incremented.
421 */
422struct coupling_desc {
423 struct regulator_dev *coupled_rdevs[MAX_COUPLED];
424 int n_resolved;
425 int n_coupled;
426};
427
428/*
410 * struct regulator_dev 429 * struct regulator_dev
411 * 430 *
412 * Voltage / Current regulator class device. One for each 431 * Voltage / Current regulator class device. One for each
@@ -429,8 +448,12 @@ struct regulator_dev {
429 /* lists we own */ 448 /* lists we own */
430 struct list_head consumer_list; /* consumers we supply */ 449 struct list_head consumer_list; /* consumers we supply */
431 450
451 struct coupling_desc coupling_desc;
452
432 struct blocking_notifier_head notifier; 453 struct blocking_notifier_head notifier;
433 struct mutex mutex; /* consumer lock */ 454 struct mutex mutex; /* consumer lock */
455 struct task_struct *mutex_owner;
456 int ref_cnt;
434 struct module *owner; 457 struct module *owner;
435 struct device dev; 458 struct device dev;
436 struct regulation_constraints *constraints; 459 struct regulation_constraints *constraints;
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 93a04893c739..3468703d663a 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -103,6 +103,7 @@ struct regulator_state {
103 * @ilim_uA: Maximum input current. 103 * @ilim_uA: Maximum input current.
104 * @system_load: Load that isn't captured by any consumer requests. 104 * @system_load: Load that isn't captured by any consumer requests.
105 * 105 *
106 * @max_spread: Max possible spread between coupled regulators
106 * @valid_modes_mask: Mask of modes which may be configured by consumers. 107 * @valid_modes_mask: Mask of modes which may be configured by consumers.
107 * @valid_ops_mask: Operations which may be performed by consumers. 108 * @valid_ops_mask: Operations which may be performed by consumers.
108 * 109 *
@@ -154,6 +155,9 @@ struct regulation_constraints {
154 155
155 int system_load; 156 int system_load;
156 157
158 /* used for coupled regulators */
159 int max_spread;
160
157 /* valid regulator operating modes for this machine */ 161 /* valid regulator operating modes for this machine */
158 unsigned int valid_modes_mask; 162 unsigned int valid_modes_mask;
159 163
diff --git a/include/linux/regulator/max8952.h b/include/linux/regulator/max8952.h
index 4dbb63a1d4ab..686c42c041b5 100644
--- a/include/linux/regulator/max8952.h
+++ b/include/linux/regulator/max8952.h
@@ -120,7 +120,6 @@ enum {
120struct max8952_platform_data { 120struct max8952_platform_data {
121 int gpio_vid0; 121 int gpio_vid0;
122 int gpio_vid1; 122 int gpio_vid1;
123 int gpio_en;
124 123
125 u32 default_mode; 124 u32 default_mode;
126 u32 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */ 125 u32 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */
diff --git a/include/linux/rmi.h b/include/linux/rmi.h
index 64125443f8a6..5ef5c7c412a7 100644
--- a/include/linux/rmi.h
+++ b/include/linux/rmi.h
@@ -354,6 +354,8 @@ struct rmi_driver_data {
354 struct mutex irq_mutex; 354 struct mutex irq_mutex;
355 struct input_dev *input; 355 struct input_dev *input;
356 356
357 struct irq_domain *irqdomain;
358
357 u8 pdt_props; 359 u8 pdt_props;
358 360
359 u8 num_rx_electrodes; 361 u8 num_rx_electrodes;
diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h
index ca07366c4c33..9fe156d1c018 100644
--- a/include/linux/rpmsg.h
+++ b/include/linux/rpmsg.h
@@ -1,35 +1,10 @@
1/* SPDX-License-Identifier: BSD-3-Clause */
1/* 2/*
2 * Remote processor messaging 3 * Remote processor messaging
3 * 4 *
4 * Copyright (C) 2011 Texas Instruments, Inc. 5 * Copyright (C) 2011 Texas Instruments, Inc.
5 * Copyright (C) 2011 Google, Inc. 6 * Copyright (C) 2011 Google, Inc.
6 * All rights reserved. 7 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * * Neither the name Texas Instruments nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 8 */
34 9
35#ifndef _LINUX_RPMSG_H 10#ifndef _LINUX_RPMSG_H
diff --git a/include/linux/rpmsg/qcom_glink.h b/include/linux/rpmsg/qcom_glink.h
index a622f029836e..96e26d94719f 100644
--- a/include/linux/rpmsg/qcom_glink.h
+++ b/include/linux/rpmsg/qcom_glink.h
@@ -1,3 +1,5 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2
1#ifndef _LINUX_RPMSG_QCOM_GLINK_H 3#ifndef _LINUX_RPMSG_QCOM_GLINK_H
2#define _LINUX_RPMSG_QCOM_GLINK_H 4#define _LINUX_RPMSG_QCOM_GLINK_H
3 5
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 4c007f69082f..6268208760e9 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -285,7 +285,7 @@ void rtc_nvmem_unregister(struct rtc_device *rtc);
285static inline int rtc_nvmem_register(struct rtc_device *rtc, 285static inline int rtc_nvmem_register(struct rtc_device *rtc,
286 struct nvmem_config *nvmem_config) 286 struct nvmem_config *nvmem_config)
287{ 287{
288 return -ENODEV; 288 return 0;
289} 289}
290static inline void rtc_nvmem_unregister(struct rtc_device *rtc) {} 290static inline void rtc_nvmem_unregister(struct rtc_device *rtc) {}
291#endif 291#endif
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 51f52020ad5f..093aa57120b0 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -9,9 +9,6 @@
9#include <asm/io.h> 9#include <asm/io.h>
10 10
11struct scatterlist { 11struct scatterlist {
12#ifdef CONFIG_DEBUG_SG
13 unsigned long sg_magic;
14#endif
15 unsigned long page_link; 12 unsigned long page_link;
16 unsigned int offset; 13 unsigned int offset;
17 unsigned int length; 14 unsigned int length;
@@ -64,7 +61,6 @@ struct sg_table {
64 * 61 *
65 */ 62 */
66 63
67#define SG_MAGIC 0x87654321
68#define SG_CHAIN 0x01UL 64#define SG_CHAIN 0x01UL
69#define SG_END 0x02UL 65#define SG_END 0x02UL
70 66
@@ -98,7 +94,6 @@ static inline void sg_assign_page(struct scatterlist *sg, struct page *page)
98 */ 94 */
99 BUG_ON((unsigned long) page & (SG_CHAIN | SG_END)); 95 BUG_ON((unsigned long) page & (SG_CHAIN | SG_END));
100#ifdef CONFIG_DEBUG_SG 96#ifdef CONFIG_DEBUG_SG
101 BUG_ON(sg->sg_magic != SG_MAGIC);
102 BUG_ON(sg_is_chain(sg)); 97 BUG_ON(sg_is_chain(sg));
103#endif 98#endif
104 sg->page_link = page_link | (unsigned long) page; 99 sg->page_link = page_link | (unsigned long) page;
@@ -129,7 +124,6 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page,
129static inline struct page *sg_page(struct scatterlist *sg) 124static inline struct page *sg_page(struct scatterlist *sg)
130{ 125{
131#ifdef CONFIG_DEBUG_SG 126#ifdef CONFIG_DEBUG_SG
132 BUG_ON(sg->sg_magic != SG_MAGIC);
133 BUG_ON(sg_is_chain(sg)); 127 BUG_ON(sg_is_chain(sg));
134#endif 128#endif
135 return (struct page *)((sg)->page_link & ~(SG_CHAIN | SG_END)); 129 return (struct page *)((sg)->page_link & ~(SG_CHAIN | SG_END));
@@ -195,9 +189,6 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
195 **/ 189 **/
196static inline void sg_mark_end(struct scatterlist *sg) 190static inline void sg_mark_end(struct scatterlist *sg)
197{ 191{
198#ifdef CONFIG_DEBUG_SG
199 BUG_ON(sg->sg_magic != SG_MAGIC);
200#endif
201 /* 192 /*
202 * Set termination bit, clear potential chain bit 193 * Set termination bit, clear potential chain bit
203 */ 194 */
@@ -215,9 +206,6 @@ static inline void sg_mark_end(struct scatterlist *sg)
215 **/ 206 **/
216static inline void sg_unmark_end(struct scatterlist *sg) 207static inline void sg_unmark_end(struct scatterlist *sg)
217{ 208{
218#ifdef CONFIG_DEBUG_SG
219 BUG_ON(sg->sg_magic != SG_MAGIC);
220#endif
221 sg->page_link &= ~SG_END; 209 sg->page_link &= ~SG_END;
222} 210}
223 211
@@ -260,12 +248,6 @@ static inline void *sg_virt(struct scatterlist *sg)
260static inline void sg_init_marker(struct scatterlist *sgl, 248static inline void sg_init_marker(struct scatterlist *sgl,
261 unsigned int nents) 249 unsigned int nents)
262{ 250{
263#ifdef CONFIG_DEBUG_SG
264 unsigned int i;
265
266 for (i = 0; i < nents; i++)
267 sgl[i].sg_magic = SG_MAGIC;
268#endif
269 sg_mark_end(&sgl[nents - 1]); 251 sg_mark_end(&sgl[nents - 1]);
270} 252}
271 253
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 14e4f9c12337..43731fe51c97 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -27,6 +27,7 @@
27#include <linux/signal_types.h> 27#include <linux/signal_types.h>
28#include <linux/mm_types_task.h> 28#include <linux/mm_types_task.h>
29#include <linux/task_io_accounting.h> 29#include <linux/task_io_accounting.h>
30#include <linux/rseq.h>
30 31
31/* task_struct member predeclarations (sorted alphabetically): */ 32/* task_struct member predeclarations (sorted alphabetically): */
32struct audit_context; 33struct audit_context;
@@ -117,7 +118,7 @@ struct task_group;
117 * the comment with set_special_state(). 118 * the comment with set_special_state().
118 */ 119 */
119#define is_special_task_state(state) \ 120#define is_special_task_state(state) \
120 ((state) & (__TASK_STOPPED | __TASK_TRACED | TASK_DEAD)) 121 ((state) & (__TASK_STOPPED | __TASK_TRACED | TASK_PARKED | TASK_DEAD))
121 122
122#define __set_current_state(state_value) \ 123#define __set_current_state(state_value) \
123 do { \ 124 do { \
@@ -741,7 +742,7 @@ struct task_struct {
741 pid_t pid; 742 pid_t pid;
742 pid_t tgid; 743 pid_t tgid;
743 744
744#ifdef CONFIG_CC_STACKPROTECTOR 745#ifdef CONFIG_STACKPROTECTOR
745 /* Canary value for the -fstack-protector GCC feature: */ 746 /* Canary value for the -fstack-protector GCC feature: */
746 unsigned long stack_canary; 747 unsigned long stack_canary;
747#endif 748#endif
@@ -1047,6 +1048,17 @@ struct task_struct {
1047 unsigned long numa_pages_migrated; 1048 unsigned long numa_pages_migrated;
1048#endif /* CONFIG_NUMA_BALANCING */ 1049#endif /* CONFIG_NUMA_BALANCING */
1049 1050
1051#ifdef CONFIG_RSEQ
1052 struct rseq __user *rseq;
1053 u32 rseq_len;
1054 u32 rseq_sig;
1055 /*
1056 * RmW on rseq_event_mask must be performed atomically
1057 * with respect to preemption.
1058 */
1059 unsigned long rseq_event_mask;
1060#endif
1061
1050 struct tlbflush_unmap_batch tlb_ubc; 1062 struct tlbflush_unmap_batch tlb_ubc;
1051 1063
1052 struct rcu_head rcu; 1064 struct rcu_head rcu;
@@ -1118,7 +1130,7 @@ struct task_struct {
1118 1130
1119#ifdef CONFIG_KCOV 1131#ifdef CONFIG_KCOV
1120 /* Coverage collection mode enabled for this task (0 if disabled): */ 1132 /* Coverage collection mode enabled for this task (0 if disabled): */
1121 enum kcov_mode kcov_mode; 1133 unsigned int kcov_mode;
1122 1134
1123 /* Size of the kcov_area: */ 1135 /* Size of the kcov_area: */
1124 unsigned int kcov_size; 1136 unsigned int kcov_size;
@@ -1627,6 +1639,12 @@ static inline void clear_tsk_thread_flag(struct task_struct *tsk, int flag)
1627 clear_ti_thread_flag(task_thread_info(tsk), flag); 1639 clear_ti_thread_flag(task_thread_info(tsk), flag);
1628} 1640}
1629 1641
1642static inline void update_tsk_thread_flag(struct task_struct *tsk, int flag,
1643 bool value)
1644{
1645 update_ti_thread_flag(task_thread_info(tsk), flag, value);
1646}
1647
1630static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) 1648static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag)
1631{ 1649{
1632 return test_and_set_ti_thread_flag(task_thread_info(tsk), flag); 1650 return test_and_set_ti_thread_flag(task_thread_info(tsk), flag);
@@ -1757,4 +1775,127 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
1757#define TASK_SIZE_OF(tsk) TASK_SIZE 1775#define TASK_SIZE_OF(tsk) TASK_SIZE
1758#endif 1776#endif
1759 1777
1778#ifdef CONFIG_RSEQ
1779
1780/*
1781 * Map the event mask on the user-space ABI enum rseq_cs_flags
1782 * for direct mask checks.
1783 */
1784enum rseq_event_mask_bits {
1785 RSEQ_EVENT_PREEMPT_BIT = RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT,
1786 RSEQ_EVENT_SIGNAL_BIT = RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT,
1787 RSEQ_EVENT_MIGRATE_BIT = RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT,
1788};
1789
1790enum rseq_event_mask {
1791 RSEQ_EVENT_PREEMPT = (1U << RSEQ_EVENT_PREEMPT_BIT),
1792 RSEQ_EVENT_SIGNAL = (1U << RSEQ_EVENT_SIGNAL_BIT),
1793 RSEQ_EVENT_MIGRATE = (1U << RSEQ_EVENT_MIGRATE_BIT),
1794};
1795
1796static inline void rseq_set_notify_resume(struct task_struct *t)
1797{
1798 if (t->rseq)
1799 set_tsk_thread_flag(t, TIF_NOTIFY_RESUME);
1800}
1801
1802void __rseq_handle_notify_resume(struct ksignal *sig, struct pt_regs *regs);
1803
1804static inline void rseq_handle_notify_resume(struct ksignal *ksig,
1805 struct pt_regs *regs)
1806{
1807 if (current->rseq)
1808 __rseq_handle_notify_resume(ksig, regs);
1809}
1810
1811static inline void rseq_signal_deliver(struct ksignal *ksig,
1812 struct pt_regs *regs)
1813{
1814 preempt_disable();
1815 __set_bit(RSEQ_EVENT_SIGNAL_BIT, &current->rseq_event_mask);
1816 preempt_enable();
1817 rseq_handle_notify_resume(ksig, regs);
1818}
1819
1820/* rseq_preempt() requires preemption to be disabled. */
1821static inline void rseq_preempt(struct task_struct *t)
1822{
1823 __set_bit(RSEQ_EVENT_PREEMPT_BIT, &t->rseq_event_mask);
1824 rseq_set_notify_resume(t);
1825}
1826
1827/* rseq_migrate() requires preemption to be disabled. */
1828static inline void rseq_migrate(struct task_struct *t)
1829{
1830 __set_bit(RSEQ_EVENT_MIGRATE_BIT, &t->rseq_event_mask);
1831 rseq_set_notify_resume(t);
1832}
1833
1834/*
1835 * If parent process has a registered restartable sequences area, the
1836 * child inherits. Only applies when forking a process, not a thread.
1837 */
1838static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
1839{
1840 if (clone_flags & CLONE_THREAD) {
1841 t->rseq = NULL;
1842 t->rseq_len = 0;
1843 t->rseq_sig = 0;
1844 t->rseq_event_mask = 0;
1845 } else {
1846 t->rseq = current->rseq;
1847 t->rseq_len = current->rseq_len;
1848 t->rseq_sig = current->rseq_sig;
1849 t->rseq_event_mask = current->rseq_event_mask;
1850 }
1851}
1852
1853static inline void rseq_execve(struct task_struct *t)
1854{
1855 t->rseq = NULL;
1856 t->rseq_len = 0;
1857 t->rseq_sig = 0;
1858 t->rseq_event_mask = 0;
1859}
1860
1861#else
1862
1863static inline void rseq_set_notify_resume(struct task_struct *t)
1864{
1865}
1866static inline void rseq_handle_notify_resume(struct ksignal *ksig,
1867 struct pt_regs *regs)
1868{
1869}
1870static inline void rseq_signal_deliver(struct ksignal *ksig,
1871 struct pt_regs *regs)
1872{
1873}
1874static inline void rseq_preempt(struct task_struct *t)
1875{
1876}
1877static inline void rseq_migrate(struct task_struct *t)
1878{
1879}
1880static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
1881{
1882}
1883static inline void rseq_execve(struct task_struct *t)
1884{
1885}
1886
1887#endif
1888
1889#ifdef CONFIG_DEBUG_RSEQ
1890
1891void rseq_syscall(struct pt_regs *regs);
1892
1893#else
1894
1895static inline void rseq_syscall(struct pt_regs *regs)
1896{
1897}
1898
1899#endif
1900
1760#endif 1901#endif
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index b458c87b866c..f4c9fc0fc755 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -85,8 +85,8 @@ struct scmi_clk_ops {
85 * @level_set: sets the performance level of a domain 85 * @level_set: sets the performance level of a domain
86 * @level_get: gets the performance level of a domain 86 * @level_get: gets the performance level of a domain
87 * @device_domain_id: gets the scmi domain id for a given device 87 * @device_domain_id: gets the scmi domain id for a given device
88 * @get_transition_latency: gets the DVFS transition latency for a given device 88 * @transition_latency_get: gets the DVFS transition latency for a given device
89 * @add_opps_to_device: adds all the OPPs for a given device 89 * @device_opps_add: adds all the OPPs for a given device
90 * @freq_set: sets the frequency for a given device using sustained frequency 90 * @freq_set: sets the frequency for a given device using sustained frequency
91 * to sustained performance level mapping 91 * to sustained performance level mapping
92 * @freq_get: gets the frequency for a given device using sustained frequency 92 * @freq_get: gets the frequency for a given device using sustained frequency
@@ -102,10 +102,10 @@ struct scmi_perf_ops {
102 int (*level_get)(const struct scmi_handle *handle, u32 domain, 102 int (*level_get)(const struct scmi_handle *handle, u32 domain,
103 u32 *level, bool poll); 103 u32 *level, bool poll);
104 int (*device_domain_id)(struct device *dev); 104 int (*device_domain_id)(struct device *dev);
105 int (*get_transition_latency)(const struct scmi_handle *handle, 105 int (*transition_latency_get)(const struct scmi_handle *handle,
106 struct device *dev); 106 struct device *dev);
107 int (*add_opps_to_device)(const struct scmi_handle *handle, 107 int (*device_opps_add)(const struct scmi_handle *handle,
108 struct device *dev); 108 struct device *dev);
109 int (*freq_set)(const struct scmi_handle *handle, u32 domain, 109 int (*freq_set)(const struct scmi_handle *handle, u32 domain,
110 unsigned long rate, bool poll); 110 unsigned long rate, bool poll);
111 int (*freq_get)(const struct scmi_handle *handle, u32 domain, 111 int (*freq_get)(const struct scmi_handle *handle, u32 domain,
@@ -189,6 +189,14 @@ struct scmi_sensor_ops {
189 * @perf_ops: pointer to set of performance protocol operations 189 * @perf_ops: pointer to set of performance protocol operations
190 * @clk_ops: pointer to set of clock protocol operations 190 * @clk_ops: pointer to set of clock protocol operations
191 * @sensor_ops: pointer to set of sensor protocol operations 191 * @sensor_ops: pointer to set of sensor protocol operations
192 * @perf_priv: pointer to private data structure specific to performance
193 * protocol(for internal use only)
194 * @clk_priv: pointer to private data structure specific to clock
195 * protocol(for internal use only)
196 * @power_priv: pointer to private data structure specific to power
197 * protocol(for internal use only)
198 * @sensor_priv: pointer to private data structure specific to sensors
199 * protocol(for internal use only)
192 */ 200 */
193struct scmi_handle { 201struct scmi_handle {
194 struct device *dev; 202 struct device *dev;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c86885954994..164cdedf6012 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3252,7 +3252,8 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags,
3252 int *peeked, int *off, int *err); 3252 int *peeked, int *off, int *err);
3253struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, 3253struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
3254 int *err); 3254 int *err);
3255__poll_t datagram_poll_mask(struct socket *sock, __poll_t events); 3255__poll_t datagram_poll(struct file *file, struct socket *sock,
3256 struct poll_table_struct *wait);
3256int skb_copy_datagram_iter(const struct sk_buff *from, int offset, 3257int skb_copy_datagram_iter(const struct sk_buff *from, int offset,
3257 struct iov_iter *to, int size); 3258 struct iov_iter *to, int size);
3258static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset, 3259static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset,
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 4d759e1ddc33..14e3fe4bd6a1 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -600,6 +600,7 @@ struct memcg_cache_params {
600 struct memcg_cache_array __rcu *memcg_caches; 600 struct memcg_cache_array __rcu *memcg_caches;
601 struct list_head __root_caches_node; 601 struct list_head __root_caches_node;
602 struct list_head children; 602 struct list_head children;
603 bool dying;
603 }; 604 };
604 struct { 605 struct {
605 struct mem_cgroup *memcg; 606 struct mem_cgroup *memcg;
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 09fa2c6f0e68..3a1a1dbc6f49 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -155,8 +155,12 @@ struct kmem_cache {
155 155
156#ifdef CONFIG_SYSFS 156#ifdef CONFIG_SYSFS
157#define SLAB_SUPPORTS_SYSFS 157#define SLAB_SUPPORTS_SYSFS
158void sysfs_slab_unlink(struct kmem_cache *);
158void sysfs_slab_release(struct kmem_cache *); 159void sysfs_slab_release(struct kmem_cache *);
159#else 160#else
161static inline void sysfs_slab_unlink(struct kmem_cache *s)
162{
163}
160static inline void sysfs_slab_release(struct kmem_cache *s) 164static inline void sysfs_slab_release(struct kmem_cache *s)
161{ 165{
162} 166}
diff --git a/include/linux/soc/qcom/smem.h b/include/linux/soc/qcom/smem.h
index c1657ed27b30..86e1b358688a 100644
--- a/include/linux/soc/qcom/smem.h
+++ b/include/linux/soc/qcom/smem.h
@@ -9,4 +9,6 @@ void *qcom_smem_get(unsigned host, unsigned item, size_t *size);
9 9
10int qcom_smem_get_free_space(unsigned host); 10int qcom_smem_get_free_space(unsigned host);
11 11
12phys_addr_t qcom_smem_virt_to_phys(void *p);
13
12#endif 14#endif
diff --git a/include/linux/soc/ti/ti_sci_protocol.h b/include/linux/soc/ti/ti_sci_protocol.h
index 0ccbc138c26a..18435e5c6364 100644
--- a/include/linux/soc/ti/ti_sci_protocol.h
+++ b/include/linux/soc/ti/ti_sci_protocol.h
@@ -1,17 +1,9 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Texas Instruments System Control Interface Protocol 3 * Texas Instruments System Control Interface Protocol
3 * 4 *
4 * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/ 5 * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
5 * Nishanth Menon 6 * Nishanth Menon
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */ 7 */
16 8
17#ifndef __TISCI_PROTOCOL_H 9#ifndef __TISCI_PROTOCOL_H
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 1e8a46435838..fd57888d4942 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -427,6 +427,11 @@ extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
427#define atomic_dec_and_lock(atomic, lock) \ 427#define atomic_dec_and_lock(atomic, lock) \
428 __cond_lock(lock, _atomic_dec_and_lock(atomic, lock)) 428 __cond_lock(lock, _atomic_dec_and_lock(atomic, lock))
429 429
430extern int _atomic_dec_and_lock_irqsave(atomic_t *atomic, spinlock_t *lock,
431 unsigned long *flags);
432#define atomic_dec_and_lock_irqsave(atomic, lock, flags) \
433 __cond_lock(lock, _atomic_dec_and_lock_irqsave(atomic, lock, &(flags)))
434
430int alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask, 435int alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask,
431 size_t max_size, unsigned int cpu_mult, 436 size_t max_size, unsigned int cpu_mult,
432 gfp_t gfp); 437 gfp_t gfp);
diff --git a/include/linux/stackprotector.h b/include/linux/stackprotector.h
index 03696c729fb4..6b792d080eee 100644
--- a/include/linux/stackprotector.h
+++ b/include/linux/stackprotector.h
@@ -6,7 +6,7 @@
6#include <linux/sched.h> 6#include <linux/sched.h>
7#include <linux/random.h> 7#include <linux/random.h>
8 8
9#ifdef CONFIG_CC_STACKPROTECTOR 9#ifdef CONFIG_STACKPROTECTOR
10# include <asm/stackprotector.h> 10# include <asm/stackprotector.h>
11#else 11#else
12static inline void boot_init_stack_canary(void) 12static inline void boot_init_stack_canary(void)
diff --git a/include/linux/stat.h b/include/linux/stat.h
index 22484e44544d..765573dc17d6 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -41,10 +41,10 @@ struct kstat {
41 kuid_t uid; 41 kuid_t uid;
42 kgid_t gid; 42 kgid_t gid;
43 loff_t size; 43 loff_t size;
44 struct timespec atime; 44 struct timespec64 atime;
45 struct timespec mtime; 45 struct timespec64 mtime;
46 struct timespec ctime; 46 struct timespec64 ctime;
47 struct timespec btime; /* File creation time */ 47 struct timespec64 btime; /* File creation time */
48 u64 blocks; 48 u64 blocks;
49}; 49};
50 50
diff --git a/include/linux/ste_modem_shm.h b/include/linux/ste_modem_shm.h
deleted file mode 100644
index 8444a4eff1bb..000000000000
--- a/include/linux/ste_modem_shm.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson AB 2012
3 * Author: Sjur Brendeland / sjur.brandeland@stericsson.com
4 *
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef __INC_MODEM_DEV_H
9#define __INC_MODEM_DEV_H
10#include <linux/types.h>
11#include <linux/platform_device.h>
12
13struct ste_modem_device;
14
15/**
16 * struct ste_modem_dev_cb - Callbacks for modem initiated events.
17 * @kick: Called when the modem kicks the host.
18 *
19 * This structure contains callbacks for actions triggered by the modem.
20 */
21struct ste_modem_dev_cb {
22 void (*kick)(struct ste_modem_device *mdev, int notify_id);
23};
24
25/**
26 * struct ste_modem_dev_ops - Functions to control modem and modem interface.
27 *
28 * @power: Main power switch, used for cold-start or complete power off.
29 * @kick: Kick the modem.
30 * @kick_subscribe: Subscribe for notifications from the modem.
31 * @setup: Provide callback functions to modem device.
32 *
33 * This structure contains functions used by the ste remoteproc driver
34 * to manage the modem.
35 */
36struct ste_modem_dev_ops {
37 int (*power)(struct ste_modem_device *mdev, bool on);
38 int (*kick)(struct ste_modem_device *mdev, int notify_id);
39 int (*kick_subscribe)(struct ste_modem_device *mdev, int notify_id);
40 int (*setup)(struct ste_modem_device *mdev,
41 struct ste_modem_dev_cb *cfg);
42};
43
44/**
45 * struct ste_modem_device - represent the STE modem device
46 * @pdev: Reference to platform device
47 * @ops: Operations used to manage the modem.
48 * @drv_data: Driver private data.
49 */
50struct ste_modem_device {
51 struct platform_device pdev;
52 struct ste_modem_dev_ops ops;
53 void *drv_data;
54};
55
56#endif /*INC_MODEM_DEV_H*/
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
index 4397c52ec4a4..d23c5030901a 100644
--- a/include/linux/string_helpers.h
+++ b/include/linux/string_helpers.h
@@ -5,6 +5,7 @@
5#include <linux/types.h> 5#include <linux/types.h>
6 6
7struct file; 7struct file;
8struct task_struct;
8 9
9/* Descriptions of the types of units to 10/* Descriptions of the types of units to
10 * print in */ 11 * print in */
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h
index 8f144db73e38..92d182fd8e3b 100644
--- a/include/linux/sunrpc/rpc_rdma.h
+++ b/include/linux/sunrpc/rpc_rdma.h
@@ -1,3 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
1/* 2/*
2 * Copyright (c) 2015-2017 Oracle. All rights reserved. 3 * Copyright (c) 2015-2017 Oracle. All rights reserved.
3 * Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved. 4 * Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved.
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index 7337e1221590..fd78f78df5c6 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -1,3 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
1/* 2/*
2 * Copyright (c) 2005-2006 Network Appliance, Inc. All rights reserved. 3 * Copyright (c) 2005-2006 Network Appliance, Inc. All rights reserved.
3 * 4 *
@@ -70,37 +71,16 @@ extern atomic_t rdma_stat_rq_prod;
70extern atomic_t rdma_stat_sq_poll; 71extern atomic_t rdma_stat_sq_poll;
71extern atomic_t rdma_stat_sq_prod; 72extern atomic_t rdma_stat_sq_prod;
72 73
73/*
74 * Contexts are built when an RDMA request is created and are a
75 * record of the resources that can be recovered when the request
76 * completes.
77 */
78struct svc_rdma_op_ctxt {
79 struct list_head list;
80 struct xdr_buf arg;
81 struct ib_cqe cqe;
82 u32 byte_len;
83 struct svcxprt_rdma *xprt;
84 enum dma_data_direction direction;
85 int count;
86 unsigned int mapped_sges;
87 int hdr_count;
88 struct ib_send_wr send_wr;
89 struct ib_sge sge[1 + RPCRDMA_MAX_INLINE_THRESH / PAGE_SIZE];
90 struct page *pages[RPCSVC_MAXPAGES];
91};
92
93struct svcxprt_rdma { 74struct svcxprt_rdma {
94 struct svc_xprt sc_xprt; /* SVC transport structure */ 75 struct svc_xprt sc_xprt; /* SVC transport structure */
95 struct rdma_cm_id *sc_cm_id; /* RDMA connection id */ 76 struct rdma_cm_id *sc_cm_id; /* RDMA connection id */
96 struct list_head sc_accept_q; /* Conn. waiting accept */ 77 struct list_head sc_accept_q; /* Conn. waiting accept */
97 int sc_ord; /* RDMA read limit */ 78 int sc_ord; /* RDMA read limit */
98 int sc_max_sge; 79 int sc_max_send_sges;
99 bool sc_snd_w_inv; /* OK to use Send With Invalidate */ 80 bool sc_snd_w_inv; /* OK to use Send With Invalidate */
100 81
101 atomic_t sc_sq_avail; /* SQEs ready to be consumed */ 82 atomic_t sc_sq_avail; /* SQEs ready to be consumed */
102 unsigned int sc_sq_depth; /* Depth of SQ */ 83 unsigned int sc_sq_depth; /* Depth of SQ */
103 unsigned int sc_rq_depth; /* Depth of RQ */
104 __be32 sc_fc_credits; /* Forward credits */ 84 __be32 sc_fc_credits; /* Forward credits */
105 u32 sc_max_requests; /* Max requests */ 85 u32 sc_max_requests; /* Max requests */
106 u32 sc_max_bc_requests;/* Backward credits */ 86 u32 sc_max_bc_requests;/* Backward credits */
@@ -109,9 +89,8 @@ struct svcxprt_rdma {
109 89
110 struct ib_pd *sc_pd; 90 struct ib_pd *sc_pd;
111 91
112 spinlock_t sc_ctxt_lock; 92 spinlock_t sc_send_lock;
113 struct list_head sc_ctxts; 93 struct list_head sc_send_ctxts;
114 int sc_ctxt_used;
115 spinlock_t sc_rw_ctxt_lock; 94 spinlock_t sc_rw_ctxt_lock;
116 struct list_head sc_rw_ctxts; 95 struct list_head sc_rw_ctxts;
117 96
@@ -127,6 +106,9 @@ struct svcxprt_rdma {
127 unsigned long sc_flags; 106 unsigned long sc_flags;
128 struct list_head sc_read_complete_q; 107 struct list_head sc_read_complete_q;
129 struct work_struct sc_work; 108 struct work_struct sc_work;
109
110 spinlock_t sc_recv_lock;
111 struct list_head sc_recv_ctxts;
130}; 112};
131/* sc_flags */ 113/* sc_flags */
132#define RDMAXPRT_CONN_PENDING 3 114#define RDMAXPRT_CONN_PENDING 3
@@ -141,12 +123,30 @@ struct svcxprt_rdma {
141 123
142#define RPCSVC_MAXPAYLOAD_RDMA RPCSVC_MAXPAYLOAD 124#define RPCSVC_MAXPAYLOAD_RDMA RPCSVC_MAXPAYLOAD
143 125
144/* Track DMA maps for this transport and context */ 126struct svc_rdma_recv_ctxt {
145static inline void svc_rdma_count_mappings(struct svcxprt_rdma *rdma, 127 struct list_head rc_list;
146 struct svc_rdma_op_ctxt *ctxt) 128 struct ib_recv_wr rc_recv_wr;
147{ 129 struct ib_cqe rc_cqe;
148 ctxt->mapped_sges++; 130 struct ib_sge rc_recv_sge;
149} 131 void *rc_recv_buf;
132 struct xdr_buf rc_arg;
133 bool rc_temp;
134 u32 rc_byte_len;
135 unsigned int rc_page_count;
136 unsigned int rc_hdr_count;
137 struct page *rc_pages[RPCSVC_MAXPAGES];
138};
139
140struct svc_rdma_send_ctxt {
141 struct list_head sc_list;
142 struct ib_send_wr sc_send_wr;
143 struct ib_cqe sc_cqe;
144 void *sc_xprt_buf;
145 int sc_page_count;
146 int sc_cur_sge_no;
147 struct page *sc_pages[RPCSVC_MAXPAGES];
148 struct ib_sge sc_sges[];
149};
150 150
151/* svc_rdma_backchannel.c */ 151/* svc_rdma_backchannel.c */
152extern int svc_rdma_handle_bc_reply(struct rpc_xprt *xprt, 152extern int svc_rdma_handle_bc_reply(struct rpc_xprt *xprt,
@@ -154,13 +154,18 @@ extern int svc_rdma_handle_bc_reply(struct rpc_xprt *xprt,
154 struct xdr_buf *rcvbuf); 154 struct xdr_buf *rcvbuf);
155 155
156/* svc_rdma_recvfrom.c */ 156/* svc_rdma_recvfrom.c */
157extern void svc_rdma_recv_ctxts_destroy(struct svcxprt_rdma *rdma);
158extern bool svc_rdma_post_recvs(struct svcxprt_rdma *rdma);
159extern void svc_rdma_recv_ctxt_put(struct svcxprt_rdma *rdma,
160 struct svc_rdma_recv_ctxt *ctxt);
161extern void svc_rdma_flush_recv_queues(struct svcxprt_rdma *rdma);
157extern int svc_rdma_recvfrom(struct svc_rqst *); 162extern int svc_rdma_recvfrom(struct svc_rqst *);
158 163
159/* svc_rdma_rw.c */ 164/* svc_rdma_rw.c */
160extern void svc_rdma_destroy_rw_ctxts(struct svcxprt_rdma *rdma); 165extern void svc_rdma_destroy_rw_ctxts(struct svcxprt_rdma *rdma);
161extern int svc_rdma_recv_read_chunk(struct svcxprt_rdma *rdma, 166extern int svc_rdma_recv_read_chunk(struct svcxprt_rdma *rdma,
162 struct svc_rqst *rqstp, 167 struct svc_rqst *rqstp,
163 struct svc_rdma_op_ctxt *head, __be32 *p); 168 struct svc_rdma_recv_ctxt *head, __be32 *p);
164extern int svc_rdma_send_write_chunk(struct svcxprt_rdma *rdma, 169extern int svc_rdma_send_write_chunk(struct svcxprt_rdma *rdma,
165 __be32 *wr_ch, struct xdr_buf *xdr); 170 __be32 *wr_ch, struct xdr_buf *xdr);
166extern int svc_rdma_send_reply_chunk(struct svcxprt_rdma *rdma, 171extern int svc_rdma_send_reply_chunk(struct svcxprt_rdma *rdma,
@@ -168,24 +173,22 @@ extern int svc_rdma_send_reply_chunk(struct svcxprt_rdma *rdma,
168 struct xdr_buf *xdr); 173 struct xdr_buf *xdr);
169 174
170/* svc_rdma_sendto.c */ 175/* svc_rdma_sendto.c */
171extern int svc_rdma_map_reply_hdr(struct svcxprt_rdma *rdma, 176extern void svc_rdma_send_ctxts_destroy(struct svcxprt_rdma *rdma);
172 struct svc_rdma_op_ctxt *ctxt, 177extern struct svc_rdma_send_ctxt *
173 __be32 *rdma_resp, unsigned int len); 178 svc_rdma_send_ctxt_get(struct svcxprt_rdma *rdma);
174extern int svc_rdma_post_send_wr(struct svcxprt_rdma *rdma, 179extern void svc_rdma_send_ctxt_put(struct svcxprt_rdma *rdma,
175 struct svc_rdma_op_ctxt *ctxt, 180 struct svc_rdma_send_ctxt *ctxt);
176 int num_sge, u32 inv_rkey); 181extern int svc_rdma_send(struct svcxprt_rdma *rdma, struct ib_send_wr *wr);
182extern void svc_rdma_sync_reply_hdr(struct svcxprt_rdma *rdma,
183 struct svc_rdma_send_ctxt *ctxt,
184 unsigned int len);
185extern int svc_rdma_map_reply_msg(struct svcxprt_rdma *rdma,
186 struct svc_rdma_send_ctxt *ctxt,
187 struct xdr_buf *xdr, __be32 *wr_lst);
177extern int svc_rdma_sendto(struct svc_rqst *); 188extern int svc_rdma_sendto(struct svc_rqst *);
178 189
179/* svc_rdma_transport.c */ 190/* svc_rdma_transport.c */
180extern void svc_rdma_wc_send(struct ib_cq *, struct ib_wc *);
181extern void svc_rdma_wc_reg(struct ib_cq *, struct ib_wc *);
182extern void svc_rdma_wc_read(struct ib_cq *, struct ib_wc *);
183extern void svc_rdma_wc_inv(struct ib_cq *, struct ib_wc *);
184extern int svc_rdma_send(struct svcxprt_rdma *, struct ib_send_wr *);
185extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *); 191extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *);
186extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *);
187extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int);
188extern void svc_rdma_unmap_dma(struct svc_rdma_op_ctxt *ctxt);
189extern void svc_sq_reap(struct svcxprt_rdma *); 192extern void svc_sq_reap(struct svcxprt_rdma *);
190extern void svc_rq_reap(struct svcxprt_rdma *); 193extern void svc_rq_reap(struct svcxprt_rdma *);
191extern void svc_rdma_prep_reply_hdr(struct svc_rqst *); 194extern void svc_rdma_prep_reply_hdr(struct svc_rqst *);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 5fea0fb420df..336fd1a19cca 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -84,7 +84,6 @@ struct rpc_rqst {
84 void (*rq_release_snd_buf)(struct rpc_rqst *); /* release rq_enc_pages */ 84 void (*rq_release_snd_buf)(struct rpc_rqst *); /* release rq_enc_pages */
85 struct list_head rq_list; 85 struct list_head rq_list;
86 86
87 void *rq_xprtdata; /* Per-xprt private data */
88 void *rq_buffer; /* Call XDR encode buffer */ 87 void *rq_buffer; /* Call XDR encode buffer */
89 size_t rq_callsize; 88 size_t rq_callsize;
90 void *rq_rbuffer; /* Reply XDR decode buffer */ 89 void *rq_rbuffer; /* Reply XDR decode buffer */
@@ -127,6 +126,8 @@ struct rpc_xprt_ops {
127 int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 126 int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
128 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 127 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
129 void (*alloc_slot)(struct rpc_xprt *xprt, struct rpc_task *task); 128 void (*alloc_slot)(struct rpc_xprt *xprt, struct rpc_task *task);
129 void (*free_slot)(struct rpc_xprt *xprt,
130 struct rpc_rqst *req);
130 void (*rpcbind)(struct rpc_task *task); 131 void (*rpcbind)(struct rpc_task *task);
131 void (*set_port)(struct rpc_xprt *xprt, unsigned short port); 132 void (*set_port)(struct rpc_xprt *xprt, unsigned short port);
132 void (*connect)(struct rpc_xprt *xprt, struct rpc_task *task); 133 void (*connect)(struct rpc_xprt *xprt, struct rpc_task *task);
@@ -324,10 +325,13 @@ struct xprt_class {
324struct rpc_xprt *xprt_create_transport(struct xprt_create *args); 325struct rpc_xprt *xprt_create_transport(struct xprt_create *args);
325void xprt_connect(struct rpc_task *task); 326void xprt_connect(struct rpc_task *task);
326void xprt_reserve(struct rpc_task *task); 327void xprt_reserve(struct rpc_task *task);
328void xprt_request_init(struct rpc_task *task);
327void xprt_retry_reserve(struct rpc_task *task); 329void xprt_retry_reserve(struct rpc_task *task);
328int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); 330int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
329int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); 331int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
330void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); 332void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task);
333void xprt_free_slot(struct rpc_xprt *xprt,
334 struct rpc_rqst *req);
331void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); 335void xprt_lock_and_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task);
332bool xprt_prepare_transmit(struct rpc_task *task); 336bool xprt_prepare_transmit(struct rpc_task *task);
333void xprt_transmit(struct rpc_task *task); 337void xprt_transmit(struct rpc_task *task);
diff --git a/include/linux/sunrpc/xprtrdma.h b/include/linux/sunrpc/xprtrdma.h
index 5859563e3c1f..86fc38ff0355 100644
--- a/include/linux/sunrpc/xprtrdma.h
+++ b/include/linux/sunrpc/xprtrdma.h
@@ -1,3 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
1/* 2/*
2 * Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved. 3 * Copyright (c) 2003-2007 Network Appliance, Inc. All rights reserved.
3 * 4 *
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 390e814fdc8d..a368a68cb667 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -66,6 +66,7 @@ struct old_linux_dirent;
66struct perf_event_attr; 66struct perf_event_attr;
67struct file_handle; 67struct file_handle;
68struct sigaltstack; 68struct sigaltstack;
69struct rseq;
69union bpf_attr; 70union bpf_attr;
70 71
71#include <linux/types.h> 72#include <linux/types.h>
@@ -230,6 +231,9 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event)
230 */ 231 */
231#ifndef __SYSCALL_DEFINEx 232#ifndef __SYSCALL_DEFINEx
232#define __SYSCALL_DEFINEx(x, name, ...) \ 233#define __SYSCALL_DEFINEx(x, name, ...) \
234 __diag_push(); \
235 __diag_ignore(GCC, 8, "-Wattribute-alias", \
236 "Type aliasing is used to sanitize syscall arguments");\
233 asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \ 237 asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
234 __attribute__((alias(__stringify(__se_sys##name)))); \ 238 __attribute__((alias(__stringify(__se_sys##name)))); \
235 ALLOW_ERROR_INJECTION(sys##name, ERRNO); \ 239 ALLOW_ERROR_INJECTION(sys##name, ERRNO); \
@@ -242,6 +246,7 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event)
242 __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ 246 __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \
243 return ret; \ 247 return ret; \
244 } \ 248 } \
249 __diag_pop(); \
245 static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) 250 static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
246#endif /* __SYSCALL_DEFINEx */ 251#endif /* __SYSCALL_DEFINEx */
247 252
@@ -897,7 +902,8 @@ asmlinkage long sys_pkey_alloc(unsigned long flags, unsigned long init_val);
897asmlinkage long sys_pkey_free(int pkey); 902asmlinkage long sys_pkey_free(int pkey);
898asmlinkage long sys_statx(int dfd, const char __user *path, unsigned flags, 903asmlinkage long sys_statx(int dfd, const char __user *path, unsigned flags,
899 unsigned mask, struct statx __user *buffer); 904 unsigned mask, struct statx __user *buffer);
900 905asmlinkage long sys_rseq(struct rseq __user *rseq, uint32_t rseq_len,
906 int flags, uint32_t sig);
901 907
902/* 908/*
903 * Architecture-specific system calls 909 * Architecture-specific system calls
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 7834be668d80..5f4705f46c2f 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -1,25 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 */
1/* 2/*
2 * thermal.h ($Revision: 0 $) 3 * thermal.h ($Revision: 0 $)
3 * 4 *
4 * Copyright (C) 2008 Intel Corp 5 * Copyright (C) 2008 Intel Corp
5 * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com> 6 * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com>
6 * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com> 7 * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com>
7 *
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *
22 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 */ 8 */
24 9
25#ifndef __THERMAL_H__ 10#ifndef __THERMAL_H__
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index cf2862bd134a..8d8821b3689a 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -60,6 +60,15 @@ static inline void clear_ti_thread_flag(struct thread_info *ti, int flag)
60 clear_bit(flag, (unsigned long *)&ti->flags); 60 clear_bit(flag, (unsigned long *)&ti->flags);
61} 61}
62 62
63static inline void update_ti_thread_flag(struct thread_info *ti, int flag,
64 bool value)
65{
66 if (value)
67 set_ti_thread_flag(ti, flag);
68 else
69 clear_ti_thread_flag(ti, flag);
70}
71
63static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag) 72static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag)
64{ 73{
65 return test_and_set_bit(flag, (unsigned long *)&ti->flags); 74 return test_and_set_bit(flag, (unsigned long *)&ti->flags);
@@ -79,6 +88,8 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag)
79 set_ti_thread_flag(current_thread_info(), flag) 88 set_ti_thread_flag(current_thread_info(), flag)
80#define clear_thread_flag(flag) \ 89#define clear_thread_flag(flag) \
81 clear_ti_thread_flag(current_thread_info(), flag) 90 clear_ti_thread_flag(current_thread_info(), flag)
91#define update_thread_flag(flag, value) \
92 update_ti_thread_flag(current_thread_info(), flag, value)
82#define test_and_set_thread_flag(flag) \ 93#define test_and_set_thread_flag(flag) \
83 test_and_set_ti_thread_flag(current_thread_info(), flag) 94 test_and_set_ti_thread_flag(current_thread_info(), flag)
84#define test_and_clear_thread_flag(flag) \ 95#define test_and_clear_thread_flag(flag) \
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index c94f466d57ef..19a690b559ca 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -4,7 +4,7 @@
4/* 4/*
5 * Kernel Tracepoint API. 5 * Kernel Tracepoint API.
6 * 6 *
7 * See Documentation/trace/tracepoints.txt. 7 * See Documentation/trace/tracepoints.rst.
8 * 8 *
9 * Copyright (C) 2008-2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> 9 * Copyright (C) 2008-2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 * 10 *
diff --git a/include/linux/uio.h b/include/linux/uio.h
index f5766e853a77..409c845d4cd3 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -155,7 +155,7 @@ size_t _copy_from_iter_flushcache(void *addr, size_t bytes, struct iov_iter *i);
155#endif 155#endif
156 156
157#ifdef CONFIG_ARCH_HAS_UACCESS_MCSAFE 157#ifdef CONFIG_ARCH_HAS_UACCESS_MCSAFE
158size_t _copy_to_iter_mcsafe(void *addr, size_t bytes, struct iov_iter *i); 158size_t _copy_to_iter_mcsafe(const void *addr, size_t bytes, struct iov_iter *i);
159#else 159#else
160#define _copy_to_iter_mcsafe _copy_to_iter 160#define _copy_to_iter_mcsafe _copy_to_iter
161#endif 161#endif
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index f144216febc6..9397628a1967 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -58,7 +58,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
58static inline int virtio_net_hdr_from_skb(const struct sk_buff *skb, 58static inline int virtio_net_hdr_from_skb(const struct sk_buff *skb,
59 struct virtio_net_hdr *hdr, 59 struct virtio_net_hdr *hdr,
60 bool little_endian, 60 bool little_endian,
61 bool has_data_valid) 61 bool has_data_valid,
62 int vlan_hlen)
62{ 63{
63 memset(hdr, 0, sizeof(*hdr)); /* no info leak */ 64 memset(hdr, 0, sizeof(*hdr)); /* no info leak */
64 65
@@ -83,12 +84,8 @@ static inline int virtio_net_hdr_from_skb(const struct sk_buff *skb,
83 84
84 if (skb->ip_summed == CHECKSUM_PARTIAL) { 85 if (skb->ip_summed == CHECKSUM_PARTIAL) {
85 hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; 86 hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
86 if (skb_vlan_tag_present(skb)) 87 hdr->csum_start = __cpu_to_virtio16(little_endian,
87 hdr->csum_start = __cpu_to_virtio16(little_endian, 88 skb_checksum_start_offset(skb) + vlan_hlen);
88 skb_checksum_start_offset(skb) + VLAN_HLEN);
89 else
90 hdr->csum_start = __cpu_to_virtio16(little_endian,
91 skb_checksum_start_offset(skb));
92 hdr->csum_offset = __cpu_to_virtio16(little_endian, 89 hdr->csum_offset = __cpu_to_virtio16(little_endian,
93 skb->csum_offset); 90 skb->csum_offset);
94 } else if (has_data_valid && 91 } else if (has_data_valid &&
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index bbf32524ab27..fab02133a919 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -35,7 +35,7 @@ static inline void virtio_rmb(bool weak_barriers)
35 if (weak_barriers) 35 if (weak_barriers)
36 virt_rmb(); 36 virt_rmb();
37 else 37 else
38 rmb(); 38 dma_rmb();
39} 39}
40 40
41static inline void virtio_wmb(bool weak_barriers) 41static inline void virtio_wmb(bool weak_barriers)
@@ -43,7 +43,7 @@ static inline void virtio_wmb(bool weak_barriers)
43 if (weak_barriers) 43 if (weak_barriers)
44 virt_wmb(); 44 virt_wmb();
45 else 45 else
46 wmb(); 46 dma_wmb();
47} 47}
48 48
49static inline void virtio_store_mb(bool weak_barriers, 49static inline void virtio_store_mb(bool weak_barriers,