diff options
Diffstat (limited to 'include/linux')
29 files changed, 147 insertions, 308 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 21ee41b92e8a..f1d5c5acc8dd 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h | |||
| @@ -171,12 +171,13 @@ void bpf_register_prog_type(struct bpf_prog_type_list *tl); | |||
| 171 | void bpf_register_map_type(struct bpf_map_type_list *tl); | 171 | void bpf_register_map_type(struct bpf_map_type_list *tl); |
| 172 | 172 | ||
| 173 | struct bpf_prog *bpf_prog_get(u32 ufd); | 173 | struct bpf_prog *bpf_prog_get(u32 ufd); |
| 174 | struct bpf_prog *bpf_prog_inc(struct bpf_prog *prog); | ||
| 174 | void bpf_prog_put(struct bpf_prog *prog); | 175 | void bpf_prog_put(struct bpf_prog *prog); |
| 175 | void bpf_prog_put_rcu(struct bpf_prog *prog); | 176 | void bpf_prog_put_rcu(struct bpf_prog *prog); |
| 176 | 177 | ||
| 177 | struct bpf_map *bpf_map_get_with_uref(u32 ufd); | 178 | struct bpf_map *bpf_map_get_with_uref(u32 ufd); |
| 178 | struct bpf_map *__bpf_map_get(struct fd f); | 179 | struct bpf_map *__bpf_map_get(struct fd f); |
| 179 | void bpf_map_inc(struct bpf_map *map, bool uref); | 180 | struct bpf_map *bpf_map_inc(struct bpf_map *map, bool uref); |
| 180 | void bpf_map_put_with_uref(struct bpf_map *map); | 181 | void bpf_map_put_with_uref(struct bpf_map *map); |
| 181 | void bpf_map_put(struct bpf_map *map); | 182 | void bpf_map_put(struct bpf_map *map); |
| 182 | int bpf_map_precharge_memlock(u32 pages); | 183 | int bpf_map_precharge_memlock(u32 pages); |
diff --git a/include/linux/ceph/auth.h b/include/linux/ceph/auth.h index 260d78b587c4..1563265d2097 100644 --- a/include/linux/ceph/auth.h +++ b/include/linux/ceph/auth.h | |||
| @@ -12,9 +12,12 @@ | |||
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | struct ceph_auth_client; | 14 | struct ceph_auth_client; |
| 15 | struct ceph_authorizer; | ||
| 16 | struct ceph_msg; | 15 | struct ceph_msg; |
| 17 | 16 | ||
| 17 | struct ceph_authorizer { | ||
| 18 | void (*destroy)(struct ceph_authorizer *); | ||
| 19 | }; | ||
| 20 | |||
| 18 | struct ceph_auth_handshake { | 21 | struct ceph_auth_handshake { |
| 19 | struct ceph_authorizer *authorizer; | 22 | struct ceph_authorizer *authorizer; |
| 20 | void *authorizer_buf; | 23 | void *authorizer_buf; |
| @@ -62,8 +65,6 @@ struct ceph_auth_client_ops { | |||
| 62 | struct ceph_auth_handshake *auth); | 65 | struct ceph_auth_handshake *auth); |
| 63 | int (*verify_authorizer_reply)(struct ceph_auth_client *ac, | 66 | int (*verify_authorizer_reply)(struct ceph_auth_client *ac, |
| 64 | struct ceph_authorizer *a, size_t len); | 67 | struct ceph_authorizer *a, size_t len); |
| 65 | void (*destroy_authorizer)(struct ceph_auth_client *ac, | ||
| 66 | struct ceph_authorizer *a); | ||
| 67 | void (*invalidate_authorizer)(struct ceph_auth_client *ac, | 68 | void (*invalidate_authorizer)(struct ceph_auth_client *ac, |
| 68 | int peer_type); | 69 | int peer_type); |
| 69 | 70 | ||
| @@ -112,8 +113,7 @@ extern int ceph_auth_is_authenticated(struct ceph_auth_client *ac); | |||
| 112 | extern int ceph_auth_create_authorizer(struct ceph_auth_client *ac, | 113 | extern int ceph_auth_create_authorizer(struct ceph_auth_client *ac, |
| 113 | int peer_type, | 114 | int peer_type, |
| 114 | struct ceph_auth_handshake *auth); | 115 | struct ceph_auth_handshake *auth); |
| 115 | extern void ceph_auth_destroy_authorizer(struct ceph_auth_client *ac, | 116 | void ceph_auth_destroy_authorizer(struct ceph_authorizer *a); |
| 116 | struct ceph_authorizer *a); | ||
| 117 | extern int ceph_auth_update_authorizer(struct ceph_auth_client *ac, | 117 | extern int ceph_auth_update_authorizer(struct ceph_auth_client *ac, |
| 118 | int peer_type, | 118 | int peer_type, |
| 119 | struct ceph_auth_handshake *a); | 119 | struct ceph_auth_handshake *a); |
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 4343df806710..cbf460927c42 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
| @@ -16,7 +16,6 @@ struct ceph_msg; | |||
| 16 | struct ceph_snap_context; | 16 | struct ceph_snap_context; |
| 17 | struct ceph_osd_request; | 17 | struct ceph_osd_request; |
| 18 | struct ceph_osd_client; | 18 | struct ceph_osd_client; |
| 19 | struct ceph_authorizer; | ||
| 20 | 19 | ||
| 21 | /* | 20 | /* |
| 22 | * completion callback for async writepages | 21 | * completion callback for async writepages |
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 3e39ae5bc799..5b17de62c962 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h | |||
| @@ -444,6 +444,7 @@ struct cgroup_subsys { | |||
| 444 | int (*can_attach)(struct cgroup_taskset *tset); | 444 | int (*can_attach)(struct cgroup_taskset *tset); |
| 445 | void (*cancel_attach)(struct cgroup_taskset *tset); | 445 | void (*cancel_attach)(struct cgroup_taskset *tset); |
| 446 | void (*attach)(struct cgroup_taskset *tset); | 446 | void (*attach)(struct cgroup_taskset *tset); |
| 447 | void (*post_attach)(void); | ||
| 447 | int (*can_fork)(struct task_struct *task); | 448 | int (*can_fork)(struct task_struct *task); |
| 448 | void (*cancel_fork)(struct task_struct *task); | 449 | void (*cancel_fork)(struct task_struct *task); |
| 449 | void (*fork)(struct task_struct *task); | 450 | void (*fork)(struct task_struct *task); |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index eeae401a2412..3d5202eda22f 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
| @@ -246,7 +246,7 @@ | |||
| 246 | #define __HAVE_BUILTIN_BSWAP32__ | 246 | #define __HAVE_BUILTIN_BSWAP32__ |
| 247 | #define __HAVE_BUILTIN_BSWAP64__ | 247 | #define __HAVE_BUILTIN_BSWAP64__ |
| 248 | #endif | 248 | #endif |
| 249 | #if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) | 249 | #if GCC_VERSION >= 40800 |
| 250 | #define __HAVE_BUILTIN_BSWAP16__ | 250 | #define __HAVE_BUILTIN_BSWAP16__ |
| 251 | #endif | 251 | #endif |
| 252 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ | 252 | #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index fea160ee5803..85a868ccb493 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
| @@ -137,8 +137,6 @@ static inline void set_mems_allowed(nodemask_t nodemask) | |||
| 137 | task_unlock(current); | 137 | task_unlock(current); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | extern void cpuset_post_attach_flush(void); | ||
| 141 | |||
| 142 | #else /* !CONFIG_CPUSETS */ | 140 | #else /* !CONFIG_CPUSETS */ |
| 143 | 141 | ||
| 144 | static inline bool cpusets_enabled(void) { return false; } | 142 | static inline bool cpusets_enabled(void) { return false; } |
| @@ -245,10 +243,6 @@ static inline bool read_mems_allowed_retry(unsigned int seq) | |||
| 245 | return false; | 243 | return false; |
| 246 | } | 244 | } |
| 247 | 245 | ||
| 248 | static inline void cpuset_post_attach_flush(void) | ||
| 249 | { | ||
| 250 | } | ||
| 251 | |||
| 252 | #endif /* !CONFIG_CPUSETS */ | 246 | #endif /* !CONFIG_CPUSETS */ |
| 253 | 247 | ||
| 254 | #endif /* _LINUX_CPUSET_H */ | 248 | #endif /* _LINUX_CPUSET_H */ |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 4bb4de8d95ea..7e9422cb5989 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -565,4 +565,16 @@ static inline struct dentry *d_real(struct dentry *dentry) | |||
| 565 | return dentry; | 565 | return dentry; |
| 566 | } | 566 | } |
| 567 | 567 | ||
| 568 | static inline struct inode *vfs_select_inode(struct dentry *dentry, | ||
| 569 | unsigned open_flags) | ||
| 570 | { | ||
| 571 | struct inode *inode = d_inode(dentry); | ||
| 572 | |||
| 573 | if (inode && unlikely(dentry->d_flags & DCACHE_OP_SELECT_INODE)) | ||
| 574 | inode = dentry->d_op->d_select_inode(dentry, open_flags); | ||
| 575 | |||
| 576 | return inode; | ||
| 577 | } | ||
| 578 | |||
| 579 | |||
| 568 | #endif /* __LINUX_DCACHE_H */ | 580 | #endif /* __LINUX_DCACHE_H */ |
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h index 358a4db72a27..5871f292b596 100644 --- a/include/linux/devpts_fs.h +++ b/include/linux/devpts_fs.h | |||
| @@ -27,11 +27,11 @@ int devpts_new_index(struct pts_fs_info *); | |||
| 27 | void devpts_kill_index(struct pts_fs_info *, int); | 27 | void devpts_kill_index(struct pts_fs_info *, int); |
| 28 | 28 | ||
| 29 | /* mknod in devpts */ | 29 | /* mknod in devpts */ |
| 30 | struct inode *devpts_pty_new(struct pts_fs_info *, dev_t, int, void *); | 30 | struct dentry *devpts_pty_new(struct pts_fs_info *, int, void *); |
| 31 | /* get private structure */ | 31 | /* get private structure */ |
| 32 | void *devpts_get_priv(struct inode *pts_inode); | 32 | void *devpts_get_priv(struct dentry *); |
| 33 | /* unlink */ | 33 | /* unlink */ |
| 34 | void devpts_pty_kill(struct inode *inode); | 34 | void devpts_pty_kill(struct dentry *); |
| 35 | 35 | ||
| 36 | #endif | 36 | #endif |
| 37 | 37 | ||
diff --git a/include/linux/hash.h b/include/linux/hash.h index 1afde47e1528..79c52fa81cac 100644 --- a/include/linux/hash.h +++ b/include/linux/hash.h | |||
| @@ -32,12 +32,28 @@ | |||
| 32 | #error Wordsize not 32 or 64 | 32 | #error Wordsize not 32 or 64 |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | /* | ||
| 36 | * The above primes are actively bad for hashing, since they are | ||
| 37 | * too sparse. The 32-bit one is mostly ok, the 64-bit one causes | ||
| 38 | * real problems. Besides, the "prime" part is pointless for the | ||
| 39 | * multiplicative hash. | ||
| 40 | * | ||
| 41 | * Although a random odd number will do, it turns out that the golden | ||
| 42 | * ratio phi = (sqrt(5)-1)/2, or its negative, has particularly nice | ||
| 43 | * properties. | ||
| 44 | * | ||
| 45 | * These are the negative, (1 - phi) = (phi^2) = (3 - sqrt(5))/2. | ||
| 46 | * (See Knuth vol 3, section 6.4, exercise 9.) | ||
| 47 | */ | ||
| 48 | #define GOLDEN_RATIO_32 0x61C88647 | ||
| 49 | #define GOLDEN_RATIO_64 0x61C8864680B583EBull | ||
| 50 | |||
| 35 | static __always_inline u64 hash_64(u64 val, unsigned int bits) | 51 | static __always_inline u64 hash_64(u64 val, unsigned int bits) |
| 36 | { | 52 | { |
| 37 | u64 hash = val; | 53 | u64 hash = val; |
| 38 | 54 | ||
| 39 | #if defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 64 | 55 | #if BITS_PER_LONG == 64 |
| 40 | hash = hash * GOLDEN_RATIO_PRIME_64; | 56 | hash = hash * GOLDEN_RATIO_64; |
| 41 | #else | 57 | #else |
| 42 | /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ | 58 | /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ |
| 43 | u64 n = hash; | 59 | u64 n = hash; |
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 7008623e24b1..d7b9e5346fba 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
| @@ -152,6 +152,7 @@ static inline bool is_huge_zero_pmd(pmd_t pmd) | |||
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | struct page *get_huge_zero_page(void); | 154 | struct page *get_huge_zero_page(void); |
| 155 | void put_huge_zero_page(void); | ||
| 155 | 156 | ||
| 156 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ | 157 | #else /* CONFIG_TRANSPARENT_HUGEPAGE */ |
| 157 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) | 158 | #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; }) |
| @@ -208,6 +209,10 @@ static inline bool is_huge_zero_page(struct page *page) | |||
| 208 | return false; | 209 | return false; |
| 209 | } | 210 | } |
| 210 | 211 | ||
| 212 | static inline void put_huge_zero_page(void) | ||
| 213 | { | ||
| 214 | BUILD_BUG(); | ||
| 215 | } | ||
| 211 | 216 | ||
| 212 | static inline struct page *follow_devmap_pmd(struct vm_area_struct *vma, | 217 | static inline struct page *follow_devmap_pmd(struct vm_area_struct *vma, |
| 213 | unsigned long addr, pmd_t *pmd, int flags) | 218 | unsigned long addr, pmd_t *pmd, int flags) |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index d5569734f672..548fd535fd02 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
| @@ -28,6 +28,11 @@ static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) | |||
| 28 | return (struct ethhdr *)skb_mac_header(skb); | 28 | return (struct ethhdr *)skb_mac_header(skb); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | static inline struct ethhdr *inner_eth_hdr(const struct sk_buff *skb) | ||
| 32 | { | ||
| 33 | return (struct ethhdr *)skb_inner_mac_header(skb); | ||
| 34 | } | ||
| 35 | |||
| 31 | int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); | 36 | int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); |
| 32 | 37 | ||
| 33 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | 38 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); |
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index c06c44242f39..30f089ebe0a4 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h | |||
| @@ -152,6 +152,8 @@ struct kernfs_syscall_ops { | |||
| 152 | int (*rmdir)(struct kernfs_node *kn); | 152 | int (*rmdir)(struct kernfs_node *kn); |
| 153 | int (*rename)(struct kernfs_node *kn, struct kernfs_node *new_parent, | 153 | int (*rename)(struct kernfs_node *kn, struct kernfs_node *new_parent, |
| 154 | const char *new_name); | 154 | const char *new_name); |
| 155 | int (*show_path)(struct seq_file *sf, struct kernfs_node *kn, | ||
| 156 | struct kernfs_root *root); | ||
| 155 | }; | 157 | }; |
| 156 | 158 | ||
| 157 | struct kernfs_root { | 159 | struct kernfs_root { |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index d026b190c530..d10ef06971b5 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
| @@ -196,9 +196,11 @@ struct lock_list { | |||
| 196 | * We record lock dependency chains, so that we can cache them: | 196 | * We record lock dependency chains, so that we can cache them: |
| 197 | */ | 197 | */ |
| 198 | struct lock_chain { | 198 | struct lock_chain { |
| 199 | u8 irq_context; | 199 | /* see BUILD_BUG_ON()s in lookup_chain_cache() */ |
| 200 | u8 depth; | 200 | unsigned int irq_context : 2, |
| 201 | u16 base; | 201 | depth : 6, |
| 202 | base : 24; | ||
| 203 | /* 4 byte hole */ | ||
| 202 | struct hlist_node entry; | 204 | struct hlist_node entry; |
| 203 | u64 chain_key; | 205 | u64 chain_key; |
| 204 | }; | 206 | }; |
diff --git a/include/linux/mfd/samsung/s2mps11.h b/include/linux/mfd/samsung/s2mps11.h index b288965e8101..2c14eeca46f0 100644 --- a/include/linux/mfd/samsung/s2mps11.h +++ b/include/linux/mfd/samsung/s2mps11.h | |||
| @@ -173,10 +173,12 @@ enum s2mps11_regulators { | |||
| 173 | 173 | ||
| 174 | #define S2MPS11_LDO_VSEL_MASK 0x3F | 174 | #define S2MPS11_LDO_VSEL_MASK 0x3F |
| 175 | #define S2MPS11_BUCK_VSEL_MASK 0xFF | 175 | #define S2MPS11_BUCK_VSEL_MASK 0xFF |
| 176 | #define S2MPS11_BUCK9_VSEL_MASK 0x1F | ||
| 176 | #define S2MPS11_ENABLE_MASK (0x03 << S2MPS11_ENABLE_SHIFT) | 177 | #define S2MPS11_ENABLE_MASK (0x03 << S2MPS11_ENABLE_SHIFT) |
| 177 | #define S2MPS11_ENABLE_SHIFT 0x06 | 178 | #define S2MPS11_ENABLE_SHIFT 0x06 |
| 178 | #define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1) | 179 | #define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1) |
| 179 | #define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1) | 180 | #define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1) |
| 181 | #define S2MPS11_BUCK9_N_VOLTAGES (S2MPS11_BUCK9_VSEL_MASK + 1) | ||
| 180 | #define S2MPS11_RAMP_DELAY 25000 /* uV/us */ | 182 | #define S2MPS11_RAMP_DELAY 25000 /* uV/us */ |
| 181 | 183 | ||
| 182 | #define S2MPS11_CTRL1_PWRHOLD_MASK BIT(4) | 184 | #define S2MPS11_CTRL1_PWRHOLD_MASK BIT(4) |
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h index 8156e3c9239c..b3575f392492 100644 --- a/include/linux/mlx5/device.h +++ b/include/linux/mlx5/device.h | |||
| @@ -392,6 +392,17 @@ enum { | |||
| 392 | MLX5_CAP_OFF_CMDIF_CSUM = 46, | 392 | MLX5_CAP_OFF_CMDIF_CSUM = 46, |
| 393 | }; | 393 | }; |
| 394 | 394 | ||
| 395 | enum { | ||
| 396 | /* | ||
| 397 | * Max wqe size for rdma read is 512 bytes, so this | ||
| 398 | * limits our max_sge_rd as the wqe needs to fit: | ||
| 399 | * - ctrl segment (16 bytes) | ||
| 400 | * - rdma segment (16 bytes) | ||
| 401 | * - scatter elements (16 bytes each) | ||
| 402 | */ | ||
| 403 | MLX5_MAX_SGE_RD = (512 - 16 - 16) / 16 | ||
| 404 | }; | ||
| 405 | |||
| 395 | struct mlx5_inbox_hdr { | 406 | struct mlx5_inbox_hdr { |
| 396 | __be16 opcode; | 407 | __be16 opcode; |
| 397 | u8 rsvd[4]; | 408 | u8 rsvd[4]; |
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index dcd5ac8d3b14..369c837d40f5 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h | |||
| @@ -519,8 +519,9 @@ enum mlx5_device_state { | |||
| 519 | }; | 519 | }; |
| 520 | 520 | ||
| 521 | enum mlx5_interface_state { | 521 | enum mlx5_interface_state { |
| 522 | MLX5_INTERFACE_STATE_DOWN, | 522 | MLX5_INTERFACE_STATE_DOWN = BIT(0), |
| 523 | MLX5_INTERFACE_STATE_UP, | 523 | MLX5_INTERFACE_STATE_UP = BIT(1), |
| 524 | MLX5_INTERFACE_STATE_SHUTDOWN = BIT(2), | ||
| 524 | }; | 525 | }; |
| 525 | 526 | ||
| 526 | enum mlx5_pci_status { | 527 | enum mlx5_pci_status { |
| @@ -544,7 +545,7 @@ struct mlx5_core_dev { | |||
| 544 | enum mlx5_device_state state; | 545 | enum mlx5_device_state state; |
| 545 | /* sync interface state */ | 546 | /* sync interface state */ |
| 546 | struct mutex intf_state_mutex; | 547 | struct mutex intf_state_mutex; |
| 547 | enum mlx5_interface_state interface_state; | 548 | unsigned long intf_state; |
| 548 | void (*event) (struct mlx5_core_dev *dev, | 549 | void (*event) (struct mlx5_core_dev *dev, |
| 549 | enum mlx5_dev_event event, | 550 | enum mlx5_dev_event event, |
| 550 | unsigned long param); | 551 | unsigned long param); |
diff --git a/include/linux/mlx5/port.h b/include/linux/mlx5/port.h index a1d145abd4eb..b30250ab7604 100644 --- a/include/linux/mlx5/port.h +++ b/include/linux/mlx5/port.h | |||
| @@ -54,9 +54,9 @@ int mlx5_set_port_admin_status(struct mlx5_core_dev *dev, | |||
| 54 | int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, | 54 | int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, |
| 55 | enum mlx5_port_status *status); | 55 | enum mlx5_port_status *status); |
| 56 | 56 | ||
| 57 | int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu, u8 port); | 57 | int mlx5_set_port_mtu(struct mlx5_core_dev *dev, u16 mtu, u8 port); |
| 58 | void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu, u8 port); | 58 | void mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, u16 *max_mtu, u8 port); |
| 59 | void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu, | 59 | void mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, u16 *oper_mtu, |
| 60 | u8 port); | 60 | u8 port); |
| 61 | 61 | ||
| 62 | int mlx5_query_port_vl_hw_cap(struct mlx5_core_dev *dev, | 62 | int mlx5_query_port_vl_hw_cap(struct mlx5_core_dev *dev, |
diff --git a/include/linux/mlx5/vport.h b/include/linux/mlx5/vport.h index bd93e6323603..301da4a5e6bf 100644 --- a/include/linux/mlx5/vport.h +++ b/include/linux/mlx5/vport.h | |||
| @@ -45,6 +45,8 @@ int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev, | |||
| 45 | u16 vport, u8 *addr); | 45 | u16 vport, u8 *addr); |
| 46 | int mlx5_modify_nic_vport_mac_address(struct mlx5_core_dev *dev, | 46 | int mlx5_modify_nic_vport_mac_address(struct mlx5_core_dev *dev, |
| 47 | u16 vport, u8 *addr); | 47 | u16 vport, u8 *addr); |
| 48 | int mlx5_query_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 *mtu); | ||
| 49 | int mlx5_modify_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 mtu); | ||
| 48 | int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev, | 50 | int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev, |
| 49 | u64 *system_image_guid); | 51 | u64 *system_image_guid); |
| 50 | int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid); | 52 | int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid); |
diff --git a/include/linux/mm.h b/include/linux/mm.h index a55e5be0894f..8f468e0d2534 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -500,11 +500,20 @@ static inline int page_mapcount(struct page *page) | |||
| 500 | 500 | ||
| 501 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 501 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 502 | int total_mapcount(struct page *page); | 502 | int total_mapcount(struct page *page); |
| 503 | int page_trans_huge_mapcount(struct page *page, int *total_mapcount); | ||
| 503 | #else | 504 | #else |
| 504 | static inline int total_mapcount(struct page *page) | 505 | static inline int total_mapcount(struct page *page) |
| 505 | { | 506 | { |
| 506 | return page_mapcount(page); | 507 | return page_mapcount(page); |
| 507 | } | 508 | } |
| 509 | static inline int page_trans_huge_mapcount(struct page *page, | ||
| 510 | int *total_mapcount) | ||
| 511 | { | ||
| 512 | int mapcount = page_mapcount(page); | ||
| 513 | if (total_mapcount) | ||
| 514 | *total_mapcount = mapcount; | ||
| 515 | return mapcount; | ||
| 516 | } | ||
| 508 | #endif | 517 | #endif |
| 509 | 518 | ||
| 510 | static inline struct page *virt_to_head_page(const void *x) | 519 | static inline struct page *virt_to_head_page(const void *x) |
| @@ -1031,6 +1040,8 @@ static inline bool page_mapped(struct page *page) | |||
| 1031 | page = compound_head(page); | 1040 | page = compound_head(page); |
| 1032 | if (atomic_read(compound_mapcount_ptr(page)) >= 0) | 1041 | if (atomic_read(compound_mapcount_ptr(page)) >= 0) |
| 1033 | return true; | 1042 | return true; |
| 1043 | if (PageHuge(page)) | ||
| 1044 | return false; | ||
| 1034 | for (i = 0; i < hpage_nr_pages(page); i++) { | 1045 | for (i = 0; i < hpage_nr_pages(page); i++) { |
| 1035 | if (atomic_read(&page[i]._mapcount) >= 0) | 1046 | if (atomic_read(&page[i]._mapcount) >= 0) |
| 1036 | return true; | 1047 | return true; |
| @@ -1138,6 +1149,8 @@ struct zap_details { | |||
| 1138 | 1149 | ||
| 1139 | struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, | 1150 | struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, |
| 1140 | pte_t pte); | 1151 | pte_t pte); |
| 1152 | struct page *vm_normal_page_pmd(struct vm_area_struct *vma, unsigned long addr, | ||
| 1153 | pmd_t pmd); | ||
| 1141 | 1154 | ||
| 1142 | int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, | 1155 | int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, |
| 1143 | unsigned long size); | 1156 | unsigned long size); |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 77d01700daf7..ec5ec2818a28 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
| @@ -79,6 +79,8 @@ extern int kern_path_mountpoint(int, const char *, struct path *, unsigned int); | |||
| 79 | 79 | ||
| 80 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); | 80 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); |
| 81 | extern struct dentry *lookup_one_len_unlocked(const char *, struct dentry *, int); | 81 | extern struct dentry *lookup_one_len_unlocked(const char *, struct dentry *, int); |
| 82 | struct qstr; | ||
| 83 | extern struct dentry *lookup_hash(const struct qstr *, struct dentry *); | ||
| 82 | 84 | ||
| 83 | extern int follow_down_one(struct path *); | 85 | extern int follow_down_one(struct path *); |
| 84 | extern int follow_down(struct path *); | 86 | extern int follow_down(struct path *); |
diff --git a/include/linux/net.h b/include/linux/net.h index 49175e4ced11..f840d77c6c31 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -246,7 +246,15 @@ do { \ | |||
| 246 | net_ratelimited_function(pr_warn, fmt, ##__VA_ARGS__) | 246 | net_ratelimited_function(pr_warn, fmt, ##__VA_ARGS__) |
| 247 | #define net_info_ratelimited(fmt, ...) \ | 247 | #define net_info_ratelimited(fmt, ...) \ |
| 248 | net_ratelimited_function(pr_info, fmt, ##__VA_ARGS__) | 248 | net_ratelimited_function(pr_info, fmt, ##__VA_ARGS__) |
| 249 | #if defined(DEBUG) | 249 | #if defined(CONFIG_DYNAMIC_DEBUG) |
| 250 | #define net_dbg_ratelimited(fmt, ...) \ | ||
| 251 | do { \ | ||
| 252 | DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ | ||
| 253 | if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ | ||
| 254 | net_ratelimit()) \ | ||
| 255 | __dynamic_pr_debug(&descriptor, fmt, ##__VA_ARGS__); \ | ||
| 256 | } while (0) | ||
| 257 | #elif defined(DEBUG) | ||
| 250 | #define net_dbg_ratelimited(fmt, ...) \ | 258 | #define net_dbg_ratelimited(fmt, ...) \ |
| 251 | net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__) | 259 | net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__) |
| 252 | #else | 260 | #else |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 8395308a2445..78181a88903b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -2164,6 +2164,9 @@ struct packet_offload { | |||
| 2164 | 2164 | ||
| 2165 | struct udp_offload; | 2165 | struct udp_offload; |
| 2166 | 2166 | ||
| 2167 | /* 'skb->encapsulation' is set before gro_complete() is called. gro_complete() | ||
| 2168 | * must set 'skb->inner_mac_header' to the beginning of tunnel payload. | ||
| 2169 | */ | ||
| 2167 | struct udp_offload_callbacks { | 2170 | struct udp_offload_callbacks { |
| 2168 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | 2171 | struct sk_buff **(*gro_receive)(struct sk_buff **head, |
| 2169 | struct sk_buff *skb, | 2172 | struct sk_buff *skb, |
| @@ -4004,7 +4007,7 @@ netdev_features_t netif_skb_features(struct sk_buff *skb); | |||
| 4004 | 4007 | ||
| 4005 | static inline bool net_gso_ok(netdev_features_t features, int gso_type) | 4008 | static inline bool net_gso_ok(netdev_features_t features, int gso_type) |
| 4006 | { | 4009 | { |
| 4007 | netdev_features_t feature = gso_type << NETIF_F_GSO_SHIFT; | 4010 | netdev_features_t feature = (netdev_features_t)gso_type << NETIF_F_GSO_SHIFT; |
| 4008 | 4011 | ||
| 4009 | /* check flags correspondence */ | 4012 | /* check flags correspondence */ |
| 4010 | BUILD_BUG_ON(SKB_GSO_TCPV4 != (NETIF_F_TSO >> NETIF_F_GSO_SHIFT)); | 4013 | BUILD_BUG_ON(SKB_GSO_TCPV4 != (NETIF_F_TSO >> NETIF_F_GSO_SHIFT)); |
diff --git a/include/linux/of.h b/include/linux/of.h index 7fcb681baadf..31758036787c 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -133,7 +133,7 @@ void of_core_init(void); | |||
| 133 | 133 | ||
| 134 | static inline bool is_of_node(struct fwnode_handle *fwnode) | 134 | static inline bool is_of_node(struct fwnode_handle *fwnode) |
| 135 | { | 135 | { |
| 136 | return fwnode && fwnode->type == FWNODE_OF; | 136 | return !IS_ERR_OR_NULL(fwnode) && fwnode->type == FWNODE_OF; |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | static inline struct device_node *to_of_node(struct fwnode_handle *fwnode) | 139 | static inline struct device_node *to_of_node(struct fwnode_handle *fwnode) |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index f4ed4f1b0c77..6b052aa7b5b7 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
| @@ -517,6 +517,27 @@ static inline int PageTransCompound(struct page *page) | |||
| 517 | } | 517 | } |
| 518 | 518 | ||
| 519 | /* | 519 | /* |
| 520 | * PageTransCompoundMap is the same as PageTransCompound, but it also | ||
| 521 | * guarantees the primary MMU has the entire compound page mapped | ||
| 522 | * through pmd_trans_huge, which in turn guarantees the secondary MMUs | ||
| 523 | * can also map the entire compound page. This allows the secondary | ||
| 524 | * MMUs to call get_user_pages() only once for each compound page and | ||
| 525 | * to immediately map the entire compound page with a single secondary | ||
| 526 | * MMU fault. If there will be a pmd split later, the secondary MMUs | ||
| 527 | * will get an update through the MMU notifier invalidation through | ||
| 528 | * split_huge_pmd(). | ||
| 529 | * | ||
| 530 | * Unlike PageTransCompound, this is safe to be called only while | ||
| 531 | * split_huge_pmd() cannot run from under us, like if protected by the | ||
| 532 | * MMU notifier, otherwise it may result in page->_mapcount < 0 false | ||
| 533 | * positives. | ||
| 534 | */ | ||
| 535 | static inline int PageTransCompoundMap(struct page *page) | ||
| 536 | { | ||
| 537 | return PageTransCompound(page) && atomic_read(&page->_mapcount) < 0; | ||
| 538 | } | ||
| 539 | |||
| 540 | /* | ||
| 520 | * PageTransTail returns true for both transparent huge pages | 541 | * PageTransTail returns true for both transparent huge pages |
| 521 | * and hugetlbfs pages, so it should only be called when it's known | 542 | * and hugetlbfs pages, so it should only be called when it's known |
| 522 | * that hugetlbfs pages aren't involved. | 543 | * that hugetlbfs pages aren't involved. |
| @@ -559,6 +580,7 @@ static inline int TestClearPageDoubleMap(struct page *page) | |||
| 559 | #else | 580 | #else |
| 560 | TESTPAGEFLAG_FALSE(TransHuge) | 581 | TESTPAGEFLAG_FALSE(TransHuge) |
| 561 | TESTPAGEFLAG_FALSE(TransCompound) | 582 | TESTPAGEFLAG_FALSE(TransCompound) |
| 583 | TESTPAGEFLAG_FALSE(TransCompoundMap) | ||
| 562 | TESTPAGEFLAG_FALSE(TransTail) | 584 | TESTPAGEFLAG_FALSE(TransTail) |
| 563 | TESTPAGEFLAG_FALSE(DoubleMap) | 585 | TESTPAGEFLAG_FALSE(DoubleMap) |
| 564 | TESTSETFLAG_FALSE(DoubleMap) | 586 | TESTSETFLAG_FALSE(DoubleMap) |
diff --git a/include/linux/rio_mport_cdev.h b/include/linux/rio_mport_cdev.h deleted file mode 100644 index b65d19df76d2..000000000000 --- a/include/linux/rio_mport_cdev.h +++ /dev/null | |||
| @@ -1,271 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2015-2016, Integrated Device Technology Inc. | ||
| 3 | * Copyright (c) 2015, Prodrive Technologies | ||
| 4 | * Copyright (c) 2015, Texas Instruments Incorporated | ||
| 5 | * Copyright (c) 2015, RapidIO Trade Association | ||
| 6 | * All rights reserved. | ||
| 7 | * | ||
| 8 | * This software is available to you under a choice of one of two licenses. | ||
| 9 | * You may choose to be licensed under the terms of the GNU General Public | ||
| 10 | * License(GPL) Version 2, or the BSD-3 Clause license below: | ||
| 11 | * | ||
| 12 | * Redistribution and use in source and binary forms, with or without | ||
| 13 | * modification, are permitted provided that the following conditions are met: | ||
| 14 | * | ||
| 15 | * 1. Redistributions of source code must retain the above copyright notice, | ||
| 16 | * this list of conditions and the following disclaimer. | ||
| 17 | * | ||
| 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, | ||
| 19 | * this list of conditions and the following disclaimer in the documentation | ||
| 20 | * and/or other materials provided with the distribution. | ||
| 21 | * | ||
| 22 | * 3. Neither the name of the copyright holder nor the names of its contributors | ||
| 23 | * may be used to endorse or promote products derived from this software without | ||
| 24 | * specific prior written permission. | ||
| 25 | * | ||
| 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| 27 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
| 28 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 29 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR | ||
| 30 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
| 31 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
| 32 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | ||
| 33 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
| 34 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | ||
| 35 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||
| 36 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 37 | */ | ||
| 38 | |||
| 39 | #ifndef _RIO_MPORT_CDEV_H_ | ||
| 40 | #define _RIO_MPORT_CDEV_H_ | ||
| 41 | |||
| 42 | #ifndef __user | ||
| 43 | #define __user | ||
| 44 | #endif | ||
| 45 | |||
| 46 | struct rio_mport_maint_io { | ||
| 47 | uint32_t rioid; /* destID of remote device */ | ||
| 48 | uint32_t hopcount; /* hopcount to remote device */ | ||
| 49 | uint32_t offset; /* offset in register space */ | ||
| 50 | size_t length; /* length in bytes */ | ||
| 51 | void __user *buffer; /* data buffer */ | ||
| 52 | }; | ||
| 53 | |||
| 54 | /* | ||
| 55 | * Definitions for RapidIO data transfers: | ||
| 56 | * - memory mapped (MAPPED) | ||
| 57 | * - packet generation from memory (TRANSFER) | ||
| 58 | */ | ||
| 59 | #define RIO_TRANSFER_MODE_MAPPED (1 << 0) | ||
| 60 | #define RIO_TRANSFER_MODE_TRANSFER (1 << 1) | ||
| 61 | #define RIO_CAP_DBL_SEND (1 << 2) | ||
| 62 | #define RIO_CAP_DBL_RECV (1 << 3) | ||
| 63 | #define RIO_CAP_PW_SEND (1 << 4) | ||
| 64 | #define RIO_CAP_PW_RECV (1 << 5) | ||
| 65 | #define RIO_CAP_MAP_OUTB (1 << 6) | ||
| 66 | #define RIO_CAP_MAP_INB (1 << 7) | ||
| 67 | |||
| 68 | struct rio_mport_properties { | ||
| 69 | uint16_t hdid; | ||
| 70 | uint8_t id; /* Physical port ID */ | ||
| 71 | uint8_t index; | ||
| 72 | uint32_t flags; | ||
| 73 | uint32_t sys_size; /* Default addressing size */ | ||
| 74 | uint8_t port_ok; | ||
| 75 | uint8_t link_speed; | ||
| 76 | uint8_t link_width; | ||
| 77 | uint32_t dma_max_sge; | ||
| 78 | uint32_t dma_max_size; | ||
| 79 | uint32_t dma_align; | ||
| 80 | uint32_t transfer_mode; /* Default transfer mode */ | ||
| 81 | uint32_t cap_sys_size; /* Capable system sizes */ | ||
| 82 | uint32_t cap_addr_size; /* Capable addressing sizes */ | ||
| 83 | uint32_t cap_transfer_mode; /* Capable transfer modes */ | ||
| 84 | uint32_t cap_mport; /* Mport capabilities */ | ||
| 85 | }; | ||
| 86 | |||
| 87 | /* | ||
| 88 | * Definitions for RapidIO events; | ||
| 89 | * - incoming port-writes | ||
| 90 | * - incoming doorbells | ||
| 91 | */ | ||
| 92 | #define RIO_DOORBELL (1 << 0) | ||
| 93 | #define RIO_PORTWRITE (1 << 1) | ||
| 94 | |||
| 95 | struct rio_doorbell { | ||
| 96 | uint32_t rioid; | ||
| 97 | uint16_t payload; | ||
| 98 | }; | ||
| 99 | |||
| 100 | struct rio_doorbell_filter { | ||
| 101 | uint32_t rioid; /* 0xffffffff to match all ids */ | ||
| 102 | uint16_t low; | ||
| 103 | uint16_t high; | ||
| 104 | }; | ||
| 105 | |||
| 106 | |||
| 107 | struct rio_portwrite { | ||
| 108 | uint32_t payload[16]; | ||
| 109 | }; | ||
| 110 | |||
| 111 | struct rio_pw_filter { | ||
| 112 | uint32_t mask; | ||
| 113 | uint32_t low; | ||
| 114 | uint32_t high; | ||
| 115 | }; | ||
| 116 | |||
| 117 | /* RapidIO base address for inbound requests set to value defined below | ||
| 118 | * indicates that no specific RIO-to-local address translation is requested | ||
| 119 | * and driver should use direct (one-to-one) address mapping. | ||
| 120 | */ | ||
| 121 | #define RIO_MAP_ANY_ADDR (uint64_t)(~((uint64_t) 0)) | ||
| 122 | |||
| 123 | struct rio_mmap { | ||
| 124 | uint32_t rioid; | ||
| 125 | uint64_t rio_addr; | ||
| 126 | uint64_t length; | ||
| 127 | uint64_t handle; | ||
| 128 | void *address; | ||
| 129 | }; | ||
| 130 | |||
| 131 | struct rio_dma_mem { | ||
| 132 | uint64_t length; /* length of DMA memory */ | ||
| 133 | uint64_t dma_handle; /* handle associated with this memory */ | ||
| 134 | void *buffer; /* pointer to this memory */ | ||
| 135 | }; | ||
| 136 | |||
| 137 | |||
| 138 | struct rio_event { | ||
| 139 | unsigned int header; /* event type RIO_DOORBELL or RIO_PORTWRITE */ | ||
| 140 | union { | ||
| 141 | struct rio_doorbell doorbell; /* header for RIO_DOORBELL */ | ||
| 142 | struct rio_portwrite portwrite; /* header for RIO_PORTWRITE */ | ||
| 143 | } u; | ||
| 144 | }; | ||
| 145 | |||
| 146 | enum rio_transfer_sync { | ||
| 147 | RIO_TRANSFER_SYNC, /* synchronous transfer */ | ||
| 148 | RIO_TRANSFER_ASYNC, /* asynchronous transfer */ | ||
| 149 | RIO_TRANSFER_FAF, /* fire-and-forget transfer */ | ||
| 150 | }; | ||
| 151 | |||
| 152 | enum rio_transfer_dir { | ||
| 153 | RIO_TRANSFER_DIR_READ, /* Read operation */ | ||
| 154 | RIO_TRANSFER_DIR_WRITE, /* Write operation */ | ||
| 155 | }; | ||
| 156 | |||
| 157 | /* | ||
| 158 | * RapidIO data exchange transactions are lists of individual transfers. Each | ||
| 159 | * transfer exchanges data between two RapidIO devices by remote direct memory | ||
| 160 | * access and has its own completion code. | ||
| 161 | * | ||
| 162 | * The RapidIO specification defines four types of data exchange requests: | ||
| 163 | * NREAD, NWRITE, SWRITE and NWRITE_R. The RapidIO DMA channel interface allows | ||
| 164 | * to specify the required type of write operation or combination of them when | ||
| 165 | * only the last data packet requires response. | ||
| 166 | * | ||
| 167 | * NREAD: read up to 256 bytes from remote device memory into local memory | ||
| 168 | * NWRITE: write up to 256 bytes from local memory to remote device memory | ||
| 169 | * without confirmation | ||
| 170 | * SWRITE: as NWRITE, but all addresses and payloads must be 64-bit aligned | ||
| 171 | * NWRITE_R: as NWRITE, but expect acknowledgment from remote device. | ||
| 172 | * | ||
| 173 | * The default exchange is chosen from NREAD and any of the WRITE modes as the | ||
| 174 | * driver sees fit. For write requests the user can explicitly choose between | ||
| 175 | * any of the write modes for each transaction. | ||
| 176 | */ | ||
| 177 | enum rio_exchange { | ||
| 178 | RIO_EXCHANGE_DEFAULT, /* Default method */ | ||
| 179 | RIO_EXCHANGE_NWRITE, /* All packets using NWRITE */ | ||
| 180 | RIO_EXCHANGE_SWRITE, /* All packets using SWRITE */ | ||
| 181 | RIO_EXCHANGE_NWRITE_R, /* Last packet NWRITE_R, others NWRITE */ | ||
| 182 | RIO_EXCHANGE_SWRITE_R, /* Last packet NWRITE_R, others SWRITE */ | ||
| 183 | RIO_EXCHANGE_NWRITE_R_ALL, /* All packets using NWRITE_R */ | ||
| 184 | }; | ||
| 185 | |||
| 186 | struct rio_transfer_io { | ||
| 187 | uint32_t rioid; /* Target destID */ | ||
| 188 | uint64_t rio_addr; /* Address in target's RIO mem space */ | ||
| 189 | enum rio_exchange method; /* Data exchange method */ | ||
| 190 | void __user *loc_addr; | ||
| 191 | uint64_t handle; | ||
| 192 | uint64_t offset; /* Offset in buffer */ | ||
| 193 | uint64_t length; /* Length in bytes */ | ||
| 194 | uint32_t completion_code; /* Completion code for this transfer */ | ||
| 195 | }; | ||
| 196 | |||
| 197 | struct rio_transaction { | ||
| 198 | uint32_t transfer_mode; /* Data transfer mode */ | ||
| 199 | enum rio_transfer_sync sync; /* Synchronization method */ | ||
| 200 | enum rio_transfer_dir dir; /* Transfer direction */ | ||
| 201 | size_t count; /* Number of transfers */ | ||
| 202 | struct rio_transfer_io __user *block; /* Array of <count> transfers */ | ||
| 203 | }; | ||
| 204 | |||
| 205 | struct rio_async_tx_wait { | ||
| 206 | uint32_t token; /* DMA transaction ID token */ | ||
| 207 | uint32_t timeout; /* Wait timeout in msec, if 0 use default TO */ | ||
| 208 | }; | ||
| 209 | |||
| 210 | #define RIO_MAX_DEVNAME_SZ 20 | ||
| 211 | |||
| 212 | struct rio_rdev_info { | ||
| 213 | uint32_t destid; | ||
| 214 | uint8_t hopcount; | ||
| 215 | uint32_t comptag; | ||
| 216 | char name[RIO_MAX_DEVNAME_SZ + 1]; | ||
| 217 | }; | ||
| 218 | |||
| 219 | /* Driver IOCTL codes */ | ||
| 220 | #define RIO_MPORT_DRV_MAGIC 'm' | ||
| 221 | |||
| 222 | #define RIO_MPORT_MAINT_HDID_SET \ | ||
| 223 | _IOW(RIO_MPORT_DRV_MAGIC, 1, uint16_t) | ||
| 224 | #define RIO_MPORT_MAINT_COMPTAG_SET \ | ||
| 225 | _IOW(RIO_MPORT_DRV_MAGIC, 2, uint32_t) | ||
| 226 | #define RIO_MPORT_MAINT_PORT_IDX_GET \ | ||
| 227 | _IOR(RIO_MPORT_DRV_MAGIC, 3, uint32_t) | ||
| 228 | #define RIO_MPORT_GET_PROPERTIES \ | ||
| 229 | _IOR(RIO_MPORT_DRV_MAGIC, 4, struct rio_mport_properties) | ||
| 230 | #define RIO_MPORT_MAINT_READ_LOCAL \ | ||
| 231 | _IOR(RIO_MPORT_DRV_MAGIC, 5, struct rio_mport_maint_io) | ||
| 232 | #define RIO_MPORT_MAINT_WRITE_LOCAL \ | ||
| 233 | _IOW(RIO_MPORT_DRV_MAGIC, 6, struct rio_mport_maint_io) | ||
| 234 | #define RIO_MPORT_MAINT_READ_REMOTE \ | ||
| 235 | _IOR(RIO_MPORT_DRV_MAGIC, 7, struct rio_mport_maint_io) | ||
| 236 | #define RIO_MPORT_MAINT_WRITE_REMOTE \ | ||
| 237 | _IOW(RIO_MPORT_DRV_MAGIC, 8, struct rio_mport_maint_io) | ||
| 238 | #define RIO_ENABLE_DOORBELL_RANGE \ | ||
| 239 | _IOW(RIO_MPORT_DRV_MAGIC, 9, struct rio_doorbell_filter) | ||
| 240 | #define RIO_DISABLE_DOORBELL_RANGE \ | ||
| 241 | _IOW(RIO_MPORT_DRV_MAGIC, 10, struct rio_doorbell_filter) | ||
| 242 | #define RIO_ENABLE_PORTWRITE_RANGE \ | ||
| 243 | _IOW(RIO_MPORT_DRV_MAGIC, 11, struct rio_pw_filter) | ||
| 244 | #define RIO_DISABLE_PORTWRITE_RANGE \ | ||
| 245 | _IOW(RIO_MPORT_DRV_MAGIC, 12, struct rio_pw_filter) | ||
| 246 | #define RIO_SET_EVENT_MASK \ | ||
| 247 | _IOW(RIO_MPORT_DRV_MAGIC, 13, unsigned int) | ||
| 248 | #define RIO_GET_EVENT_MASK \ | ||
| 249 | _IOR(RIO_MPORT_DRV_MAGIC, 14, unsigned int) | ||
| 250 | #define RIO_MAP_OUTBOUND \ | ||
| 251 | _IOWR(RIO_MPORT_DRV_MAGIC, 15, struct rio_mmap) | ||
| 252 | #define RIO_UNMAP_OUTBOUND \ | ||
| 253 | _IOW(RIO_MPORT_DRV_MAGIC, 16, struct rio_mmap) | ||
| 254 | #define RIO_MAP_INBOUND \ | ||
| 255 | _IOWR(RIO_MPORT_DRV_MAGIC, 17, struct rio_mmap) | ||
| 256 | #define RIO_UNMAP_INBOUND \ | ||
| 257 | _IOW(RIO_MPORT_DRV_MAGIC, 18, uint64_t) | ||
| 258 | #define RIO_ALLOC_DMA \ | ||
| 259 | _IOWR(RIO_MPORT_DRV_MAGIC, 19, struct rio_dma_mem) | ||
| 260 | #define RIO_FREE_DMA \ | ||
| 261 | _IOW(RIO_MPORT_DRV_MAGIC, 20, uint64_t) | ||
| 262 | #define RIO_TRANSFER \ | ||
| 263 | _IOWR(RIO_MPORT_DRV_MAGIC, 21, struct rio_transaction) | ||
| 264 | #define RIO_WAIT_FOR_ASYNC \ | ||
| 265 | _IOW(RIO_MPORT_DRV_MAGIC, 22, struct rio_async_tx_wait) | ||
| 266 | #define RIO_DEV_ADD \ | ||
| 267 | _IOW(RIO_MPORT_DRV_MAGIC, 23, struct rio_rdev_info) | ||
| 268 | #define RIO_DEV_DEL \ | ||
| 269 | _IOW(RIO_MPORT_DRV_MAGIC, 24, struct rio_rdev_info) | ||
| 270 | |||
| 271 | #endif /* _RIO_MPORT_CDEV_H_ */ | ||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 857a9a1d82b5..1f03483f61e5 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -372,6 +372,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
| 372 | * @unprepare_message: undo any work done by prepare_message(). | 372 | * @unprepare_message: undo any work done by prepare_message(). |
| 373 | * @spi_flash_read: to support spi-controller hardwares that provide | 373 | * @spi_flash_read: to support spi-controller hardwares that provide |
| 374 | * accelerated interface to read from flash devices. | 374 | * accelerated interface to read from flash devices. |
| 375 | * @flash_read_supported: spi device supports flash read | ||
| 375 | * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS | 376 | * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS |
| 376 | * number. Any individual value may be -ENOENT for CS lines that | 377 | * number. Any individual value may be -ENOENT for CS lines that |
| 377 | * are not GPIOs (driven by the SPI controller itself). | 378 | * are not GPIOs (driven by the SPI controller itself). |
| @@ -529,6 +530,7 @@ struct spi_master { | |||
| 529 | struct spi_message *message); | 530 | struct spi_message *message); |
| 530 | int (*spi_flash_read)(struct spi_device *spi, | 531 | int (*spi_flash_read)(struct spi_device *spi, |
| 531 | struct spi_flash_read_message *msg); | 532 | struct spi_flash_read_message *msg); |
| 533 | bool (*flash_read_supported)(struct spi_device *spi); | ||
| 532 | 534 | ||
| 533 | /* | 535 | /* |
| 534 | * These hooks are for drivers that use a generic implementation | 536 | * These hooks are for drivers that use a generic implementation |
| @@ -1158,7 +1160,9 @@ struct spi_flash_read_message { | |||
| 1158 | /* SPI core interface for flash read support */ | 1160 | /* SPI core interface for flash read support */ |
| 1159 | static inline bool spi_flash_read_supported(struct spi_device *spi) | 1161 | static inline bool spi_flash_read_supported(struct spi_device *spi) |
| 1160 | { | 1162 | { |
| 1161 | return spi->master->spi_flash_read ? true : false; | 1163 | return spi->master->spi_flash_read && |
| 1164 | (!spi->master->flash_read_supported || | ||
| 1165 | spi->master->flash_read_supported(spi)); | ||
| 1162 | } | 1166 | } |
| 1163 | 1167 | ||
| 1164 | int spi_flash_read(struct spi_device *spi, | 1168 | int spi_flash_read(struct spi_device *spi, |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 2b83359c19ca..ad220359f1b0 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -418,7 +418,7 @@ extern sector_t swapdev_block(int, pgoff_t); | |||
| 418 | extern int page_swapcount(struct page *); | 418 | extern int page_swapcount(struct page *); |
| 419 | extern int swp_swapcount(swp_entry_t entry); | 419 | extern int swp_swapcount(swp_entry_t entry); |
| 420 | extern struct swap_info_struct *page_swap_info(struct page *); | 420 | extern struct swap_info_struct *page_swap_info(struct page *); |
| 421 | extern int reuse_swap_page(struct page *); | 421 | extern bool reuse_swap_page(struct page *, int *); |
| 422 | extern int try_to_free_swap(struct page *); | 422 | extern int try_to_free_swap(struct page *); |
| 423 | struct backing_dev_info; | 423 | struct backing_dev_info; |
| 424 | 424 | ||
| @@ -513,8 +513,8 @@ static inline int swp_swapcount(swp_entry_t entry) | |||
| 513 | return 0; | 513 | return 0; |
| 514 | } | 514 | } |
| 515 | 515 | ||
| 516 | #define reuse_swap_page(page) \ | 516 | #define reuse_swap_page(page, total_mapcount) \ |
| 517 | (!PageTransCompound(page) && page_mapcount(page) == 1) | 517 | (page_trans_huge_mapcount(page, total_mapcount) == 1) |
| 518 | 518 | ||
| 519 | static inline int try_to_free_swap(struct page *page) | 519 | static inline int try_to_free_swap(struct page *page) |
| 520 | { | 520 | { |
| @@ -533,6 +533,10 @@ static inline swp_entry_t get_swap_page(void) | |||
| 533 | #ifdef CONFIG_MEMCG | 533 | #ifdef CONFIG_MEMCG |
| 534 | static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) | 534 | static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg) |
| 535 | { | 535 | { |
| 536 | /* Cgroup2 doesn't have per-cgroup swappiness */ | ||
| 537 | if (cgroup_subsys_on_dfl(memory_cgrp_subsys)) | ||
| 538 | return vm_swappiness; | ||
| 539 | |||
| 536 | /* root ? */ | 540 | /* root ? */ |
| 537 | if (mem_cgroup_disabled() || !memcg->css.parent) | 541 | if (mem_cgroup_disabled() || !memcg->css.parent) |
| 538 | return vm_swappiness; | 542 | return vm_swappiness; |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 161052477f77..b742b5e47cc2 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | * defined; unless noted otherwise, they are optional, and can be | 7 | * defined; unless noted otherwise, they are optional, and can be |
| 8 | * filled in with a null pointer. | 8 | * filled in with a null pointer. |
| 9 | * | 9 | * |
| 10 | * struct tty_struct * (*lookup)(struct tty_driver *self, int idx) | 10 | * struct tty_struct * (*lookup)(struct tty_driver *self, struct file *, int idx) |
| 11 | * | 11 | * |
| 12 | * Return the tty device corresponding to idx, NULL if there is not | 12 | * Return the tty device corresponding to idx, NULL if there is not |
| 13 | * one currently in use and an ERR_PTR value on error. Called under | 13 | * one currently in use and an ERR_PTR value on error. Called under |
| @@ -250,7 +250,7 @@ struct serial_icounter_struct; | |||
| 250 | 250 | ||
| 251 | struct tty_operations { | 251 | struct tty_operations { |
| 252 | struct tty_struct * (*lookup)(struct tty_driver *driver, | 252 | struct tty_struct * (*lookup)(struct tty_driver *driver, |
| 253 | struct inode *inode, int idx); | 253 | struct file *filp, int idx); |
| 254 | int (*install)(struct tty_driver *driver, struct tty_struct *tty); | 254 | int (*install)(struct tty_driver *driver, struct tty_struct *tty); |
| 255 | void (*remove)(struct tty_driver *driver, struct tty_struct *tty); | 255 | void (*remove)(struct tty_driver *driver, struct tty_struct *tty); |
| 256 | int (*open)(struct tty_struct * tty, struct file * filp); | 256 | int (*open)(struct tty_struct * tty, struct file * filp); |
diff --git a/include/linux/uio.h b/include/linux/uio.h index fd9bcfedad42..1b5d1cd796e2 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
| @@ -87,6 +87,7 @@ size_t copy_from_iter(void *addr, size_t bytes, struct iov_iter *i); | |||
| 87 | size_t copy_from_iter_nocache(void *addr, size_t bytes, struct iov_iter *i); | 87 | size_t copy_from_iter_nocache(void *addr, size_t bytes, struct iov_iter *i); |
| 88 | size_t iov_iter_zero(size_t bytes, struct iov_iter *); | 88 | size_t iov_iter_zero(size_t bytes, struct iov_iter *); |
| 89 | unsigned long iov_iter_alignment(const struct iov_iter *i); | 89 | unsigned long iov_iter_alignment(const struct iov_iter *i); |
| 90 | unsigned long iov_iter_gap_alignment(const struct iov_iter *i); | ||
| 90 | void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov, | 91 | void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov, |
| 91 | unsigned long nr_segs, size_t count); | 92 | unsigned long nr_segs, size_t count); |
| 92 | void iov_iter_kvec(struct iov_iter *i, int direction, const struct kvec *kvec, | 93 | void iov_iter_kvec(struct iov_iter *i, int direction, const struct kvec *kvec, |
