diff options
Diffstat (limited to 'include/linux')
158 files changed, 2785 insertions, 911 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index bcbdd7484e58..03053aca5b32 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -152,15 +152,6 @@ void acpi_penalize_isa_irq(int irq, int active); | |||
| 152 | 152 | ||
| 153 | void acpi_pci_irq_disable (struct pci_dev *dev); | 153 | void acpi_pci_irq_disable (struct pci_dev *dev); |
| 154 | 154 | ||
| 155 | struct acpi_pci_driver { | ||
| 156 | struct list_head node; | ||
| 157 | int (*add)(struct acpi_pci_root *root); | ||
| 158 | void (*remove)(struct acpi_pci_root *root); | ||
| 159 | }; | ||
| 160 | |||
| 161 | int acpi_pci_register_driver(struct acpi_pci_driver *driver); | ||
| 162 | void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); | ||
| 163 | |||
| 164 | extern int ec_read(u8 addr, u8 *val); | 155 | extern int ec_read(u8 addr, u8 *val); |
| 165 | extern int ec_write(u8 addr, u8 val); | 156 | extern int ec_write(u8 addr, u8 val); |
| 166 | extern int ec_transaction(u8 command, | 157 | extern int ec_transaction(u8 command, |
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index f612c783170f..62d9303c2837 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
| @@ -203,6 +203,9 @@ struct amba_pl011_data { | |||
| 203 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | 203 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); |
| 204 | void *dma_rx_param; | 204 | void *dma_rx_param; |
| 205 | void *dma_tx_param; | 205 | void *dma_tx_param; |
| 206 | bool dma_rx_poll_enable; | ||
| 207 | unsigned int dma_rx_poll_rate; | ||
| 208 | unsigned int dma_rx_poll_timeout; | ||
| 206 | void (*init) (void); | 209 | void (*init) (void); |
| 207 | void (*exit) (void); | 210 | void (*exit) (void); |
| 208 | }; | 211 | }; |
diff --git a/include/linux/async.h b/include/linux/async.h index a2e3f18b2ad6..6b0226bdaadc 100644 --- a/include/linux/async.h +++ b/include/linux/async.h | |||
| @@ -16,9 +16,8 @@ | |||
| 16 | #include <linux/list.h> | 16 | #include <linux/list.h> |
| 17 | 17 | ||
| 18 | typedef u64 async_cookie_t; | 18 | typedef u64 async_cookie_t; |
| 19 | typedef void (async_func_ptr) (void *data, async_cookie_t cookie); | 19 | typedef void (*async_func_t) (void *data, async_cookie_t cookie); |
| 20 | struct async_domain { | 20 | struct async_domain { |
| 21 | struct list_head node; | ||
| 22 | struct list_head pending; | 21 | struct list_head pending; |
| 23 | unsigned registered:1; | 22 | unsigned registered:1; |
| 24 | }; | 23 | }; |
| @@ -27,8 +26,7 @@ struct async_domain { | |||
| 27 | * domain participates in global async_synchronize_full | 26 | * domain participates in global async_synchronize_full |
| 28 | */ | 27 | */ |
| 29 | #define ASYNC_DOMAIN(_name) \ | 28 | #define ASYNC_DOMAIN(_name) \ |
| 30 | struct async_domain _name = { .node = LIST_HEAD_INIT(_name.node), \ | 29 | struct async_domain _name = { .pending = LIST_HEAD_INIT(_name.pending), \ |
| 31 | .pending = LIST_HEAD_INIT(_name.pending), \ | ||
| 32 | .registered = 1 } | 30 | .registered = 1 } |
| 33 | 31 | ||
| 34 | /* | 32 | /* |
| @@ -36,12 +34,11 @@ struct async_domain { | |||
| 36 | * complete, this domain does not participate in async_synchronize_full | 34 | * complete, this domain does not participate in async_synchronize_full |
| 37 | */ | 35 | */ |
| 38 | #define ASYNC_DOMAIN_EXCLUSIVE(_name) \ | 36 | #define ASYNC_DOMAIN_EXCLUSIVE(_name) \ |
| 39 | struct async_domain _name = { .node = LIST_HEAD_INIT(_name.node), \ | 37 | struct async_domain _name = { .pending = LIST_HEAD_INIT(_name.pending), \ |
| 40 | .pending = LIST_HEAD_INIT(_name.pending), \ | ||
| 41 | .registered = 0 } | 38 | .registered = 0 } |
| 42 | 39 | ||
| 43 | extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data); | 40 | extern async_cookie_t async_schedule(async_func_t func, void *data); |
| 44 | extern async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data, | 41 | extern async_cookie_t async_schedule_domain(async_func_t func, void *data, |
| 45 | struct async_domain *domain); | 42 | struct async_domain *domain); |
| 46 | void async_unregister_domain(struct async_domain *domain); | 43 | void async_unregister_domain(struct async_domain *domain); |
| 47 | extern void async_synchronize_full(void); | 44 | extern void async_synchronize_full(void); |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 8f7a3d68371a..ee0bd9524055 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -954,7 +954,7 @@ static inline int atapi_cdb_len(const u16 *dev_id) | |||
| 954 | } | 954 | } |
| 955 | } | 955 | } |
| 956 | 956 | ||
| 957 | static inline bool atapi_command_packet_set(const u16 *dev_id) | 957 | static inline int atapi_command_packet_set(const u16 *dev_id) |
| 958 | { | 958 | { |
| 959 | return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f; | 959 | return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f; |
| 960 | } | 960 | } |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index cdf11191e645..22990cf4439d 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
| @@ -111,12 +111,13 @@ struct bio { | |||
| 111 | #define BIO_FS_INTEGRITY 9 /* fs owns integrity data, not block layer */ | 111 | #define BIO_FS_INTEGRITY 9 /* fs owns integrity data, not block layer */ |
| 112 | #define BIO_QUIET 10 /* Make BIO Quiet */ | 112 | #define BIO_QUIET 10 /* Make BIO Quiet */ |
| 113 | #define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */ | 113 | #define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */ |
| 114 | #define BIO_SNAP_STABLE 12 /* bio data must be snapshotted during write */ | ||
| 114 | 115 | ||
| 115 | /* | 116 | /* |
| 116 | * Flags starting here get preserved by bio_reset() - this includes | 117 | * Flags starting here get preserved by bio_reset() - this includes |
| 117 | * BIO_POOL_IDX() | 118 | * BIO_POOL_IDX() |
| 118 | */ | 119 | */ |
| 119 | #define BIO_RESET_BITS 12 | 120 | #define BIO_RESET_BITS 13 |
| 120 | 121 | ||
| 121 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) | 122 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) |
| 122 | 123 | ||
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 0ea61e07a91c..7c2e030e72f1 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | 12 | ||
| 13 | struct blk_trace { | 13 | struct blk_trace { |
| 14 | int trace_state; | 14 | int trace_state; |
| 15 | bool rq_based; | ||
| 16 | struct rchan *rchan; | 15 | struct rchan *rchan; |
| 17 | unsigned long __percpu *sequence; | 16 | unsigned long __percpu *sequence; |
| 18 | unsigned char __percpu *msg_data; | 17 | unsigned char __percpu *msg_data; |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index cdc3bab01832..5f0b0e1f7c08 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
| @@ -44,7 +44,6 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat, | |||
| 44 | unsigned long endpfn); | 44 | unsigned long endpfn); |
| 45 | extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); | 45 | extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); |
| 46 | 46 | ||
| 47 | extern unsigned long free_low_memory_core_early(int nodeid); | ||
| 48 | extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); | 47 | extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); |
| 49 | extern unsigned long free_all_bootmem(void); | 48 | extern unsigned long free_all_bootmem(void); |
| 50 | 49 | ||
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 5afc4f94d110..4c16c4a88d47 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
| @@ -181,6 +181,7 @@ void ll_rw_block(int, int, struct buffer_head * bh[]); | |||
| 181 | int sync_dirty_buffer(struct buffer_head *bh); | 181 | int sync_dirty_buffer(struct buffer_head *bh); |
| 182 | int __sync_dirty_buffer(struct buffer_head *bh, int rw); | 182 | int __sync_dirty_buffer(struct buffer_head *bh, int rw); |
| 183 | void write_dirty_buffer(struct buffer_head *bh, int rw); | 183 | void write_dirty_buffer(struct buffer_head *bh, int rw); |
| 184 | int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags); | ||
| 184 | int submit_bh(int, struct buffer_head *); | 185 | int submit_bh(int, struct buffer_head *); |
| 185 | void write_boundary_block(struct block_device *bdev, | 186 | void write_boundary_block(struct block_device *bdev, |
| 186 | sector_t bblock, unsigned blocksize); | 187 | sector_t bblock, unsigned blocksize); |
diff --git a/include/linux/capability.h b/include/linux/capability.h index 98503b792369..d9a4f7f40f32 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
| @@ -35,6 +35,7 @@ struct cpu_vfs_cap_data { | |||
| 35 | #define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) | 35 | #define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) |
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | struct file; | ||
| 38 | struct inode; | 39 | struct inode; |
| 39 | struct dentry; | 40 | struct dentry; |
| 40 | struct user_namespace; | 41 | struct user_namespace; |
| @@ -211,6 +212,7 @@ extern bool capable(int cap); | |||
| 211 | extern bool ns_capable(struct user_namespace *ns, int cap); | 212 | extern bool ns_capable(struct user_namespace *ns, int cap); |
| 212 | extern bool nsown_capable(int cap); | 213 | extern bool nsown_capable(int cap); |
| 213 | extern bool inode_capable(const struct inode *inode, int cap); | 214 | extern bool inode_capable(const struct inode *inode, int cap); |
| 215 | extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap); | ||
| 214 | 216 | ||
| 215 | /* audit system wants to get cap info from files as well */ | 217 | /* audit system wants to get cap info from files as well */ |
| 216 | extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); | 218 | extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 900af5964f55..646ab9d15e42 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/idr.h> | 19 | #include <linux/idr.h> |
| 20 | #include <linux/workqueue.h> | 20 | #include <linux/workqueue.h> |
| 21 | #include <linux/xattr.h> | 21 | #include <linux/xattr.h> |
| 22 | #include <linux/fs.h> | ||
| 22 | 23 | ||
| 23 | #ifdef CONFIG_CGROUPS | 24 | #ifdef CONFIG_CGROUPS |
| 24 | 25 | ||
| @@ -30,10 +31,6 @@ struct css_id; | |||
| 30 | 31 | ||
| 31 | extern int cgroup_init_early(void); | 32 | extern int cgroup_init_early(void); |
| 32 | extern int cgroup_init(void); | 33 | extern int cgroup_init(void); |
| 33 | extern void cgroup_lock(void); | ||
| 34 | extern int cgroup_lock_is_held(void); | ||
| 35 | extern bool cgroup_lock_live_group(struct cgroup *cgrp); | ||
| 36 | extern void cgroup_unlock(void); | ||
| 37 | extern void cgroup_fork(struct task_struct *p); | 34 | extern void cgroup_fork(struct task_struct *p); |
| 38 | extern void cgroup_post_fork(struct task_struct *p); | 35 | extern void cgroup_post_fork(struct task_struct *p); |
| 39 | extern void cgroup_exit(struct task_struct *p, int run_callbacks); | 36 | extern void cgroup_exit(struct task_struct *p, int run_callbacks); |
| @@ -44,14 +41,25 @@ extern void cgroup_unload_subsys(struct cgroup_subsys *ss); | |||
| 44 | 41 | ||
| 45 | extern const struct file_operations proc_cgroup_operations; | 42 | extern const struct file_operations proc_cgroup_operations; |
| 46 | 43 | ||
| 47 | /* Define the enumeration of all builtin cgroup subsystems */ | 44 | /* |
| 45 | * Define the enumeration of all cgroup subsystems. | ||
| 46 | * | ||
| 47 | * We define ids for builtin subsystems and then modular ones. | ||
| 48 | */ | ||
| 48 | #define SUBSYS(_x) _x ## _subsys_id, | 49 | #define SUBSYS(_x) _x ## _subsys_id, |
| 49 | #define IS_SUBSYS_ENABLED(option) IS_ENABLED(option) | ||
| 50 | enum cgroup_subsys_id { | 50 | enum cgroup_subsys_id { |
| 51 | #define IS_SUBSYS_ENABLED(option) IS_BUILTIN(option) | ||
| 51 | #include <linux/cgroup_subsys.h> | 52 | #include <linux/cgroup_subsys.h> |
| 53 | #undef IS_SUBSYS_ENABLED | ||
| 54 | CGROUP_BUILTIN_SUBSYS_COUNT, | ||
| 55 | |||
| 56 | __CGROUP_SUBSYS_TEMP_PLACEHOLDER = CGROUP_BUILTIN_SUBSYS_COUNT - 1, | ||
| 57 | |||
| 58 | #define IS_SUBSYS_ENABLED(option) IS_MODULE(option) | ||
| 59 | #include <linux/cgroup_subsys.h> | ||
| 60 | #undef IS_SUBSYS_ENABLED | ||
| 52 | CGROUP_SUBSYS_COUNT, | 61 | CGROUP_SUBSYS_COUNT, |
| 53 | }; | 62 | }; |
| 54 | #undef IS_SUBSYS_ENABLED | ||
| 55 | #undef SUBSYS | 63 | #undef SUBSYS |
| 56 | 64 | ||
| 57 | /* Per-subsystem/per-cgroup state maintained by the system. */ | 65 | /* Per-subsystem/per-cgroup state maintained by the system. */ |
| @@ -148,6 +156,13 @@ enum { | |||
| 148 | * specified at mount time and thus is implemented here. | 156 | * specified at mount time and thus is implemented here. |
| 149 | */ | 157 | */ |
| 150 | CGRP_CPUSET_CLONE_CHILDREN, | 158 | CGRP_CPUSET_CLONE_CHILDREN, |
| 159 | /* see the comment above CGRP_ROOT_SANE_BEHAVIOR for details */ | ||
| 160 | CGRP_SANE_BEHAVIOR, | ||
| 161 | }; | ||
| 162 | |||
| 163 | struct cgroup_name { | ||
| 164 | struct rcu_head rcu_head; | ||
| 165 | char name[]; | ||
| 151 | }; | 166 | }; |
| 152 | 167 | ||
| 153 | struct cgroup { | 168 | struct cgroup { |
| @@ -172,11 +187,23 @@ struct cgroup { | |||
| 172 | struct cgroup *parent; /* my parent */ | 187 | struct cgroup *parent; /* my parent */ |
| 173 | struct dentry *dentry; /* cgroup fs entry, RCU protected */ | 188 | struct dentry *dentry; /* cgroup fs entry, RCU protected */ |
| 174 | 189 | ||
| 190 | /* | ||
| 191 | * This is a copy of dentry->d_name, and it's needed because | ||
| 192 | * we can't use dentry->d_name in cgroup_path(). | ||
| 193 | * | ||
| 194 | * You must acquire rcu_read_lock() to access cgrp->name, and | ||
| 195 | * the only place that can change it is rename(), which is | ||
| 196 | * protected by parent dir's i_mutex. | ||
| 197 | * | ||
| 198 | * Normally you should use cgroup_name() wrapper rather than | ||
| 199 | * access it directly. | ||
| 200 | */ | ||
| 201 | struct cgroup_name __rcu *name; | ||
| 202 | |||
| 175 | /* Private pointers for each registered subsystem */ | 203 | /* Private pointers for each registered subsystem */ |
| 176 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; | 204 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; |
| 177 | 205 | ||
| 178 | struct cgroupfs_root *root; | 206 | struct cgroupfs_root *root; |
| 179 | struct cgroup *top_cgroup; | ||
| 180 | 207 | ||
| 181 | /* | 208 | /* |
| 182 | * List of cg_cgroup_links pointing at css_sets with | 209 | * List of cg_cgroup_links pointing at css_sets with |
| @@ -213,6 +240,96 @@ struct cgroup { | |||
| 213 | struct simple_xattrs xattrs; | 240 | struct simple_xattrs xattrs; |
| 214 | }; | 241 | }; |
| 215 | 242 | ||
| 243 | #define MAX_CGROUP_ROOT_NAMELEN 64 | ||
| 244 | |||
| 245 | /* cgroupfs_root->flags */ | ||
| 246 | enum { | ||
| 247 | /* | ||
| 248 | * Unfortunately, cgroup core and various controllers are riddled | ||
| 249 | * with idiosyncrasies and pointless options. The following flag, | ||
| 250 | * when set, will force sane behavior - some options are forced on, | ||
| 251 | * others are disallowed, and some controllers will change their | ||
| 252 | * hierarchical or other behaviors. | ||
| 253 | * | ||
| 254 | * The set of behaviors affected by this flag are still being | ||
| 255 | * determined and developed and the mount option for this flag is | ||
| 256 | * prefixed with __DEVEL__. The prefix will be dropped once we | ||
| 257 | * reach the point where all behaviors are compatible with the | ||
| 258 | * planned unified hierarchy, which will automatically turn on this | ||
| 259 | * flag. | ||
| 260 | * | ||
| 261 | * The followings are the behaviors currently affected this flag. | ||
| 262 | * | ||
| 263 | * - Mount options "noprefix" and "clone_children" are disallowed. | ||
| 264 | * Also, cgroupfs file cgroup.clone_children is not created. | ||
| 265 | * | ||
| 266 | * - When mounting an existing superblock, mount options should | ||
| 267 | * match. | ||
| 268 | * | ||
| 269 | * - Remount is disallowed. | ||
| 270 | * | ||
| 271 | * - memcg: use_hierarchy is on by default and the cgroup file for | ||
| 272 | * the flag is not created. | ||
| 273 | * | ||
| 274 | * The followings are planned changes. | ||
| 275 | * | ||
| 276 | * - release_agent will be disallowed once replacement notification | ||
| 277 | * mechanism is implemented. | ||
| 278 | */ | ||
| 279 | CGRP_ROOT_SANE_BEHAVIOR = (1 << 0), | ||
| 280 | |||
| 281 | CGRP_ROOT_NOPREFIX = (1 << 1), /* mounted subsystems have no named prefix */ | ||
| 282 | CGRP_ROOT_XATTR = (1 << 2), /* supports extended attributes */ | ||
| 283 | }; | ||
| 284 | |||
| 285 | /* | ||
| 286 | * A cgroupfs_root represents the root of a cgroup hierarchy, and may be | ||
| 287 | * associated with a superblock to form an active hierarchy. This is | ||
| 288 | * internal to cgroup core. Don't access directly from controllers. | ||
| 289 | */ | ||
| 290 | struct cgroupfs_root { | ||
| 291 | struct super_block *sb; | ||
| 292 | |||
| 293 | /* | ||
| 294 | * The bitmask of subsystems intended to be attached to this | ||
| 295 | * hierarchy | ||
| 296 | */ | ||
| 297 | unsigned long subsys_mask; | ||
| 298 | |||
| 299 | /* Unique id for this hierarchy. */ | ||
| 300 | int hierarchy_id; | ||
| 301 | |||
| 302 | /* The bitmask of subsystems currently attached to this hierarchy */ | ||
| 303 | unsigned long actual_subsys_mask; | ||
| 304 | |||
| 305 | /* A list running through the attached subsystems */ | ||
| 306 | struct list_head subsys_list; | ||
| 307 | |||
| 308 | /* The root cgroup for this hierarchy */ | ||
| 309 | struct cgroup top_cgroup; | ||
| 310 | |||
| 311 | /* Tracks how many cgroups are currently defined in hierarchy.*/ | ||
| 312 | int number_of_cgroups; | ||
| 313 | |||
| 314 | /* A list running through the active hierarchies */ | ||
| 315 | struct list_head root_list; | ||
| 316 | |||
| 317 | /* All cgroups on this root, cgroup_mutex protected */ | ||
| 318 | struct list_head allcg_list; | ||
| 319 | |||
| 320 | /* Hierarchy-specific flags */ | ||
| 321 | unsigned long flags; | ||
| 322 | |||
| 323 | /* IDs for cgroups in this hierarchy */ | ||
| 324 | struct ida cgroup_ida; | ||
| 325 | |||
| 326 | /* The path to use for release notifications. */ | ||
| 327 | char release_agent_path[PATH_MAX]; | ||
| 328 | |||
| 329 | /* The name for this hierarchy - may be empty */ | ||
| 330 | char name[MAX_CGROUP_ROOT_NAMELEN]; | ||
| 331 | }; | ||
| 332 | |||
| 216 | /* | 333 | /* |
| 217 | * A css_set is a structure holding pointers to a set of | 334 | * A css_set is a structure holding pointers to a set of |
| 218 | * cgroup_subsys_state objects. This saves space in the task struct | 335 | * cgroup_subsys_state objects. This saves space in the task struct |
| @@ -278,6 +395,7 @@ struct cgroup_map_cb { | |||
| 278 | /* cftype->flags */ | 395 | /* cftype->flags */ |
| 279 | #define CFTYPE_ONLY_ON_ROOT (1U << 0) /* only create on root cg */ | 396 | #define CFTYPE_ONLY_ON_ROOT (1U << 0) /* only create on root cg */ |
| 280 | #define CFTYPE_NOT_ON_ROOT (1U << 1) /* don't create on root cg */ | 397 | #define CFTYPE_NOT_ON_ROOT (1U << 1) /* don't create on root cg */ |
| 398 | #define CFTYPE_INSANE (1U << 2) /* don't create if sane_behavior */ | ||
| 281 | 399 | ||
| 282 | #define MAX_CFTYPE_NAME 64 | 400 | #define MAX_CFTYPE_NAME 64 |
| 283 | 401 | ||
| @@ -304,9 +422,6 @@ struct cftype { | |||
| 304 | /* CFTYPE_* flags */ | 422 | /* CFTYPE_* flags */ |
| 305 | unsigned int flags; | 423 | unsigned int flags; |
| 306 | 424 | ||
| 307 | /* file xattrs */ | ||
| 308 | struct simple_xattrs xattrs; | ||
| 309 | |||
| 310 | int (*open)(struct inode *inode, struct file *file); | 425 | int (*open)(struct inode *inode, struct file *file); |
| 311 | ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft, | 426 | ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft, |
| 312 | struct file *file, | 427 | struct file *file, |
| @@ -404,18 +519,31 @@ struct cgroup_scanner { | |||
| 404 | void *data; | 519 | void *data; |
| 405 | }; | 520 | }; |
| 406 | 521 | ||
| 522 | /* | ||
| 523 | * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This | ||
| 524 | * function can be called as long as @cgrp is accessible. | ||
| 525 | */ | ||
| 526 | static inline bool cgroup_sane_behavior(const struct cgroup *cgrp) | ||
| 527 | { | ||
| 528 | return cgrp->root->flags & CGRP_ROOT_SANE_BEHAVIOR; | ||
| 529 | } | ||
| 530 | |||
| 531 | /* Caller should hold rcu_read_lock() */ | ||
| 532 | static inline const char *cgroup_name(const struct cgroup *cgrp) | ||
| 533 | { | ||
| 534 | return rcu_dereference(cgrp->name)->name; | ||
| 535 | } | ||
| 536 | |||
| 407 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); | 537 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
| 408 | int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); | 538 | int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
| 409 | 539 | ||
| 410 | int cgroup_is_removed(const struct cgroup *cgrp); | 540 | int cgroup_is_removed(const struct cgroup *cgrp); |
| 541 | bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor); | ||
| 411 | 542 | ||
| 412 | int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen); | 543 | int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen); |
| 413 | 544 | ||
| 414 | int cgroup_task_count(const struct cgroup *cgrp); | 545 | int cgroup_task_count(const struct cgroup *cgrp); |
| 415 | 546 | ||
| 416 | /* Return true if cgrp is a descendant of the task's cgroup */ | ||
| 417 | int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); | ||
| 418 | |||
| 419 | /* | 547 | /* |
| 420 | * Control Group taskset, used to pass around set of tasks to cgroup_subsys | 548 | * Control Group taskset, used to pass around set of tasks to cgroup_subsys |
| 421 | * methods. | 549 | * methods. |
| @@ -458,7 +586,6 @@ struct cgroup_subsys { | |||
| 458 | void (*bind)(struct cgroup *root); | 586 | void (*bind)(struct cgroup *root); |
| 459 | 587 | ||
| 460 | int subsys_id; | 588 | int subsys_id; |
| 461 | int active; | ||
| 462 | int disabled; | 589 | int disabled; |
| 463 | int early_init; | 590 | int early_init; |
| 464 | /* | 591 | /* |
| @@ -523,10 +650,16 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state( | |||
| 523 | * rcu_dereference_check() conditions, such as locks used during the | 650 | * rcu_dereference_check() conditions, such as locks used during the |
| 524 | * cgroup_subsys::attach() methods. | 651 | * cgroup_subsys::attach() methods. |
| 525 | */ | 652 | */ |
| 653 | #ifdef CONFIG_PROVE_RCU | ||
| 654 | extern struct mutex cgroup_mutex; | ||
| 526 | #define task_subsys_state_check(task, subsys_id, __c) \ | 655 | #define task_subsys_state_check(task, subsys_id, __c) \ |
| 527 | rcu_dereference_check(task->cgroups->subsys[subsys_id], \ | 656 | rcu_dereference_check((task)->cgroups->subsys[(subsys_id)], \ |
| 528 | lockdep_is_held(&task->alloc_lock) || \ | 657 | lockdep_is_held(&(task)->alloc_lock) || \ |
| 529 | cgroup_lock_is_held() || (__c)) | 658 | lockdep_is_held(&cgroup_mutex) || (__c)) |
| 659 | #else | ||
| 660 | #define task_subsys_state_check(task, subsys_id, __c) \ | ||
| 661 | rcu_dereference((task)->cgroups->subsys[(subsys_id)]) | ||
| 662 | #endif | ||
| 530 | 663 | ||
| 531 | static inline struct cgroup_subsys_state * | 664 | static inline struct cgroup_subsys_state * |
| 532 | task_subsys_state(struct task_struct *task, int subsys_id) | 665 | task_subsys_state(struct task_struct *task, int subsys_id) |
| @@ -661,8 +794,8 @@ struct task_struct *cgroup_iter_next(struct cgroup *cgrp, | |||
| 661 | struct cgroup_iter *it); | 794 | struct cgroup_iter *it); |
| 662 | void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); | 795 | void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); |
| 663 | int cgroup_scan_tasks(struct cgroup_scanner *scan); | 796 | int cgroup_scan_tasks(struct cgroup_scanner *scan); |
| 664 | int cgroup_attach_task(struct cgroup *, struct task_struct *); | ||
| 665 | int cgroup_attach_task_all(struct task_struct *from, struct task_struct *); | 797 | int cgroup_attach_task_all(struct task_struct *from, struct task_struct *); |
| 798 | int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); | ||
| 666 | 799 | ||
| 667 | /* | 800 | /* |
| 668 | * CSS ID is ID for cgroup_subsys_state structs under subsys. This only works | 801 | * CSS ID is ID for cgroup_subsys_state structs under subsys. This only works |
| @@ -687,13 +820,6 @@ void free_css_id(struct cgroup_subsys *ss, struct cgroup_subsys_state *css); | |||
| 687 | 820 | ||
| 688 | struct cgroup_subsys_state *css_lookup(struct cgroup_subsys *ss, int id); | 821 | struct cgroup_subsys_state *css_lookup(struct cgroup_subsys *ss, int id); |
| 689 | 822 | ||
| 690 | /* | ||
| 691 | * Get a cgroup whose id is greater than or equal to id under tree of root. | ||
| 692 | * Returning a cgroup_subsys_state or NULL. | ||
| 693 | */ | ||
| 694 | struct cgroup_subsys_state *css_get_next(struct cgroup_subsys *ss, int id, | ||
| 695 | struct cgroup_subsys_state *root, int *foundid); | ||
| 696 | |||
| 697 | /* Returns true if root is ancestor of cg */ | 823 | /* Returns true if root is ancestor of cg */ |
| 698 | bool css_is_ancestor(struct cgroup_subsys_state *cg, | 824 | bool css_is_ancestor(struct cgroup_subsys_state *cg, |
| 699 | const struct cgroup_subsys_state *root); | 825 | const struct cgroup_subsys_state *root); |
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h index 9c7f5807824b..dd7adff76e81 100644 --- a/include/linux/clk-private.h +++ b/include/linux/clk-private.h | |||
| @@ -152,7 +152,7 @@ struct clk { | |||
| 152 | }, \ | 152 | }, \ |
| 153 | .reg = _reg, \ | 153 | .reg = _reg, \ |
| 154 | .shift = _shift, \ | 154 | .shift = _shift, \ |
| 155 | .width = _width, \ | 155 | .mask = BIT(_width) - 1, \ |
| 156 | .flags = _mux_flags, \ | 156 | .flags = _mux_flags, \ |
| 157 | .lock = _lock, \ | 157 | .lock = _lock, \ |
| 158 | }; \ | 158 | }; \ |
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 7f197d7addb0..11860985fecb 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
| @@ -45,6 +45,14 @@ struct clk_hw; | |||
| 45 | * undo any work done in the @prepare callback. Called with | 45 | * undo any work done in the @prepare callback. Called with |
| 46 | * prepare_lock held. | 46 | * prepare_lock held. |
| 47 | * | 47 | * |
| 48 | * @is_prepared: Queries the hardware to determine if the clock is prepared. | ||
| 49 | * This function is allowed to sleep. Optional, if this op is not | ||
| 50 | * set then the prepare count will be used. | ||
| 51 | * | ||
| 52 | * @unprepare_unused: Unprepare the clock atomically. Only called from | ||
| 53 | * clk_disable_unused for prepare clocks with special needs. | ||
| 54 | * Called with prepare mutex held. This function may sleep. | ||
| 55 | * | ||
| 48 | * @enable: Enable the clock atomically. This must not return until the | 56 | * @enable: Enable the clock atomically. This must not return until the |
| 49 | * clock is generating a valid clock signal, usable by consumer | 57 | * clock is generating a valid clock signal, usable by consumer |
| 50 | * devices. Called with enable_lock held. This function must not | 58 | * devices. Called with enable_lock held. This function must not |
| @@ -108,6 +116,8 @@ struct clk_hw; | |||
| 108 | struct clk_ops { | 116 | struct clk_ops { |
| 109 | int (*prepare)(struct clk_hw *hw); | 117 | int (*prepare)(struct clk_hw *hw); |
| 110 | void (*unprepare)(struct clk_hw *hw); | 118 | void (*unprepare)(struct clk_hw *hw); |
| 119 | int (*is_prepared)(struct clk_hw *hw); | ||
| 120 | void (*unprepare_unused)(struct clk_hw *hw); | ||
| 111 | int (*enable)(struct clk_hw *hw); | 121 | int (*enable)(struct clk_hw *hw); |
| 112 | void (*disable)(struct clk_hw *hw); | 122 | void (*disable)(struct clk_hw *hw); |
| 113 | int (*is_enabled)(struct clk_hw *hw); | 123 | int (*is_enabled)(struct clk_hw *hw); |
| @@ -239,9 +249,14 @@ struct clk_div_table { | |||
| 239 | * CLK_DIVIDER_ONE_BASED - by default the divisor is the value read from the | 249 | * CLK_DIVIDER_ONE_BASED - by default the divisor is the value read from the |
| 240 | * register plus one. If CLK_DIVIDER_ONE_BASED is set then the divider is | 250 | * register plus one. If CLK_DIVIDER_ONE_BASED is set then the divider is |
| 241 | * the raw value read from the register, with the value of zero considered | 251 | * the raw value read from the register, with the value of zero considered |
| 242 | * invalid | 252 | * invalid, unless CLK_DIVIDER_ALLOW_ZERO is set. |
| 243 | * CLK_DIVIDER_POWER_OF_TWO - clock divisor is 2 raised to the value read from | 253 | * CLK_DIVIDER_POWER_OF_TWO - clock divisor is 2 raised to the value read from |
| 244 | * the hardware register | 254 | * the hardware register |
| 255 | * CLK_DIVIDER_ALLOW_ZERO - Allow zero divisors. For dividers which have | ||
| 256 | * CLK_DIVIDER_ONE_BASED set, it is possible to end up with a zero divisor. | ||
| 257 | * Some hardware implementations gracefully handle this case and allow a | ||
| 258 | * zero divisor by not modifying their input clock | ||
| 259 | * (divide by one / bypass). | ||
| 245 | */ | 260 | */ |
| 246 | struct clk_divider { | 261 | struct clk_divider { |
| 247 | struct clk_hw hw; | 262 | struct clk_hw hw; |
| @@ -255,6 +270,7 @@ struct clk_divider { | |||
| 255 | 270 | ||
| 256 | #define CLK_DIVIDER_ONE_BASED BIT(0) | 271 | #define CLK_DIVIDER_ONE_BASED BIT(0) |
| 257 | #define CLK_DIVIDER_POWER_OF_TWO BIT(1) | 272 | #define CLK_DIVIDER_POWER_OF_TWO BIT(1) |
| 273 | #define CLK_DIVIDER_ALLOW_ZERO BIT(2) | ||
| 258 | 274 | ||
| 259 | extern const struct clk_ops clk_divider_ops; | 275 | extern const struct clk_ops clk_divider_ops; |
| 260 | struct clk *clk_register_divider(struct device *dev, const char *name, | 276 | struct clk *clk_register_divider(struct device *dev, const char *name, |
| @@ -274,7 +290,7 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name, | |||
| 274 | * @reg: register controlling multiplexer | 290 | * @reg: register controlling multiplexer |
| 275 | * @shift: shift to multiplexer bit field | 291 | * @shift: shift to multiplexer bit field |
| 276 | * @width: width of mutliplexer bit field | 292 | * @width: width of mutliplexer bit field |
| 277 | * @num_clks: number of parent clocks | 293 | * @flags: hardware-specific flags |
| 278 | * @lock: register lock | 294 | * @lock: register lock |
| 279 | * | 295 | * |
| 280 | * Clock with multiple selectable parents. Implements .get_parent, .set_parent | 296 | * Clock with multiple selectable parents. Implements .get_parent, .set_parent |
| @@ -287,8 +303,9 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name, | |||
| 287 | struct clk_mux { | 303 | struct clk_mux { |
| 288 | struct clk_hw hw; | 304 | struct clk_hw hw; |
| 289 | void __iomem *reg; | 305 | void __iomem *reg; |
| 306 | u32 *table; | ||
| 307 | u32 mask; | ||
| 290 | u8 shift; | 308 | u8 shift; |
| 291 | u8 width; | ||
| 292 | u8 flags; | 309 | u8 flags; |
| 293 | spinlock_t *lock; | 310 | spinlock_t *lock; |
| 294 | }; | 311 | }; |
| @@ -297,11 +314,19 @@ struct clk_mux { | |||
| 297 | #define CLK_MUX_INDEX_BIT BIT(1) | 314 | #define CLK_MUX_INDEX_BIT BIT(1) |
| 298 | 315 | ||
| 299 | extern const struct clk_ops clk_mux_ops; | 316 | extern const struct clk_ops clk_mux_ops; |
| 317 | |||
| 300 | struct clk *clk_register_mux(struct device *dev, const char *name, | 318 | struct clk *clk_register_mux(struct device *dev, const char *name, |
| 301 | const char **parent_names, u8 num_parents, unsigned long flags, | 319 | const char **parent_names, u8 num_parents, unsigned long flags, |
| 302 | void __iomem *reg, u8 shift, u8 width, | 320 | void __iomem *reg, u8 shift, u8 width, |
| 303 | u8 clk_mux_flags, spinlock_t *lock); | 321 | u8 clk_mux_flags, spinlock_t *lock); |
| 304 | 322 | ||
| 323 | struct clk *clk_register_mux_table(struct device *dev, const char *name, | ||
| 324 | const char **parent_names, u8 num_parents, unsigned long flags, | ||
| 325 | void __iomem *reg, u8 shift, u32 mask, | ||
| 326 | u8 clk_mux_flags, u32 *table, spinlock_t *lock); | ||
| 327 | |||
| 328 | void of_fixed_factor_clk_setup(struct device_node *node); | ||
| 329 | |||
| 305 | /** | 330 | /** |
| 306 | * struct clk_fixed_factor - fixed multiplier and divider clock | 331 | * struct clk_fixed_factor - fixed multiplier and divider clock |
| 307 | * | 332 | * |
| @@ -325,6 +350,37 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name, | |||
| 325 | const char *parent_name, unsigned long flags, | 350 | const char *parent_name, unsigned long flags, |
| 326 | unsigned int mult, unsigned int div); | 351 | unsigned int mult, unsigned int div); |
| 327 | 352 | ||
| 353 | /*** | ||
| 354 | * struct clk_composite - aggregate clock of mux, divider and gate clocks | ||
| 355 | * | ||
| 356 | * @hw: handle between common and hardware-specific interfaces | ||
| 357 | * @mux_hw: handle between composite and hardware-specific mux clock | ||
| 358 | * @rate_hw: handle between composite and hardware-specific rate clock | ||
| 359 | * @gate_hw: handle between composite and hardware-specific gate clock | ||
| 360 | * @mux_ops: clock ops for mux | ||
| 361 | * @rate_ops: clock ops for rate | ||
| 362 | * @gate_ops: clock ops for gate | ||
| 363 | */ | ||
| 364 | struct clk_composite { | ||
| 365 | struct clk_hw hw; | ||
| 366 | struct clk_ops ops; | ||
| 367 | |||
| 368 | struct clk_hw *mux_hw; | ||
| 369 | struct clk_hw *rate_hw; | ||
| 370 | struct clk_hw *gate_hw; | ||
| 371 | |||
| 372 | const struct clk_ops *mux_ops; | ||
| 373 | const struct clk_ops *rate_ops; | ||
| 374 | const struct clk_ops *gate_ops; | ||
| 375 | }; | ||
| 376 | |||
| 377 | struct clk *clk_register_composite(struct device *dev, const char *name, | ||
| 378 | const char **parent_names, int num_parents, | ||
| 379 | struct clk_hw *mux_hw, const struct clk_ops *mux_ops, | ||
| 380 | struct clk_hw *rate_hw, const struct clk_ops *rate_ops, | ||
| 381 | struct clk_hw *gate_hw, const struct clk_ops *gate_ops, | ||
| 382 | unsigned long flags); | ||
| 383 | |||
| 328 | /** | 384 | /** |
| 329 | * clk_register - allocate a new clock, register it and return an opaque cookie | 385 | * clk_register - allocate a new clock, register it and return an opaque cookie |
| 330 | * @dev: device that is registering this clock | 386 | * @dev: device that is registering this clock |
| @@ -351,6 +407,7 @@ unsigned int __clk_get_enable_count(struct clk *clk); | |||
| 351 | unsigned int __clk_get_prepare_count(struct clk *clk); | 407 | unsigned int __clk_get_prepare_count(struct clk *clk); |
| 352 | unsigned long __clk_get_rate(struct clk *clk); | 408 | unsigned long __clk_get_rate(struct clk *clk); |
| 353 | unsigned long __clk_get_flags(struct clk *clk); | 409 | unsigned long __clk_get_flags(struct clk *clk); |
| 410 | bool __clk_is_prepared(struct clk *clk); | ||
| 354 | bool __clk_is_enabled(struct clk *clk); | 411 | bool __clk_is_enabled(struct clk *clk); |
| 355 | struct clk *__clk_lookup(const char *name); | 412 | struct clk *__clk_lookup(const char *name); |
| 356 | 413 | ||
diff --git a/include/linux/clk.h b/include/linux/clk.h index b3ac22d0fc1f..9a6d04524b1a 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
| @@ -28,16 +28,16 @@ struct clk; | |||
| 28 | * PRE_RATE_CHANGE - called immediately before the clk rate is changed, | 28 | * PRE_RATE_CHANGE - called immediately before the clk rate is changed, |
| 29 | * to indicate that the rate change will proceed. Drivers must | 29 | * to indicate that the rate change will proceed. Drivers must |
| 30 | * immediately terminate any operations that will be affected by the | 30 | * immediately terminate any operations that will be affected by the |
| 31 | * rate change. Callbacks may either return NOTIFY_DONE or | 31 | * rate change. Callbacks may either return NOTIFY_DONE, NOTIFY_OK, |
| 32 | * NOTIFY_STOP. | 32 | * NOTIFY_STOP or NOTIFY_BAD. |
| 33 | * | 33 | * |
| 34 | * ABORT_RATE_CHANGE: called if the rate change failed for some reason | 34 | * ABORT_RATE_CHANGE: called if the rate change failed for some reason |
| 35 | * after PRE_RATE_CHANGE. In this case, all registered notifiers on | 35 | * after PRE_RATE_CHANGE. In this case, all registered notifiers on |
| 36 | * the clk will be called with ABORT_RATE_CHANGE. Callbacks must | 36 | * the clk will be called with ABORT_RATE_CHANGE. Callbacks must |
| 37 | * always return NOTIFY_DONE. | 37 | * always return NOTIFY_DONE or NOTIFY_OK. |
| 38 | * | 38 | * |
| 39 | * POST_RATE_CHANGE - called after the clk rate change has successfully | 39 | * POST_RATE_CHANGE - called after the clk rate change has successfully |
| 40 | * completed. Callbacks must always return NOTIFY_DONE. | 40 | * completed. Callbacks must always return NOTIFY_DONE or NOTIFY_OK. |
| 41 | * | 41 | * |
| 42 | */ | 42 | */ |
| 43 | #define PRE_RATE_CHANGE BIT(0) | 43 | #define PRE_RATE_CHANGE BIT(0) |
diff --git a/include/linux/clk/sunxi.h b/include/linux/clk/sunxi.h new file mode 100644 index 000000000000..e074fdd5a236 --- /dev/null +++ b/include/linux/clk/sunxi.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2012 Maxime Ripard | ||
| 3 | * | ||
| 4 | * Maxime Ripard <maxime.ripard@free-electrons.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef __LINUX_CLK_SUNXI_H_ | ||
| 18 | #define __LINUX_CLK_SUNXI_H_ | ||
| 19 | |||
| 20 | void __init sunxi_init_clocks(void); | ||
| 21 | |||
| 22 | #endif | ||
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 66346521cb65..464e229e7d84 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
| @@ -55,6 +55,11 @@ enum clock_event_nofitiers { | |||
| 55 | #define CLOCK_EVT_FEAT_C3STOP 0x000008 | 55 | #define CLOCK_EVT_FEAT_C3STOP 0x000008 |
| 56 | #define CLOCK_EVT_FEAT_DUMMY 0x000010 | 56 | #define CLOCK_EVT_FEAT_DUMMY 0x000010 |
| 57 | 57 | ||
| 58 | /* | ||
| 59 | * Core shall set the interrupt affinity dynamically in broadcast mode | ||
| 60 | */ | ||
| 61 | #define CLOCK_EVT_FEAT_DYNIRQ 0x000020 | ||
| 62 | |||
| 58 | /** | 63 | /** |
| 59 | * struct clock_event_device - clock event device descriptor | 64 | * struct clock_event_device - clock event device descriptor |
| 60 | * @event_handler: Assigned by the framework to be called by the low | 65 | * @event_handler: Assigned by the framework to be called by the low |
| @@ -170,6 +175,12 @@ extern void tick_broadcast(const struct cpumask *mask); | |||
| 170 | extern int tick_receive_broadcast(void); | 175 | extern int tick_receive_broadcast(void); |
| 171 | #endif | 176 | #endif |
| 172 | 177 | ||
| 178 | #if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_TICK_ONESHOT) | ||
| 179 | extern int tick_check_broadcast_expired(void); | ||
| 180 | #else | ||
| 181 | static inline int tick_check_broadcast_expired(void) { return 0; } | ||
| 182 | #endif | ||
| 183 | |||
| 173 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 184 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
| 174 | extern void clockevents_notify(unsigned long reason, void *arg); | 185 | extern void clockevents_notify(unsigned long reason, void *arg); |
| 175 | #else | 186 | #else |
| @@ -182,6 +193,7 @@ static inline void clockevents_suspend(void) {} | |||
| 182 | static inline void clockevents_resume(void) {} | 193 | static inline void clockevents_resume(void) {} |
| 183 | 194 | ||
| 184 | #define clockevents_notify(reason, arg) do { } while (0) | 195 | #define clockevents_notify(reason, arg) do { } while (0) |
| 196 | static inline int tick_check_broadcast_expired(void) { return 0; } | ||
| 185 | 197 | ||
| 186 | #endif | 198 | #endif |
| 187 | 199 | ||
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 27cfda427dd9..aa7032c7238f 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -206,6 +206,7 @@ struct clocksource { | |||
| 206 | #define CLOCK_SOURCE_WATCHDOG 0x10 | 206 | #define CLOCK_SOURCE_WATCHDOG 0x10 |
| 207 | #define CLOCK_SOURCE_VALID_FOR_HRES 0x20 | 207 | #define CLOCK_SOURCE_VALID_FOR_HRES 0x20 |
| 208 | #define CLOCK_SOURCE_UNSTABLE 0x40 | 208 | #define CLOCK_SOURCE_UNSTABLE 0x40 |
| 209 | #define CLOCK_SOURCE_SUSPEND_NONSTOP 0x80 | ||
| 209 | 210 | ||
| 210 | /* simplify initialization of mask field */ | 211 | /* simplify initialization of mask field */ |
| 211 | #define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) | 212 | #define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 68b162d92254..842de225055f 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #define __must_check __attribute__((warn_unused_result)) | 13 | #define __must_check __attribute__((warn_unused_result)) |
| 14 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) | 14 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) |
| 15 | 15 | ||
| 16 | #if GCC_VERSION >= 40100 | 16 | #if GCC_VERSION >= 40100 && GCC_VERSION < 40600 |
| 17 | # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | 17 | # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) |
| 18 | #endif | 18 | #endif |
| 19 | 19 | ||
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 10b8f23fab0f..92669cd182a6 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -351,4 +351,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 351 | */ | 351 | */ |
| 352 | #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) | 352 | #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) |
| 353 | 353 | ||
| 354 | /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ | ||
| 355 | #ifdef CONFIG_KPROBES | ||
| 356 | # define __kprobes __attribute__((__section__(".kprobes.text"))) | ||
| 357 | #else | ||
| 358 | # define __kprobes | ||
| 359 | #endif | ||
| 354 | #endif /* __LINUX_COMPILER_H */ | 360 | #endif /* __LINUX_COMPILER_H */ |
diff --git a/include/linux/console.h b/include/linux/console.h index 29680a8cda99..73bab0f58af5 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
| @@ -141,6 +141,7 @@ struct console { | |||
| 141 | for (con = console_drivers; con != NULL; con = con->next) | 141 | for (con = console_drivers; con != NULL; con = con->next) |
| 142 | 142 | ||
| 143 | extern int console_set_on_cmdline; | 143 | extern int console_set_on_cmdline; |
| 144 | extern struct console *early_console; | ||
| 144 | 145 | ||
| 145 | extern int add_preferred_console(char *name, int idx, char *options); | 146 | extern int add_preferred_console(char *name, int idx, char *options); |
| 146 | extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options); | 147 | extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options); |
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index b28d161c1091..365f4a61bf04 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | #ifndef _LINUX_CONTEXT_TRACKING_H | 1 | #ifndef _LINUX_CONTEXT_TRACKING_H |
| 2 | #define _LINUX_CONTEXT_TRACKING_H | 2 | #define _LINUX_CONTEXT_TRACKING_H |
| 3 | 3 | ||
| 4 | #ifdef CONFIG_CONTEXT_TRACKING | ||
| 5 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
| 6 | #include <linux/percpu.h> | 5 | #include <linux/percpu.h> |
| 6 | #include <asm/ptrace.h> | ||
| 7 | 7 | ||
| 8 | struct context_tracking { | 8 | struct context_tracking { |
| 9 | /* | 9 | /* |
| @@ -13,12 +13,13 @@ struct context_tracking { | |||
| 13 | * may be further optimized using static keys. | 13 | * may be further optimized using static keys. |
| 14 | */ | 14 | */ |
| 15 | bool active; | 15 | bool active; |
| 16 | enum { | 16 | enum ctx_state { |
| 17 | IN_KERNEL = 0, | 17 | IN_KERNEL = 0, |
| 18 | IN_USER, | 18 | IN_USER, |
| 19 | } state; | 19 | } state; |
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | #ifdef CONFIG_CONTEXT_TRACKING | ||
| 22 | DECLARE_PER_CPU(struct context_tracking, context_tracking); | 23 | DECLARE_PER_CPU(struct context_tracking, context_tracking); |
| 23 | 24 | ||
| 24 | static inline bool context_tracking_in_user(void) | 25 | static inline bool context_tracking_in_user(void) |
| @@ -33,12 +34,31 @@ static inline bool context_tracking_active(void) | |||
| 33 | 34 | ||
| 34 | extern void user_enter(void); | 35 | extern void user_enter(void); |
| 35 | extern void user_exit(void); | 36 | extern void user_exit(void); |
| 37 | |||
| 38 | static inline enum ctx_state exception_enter(void) | ||
| 39 | { | ||
| 40 | enum ctx_state prev_ctx; | ||
| 41 | |||
| 42 | prev_ctx = this_cpu_read(context_tracking.state); | ||
| 43 | user_exit(); | ||
| 44 | |||
| 45 | return prev_ctx; | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline void exception_exit(enum ctx_state prev_ctx) | ||
| 49 | { | ||
| 50 | if (prev_ctx == IN_USER) | ||
| 51 | user_enter(); | ||
| 52 | } | ||
| 53 | |||
| 36 | extern void context_tracking_task_switch(struct task_struct *prev, | 54 | extern void context_tracking_task_switch(struct task_struct *prev, |
| 37 | struct task_struct *next); | 55 | struct task_struct *next); |
| 38 | #else | 56 | #else |
| 39 | static inline bool context_tracking_in_user(void) { return false; } | 57 | static inline bool context_tracking_in_user(void) { return false; } |
| 40 | static inline void user_enter(void) { } | 58 | static inline void user_enter(void) { } |
| 41 | static inline void user_exit(void) { } | 59 | static inline void user_exit(void) { } |
| 60 | static inline enum ctx_state exception_enter(void) { return 0; } | ||
| 61 | static inline void exception_exit(enum ctx_state prev_ctx) { } | ||
| 42 | static inline void context_tracking_task_switch(struct task_struct *prev, | 62 | static inline void context_tracking_task_switch(struct task_struct *prev, |
| 43 | struct task_struct *next) { } | 63 | struct task_struct *next) { } |
| 44 | #endif /* !CONFIG_CONTEXT_TRACKING */ | 64 | #endif /* !CONFIG_CONTEXT_TRACKING */ |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index ce7a074f2519..c6f6e0839b61 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -212,4 +212,20 @@ static inline int disable_nonboot_cpus(void) { return 0; } | |||
| 212 | static inline void enable_nonboot_cpus(void) {} | 212 | static inline void enable_nonboot_cpus(void) {} |
| 213 | #endif /* !CONFIG_PM_SLEEP_SMP */ | 213 | #endif /* !CONFIG_PM_SLEEP_SMP */ |
| 214 | 214 | ||
| 215 | enum cpuhp_state { | ||
| 216 | CPUHP_OFFLINE, | ||
| 217 | CPUHP_ONLINE, | ||
| 218 | }; | ||
| 219 | |||
| 220 | void cpu_startup_entry(enum cpuhp_state state); | ||
| 221 | void cpu_idle(void); | ||
| 222 | |||
| 223 | void cpu_idle_poll_ctrl(bool enable); | ||
| 224 | |||
| 225 | void arch_cpu_idle(void); | ||
| 226 | void arch_cpu_idle_prepare(void); | ||
| 227 | void arch_cpu_idle_enter(void); | ||
| 228 | void arch_cpu_idle_exit(void); | ||
| 229 | void arch_cpu_idle_dead(void); | ||
| 230 | |||
| 215 | #endif /* _LINUX_CPU_H_ */ | 231 | #endif /* _LINUX_CPU_H_ */ |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 032560295fcb..d08e4d2a9b92 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
| @@ -591,6 +591,21 @@ static inline int cpulist_scnprintf(char *buf, int len, | |||
| 591 | } | 591 | } |
| 592 | 592 | ||
| 593 | /** | 593 | /** |
| 594 | * cpumask_parse - extract a cpumask from from a string | ||
| 595 | * @buf: the buffer to extract from | ||
| 596 | * @dstp: the cpumask to set. | ||
| 597 | * | ||
| 598 | * Returns -errno, or 0 for success. | ||
| 599 | */ | ||
| 600 | static inline int cpumask_parse(const char *buf, struct cpumask *dstp) | ||
| 601 | { | ||
| 602 | char *nl = strchr(buf, '\n'); | ||
| 603 | int len = nl ? nl - buf : strlen(buf); | ||
| 604 | |||
| 605 | return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); | ||
| 606 | } | ||
| 607 | |||
| 608 | /** | ||
| 594 | * cpulist_parse - extract a cpumask from a user string of ranges | 609 | * cpulist_parse - extract a cpumask from a user string of ranges |
| 595 | * @buf: the buffer to extract from | 610 | * @buf: the buffer to extract from |
| 596 | * @dstp: the cpumask to set. | 611 | * @dstp: the cpumask to set. |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 8c8a60d29407..ccd1de8ad822 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
| 12 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
| 13 | #include <linux/nodemask.h> | 13 | #include <linux/nodemask.h> |
| 14 | #include <linux/cgroup.h> | ||
| 15 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
| 16 | 15 | ||
| 17 | #ifdef CONFIG_CPUSETS | 16 | #ifdef CONFIG_CPUSETS |
diff --git a/include/linux/ctype.h b/include/linux/ctype.h index 8acfe312f947..653589e3e30e 100644 --- a/include/linux/ctype.h +++ b/include/linux/ctype.h | |||
| @@ -61,4 +61,10 @@ static inline char _tolower(const char c) | |||
| 61 | return c | 0x20; | 61 | return c | 0x20; |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | /* Fast check for octal digit */ | ||
| 65 | static inline int isodigit(const char c) | ||
| 66 | { | ||
| 67 | return c >= '0' && c <= '7'; | ||
| 68 | } | ||
| 69 | |||
| 64 | #endif | 70 | #endif |
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index 3bd46f766751..21ca773f77bf 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h | |||
| @@ -27,7 +27,7 @@ extern int debug_locks_off(void); | |||
| 27 | \ | 27 | \ |
| 28 | if (!oops_in_progress && unlikely(c)) { \ | 28 | if (!oops_in_progress && unlikely(c)) { \ |
| 29 | if (debug_locks_off() && !debug_locks_silent) \ | 29 | if (debug_locks_off() && !debug_locks_silent) \ |
| 30 | WARN_ON(1); \ | 30 | WARN(1, "DEBUG_LOCKS_WARN_ON(%s)", #c); \ |
| 31 | __ret = 1; \ | 31 | __ret = 1; \ |
| 32 | } \ | 32 | } \ |
| 33 | __ret; \ | 33 | __ret; \ |
diff --git a/include/linux/device.h b/include/linux/device.h index 9d6464ea99c6..711793b145ff 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/pm.h> | 25 | #include <linux/pm.h> |
| 26 | #include <linux/atomic.h> | 26 | #include <linux/atomic.h> |
| 27 | #include <linux/ratelimit.h> | 27 | #include <linux/ratelimit.h> |
| 28 | #include <linux/uidgid.h> | ||
| 28 | #include <asm/device.h> | 29 | #include <asm/device.h> |
| 29 | 30 | ||
| 30 | struct device; | 31 | struct device; |
| @@ -111,17 +112,11 @@ struct bus_type { | |||
| 111 | struct iommu_ops *iommu_ops; | 112 | struct iommu_ops *iommu_ops; |
| 112 | 113 | ||
| 113 | struct subsys_private *p; | 114 | struct subsys_private *p; |
| 115 | struct lock_class_key lock_key; | ||
| 114 | }; | 116 | }; |
| 115 | 117 | ||
| 116 | /* This is a #define to keep the compiler from merging different | 118 | extern int __must_check bus_register(struct bus_type *bus); |
| 117 | * instances of the __key variable */ | 119 | |
| 118 | #define bus_register(subsys) \ | ||
| 119 | ({ \ | ||
| 120 | static struct lock_class_key __key; \ | ||
| 121 | __bus_register(subsys, &__key); \ | ||
| 122 | }) | ||
| 123 | extern int __must_check __bus_register(struct bus_type *bus, | ||
| 124 | struct lock_class_key *key); | ||
| 125 | extern void bus_unregister(struct bus_type *bus); | 120 | extern void bus_unregister(struct bus_type *bus); |
| 126 | 121 | ||
| 127 | extern int __must_check bus_rescan_devices(struct bus_type *bus); | 122 | extern int __must_check bus_rescan_devices(struct bus_type *bus); |
| @@ -302,6 +297,8 @@ void subsys_interface_unregister(struct subsys_interface *sif); | |||
| 302 | 297 | ||
| 303 | int subsys_system_register(struct bus_type *subsys, | 298 | int subsys_system_register(struct bus_type *subsys, |
| 304 | const struct attribute_group **groups); | 299 | const struct attribute_group **groups); |
| 300 | int subsys_virtual_register(struct bus_type *subsys, | ||
| 301 | const struct attribute_group **groups); | ||
| 305 | 302 | ||
| 306 | /** | 303 | /** |
| 307 | * struct class - device classes | 304 | * struct class - device classes |
| @@ -471,7 +468,8 @@ struct device_type { | |||
| 471 | const char *name; | 468 | const char *name; |
| 472 | const struct attribute_group **groups; | 469 | const struct attribute_group **groups; |
| 473 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); | 470 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); |
| 474 | char *(*devnode)(struct device *dev, umode_t *mode); | 471 | char *(*devnode)(struct device *dev, umode_t *mode, |
| 472 | kuid_t *uid, kgid_t *gid); | ||
| 475 | void (*release)(struct device *dev); | 473 | void (*release)(struct device *dev); |
| 476 | 474 | ||
| 477 | const struct dev_pm_ops *pm; | 475 | const struct dev_pm_ops *pm; |
| @@ -849,7 +847,8 @@ extern int device_rename(struct device *dev, const char *new_name); | |||
| 849 | extern int device_move(struct device *dev, struct device *new_parent, | 847 | extern int device_move(struct device *dev, struct device *new_parent, |
| 850 | enum dpm_order dpm_order); | 848 | enum dpm_order dpm_order); |
| 851 | extern const char *device_get_devnode(struct device *dev, | 849 | extern const char *device_get_devnode(struct device *dev, |
| 852 | umode_t *mode, const char **tmp); | 850 | umode_t *mode, kuid_t *uid, kgid_t *gid, |
| 851 | const char **tmp); | ||
| 853 | extern void *dev_get_drvdata(const struct device *dev); | 852 | extern void *dev_get_drvdata(const struct device *dev); |
| 854 | extern int dev_set_drvdata(struct device *dev, void *data); | 853 | extern int dev_set_drvdata(struct device *dev, void *data); |
| 855 | 854 | ||
diff --git a/include/linux/efi.h b/include/linux/efi.h index 9bf2f1fcae27..3d7df3d32c66 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -333,6 +333,7 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, | |||
| 333 | unsigned long count, | 333 | unsigned long count, |
| 334 | u64 *max_size, | 334 | u64 *max_size, |
| 335 | int *reset_type); | 335 | int *reset_type); |
| 336 | typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size); | ||
| 336 | 337 | ||
| 337 | /* | 338 | /* |
| 338 | * EFI Configuration Table and GUID definitions | 339 | * EFI Configuration Table and GUID definitions |
| @@ -575,9 +576,15 @@ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if pos | |||
| 575 | #ifdef CONFIG_X86 | 576 | #ifdef CONFIG_X86 |
| 576 | extern void efi_late_init(void); | 577 | extern void efi_late_init(void); |
| 577 | extern void efi_free_boot_services(void); | 578 | extern void efi_free_boot_services(void); |
| 579 | extern efi_status_t efi_query_variable_store(u32 attributes, unsigned long size); | ||
| 578 | #else | 580 | #else |
| 579 | static inline void efi_late_init(void) {} | 581 | static inline void efi_late_init(void) {} |
| 580 | static inline void efi_free_boot_services(void) {} | 582 | static inline void efi_free_boot_services(void) {} |
| 583 | |||
| 584 | static inline efi_status_t efi_query_variable_store(u32 attributes, unsigned long size) | ||
| 585 | { | ||
| 586 | return EFI_SUCCESS; | ||
| 587 | } | ||
| 581 | #endif | 588 | #endif |
| 582 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); | 589 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); |
| 583 | extern u64 efi_get_iobase (void); | 590 | extern u64 efi_get_iobase (void); |
| @@ -731,7 +738,7 @@ struct efivar_operations { | |||
| 731 | efi_get_variable_t *get_variable; | 738 | efi_get_variable_t *get_variable; |
| 732 | efi_get_next_variable_t *get_next_variable; | 739 | efi_get_next_variable_t *get_next_variable; |
| 733 | efi_set_variable_t *set_variable; | 740 | efi_set_variable_t *set_variable; |
| 734 | efi_query_variable_info_t *query_variable_info; | 741 | efi_query_variable_store_t *query_variable_store; |
| 735 | }; | 742 | }; |
| 736 | 743 | ||
| 737 | struct efivars { | 744 | struct efivars { |
diff --git a/include/linux/evm.h b/include/linux/evm.h index 9fc13a760928..1fcb88ca88de 100644 --- a/include/linux/evm.h +++ b/include/linux/evm.h | |||
| @@ -96,5 +96,5 @@ static inline int evm_inode_init_security(struct inode *inode, | |||
| 96 | return 0; | 96 | return 0; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | #endif /* CONFIG_EVM_H */ | 99 | #endif /* CONFIG_EVM */ |
| 100 | #endif /* LINUX_EVM_H */ | 100 | #endif /* LINUX_EVM_H */ |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 5b9b5b317180..41b223a59a63 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h | |||
| @@ -85,6 +85,17 @@ enum fid_type { | |||
| 85 | FILEID_NILFS_WITH_PARENT = 0x62, | 85 | FILEID_NILFS_WITH_PARENT = 0x62, |
| 86 | 86 | ||
| 87 | /* | 87 | /* |
| 88 | * 32 bit generation number, 40 bit i_pos. | ||
| 89 | */ | ||
| 90 | FILEID_FAT_WITHOUT_PARENT = 0x71, | ||
| 91 | |||
| 92 | /* | ||
| 93 | * 32 bit generation number, 40 bit i_pos, | ||
| 94 | * 32 bit parent generation number, 40 bit parent i_pos | ||
| 95 | */ | ||
| 96 | FILEID_FAT_WITH_PARENT = 0x72, | ||
| 97 | |||
| 98 | /* | ||
| 88 | * Filesystems must not use 0xff file ID. | 99 | * Filesystems must not use 0xff file ID. |
| 89 | */ | 100 | */ |
| 90 | FILEID_INVALID = 0xff, | 101 | FILEID_INVALID = 0xff, |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index d5b0910d4961..4b2ee8d12f5e 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
| @@ -157,7 +157,6 @@ struct fsnotify_group { | |||
| 157 | struct inotify_group_private_data { | 157 | struct inotify_group_private_data { |
| 158 | spinlock_t idr_lock; | 158 | spinlock_t idr_lock; |
| 159 | struct idr idr; | 159 | struct idr idr; |
| 160 | u32 last_wd; | ||
| 161 | struct user_struct *user; | 160 | struct user_struct *user; |
| 162 | } inotify_data; | 161 | } inotify_data; |
| 163 | #endif | 162 | #endif |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index e5ca8ef50e9b..f83e17a40e8b 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -89,6 +89,7 @@ typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip, | |||
| 89 | * that the call back has its own recursion protection. If it does | 89 | * that the call back has its own recursion protection. If it does |
| 90 | * not set this, then the ftrace infrastructure will add recursion | 90 | * not set this, then the ftrace infrastructure will add recursion |
| 91 | * protection for the caller. | 91 | * protection for the caller. |
| 92 | * STUB - The ftrace_ops is just a place holder. | ||
| 92 | */ | 93 | */ |
| 93 | enum { | 94 | enum { |
| 94 | FTRACE_OPS_FL_ENABLED = 1 << 0, | 95 | FTRACE_OPS_FL_ENABLED = 1 << 0, |
| @@ -98,6 +99,7 @@ enum { | |||
| 98 | FTRACE_OPS_FL_SAVE_REGS = 1 << 4, | 99 | FTRACE_OPS_FL_SAVE_REGS = 1 << 4, |
| 99 | FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5, | 100 | FTRACE_OPS_FL_SAVE_REGS_IF_SUPPORTED = 1 << 5, |
| 100 | FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6, | 101 | FTRACE_OPS_FL_RECURSION_SAFE = 1 << 6, |
| 102 | FTRACE_OPS_FL_STUB = 1 << 7, | ||
| 101 | }; | 103 | }; |
| 102 | 104 | ||
| 103 | struct ftrace_ops { | 105 | struct ftrace_ops { |
| @@ -259,8 +261,10 @@ struct ftrace_probe_ops { | |||
| 259 | void (*func)(unsigned long ip, | 261 | void (*func)(unsigned long ip, |
| 260 | unsigned long parent_ip, | 262 | unsigned long parent_ip, |
| 261 | void **data); | 263 | void **data); |
| 262 | int (*callback)(unsigned long ip, void **data); | 264 | int (*init)(struct ftrace_probe_ops *ops, |
| 263 | void (*free)(void **data); | 265 | unsigned long ip, void **data); |
| 266 | void (*free)(struct ftrace_probe_ops *ops, | ||
| 267 | unsigned long ip, void **data); | ||
| 264 | int (*print)(struct seq_file *m, | 268 | int (*print)(struct seq_file *m, |
| 265 | unsigned long ip, | 269 | unsigned long ip, |
| 266 | struct ftrace_probe_ops *ops, | 270 | struct ftrace_probe_ops *ops, |
| @@ -394,7 +398,6 @@ ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf, | |||
| 394 | size_t cnt, loff_t *ppos); | 398 | size_t cnt, loff_t *ppos); |
| 395 | ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, | 399 | ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, |
| 396 | size_t cnt, loff_t *ppos); | 400 | size_t cnt, loff_t *ppos); |
| 397 | loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence); | ||
| 398 | int ftrace_regex_release(struct inode *inode, struct file *file); | 401 | int ftrace_regex_release(struct inode *inode, struct file *file); |
| 399 | 402 | ||
| 400 | void __init | 403 | void __init |
| @@ -567,6 +570,8 @@ static inline int | |||
| 567 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } | 570 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } |
| 568 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 571 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
| 569 | 572 | ||
| 573 | loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int whence); | ||
| 574 | |||
| 570 | /* totally disable ftrace - can not re-enable after this */ | 575 | /* totally disable ftrace - can not re-enable after this */ |
| 571 | void ftrace_kill(void); | 576 | void ftrace_kill(void); |
| 572 | 577 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 13a54d0bdfa8..34e00fb49bec 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/perf_event.h> | 8 | #include <linux/perf_event.h> |
| 9 | 9 | ||
| 10 | struct trace_array; | 10 | struct trace_array; |
| 11 | struct trace_buffer; | ||
| 11 | struct tracer; | 12 | struct tracer; |
| 12 | struct dentry; | 13 | struct dentry; |
| 13 | 14 | ||
| @@ -38,6 +39,12 @@ const char *ftrace_print_symbols_seq_u64(struct trace_seq *p, | |||
| 38 | const char *ftrace_print_hex_seq(struct trace_seq *p, | 39 | const char *ftrace_print_hex_seq(struct trace_seq *p, |
| 39 | const unsigned char *buf, int len); | 40 | const unsigned char *buf, int len); |
| 40 | 41 | ||
| 42 | struct trace_iterator; | ||
| 43 | struct trace_event; | ||
| 44 | |||
| 45 | int ftrace_raw_output_prep(struct trace_iterator *iter, | ||
| 46 | struct trace_event *event); | ||
| 47 | |||
| 41 | /* | 48 | /* |
| 42 | * The trace entry - the most basic unit of tracing. This is what | 49 | * The trace entry - the most basic unit of tracing. This is what |
| 43 | * is printed in the end as a single line in the trace output, such as: | 50 | * is printed in the end as a single line in the trace output, such as: |
| @@ -61,6 +68,7 @@ struct trace_entry { | |||
| 61 | struct trace_iterator { | 68 | struct trace_iterator { |
| 62 | struct trace_array *tr; | 69 | struct trace_array *tr; |
| 63 | struct tracer *trace; | 70 | struct tracer *trace; |
| 71 | struct trace_buffer *trace_buffer; | ||
| 64 | void *private; | 72 | void *private; |
| 65 | int cpu_file; | 73 | int cpu_file; |
| 66 | struct mutex mutex; | 74 | struct mutex mutex; |
| @@ -95,8 +103,6 @@ enum trace_iter_flags { | |||
| 95 | }; | 103 | }; |
| 96 | 104 | ||
| 97 | 105 | ||
| 98 | struct trace_event; | ||
| 99 | |||
| 100 | typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter, | 106 | typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter, |
| 101 | int flags, struct trace_event *event); | 107 | int flags, struct trace_event *event); |
| 102 | 108 | ||
| @@ -128,6 +134,13 @@ enum print_line_t { | |||
| 128 | void tracing_generic_entry_update(struct trace_entry *entry, | 134 | void tracing_generic_entry_update(struct trace_entry *entry, |
| 129 | unsigned long flags, | 135 | unsigned long flags, |
| 130 | int pc); | 136 | int pc); |
| 137 | struct ftrace_event_file; | ||
| 138 | |||
| 139 | struct ring_buffer_event * | ||
| 140 | trace_event_buffer_lock_reserve(struct ring_buffer **current_buffer, | ||
| 141 | struct ftrace_event_file *ftrace_file, | ||
| 142 | int type, unsigned long len, | ||
| 143 | unsigned long flags, int pc); | ||
| 131 | struct ring_buffer_event * | 144 | struct ring_buffer_event * |
| 132 | trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer, | 145 | trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer, |
| 133 | int type, unsigned long len, | 146 | int type, unsigned long len, |
| @@ -182,53 +195,49 @@ extern int ftrace_event_reg(struct ftrace_event_call *event, | |||
| 182 | enum trace_reg type, void *data); | 195 | enum trace_reg type, void *data); |
| 183 | 196 | ||
| 184 | enum { | 197 | enum { |
| 185 | TRACE_EVENT_FL_ENABLED_BIT, | ||
| 186 | TRACE_EVENT_FL_FILTERED_BIT, | 198 | TRACE_EVENT_FL_FILTERED_BIT, |
| 187 | TRACE_EVENT_FL_RECORDED_CMD_BIT, | ||
| 188 | TRACE_EVENT_FL_CAP_ANY_BIT, | 199 | TRACE_EVENT_FL_CAP_ANY_BIT, |
| 189 | TRACE_EVENT_FL_NO_SET_FILTER_BIT, | 200 | TRACE_EVENT_FL_NO_SET_FILTER_BIT, |
| 190 | TRACE_EVENT_FL_IGNORE_ENABLE_BIT, | 201 | TRACE_EVENT_FL_IGNORE_ENABLE_BIT, |
| 202 | TRACE_EVENT_FL_WAS_ENABLED_BIT, | ||
| 191 | }; | 203 | }; |
| 192 | 204 | ||
| 205 | /* | ||
| 206 | * Event flags: | ||
| 207 | * FILTERED - The event has a filter attached | ||
| 208 | * CAP_ANY - Any user can enable for perf | ||
| 209 | * NO_SET_FILTER - Set when filter has error and is to be ignored | ||
| 210 | * IGNORE_ENABLE - For ftrace internal events, do not enable with debugfs file | ||
| 211 | * WAS_ENABLED - Set and stays set when an event was ever enabled | ||
| 212 | * (used for module unloading, if a module event is enabled, | ||
| 213 | * it is best to clear the buffers that used it). | ||
| 214 | */ | ||
| 193 | enum { | 215 | enum { |
| 194 | TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT), | ||
| 195 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | 216 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), |
| 196 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), | ||
| 197 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), | 217 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), |
| 198 | TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), | 218 | TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), |
| 199 | TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), | 219 | TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), |
| 220 | TRACE_EVENT_FL_WAS_ENABLED = (1 << TRACE_EVENT_FL_WAS_ENABLED_BIT), | ||
| 200 | }; | 221 | }; |
| 201 | 222 | ||
| 202 | struct ftrace_event_call { | 223 | struct ftrace_event_call { |
| 203 | struct list_head list; | 224 | struct list_head list; |
| 204 | struct ftrace_event_class *class; | 225 | struct ftrace_event_class *class; |
| 205 | char *name; | 226 | char *name; |
| 206 | struct dentry *dir; | ||
| 207 | struct trace_event event; | 227 | struct trace_event event; |
| 208 | const char *print_fmt; | 228 | const char *print_fmt; |
| 209 | struct event_filter *filter; | 229 | struct event_filter *filter; |
| 230 | struct list_head *files; | ||
| 210 | void *mod; | 231 | void *mod; |
| 211 | void *data; | 232 | void *data; |
| 212 | |||
| 213 | /* | 233 | /* |
| 214 | * 32 bit flags: | 234 | * bit 0: filter_active |
| 215 | * bit 1: enabled | 235 | * bit 1: allow trace by non root (cap any) |
| 216 | * bit 2: filter_active | 236 | * bit 2: failed to apply filter |
| 217 | * bit 3: enabled cmd record | 237 | * bit 3: ftrace internal event (do not enable) |
| 218 | * bit 4: allow trace by non root (cap any) | 238 | * bit 4: Event was enabled by module |
| 219 | * bit 5: failed to apply filter | ||
| 220 | * bit 6: ftrace internal event (do not enable) | ||
| 221 | * | ||
| 222 | * Changes to flags must hold the event_mutex. | ||
| 223 | * | ||
| 224 | * Note: Reads of flags do not hold the event_mutex since | ||
| 225 | * they occur in critical sections. But the way flags | ||
| 226 | * is currently used, these changes do no affect the code | ||
| 227 | * except that when a change is made, it may have a slight | ||
| 228 | * delay in propagating the changes to other CPUs due to | ||
| 229 | * caching and such. | ||
| 230 | */ | 239 | */ |
| 231 | unsigned int flags; | 240 | int flags; /* static flags of different events */ |
| 232 | 241 | ||
| 233 | #ifdef CONFIG_PERF_EVENTS | 242 | #ifdef CONFIG_PERF_EVENTS |
| 234 | int perf_refcount; | 243 | int perf_refcount; |
| @@ -236,6 +245,56 @@ struct ftrace_event_call { | |||
| 236 | #endif | 245 | #endif |
| 237 | }; | 246 | }; |
| 238 | 247 | ||
| 248 | struct trace_array; | ||
| 249 | struct ftrace_subsystem_dir; | ||
| 250 | |||
| 251 | enum { | ||
| 252 | FTRACE_EVENT_FL_ENABLED_BIT, | ||
| 253 | FTRACE_EVENT_FL_RECORDED_CMD_BIT, | ||
| 254 | FTRACE_EVENT_FL_SOFT_MODE_BIT, | ||
| 255 | FTRACE_EVENT_FL_SOFT_DISABLED_BIT, | ||
| 256 | }; | ||
| 257 | |||
| 258 | /* | ||
| 259 | * Ftrace event file flags: | ||
| 260 | * ENABLED - The event is enabled | ||
| 261 | * RECORDED_CMD - The comms should be recorded at sched_switch | ||
| 262 | * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED | ||
| 263 | * SOFT_DISABLED - When set, do not trace the event (even though its | ||
| 264 | * tracepoint may be enabled) | ||
| 265 | */ | ||
| 266 | enum { | ||
| 267 | FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT), | ||
| 268 | FTRACE_EVENT_FL_RECORDED_CMD = (1 << FTRACE_EVENT_FL_RECORDED_CMD_BIT), | ||
| 269 | FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), | ||
| 270 | FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), | ||
| 271 | }; | ||
| 272 | |||
| 273 | struct ftrace_event_file { | ||
| 274 | struct list_head list; | ||
| 275 | struct ftrace_event_call *event_call; | ||
| 276 | struct dentry *dir; | ||
| 277 | struct trace_array *tr; | ||
| 278 | struct ftrace_subsystem_dir *system; | ||
| 279 | |||
| 280 | /* | ||
| 281 | * 32 bit flags: | ||
| 282 | * bit 0: enabled | ||
| 283 | * bit 1: enabled cmd record | ||
| 284 | * bit 2: enable/disable with the soft disable bit | ||
| 285 | * bit 3: soft disabled | ||
| 286 | * | ||
| 287 | * Note: The bits must be set atomically to prevent races | ||
| 288 | * from other writers. Reads of flags do not need to be in | ||
| 289 | * sync as they occur in critical sections. But the way flags | ||
| 290 | * is currently used, these changes do not affect the code | ||
| 291 | * except that when a change is made, it may have a slight | ||
| 292 | * delay in propagating the changes to other CPUs due to | ||
| 293 | * caching and such. Which is mostly OK ;-) | ||
| 294 | */ | ||
| 295 | unsigned long flags; | ||
| 296 | }; | ||
| 297 | |||
| 239 | #define __TRACE_EVENT_FLAGS(name, value) \ | 298 | #define __TRACE_EVENT_FLAGS(name, value) \ |
| 240 | static int __init trace_init_flags_##name(void) \ | 299 | static int __init trace_init_flags_##name(void) \ |
| 241 | { \ | 300 | { \ |
| @@ -274,7 +333,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type, | |||
| 274 | extern int trace_add_event_call(struct ftrace_event_call *call); | 333 | extern int trace_add_event_call(struct ftrace_event_call *call); |
| 275 | extern void trace_remove_event_call(struct ftrace_event_call *call); | 334 | extern void trace_remove_event_call(struct ftrace_event_call *call); |
| 276 | 335 | ||
| 277 | #define is_signed_type(type) (((type)(-1)) < (type)0) | 336 | #define is_signed_type(type) (((type)(-1)) < (type)1) |
| 278 | 337 | ||
| 279 | int trace_set_clr_event(const char *system, const char *event, int set); | 338 | int trace_set_clr_event(const char *system, const char *event, int set); |
| 280 | 339 | ||
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index dd7c569aacad..661d374aeb2d 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h | |||
| @@ -29,6 +29,10 @@ | |||
| 29 | 29 | ||
| 30 | #ifndef __GENALLOC_H__ | 30 | #ifndef __GENALLOC_H__ |
| 31 | #define __GENALLOC_H__ | 31 | #define __GENALLOC_H__ |
| 32 | |||
| 33 | struct device; | ||
| 34 | struct device_node; | ||
| 35 | |||
| 32 | /** | 36 | /** |
| 33 | * Allocation callback function type definition | 37 | * Allocation callback function type definition |
| 34 | * @map: Pointer to bitmap | 38 | * @map: Pointer to bitmap |
| @@ -105,4 +109,18 @@ extern unsigned long gen_pool_first_fit(unsigned long *map, unsigned long size, | |||
| 105 | extern unsigned long gen_pool_best_fit(unsigned long *map, unsigned long size, | 109 | extern unsigned long gen_pool_best_fit(unsigned long *map, unsigned long size, |
| 106 | unsigned long start, unsigned int nr, void *data); | 110 | unsigned long start, unsigned int nr, void *data); |
| 107 | 111 | ||
| 112 | extern struct gen_pool *devm_gen_pool_create(struct device *dev, | ||
| 113 | int min_alloc_order, int nid); | ||
| 114 | extern struct gen_pool *dev_get_gen_pool(struct device *dev); | ||
| 115 | |||
| 116 | #ifdef CONFIG_OF | ||
| 117 | extern struct gen_pool *of_get_named_gen_pool(struct device_node *np, | ||
| 118 | const char *propname, int index); | ||
| 119 | #else | ||
| 120 | static inline struct gen_pool *of_get_named_gen_pool(struct device_node *np, | ||
| 121 | const char *propname, int index) | ||
| 122 | { | ||
| 123 | return NULL; | ||
| 124 | } | ||
| 125 | #endif | ||
| 108 | #endif /* __GENALLOC_H__ */ | 126 | #endif /* __GENALLOC_H__ */ |
diff --git a/include/linux/hid-debug.h b/include/linux/hid-debug.h index 53744fa1c8b7..8663f216c563 100644 --- a/include/linux/hid-debug.h +++ b/include/linux/hid-debug.h | |||
| @@ -22,11 +22,12 @@ | |||
| 22 | * | 22 | * |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #define HID_DEBUG_BUFSIZE 512 | ||
| 26 | |||
| 27 | #ifdef CONFIG_DEBUG_FS | 25 | #ifdef CONFIG_DEBUG_FS |
| 28 | 26 | ||
| 27 | #define HID_DEBUG_BUFSIZE 512 | ||
| 28 | |||
| 29 | void hid_dump_input(struct hid_device *, struct hid_usage *, __s32); | 29 | void hid_dump_input(struct hid_device *, struct hid_usage *, __s32); |
| 30 | void hid_dump_report(struct hid_device *, int , u8 *, int); | ||
| 30 | void hid_dump_device(struct hid_device *, struct seq_file *); | 31 | void hid_dump_device(struct hid_device *, struct seq_file *); |
| 31 | void hid_dump_field(struct hid_field *, int, struct seq_file *); | 32 | void hid_dump_field(struct hid_field *, int, struct seq_file *); |
| 32 | char *hid_resolv_usage(unsigned, struct seq_file *); | 33 | char *hid_resolv_usage(unsigned, struct seq_file *); |
| @@ -50,6 +51,7 @@ struct hid_debug_list { | |||
| 50 | #else | 51 | #else |
| 51 | 52 | ||
| 52 | #define hid_dump_input(a,b,c) do { } while (0) | 53 | #define hid_dump_input(a,b,c) do { } while (0) |
| 54 | #define hid_dump_report(a,b,c,d) do { } while (0) | ||
| 53 | #define hid_dump_device(a,b) do { } while (0) | 55 | #define hid_dump_device(a,b) do { } while (0) |
| 54 | #define hid_dump_field(a,b,c) do { } while (0) | 56 | #define hid_dump_field(a,b,c) do { } while (0) |
| 55 | #define hid_resolv_usage(a,b) do { } while (0) | 57 | #define hid_resolv_usage(a,b) do { } while (0) |
diff --git a/include/linux/hid.h b/include/linux/hid.h index e14b465b1146..af1b86d46f6e 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -282,6 +282,7 @@ struct hid_item { | |||
| 282 | #define HID_QUIRK_BADPAD 0x00000020 | 282 | #define HID_QUIRK_BADPAD 0x00000020 |
| 283 | #define HID_QUIRK_MULTI_INPUT 0x00000040 | 283 | #define HID_QUIRK_MULTI_INPUT 0x00000040 |
| 284 | #define HID_QUIRK_HIDINPUT_FORCE 0x00000080 | 284 | #define HID_QUIRK_HIDINPUT_FORCE 0x00000080 |
| 285 | #define HID_QUIRK_NO_EMPTY_INPUT 0x00000100 | ||
| 285 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 | 286 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 |
| 286 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 | 287 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 |
| 287 | #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 | 288 | #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 |
| @@ -456,7 +457,8 @@ struct hid_device { /* device report descriptor */ | |||
| 456 | unsigned country; /* HID country */ | 457 | unsigned country; /* HID country */ |
| 457 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; | 458 | struct hid_report_enum report_enum[HID_REPORT_TYPES]; |
| 458 | 459 | ||
| 459 | struct semaphore driver_lock; /* protects the current driver */ | 460 | struct semaphore driver_lock; /* protects the current driver, except during input */ |
| 461 | struct semaphore driver_input_lock; /* protects the current driver */ | ||
| 460 | struct device dev; /* device */ | 462 | struct device dev; /* device */ |
| 461 | struct hid_driver *driver; | 463 | struct hid_driver *driver; |
| 462 | struct hid_ll_driver *ll_driver; | 464 | struct hid_ll_driver *ll_driver; |
| @@ -477,6 +479,7 @@ struct hid_device { /* device report descriptor */ | |||
| 477 | unsigned int status; /* see STAT flags above */ | 479 | unsigned int status; /* see STAT flags above */ |
| 478 | unsigned claimed; /* Claimed by hidinput, hiddev? */ | 480 | unsigned claimed; /* Claimed by hidinput, hiddev? */ |
| 479 | unsigned quirks; /* Various quirks the device can pull on us */ | 481 | unsigned quirks; /* Various quirks the device can pull on us */ |
| 482 | bool io_started; /* Protected by driver_lock. If IO has started */ | ||
| 480 | 483 | ||
| 481 | struct list_head inputs; /* The list of inputs */ | 484 | struct list_head inputs; /* The list of inputs */ |
| 482 | void *hiddev; /* The hiddev structure */ | 485 | void *hiddev; /* The hiddev structure */ |
| @@ -512,6 +515,7 @@ struct hid_device { /* device report descriptor */ | |||
| 512 | struct dentry *debug_rdesc; | 515 | struct dentry *debug_rdesc; |
| 513 | struct dentry *debug_events; | 516 | struct dentry *debug_events; |
| 514 | struct list_head debug_list; | 517 | struct list_head debug_list; |
| 518 | struct mutex debug_list_lock; | ||
| 515 | wait_queue_head_t debug_wait; | 519 | wait_queue_head_t debug_wait; |
| 516 | }; | 520 | }; |
| 517 | 521 | ||
| @@ -599,6 +603,10 @@ struct hid_usage_id { | |||
| 599 | * @resume: invoked on resume if device was not reset (NULL means nop) | 603 | * @resume: invoked on resume if device was not reset (NULL means nop) |
| 600 | * @reset_resume: invoked on resume if device was reset (NULL means nop) | 604 | * @reset_resume: invoked on resume if device was reset (NULL means nop) |
| 601 | * | 605 | * |
| 606 | * probe should return -errno on error, or 0 on success. During probe, | ||
| 607 | * input will not be passed to raw_event unless hid_device_io_start is | ||
| 608 | * called. | ||
| 609 | * | ||
| 602 | * raw_event and event should return 0 on no action performed, 1 when no | 610 | * raw_event and event should return 0 on no action performed, 1 when no |
| 603 | * further processing should be done and negative on error | 611 | * further processing should be done and negative on error |
| 604 | * | 612 | * |
| @@ -662,6 +670,9 @@ struct hid_driver { | |||
| 662 | * @hidinput_input_event: event input event (e.g. ff or leds) | 670 | * @hidinput_input_event: event input event (e.g. ff or leds) |
| 663 | * @parse: this method is called only once to parse the device data, | 671 | * @parse: this method is called only once to parse the device data, |
| 664 | * shouldn't allocate anything to not leak memory | 672 | * shouldn't allocate anything to not leak memory |
| 673 | * @request: send report request to device (e.g. feature report) | ||
| 674 | * @wait: wait for buffered io to complete (send/recv reports) | ||
| 675 | * @idle: send idle request to device | ||
| 665 | */ | 676 | */ |
| 666 | struct hid_ll_driver { | 677 | struct hid_ll_driver { |
| 667 | int (*start)(struct hid_device *hdev); | 678 | int (*start)(struct hid_device *hdev); |
| @@ -676,6 +687,13 @@ struct hid_ll_driver { | |||
| 676 | unsigned int code, int value); | 687 | unsigned int code, int value); |
| 677 | 688 | ||
| 678 | int (*parse)(struct hid_device *hdev); | 689 | int (*parse)(struct hid_device *hdev); |
| 690 | |||
| 691 | void (*request)(struct hid_device *hdev, | ||
| 692 | struct hid_report *report, int reqtype); | ||
| 693 | |||
| 694 | int (*wait)(struct hid_device *hdev); | ||
| 695 | int (*idle)(struct hid_device *hdev, int report, int idle, int reqtype); | ||
| 696 | |||
| 679 | }; | 697 | }; |
| 680 | 698 | ||
| 681 | #define PM_HINT_FULLON 1<<5 | 699 | #define PM_HINT_FULLON 1<<5 |
| @@ -738,6 +756,44 @@ const struct hid_device_id *hid_match_id(struct hid_device *hdev, | |||
| 738 | s32 hid_snto32(__u32 value, unsigned n); | 756 | s32 hid_snto32(__u32 value, unsigned n); |
| 739 | 757 | ||
| 740 | /** | 758 | /** |
| 759 | * hid_device_io_start - enable HID input during probe, remove | ||
| 760 | * | ||
| 761 | * @hid - the device | ||
| 762 | * | ||
| 763 | * This should only be called during probe or remove and only be | ||
| 764 | * called by the thread calling probe or remove. It will allow | ||
| 765 | * incoming packets to be delivered to the driver. | ||
| 766 | */ | ||
| 767 | static inline void hid_device_io_start(struct hid_device *hid) { | ||
| 768 | if (hid->io_started) { | ||
| 769 | dev_warn(&hid->dev, "io already started"); | ||
| 770 | return; | ||
| 771 | } | ||
| 772 | hid->io_started = true; | ||
| 773 | up(&hid->driver_input_lock); | ||
| 774 | } | ||
| 775 | |||
| 776 | /** | ||
| 777 | * hid_device_io_stop - disable HID input during probe, remove | ||
| 778 | * | ||
| 779 | * @hid - the device | ||
| 780 | * | ||
| 781 | * Should only be called after hid_device_io_start. It will prevent | ||
| 782 | * incoming packets from going to the driver for the duration of | ||
| 783 | * probe, remove. If called during probe, packets will still go to the | ||
| 784 | * driver after probe is complete. This function should only be called | ||
| 785 | * by the thread calling probe or remove. | ||
| 786 | */ | ||
| 787 | static inline void hid_device_io_stop(struct hid_device *hid) { | ||
| 788 | if (!hid->io_started) { | ||
| 789 | dev_warn(&hid->dev, "io already stopped"); | ||
| 790 | return; | ||
| 791 | } | ||
| 792 | hid->io_started = false; | ||
| 793 | down(&hid->driver_input_lock); | ||
| 794 | } | ||
| 795 | |||
| 796 | /** | ||
| 741 | * hid_map_usage - map usage input bits | 797 | * hid_map_usage - map usage input bits |
| 742 | * | 798 | * |
| 743 | * @hidinput: hidinput which we are interested in | 799 | * @hidinput: hidinput which we are interested in |
| @@ -883,6 +939,49 @@ static inline int hid_hw_power(struct hid_device *hdev, int level) | |||
| 883 | return hdev->ll_driver->power ? hdev->ll_driver->power(hdev, level) : 0; | 939 | return hdev->ll_driver->power ? hdev->ll_driver->power(hdev, level) : 0; |
| 884 | } | 940 | } |
| 885 | 941 | ||
| 942 | |||
| 943 | /** | ||
| 944 | * hid_hw_request - send report request to device | ||
| 945 | * | ||
| 946 | * @hdev: hid device | ||
| 947 | * @report: report to send | ||
| 948 | * @reqtype: hid request type | ||
| 949 | */ | ||
| 950 | static inline void hid_hw_request(struct hid_device *hdev, | ||
| 951 | struct hid_report *report, int reqtype) | ||
| 952 | { | ||
| 953 | if (hdev->ll_driver->request) | ||
| 954 | hdev->ll_driver->request(hdev, report, reqtype); | ||
| 955 | } | ||
| 956 | |||
| 957 | /** | ||
| 958 | * hid_hw_idle - send idle request to device | ||
| 959 | * | ||
| 960 | * @hdev: hid device | ||
| 961 | * @report: report to control | ||
| 962 | * @idle: idle state | ||
| 963 | * @reqtype: hid request type | ||
| 964 | */ | ||
| 965 | static inline int hid_hw_idle(struct hid_device *hdev, int report, int idle, | ||
| 966 | int reqtype) | ||
| 967 | { | ||
| 968 | if (hdev->ll_driver->idle) | ||
| 969 | return hdev->ll_driver->idle(hdev, report, idle, reqtype); | ||
| 970 | |||
| 971 | return 0; | ||
| 972 | } | ||
| 973 | |||
| 974 | /** | ||
| 975 | * hid_hw_wait - wait for buffered io to complete | ||
| 976 | * | ||
| 977 | * @hdev: hid device | ||
| 978 | */ | ||
| 979 | static inline void hid_hw_wait(struct hid_device *hdev) | ||
| 980 | { | ||
| 981 | if (hdev->ll_driver->wait) | ||
| 982 | hdev->ll_driver->wait(hdev); | ||
| 983 | } | ||
| 984 | |||
| 886 | int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | 985 | int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, |
| 887 | int interrupt); | 986 | int interrupt); |
| 888 | 987 | ||
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index cc07d2777bbe..d19a5c2d2270 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
| @@ -157,6 +157,7 @@ enum hrtimer_base_type { | |||
| 157 | HRTIMER_BASE_MONOTONIC, | 157 | HRTIMER_BASE_MONOTONIC, |
| 158 | HRTIMER_BASE_REALTIME, | 158 | HRTIMER_BASE_REALTIME, |
| 159 | HRTIMER_BASE_BOOTTIME, | 159 | HRTIMER_BASE_BOOTTIME, |
| 160 | HRTIMER_BASE_TAI, | ||
| 160 | HRTIMER_MAX_CLOCK_BASES, | 161 | HRTIMER_MAX_CLOCK_BASES, |
| 161 | }; | 162 | }; |
| 162 | 163 | ||
| @@ -327,7 +328,9 @@ extern ktime_t ktime_get(void); | |||
| 327 | extern ktime_t ktime_get_real(void); | 328 | extern ktime_t ktime_get_real(void); |
| 328 | extern ktime_t ktime_get_boottime(void); | 329 | extern ktime_t ktime_get_boottime(void); |
| 329 | extern ktime_t ktime_get_monotonic_offset(void); | 330 | extern ktime_t ktime_get_monotonic_offset(void); |
| 330 | extern ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot); | 331 | extern ktime_t ktime_get_clocktai(void); |
| 332 | extern ktime_t ktime_get_update_offsets(ktime_t *offs_real, ktime_t *offs_boot, | ||
| 333 | ktime_t *offs_tai); | ||
| 331 | 334 | ||
| 332 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); | 335 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); |
| 333 | 336 | ||
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index ee1c244a62a1..528454c2caa9 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
| @@ -99,7 +99,11 @@ extern int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, | |||
| 99 | extern int handle_pte_fault(struct mm_struct *mm, | 99 | extern int handle_pte_fault(struct mm_struct *mm, |
| 100 | struct vm_area_struct *vma, unsigned long address, | 100 | struct vm_area_struct *vma, unsigned long address, |
| 101 | pte_t *pte, pmd_t *pmd, unsigned int flags); | 101 | pte_t *pte, pmd_t *pmd, unsigned int flags); |
| 102 | extern int split_huge_page(struct page *page); | 102 | extern int split_huge_page_to_list(struct page *page, struct list_head *list); |
| 103 | static inline int split_huge_page(struct page *page) | ||
| 104 | { | ||
| 105 | return split_huge_page_to_list(page, NULL); | ||
| 106 | } | ||
| 103 | extern void __split_huge_page_pmd(struct vm_area_struct *vma, | 107 | extern void __split_huge_page_pmd(struct vm_area_struct *vma, |
| 104 | unsigned long address, pmd_t *pmd); | 108 | unsigned long address, pmd_t *pmd); |
| 105 | #define split_huge_page_pmd(__vma, __address, __pmd) \ | 109 | #define split_huge_page_pmd(__vma, __address, __pmd) \ |
| @@ -186,6 +190,11 @@ extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vm | |||
| 186 | #define transparent_hugepage_enabled(__vma) 0 | 190 | #define transparent_hugepage_enabled(__vma) 0 |
| 187 | 191 | ||
| 188 | #define transparent_hugepage_flags 0UL | 192 | #define transparent_hugepage_flags 0UL |
| 193 | static inline int | ||
| 194 | split_huge_page_to_list(struct page *page, struct list_head *list) | ||
| 195 | { | ||
| 196 | return 0; | ||
| 197 | } | ||
| 189 | static inline int split_huge_page(struct page *page) | 198 | static inline int split_huge_page(struct page *page) |
| 190 | { | 199 | { |
| 191 | return 0; | 200 | return 0; |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 16e4e9a643fb..3a62df310f2e 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -58,6 +58,7 @@ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, | |||
| 58 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); | 58 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); |
| 59 | void hugetlb_report_meminfo(struct seq_file *); | 59 | void hugetlb_report_meminfo(struct seq_file *); |
| 60 | int hugetlb_report_node_meminfo(int, char *); | 60 | int hugetlb_report_node_meminfo(int, char *); |
| 61 | void hugetlb_show_meminfo(void); | ||
| 61 | unsigned long hugetlb_total_pages(void); | 62 | unsigned long hugetlb_total_pages(void); |
| 62 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 63 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
| 63 | unsigned long address, unsigned int flags); | 64 | unsigned long address, unsigned int flags); |
| @@ -114,6 +115,9 @@ static inline void hugetlb_report_meminfo(struct seq_file *m) | |||
| 114 | { | 115 | { |
| 115 | } | 116 | } |
| 116 | #define hugetlb_report_node_meminfo(n, buf) 0 | 117 | #define hugetlb_report_node_meminfo(n, buf) 0 |
| 118 | static inline void hugetlb_show_meminfo(void) | ||
| 119 | { | ||
| 120 | } | ||
| 117 | #define follow_huge_pmd(mm, addr, pmd, write) NULL | 121 | #define follow_huge_pmd(mm, addr, pmd, write) NULL |
| 118 | #define follow_huge_pud(mm, addr, pud, write) NULL | 122 | #define follow_huge_pud(mm, addr, pud, write) NULL |
| 119 | #define prepare_hugepage_range(file, addr, len) (-EINVAL) | 123 | #define prepare_hugepage_range(file, addr, len) (-EINVAL) |
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index df77ba9a8166..c2559847d7ee 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
| @@ -27,6 +27,63 @@ | |||
| 27 | 27 | ||
| 28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
| 29 | 29 | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Implementation of host controlled snapshot of the guest. | ||
| 33 | */ | ||
| 34 | |||
| 35 | #define VSS_OP_REGISTER 128 | ||
| 36 | |||
| 37 | enum hv_vss_op { | ||
| 38 | VSS_OP_CREATE = 0, | ||
| 39 | VSS_OP_DELETE, | ||
| 40 | VSS_OP_HOT_BACKUP, | ||
| 41 | VSS_OP_GET_DM_INFO, | ||
| 42 | VSS_OP_BU_COMPLETE, | ||
| 43 | /* | ||
| 44 | * Following operations are only supported with IC version >= 5.0 | ||
| 45 | */ | ||
| 46 | VSS_OP_FREEZE, /* Freeze the file systems in the VM */ | ||
| 47 | VSS_OP_THAW, /* Unfreeze the file systems */ | ||
| 48 | VSS_OP_AUTO_RECOVER, | ||
| 49 | VSS_OP_COUNT /* Number of operations, must be last */ | ||
| 50 | }; | ||
| 51 | |||
| 52 | |||
| 53 | /* | ||
| 54 | * Header for all VSS messages. | ||
| 55 | */ | ||
| 56 | struct hv_vss_hdr { | ||
| 57 | __u8 operation; | ||
| 58 | __u8 reserved[7]; | ||
| 59 | } __attribute__((packed)); | ||
| 60 | |||
| 61 | |||
| 62 | /* | ||
| 63 | * Flag values for the hv_vss_check_feature. Linux supports only | ||
| 64 | * one value. | ||
| 65 | */ | ||
| 66 | #define VSS_HBU_NO_AUTO_RECOVERY 0x00000005 | ||
| 67 | |||
| 68 | struct hv_vss_check_feature { | ||
| 69 | __u32 flags; | ||
| 70 | } __attribute__((packed)); | ||
| 71 | |||
| 72 | struct hv_vss_check_dm_info { | ||
| 73 | __u32 flags; | ||
| 74 | } __attribute__((packed)); | ||
| 75 | |||
| 76 | struct hv_vss_msg { | ||
| 77 | union { | ||
| 78 | struct hv_vss_hdr vss_hdr; | ||
| 79 | int error; | ||
| 80 | }; | ||
| 81 | union { | ||
| 82 | struct hv_vss_check_feature vss_cf; | ||
| 83 | struct hv_vss_check_dm_info dm_info; | ||
| 84 | }; | ||
| 85 | } __attribute__((packed)); | ||
| 86 | |||
| 30 | /* | 87 | /* |
| 31 | * An implementation of HyperV key value pair (KVP) functionality for Linux. | 88 | * An implementation of HyperV key value pair (KVP) functionality for Linux. |
| 32 | * | 89 | * |
| @@ -1253,6 +1310,25 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver); | |||
| 1253 | } | 1310 | } |
| 1254 | 1311 | ||
| 1255 | /* | 1312 | /* |
| 1313 | * VSS (Backup/Restore) GUID | ||
| 1314 | */ | ||
| 1315 | #define HV_VSS_GUID \ | ||
| 1316 | .guid = { \ | ||
| 1317 | 0x29, 0x2e, 0xfa, 0x35, 0x23, 0xea, 0x36, 0x42, \ | ||
| 1318 | 0x96, 0xae, 0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40 \ | ||
| 1319 | } | ||
| 1320 | /* | ||
| 1321 | * Synthetic Video GUID | ||
| 1322 | * {DA0A7802-E377-4aac-8E77-0558EB1073F8} | ||
| 1323 | */ | ||
| 1324 | #define HV_SYNTHVID_GUID \ | ||
| 1325 | .guid = { \ | ||
| 1326 | 0x02, 0x78, 0x0a, 0xda, 0x77, 0xe3, 0xac, 0x4a, \ | ||
| 1327 | 0x8e, 0x77, 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8 \ | ||
| 1328 | } | ||
| 1329 | |||
| 1330 | |||
| 1331 | /* | ||
| 1256 | * Common header for Hyper-V ICs | 1332 | * Common header for Hyper-V ICs |
| 1257 | */ | 1333 | */ |
| 1258 | 1334 | ||
| @@ -1356,6 +1432,10 @@ int hv_kvp_init(struct hv_util_service *); | |||
| 1356 | void hv_kvp_deinit(void); | 1432 | void hv_kvp_deinit(void); |
| 1357 | void hv_kvp_onchannelcallback(void *); | 1433 | void hv_kvp_onchannelcallback(void *); |
| 1358 | 1434 | ||
| 1435 | int hv_vss_init(struct hv_util_service *); | ||
| 1436 | void hv_vss_deinit(void); | ||
| 1437 | void hv_vss_onchannelcallback(void *); | ||
| 1438 | |||
| 1359 | /* | 1439 | /* |
| 1360 | * Negotiated version with the Host. | 1440 | * Negotiated version with the Host. |
| 1361 | */ | 1441 | */ |
diff --git a/include/linux/idr.h b/include/linux/idr.h index 2640c7e99e51..a470ac3ef49d 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
| @@ -42,6 +42,7 @@ struct idr { | |||
| 42 | struct idr_layer *id_free; | 42 | struct idr_layer *id_free; |
| 43 | int layers; /* only valid w/o concurrent changes */ | 43 | int layers; /* only valid w/o concurrent changes */ |
| 44 | int id_free_cnt; | 44 | int id_free_cnt; |
| 45 | int cur; /* current pos for cyclic allocation */ | ||
| 45 | spinlock_t lock; | 46 | spinlock_t lock; |
| 46 | }; | 47 | }; |
| 47 | 48 | ||
| @@ -75,6 +76,7 @@ struct idr { | |||
| 75 | void *idr_find_slowpath(struct idr *idp, int id); | 76 | void *idr_find_slowpath(struct idr *idp, int id); |
| 76 | void idr_preload(gfp_t gfp_mask); | 77 | void idr_preload(gfp_t gfp_mask); |
| 77 | int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask); | 78 | int idr_alloc(struct idr *idp, void *ptr, int start, int end, gfp_t gfp_mask); |
| 79 | int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, gfp_t gfp_mask); | ||
| 78 | int idr_for_each(struct idr *idp, | 80 | int idr_for_each(struct idr *idp, |
| 79 | int (*fn)(int id, void *p, void *data), void *data); | 81 | int (*fn)(int id, void *p, void *data), void *data); |
| 80 | void *idr_get_next(struct idr *idp, int *nextid); | 82 | void *idr_get_next(struct idr *idp, int *nextid); |
diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h index 2e4eab9868a3..e7fdec4db9da 100644 --- a/include/linux/iio/adc/ad_sigma_delta.h +++ b/include/linux/iio/adc/ad_sigma_delta.h | |||
| @@ -133,9 +133,9 @@ int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig); | |||
| 133 | .channel2 = (_channel2), \ | 133 | .channel2 = (_channel2), \ |
| 134 | .address = (_address), \ | 134 | .address = (_address), \ |
| 135 | .extend_name = (_extend_name), \ | 135 | .extend_name = (_extend_name), \ |
| 136 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 136 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
| 137 | IIO_CHAN_INFO_SCALE_SHARED_BIT | \ | 137 | BIT(IIO_CHAN_INFO_OFFSET), \ |
| 138 | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \ | 138 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ |
| 139 | .scan_index = (_si), \ | 139 | .scan_index = (_si), \ |
| 140 | .scan_type = { \ | 140 | .scan_type = { \ |
| 141 | .sign = 'u', \ | 141 | .sign = 'u', \ |
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index 8bd12be0b02f..172c5b23cb84 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/spi/spi.h> | 15 | #include <linux/spi/spi.h> |
| 16 | #include <linux/irqreturn.h> | 16 | #include <linux/irqreturn.h> |
| 17 | #include <linux/iio/trigger.h> | 17 | #include <linux/iio/trigger.h> |
| 18 | #include <linux/bitops.h> | ||
| 18 | 19 | ||
| 19 | #define ST_SENSORS_TX_MAX_LENGTH 2 | 20 | #define ST_SENSORS_TX_MAX_LENGTH 2 |
| 20 | #define ST_SENSORS_RX_MAX_LENGTH 6 | 21 | #define ST_SENSORS_RX_MAX_LENGTH 6 |
| @@ -45,8 +46,8 @@ | |||
| 45 | { \ | 46 | { \ |
| 46 | .type = device_type, \ | 47 | .type = device_type, \ |
| 47 | .modified = 1, \ | 48 | .modified = 1, \ |
| 48 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 49 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
| 49 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ | 50 | BIT(IIO_CHAN_INFO_SCALE), \ |
| 50 | .scan_index = index, \ | 51 | .scan_index = index, \ |
| 51 | .channel2 = mod, \ | 52 | .channel2 = mod, \ |
| 52 | .address = addr, \ | 53 | .address = addr, \ |
diff --git a/include/linux/iio/gyro/itg3200.h b/include/linux/iio/gyro/itg3200.h index c53f16914b77..2a820850f284 100644 --- a/include/linux/iio/gyro/itg3200.h +++ b/include/linux/iio/gyro/itg3200.h | |||
| @@ -149,6 +149,6 @@ static inline void itg3200_buffer_unconfigure(struct iio_dev *indio_dev) | |||
| 149 | { | 149 | { |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | #endif /* CONFIG_IIO_RING_BUFFER */ | 152 | #endif /* CONFIG_IIO_BUFFER */ |
| 153 | 153 | ||
| 154 | #endif /* ITG3200_H_ */ | 154 | #endif /* ITG3200_H_ */ |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index da8c776ba0bd..8d171f427632 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
| @@ -38,76 +38,6 @@ enum iio_chan_info_enum { | |||
| 38 | IIO_CHAN_INFO_HYSTERESIS, | 38 | IIO_CHAN_INFO_HYSTERESIS, |
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | #define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2) | ||
| 42 | #define IIO_CHAN_INFO_SEPARATE_BIT(type) BIT(type*2 + 1) | ||
| 43 | #define IIO_CHAN_INFO_BITS(type) (IIO_CHAN_INFO_SHARED_BIT(type) | \ | ||
| 44 | IIO_CHAN_INFO_SEPARATE_BIT(type)) | ||
| 45 | |||
| 46 | #define IIO_CHAN_INFO_RAW_SEPARATE_BIT \ | ||
| 47 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_RAW) | ||
| 48 | #define IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT \ | ||
| 49 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PROCESSED) | ||
| 50 | #define IIO_CHAN_INFO_SCALE_SEPARATE_BIT \ | ||
| 51 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_SCALE) | ||
| 52 | #define IIO_CHAN_INFO_SCALE_SHARED_BIT \ | ||
| 53 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_SCALE) | ||
| 54 | #define IIO_CHAN_INFO_OFFSET_SEPARATE_BIT \ | ||
| 55 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_OFFSET) | ||
| 56 | #define IIO_CHAN_INFO_OFFSET_SHARED_BIT \ | ||
| 57 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_OFFSET) | ||
| 58 | #define IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT \ | ||
| 59 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_CALIBSCALE) | ||
| 60 | #define IIO_CHAN_INFO_CALIBSCALE_SHARED_BIT \ | ||
| 61 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_CALIBSCALE) | ||
| 62 | #define IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT \ | ||
| 63 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_CALIBBIAS) | ||
| 64 | #define IIO_CHAN_INFO_CALIBBIAS_SHARED_BIT \ | ||
| 65 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_CALIBBIAS) | ||
| 66 | #define IIO_CHAN_INFO_PEAK_SEPARATE_BIT \ | ||
| 67 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PEAK) | ||
| 68 | #define IIO_CHAN_INFO_PEAK_SHARED_BIT \ | ||
| 69 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_PEAK) | ||
| 70 | #define IIO_CHAN_INFO_PEAKSCALE_SEPARATE_BIT \ | ||
| 71 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PEAKSCALE) | ||
| 72 | #define IIO_CHAN_INFO_PEAKSCALE_SHARED_BIT \ | ||
| 73 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_PEAKSCALE) | ||
| 74 | #define IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE_BIT \ | ||
| 75 | IIO_CHAN_INFO_SEPARATE_BIT( \ | ||
| 76 | IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW) | ||
| 77 | #define IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SHARED_BIT \ | ||
| 78 | IIO_CHAN_INFO_SHARED_BIT( \ | ||
| 79 | IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW) | ||
| 80 | #define IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_BIT \ | ||
| 81 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_AVERAGE_RAW) | ||
| 82 | #define IIO_CHAN_INFO_AVERAGE_RAW_SHARED_BIT \ | ||
| 83 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_AVERAGE_RAW) | ||
| 84 | #define IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SHARED_BIT \ | ||
| 85 | IIO_CHAN_INFO_SHARED_BIT( \ | ||
| 86 | IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY) | ||
| 87 | #define IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SEPARATE_BIT \ | ||
| 88 | IIO_CHAN_INFO_SEPARATE_BIT( \ | ||
| 89 | IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY) | ||
| 90 | #define IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT \ | ||
| 91 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_SAMP_FREQ) | ||
| 92 | #define IIO_CHAN_INFO_SAMP_FREQ_SHARED_BIT \ | ||
| 93 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_SAMP_FREQ) | ||
| 94 | #define IIO_CHAN_INFO_FREQUENCY_SEPARATE_BIT \ | ||
| 95 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_FREQUENCY) | ||
| 96 | #define IIO_CHAN_INFO_FREQUENCY_SHARED_BIT \ | ||
| 97 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_FREQUENCY) | ||
| 98 | #define IIO_CHAN_INFO_PHASE_SEPARATE_BIT \ | ||
| 99 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_PHASE) | ||
| 100 | #define IIO_CHAN_INFO_PHASE_SHARED_BIT \ | ||
| 101 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_PHASE) | ||
| 102 | #define IIO_CHAN_INFO_HARDWAREGAIN_SEPARATE_BIT \ | ||
| 103 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HARDWAREGAIN) | ||
| 104 | #define IIO_CHAN_INFO_HARDWAREGAIN_SHARED_BIT \ | ||
| 105 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HARDWAREGAIN) | ||
| 106 | #define IIO_CHAN_INFO_HYSTERESIS_SEPARATE_BIT \ | ||
| 107 | IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_HYSTERESIS) | ||
| 108 | #define IIO_CHAN_INFO_HYSTERESIS_SHARED_BIT \ | ||
| 109 | IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_HYSTERESIS) | ||
| 110 | |||
| 111 | enum iio_endian { | 41 | enum iio_endian { |
| 112 | IIO_CPU, | 42 | IIO_CPU, |
| 113 | IIO_BE, | 43 | IIO_BE, |
| @@ -218,6 +148,10 @@ ssize_t iio_enum_write(struct iio_dev *indio_dev, | |||
| 218 | * endianness: little or big endian | 148 | * endianness: little or big endian |
| 219 | * @info_mask: What information is to be exported about this channel. | 149 | * @info_mask: What information is to be exported about this channel. |
| 220 | * This includes calibbias, scale etc. | 150 | * This includes calibbias, scale etc. |
| 151 | * @info_mask_separate: What information is to be exported that is specific to | ||
| 152 | * this channel. | ||
| 153 | * @info_mask_shared_by_type: What information is to be exported that is shared | ||
| 154 | * by all channels of the same type. | ||
| 221 | * @event_mask: What events can this channel produce. | 155 | * @event_mask: What events can this channel produce. |
| 222 | * @ext_info: Array of extended info attributes for this channel. | 156 | * @ext_info: Array of extended info attributes for this channel. |
| 223 | * The array is NULL terminated, the last element should | 157 | * The array is NULL terminated, the last element should |
| @@ -253,6 +187,8 @@ struct iio_chan_spec { | |||
| 253 | enum iio_endian endianness; | 187 | enum iio_endian endianness; |
| 254 | } scan_type; | 188 | } scan_type; |
| 255 | long info_mask; | 189 | long info_mask; |
| 190 | long info_mask_separate; | ||
| 191 | long info_mask_shared_by_type; | ||
| 256 | long event_mask; | 192 | long event_mask; |
| 257 | const struct iio_chan_spec_ext_info *ext_info; | 193 | const struct iio_chan_spec_ext_info *ext_info; |
| 258 | const char *extend_name; | 194 | const char *extend_name; |
| @@ -275,7 +211,8 @@ struct iio_chan_spec { | |||
| 275 | static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, | 211 | static inline bool iio_channel_has_info(const struct iio_chan_spec *chan, |
| 276 | enum iio_chan_info_enum type) | 212 | enum iio_chan_info_enum type) |
| 277 | { | 213 | { |
| 278 | return chan->info_mask & IIO_CHAN_INFO_BITS(type); | 214 | return (chan->info_mask_separate & type) | |
| 215 | (chan->info_mask_shared_by_type & type); | ||
| 279 | } | 216 | } |
| 280 | 217 | ||
| 281 | #define IIO_ST(si, rb, sb, sh) \ | 218 | #define IIO_ST(si, rb, sb, sh) \ |
diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h index ff781dca2e9a..b665dc7f017b 100644 --- a/include/linux/iio/imu/adis.h +++ b/include/linux/iio/imu/adis.h | |||
| @@ -162,8 +162,8 @@ int adis_single_conversion(struct iio_dev *indio_dev, | |||
| 162 | .indexed = 1, \ | 162 | .indexed = 1, \ |
| 163 | .channel = (chan), \ | 163 | .channel = (chan), \ |
| 164 | .extend_name = name, \ | 164 | .extend_name = name, \ |
| 165 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 165 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
| 166 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ | 166 | BIT(IIO_CHAN_INFO_SCALE), \ |
| 167 | .address = (addr), \ | 167 | .address = (addr), \ |
| 168 | .scan_index = (si), \ | 168 | .scan_index = (si), \ |
| 169 | .scan_type = { \ | 169 | .scan_type = { \ |
| @@ -184,9 +184,9 @@ int adis_single_conversion(struct iio_dev *indio_dev, | |||
| 184 | .type = IIO_TEMP, \ | 184 | .type = IIO_TEMP, \ |
| 185 | .indexed = 1, \ | 185 | .indexed = 1, \ |
| 186 | .channel = 0, \ | 186 | .channel = 0, \ |
| 187 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 187 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
| 188 | IIO_CHAN_INFO_SCALE_SEPARATE_BIT | \ | 188 | BIT(IIO_CHAN_INFO_SCALE) | \ |
| 189 | IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \ | 189 | BIT(IIO_CHAN_INFO_OFFSET), \ |
| 190 | .address = (addr), \ | 190 | .address = (addr), \ |
| 191 | .scan_index = (si), \ | 191 | .scan_index = (si), \ |
| 192 | .scan_type = { \ | 192 | .scan_type = { \ |
| @@ -197,13 +197,13 @@ int adis_single_conversion(struct iio_dev *indio_dev, | |||
| 197 | }, \ | 197 | }, \ |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | #define ADIS_MOD_CHAN(_type, mod, addr, si, info, bits) { \ | 200 | #define ADIS_MOD_CHAN(_type, mod, addr, si, info_sep, bits) { \ |
| 201 | .type = (_type), \ | 201 | .type = (_type), \ |
| 202 | .modified = 1, \ | 202 | .modified = 1, \ |
| 203 | .channel2 = IIO_MOD_ ## mod, \ | 203 | .channel2 = IIO_MOD_ ## mod, \ |
| 204 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ | 204 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ |
| 205 | IIO_CHAN_INFO_SCALE_SHARED_BIT | \ | 205 | info_sep, \ |
| 206 | info, \ | 206 | .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ |
| 207 | .address = (addr), \ | 207 | .address = (addr), \ |
| 208 | .scan_index = (si), \ | 208 | .scan_index = (si), \ |
| 209 | .scan_type = { \ | 209 | .scan_type = { \ |
| @@ -214,17 +214,17 @@ int adis_single_conversion(struct iio_dev *indio_dev, | |||
| 214 | }, \ | 214 | }, \ |
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | #define ADIS_ACCEL_CHAN(mod, addr, si, info, bits) \ | 217 | #define ADIS_ACCEL_CHAN(mod, addr, si, info_sep, bits) \ |
| 218 | ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info, bits) | 218 | ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info_sep, bits) |
| 219 | 219 | ||
| 220 | #define ADIS_GYRO_CHAN(mod, addr, si, info, bits) \ | 220 | #define ADIS_GYRO_CHAN(mod, addr, si, info_sep, bits) \ |
| 221 | ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info, bits) | 221 | ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info_sep, bits) |
| 222 | 222 | ||
| 223 | #define ADIS_INCLI_CHAN(mod, addr, si, info, bits) \ | 223 | #define ADIS_INCLI_CHAN(mod, addr, si, info_sep, bits) \ |
| 224 | ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info, bits) | 224 | ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info_sep, bits) |
| 225 | 225 | ||
| 226 | #define ADIS_ROT_CHAN(mod, addr, si, info, bits) \ | 226 | #define ADIS_ROT_CHAN(mod, addr, si, info_sep, bits) \ |
| 227 | ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info, bits) | 227 | ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info_sep, bits) |
| 228 | 228 | ||
| 229 | #ifdef CONFIG_IIO_ADIS_LIB_BUFFER | 229 | #ifdef CONFIG_IIO_ADIS_LIB_BUFFER |
| 230 | 230 | ||
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index c66e0a96f6e8..3869c525b052 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h | |||
| @@ -44,7 +44,6 @@ struct iio_trigger_ops { | |||
| 44 | * @id: [INTERN] unique id number | 44 | * @id: [INTERN] unique id number |
| 45 | * @name: [DRIVER] unique name | 45 | * @name: [DRIVER] unique name |
| 46 | * @dev: [DRIVER] associated device (if relevant) | 46 | * @dev: [DRIVER] associated device (if relevant) |
| 47 | * @private_data: [DRIVER] device specific data | ||
| 48 | * @list: [INTERN] used in maintenance of global trigger list | 47 | * @list: [INTERN] used in maintenance of global trigger list |
| 49 | * @alloc_list: [DRIVER] used for driver specific trigger list | 48 | * @alloc_list: [DRIVER] used for driver specific trigger list |
| 50 | * @use_count: use count for the trigger | 49 | * @use_count: use count for the trigger |
| @@ -60,7 +59,6 @@ struct iio_trigger { | |||
| 60 | const char *name; | 59 | const char *name; |
| 61 | struct device dev; | 60 | struct device dev; |
| 62 | 61 | ||
| 63 | void *private_data; | ||
| 64 | struct list_head list; | 62 | struct list_head list; |
| 65 | struct list_head alloc_list; | 63 | struct list_head alloc_list; |
| 66 | int use_count; | 64 | int use_count; |
| @@ -92,6 +90,30 @@ static inline void iio_trigger_get(struct iio_trigger *trig) | |||
| 92 | } | 90 | } |
| 93 | 91 | ||
| 94 | /** | 92 | /** |
| 93 | * iio_device_set_drvdata() - Set trigger driver data | ||
| 94 | * @trig: IIO trigger structure | ||
| 95 | * @data: Driver specific data | ||
| 96 | * | ||
| 97 | * Allows to attach an arbitrary pointer to an IIO trigger, which can later be | ||
| 98 | * retrieved by iio_trigger_get_drvdata(). | ||
| 99 | */ | ||
| 100 | static inline void iio_trigger_set_drvdata(struct iio_trigger *trig, void *data) | ||
| 101 | { | ||
| 102 | dev_set_drvdata(&trig->dev, data); | ||
| 103 | } | ||
| 104 | |||
| 105 | /** | ||
| 106 | * iio_trigger_get_drvdata() - Get trigger driver data | ||
| 107 | * @trig: IIO trigger structure | ||
| 108 | * | ||
| 109 | * Returns the data previously set with iio_trigger_set_drvdata() | ||
| 110 | */ | ||
| 111 | static inline void *iio_trigger_get_drvdata(struct iio_trigger *trig) | ||
| 112 | { | ||
| 113 | return dev_get_drvdata(&trig->dev); | ||
| 114 | } | ||
| 115 | |||
| 116 | /** | ||
| 95 | * iio_trigger_register() - register a trigger with the IIO core | 117 | * iio_trigger_register() - register a trigger with the IIO core |
| 96 | * @trig_info: trigger to be registered | 118 | * @trig_info: trigger to be registered |
| 97 | **/ | 119 | **/ |
diff --git a/include/linux/ima.h b/include/linux/ima.h index 86c361e947b9..1b7f268cddce 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h | |||
| @@ -46,7 +46,7 @@ static inline int ima_module_check(struct file *file) | |||
| 46 | return 0; | 46 | return 0; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | #endif /* CONFIG_IMA_H */ | 49 | #endif /* CONFIG_IMA */ |
| 50 | 50 | ||
| 51 | #ifdef CONFIG_IMA_APPRAISE | 51 | #ifdef CONFIG_IMA_APPRAISE |
| 52 | extern void ima_inode_post_setattr(struct dentry *dentry); | 52 | extern void ima_inode_post_setattr(struct dentry *dentry); |
| @@ -72,5 +72,5 @@ static inline int ima_inode_removexattr(struct dentry *dentry, | |||
| 72 | { | 72 | { |
| 73 | return 0; | 73 | return 0; |
| 74 | } | 74 | } |
| 75 | #endif /* CONFIG_IMA_APPRAISE_H */ | 75 | #endif /* CONFIG_IMA_APPRAISE */ |
| 76 | #endif /* _LINUX_IMA_H */ | 76 | #endif /* _LINUX_IMA_H */ |
diff --git a/include/linux/integrity.h b/include/linux/integrity.h index 66c5fe9550a5..83222cebd47b 100644 --- a/include/linux/integrity.h +++ b/include/linux/integrity.h | |||
| @@ -36,5 +36,5 @@ static inline void integrity_inode_free(struct inode *inode) | |||
| 36 | { | 36 | { |
| 37 | return; | 37 | return; |
| 38 | } | 38 | } |
| 39 | #endif /* CONFIG_INTEGRITY_H */ | 39 | #endif /* CONFIG_INTEGRITY */ |
| 40 | #endif /* _LINUX_INTEGRITY_H */ | 40 | #endif /* _LINUX_INTEGRITY_H */ |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 85ac9b9b72a2..89b7c24a36e9 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
| @@ -192,6 +192,10 @@ extern struct resource * __request_region(struct resource *, | |||
| 192 | extern int __check_region(struct resource *, resource_size_t, resource_size_t); | 192 | extern int __check_region(struct resource *, resource_size_t, resource_size_t); |
| 193 | extern void __release_region(struct resource *, resource_size_t, | 193 | extern void __release_region(struct resource *, resource_size_t, |
| 194 | resource_size_t); | 194 | resource_size_t); |
| 195 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
| 196 | extern int release_mem_region_adjustable(struct resource *, resource_size_t, | ||
| 197 | resource_size_t); | ||
| 198 | #endif | ||
| 195 | 199 | ||
| 196 | static inline int __deprecated check_region(resource_size_t s, | 200 | static inline int __deprecated check_region(resource_size_t s, |
| 197 | resource_size_t n) | 201 | resource_size_t n) |
diff --git a/include/linux/ipack.h b/include/linux/ipack.h index fea12cbb2aeb..1888e06ddf64 100644 --- a/include/linux/ipack.h +++ b/include/linux/ipack.h | |||
| @@ -207,19 +207,41 @@ int ipack_driver_register(struct ipack_driver *edrv, struct module *owner, | |||
| 207 | void ipack_driver_unregister(struct ipack_driver *edrv); | 207 | void ipack_driver_unregister(struct ipack_driver *edrv); |
| 208 | 208 | ||
| 209 | /** | 209 | /** |
| 210 | * ipack_device_register -- register an IPack device with the kernel | 210 | * ipack_device_init -- initialize an IPack device |
| 211 | * @dev: the new device to register. | 211 | * @dev: the new device to initialize. |
| 212 | * | 212 | * |
| 213 | * Register a new IPack device ("module" in IndustryPack jargon). The call | 213 | * Initialize a new IPack device ("module" in IndustryPack jargon). The call |
| 214 | * is done by the carrier driver. The carrier should populate the fields | 214 | * is done by the carrier driver. The carrier should populate the fields |
| 215 | * bus and slot as well as the region array of @dev prior to calling this | 215 | * bus and slot as well as the region array of @dev prior to calling this |
| 216 | * function. The rest of the fields will be allocated and populated | 216 | * function. The rest of the fields will be allocated and populated |
| 217 | * during registration. | 217 | * during initalization. |
| 218 | * | 218 | * |
| 219 | * Return zero on success or error code on failure. | 219 | * Return zero on success or error code on failure. |
| 220 | * | ||
| 221 | * NOTE: _Never_ directly free @dev after calling this function, even | ||
| 222 | * if it returned an error! Always use ipack_put_device() to give up the | ||
| 223 | * reference initialized in this function instead. | ||
| 224 | */ | ||
| 225 | int ipack_device_init(struct ipack_device *dev); | ||
| 226 | |||
| 227 | /** | ||
| 228 | * ipack_device_add -- Add an IPack device | ||
| 229 | * @dev: the new device to add. | ||
| 230 | * | ||
| 231 | * Add a new IPack device. The call is done by the carrier driver | ||
| 232 | * after calling ipack_device_init(). | ||
| 233 | * | ||
| 234 | * Return zero on success or error code on failure. | ||
| 235 | * | ||
| 236 | * NOTE: _Never_ directly free @dev after calling this function, even | ||
| 237 | * if it returned an error! Always use ipack_put_device() to give up the | ||
| 238 | * reference initialized in this function instead. | ||
| 220 | */ | 239 | */ |
| 221 | int ipack_device_register(struct ipack_device *dev); | 240 | int ipack_device_add(struct ipack_device *dev); |
| 222 | void ipack_device_unregister(struct ipack_device *dev); | 241 | void ipack_device_del(struct ipack_device *dev); |
| 242 | |||
| 243 | void ipack_get_device(struct ipack_device *dev); | ||
| 244 | void ipack_put_device(struct ipack_device *dev); | ||
| 223 | 245 | ||
| 224 | /** | 246 | /** |
| 225 | * DEFINE_IPACK_DEVICE_TABLE - macro used to describe a IndustryPack table | 247 | * DEFINE_IPACK_DEVICE_TABLE - macro used to describe a IndustryPack table |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 82ed068b1ebe..8fb8edf12417 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
| @@ -75,7 +75,6 @@ extern int register_refined_jiffies(long clock_tick_rate); | |||
| 75 | */ | 75 | */ |
| 76 | extern u64 __jiffy_data jiffies_64; | 76 | extern u64 __jiffy_data jiffies_64; |
| 77 | extern unsigned long volatile __jiffy_data jiffies; | 77 | extern unsigned long volatile __jiffy_data jiffies; |
| 78 | extern seqlock_t jiffies_lock; | ||
| 79 | 78 | ||
| 80 | #if (BITS_PER_LONG < 64) | 79 | #if (BITS_PER_LONG < 64) |
| 81 | u64 get_jiffies_64(void); | 80 | u64 get_jiffies_64(void); |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 79fdd80a42d4..2dac79c39199 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -486,6 +486,8 @@ enum ftrace_dump_mode { | |||
| 486 | void tracing_on(void); | 486 | void tracing_on(void); |
| 487 | void tracing_off(void); | 487 | void tracing_off(void); |
| 488 | int tracing_is_on(void); | 488 | int tracing_is_on(void); |
| 489 | void tracing_snapshot(void); | ||
| 490 | void tracing_snapshot_alloc(void); | ||
| 489 | 491 | ||
| 490 | extern void tracing_start(void); | 492 | extern void tracing_start(void); |
| 491 | extern void tracing_stop(void); | 493 | extern void tracing_stop(void); |
| @@ -515,10 +517,32 @@ do { \ | |||
| 515 | * | 517 | * |
| 516 | * This is intended as a debugging tool for the developer only. | 518 | * This is intended as a debugging tool for the developer only. |
| 517 | * Please refrain from leaving trace_printks scattered around in | 519 | * Please refrain from leaving trace_printks scattered around in |
| 518 | * your code. | 520 | * your code. (Extra memory is used for special buffers that are |
| 521 | * allocated when trace_printk() is used) | ||
| 522 | * | ||
| 523 | * A little optization trick is done here. If there's only one | ||
| 524 | * argument, there's no need to scan the string for printf formats. | ||
| 525 | * The trace_puts() will suffice. But how can we take advantage of | ||
| 526 | * using trace_puts() when trace_printk() has only one argument? | ||
| 527 | * By stringifying the args and checking the size we can tell | ||
| 528 | * whether or not there are args. __stringify((__VA_ARGS__)) will | ||
| 529 | * turn into "()\0" with a size of 3 when there are no args, anything | ||
| 530 | * else will be bigger. All we need to do is define a string to this, | ||
| 531 | * and then take its size and compare to 3. If it's bigger, use | ||
| 532 | * do_trace_printk() otherwise, optimize it to trace_puts(). Then just | ||
| 533 | * let gcc optimize the rest. | ||
| 519 | */ | 534 | */ |
| 520 | 535 | ||
| 521 | #define trace_printk(fmt, args...) \ | 536 | #define trace_printk(fmt, ...) \ |
| 537 | do { \ | ||
| 538 | char _______STR[] = __stringify((__VA_ARGS__)); \ | ||
| 539 | if (sizeof(_______STR) > 3) \ | ||
| 540 | do_trace_printk(fmt, ##__VA_ARGS__); \ | ||
| 541 | else \ | ||
| 542 | trace_puts(fmt); \ | ||
| 543 | } while (0) | ||
| 544 | |||
| 545 | #define do_trace_printk(fmt, args...) \ | ||
| 522 | do { \ | 546 | do { \ |
| 523 | static const char *trace_printk_fmt \ | 547 | static const char *trace_printk_fmt \ |
| 524 | __attribute__((section("__trace_printk_fmt"))) = \ | 548 | __attribute__((section("__trace_printk_fmt"))) = \ |
| @@ -538,7 +562,45 @@ int __trace_bprintk(unsigned long ip, const char *fmt, ...); | |||
| 538 | extern __printf(2, 3) | 562 | extern __printf(2, 3) |
| 539 | int __trace_printk(unsigned long ip, const char *fmt, ...); | 563 | int __trace_printk(unsigned long ip, const char *fmt, ...); |
| 540 | 564 | ||
| 541 | extern void trace_dump_stack(void); | 565 | /** |
| 566 | * trace_puts - write a string into the ftrace buffer | ||
| 567 | * @str: the string to record | ||
| 568 | * | ||
| 569 | * Note: __trace_bputs is an internal function for trace_puts and | ||
| 570 | * the @ip is passed in via the trace_puts macro. | ||
| 571 | * | ||
| 572 | * This is similar to trace_printk() but is made for those really fast | ||
| 573 | * paths that a developer wants the least amount of "Heisenbug" affects, | ||
| 574 | * where the processing of the print format is still too much. | ||
| 575 | * | ||
| 576 | * This function allows a kernel developer to debug fast path sections | ||
| 577 | * that printk is not appropriate for. By scattering in various | ||
| 578 | * printk like tracing in the code, a developer can quickly see | ||
| 579 | * where problems are occurring. | ||
| 580 | * | ||
| 581 | * This is intended as a debugging tool for the developer only. | ||
| 582 | * Please refrain from leaving trace_puts scattered around in | ||
| 583 | * your code. (Extra memory is used for special buffers that are | ||
| 584 | * allocated when trace_puts() is used) | ||
| 585 | * | ||
| 586 | * Returns: 0 if nothing was written, positive # if string was. | ||
| 587 | * (1 when __trace_bputs is used, strlen(str) when __trace_puts is used) | ||
| 588 | */ | ||
| 589 | |||
| 590 | extern int __trace_bputs(unsigned long ip, const char *str); | ||
| 591 | extern int __trace_puts(unsigned long ip, const char *str, int size); | ||
| 592 | #define trace_puts(str) ({ \ | ||
| 593 | static const char *trace_printk_fmt \ | ||
| 594 | __attribute__((section("__trace_printk_fmt"))) = \ | ||
| 595 | __builtin_constant_p(str) ? str : NULL; \ | ||
| 596 | \ | ||
| 597 | if (__builtin_constant_p(str)) \ | ||
| 598 | __trace_bputs(_THIS_IP_, trace_printk_fmt); \ | ||
| 599 | else \ | ||
| 600 | __trace_puts(_THIS_IP_, str, strlen(str)); \ | ||
| 601 | }) | ||
| 602 | |||
| 603 | extern void trace_dump_stack(int skip); | ||
| 542 | 604 | ||
| 543 | /* | 605 | /* |
| 544 | * The double __builtin_constant_p is because gcc will give us an error | 606 | * The double __builtin_constant_p is because gcc will give us an error |
| @@ -573,6 +635,8 @@ static inline void trace_dump_stack(void) { } | |||
| 573 | static inline void tracing_on(void) { } | 635 | static inline void tracing_on(void) { } |
| 574 | static inline void tracing_off(void) { } | 636 | static inline void tracing_off(void) { } |
| 575 | static inline int tracing_is_on(void) { return 0; } | 637 | static inline int tracing_is_on(void) { return 0; } |
| 638 | static inline void tracing_snapshot(void) { } | ||
| 639 | static inline void tracing_snapshot_alloc(void) { } | ||
| 576 | 640 | ||
| 577 | static inline __printf(1, 2) | 641 | static inline __printf(1, 2) |
| 578 | int trace_printk(const char *fmt, ...) | 642 | int trace_printk(const char *fmt, ...) |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d2e6927bbaae..d78d28a733b1 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
| @@ -200,6 +200,8 @@ extern size_t vmcoreinfo_max_size; | |||
| 200 | 200 | ||
| 201 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, | 201 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, |
| 202 | unsigned long long *crash_size, unsigned long long *crash_base); | 202 | unsigned long long *crash_size, unsigned long long *crash_base); |
| 203 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, | ||
| 204 | unsigned long long *crash_size, unsigned long long *crash_base); | ||
| 203 | int parse_crashkernel_low(char *cmdline, unsigned long long system_ram, | 205 | int parse_crashkernel_low(char *cmdline, unsigned long long system_ram, |
| 204 | unsigned long long *crash_size, unsigned long long *crash_base); | 206 | unsigned long long *crash_size, unsigned long long *crash_base); |
| 205 | int crash_shrink_memory(unsigned long new_size); | 207 | int crash_shrink_memory(unsigned long new_size); |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 4b6ef4d33cc2..ca1d27a0d6a6 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi | 29 | * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi |
| 30 | * <prasanna@in.ibm.com> added function-return probes. | 30 | * <prasanna@in.ibm.com> added function-return probes. |
| 31 | */ | 31 | */ |
| 32 | #include <linux/compiler.h> /* for __kprobes */ | ||
| 32 | #include <linux/linkage.h> | 33 | #include <linux/linkage.h> |
| 33 | #include <linux/list.h> | 34 | #include <linux/list.h> |
| 34 | #include <linux/notifier.h> | 35 | #include <linux/notifier.h> |
| @@ -49,16 +50,11 @@ | |||
| 49 | #define KPROBE_REENTER 0x00000004 | 50 | #define KPROBE_REENTER 0x00000004 |
| 50 | #define KPROBE_HIT_SSDONE 0x00000008 | 51 | #define KPROBE_HIT_SSDONE 0x00000008 |
| 51 | 52 | ||
| 52 | /* Attach to insert probes on any functions which should be ignored*/ | ||
| 53 | #define __kprobes __attribute__((__section__(".kprobes.text"))) | ||
| 54 | |||
| 55 | #else /* CONFIG_KPROBES */ | 53 | #else /* CONFIG_KPROBES */ |
| 56 | typedef int kprobe_opcode_t; | 54 | typedef int kprobe_opcode_t; |
| 57 | struct arch_specific_insn { | 55 | struct arch_specific_insn { |
| 58 | int dummy; | 56 | int dummy; |
| 59 | }; | 57 | }; |
| 60 | #define __kprobes | ||
| 61 | |||
| 62 | #endif /* CONFIG_KPROBES */ | 58 | #endif /* CONFIG_KPROBES */ |
| 63 | 59 | ||
| 64 | struct kprobe; | 60 | struct kprobe; |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index cad77fe09d77..c13958251927 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -518,7 +518,7 @@ int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, | |||
| 518 | int kvm_write_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, | 518 | int kvm_write_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc, |
| 519 | void *data, unsigned long len); | 519 | void *data, unsigned long len); |
| 520 | int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc, | 520 | int kvm_gfn_to_hva_cache_init(struct kvm *kvm, struct gfn_to_hva_cache *ghc, |
| 521 | gpa_t gpa); | 521 | gpa_t gpa, unsigned long len); |
| 522 | int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); | 522 | int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len); |
| 523 | int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); | 523 | int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); |
| 524 | struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); | 524 | struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); |
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h index fa7cc7244cbd..b0bcce0ddc95 100644 --- a/include/linux/kvm_types.h +++ b/include/linux/kvm_types.h | |||
| @@ -71,6 +71,7 @@ struct gfn_to_hva_cache { | |||
| 71 | u64 generation; | 71 | u64 generation; |
| 72 | gpa_t gpa; | 72 | gpa_t gpa; |
| 73 | unsigned long hva; | 73 | unsigned long hva; |
| 74 | unsigned long len; | ||
| 74 | struct kvm_memory_slot *memslot; | 75 | struct kvm_memory_slot *memslot; |
| 75 | }; | 76 | }; |
| 76 | 77 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index 91c9d109e5f1..eae7a053dc51 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -398,6 +398,7 @@ enum { | |||
| 398 | ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ | 398 | ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ |
| 399 | ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ | 399 | ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ |
| 400 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ | 400 | ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ |
| 401 | ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ | ||
| 401 | 402 | ||
| 402 | /* DMA mask for user DMA control: User visible values; DO NOT | 403 | /* DMA mask for user DMA control: User visible values; DO NOT |
| 403 | renumber */ | 404 | renumber */ |
diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h index 31f9d75adc5b..2eb88556c5c5 100644 --- a/include/linux/list_bl.h +++ b/include/linux/list_bl.h | |||
| @@ -125,6 +125,11 @@ static inline void hlist_bl_unlock(struct hlist_bl_head *b) | |||
| 125 | __bit_spin_unlock(0, (unsigned long *)b); | 125 | __bit_spin_unlock(0, (unsigned long *)b); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | static inline bool hlist_bl_is_locked(struct hlist_bl_head *b) | ||
| 129 | { | ||
| 130 | return bit_spin_is_locked(0, (unsigned long *)b); | ||
| 131 | } | ||
| 132 | |||
| 128 | /** | 133 | /** |
| 129 | * hlist_bl_for_each_entry - iterate over list of given type | 134 | * hlist_bl_for_each_entry - iterate over list of given type |
| 130 | * @tpos: the type * to use as a loop cursor. | 135 | * @tpos: the type * to use as a loop cursor. |
diff --git a/include/linux/math64.h b/include/linux/math64.h index b8ba85544721..931a619407bf 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h | |||
| @@ -30,6 +30,15 @@ static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) | |||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * div64_u64_rem - unsigned 64bit divide with 64bit divisor | ||
| 34 | */ | ||
| 35 | static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) | ||
| 36 | { | ||
| 37 | *remainder = dividend % divisor; | ||
| 38 | return dividend / divisor; | ||
| 39 | } | ||
| 40 | |||
| 41 | /** | ||
| 33 | * div64_u64 - unsigned 64bit divide with 64bit divisor | 42 | * div64_u64 - unsigned 64bit divide with 64bit divisor |
| 34 | */ | 43 | */ |
| 35 | static inline u64 div64_u64(u64 dividend, u64 divisor) | 44 | static inline u64 div64_u64(u64 dividend, u64 divisor) |
| @@ -61,8 +70,16 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) | |||
| 61 | extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder); | 70 | extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder); |
| 62 | #endif | 71 | #endif |
| 63 | 72 | ||
| 73 | #ifndef div64_u64_rem | ||
| 74 | extern u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder); | ||
| 75 | #endif | ||
| 76 | |||
| 64 | #ifndef div64_u64 | 77 | #ifndef div64_u64 |
| 65 | extern u64 div64_u64(u64 dividend, u64 divisor); | 78 | static inline u64 div64_u64(u64 dividend, u64 divisor) |
| 79 | { | ||
| 80 | u64 remainder; | ||
| 81 | return div64_u64_rem(dividend, divisor, &remainder); | ||
| 82 | } | ||
| 66 | #endif | 83 | #endif |
| 67 | 84 | ||
| 68 | #ifndef div64_s64 | 85 | #ifndef div64_s64 |
diff --git a/include/linux/mei_cl_bus.h b/include/linux/mei_cl_bus.h new file mode 100644 index 000000000000..d14af7b722ef --- /dev/null +++ b/include/linux/mei_cl_bus.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #ifndef _LINUX_MEI_CL_BUS_H | ||
| 2 | #define _LINUX_MEI_CL_BUS_H | ||
| 3 | |||
| 4 | #include <linux/device.h> | ||
| 5 | #include <linux/uuid.h> | ||
| 6 | |||
| 7 | struct mei_cl_device; | ||
| 8 | |||
| 9 | struct mei_cl_driver { | ||
| 10 | struct device_driver driver; | ||
| 11 | const char *name; | ||
| 12 | |||
| 13 | const struct mei_cl_device_id *id_table; | ||
| 14 | |||
| 15 | int (*probe)(struct mei_cl_device *dev, | ||
| 16 | const struct mei_cl_device_id *id); | ||
| 17 | int (*remove)(struct mei_cl_device *dev); | ||
| 18 | }; | ||
| 19 | |||
| 20 | int __mei_cl_driver_register(struct mei_cl_driver *driver, | ||
| 21 | struct module *owner); | ||
| 22 | #define mei_cl_driver_register(driver) \ | ||
| 23 | __mei_cl_driver_register(driver, THIS_MODULE) | ||
| 24 | |||
| 25 | void mei_cl_driver_unregister(struct mei_cl_driver *driver); | ||
| 26 | |||
| 27 | int mei_cl_send(struct mei_cl_device *device, u8 *buf, size_t length); | ||
| 28 | int mei_cl_recv(struct mei_cl_device *device, u8 *buf, size_t length); | ||
| 29 | |||
| 30 | typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device, | ||
| 31 | u32 events, void *context); | ||
| 32 | int mei_cl_register_event_cb(struct mei_cl_device *device, | ||
| 33 | mei_cl_event_cb_t read_cb, void *context); | ||
| 34 | |||
| 35 | #define MEI_CL_EVENT_RX 0 | ||
| 36 | #define MEI_CL_EVENT_TX 1 | ||
| 37 | |||
| 38 | void *mei_cl_get_drvdata(const struct mei_cl_device *device); | ||
| 39 | void mei_cl_set_drvdata(struct mei_cl_device *device, void *data); | ||
| 40 | |||
| 41 | int mei_cl_enable_device(struct mei_cl_device *device); | ||
| 42 | int mei_cl_disable_device(struct mei_cl_device *device); | ||
| 43 | |||
| 44 | #endif /* _LINUX_MEI_CL_BUS_H */ | ||
diff --git a/include/linux/memory.h b/include/linux/memory.h index 45e93b468878..73817af8b480 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/node.h> | 18 | #include <linux/node.h> |
| 19 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
| 20 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
| 21 | #include <linux/notifier.h> | ||
| 21 | 22 | ||
| 22 | #define MIN_MEMORY_BLOCK_SIZE (1UL << SECTION_SIZE_BITS) | 23 | #define MIN_MEMORY_BLOCK_SIZE (1UL << SECTION_SIZE_BITS) |
| 23 | 24 | ||
| @@ -114,9 +115,10 @@ extern void unregister_memory_notifier(struct notifier_block *nb); | |||
| 114 | extern int register_memory_isolate_notifier(struct notifier_block *nb); | 115 | extern int register_memory_isolate_notifier(struct notifier_block *nb); |
| 115 | extern void unregister_memory_isolate_notifier(struct notifier_block *nb); | 116 | extern void unregister_memory_isolate_notifier(struct notifier_block *nb); |
| 116 | extern int register_new_memory(int, struct mem_section *); | 117 | extern int register_new_memory(int, struct mem_section *); |
| 118 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
| 117 | extern int unregister_memory_section(struct mem_section *); | 119 | extern int unregister_memory_section(struct mem_section *); |
| 120 | #endif | ||
| 118 | extern int memory_dev_init(void); | 121 | extern int memory_dev_init(void); |
| 119 | extern int remove_memory_block(unsigned long, struct mem_section *, int); | ||
| 120 | extern int memory_notify(unsigned long val, void *v); | 122 | extern int memory_notify(unsigned long val, void *v); |
| 121 | extern int memory_isolate_notify(unsigned long val, void *v); | 123 | extern int memory_isolate_notify(unsigned long val, void *v); |
| 122 | extern struct memory_block *find_memory_block_hinted(struct mem_section *, | 124 | extern struct memory_block *find_memory_block_hinted(struct mem_section *, |
| @@ -127,13 +129,18 @@ enum mem_add_context { BOOT, HOTPLUG }; | |||
| 127 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ | 129 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ |
| 128 | 130 | ||
| 129 | #ifdef CONFIG_MEMORY_HOTPLUG | 131 | #ifdef CONFIG_MEMORY_HOTPLUG |
| 130 | #define hotplug_memory_notifier(fn, pri) { \ | 132 | #define hotplug_memory_notifier(fn, pri) ({ \ |
| 131 | static __meminitdata struct notifier_block fn##_mem_nb =\ | 133 | static __meminitdata struct notifier_block fn##_mem_nb =\ |
| 132 | { .notifier_call = fn, .priority = pri }; \ | 134 | { .notifier_call = fn, .priority = pri };\ |
| 133 | register_memory_notifier(&fn##_mem_nb); \ | 135 | register_memory_notifier(&fn##_mem_nb); \ |
| 134 | } | 136 | }) |
| 137 | #define register_hotmemory_notifier(nb) register_memory_notifier(nb) | ||
| 138 | #define unregister_hotmemory_notifier(nb) unregister_memory_notifier(nb) | ||
| 135 | #else | 139 | #else |
| 136 | #define hotplug_memory_notifier(fn, pri) do { } while (0) | 140 | #define hotplug_memory_notifier(fn, pri) (0) |
| 141 | /* These aren't inline functions due to a GCC bug. */ | ||
| 142 | #define register_hotmemory_notifier(nb) ({ (void)(nb); 0; }) | ||
| 143 | #define unregister_hotmemory_notifier(nb) ({ (void)(nb); }) | ||
| 137 | #endif | 144 | #endif |
| 138 | 145 | ||
| 139 | /* | 146 | /* |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index b6a3be7d47bf..3e622c610925 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -97,13 +97,13 @@ extern void __online_page_free(struct page *page); | |||
| 97 | #ifdef CONFIG_MEMORY_HOTREMOVE | 97 | #ifdef CONFIG_MEMORY_HOTREMOVE |
| 98 | extern bool is_pageblock_removable_nolock(struct page *page); | 98 | extern bool is_pageblock_removable_nolock(struct page *page); |
| 99 | extern int arch_remove_memory(u64 start, u64 size); | 99 | extern int arch_remove_memory(u64 start, u64 size); |
| 100 | extern int __remove_pages(struct zone *zone, unsigned long start_pfn, | ||
| 101 | unsigned long nr_pages); | ||
| 100 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | 102 | #endif /* CONFIG_MEMORY_HOTREMOVE */ |
| 101 | 103 | ||
| 102 | /* reasonably generic interface to expand the physical pages in a zone */ | 104 | /* reasonably generic interface to expand the physical pages in a zone */ |
| 103 | extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, | 105 | extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, |
| 104 | unsigned long nr_pages); | 106 | unsigned long nr_pages); |
| 105 | extern int __remove_pages(struct zone *zone, unsigned long start_pfn, | ||
| 106 | unsigned long nr_pages); | ||
| 107 | 107 | ||
| 108 | #ifdef CONFIG_NUMA | 108 | #ifdef CONFIG_NUMA |
| 109 | extern int memory_add_physaddr_to_nid(u64 start); | 109 | extern int memory_add_physaddr_to_nid(u64 start); |
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 9db0bda446a0..84f449475c25 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
| @@ -364,8 +364,7 @@ struct ab8500 { | |||
| 364 | const int *irq_reg_offset; | 364 | const int *irq_reg_offset; |
| 365 | }; | 365 | }; |
| 366 | 366 | ||
| 367 | struct regulator_reg_init; | 367 | struct ab8500_regulator_platform_data; |
| 368 | struct regulator_init_data; | ||
| 369 | struct ab8500_gpio_platform_data; | 368 | struct ab8500_gpio_platform_data; |
| 370 | struct ab8500_codec_platform_data; | 369 | struct ab8500_codec_platform_data; |
| 371 | struct ab8500_sysctrl_platform_data; | 370 | struct ab8500_sysctrl_platform_data; |
| @@ -375,19 +374,13 @@ struct ab8500_sysctrl_platform_data; | |||
| 375 | * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used | 374 | * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used |
| 376 | * @pm_power_off: Should machine pm power off hook be registered or not | 375 | * @pm_power_off: Should machine pm power off hook be registered or not |
| 377 | * @init: board-specific initialization after detection of ab8500 | 376 | * @init: board-specific initialization after detection of ab8500 |
| 378 | * @num_regulator_reg_init: number of regulator init registers | ||
| 379 | * @regulator_reg_init: regulator init registers | ||
| 380 | * @num_regulator: number of regulators | ||
| 381 | * @regulator: machine-specific constraints for regulators | 377 | * @regulator: machine-specific constraints for regulators |
| 382 | */ | 378 | */ |
| 383 | struct ab8500_platform_data { | 379 | struct ab8500_platform_data { |
| 384 | int irq_base; | 380 | int irq_base; |
| 385 | bool pm_power_off; | 381 | bool pm_power_off; |
| 386 | void (*init) (struct ab8500 *); | 382 | void (*init) (struct ab8500 *); |
| 387 | int num_regulator_reg_init; | 383 | struct ab8500_regulator_platform_data *regulator; |
| 388 | struct ab8500_regulator_reg_init *regulator_reg_init; | ||
| 389 | int num_regulator; | ||
| 390 | struct regulator_init_data *regulator; | ||
| 391 | struct abx500_gpio_platform_data *gpio; | 384 | struct abx500_gpio_platform_data *gpio; |
| 392 | struct ab8500_codec_platform_data *codec; | 385 | struct ab8500_codec_platform_data *codec; |
| 393 | struct ab8500_sysctrl_platform_data *sysctrl; | 386 | struct ab8500_sysctrl_platform_data *sysctrl; |
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h index a710255528d7..cc281368dc55 100644 --- a/include/linux/mfd/arizona/core.h +++ b/include/linux/mfd/arizona/core.h | |||
| @@ -100,6 +100,9 @@ struct arizona { | |||
| 100 | struct regmap_irq_chip_data *aod_irq_chip; | 100 | struct regmap_irq_chip_data *aod_irq_chip; |
| 101 | struct regmap_irq_chip_data *irq_chip; | 101 | struct regmap_irq_chip_data *irq_chip; |
| 102 | 102 | ||
| 103 | bool hpdet_magic; | ||
| 104 | unsigned int hp_ena; | ||
| 105 | |||
| 103 | struct mutex clk_lock; | 106 | struct mutex clk_lock; |
| 104 | int clk32k_ref; | 107 | int clk32k_ref; |
| 105 | 108 | ||
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h index 455c51d22d6b..a0f940987a3e 100644 --- a/include/linux/mfd/arizona/pdata.h +++ b/include/linux/mfd/arizona/pdata.h | |||
| @@ -86,6 +86,11 @@ struct arizona_micd_config { | |||
| 86 | bool gpio; | 86 | bool gpio; |
| 87 | }; | 87 | }; |
| 88 | 88 | ||
| 89 | struct arizona_micd_range { | ||
| 90 | int max; /** Ohms */ | ||
| 91 | int key; /** Key to report to input layer */ | ||
| 92 | }; | ||
| 93 | |||
| 89 | struct arizona_pdata { | 94 | struct arizona_pdata { |
| 90 | int reset; /** GPIO controlling /RESET, if any */ | 95 | int reset; /** GPIO controlling /RESET, if any */ |
| 91 | int ldoena; /** GPIO controlling LODENA, if any */ | 96 | int ldoena; /** GPIO controlling LODENA, if any */ |
| @@ -117,12 +122,21 @@ struct arizona_pdata { | |||
| 117 | /** GPIO5 is used for jack detection */ | 122 | /** GPIO5 is used for jack detection */ |
| 118 | bool jd_gpio5; | 123 | bool jd_gpio5; |
| 119 | 124 | ||
| 125 | /** Internal pull on GPIO5 is disabled when used for jack detection */ | ||
| 126 | bool jd_gpio5_nopull; | ||
| 127 | |||
| 120 | /** Use the headphone detect circuit to identify the accessory */ | 128 | /** Use the headphone detect circuit to identify the accessory */ |
| 121 | bool hpdet_acc_id; | 129 | bool hpdet_acc_id; |
| 122 | 130 | ||
| 131 | /** Check for line output with HPDET method */ | ||
| 132 | bool hpdet_acc_id_line; | ||
| 133 | |||
| 123 | /** GPIO used for mic isolation with HPDET */ | 134 | /** GPIO used for mic isolation with HPDET */ |
| 124 | int hpdet_id_gpio; | 135 | int hpdet_id_gpio; |
| 125 | 136 | ||
| 137 | /** Extra debounce timeout used during initial mic detection (ms) */ | ||
| 138 | int micd_detect_debounce; | ||
| 139 | |||
| 126 | /** GPIO for mic detection polarity */ | 140 | /** GPIO for mic detection polarity */ |
| 127 | int micd_pol_gpio; | 141 | int micd_pol_gpio; |
| 128 | 142 | ||
| @@ -135,9 +149,16 @@ struct arizona_pdata { | |||
| 135 | /** Mic detect debounce level */ | 149 | /** Mic detect debounce level */ |
| 136 | int micd_dbtime; | 150 | int micd_dbtime; |
| 137 | 151 | ||
| 152 | /** Mic detect timeout (ms) */ | ||
| 153 | int micd_timeout; | ||
| 154 | |||
| 138 | /** Force MICBIAS on for mic detect */ | 155 | /** Force MICBIAS on for mic detect */ |
| 139 | bool micd_force_micbias; | 156 | bool micd_force_micbias; |
| 140 | 157 | ||
| 158 | /** Mic detect level parameters */ | ||
| 159 | const struct arizona_micd_range *micd_ranges; | ||
| 160 | int num_micd_ranges; | ||
| 161 | |||
| 141 | /** Headset polarity configurations */ | 162 | /** Headset polarity configurations */ |
| 142 | struct arizona_micd_config *micd_configs; | 163 | struct arizona_micd_config *micd_configs; |
| 143 | int num_micd_configs; | 164 | int num_micd_configs; |
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h index 340355136069..f43aa7c8d040 100644 --- a/include/linux/mfd/arizona/registers.h +++ b/include/linux/mfd/arizona/registers.h | |||
| @@ -124,6 +124,10 @@ | |||
| 124 | #define ARIZONA_MIC_DETECT_1 0x2A3 | 124 | #define ARIZONA_MIC_DETECT_1 0x2A3 |
| 125 | #define ARIZONA_MIC_DETECT_2 0x2A4 | 125 | #define ARIZONA_MIC_DETECT_2 0x2A4 |
| 126 | #define ARIZONA_MIC_DETECT_3 0x2A5 | 126 | #define ARIZONA_MIC_DETECT_3 0x2A5 |
| 127 | #define ARIZONA_MIC_DETECT_LEVEL_1 0x2A6 | ||
| 128 | #define ARIZONA_MIC_DETECT_LEVEL_2 0x2A7 | ||
| 129 | #define ARIZONA_MIC_DETECT_LEVEL_3 0x2A8 | ||
| 130 | #define ARIZONA_MIC_DETECT_LEVEL_4 0x2A9 | ||
| 127 | #define ARIZONA_MIC_NOISE_MIX_CONTROL_1 0x2C3 | 131 | #define ARIZONA_MIC_NOISE_MIX_CONTROL_1 0x2C3 |
| 128 | #define ARIZONA_ISOLATION_CONTROL 0x2CB | 132 | #define ARIZONA_ISOLATION_CONTROL 0x2CB |
| 129 | #define ARIZONA_JACK_DETECT_ANALOGUE 0x2D3 | 133 | #define ARIZONA_JACK_DETECT_ANALOGUE 0x2D3 |
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 3bbda22721ea..ecddc5173c7c 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h | |||
| @@ -109,19 +109,6 @@ struct palmas_reg_init { | |||
| 109 | */ | 109 | */ |
| 110 | int mode_sleep; | 110 | int mode_sleep; |
| 111 | 111 | ||
| 112 | /* tstep is the timestep loaded to the TSTEP register | ||
| 113 | * | ||
| 114 | * For SMPS | ||
| 115 | * | ||
| 116 | * 0: Jump (no slope control) | ||
| 117 | * 1: 10mV/us | ||
| 118 | * 2: 5mV/us | ||
| 119 | * 3: 2.5mV/us | ||
| 120 | * | ||
| 121 | * For LDO unused | ||
| 122 | */ | ||
| 123 | int tstep; | ||
| 124 | |||
| 125 | /* voltage_sel is the bitfield loaded onto the SMPSX_VOLTAGE | 112 | /* voltage_sel is the bitfield loaded onto the SMPSX_VOLTAGE |
| 126 | * register. Set this is the default voltage set in OTP needs | 113 | * register. Set this is the default voltage set in OTP needs |
| 127 | * to be overridden. | 114 | * to be overridden. |
| @@ -154,6 +141,12 @@ enum palmas_regulators { | |||
| 154 | PALMAS_REG_LDO9, | 141 | PALMAS_REG_LDO9, |
| 155 | PALMAS_REG_LDOLN, | 142 | PALMAS_REG_LDOLN, |
| 156 | PALMAS_REG_LDOUSB, | 143 | PALMAS_REG_LDOUSB, |
| 144 | /* External regulators */ | ||
| 145 | PALMAS_REG_REGEN1, | ||
| 146 | PALMAS_REG_REGEN2, | ||
| 147 | PALMAS_REG_REGEN3, | ||
| 148 | PALMAS_REG_SYSEN1, | ||
| 149 | PALMAS_REG_SYSEN2, | ||
| 157 | /* Total number of regulators */ | 150 | /* Total number of regulators */ |
| 158 | PALMAS_NUM_REGS, | 151 | PALMAS_NUM_REGS, |
| 159 | }; | 152 | }; |
| @@ -171,6 +164,9 @@ struct palmas_pmic_platform_data { | |||
| 171 | 164 | ||
| 172 | /* use LDO6 for vibrator control */ | 165 | /* use LDO6 for vibrator control */ |
| 173 | int ldo6_vibrator; | 166 | int ldo6_vibrator; |
| 167 | |||
| 168 | /* Enable tracking mode of LDO8 */ | ||
| 169 | bool enable_ldo8_tracking; | ||
| 174 | }; | 170 | }; |
| 175 | 171 | ||
| 176 | struct palmas_usb_platform_data { | 172 | struct palmas_usb_platform_data { |
| @@ -331,6 +327,8 @@ struct palmas_pmic { | |||
| 331 | int smps457; | 327 | int smps457; |
| 332 | 328 | ||
| 333 | int range[PALMAS_REG_SMPS10]; | 329 | int range[PALMAS_REG_SMPS10]; |
| 330 | unsigned int ramp_delay[PALMAS_REG_SMPS10]; | ||
| 331 | unsigned int current_reg_mode[PALMAS_REG_SMPS10]; | ||
| 334 | }; | 332 | }; |
| 335 | 333 | ||
| 336 | struct palmas_resource { | 334 | struct palmas_resource { |
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h index 290762f93930..29eab2bd3dfa 100644 --- a/include/linux/mfd/tps65217.h +++ b/include/linux/mfd/tps65217.h | |||
| @@ -228,6 +228,7 @@ enum tps65217_bl_fdim { | |||
| 228 | struct tps65217_bl_pdata { | 228 | struct tps65217_bl_pdata { |
| 229 | enum tps65217_bl_isel isel; | 229 | enum tps65217_bl_isel isel; |
| 230 | enum tps65217_bl_fdim fdim; | 230 | enum tps65217_bl_fdim fdim; |
| 231 | int dft_brightness; | ||
| 231 | }; | 232 | }; |
| 232 | 233 | ||
| 233 | /** | 234 | /** |
diff --git a/include/linux/mm.h b/include/linux/mm.h index e19ff30ad0a2..c05d7cfbb6b9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -44,6 +44,9 @@ extern int sysctl_legacy_va_layout; | |||
| 44 | #include <asm/pgtable.h> | 44 | #include <asm/pgtable.h> |
| 45 | #include <asm/processor.h> | 45 | #include <asm/processor.h> |
| 46 | 46 | ||
| 47 | extern unsigned long sysctl_user_reserve_kbytes; | ||
| 48 | extern unsigned long sysctl_admin_reserve_kbytes; | ||
| 49 | |||
| 47 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) | 50 | #define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) |
| 48 | 51 | ||
| 49 | /* to align the pointer to the (next) page boundary */ | 52 | /* to align the pointer to the (next) page boundary */ |
| @@ -899,7 +902,8 @@ extern void pagefault_out_of_memory(void); | |||
| 899 | * Flags passed to show_mem() and show_free_areas() to suppress output in | 902 | * Flags passed to show_mem() and show_free_areas() to suppress output in |
| 900 | * various contexts. | 903 | * various contexts. |
| 901 | */ | 904 | */ |
| 902 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* filter disallowed nodes */ | 905 | #define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */ |
| 906 | #define SHOW_MEM_FILTER_PAGE_COUNT (0x0002u) /* page type count */ | ||
| 903 | 907 | ||
| 904 | extern void show_free_areas(unsigned int flags); | 908 | extern void show_free_areas(unsigned int flags); |
| 905 | extern bool skip_free_areas_node(unsigned int flags, int nid); | 909 | extern bool skip_free_areas_node(unsigned int flags, int nid); |
| @@ -1294,6 +1298,61 @@ extern void free_area_init_node(int nid, unsigned long * zones_size, | |||
| 1294 | unsigned long zone_start_pfn, unsigned long *zholes_size); | 1298 | unsigned long zone_start_pfn, unsigned long *zholes_size); |
| 1295 | extern void free_initmem(void); | 1299 | extern void free_initmem(void); |
| 1296 | 1300 | ||
| 1301 | /* | ||
| 1302 | * Free reserved pages within range [PAGE_ALIGN(start), end & PAGE_MASK) | ||
| 1303 | * into the buddy system. The freed pages will be poisoned with pattern | ||
| 1304 | * "poison" if it's non-zero. | ||
| 1305 | * Return pages freed into the buddy system. | ||
| 1306 | */ | ||
| 1307 | extern unsigned long free_reserved_area(unsigned long start, unsigned long end, | ||
| 1308 | int poison, char *s); | ||
| 1309 | #ifdef CONFIG_HIGHMEM | ||
| 1310 | /* | ||
| 1311 | * Free a highmem page into the buddy system, adjusting totalhigh_pages | ||
| 1312 | * and totalram_pages. | ||
| 1313 | */ | ||
| 1314 | extern void free_highmem_page(struct page *page); | ||
| 1315 | #endif | ||
| 1316 | |||
| 1317 | static inline void adjust_managed_page_count(struct page *page, long count) | ||
| 1318 | { | ||
| 1319 | totalram_pages += count; | ||
| 1320 | } | ||
| 1321 | |||
| 1322 | /* Free the reserved page into the buddy system, so it gets managed. */ | ||
| 1323 | static inline void __free_reserved_page(struct page *page) | ||
| 1324 | { | ||
| 1325 | ClearPageReserved(page); | ||
| 1326 | init_page_count(page); | ||
| 1327 | __free_page(page); | ||
| 1328 | } | ||
| 1329 | |||
| 1330 | static inline void free_reserved_page(struct page *page) | ||
| 1331 | { | ||
| 1332 | __free_reserved_page(page); | ||
| 1333 | adjust_managed_page_count(page, 1); | ||
| 1334 | } | ||
| 1335 | |||
| 1336 | static inline void mark_page_reserved(struct page *page) | ||
| 1337 | { | ||
| 1338 | SetPageReserved(page); | ||
| 1339 | adjust_managed_page_count(page, -1); | ||
| 1340 | } | ||
| 1341 | |||
| 1342 | /* | ||
| 1343 | * Default method to free all the __init memory into the buddy system. | ||
| 1344 | * The freed pages will be poisoned with pattern "poison" if it is | ||
| 1345 | * non-zero. Return pages freed into the buddy system. | ||
| 1346 | */ | ||
| 1347 | static inline unsigned long free_initmem_default(int poison) | ||
| 1348 | { | ||
| 1349 | extern char __init_begin[], __init_end[]; | ||
| 1350 | |||
| 1351 | return free_reserved_area(PAGE_ALIGN((unsigned long)&__init_begin) , | ||
| 1352 | ((unsigned long)&__init_end) & PAGE_MASK, | ||
| 1353 | poison, "unused kernel"); | ||
| 1354 | } | ||
| 1355 | |||
| 1297 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 1356 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
| 1298 | /* | 1357 | /* |
| 1299 | * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its | 1358 | * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its |
| @@ -1611,6 +1670,8 @@ int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, | |||
| 1611 | unsigned long pfn); | 1670 | unsigned long pfn); |
| 1612 | int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, | 1671 | int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, |
| 1613 | unsigned long pfn); | 1672 | unsigned long pfn); |
| 1673 | int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len); | ||
| 1674 | |||
| 1614 | 1675 | ||
| 1615 | struct page *follow_page_mask(struct vm_area_struct *vma, | 1676 | struct page *follow_page_mask(struct vm_area_struct *vma, |
| 1616 | unsigned long address, unsigned int foll_flags, | 1677 | unsigned long address, unsigned int foll_flags, |
| @@ -1673,8 +1734,12 @@ int in_gate_area_no_mm(unsigned long addr); | |||
| 1673 | #define in_gate_area(mm, addr) ({(void)mm; in_gate_area_no_mm(addr);}) | 1734 | #define in_gate_area(mm, addr) ({(void)mm; in_gate_area_no_mm(addr);}) |
| 1674 | #endif /* __HAVE_ARCH_GATE_AREA */ | 1735 | #endif /* __HAVE_ARCH_GATE_AREA */ |
| 1675 | 1736 | ||
| 1737 | #ifdef CONFIG_SYSCTL | ||
| 1738 | extern int sysctl_drop_caches; | ||
| 1676 | int drop_caches_sysctl_handler(struct ctl_table *, int, | 1739 | int drop_caches_sysctl_handler(struct ctl_table *, int, |
| 1677 | void __user *, size_t *, loff_t *); | 1740 | void __user *, size_t *, loff_t *); |
| 1741 | #endif | ||
| 1742 | |||
| 1678 | unsigned long shrink_slab(struct shrink_control *shrink, | 1743 | unsigned long shrink_slab(struct shrink_control *shrink, |
| 1679 | unsigned long nr_pages_scanned, | 1744 | unsigned long nr_pages_scanned, |
| 1680 | unsigned long lru_pages); | 1745 | unsigned long lru_pages); |
| @@ -1702,12 +1767,12 @@ pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node); | |||
| 1702 | void *vmemmap_alloc_block(unsigned long size, int node); | 1767 | void *vmemmap_alloc_block(unsigned long size, int node); |
| 1703 | void *vmemmap_alloc_block_buf(unsigned long size, int node); | 1768 | void *vmemmap_alloc_block_buf(unsigned long size, int node); |
| 1704 | void vmemmap_verify(pte_t *, int, unsigned long, unsigned long); | 1769 | void vmemmap_verify(pte_t *, int, unsigned long, unsigned long); |
| 1705 | int vmemmap_populate_basepages(struct page *start_page, | 1770 | int vmemmap_populate_basepages(unsigned long start, unsigned long end, |
| 1706 | unsigned long pages, int node); | 1771 | int node); |
| 1707 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); | 1772 | int vmemmap_populate(unsigned long start, unsigned long end, int node); |
| 1708 | void vmemmap_populate_print_last(void); | 1773 | void vmemmap_populate_print_last(void); |
| 1709 | #ifdef CONFIG_MEMORY_HOTPLUG | 1774 | #ifdef CONFIG_MEMORY_HOTPLUG |
| 1710 | void vmemmap_free(struct page *memmap, unsigned long nr_pages); | 1775 | void vmemmap_free(unsigned long start, unsigned long end); |
| 1711 | #endif | 1776 | #endif |
| 1712 | void register_page_bootmem_memmap(unsigned long section_nr, struct page *map, | 1777 | void register_page_bootmem_memmap(unsigned long section_nr, struct page *map, |
| 1713 | unsigned long size); | 1778 | unsigned long size); |
| @@ -1754,5 +1819,11 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; } | |||
| 1754 | static inline bool page_is_guard(struct page *page) { return false; } | 1819 | static inline bool page_is_guard(struct page *page) { return false; } |
| 1755 | #endif /* CONFIG_DEBUG_PAGEALLOC */ | 1820 | #endif /* CONFIG_DEBUG_PAGEALLOC */ |
| 1756 | 1821 | ||
| 1822 | #if MAX_NUMNODES > 1 | ||
| 1823 | void __init setup_nr_node_ids(void); | ||
| 1824 | #else | ||
| 1825 | static inline void setup_nr_node_ids(void) {} | ||
| 1826 | #endif | ||
| 1827 | |||
| 1757 | #endif /* __KERNEL__ */ | 1828 | #endif /* __KERNEL__ */ |
| 1758 | #endif /* _LINUX_MM_H */ | 1829 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index c74092eebf5c..5c76737d836b 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -450,7 +450,7 @@ struct zone { | |||
| 450 | * | 450 | * |
| 451 | * present_pages is physical pages existing within the zone, which | 451 | * present_pages is physical pages existing within the zone, which |
| 452 | * is calculated as: | 452 | * is calculated as: |
| 453 | * present_pages = spanned_pages - absent_pages(pags in holes); | 453 | * present_pages = spanned_pages - absent_pages(pages in holes); |
| 454 | * | 454 | * |
| 455 | * managed_pages is present pages managed by the buddy system, which | 455 | * managed_pages is present pages managed by the buddy system, which |
| 456 | * is calculated as (reserved_pages includes pages allocated by the | 456 | * is calculated as (reserved_pages includes pages allocated by the |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 779cf7c4a3d1..b508016fb76d 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/uuid.h> | ||
| 12 | typedef unsigned long kernel_ulong_t; | 13 | typedef unsigned long kernel_ulong_t; |
| 13 | #endif | 14 | #endif |
| 14 | 15 | ||
| @@ -568,4 +569,12 @@ struct ipack_device_id { | |||
| 568 | __u32 device; /* Device ID or IPACK_ANY_ID */ | 569 | __u32 device; /* Device ID or IPACK_ANY_ID */ |
| 569 | }; | 570 | }; |
| 570 | 571 | ||
| 572 | #define MEI_CL_MODULE_PREFIX "mei:" | ||
| 573 | #define MEI_CL_NAME_SIZE 32 | ||
| 574 | |||
| 575 | struct mei_cl_device_id { | ||
| 576 | char name[MEI_CL_NAME_SIZE]; | ||
| 577 | kernel_ulong_t driver_info; | ||
| 578 | }; | ||
| 579 | |||
| 571 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 580 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/msi.h b/include/linux/msi.h index ce93a341337d..20c2d6dd5d25 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
| @@ -13,14 +13,14 @@ struct msi_msg { | |||
| 13 | /* Helper functions */ | 13 | /* Helper functions */ |
| 14 | struct irq_data; | 14 | struct irq_data; |
| 15 | struct msi_desc; | 15 | struct msi_desc; |
| 16 | extern void mask_msi_irq(struct irq_data *data); | 16 | void mask_msi_irq(struct irq_data *data); |
| 17 | extern void unmask_msi_irq(struct irq_data *data); | 17 | void unmask_msi_irq(struct irq_data *data); |
| 18 | extern void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg); | 18 | void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg); |
| 19 | extern void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg); | 19 | void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg); |
| 20 | extern void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg); | 20 | void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg); |
| 21 | extern void read_msi_msg(unsigned int irq, struct msi_msg *msg); | 21 | void read_msi_msg(unsigned int irq, struct msi_msg *msg); |
| 22 | extern void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg); | 22 | void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg); |
| 23 | extern void write_msi_msg(unsigned int irq, struct msi_msg *msg); | 23 | void write_msi_msg(unsigned int irq, struct msi_msg *msg); |
| 24 | 24 | ||
| 25 | struct msi_desc { | 25 | struct msi_desc { |
| 26 | struct { | 26 | struct { |
| @@ -54,9 +54,8 @@ struct msi_desc { | |||
| 54 | */ | 54 | */ |
| 55 | int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc); | 55 | int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc); |
| 56 | void arch_teardown_msi_irq(unsigned int irq); | 56 | void arch_teardown_msi_irq(unsigned int irq); |
| 57 | extern int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); | 57 | int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); |
| 58 | extern void arch_teardown_msi_irqs(struct pci_dev *dev); | 58 | void arch_teardown_msi_irqs(struct pci_dev *dev); |
| 59 | extern int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); | 59 | int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); |
| 60 | |||
| 61 | 60 | ||
| 62 | #endif /* LINUX_MSI_H */ | 61 | #endif /* LINUX_MSI_H */ |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 9121595a8ebf..433da8a1a426 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
| @@ -53,6 +53,9 @@ struct mutex { | |||
| 53 | #if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP) | 53 | #if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP) |
| 54 | struct task_struct *owner; | 54 | struct task_struct *owner; |
| 55 | #endif | 55 | #endif |
| 56 | #ifdef CONFIG_MUTEX_SPIN_ON_OWNER | ||
| 57 | void *spin_mlock; /* Spinner MCS lock */ | ||
| 58 | #endif | ||
| 56 | #ifdef CONFIG_DEBUG_MUTEXES | 59 | #ifdef CONFIG_DEBUG_MUTEXES |
| 57 | const char *name; | 60 | const char *name; |
| 58 | void *magic; | 61 | void *magic; |
diff --git a/include/linux/net.h b/include/linux/net.h index aa1673160a45..99c9f0c103c2 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -240,8 +240,8 @@ do { \ | |||
| 240 | #define net_dbg_ratelimited(fmt, ...) \ | 240 | #define net_dbg_ratelimited(fmt, ...) \ |
| 241 | net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__) | 241 | net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__) |
| 242 | 242 | ||
| 243 | #define net_random() random32() | 243 | #define net_random() prandom_u32() |
| 244 | #define net_srandom(seed) srandom32((__force u32)seed) | 244 | #define net_srandom(seed) prandom_seed((__force u32)(seed)) |
| 245 | 245 | ||
| 246 | extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg, | 246 | extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg, |
| 247 | struct kvec *vec, size_t num, size_t len); | 247 | struct kvec *vec, size_t num, size_t len); |
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index 01d25e6fc792..0214c4c146fa 100644 --- a/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/include/linux/netfilter/ipset/ip_set_ahash.h | |||
| @@ -291,6 +291,7 @@ ip_set_hash_destroy(struct ip_set *set) | |||
| 291 | #define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist) | 291 | #define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist) |
| 292 | #define type_pf_data_next TOKEN(TYPE, PF, _data_next) | 292 | #define type_pf_data_next TOKEN(TYPE, PF, _data_next) |
| 293 | #define type_pf_data_flags TOKEN(TYPE, PF, _data_flags) | 293 | #define type_pf_data_flags TOKEN(TYPE, PF, _data_flags) |
| 294 | #define type_pf_data_reset_flags TOKEN(TYPE, PF, _data_reset_flags) | ||
| 294 | #ifdef IP_SET_HASH_WITH_NETS | 295 | #ifdef IP_SET_HASH_WITH_NETS |
| 295 | #define type_pf_data_match TOKEN(TYPE, PF, _data_match) | 296 | #define type_pf_data_match TOKEN(TYPE, PF, _data_match) |
| 296 | #else | 297 | #else |
| @@ -385,9 +386,9 @@ type_pf_resize(struct ip_set *set, bool retried) | |||
| 385 | struct ip_set_hash *h = set->data; | 386 | struct ip_set_hash *h = set->data; |
| 386 | struct htable *t, *orig = h->table; | 387 | struct htable *t, *orig = h->table; |
| 387 | u8 htable_bits = orig->htable_bits; | 388 | u8 htable_bits = orig->htable_bits; |
| 388 | const struct type_pf_elem *data; | 389 | struct type_pf_elem *data; |
| 389 | struct hbucket *n, *m; | 390 | struct hbucket *n, *m; |
| 390 | u32 i, j; | 391 | u32 i, j, flags = 0; |
| 391 | int ret; | 392 | int ret; |
| 392 | 393 | ||
| 393 | retry: | 394 | retry: |
| @@ -412,9 +413,16 @@ retry: | |||
| 412 | n = hbucket(orig, i); | 413 | n = hbucket(orig, i); |
| 413 | for (j = 0; j < n->pos; j++) { | 414 | for (j = 0; j < n->pos; j++) { |
| 414 | data = ahash_data(n, j); | 415 | data = ahash_data(n, j); |
| 416 | #ifdef IP_SET_HASH_WITH_NETS | ||
| 417 | flags = 0; | ||
| 418 | type_pf_data_reset_flags(data, &flags); | ||
| 419 | #endif | ||
| 415 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); | 420 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); |
| 416 | ret = type_pf_elem_add(m, data, AHASH_MAX(h), 0); | 421 | ret = type_pf_elem_add(m, data, AHASH_MAX(h), flags); |
| 417 | if (ret < 0) { | 422 | if (ret < 0) { |
| 423 | #ifdef IP_SET_HASH_WITH_NETS | ||
| 424 | type_pf_data_flags(data, flags); | ||
| 425 | #endif | ||
| 418 | read_unlock_bh(&set->lock); | 426 | read_unlock_bh(&set->lock); |
| 419 | ahash_destroy(t); | 427 | ahash_destroy(t); |
| 420 | if (ret == -EAGAIN) | 428 | if (ret == -EAGAIN) |
| @@ -836,9 +844,9 @@ type_pf_tresize(struct ip_set *set, bool retried) | |||
| 836 | struct ip_set_hash *h = set->data; | 844 | struct ip_set_hash *h = set->data; |
| 837 | struct htable *t, *orig = h->table; | 845 | struct htable *t, *orig = h->table; |
| 838 | u8 htable_bits = orig->htable_bits; | 846 | u8 htable_bits = orig->htable_bits; |
| 839 | const struct type_pf_elem *data; | 847 | struct type_pf_elem *data; |
| 840 | struct hbucket *n, *m; | 848 | struct hbucket *n, *m; |
| 841 | u32 i, j; | 849 | u32 i, j, flags = 0; |
| 842 | int ret; | 850 | int ret; |
| 843 | 851 | ||
| 844 | /* Try to cleanup once */ | 852 | /* Try to cleanup once */ |
| @@ -873,10 +881,17 @@ retry: | |||
| 873 | n = hbucket(orig, i); | 881 | n = hbucket(orig, i); |
| 874 | for (j = 0; j < n->pos; j++) { | 882 | for (j = 0; j < n->pos; j++) { |
| 875 | data = ahash_tdata(n, j); | 883 | data = ahash_tdata(n, j); |
| 884 | #ifdef IP_SET_HASH_WITH_NETS | ||
| 885 | flags = 0; | ||
| 886 | type_pf_data_reset_flags(data, &flags); | ||
| 887 | #endif | ||
| 876 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); | 888 | m = hbucket(t, HKEY(data, h->initval, htable_bits)); |
| 877 | ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), 0, | 889 | ret = type_pf_elem_tadd(m, data, AHASH_MAX(h), flags, |
| 878 | ip_set_timeout_get(type_pf_data_timeout(data))); | 890 | ip_set_timeout_get(type_pf_data_timeout(data))); |
| 879 | if (ret < 0) { | 891 | if (ret < 0) { |
| 892 | #ifdef IP_SET_HASH_WITH_NETS | ||
| 893 | type_pf_data_flags(data, flags); | ||
| 894 | #endif | ||
| 880 | read_unlock_bh(&set->lock); | 895 | read_unlock_bh(&set->lock); |
| 881 | ahash_destroy(t); | 896 | ahash_destroy(t); |
| 882 | if (ret == -EAGAIN) | 897 | if (ret == -EAGAIN) |
| @@ -1187,6 +1202,7 @@ type_pf_gc_init(struct ip_set *set) | |||
| 1187 | #undef type_pf_data_tlist | 1202 | #undef type_pf_data_tlist |
| 1188 | #undef type_pf_data_next | 1203 | #undef type_pf_data_next |
| 1189 | #undef type_pf_data_flags | 1204 | #undef type_pf_data_flags |
| 1205 | #undef type_pf_data_reset_flags | ||
| 1190 | #undef type_pf_data_match | 1206 | #undef type_pf_data_match |
| 1191 | 1207 | ||
| 1192 | #undef type_pf_elem | 1208 | #undef type_pf_elem |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 1cc25682b20b..fc01d5cb4cf1 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -59,11 +59,18 @@ struct nfs_lockowner { | |||
| 59 | pid_t l_pid; | 59 | pid_t l_pid; |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | #define NFS_IO_INPROGRESS 0 | ||
| 63 | struct nfs_io_counter { | ||
| 64 | unsigned long flags; | ||
| 65 | atomic_t io_count; | ||
| 66 | }; | ||
| 67 | |||
| 62 | struct nfs_lock_context { | 68 | struct nfs_lock_context { |
| 63 | atomic_t count; | 69 | atomic_t count; |
| 64 | struct list_head list; | 70 | struct list_head list; |
| 65 | struct nfs_open_context *open_context; | 71 | struct nfs_open_context *open_context; |
| 66 | struct nfs_lockowner lockowner; | 72 | struct nfs_lockowner lockowner; |
| 73 | struct nfs_io_counter io_count; | ||
| 67 | }; | 74 | }; |
| 68 | 75 | ||
| 69 | struct nfs4_state; | 76 | struct nfs4_state; |
| @@ -77,6 +84,7 @@ struct nfs_open_context { | |||
| 77 | unsigned long flags; | 84 | unsigned long flags; |
| 78 | #define NFS_CONTEXT_ERROR_WRITE (0) | 85 | #define NFS_CONTEXT_ERROR_WRITE (0) |
| 79 | #define NFS_CONTEXT_RESEND_WRITES (1) | 86 | #define NFS_CONTEXT_RESEND_WRITES (1) |
| 87 | #define NFS_CONTEXT_BAD (2) | ||
| 80 | int error; | 88 | int error; |
| 81 | 89 | ||
| 82 | struct list_head list; | 90 | struct list_head list; |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 6c6ed153a9b4..3b7fa2abecca 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -40,6 +40,7 @@ struct nfs_client { | |||
| 40 | #define NFS_CS_NORESVPORT 0 /* - use ephemeral src port */ | 40 | #define NFS_CS_NORESVPORT 0 /* - use ephemeral src port */ |
| 41 | #define NFS_CS_DISCRTRY 1 /* - disconnect on RPC retry */ | 41 | #define NFS_CS_DISCRTRY 1 /* - disconnect on RPC retry */ |
| 42 | #define NFS_CS_MIGRATION 2 /* - transparent state migr */ | 42 | #define NFS_CS_MIGRATION 2 /* - transparent state migr */ |
| 43 | #define NFS_CS_INFINITE_SLOTS 3 /* - don't limit TCP slots */ | ||
| 43 | struct sockaddr_storage cl_addr; /* server identifier */ | 44 | struct sockaddr_storage cl_addr; /* server identifier */ |
| 44 | size_t cl_addrlen; | 45 | size_t cl_addrlen; |
| 45 | char * cl_hostname; /* hostname of server */ | 46 | char * cl_hostname; /* hostname of server */ |
| @@ -197,5 +198,7 @@ struct nfs_server { | |||
| 197 | #define NFS_CAP_MTIME (1U << 13) | 198 | #define NFS_CAP_MTIME (1U << 13) |
| 198 | #define NFS_CAP_POSIX_LOCK (1U << 14) | 199 | #define NFS_CAP_POSIX_LOCK (1U << 14) |
| 199 | #define NFS_CAP_UIDGID_NOMAP (1U << 15) | 200 | #define NFS_CAP_UIDGID_NOMAP (1U << 15) |
| 201 | #define NFS_CAP_STATEID_NFSV41 (1U << 16) | ||
| 202 | #define NFS_CAP_ATOMIC_OPEN_V1 (1U << 17) | ||
| 200 | 203 | ||
| 201 | #endif | 204 | #endif |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 4b993d358dad..766c5bc9d441 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -14,9 +14,6 @@ | |||
| 14 | #define NFS_DEF_FILE_IO_SIZE (4096U) | 14 | #define NFS_DEF_FILE_IO_SIZE (4096U) |
| 15 | #define NFS_MIN_FILE_IO_SIZE (1024U) | 15 | #define NFS_MIN_FILE_IO_SIZE (1024U) |
| 16 | 16 | ||
| 17 | /* Forward declaration for NFS v3 */ | ||
| 18 | struct nfs4_secinfo_flavors; | ||
| 19 | |||
| 20 | struct nfs4_string { | 17 | struct nfs4_string { |
| 21 | unsigned int len; | 18 | unsigned int len; |
| 22 | char *data; | 19 | char *data; |
| @@ -349,6 +346,7 @@ struct nfs_openargs { | |||
| 349 | const u32 * bitmask; | 346 | const u32 * bitmask; |
| 350 | const u32 * open_bitmap; | 347 | const u32 * open_bitmap; |
| 351 | __u32 claim; | 348 | __u32 claim; |
| 349 | enum createmode4 createmode; | ||
| 352 | }; | 350 | }; |
| 353 | 351 | ||
| 354 | struct nfs_openres { | 352 | struct nfs_openres { |
| @@ -486,6 +484,7 @@ struct nfs_readargs { | |||
| 486 | struct nfs_fh * fh; | 484 | struct nfs_fh * fh; |
| 487 | struct nfs_open_context *context; | 485 | struct nfs_open_context *context; |
| 488 | struct nfs_lock_context *lock_context; | 486 | struct nfs_lock_context *lock_context; |
| 487 | nfs4_stateid stateid; | ||
| 489 | __u64 offset; | 488 | __u64 offset; |
| 490 | __u32 count; | 489 | __u32 count; |
| 491 | unsigned int pgbase; | 490 | unsigned int pgbase; |
| @@ -507,6 +506,7 @@ struct nfs_writeargs { | |||
| 507 | struct nfs_fh * fh; | 506 | struct nfs_fh * fh; |
| 508 | struct nfs_open_context *context; | 507 | struct nfs_open_context *context; |
| 509 | struct nfs_lock_context *lock_context; | 508 | struct nfs_lock_context *lock_context; |
| 509 | nfs4_stateid stateid; | ||
| 510 | __u64 offset; | 510 | __u64 offset; |
| 511 | __u32 count; | 511 | __u32 count; |
| 512 | enum nfs3_stable_how stable; | 512 | enum nfs3_stable_how stable; |
| @@ -1050,25 +1050,14 @@ struct nfs4_fs_locations_res { | |||
| 1050 | struct nfs4_fs_locations *fs_locations; | 1050 | struct nfs4_fs_locations *fs_locations; |
| 1051 | }; | 1051 | }; |
| 1052 | 1052 | ||
| 1053 | struct nfs4_secinfo_oid { | 1053 | struct nfs4_secinfo4 { |
| 1054 | unsigned int len; | 1054 | u32 flavor; |
| 1055 | char data[GSS_OID_MAX_LEN]; | 1055 | struct rpcsec_gss_info flavor_info; |
| 1056 | }; | ||
| 1057 | |||
| 1058 | struct nfs4_secinfo_gss { | ||
| 1059 | struct nfs4_secinfo_oid sec_oid4; | ||
| 1060 | unsigned int qop4; | ||
| 1061 | unsigned int service; | ||
| 1062 | }; | ||
| 1063 | |||
| 1064 | struct nfs4_secinfo_flavor { | ||
| 1065 | unsigned int flavor; | ||
| 1066 | struct nfs4_secinfo_gss gss; | ||
| 1067 | }; | 1056 | }; |
| 1068 | 1057 | ||
| 1069 | struct nfs4_secinfo_flavors { | 1058 | struct nfs4_secinfo_flavors { |
| 1070 | unsigned int num_flavors; | 1059 | unsigned int num_flavors; |
| 1071 | struct nfs4_secinfo_flavor flavors[0]; | 1060 | struct nfs4_secinfo4 flavors[0]; |
| 1072 | }; | 1061 | }; |
| 1073 | 1062 | ||
| 1074 | struct nfs4_secinfo_arg { | 1063 | struct nfs4_secinfo_arg { |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index d65746efc954..d14a4c362465 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
| @@ -47,8 +47,11 @@ | |||
| 47 | * runtime initialization. | 47 | * runtime initialization. |
| 48 | */ | 48 | */ |
| 49 | 49 | ||
| 50 | typedef int (*notifier_fn_t)(struct notifier_block *nb, | ||
| 51 | unsigned long action, void *data); | ||
| 52 | |||
| 50 | struct notifier_block { | 53 | struct notifier_block { |
| 51 | int (*notifier_call)(struct notifier_block *, unsigned long, void *); | 54 | notifier_fn_t notifier_call; |
| 52 | struct notifier_block __rcu *next; | 55 | struct notifier_block __rcu *next; |
| 53 | int priority; | 56 | int priority; |
| 54 | }; | 57 | }; |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 0e38e13eb249..e3dea75a078b 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -149,7 +149,7 @@ static inline int page_cache_get_speculative(struct page *page) | |||
| 149 | { | 149 | { |
| 150 | VM_BUG_ON(in_interrupt()); | 150 | VM_BUG_ON(in_interrupt()); |
| 151 | 151 | ||
| 152 | #if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) | 152 | #ifdef CONFIG_TINY_RCU |
| 153 | # ifdef CONFIG_PREEMPT_COUNT | 153 | # ifdef CONFIG_PREEMPT_COUNT |
| 154 | VM_BUG_ON(!in_atomic()); | 154 | VM_BUG_ON(!in_atomic()); |
| 155 | # endif | 155 | # endif |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 9a22b5efb384..81b31613eb25 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
| @@ -41,8 +41,37 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | |||
| 41 | 41 | ||
| 42 | return DEVICE_ACPI_HANDLE(dev); | 42 | return DEVICE_ACPI_HANDLE(dev); |
| 43 | } | 43 | } |
| 44 | |||
| 45 | void acpi_pci_add_bus(struct pci_bus *bus); | ||
| 46 | void acpi_pci_remove_bus(struct pci_bus *bus); | ||
| 47 | |||
| 48 | #ifdef CONFIG_ACPI_PCI_SLOT | ||
| 49 | void acpi_pci_slot_init(void); | ||
| 50 | void acpi_pci_slot_enumerate(struct pci_bus *bus, acpi_handle handle); | ||
| 51 | void acpi_pci_slot_remove(struct pci_bus *bus); | ||
| 52 | #else | ||
| 53 | static inline void acpi_pci_slot_init(void) { } | ||
| 54 | static inline void acpi_pci_slot_enumerate(struct pci_bus *bus, | ||
| 55 | acpi_handle handle) { } | ||
| 56 | static inline void acpi_pci_slot_remove(struct pci_bus *bus) { } | ||
| 44 | #endif | 57 | #endif |
| 45 | 58 | ||
| 59 | #ifdef CONFIG_HOTPLUG_PCI_ACPI | ||
| 60 | void acpiphp_init(void); | ||
| 61 | void acpiphp_enumerate_slots(struct pci_bus *bus, acpi_handle handle); | ||
| 62 | void acpiphp_remove_slots(struct pci_bus *bus); | ||
| 63 | #else | ||
| 64 | static inline void acpiphp_init(void) { } | ||
| 65 | static inline void acpiphp_enumerate_slots(struct pci_bus *bus, | ||
| 66 | acpi_handle handle) { } | ||
| 67 | static inline void acpiphp_remove_slots(struct pci_bus *bus) { } | ||
| 68 | #endif | ||
| 69 | |||
| 70 | #else /* CONFIG_ACPI */ | ||
| 71 | static inline void acpi_pci_add_bus(struct pci_bus *bus) { } | ||
| 72 | static inline void acpi_pci_remove_bus(struct pci_bus *bus) { } | ||
| 73 | #endif /* CONFIG_ACPI */ | ||
| 74 | |||
| 46 | #ifdef CONFIG_ACPI_APEI | 75 | #ifdef CONFIG_ACPI_APEI |
| 47 | extern bool aer_acpi_firmware_first(void); | 76 | extern bool aer_acpi_firmware_first(void); |
| 48 | #else | 77 | #else |
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h index c8320144fe79..8af4610c2e41 100644 --- a/include/linux/pci-aspm.h +++ b/include/linux/pci-aspm.h | |||
| @@ -23,14 +23,14 @@ | |||
| 23 | #define PCIE_LINK_STATE_CLKPM 4 | 23 | #define PCIE_LINK_STATE_CLKPM 4 |
| 24 | 24 | ||
| 25 | #ifdef CONFIG_PCIEASPM | 25 | #ifdef CONFIG_PCIEASPM |
| 26 | extern void pcie_aspm_init_link_state(struct pci_dev *pdev); | 26 | void pcie_aspm_init_link_state(struct pci_dev *pdev); |
| 27 | extern void pcie_aspm_exit_link_state(struct pci_dev *pdev); | 27 | void pcie_aspm_exit_link_state(struct pci_dev *pdev); |
| 28 | extern void pcie_aspm_pm_state_change(struct pci_dev *pdev); | 28 | void pcie_aspm_pm_state_change(struct pci_dev *pdev); |
| 29 | extern void pcie_aspm_powersave_config_link(struct pci_dev *pdev); | 29 | void pcie_aspm_powersave_config_link(struct pci_dev *pdev); |
| 30 | extern void pci_disable_link_state(struct pci_dev *pdev, int state); | 30 | void pci_disable_link_state(struct pci_dev *pdev, int state); |
| 31 | extern void pci_disable_link_state_locked(struct pci_dev *pdev, int state); | 31 | void pci_disable_link_state_locked(struct pci_dev *pdev, int state); |
| 32 | extern void pcie_clear_aspm(struct pci_bus *bus); | 32 | void pcie_clear_aspm(struct pci_bus *bus); |
| 33 | extern void pcie_no_aspm(void); | 33 | void pcie_no_aspm(void); |
| 34 | #else | 34 | #else |
| 35 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) | 35 | static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) |
| 36 | { | 36 | { |
| @@ -56,8 +56,8 @@ static inline void pcie_no_aspm(void) | |||
| 56 | #endif | 56 | #endif |
| 57 | 57 | ||
| 58 | #ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */ | 58 | #ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */ |
| 59 | extern void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev); | 59 | void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev); |
| 60 | extern void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev); | 60 | void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev); |
| 61 | #else | 61 | #else |
| 62 | static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) | 62 | static inline void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev) |
| 63 | { | 63 | { |
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index 7ef68724f0f0..68bcefd7fca0 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h | |||
| @@ -14,9 +14,9 @@ struct pci_ats { | |||
| 14 | 14 | ||
| 15 | #ifdef CONFIG_PCI_ATS | 15 | #ifdef CONFIG_PCI_ATS |
| 16 | 16 | ||
| 17 | extern int pci_enable_ats(struct pci_dev *dev, int ps); | 17 | int pci_enable_ats(struct pci_dev *dev, int ps); |
| 18 | extern void pci_disable_ats(struct pci_dev *dev); | 18 | void pci_disable_ats(struct pci_dev *dev); |
| 19 | extern int pci_ats_queue_depth(struct pci_dev *dev); | 19 | int pci_ats_queue_depth(struct pci_dev *dev); |
| 20 | 20 | ||
| 21 | /** | 21 | /** |
| 22 | * pci_ats_enabled - query the ATS status | 22 | * pci_ats_enabled - query the ATS status |
| @@ -54,12 +54,12 @@ static inline int pci_ats_enabled(struct pci_dev *dev) | |||
| 54 | 54 | ||
| 55 | #ifdef CONFIG_PCI_PRI | 55 | #ifdef CONFIG_PCI_PRI |
| 56 | 56 | ||
| 57 | extern int pci_enable_pri(struct pci_dev *pdev, u32 reqs); | 57 | int pci_enable_pri(struct pci_dev *pdev, u32 reqs); |
| 58 | extern void pci_disable_pri(struct pci_dev *pdev); | 58 | void pci_disable_pri(struct pci_dev *pdev); |
| 59 | extern bool pci_pri_enabled(struct pci_dev *pdev); | 59 | bool pci_pri_enabled(struct pci_dev *pdev); |
| 60 | extern int pci_reset_pri(struct pci_dev *pdev); | 60 | int pci_reset_pri(struct pci_dev *pdev); |
| 61 | extern bool pci_pri_stopped(struct pci_dev *pdev); | 61 | bool pci_pri_stopped(struct pci_dev *pdev); |
| 62 | extern int pci_pri_status(struct pci_dev *pdev); | 62 | int pci_pri_status(struct pci_dev *pdev); |
| 63 | 63 | ||
| 64 | #else /* CONFIG_PCI_PRI */ | 64 | #else /* CONFIG_PCI_PRI */ |
| 65 | 65 | ||
| @@ -95,10 +95,10 @@ static inline int pci_pri_status(struct pci_dev *pdev) | |||
| 95 | 95 | ||
| 96 | #ifdef CONFIG_PCI_PASID | 96 | #ifdef CONFIG_PCI_PASID |
| 97 | 97 | ||
| 98 | extern int pci_enable_pasid(struct pci_dev *pdev, int features); | 98 | int pci_enable_pasid(struct pci_dev *pdev, int features); |
| 99 | extern void pci_disable_pasid(struct pci_dev *pdev); | 99 | void pci_disable_pasid(struct pci_dev *pdev); |
| 100 | extern int pci_pasid_features(struct pci_dev *pdev); | 100 | int pci_pasid_features(struct pci_dev *pdev); |
| 101 | extern int pci_max_pasids(struct pci_dev *pdev); | 101 | int pci_max_pasids(struct pci_dev *pdev); |
| 102 | 102 | ||
| 103 | #else /* CONFIG_PCI_PASID */ | 103 | #else /* CONFIG_PCI_PASID */ |
| 104 | 104 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 710067f3618c..e73dfa308b87 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -35,6 +35,21 @@ | |||
| 35 | /* Include the ID list */ | 35 | /* Include the ID list */ |
| 36 | #include <linux/pci_ids.h> | 36 | #include <linux/pci_ids.h> |
| 37 | 37 | ||
| 38 | /* | ||
| 39 | * The PCI interface treats multi-function devices as independent | ||
| 40 | * devices. The slot/function address of each device is encoded | ||
| 41 | * in a single byte as follows: | ||
| 42 | * | ||
| 43 | * 7:3 = slot | ||
| 44 | * 2:0 = function | ||
| 45 | * PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined uapi/linux/pci.h | ||
| 46 | * In the interest of not exposing interfaces to user-space unnecessarily, | ||
| 47 | * the following kernel only defines are being added here. | ||
| 48 | */ | ||
| 49 | #define PCI_DEVID(bus, devfn) ((((u16)bus) << 8) | devfn) | ||
| 50 | /* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */ | ||
| 51 | #define PCI_BUS_NUM(x) (((x) >> 8) & 0xff) | ||
| 52 | |||
| 38 | /* pci_slot represents a physical slot */ | 53 | /* pci_slot represents a physical slot */ |
| 39 | struct pci_slot { | 54 | struct pci_slot { |
| 40 | struct pci_bus *bus; /* The bus this slot is on */ | 55 | struct pci_bus *bus; /* The bus this slot is on */ |
| @@ -232,6 +247,8 @@ struct pci_dev { | |||
| 232 | u8 revision; /* PCI revision, low byte of class word */ | 247 | u8 revision; /* PCI revision, low byte of class word */ |
| 233 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ | 248 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ |
| 234 | u8 pcie_cap; /* PCI-E capability offset */ | 249 | u8 pcie_cap; /* PCI-E capability offset */ |
| 250 | u8 msi_cap; /* MSI capability offset */ | ||
| 251 | u8 msix_cap; /* MSI-X capability offset */ | ||
| 235 | u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ | 252 | u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ |
| 236 | u8 rom_base_reg; /* which config register controls the ROM */ | 253 | u8 rom_base_reg; /* which config register controls the ROM */ |
| 237 | u8 pin; /* which interrupt pin this device uses */ | 254 | u8 pin; /* which interrupt pin this device uses */ |
| @@ -249,8 +266,7 @@ struct pci_dev { | |||
| 249 | pci_power_t current_state; /* Current operating state. In ACPI-speak, | 266 | pci_power_t current_state; /* Current operating state. In ACPI-speak, |
| 250 | this is D0-D3, D0 being fully functional, | 267 | this is D0-D3, D0 being fully functional, |
| 251 | and D3 being off. */ | 268 | and D3 being off. */ |
| 252 | int pm_cap; /* PM capability offset in the | 269 | u8 pm_cap; /* PM capability offset */ |
| 253 | configuration space */ | ||
| 254 | unsigned int pme_support:5; /* Bitmask of states from which PME# | 270 | unsigned int pme_support:5; /* Bitmask of states from which PME# |
| 255 | can be generated */ | 271 | can be generated */ |
| 256 | unsigned int pme_interrupt:1; | 272 | unsigned int pme_interrupt:1; |
| @@ -348,7 +364,7 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) | |||
| 348 | return dev; | 364 | return dev; |
| 349 | } | 365 | } |
| 350 | 366 | ||
| 351 | extern struct pci_dev *alloc_pci_dev(void); | 367 | struct pci_dev *alloc_pci_dev(void); |
| 352 | 368 | ||
| 353 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) | 369 | #define to_pci_dev(n) container_of(n, struct pci_dev, dev) |
| 354 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) | 370 | #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) |
| @@ -504,10 +520,10 @@ struct pci_ops { | |||
| 504 | * ACPI needs to be able to access PCI config space before we've done a | 520 | * ACPI needs to be able to access PCI config space before we've done a |
| 505 | * PCI bus scan and created pci_bus structures. | 521 | * PCI bus scan and created pci_bus structures. |
| 506 | */ | 522 | */ |
| 507 | extern int raw_pci_read(unsigned int domain, unsigned int bus, | 523 | int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, |
| 508 | unsigned int devfn, int reg, int len, u32 *val); | 524 | int reg, int len, u32 *val); |
| 509 | extern int raw_pci_write(unsigned int domain, unsigned int bus, | 525 | int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, |
| 510 | unsigned int devfn, int reg, int len, u32 val); | 526 | int reg, int len, u32 val); |
| 511 | 527 | ||
| 512 | struct pci_bus_region { | 528 | struct pci_bus_region { |
| 513 | resource_size_t start; | 529 | resource_size_t start; |
| @@ -658,7 +674,7 @@ struct pci_driver { | |||
| 658 | /* these external functions are only available when PCI support is enabled */ | 674 | /* these external functions are only available when PCI support is enabled */ |
| 659 | #ifdef CONFIG_PCI | 675 | #ifdef CONFIG_PCI |
| 660 | 676 | ||
| 661 | extern void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss); | 677 | void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss); |
| 662 | 678 | ||
| 663 | enum pcie_bus_config_types { | 679 | enum pcie_bus_config_types { |
| 664 | PCIE_BUS_TUNE_OFF, | 680 | PCIE_BUS_TUNE_OFF, |
| @@ -675,9 +691,11 @@ extern struct bus_type pci_bus_type; | |||
| 675 | * code, or pci core code. */ | 691 | * code, or pci core code. */ |
| 676 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ | 692 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ |
| 677 | /* Some device drivers need know if pci is initiated */ | 693 | /* Some device drivers need know if pci is initiated */ |
| 678 | extern int no_pci_devices(void); | 694 | int no_pci_devices(void); |
| 679 | 695 | ||
| 680 | void pcibios_resource_survey_bus(struct pci_bus *bus); | 696 | void pcibios_resource_survey_bus(struct pci_bus *bus); |
| 697 | void pcibios_add_bus(struct pci_bus *bus); | ||
| 698 | void pcibios_remove_bus(struct pci_bus *bus); | ||
| 681 | void pcibios_fixup_bus(struct pci_bus *); | 699 | void pcibios_fixup_bus(struct pci_bus *); |
| 682 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); | 700 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); |
| 683 | /* Architecture specific versions may override this (weak) */ | 701 | /* Architecture specific versions may override this (weak) */ |
| @@ -699,7 +717,7 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | |||
| 699 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | 717 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, |
| 700 | struct pci_bus_region *region); | 718 | struct pci_bus_region *region); |
| 701 | void pcibios_scan_specific_bus(int busn); | 719 | void pcibios_scan_specific_bus(int busn); |
| 702 | extern struct pci_bus *pci_find_bus(int domain, int busnr); | 720 | struct pci_bus *pci_find_bus(int domain, int busnr); |
| 703 | void pci_bus_add_devices(const struct pci_bus *bus); | 721 | void pci_bus_add_devices(const struct pci_bus *bus); |
| 704 | struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, | 722 | struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, |
| 705 | struct pci_ops *ops, void *sysdata); | 723 | struct pci_ops *ops, void *sysdata); |
| @@ -732,14 +750,14 @@ struct resource *pci_find_parent_resource(const struct pci_dev *dev, | |||
| 732 | u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin); | 750 | u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin); |
| 733 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); | 751 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); |
| 734 | u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); | 752 | u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp); |
| 735 | extern struct pci_dev *pci_dev_get(struct pci_dev *dev); | 753 | struct pci_dev *pci_dev_get(struct pci_dev *dev); |
| 736 | extern void pci_dev_put(struct pci_dev *dev); | 754 | void pci_dev_put(struct pci_dev *dev); |
| 737 | extern void pci_remove_bus(struct pci_bus *b); | 755 | void pci_remove_bus(struct pci_bus *b); |
| 738 | extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); | 756 | void pci_stop_and_remove_bus_device(struct pci_dev *dev); |
| 739 | void pci_stop_root_bus(struct pci_bus *bus); | 757 | void pci_stop_root_bus(struct pci_bus *bus); |
| 740 | void pci_remove_root_bus(struct pci_bus *bus); | 758 | void pci_remove_root_bus(struct pci_bus *bus); |
| 741 | void pci_setup_cardbus(struct pci_bus *bus); | 759 | void pci_setup_cardbus(struct pci_bus *bus); |
| 742 | extern void pci_sort_breadthfirst(void); | 760 | void pci_sort_breadthfirst(void); |
| 743 | #define dev_is_pci(d) ((d)->bus == &pci_bus_type) | 761 | #define dev_is_pci(d) ((d)->bus == &pci_bus_type) |
| 744 | #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) | 762 | #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) |
| 745 | #define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) | 763 | #define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) |
| @@ -1142,18 +1160,17 @@ static inline int pci_msi_enabled(void) | |||
| 1142 | return 0; | 1160 | return 0; |
| 1143 | } | 1161 | } |
| 1144 | #else | 1162 | #else |
| 1145 | extern int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); | 1163 | int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec); |
| 1146 | extern int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); | 1164 | int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); |
| 1147 | extern void pci_msi_shutdown(struct pci_dev *dev); | 1165 | void pci_msi_shutdown(struct pci_dev *dev); |
| 1148 | extern void pci_disable_msi(struct pci_dev *dev); | 1166 | void pci_disable_msi(struct pci_dev *dev); |
| 1149 | extern int pci_msix_table_size(struct pci_dev *dev); | 1167 | int pci_msix_table_size(struct pci_dev *dev); |
| 1150 | extern int pci_enable_msix(struct pci_dev *dev, | 1168 | int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); |
| 1151 | struct msix_entry *entries, int nvec); | 1169 | void pci_msix_shutdown(struct pci_dev *dev); |
| 1152 | extern void pci_msix_shutdown(struct pci_dev *dev); | 1170 | void pci_disable_msix(struct pci_dev *dev); |
| 1153 | extern void pci_disable_msix(struct pci_dev *dev); | 1171 | void msi_remove_pci_irq_vectors(struct pci_dev *dev); |
| 1154 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); | 1172 | void pci_restore_msi_state(struct pci_dev *dev); |
| 1155 | extern void pci_restore_msi_state(struct pci_dev *dev); | 1173 | int pci_msi_enabled(void); |
| 1156 | extern int pci_msi_enabled(void); | ||
| 1157 | #endif | 1174 | #endif |
| 1158 | 1175 | ||
| 1159 | #ifdef CONFIG_PCIEPORTBUS | 1176 | #ifdef CONFIG_PCIEPORTBUS |
| @@ -1168,8 +1185,8 @@ extern bool pcie_ports_auto; | |||
| 1168 | static inline int pcie_aspm_enabled(void) { return 0; } | 1185 | static inline int pcie_aspm_enabled(void) { return 0; } |
| 1169 | static inline bool pcie_aspm_support_enabled(void) { return false; } | 1186 | static inline bool pcie_aspm_support_enabled(void) { return false; } |
| 1170 | #else | 1187 | #else |
| 1171 | extern int pcie_aspm_enabled(void); | 1188 | int pcie_aspm_enabled(void); |
| 1172 | extern bool pcie_aspm_support_enabled(void); | 1189 | bool pcie_aspm_support_enabled(void); |
| 1173 | #endif | 1190 | #endif |
| 1174 | 1191 | ||
| 1175 | #ifdef CONFIG_PCIEAER | 1192 | #ifdef CONFIG_PCIEAER |
| @@ -1187,8 +1204,8 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev) | |||
| 1187 | } | 1204 | } |
| 1188 | static inline void pcie_ecrc_get_policy(char *str) {}; | 1205 | static inline void pcie_ecrc_get_policy(char *str) {}; |
| 1189 | #else | 1206 | #else |
| 1190 | extern void pcie_set_ecrc_checking(struct pci_dev *dev); | 1207 | void pcie_set_ecrc_checking(struct pci_dev *dev); |
| 1191 | extern void pcie_ecrc_get_policy(char *str); | 1208 | void pcie_ecrc_get_policy(char *str); |
| 1192 | #endif | 1209 | #endif |
| 1193 | 1210 | ||
| 1194 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) | 1211 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) |
| @@ -1199,9 +1216,9 @@ int ht_create_irq(struct pci_dev *dev, int idx); | |||
| 1199 | void ht_destroy_irq(unsigned int irq); | 1216 | void ht_destroy_irq(unsigned int irq); |
| 1200 | #endif /* CONFIG_HT_IRQ */ | 1217 | #endif /* CONFIG_HT_IRQ */ |
| 1201 | 1218 | ||
| 1202 | extern void pci_cfg_access_lock(struct pci_dev *dev); | 1219 | void pci_cfg_access_lock(struct pci_dev *dev); |
| 1203 | extern bool pci_cfg_access_trylock(struct pci_dev *dev); | 1220 | bool pci_cfg_access_trylock(struct pci_dev *dev); |
| 1204 | extern void pci_cfg_access_unlock(struct pci_dev *dev); | 1221 | void pci_cfg_access_unlock(struct pci_dev *dev); |
| 1205 | 1222 | ||
| 1206 | /* | 1223 | /* |
| 1207 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), | 1224 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), |
| @@ -1226,7 +1243,7 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
| 1226 | /* some architectures require additional setup to direct VGA traffic */ | 1243 | /* some architectures require additional setup to direct VGA traffic */ |
| 1227 | typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, | 1244 | typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, |
| 1228 | unsigned int command_bits, u32 flags); | 1245 | unsigned int command_bits, u32 flags); |
| 1229 | extern void pci_register_set_vga_state(arch_set_vga_state_t func); | 1246 | void pci_register_set_vga_state(arch_set_vga_state_t func); |
| 1230 | 1247 | ||
| 1231 | #else /* CONFIG_PCI is not enabled */ | 1248 | #else /* CONFIG_PCI is not enabled */ |
| 1232 | 1249 | ||
| @@ -1628,8 +1645,8 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, | |||
| 1628 | int pcibios_add_device(struct pci_dev *dev); | 1645 | int pcibios_add_device(struct pci_dev *dev); |
| 1629 | 1646 | ||
| 1630 | #ifdef CONFIG_PCI_MMCONFIG | 1647 | #ifdef CONFIG_PCI_MMCONFIG |
| 1631 | extern void __init pci_mmcfg_early_init(void); | 1648 | void __init pci_mmcfg_early_init(void); |
| 1632 | extern void __init pci_mmcfg_late_init(void); | 1649 | void __init pci_mmcfg_late_init(void); |
| 1633 | #else | 1650 | #else |
| 1634 | static inline void pci_mmcfg_early_init(void) { } | 1651 | static inline void pci_mmcfg_early_init(void) { } |
| 1635 | static inline void pci_mmcfg_late_init(void) { } | 1652 | static inline void pci_mmcfg_late_init(void) { } |
| @@ -1640,12 +1657,12 @@ int pci_ext_cfg_avail(void); | |||
| 1640 | void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); | 1657 | void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); |
| 1641 | 1658 | ||
| 1642 | #ifdef CONFIG_PCI_IOV | 1659 | #ifdef CONFIG_PCI_IOV |
| 1643 | extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); | 1660 | int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); |
| 1644 | extern void pci_disable_sriov(struct pci_dev *dev); | 1661 | void pci_disable_sriov(struct pci_dev *dev); |
| 1645 | extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); | 1662 | irqreturn_t pci_sriov_migration(struct pci_dev *dev); |
| 1646 | extern int pci_num_vf(struct pci_dev *dev); | 1663 | int pci_num_vf(struct pci_dev *dev); |
| 1647 | extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); | 1664 | int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); |
| 1648 | extern int pci_sriov_get_totalvfs(struct pci_dev *dev); | 1665 | int pci_sriov_get_totalvfs(struct pci_dev *dev); |
| 1649 | #else | 1666 | #else |
| 1650 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) | 1667 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) |
| 1651 | { | 1668 | { |
| @@ -1673,8 +1690,8 @@ static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) | |||
| 1673 | #endif | 1690 | #endif |
| 1674 | 1691 | ||
| 1675 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) | 1692 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) |
| 1676 | extern void pci_hp_create_module_link(struct pci_slot *pci_slot); | 1693 | void pci_hp_create_module_link(struct pci_slot *pci_slot); |
| 1677 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); | 1694 | void pci_hp_remove_module_link(struct pci_slot *pci_slot); |
| 1678 | #endif | 1695 | #endif |
| 1679 | 1696 | ||
| 1680 | /** | 1697 | /** |
| @@ -1818,13 +1835,13 @@ int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, | |||
| 1818 | /* PCI <-> OF binding helpers */ | 1835 | /* PCI <-> OF binding helpers */ |
| 1819 | #ifdef CONFIG_OF | 1836 | #ifdef CONFIG_OF |
| 1820 | struct device_node; | 1837 | struct device_node; |
| 1821 | extern void pci_set_of_node(struct pci_dev *dev); | 1838 | void pci_set_of_node(struct pci_dev *dev); |
| 1822 | extern void pci_release_of_node(struct pci_dev *dev); | 1839 | void pci_release_of_node(struct pci_dev *dev); |
| 1823 | extern void pci_set_bus_of_node(struct pci_bus *bus); | 1840 | void pci_set_bus_of_node(struct pci_bus *bus); |
| 1824 | extern void pci_release_bus_of_node(struct pci_bus *bus); | 1841 | void pci_release_bus_of_node(struct pci_bus *bus); |
| 1825 | 1842 | ||
| 1826 | /* Arch may override this (weak) */ | 1843 | /* Arch may override this (weak) */ |
| 1827 | extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus); | 1844 | struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus); |
| 1828 | 1845 | ||
| 1829 | static inline struct device_node * | 1846 | static inline struct device_node * |
| 1830 | pci_device_to_OF_node(const struct pci_dev *pdev) | 1847 | pci_device_to_OF_node(const struct pci_dev *pdev) |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 45fc162cbdc0..8db71dcd6337 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
| @@ -125,12 +125,12 @@ static inline const char *hotplug_slot_name(const struct hotplug_slot *slot) | |||
| 125 | return pci_slot_name(slot->pci_slot); | 125 | return pci_slot_name(slot->pci_slot); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | extern int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, | 128 | int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, int nr, |
| 129 | int nr, const char *name, | 129 | const char *name, struct module *owner, |
| 130 | struct module *owner, const char *mod_name); | 130 | const char *mod_name); |
| 131 | extern int pci_hp_deregister(struct hotplug_slot *slot); | 131 | int pci_hp_deregister(struct hotplug_slot *slot); |
| 132 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, | 132 | int __must_check pci_hp_change_slot_info(struct hotplug_slot *slot, |
| 133 | struct hotplug_slot_info *info); | 133 | struct hotplug_slot_info *info); |
| 134 | 134 | ||
| 135 | /* use a define to avoid include chaining to get THIS_MODULE & friends */ | 135 | /* use a define to avoid include chaining to get THIS_MODULE & friends */ |
| 136 | #define pci_hp_register(slot, pbus, devnr, name) \ | 136 | #define pci_hp_register(slot, pbus, devnr, name) \ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index f11c1c2609d5..2b85c521f737 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -524,6 +524,8 @@ | |||
| 524 | #define PCI_DEVICE_ID_AMD_15H_NB_F3 0x1603 | 524 | #define PCI_DEVICE_ID_AMD_15H_NB_F3 0x1603 |
| 525 | #define PCI_DEVICE_ID_AMD_15H_NB_F4 0x1604 | 525 | #define PCI_DEVICE_ID_AMD_15H_NB_F4 0x1604 |
| 526 | #define PCI_DEVICE_ID_AMD_15H_NB_F5 0x1605 | 526 | #define PCI_DEVICE_ID_AMD_15H_NB_F5 0x1605 |
| 527 | #define PCI_DEVICE_ID_AMD_16H_NB_F3 0x1533 | ||
| 528 | #define PCI_DEVICE_ID_AMD_16H_NB_F4 0x1534 | ||
| 527 | #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 | 529 | #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 |
| 528 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 530 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
| 529 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 531 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
| @@ -1604,6 +1606,7 @@ | |||
| 1604 | #define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334 | 1606 | #define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334 |
| 1605 | 1607 | ||
| 1606 | #define PCI_VENDOR_ID_MARVELL 0x11ab | 1608 | #define PCI_VENDOR_ID_MARVELL 0x11ab |
| 1609 | #define PCI_VENDOR_ID_MARVELL_EXT 0x1b4b | ||
| 1607 | #define PCI_DEVICE_ID_MARVELL_GT64111 0x4146 | 1610 | #define PCI_DEVICE_ID_MARVELL_GT64111 0x4146 |
| 1608 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 | 1611 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 |
| 1609 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 | 1612 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 |
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index e6f91b1406d8..9572669eea97 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h | |||
| @@ -62,7 +62,7 @@ struct pcie_port_service_driver { | |||
| 62 | #define to_service_driver(d) \ | 62 | #define to_service_driver(d) \ |
| 63 | container_of(d, struct pcie_port_service_driver, driver) | 63 | container_of(d, struct pcie_port_service_driver, driver) |
| 64 | 64 | ||
| 65 | extern int pcie_port_service_register(struct pcie_port_service_driver *new); | 65 | int pcie_port_service_register(struct pcie_port_service_driver *new); |
| 66 | extern void pcie_port_service_unregister(struct pcie_port_service_driver *new); | 66 | void pcie_port_service_unregister(struct pcie_port_service_driver *new); |
| 67 | 67 | ||
| 68 | #endif /* _PCIEPORT_IF_H_ */ | 68 | #endif /* _PCIEPORT_IF_H_ */ |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 1d795df6f4cf..e0373d26c244 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #ifdef CONFIG_PERF_EVENTS | 23 | #ifdef CONFIG_PERF_EVENTS |
| 24 | # include <linux/cgroup.h> | ||
| 25 | # include <asm/perf_event.h> | 24 | # include <asm/perf_event.h> |
| 26 | # include <asm/local64.h> | 25 | # include <asm/local64.h> |
| 27 | #endif | 26 | #endif |
| @@ -128,6 +127,7 @@ struct hw_perf_event { | |||
| 128 | int event_base_rdpmc; | 127 | int event_base_rdpmc; |
| 129 | int idx; | 128 | int idx; |
| 130 | int last_cpu; | 129 | int last_cpu; |
| 130 | int flags; | ||
| 131 | 131 | ||
| 132 | struct hw_perf_event_extra extra_reg; | 132 | struct hw_perf_event_extra extra_reg; |
| 133 | struct hw_perf_event_extra branch_reg; | 133 | struct hw_perf_event_extra branch_reg; |
| @@ -299,22 +299,7 @@ struct swevent_hlist { | |||
| 299 | #define PERF_ATTACH_GROUP 0x02 | 299 | #define PERF_ATTACH_GROUP 0x02 |
| 300 | #define PERF_ATTACH_TASK 0x04 | 300 | #define PERF_ATTACH_TASK 0x04 |
| 301 | 301 | ||
| 302 | #ifdef CONFIG_CGROUP_PERF | 302 | struct perf_cgroup; |
| 303 | /* | ||
| 304 | * perf_cgroup_info keeps track of time_enabled for a cgroup. | ||
| 305 | * This is a per-cpu dynamically allocated data structure. | ||
| 306 | */ | ||
| 307 | struct perf_cgroup_info { | ||
| 308 | u64 time; | ||
| 309 | u64 timestamp; | ||
| 310 | }; | ||
| 311 | |||
| 312 | struct perf_cgroup { | ||
| 313 | struct cgroup_subsys_state css; | ||
| 314 | struct perf_cgroup_info *info; /* timing info, one per cpu */ | ||
| 315 | }; | ||
| 316 | #endif | ||
| 317 | |||
| 318 | struct ring_buffer; | 303 | struct ring_buffer; |
| 319 | 304 | ||
| 320 | /** | 305 | /** |
| @@ -583,11 +568,13 @@ struct perf_sample_data { | |||
| 583 | u32 reserved; | 568 | u32 reserved; |
| 584 | } cpu_entry; | 569 | } cpu_entry; |
| 585 | u64 period; | 570 | u64 period; |
| 571 | union perf_mem_data_src data_src; | ||
| 586 | struct perf_callchain_entry *callchain; | 572 | struct perf_callchain_entry *callchain; |
| 587 | struct perf_raw_record *raw; | 573 | struct perf_raw_record *raw; |
| 588 | struct perf_branch_stack *br_stack; | 574 | struct perf_branch_stack *br_stack; |
| 589 | struct perf_regs_user regs_user; | 575 | struct perf_regs_user regs_user; |
| 590 | u64 stack_user_size; | 576 | u64 stack_user_size; |
| 577 | u64 weight; | ||
| 591 | }; | 578 | }; |
| 592 | 579 | ||
| 593 | static inline void perf_sample_data_init(struct perf_sample_data *data, | 580 | static inline void perf_sample_data_init(struct perf_sample_data *data, |
| @@ -601,6 +588,8 @@ static inline void perf_sample_data_init(struct perf_sample_data *data, | |||
| 601 | data->regs_user.abi = PERF_SAMPLE_REGS_ABI_NONE; | 588 | data->regs_user.abi = PERF_SAMPLE_REGS_ABI_NONE; |
| 602 | data->regs_user.regs = NULL; | 589 | data->regs_user.regs = NULL; |
| 603 | data->stack_user_size = 0; | 590 | data->stack_user_size = 0; |
| 591 | data->weight = 0; | ||
| 592 | data->data_src.val = 0; | ||
| 604 | } | 593 | } |
| 605 | 594 | ||
| 606 | extern void perf_output_sample(struct perf_output_handle *handle, | 595 | extern void perf_output_sample(struct perf_output_handle *handle, |
| @@ -831,6 +820,7 @@ do { \ | |||
| 831 | struct perf_pmu_events_attr { | 820 | struct perf_pmu_events_attr { |
| 832 | struct device_attribute attr; | 821 | struct device_attribute attr; |
| 833 | u64 id; | 822 | u64 id; |
| 823 | const char *event_str; | ||
| 834 | }; | 824 | }; |
| 835 | 825 | ||
| 836 | #define PMU_EVENT_ATTR(_name, _var, _id, _show) \ | 826 | #define PMU_EVENT_ATTR(_name, _var, _id, _show) \ |
diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h index e7a720104a47..1ad4f31ef6b8 100644 --- a/include/linux/pinctrl/pinconf.h +++ b/include/linux/pinctrl/pinconf.h | |||
| @@ -14,6 +14,8 @@ | |||
| 14 | 14 | ||
| 15 | #ifdef CONFIG_PINCONF | 15 | #ifdef CONFIG_PINCONF |
| 16 | 16 | ||
| 17 | #include <linux/pinctrl/machine.h> | ||
| 18 | |||
| 17 | struct pinctrl_dev; | 19 | struct pinctrl_dev; |
| 18 | struct seq_file; | 20 | struct seq_file; |
| 19 | 21 | ||
| @@ -28,6 +30,7 @@ struct seq_file; | |||
| 28 | * @pin_config_set: configure an individual pin | 30 | * @pin_config_set: configure an individual pin |
| 29 | * @pin_config_group_get: get configurations for an entire pin group | 31 | * @pin_config_group_get: get configurations for an entire pin group |
| 30 | * @pin_config_group_set: configure all pins in a group | 32 | * @pin_config_group_set: configure all pins in a group |
| 33 | * @pin_config_group_dbg_set: optional debugfs to modify a pin configuration | ||
| 31 | * @pin_config_dbg_show: optional debugfs display hook that will provide | 34 | * @pin_config_dbg_show: optional debugfs display hook that will provide |
| 32 | * per-device info for a certain pin in debugfs | 35 | * per-device info for a certain pin in debugfs |
| 33 | * @pin_config_group_dbg_show: optional debugfs display hook that will provide | 36 | * @pin_config_group_dbg_show: optional debugfs display hook that will provide |
| @@ -51,6 +54,9 @@ struct pinconf_ops { | |||
| 51 | int (*pin_config_group_set) (struct pinctrl_dev *pctldev, | 54 | int (*pin_config_group_set) (struct pinctrl_dev *pctldev, |
| 52 | unsigned selector, | 55 | unsigned selector, |
| 53 | unsigned long config); | 56 | unsigned long config); |
| 57 | int (*pin_config_dbg_parse_modify) (struct pinctrl_dev *pctldev, | ||
| 58 | const char *arg, | ||
| 59 | unsigned long *config); | ||
| 54 | void (*pin_config_dbg_show) (struct pinctrl_dev *pctldev, | 60 | void (*pin_config_dbg_show) (struct pinctrl_dev *pctldev, |
| 55 | struct seq_file *s, | 61 | struct seq_file *s, |
| 56 | unsigned offset); | 62 | unsigned offset); |
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 778804df293f..2c2a9e8d8578 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
| @@ -118,9 +118,9 @@ struct pinctrl_desc { | |||
| 118 | const char *name; | 118 | const char *name; |
| 119 | struct pinctrl_pin_desc const *pins; | 119 | struct pinctrl_pin_desc const *pins; |
| 120 | unsigned int npins; | 120 | unsigned int npins; |
| 121 | struct pinctrl_ops *pctlops; | 121 | const struct pinctrl_ops *pctlops; |
| 122 | struct pinmux_ops *pmxops; | 122 | const struct pinmux_ops *pmxops; |
| 123 | struct pinconf_ops *confops; | 123 | const struct pinconf_ops *confops; |
| 124 | struct module *owner; | 124 | struct module *owner; |
| 125 | }; | 125 | }; |
| 126 | 126 | ||
diff --git a/include/linux/platform_data/coda.h b/include/linux/platform_data/coda.h new file mode 100644 index 000000000000..6ad4410d9e20 --- /dev/null +++ b/include/linux/platform_data/coda.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2013 Philipp Zabel, Pengutronix | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | */ | ||
| 9 | #ifndef PLATFORM_CODA_H | ||
| 10 | #define PLATFORM_CODA_H | ||
| 11 | |||
| 12 | struct device; | ||
| 13 | |||
| 14 | struct coda_platform_data { | ||
| 15 | struct device *iram_dev; | ||
| 16 | }; | ||
| 17 | |||
| 18 | #endif | ||
diff --git a/include/linux/platform_data/dwc3-omap.h b/include/linux/platform_data/dwc3-omap.h index ada401244e0b..1d36ca874cc8 100644 --- a/include/linux/platform_data/dwc3-omap.h +++ b/include/linux/platform_data/dwc3-omap.h | |||
| @@ -41,7 +41,3 @@ enum dwc3_omap_utmi_mode { | |||
| 41 | DWC3_OMAP_UTMI_MODE_HW, | 41 | DWC3_OMAP_UTMI_MODE_HW, |
| 42 | DWC3_OMAP_UTMI_MODE_SW, | 42 | DWC3_OMAP_UTMI_MODE_SW, |
| 43 | }; | 43 | }; |
| 44 | |||
| 45 | struct dwc3_omap_data { | ||
| 46 | enum dwc3_omap_utmi_mode utmi_mode; | ||
| 47 | }; | ||
diff --git a/include/linux/platform_data/emif_plat.h b/include/linux/platform_data/emif_plat.h index 03378ca84061..5c19a2a647c4 100644 --- a/include/linux/platform_data/emif_plat.h +++ b/include/linux/platform_data/emif_plat.h | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | /* Custom config requests */ | 40 | /* Custom config requests */ |
| 41 | #define EMIF_CUSTOM_CONFIG_LPMODE 0x00000001 | 41 | #define EMIF_CUSTOM_CONFIG_LPMODE 0x00000001 |
| 42 | #define EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL 0x00000002 | 42 | #define EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL 0x00000002 |
| 43 | #define EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART 0x00000004 | ||
| 43 | 44 | ||
| 44 | #ifndef __ASSEMBLY__ | 45 | #ifndef __ASSEMBLY__ |
| 45 | /** | 46 | /** |
diff --git a/include/linux/platform_data/lp855x.h b/include/linux/platform_data/lp855x.h index 20ee8b221dbd..ea3200527dd3 100644 --- a/include/linux/platform_data/lp855x.h +++ b/include/linux/platform_data/lp855x.h | |||
| @@ -69,11 +69,6 @@ enum lp855x_chip_id { | |||
| 69 | LP8557, | 69 | LP8557, |
| 70 | }; | 70 | }; |
| 71 | 71 | ||
| 72 | enum lp855x_brightness_ctrl_mode { | ||
| 73 | PWM_BASED = 1, | ||
| 74 | REGISTER_BASED, | ||
| 75 | }; | ||
| 76 | |||
| 77 | enum lp8550_brighntess_source { | 72 | enum lp8550_brighntess_source { |
| 78 | LP8550_PWM_ONLY, | 73 | LP8550_PWM_ONLY, |
| 79 | LP8550_I2C_ONLY = 2, | 74 | LP8550_I2C_ONLY = 2, |
| @@ -116,24 +111,18 @@ struct lp855x_rom_data { | |||
| 116 | /** | 111 | /** |
| 117 | * struct lp855x_platform_data | 112 | * struct lp855x_platform_data |
| 118 | * @name : Backlight driver name. If it is not defined, default name is set. | 113 | * @name : Backlight driver name. If it is not defined, default name is set. |
| 119 | * @mode : brightness control by pwm or lp855x register | ||
| 120 | * @device_control : value of DEVICE CONTROL register | 114 | * @device_control : value of DEVICE CONTROL register |
| 121 | * @initial_brightness : initial value of backlight brightness | 115 | * @initial_brightness : initial value of backlight brightness |
| 122 | * @period_ns : platform specific pwm period value. unit is nano. | 116 | * @period_ns : platform specific pwm period value. unit is nano. |
| 123 | Only valid when mode is PWM_BASED. | 117 | Only valid when mode is PWM_BASED. |
| 124 | * @load_new_rom_data : | ||
| 125 | 0 : use default configuration data | ||
| 126 | 1 : update values of eeprom or eprom registers on loading driver | ||
| 127 | * @size_program : total size of lp855x_rom_data | 118 | * @size_program : total size of lp855x_rom_data |
| 128 | * @rom_data : list of new eeprom/eprom registers | 119 | * @rom_data : list of new eeprom/eprom registers |
| 129 | */ | 120 | */ |
| 130 | struct lp855x_platform_data { | 121 | struct lp855x_platform_data { |
| 131 | char *name; | 122 | const char *name; |
| 132 | enum lp855x_brightness_ctrl_mode mode; | ||
| 133 | u8 device_control; | 123 | u8 device_control; |
| 134 | int initial_brightness; | 124 | u8 initial_brightness; |
| 135 | unsigned int period_ns; | 125 | unsigned int period_ns; |
| 136 | u8 load_new_rom_data; | ||
| 137 | int size_program; | 126 | int size_program; |
| 138 | struct lp855x_rom_data *rom_data; | 127 | struct lp855x_rom_data *rom_data; |
| 139 | }; | 128 | }; |
diff --git a/include/linux/platform_data/mv_usb.h b/include/linux/platform_data/mv_usb.h index 944b01dd103e..98b7925f1a2d 100644 --- a/include/linux/platform_data/mv_usb.h +++ b/include/linux/platform_data/mv_usb.h | |||
| @@ -34,8 +34,6 @@ struct mv_usb_addon_irq { | |||
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | struct mv_usb_platform_data { | 36 | struct mv_usb_platform_data { |
| 37 | unsigned int clknum; | ||
| 38 | char **clkname; | ||
| 39 | struct mv_usb_addon_irq *id; /* Only valid for OTG. ID pin change*/ | 37 | struct mv_usb_addon_irq *id; /* Only valid for OTG. ID pin change*/ |
| 40 | struct mv_usb_addon_irq *vbus; /* valid for OTG/UDC. VBUS change*/ | 38 | struct mv_usb_addon_irq *vbus; /* valid for OTG/UDC. VBUS change*/ |
| 41 | 39 | ||
diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h index 88734e871e3a..c7285b575462 100644 --- a/include/linux/platform_data/ntc_thermistor.h +++ b/include/linux/platform_data/ntc_thermistor.h | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | #ifndef _LINUX_NTC_H | 21 | #ifndef _LINUX_NTC_H |
| 22 | #define _LINUX_NTC_H | 22 | #define _LINUX_NTC_H |
| 23 | 23 | ||
| 24 | struct iio_channel; | ||
| 25 | |||
| 24 | enum ntc_thermistor_type { | 26 | enum ntc_thermistor_type { |
| 25 | TYPE_NCPXXWB473, | 27 | TYPE_NCPXXWB473, |
| 26 | TYPE_NCPXXWL333, | 28 | TYPE_NCPXXWL333, |
| @@ -39,13 +41,17 @@ struct ntc_thermistor_platform_data { | |||
| 39 | * described at Documentation/hwmon/ntc_thermistor | 41 | * described at Documentation/hwmon/ntc_thermistor |
| 40 | * | 42 | * |
| 41 | * pullup/down_ohm: 0 for infinite / not-connected | 43 | * pullup/down_ohm: 0 for infinite / not-connected |
| 44 | * | ||
| 45 | * chan: iio_channel pointer to communicate with the ADC which the | ||
| 46 | * thermistor is using for conversion of the analog values. | ||
| 42 | */ | 47 | */ |
| 43 | int (*read_uV)(void); | 48 | int (*read_uv)(struct ntc_thermistor_platform_data *); |
| 44 | unsigned int pullup_uV; | 49 | unsigned int pullup_uv; |
| 45 | 50 | ||
| 46 | unsigned int pullup_ohm; | 51 | unsigned int pullup_ohm; |
| 47 | unsigned int pulldown_ohm; | 52 | unsigned int pulldown_ohm; |
| 48 | enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect; | 53 | enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect; |
| 54 | struct iio_channel *chan; | ||
| 49 | 55 | ||
| 50 | int (*read_ohm)(void); | 56 | int (*read_ohm)(void); |
| 51 | }; | 57 | }; |
diff --git a/include/linux/platform_data/serial-sccnxp.h b/include/linux/platform_data/serial-sccnxp.h index 215574d1e81d..bdc510d03245 100644 --- a/include/linux/platform_data/serial-sccnxp.h +++ b/include/linux/platform_data/serial-sccnxp.h | |||
| @@ -86,10 +86,6 @@ struct sccnxp_pdata { | |||
| 86 | const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; | 86 | const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; |
| 87 | /* Timer value for polling mode (usecs) */ | 87 | /* Timer value for polling mode (usecs) */ |
| 88 | const unsigned int poll_time_us; | 88 | const unsigned int poll_time_us; |
| 89 | /* Called during startup */ | ||
| 90 | void (*init)(void); | ||
| 91 | /* Called before finish */ | ||
| 92 | void (*exit)(void); | ||
| 93 | }; | 89 | }; |
| 94 | 90 | ||
| 95 | #endif | 91 | #endif |
diff --git a/include/linux/platform_data/si5351.h b/include/linux/platform_data/si5351.h new file mode 100644 index 000000000000..92dabcaf6499 --- /dev/null +++ b/include/linux/platform_data/si5351.h | |||
| @@ -0,0 +1,114 @@ | |||
| 1 | /* | ||
| 2 | * Si5351A/B/C programmable clock generator platform_data. | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef __LINUX_PLATFORM_DATA_SI5351_H__ | ||
| 6 | #define __LINUX_PLATFORM_DATA_SI5351_H__ | ||
| 7 | |||
| 8 | struct clk; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * enum si5351_variant - SiLabs Si5351 chip variant | ||
| 12 | * @SI5351_VARIANT_A: Si5351A (8 output clocks, XTAL input) | ||
| 13 | * @SI5351_VARIANT_A3: Si5351A MSOP10 (3 output clocks, XTAL input) | ||
| 14 | * @SI5351_VARIANT_B: Si5351B (8 output clocks, XTAL/VXCO input) | ||
| 15 | * @SI5351_VARIANT_C: Si5351C (8 output clocks, XTAL/CLKIN input) | ||
| 16 | */ | ||
| 17 | enum si5351_variant { | ||
| 18 | SI5351_VARIANT_A = 1, | ||
| 19 | SI5351_VARIANT_A3 = 2, | ||
| 20 | SI5351_VARIANT_B = 3, | ||
| 21 | SI5351_VARIANT_C = 4, | ||
| 22 | }; | ||
| 23 | |||
| 24 | /** | ||
| 25 | * enum si5351_pll_src - Si5351 pll clock source | ||
| 26 | * @SI5351_PLL_SRC_DEFAULT: default, do not change eeprom config | ||
| 27 | * @SI5351_PLL_SRC_XTAL: pll source clock is XTAL input | ||
| 28 | * @SI5351_PLL_SRC_CLKIN: pll source clock is CLKIN input (Si5351C only) | ||
| 29 | */ | ||
| 30 | enum si5351_pll_src { | ||
| 31 | SI5351_PLL_SRC_DEFAULT = 0, | ||
| 32 | SI5351_PLL_SRC_XTAL = 1, | ||
| 33 | SI5351_PLL_SRC_CLKIN = 2, | ||
| 34 | }; | ||
| 35 | |||
| 36 | /** | ||
| 37 | * enum si5351_multisynth_src - Si5351 multisynth clock source | ||
| 38 | * @SI5351_MULTISYNTH_SRC_DEFAULT: default, do not change eeprom config | ||
| 39 | * @SI5351_MULTISYNTH_SRC_VCO0: multisynth source clock is VCO0 | ||
| 40 | * @SI5351_MULTISYNTH_SRC_VCO1: multisynth source clock is VCO1/VXCO | ||
| 41 | */ | ||
| 42 | enum si5351_multisynth_src { | ||
| 43 | SI5351_MULTISYNTH_SRC_DEFAULT = 0, | ||
| 44 | SI5351_MULTISYNTH_SRC_VCO0 = 1, | ||
| 45 | SI5351_MULTISYNTH_SRC_VCO1 = 2, | ||
| 46 | }; | ||
| 47 | |||
| 48 | /** | ||
| 49 | * enum si5351_clkout_src - Si5351 clock output clock source | ||
| 50 | * @SI5351_CLKOUT_SRC_DEFAULT: default, do not change eeprom config | ||
| 51 | * @SI5351_CLKOUT_SRC_MSYNTH_N: clkout N source clock is multisynth N | ||
| 52 | * @SI5351_CLKOUT_SRC_MSYNTH_0_4: clkout N source clock is multisynth 0 (N<4) | ||
| 53 | * or 4 (N>=4) | ||
| 54 | * @SI5351_CLKOUT_SRC_XTAL: clkout N source clock is XTAL | ||
| 55 | * @SI5351_CLKOUT_SRC_CLKIN: clkout N source clock is CLKIN (Si5351C only) | ||
| 56 | */ | ||
| 57 | enum si5351_clkout_src { | ||
| 58 | SI5351_CLKOUT_SRC_DEFAULT = 0, | ||
| 59 | SI5351_CLKOUT_SRC_MSYNTH_N = 1, | ||
| 60 | SI5351_CLKOUT_SRC_MSYNTH_0_4 = 2, | ||
| 61 | SI5351_CLKOUT_SRC_XTAL = 3, | ||
| 62 | SI5351_CLKOUT_SRC_CLKIN = 4, | ||
| 63 | }; | ||
| 64 | |||
| 65 | /** | ||
| 66 | * enum si5351_drive_strength - Si5351 clock output drive strength | ||
| 67 | * @SI5351_DRIVE_DEFAULT: default, do not change eeprom config | ||
| 68 | * @SI5351_DRIVE_2MA: 2mA clock output drive strength | ||
| 69 | * @SI5351_DRIVE_4MA: 4mA clock output drive strength | ||
| 70 | * @SI5351_DRIVE_6MA: 6mA clock output drive strength | ||
| 71 | * @SI5351_DRIVE_8MA: 8mA clock output drive strength | ||
| 72 | */ | ||
| 73 | enum si5351_drive_strength { | ||
| 74 | SI5351_DRIVE_DEFAULT = 0, | ||
| 75 | SI5351_DRIVE_2MA = 2, | ||
| 76 | SI5351_DRIVE_4MA = 4, | ||
| 77 | SI5351_DRIVE_6MA = 6, | ||
| 78 | SI5351_DRIVE_8MA = 8, | ||
| 79 | }; | ||
| 80 | |||
| 81 | /** | ||
| 82 | * struct si5351_clkout_config - Si5351 clock output configuration | ||
| 83 | * @clkout: clkout number | ||
| 84 | * @multisynth_src: multisynth source clock | ||
| 85 | * @clkout_src: clkout source clock | ||
| 86 | * @pll_master: if true, clkout can also change pll rate | ||
| 87 | * @drive: output drive strength | ||
| 88 | * @rate: initial clkout rate, or default if 0 | ||
| 89 | */ | ||
| 90 | struct si5351_clkout_config { | ||
| 91 | enum si5351_multisynth_src multisynth_src; | ||
| 92 | enum si5351_clkout_src clkout_src; | ||
| 93 | enum si5351_drive_strength drive; | ||
| 94 | bool pll_master; | ||
| 95 | unsigned long rate; | ||
| 96 | }; | ||
| 97 | |||
| 98 | /** | ||
| 99 | * struct si5351_platform_data - Platform data for the Si5351 clock driver | ||
| 100 | * @variant: Si5351 chip variant | ||
| 101 | * @clk_xtal: xtal input clock | ||
| 102 | * @clk_clkin: clkin input clock | ||
| 103 | * @pll_src: array of pll source clock setting | ||
| 104 | * @clkout: array of clkout configuration | ||
| 105 | */ | ||
| 106 | struct si5351_platform_data { | ||
| 107 | enum si5351_variant variant; | ||
| 108 | struct clk *clk_xtal; | ||
| 109 | struct clk *clk_clkin; | ||
| 110 | enum si5351_pll_src pll_src[2]; | ||
| 111 | struct si5351_clkout_config clkout[8]; | ||
| 112 | }; | ||
| 113 | |||
| 114 | #endif | ||
diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h index ceba18d23a5a..8447f634c7f5 100644 --- a/include/linux/platform_data/spi-s3c64xx.h +++ b/include/linux/platform_data/spi-s3c64xx.h | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | #ifndef __S3C64XX_PLAT_SPI_H | 11 | #ifndef __S3C64XX_PLAT_SPI_H |
| 12 | #define __S3C64XX_PLAT_SPI_H | 12 | #define __S3C64XX_PLAT_SPI_H |
| 13 | 13 | ||
| 14 | #include <linux/dmaengine.h> | ||
| 15 | |||
| 14 | struct platform_device; | 16 | struct platform_device; |
| 15 | 17 | ||
| 16 | /** | 18 | /** |
| @@ -38,6 +40,7 @@ struct s3c64xx_spi_info { | |||
| 38 | int src_clk_nr; | 40 | int src_clk_nr; |
| 39 | int num_cs; | 41 | int num_cs; |
| 40 | int (*cfg_gpio)(void); | 42 | int (*cfg_gpio)(void); |
| 43 | dma_filter_fn filter; | ||
| 41 | }; | 44 | }; |
| 42 | 45 | ||
| 43 | /** | 46 | /** |
diff --git a/include/linux/platform_data/video-vt8500lcdfb.h b/include/linux/platform_data/video-vt8500lcdfb.h deleted file mode 100644 index 7f399c370fe0..000000000000 --- a/include/linux/platform_data/video-vt8500lcdfb.h +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * VT8500/WM8505 Frame Buffer platform data definitions | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Ed Spiridonov <edo.rus@gmail.com> | ||
| 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 _VT8500FB_H | ||
| 17 | #define _VT8500FB_H | ||
| 18 | |||
| 19 | #include <linux/fb.h> | ||
| 20 | |||
| 21 | struct vt8500fb_platform_data { | ||
| 22 | struct fb_videomode mode; | ||
| 23 | u32 xres_virtual; | ||
| 24 | u32 yres_virtual; | ||
| 25 | u32 bpp; | ||
| 26 | unsigned long video_mem_phys; | ||
| 27 | void *video_mem_virt; | ||
| 28 | unsigned long video_mem_len; | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif /* _VT8500FB_H */ | ||
diff --git a/include/linux/platform_data/video_s3c.h b/include/linux/platform_data/video_s3c.h new file mode 100644 index 000000000000..48883995f47f --- /dev/null +++ b/include/linux/platform_data/video_s3c.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | #ifndef __PLATFORM_DATA_VIDEO_S3C | ||
| 2 | #define __PLATFORM_DATA_VIDEO_S3C | ||
| 3 | |||
| 4 | /* S3C_FB_MAX_WIN | ||
| 5 | * Set to the maximum number of windows that any of the supported hardware | ||
| 6 | * can use. Since the platform data uses this for an array size, having it | ||
| 7 | * set to the maximum of any version of the hardware can do is safe. | ||
| 8 | */ | ||
| 9 | #define S3C_FB_MAX_WIN (5) | ||
| 10 | |||
| 11 | /** | ||
| 12 | * struct s3c_fb_pd_win - per window setup data | ||
| 13 | * @xres : The window X size. | ||
| 14 | * @yres : The window Y size. | ||
| 15 | * @virtual_x: The virtual X size. | ||
| 16 | * @virtual_y: The virtual Y size. | ||
| 17 | */ | ||
| 18 | struct s3c_fb_pd_win { | ||
| 19 | unsigned short default_bpp; | ||
| 20 | unsigned short max_bpp; | ||
| 21 | unsigned short xres; | ||
| 22 | unsigned short yres; | ||
| 23 | unsigned short virtual_x; | ||
| 24 | unsigned short virtual_y; | ||
| 25 | }; | ||
| 26 | |||
| 27 | /** | ||
| 28 | * struct s3c_fb_platdata - S3C driver platform specific information | ||
| 29 | * @setup_gpio: Setup the external GPIO pins to the right state to transfer | ||
| 30 | * the data from the display system to the connected display | ||
| 31 | * device. | ||
| 32 | * @vidcon0: The base vidcon0 values to control the panel data format. | ||
| 33 | * @vidcon1: The base vidcon1 values to control the panel data output. | ||
| 34 | * @vtiming: Video timing when connected to a RGB type panel. | ||
| 35 | * @win: The setup data for each hardware window, or NULL for unused. | ||
| 36 | * @display_mode: The LCD output display mode. | ||
| 37 | * | ||
| 38 | * The platform data supplies the video driver with all the information | ||
| 39 | * it requires to work with the display(s) attached to the machine. It | ||
| 40 | * controls the initial mode, the number of display windows (0 is always | ||
| 41 | * the base framebuffer) that are initialised etc. | ||
| 42 | * | ||
| 43 | */ | ||
| 44 | struct s3c_fb_platdata { | ||
| 45 | void (*setup_gpio)(void); | ||
| 46 | |||
| 47 | struct s3c_fb_pd_win *win[S3C_FB_MAX_WIN]; | ||
| 48 | struct fb_videomode *vtiming; | ||
| 49 | |||
| 50 | u32 vidcon0; | ||
| 51 | u32 vidcon1; | ||
| 52 | }; | ||
| 53 | |||
| 54 | #endif | ||
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index c082c71f7225..9abf1db6aea6 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
| @@ -20,12 +20,12 @@ | |||
| 20 | struct mfd_cell; | 20 | struct mfd_cell; |
| 21 | 21 | ||
| 22 | struct platform_device { | 22 | struct platform_device { |
| 23 | const char * name; | 23 | const char *name; |
| 24 | int id; | 24 | int id; |
| 25 | bool id_auto; | 25 | bool id_auto; |
| 26 | struct device dev; | 26 | struct device dev; |
| 27 | u32 num_resources; | 27 | u32 num_resources; |
| 28 | struct resource * resource; | 28 | struct resource *resource; |
| 29 | 29 | ||
| 30 | const struct platform_device_id *id_entry; | 30 | const struct platform_device_id *id_entry; |
| 31 | 31 | ||
| @@ -47,9 +47,12 @@ extern struct bus_type platform_bus_type; | |||
| 47 | extern struct device platform_bus; | 47 | extern struct device platform_bus; |
| 48 | 48 | ||
| 49 | extern void arch_setup_pdev_archdata(struct platform_device *); | 49 | extern void arch_setup_pdev_archdata(struct platform_device *); |
| 50 | extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); | 50 | extern struct resource *platform_get_resource(struct platform_device *, |
| 51 | unsigned int, unsigned int); | ||
| 51 | extern int platform_get_irq(struct platform_device *, unsigned int); | 52 | extern int platform_get_irq(struct platform_device *, unsigned int); |
| 52 | extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); | 53 | extern struct resource *platform_get_resource_byname(struct platform_device *, |
| 54 | unsigned int, | ||
| 55 | const char *); | ||
| 53 | extern int platform_get_irq_byname(struct platform_device *, const char *); | 56 | extern int platform_get_irq_byname(struct platform_device *, const char *); |
| 54 | extern int platform_add_devices(struct platform_device **, int); | 57 | extern int platform_add_devices(struct platform_device **, int); |
| 55 | 58 | ||
| @@ -161,7 +164,8 @@ extern struct platform_device *platform_device_alloc(const char *name, int id); | |||
| 161 | extern int platform_device_add_resources(struct platform_device *pdev, | 164 | extern int platform_device_add_resources(struct platform_device *pdev, |
| 162 | const struct resource *res, | 165 | const struct resource *res, |
| 163 | unsigned int num); | 166 | unsigned int num); |
| 164 | extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); | 167 | extern int platform_device_add_data(struct platform_device *pdev, |
| 168 | const void *data, size_t size); | ||
| 165 | extern int platform_device_add(struct platform_device *pdev); | 169 | extern int platform_device_add(struct platform_device *pdev); |
| 166 | extern void platform_device_del(struct platform_device *pdev); | 170 | extern void platform_device_del(struct platform_device *pdev); |
| 167 | extern void platform_device_put(struct platform_device *pdev); | 171 | extern void platform_device_put(struct platform_device *pdev); |
| @@ -190,7 +194,8 @@ static inline void *platform_get_drvdata(const struct platform_device *pdev) | |||
| 190 | return dev_get_drvdata(&pdev->dev); | 194 | return dev_get_drvdata(&pdev->dev); |
| 191 | } | 195 | } |
| 192 | 196 | ||
| 193 | static inline void platform_set_drvdata(struct platform_device *pdev, void *data) | 197 | static inline void platform_set_drvdata(struct platform_device *pdev, |
| 198 | void *data) | ||
| 194 | { | 199 | { |
| 195 | dev_set_drvdata(&pdev->dev, data); | 200 | dev_set_drvdata(&pdev->dev, data); |
| 196 | } | 201 | } |
| @@ -222,10 +227,10 @@ static void __exit __platform_driver##_exit(void) \ | |||
| 222 | } \ | 227 | } \ |
| 223 | module_exit(__platform_driver##_exit); | 228 | module_exit(__platform_driver##_exit); |
| 224 | 229 | ||
| 225 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, | 230 | extern struct platform_device *platform_create_bundle( |
| 226 | int (*probe)(struct platform_device *), | 231 | struct platform_driver *driver, int (*probe)(struct platform_device *), |
| 227 | struct resource *res, unsigned int n_res, | 232 | struct resource *res, unsigned int n_res, |
| 228 | const void *data, size_t size); | 233 | const void *data, size_t size); |
| 229 | 234 | ||
| 230 | /* early platform driver interface */ | 235 | /* early platform driver interface */ |
| 231 | struct early_platform_driver { | 236 | struct early_platform_driver { |
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 042058fdb0af..60bac697a91b 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h | |||
| @@ -55,6 +55,7 @@ struct cpu_timer_list { | |||
| 55 | /* POSIX.1b interval timer structure. */ | 55 | /* POSIX.1b interval timer structure. */ |
| 56 | struct k_itimer { | 56 | struct k_itimer { |
| 57 | struct list_head list; /* free/ allocate list */ | 57 | struct list_head list; /* free/ allocate list */ |
| 58 | struct hlist_node t_hash; | ||
| 58 | spinlock_t it_lock; | 59 | spinlock_t it_lock; |
| 59 | clockid_t it_clock; /* which timer type */ | 60 | clockid_t it_clock; /* which timer type */ |
| 60 | timer_t it_id; /* timer id */ | 61 | timer_t it_id; /* timer id */ |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 5a710b9c578e..87a03c746f17 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
| @@ -93,14 +93,20 @@ do { \ | |||
| 93 | 93 | ||
| 94 | #else /* !CONFIG_PREEMPT_COUNT */ | 94 | #else /* !CONFIG_PREEMPT_COUNT */ |
| 95 | 95 | ||
| 96 | #define preempt_disable() do { } while (0) | 96 | /* |
| 97 | #define sched_preempt_enable_no_resched() do { } while (0) | 97 | * Even if we don't have any preemption, we need preempt disable/enable |
| 98 | #define preempt_enable_no_resched() do { } while (0) | 98 | * to be barriers, so that we don't have things like get_user/put_user |
| 99 | #define preempt_enable() do { } while (0) | 99 | * that can cause faults and scheduling migrate into our preempt-protected |
| 100 | 100 | * region. | |
| 101 | #define preempt_disable_notrace() do { } while (0) | 101 | */ |
| 102 | #define preempt_enable_no_resched_notrace() do { } while (0) | 102 | #define preempt_disable() barrier() |
| 103 | #define preempt_enable_notrace() do { } while (0) | 103 | #define sched_preempt_enable_no_resched() barrier() |
| 104 | #define preempt_enable_no_resched() barrier() | ||
| 105 | #define preempt_enable() barrier() | ||
| 106 | |||
| 107 | #define preempt_disable_notrace() barrier() | ||
| 108 | #define preempt_enable_no_resched_notrace() barrier() | ||
| 109 | #define preempt_enable_notrace() barrier() | ||
| 104 | 110 | ||
| 105 | #endif /* CONFIG_PREEMPT_COUNT */ | 111 | #endif /* CONFIG_PREEMPT_COUNT */ |
| 106 | 112 | ||
diff --git a/include/linux/printk.h b/include/linux/printk.h index 822171fcb1c8..4890fe62c011 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef __KERNEL_PRINTK__ | 1 | #ifndef __KERNEL_PRINTK__ |
| 2 | #define __KERNEL_PRINTK__ | 2 | #define __KERNEL_PRINTK__ |
| 3 | 3 | ||
| 4 | #include <stdarg.h> | ||
| 4 | #include <linux/init.h> | 5 | #include <linux/init.h> |
| 5 | #include <linux/kern_levels.h> | 6 | #include <linux/kern_levels.h> |
| 6 | 7 | ||
| @@ -95,8 +96,14 @@ int no_printk(const char *fmt, ...) | |||
| 95 | return 0; | 96 | return 0; |
| 96 | } | 97 | } |
| 97 | 98 | ||
| 99 | #ifdef CONFIG_EARLY_PRINTK | ||
| 98 | extern asmlinkage __printf(1, 2) | 100 | extern asmlinkage __printf(1, 2) |
| 99 | void early_printk(const char *fmt, ...); | 101 | void early_printk(const char *fmt, ...); |
| 102 | void early_vprintk(const char *fmt, va_list ap); | ||
| 103 | #else | ||
| 104 | static inline __printf(1, 2) __cold | ||
| 105 | void early_printk(const char *s, ...) { } | ||
| 106 | #endif | ||
| 100 | 107 | ||
| 101 | #ifdef CONFIG_PRINTK | 108 | #ifdef CONFIG_PRINTK |
| 102 | asmlinkage __printf(5, 0) | 109 | asmlinkage __printf(5, 0) |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 8307f2f94d86..94dfb2aa5533 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
| @@ -117,6 +117,7 @@ struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, | |||
| 117 | const struct file_operations *proc_fops, | 117 | const struct file_operations *proc_fops, |
| 118 | void *data); | 118 | void *data); |
| 119 | extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); | 119 | extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); |
| 120 | extern int remove_proc_subtree(const char *name, struct proc_dir_entry *parent); | ||
| 120 | 121 | ||
| 121 | struct pid_namespace; | 122 | struct pid_namespace; |
| 122 | 123 | ||
| @@ -202,6 +203,7 @@ static inline struct proc_dir_entry *proc_create_data(const char *name, | |||
| 202 | return NULL; | 203 | return NULL; |
| 203 | } | 204 | } |
| 204 | #define remove_proc_entry(name, parent) do {} while (0) | 205 | #define remove_proc_entry(name, parent) do {} while (0) |
| 206 | #define remove_proc_subtree(name, parent) do {} while (0) | ||
| 205 | 207 | ||
| 206 | static inline struct proc_dir_entry *proc_symlink(const char *name, | 208 | static inline struct proc_dir_entry *proc_symlink(const char *name, |
| 207 | struct proc_dir_entry *parent,const char *dest) {return NULL;} | 209 | struct proc_dir_entry *parent,const char *dest) {return NULL;} |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 5bf5500db83d..69e37c2d1ea5 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
| @@ -6,7 +6,13 @@ struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir, | |||
| 6 | extern struct dentry *ramfs_mount(struct file_system_type *fs_type, | 6 | extern struct dentry *ramfs_mount(struct file_system_type *fs_type, |
| 7 | int flags, const char *dev_name, void *data); | 7 | int flags, const char *dev_name, void *data); |
| 8 | 8 | ||
| 9 | #ifndef CONFIG_MMU | 9 | #ifdef CONFIG_MMU |
| 10 | static inline int | ||
| 11 | ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) | ||
| 12 | { | ||
| 13 | return 0; | ||
| 14 | } | ||
| 15 | #else | ||
| 10 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); | 16 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); |
| 11 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, | 17 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, |
| 12 | unsigned long addr, | 18 | unsigned long addr, |
diff --git a/include/linux/rculist_bl.h b/include/linux/rculist_bl.h index cf1244fbf3b6..4f216c59e7db 100644 --- a/include/linux/rculist_bl.h +++ b/include/linux/rculist_bl.h | |||
| @@ -20,7 +20,7 @@ static inline void hlist_bl_set_first_rcu(struct hlist_bl_head *h, | |||
| 20 | static inline struct hlist_bl_node *hlist_bl_first_rcu(struct hlist_bl_head *h) | 20 | static inline struct hlist_bl_node *hlist_bl_first_rcu(struct hlist_bl_head *h) |
| 21 | { | 21 | { |
| 22 | return (struct hlist_bl_node *) | 22 | return (struct hlist_bl_node *) |
| 23 | ((unsigned long)rcu_dereference(h->first) & ~LIST_BL_LOCKMASK); | 23 | ((unsigned long)rcu_dereference_check(h->first, hlist_bl_is_locked(h)) & ~LIST_BL_LOCKMASK); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index b758ce17b309..9ed2c9a4de45 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -80,6 +80,7 @@ extern void do_trace_rcu_torture_read(char *rcutorturename, | |||
| 80 | #define UINT_CMP_LT(a, b) (UINT_MAX / 2 < (a) - (b)) | 80 | #define UINT_CMP_LT(a, b) (UINT_MAX / 2 < (a) - (b)) |
| 81 | #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) | 81 | #define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) |
| 82 | #define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b)) | 82 | #define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b)) |
| 83 | #define ulong2long(a) (*(long *)(&(a))) | ||
| 83 | 84 | ||
| 84 | /* Exported common interfaces */ | 85 | /* Exported common interfaces */ |
| 85 | 86 | ||
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index bf77dfdabef9..02d84e24b7c2 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
| @@ -389,6 +389,7 @@ int regmap_update_bits_check(struct regmap *map, unsigned int reg, | |||
| 389 | bool *change); | 389 | bool *change); |
| 390 | int regmap_get_val_bytes(struct regmap *map); | 390 | int regmap_get_val_bytes(struct regmap *map); |
| 391 | int regmap_async_complete(struct regmap *map); | 391 | int regmap_async_complete(struct regmap *map); |
| 392 | bool regmap_can_raw_write(struct regmap *map); | ||
| 392 | 393 | ||
| 393 | int regcache_sync(struct regmap *map); | 394 | int regcache_sync(struct regmap *map); |
| 394 | int regcache_sync_region(struct regmap *map, unsigned int min, | 395 | int regcache_sync_region(struct regmap *map, unsigned int min, |
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h index 7bd73bbdfd1b..7c5ff0c55773 100644 --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h | |||
| @@ -5,11 +5,14 @@ | |||
| 5 | * | 5 | * |
| 6 | * Authors: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson | 6 | * Authors: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson |
| 7 | * Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson | 7 | * Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson |
| 8 | * Daniel Willerud <daniel.willerud@stericsson.com> for ST-Ericsson | ||
| 8 | */ | 9 | */ |
| 9 | 10 | ||
| 10 | #ifndef __LINUX_MFD_AB8500_REGULATOR_H | 11 | #ifndef __LINUX_MFD_AB8500_REGULATOR_H |
| 11 | #define __LINUX_MFD_AB8500_REGULATOR_H | 12 | #define __LINUX_MFD_AB8500_REGULATOR_H |
| 12 | 13 | ||
| 14 | #include <linux/platform_device.h> | ||
| 15 | |||
| 13 | /* AB8500 regulators */ | 16 | /* AB8500 regulators */ |
| 14 | enum ab8500_regulator_id { | 17 | enum ab8500_regulator_id { |
| 15 | AB8500_LDO_AUX1, | 18 | AB8500_LDO_AUX1, |
| @@ -17,7 +20,6 @@ enum ab8500_regulator_id { | |||
| 17 | AB8500_LDO_AUX3, | 20 | AB8500_LDO_AUX3, |
| 18 | AB8500_LDO_INTCORE, | 21 | AB8500_LDO_INTCORE, |
| 19 | AB8500_LDO_TVOUT, | 22 | AB8500_LDO_TVOUT, |
| 20 | AB8500_LDO_USB, | ||
| 21 | AB8500_LDO_AUDIO, | 23 | AB8500_LDO_AUDIO, |
| 22 | AB8500_LDO_ANAMIC1, | 24 | AB8500_LDO_ANAMIC1, |
| 23 | AB8500_LDO_ANAMIC2, | 25 | AB8500_LDO_ANAMIC2, |
| @@ -26,7 +28,28 @@ enum ab8500_regulator_id { | |||
| 26 | AB8500_NUM_REGULATORS, | 28 | AB8500_NUM_REGULATORS, |
| 27 | }; | 29 | }; |
| 28 | 30 | ||
| 29 | /* AB9450 regulators */ | 31 | /* AB8505 regulators */ |
| 32 | enum ab8505_regulator_id { | ||
| 33 | AB8505_LDO_AUX1, | ||
| 34 | AB8505_LDO_AUX2, | ||
| 35 | AB8505_LDO_AUX3, | ||
| 36 | AB8505_LDO_AUX4, | ||
| 37 | AB8505_LDO_AUX5, | ||
| 38 | AB8505_LDO_AUX6, | ||
| 39 | AB8505_LDO_INTCORE, | ||
| 40 | AB8505_LDO_ADC, | ||
| 41 | AB8505_LDO_USB, | ||
| 42 | AB8505_LDO_AUDIO, | ||
| 43 | AB8505_LDO_ANAMIC1, | ||
| 44 | AB8505_LDO_ANAMIC2, | ||
| 45 | AB8505_LDO_AUX8, | ||
| 46 | AB8505_LDO_ANA, | ||
| 47 | AB8505_SYSCLKREQ_2, | ||
| 48 | AB8505_SYSCLKREQ_4, | ||
| 49 | AB8505_NUM_REGULATORS, | ||
| 50 | }; | ||
| 51 | |||
| 52 | /* AB9540 regulators */ | ||
| 30 | enum ab9540_regulator_id { | 53 | enum ab9540_regulator_id { |
| 31 | AB9540_LDO_AUX1, | 54 | AB9540_LDO_AUX1, |
| 32 | AB9540_LDO_AUX2, | 55 | AB9540_LDO_AUX2, |
| @@ -45,16 +68,39 @@ enum ab9540_regulator_id { | |||
| 45 | AB9540_NUM_REGULATORS, | 68 | AB9540_NUM_REGULATORS, |
| 46 | }; | 69 | }; |
| 47 | 70 | ||
| 48 | /* AB8500 and AB9540 register initialization */ | 71 | /* AB8540 regulators */ |
| 72 | enum 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 */ | ||
| 49 | struct ab8500_regulator_reg_init { | 93 | struct ab8500_regulator_reg_init { |
| 50 | int id; | 94 | int id; |
| 95 | u8 mask; | ||
| 51 | u8 value; | 96 | u8 value; |
| 52 | }; | 97 | }; |
| 53 | 98 | ||
| 54 | #define INIT_REGULATOR_REGISTER(_id, _value) \ | 99 | #define INIT_REGULATOR_REGISTER(_id, _mask, _value) \ |
| 55 | { \ | 100 | { \ |
| 56 | .id = _id, \ | 101 | .id = _id, \ |
| 57 | .value = _value, \ | 102 | .mask = _mask, \ |
| 103 | .value = _value, \ | ||
| 58 | } | 104 | } |
| 59 | 105 | ||
| 60 | /* AB8500 registers */ | 106 | /* AB8500 registers */ |
| @@ -86,10 +132,58 @@ enum ab8500_regulator_reg { | |||
| 86 | AB8500_REGUCTRL2SPARE, | 132 | AB8500_REGUCTRL2SPARE, |
| 87 | AB8500_REGUCTRLDISCH, | 133 | AB8500_REGUCTRLDISCH, |
| 88 | AB8500_REGUCTRLDISCH2, | 134 | AB8500_REGUCTRLDISCH2, |
| 89 | AB8500_VSMPS1SEL1, | ||
| 90 | AB8500_NUM_REGULATOR_REGISTERS, | 135 | AB8500_NUM_REGULATOR_REGISTERS, |
| 91 | }; | 136 | }; |
| 92 | 137 | ||
| 138 | /* AB8505 registers */ | ||
| 139 | enum ab8505_regulator_reg { | ||
| 140 | AB8505_REGUREQUESTCTRL1, | ||
| 141 | AB8505_REGUREQUESTCTRL2, | ||
| 142 | AB8505_REGUREQUESTCTRL3, | ||
| 143 | AB8505_REGUREQUESTCTRL4, | ||
| 144 | AB8505_REGUSYSCLKREQ1HPVALID1, | ||
| 145 | AB8505_REGUSYSCLKREQ1HPVALID2, | ||
| 146 | AB8505_REGUHWHPREQ1VALID1, | ||
| 147 | AB8505_REGUHWHPREQ1VALID2, | ||
| 148 | AB8505_REGUHWHPREQ2VALID1, | ||
| 149 | AB8505_REGUHWHPREQ2VALID2, | ||
| 150 | AB8505_REGUSWHPREQVALID1, | ||
| 151 | AB8505_REGUSWHPREQVALID2, | ||
| 152 | AB8505_REGUSYSCLKREQVALID1, | ||
| 153 | AB8505_REGUSYSCLKREQVALID2, | ||
| 154 | AB8505_REGUVAUX4REQVALID, | ||
| 155 | AB8505_REGUMISC1, | ||
| 156 | AB8505_VAUDIOSUPPLY, | ||
| 157 | AB8505_REGUCTRL1VAMIC, | ||
| 158 | AB8505_VSMPSAREGU, | ||
| 159 | AB8505_VSMPSBREGU, | ||
| 160 | AB8505_VSAFEREGU, /* NOTE! PRCMU register */ | ||
| 161 | AB8505_VPLLVANAREGU, | ||
| 162 | AB8505_EXTSUPPLYREGU, | ||
| 163 | AB8505_VAUX12REGU, | ||
| 164 | AB8505_VRF1VAUX3REGU, | ||
| 165 | AB8505_VSMPSASEL1, | ||
| 166 | AB8505_VSMPSASEL2, | ||
| 167 | AB8505_VSMPSASEL3, | ||
| 168 | AB8505_VSMPSBSEL1, | ||
| 169 | AB8505_VSMPSBSEL2, | ||
| 170 | AB8505_VSMPSBSEL3, | ||
| 171 | AB8505_VSAFESEL1, /* NOTE! PRCMU register */ | ||
| 172 | AB8505_VSAFESEL2, /* NOTE! PRCMU register */ | ||
| 173 | AB8505_VSAFESEL3, /* NOTE! PRCMU register */ | ||
| 174 | AB8505_VAUX1SEL, | ||
| 175 | AB8505_VAUX2SEL, | ||
| 176 | AB8505_VRF1VAUX3SEL, | ||
| 177 | AB8505_VAUX4REQCTRL, | ||
| 178 | AB8505_VAUX4REGU, | ||
| 179 | AB8505_VAUX4SEL, | ||
| 180 | AB8505_REGUCTRLDISCH, | ||
| 181 | AB8505_REGUCTRLDISCH2, | ||
| 182 | AB8505_REGUCTRLDISCH3, | ||
| 183 | AB8505_CTRLVAUX5, | ||
| 184 | AB8505_CTRLVAUX6, | ||
| 185 | AB8505_NUM_REGULATOR_REGISTERS, | ||
| 186 | }; | ||
| 93 | 187 | ||
| 94 | /* AB9540 registers */ | 188 | /* AB9540 registers */ |
| 95 | enum ab9540_regulator_reg { | 189 | enum ab9540_regulator_reg { |
| @@ -139,4 +233,111 @@ enum ab9540_regulator_reg { | |||
| 139 | AB9540_NUM_REGULATOR_REGISTERS, | 233 | AB9540_NUM_REGULATOR_REGISTERS, |
| 140 | }; | 234 | }; |
| 141 | 235 | ||
| 236 | /* AB8540 registers */ | ||
| 237 | enum 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 */ | ||
| 304 | struct ab8500_ext_regulator_cfg { | ||
| 305 | bool hwreq; /* requires hw mode or high power mode */ | ||
| 306 | }; | ||
| 307 | |||
| 308 | enum ab8500_ext_regulator_id { | ||
| 309 | AB8500_EXT_SUPPLY1, | ||
| 310 | AB8500_EXT_SUPPLY2, | ||
| 311 | AB8500_EXT_SUPPLY3, | ||
| 312 | AB8500_NUM_EXT_REGULATORS, | ||
| 313 | }; | ||
| 314 | |||
| 315 | /* AB8500 regulator platform data */ | ||
| 316 | struct ab8500_regulator_platform_data { | ||
| 317 | int num_reg_init; | ||
| 318 | struct ab8500_regulator_reg_init *reg_init; | ||
| 319 | int num_regulator; | ||
| 320 | struct regulator_init_data *regulator; | ||
| 321 | int num_ext_regulator; | ||
| 322 | struct regulator_init_data *ext_regulator; | ||
| 323 | }; | ||
| 324 | |||
| 325 | #ifdef CONFIG_REGULATOR_AB8500_DEBUG | ||
| 326 | int ab8500_regulator_debug_init(struct platform_device *pdev); | ||
| 327 | int ab8500_regulator_debug_exit(struct platform_device *pdev); | ||
| 328 | #else | ||
| 329 | static inline int ab8500_regulator_debug_init(struct platform_device *pdev) | ||
| 330 | { | ||
| 331 | return 0; | ||
| 332 | } | ||
| 333 | static inline int ab8500_regulator_debug_exit(struct platform_device *pdev) | ||
| 334 | { | ||
| 335 | return 0; | ||
| 336 | } | ||
| 337 | #endif | ||
| 338 | |||
| 339 | /* AB8500 external regulator functions. */ | ||
| 340 | int ab8500_ext_regulator_init(struct platform_device *pdev); | ||
| 341 | void ab8500_ext_regulator_exit(struct platform_device *pdev); | ||
| 342 | |||
| 142 | #endif | 343 | #endif |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 7bc732ce6e50..145022a83085 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
| @@ -141,18 +141,18 @@ void regulator_put(struct regulator *regulator); | |||
| 141 | void devm_regulator_put(struct regulator *regulator); | 141 | void devm_regulator_put(struct regulator *regulator); |
| 142 | 142 | ||
| 143 | /* regulator output control and status */ | 143 | /* regulator output control and status */ |
| 144 | int regulator_enable(struct regulator *regulator); | 144 | int __must_check regulator_enable(struct regulator *regulator); |
| 145 | int regulator_disable(struct regulator *regulator); | 145 | int regulator_disable(struct regulator *regulator); |
| 146 | int regulator_force_disable(struct regulator *regulator); | 146 | int regulator_force_disable(struct regulator *regulator); |
| 147 | int regulator_is_enabled(struct regulator *regulator); | 147 | int regulator_is_enabled(struct regulator *regulator); |
| 148 | int regulator_disable_deferred(struct regulator *regulator, int ms); | 148 | int regulator_disable_deferred(struct regulator *regulator, int ms); |
| 149 | 149 | ||
| 150 | int regulator_bulk_get(struct device *dev, int num_consumers, | 150 | int __must_check regulator_bulk_get(struct device *dev, int num_consumers, |
| 151 | struct regulator_bulk_data *consumers); | 151 | struct regulator_bulk_data *consumers); |
| 152 | int devm_regulator_bulk_get(struct device *dev, int num_consumers, | 152 | int __must_check devm_regulator_bulk_get(struct device *dev, int num_consumers, |
| 153 | struct regulator_bulk_data *consumers); | 153 | struct regulator_bulk_data *consumers); |
| 154 | int regulator_bulk_enable(int num_consumers, | 154 | int __must_check regulator_bulk_enable(int num_consumers, |
| 155 | struct regulator_bulk_data *consumers); | 155 | struct regulator_bulk_data *consumers); |
| 156 | int regulator_bulk_disable(int num_consumers, | 156 | int regulator_bulk_disable(int num_consumers, |
| 157 | struct regulator_bulk_data *consumers); | 157 | struct regulator_bulk_data *consumers); |
| 158 | int regulator_bulk_force_disable(int num_consumers, | 158 | int regulator_bulk_force_disable(int num_consumers, |
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h index 7df93f52db08..6700cc94bdd1 100644 --- a/include/linux/regulator/driver.h +++ b/include/linux/regulator/driver.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | struct regmap; | 22 | struct regmap; |
| 23 | struct regulator_dev; | 23 | struct regulator_dev; |
| 24 | struct regulator_init_data; | 24 | struct regulator_init_data; |
| 25 | struct regulator_enable_gpio; | ||
| 25 | 26 | ||
| 26 | enum regulator_status { | 27 | enum regulator_status { |
| 27 | REGULATOR_STATUS_OFF, | 28 | REGULATOR_STATUS_OFF, |
| @@ -199,6 +200,8 @@ enum regulator_type { | |||
| 199 | * output when using regulator_set_voltage_sel_regmap | 200 | * output when using regulator_set_voltage_sel_regmap |
| 200 | * @enable_reg: Register for control when using regmap enable/disable ops | 201 | * @enable_reg: Register for control when using regmap enable/disable ops |
| 201 | * @enable_mask: Mask for control when using regmap enable/disable ops | 202 | * @enable_mask: Mask for control when using regmap enable/disable ops |
| 203 | * @enable_is_inverted: A flag to indicate set enable_mask bits to disable | ||
| 204 | * when using regulator_enable_regmap and friends APIs. | ||
| 202 | * @bypass_reg: Register for control when using regmap set_bypass | 205 | * @bypass_reg: Register for control when using regmap set_bypass |
| 203 | * @bypass_mask: Mask for control when using regmap set_bypass | 206 | * @bypass_mask: Mask for control when using regmap set_bypass |
| 204 | * | 207 | * |
| @@ -228,6 +231,7 @@ struct regulator_desc { | |||
| 228 | unsigned int apply_bit; | 231 | unsigned int apply_bit; |
| 229 | unsigned int enable_reg; | 232 | unsigned int enable_reg; |
| 230 | unsigned int enable_mask; | 233 | unsigned int enable_mask; |
| 234 | bool enable_is_inverted; | ||
| 231 | unsigned int bypass_reg; | 235 | unsigned int bypass_reg; |
| 232 | unsigned int bypass_mask; | 236 | unsigned int bypass_mask; |
| 233 | 237 | ||
| @@ -302,8 +306,7 @@ struct regulator_dev { | |||
| 302 | 306 | ||
| 303 | struct dentry *debugfs; | 307 | struct dentry *debugfs; |
| 304 | 308 | ||
| 305 | int ena_gpio; | 309 | struct regulator_enable_gpio *ena_pin; |
| 306 | unsigned int ena_gpio_invert:1; | ||
| 307 | unsigned int ena_gpio_state:1; | 310 | unsigned int ena_gpio_state:1; |
| 308 | }; | 311 | }; |
| 309 | 312 | ||
| @@ -329,6 +332,8 @@ int regulator_map_voltage_linear(struct regulator_dev *rdev, | |||
| 329 | int min_uV, int max_uV); | 332 | int min_uV, int max_uV); |
| 330 | int regulator_map_voltage_iterate(struct regulator_dev *rdev, | 333 | int regulator_map_voltage_iterate(struct regulator_dev *rdev, |
| 331 | int min_uV, int max_uV); | 334 | int min_uV, int max_uV); |
| 335 | int regulator_map_voltage_ascend(struct regulator_dev *rdev, | ||
| 336 | int min_uV, int max_uV); | ||
| 332 | int regulator_get_voltage_sel_regmap(struct regulator_dev *rdev); | 337 | int regulator_get_voltage_sel_regmap(struct regulator_dev *rdev); |
| 333 | int regulator_set_voltage_sel_regmap(struct regulator_dev *rdev, unsigned sel); | 338 | int regulator_set_voltage_sel_regmap(struct regulator_dev *rdev, unsigned sel); |
| 334 | int regulator_is_enabled_regmap(struct regulator_dev *rdev); | 339 | int regulator_is_enabled_regmap(struct regulator_dev *rdev); |
diff --git a/include/linux/regulator/max8952.h b/include/linux/regulator/max8952.h index 45e42855ad05..4dbb63a1d4ab 100644 --- a/include/linux/regulator/max8952.h +++ b/include/linux/regulator/max8952.h | |||
| @@ -122,13 +122,13 @@ struct max8952_platform_data { | |||
| 122 | int gpio_vid1; | 122 | int gpio_vid1; |
| 123 | int gpio_en; | 123 | int gpio_en; |
| 124 | 124 | ||
| 125 | u8 default_mode; | 125 | u32 default_mode; |
| 126 | u8 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */ | 126 | u32 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */ |
| 127 | 127 | ||
| 128 | u8 sync_freq; | 128 | u32 sync_freq; |
| 129 | u8 ramp_speed; | 129 | u32 ramp_speed; |
| 130 | 130 | ||
| 131 | struct regulator_init_data reg_data; | 131 | struct regulator_init_data *reg_data; |
| 132 | }; | 132 | }; |
| 133 | 133 | ||
| 134 | 134 | ||
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index c23099413ad6..96a509b6be04 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | * info about what this counter is. | 13 | * info about what this counter is. |
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | #include <linux/cgroup.h> | 16 | #include <linux/spinlock.h> |
| 17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 18 | 18 | ||
| 19 | /* | 19 | /* |
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 1342e69542f3..d69cf637a15a 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <linux/kmemcheck.h> | 4 | #include <linux/kmemcheck.h> |
| 5 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
| 6 | #include <linux/seq_file.h> | 6 | #include <linux/seq_file.h> |
| 7 | #include <linux/poll.h> | ||
| 7 | 8 | ||
| 8 | struct ring_buffer; | 9 | struct ring_buffer; |
| 9 | struct ring_buffer_iter; | 10 | struct ring_buffer_iter; |
| @@ -96,6 +97,11 @@ __ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *k | |||
| 96 | __ring_buffer_alloc((size), (flags), &__key); \ | 97 | __ring_buffer_alloc((size), (flags), &__key); \ |
| 97 | }) | 98 | }) |
| 98 | 99 | ||
| 100 | void ring_buffer_wait(struct ring_buffer *buffer, int cpu); | ||
| 101 | int ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu, | ||
| 102 | struct file *filp, poll_table *poll_table); | ||
| 103 | |||
| 104 | |||
| 99 | #define RING_BUFFER_ALL_CPUS -1 | 105 | #define RING_BUFFER_ALL_CPUS -1 |
| 100 | 106 | ||
| 101 | void ring_buffer_free(struct ring_buffer *buffer); | 107 | void ring_buffer_free(struct ring_buffer *buffer); |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 580b24c8b8ca..c2c28975293c 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
| @@ -133,7 +133,13 @@ extern struct rtc_device *rtc_device_register(const char *name, | |||
| 133 | struct device *dev, | 133 | struct device *dev, |
| 134 | const struct rtc_class_ops *ops, | 134 | const struct rtc_class_ops *ops, |
| 135 | struct module *owner); | 135 | struct module *owner); |
| 136 | extern struct rtc_device *devm_rtc_device_register(struct device *dev, | ||
| 137 | const char *name, | ||
| 138 | const struct rtc_class_ops *ops, | ||
| 139 | struct module *owner); | ||
| 136 | extern void rtc_device_unregister(struct rtc_device *rtc); | 140 | extern void rtc_device_unregister(struct rtc_device *rtc); |
| 141 | extern void devm_rtc_device_unregister(struct device *dev, | ||
| 142 | struct rtc_device *rtc); | ||
| 137 | 143 | ||
| 138 | extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm); | 144 | extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm); |
| 139 | extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm); | 145 | extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index d35d2b6ddbfb..54ddcb82cddf 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -127,18 +127,6 @@ extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m); | |||
| 127 | extern void proc_sched_set_task(struct task_struct *p); | 127 | extern void proc_sched_set_task(struct task_struct *p); |
| 128 | extern void | 128 | extern void |
| 129 | print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq); | 129 | print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq); |
| 130 | #else | ||
| 131 | static inline void | ||
| 132 | proc_sched_show_task(struct task_struct *p, struct seq_file *m) | ||
| 133 | { | ||
| 134 | } | ||
| 135 | static inline void proc_sched_set_task(struct task_struct *p) | ||
| 136 | { | ||
| 137 | } | ||
| 138 | static inline void | ||
| 139 | print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | ||
| 140 | { | ||
| 141 | } | ||
| 142 | #endif | 130 | #endif |
| 143 | 131 | ||
| 144 | /* | 132 | /* |
| @@ -163,9 +151,10 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
| 163 | #define TASK_DEAD 64 | 151 | #define TASK_DEAD 64 |
| 164 | #define TASK_WAKEKILL 128 | 152 | #define TASK_WAKEKILL 128 |
| 165 | #define TASK_WAKING 256 | 153 | #define TASK_WAKING 256 |
| 166 | #define TASK_STATE_MAX 512 | 154 | #define TASK_PARKED 512 |
| 155 | #define TASK_STATE_MAX 1024 | ||
| 167 | 156 | ||
| 168 | #define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW" | 157 | #define TASK_STATE_TO_CHAR_STR "RSDTtZXxKWP" |
| 169 | 158 | ||
| 170 | extern char ___assert_task_state[1 - 2*!!( | 159 | extern char ___assert_task_state[1 - 2*!!( |
| 171 | sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)]; | 160 | sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)]; |
| @@ -320,7 +309,6 @@ extern signed long schedule_timeout_killable(signed long timeout); | |||
| 320 | extern signed long schedule_timeout_uninterruptible(signed long timeout); | 309 | extern signed long schedule_timeout_uninterruptible(signed long timeout); |
| 321 | asmlinkage void schedule(void); | 310 | asmlinkage void schedule(void); |
| 322 | extern void schedule_preempt_disabled(void); | 311 | extern void schedule_preempt_disabled(void); |
| 323 | extern int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner); | ||
| 324 | 312 | ||
| 325 | struct nsproxy; | 313 | struct nsproxy; |
| 326 | struct user_namespace; | 314 | struct user_namespace; |
| @@ -526,7 +514,8 @@ struct signal_struct { | |||
| 526 | unsigned int has_child_subreaper:1; | 514 | unsigned int has_child_subreaper:1; |
| 527 | 515 | ||
| 528 | /* POSIX.1b Interval Timers */ | 516 | /* POSIX.1b Interval Timers */ |
| 529 | struct list_head posix_timers; | 517 | int posix_timer_id; |
| 518 | struct list_head posix_timers; | ||
| 530 | 519 | ||
| 531 | /* ITIMER_REAL timer for the process */ | 520 | /* ITIMER_REAL timer for the process */ |
| 532 | struct hrtimer real_timer; | 521 | struct hrtimer real_timer; |
| @@ -570,7 +559,7 @@ struct signal_struct { | |||
| 570 | cputime_t utime, stime, cutime, cstime; | 559 | cputime_t utime, stime, cutime, cstime; |
| 571 | cputime_t gtime; | 560 | cputime_t gtime; |
| 572 | cputime_t cgtime; | 561 | cputime_t cgtime; |
| 573 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | 562 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE |
| 574 | struct cputime prev_cputime; | 563 | struct cputime prev_cputime; |
| 575 | #endif | 564 | #endif |
| 576 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; | 565 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; |
| @@ -768,31 +757,6 @@ enum cpu_idle_type { | |||
| 768 | }; | 757 | }; |
| 769 | 758 | ||
| 770 | /* | 759 | /* |
| 771 | * Increase resolution of nice-level calculations for 64-bit architectures. | ||
| 772 | * The extra resolution improves shares distribution and load balancing of | ||
| 773 | * low-weight task groups (eg. nice +19 on an autogroup), deeper taskgroup | ||
| 774 | * hierarchies, especially on larger systems. This is not a user-visible change | ||
| 775 | * and does not change the user-interface for setting shares/weights. | ||
| 776 | * | ||
| 777 | * We increase resolution only if we have enough bits to allow this increased | ||
| 778 | * resolution (i.e. BITS_PER_LONG > 32). The costs for increasing resolution | ||
| 779 | * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the | ||
| 780 | * increased costs. | ||
| 781 | */ | ||
| 782 | #if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power usage under light load */ | ||
| 783 | # define SCHED_LOAD_RESOLUTION 10 | ||
| 784 | # define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION) | ||
| 785 | # define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION) | ||
| 786 | #else | ||
| 787 | # define SCHED_LOAD_RESOLUTION 0 | ||
| 788 | # define scale_load(w) (w) | ||
| 789 | # define scale_load_down(w) (w) | ||
| 790 | #endif | ||
| 791 | |||
| 792 | #define SCHED_LOAD_SHIFT (10 + SCHED_LOAD_RESOLUTION) | ||
| 793 | #define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT) | ||
| 794 | |||
| 795 | /* | ||
| 796 | * Increase resolution of cpu_power calculations | 760 | * Increase resolution of cpu_power calculations |
| 797 | */ | 761 | */ |
| 798 | #define SCHED_POWER_SHIFT 10 | 762 | #define SCHED_POWER_SHIFT 10 |
| @@ -817,62 +781,6 @@ enum cpu_idle_type { | |||
| 817 | 781 | ||
| 818 | extern int __weak arch_sd_sibiling_asym_packing(void); | 782 | extern int __weak arch_sd_sibiling_asym_packing(void); |
| 819 | 783 | ||
| 820 | struct sched_group_power { | ||
| 821 | atomic_t ref; | ||
| 822 | /* | ||
| 823 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a | ||
| 824 | * single CPU. | ||
| 825 | */ | ||
| 826 | unsigned int power, power_orig; | ||
| 827 | unsigned long next_update; | ||
| 828 | /* | ||
| 829 | * Number of busy cpus in this group. | ||
| 830 | */ | ||
| 831 | atomic_t nr_busy_cpus; | ||
| 832 | |||
| 833 | unsigned long cpumask[0]; /* iteration mask */ | ||
| 834 | }; | ||
| 835 | |||
| 836 | struct sched_group { | ||
| 837 | struct sched_group *next; /* Must be a circular list */ | ||
| 838 | atomic_t ref; | ||
| 839 | |||
| 840 | unsigned int group_weight; | ||
| 841 | struct sched_group_power *sgp; | ||
| 842 | |||
| 843 | /* | ||
| 844 | * The CPUs this group covers. | ||
| 845 | * | ||
| 846 | * NOTE: this field is variable length. (Allocated dynamically | ||
| 847 | * by attaching extra space to the end of the structure, | ||
| 848 | * depending on how many CPUs the kernel has booted up with) | ||
| 849 | */ | ||
| 850 | unsigned long cpumask[0]; | ||
| 851 | }; | ||
| 852 | |||
| 853 | static inline struct cpumask *sched_group_cpus(struct sched_group *sg) | ||
| 854 | { | ||
| 855 | return to_cpumask(sg->cpumask); | ||
| 856 | } | ||
| 857 | |||
| 858 | /* | ||
| 859 | * cpumask masking which cpus in the group are allowed to iterate up the domain | ||
| 860 | * tree. | ||
| 861 | */ | ||
| 862 | static inline struct cpumask *sched_group_mask(struct sched_group *sg) | ||
| 863 | { | ||
| 864 | return to_cpumask(sg->sgp->cpumask); | ||
| 865 | } | ||
| 866 | |||
| 867 | /** | ||
| 868 | * group_first_cpu - Returns the first cpu in the cpumask of a sched_group. | ||
| 869 | * @group: The group whose first cpu is to be returned. | ||
| 870 | */ | ||
| 871 | static inline unsigned int group_first_cpu(struct sched_group *group) | ||
| 872 | { | ||
| 873 | return cpumask_first(sched_group_cpus(group)); | ||
| 874 | } | ||
| 875 | |||
| 876 | struct sched_domain_attr { | 784 | struct sched_domain_attr { |
| 877 | int relax_domain_level; | 785 | int relax_domain_level; |
| 878 | }; | 786 | }; |
| @@ -883,6 +791,8 @@ struct sched_domain_attr { | |||
| 883 | 791 | ||
| 884 | extern int sched_domain_level_max; | 792 | extern int sched_domain_level_max; |
| 885 | 793 | ||
| 794 | struct sched_group; | ||
| 795 | |||
| 886 | struct sched_domain { | 796 | struct sched_domain { |
| 887 | /* These fields must be setup */ | 797 | /* These fields must be setup */ |
| 888 | struct sched_domain *parent; /* top domain must be null terminated */ | 798 | struct sched_domain *parent; /* top domain must be null terminated */ |
| @@ -899,6 +809,8 @@ struct sched_domain { | |||
| 899 | unsigned int wake_idx; | 809 | unsigned int wake_idx; |
| 900 | unsigned int forkexec_idx; | 810 | unsigned int forkexec_idx; |
| 901 | unsigned int smt_gain; | 811 | unsigned int smt_gain; |
| 812 | |||
| 813 | int nohz_idle; /* NOHZ IDLE status */ | ||
| 902 | int flags; /* See SD_* */ | 814 | int flags; /* See SD_* */ |
| 903 | int level; | 815 | int level; |
| 904 | 816 | ||
| @@ -971,18 +883,6 @@ extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[], | |||
| 971 | cpumask_var_t *alloc_sched_domains(unsigned int ndoms); | 883 | cpumask_var_t *alloc_sched_domains(unsigned int ndoms); |
| 972 | void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms); | 884 | void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms); |
| 973 | 885 | ||
| 974 | /* Test a flag in parent sched domain */ | ||
| 975 | static inline int test_sd_parent(struct sched_domain *sd, int flag) | ||
| 976 | { | ||
| 977 | if (sd->parent && (sd->parent->flags & flag)) | ||
| 978 | return 1; | ||
| 979 | |||
| 980 | return 0; | ||
| 981 | } | ||
| 982 | |||
| 983 | unsigned long default_scale_freq_power(struct sched_domain *sd, int cpu); | ||
| 984 | unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu); | ||
| 985 | |||
| 986 | bool cpus_share_cache(int this_cpu, int that_cpu); | 886 | bool cpus_share_cache(int this_cpu, int that_cpu); |
| 987 | 887 | ||
| 988 | #else /* CONFIG_SMP */ | 888 | #else /* CONFIG_SMP */ |
| @@ -1017,72 +917,6 @@ struct mempolicy; | |||
| 1017 | struct pipe_inode_info; | 917 | struct pipe_inode_info; |
| 1018 | struct uts_namespace; | 918 | struct uts_namespace; |
| 1019 | 919 | ||
| 1020 | struct rq; | ||
| 1021 | struct sched_domain; | ||
| 1022 | |||
| 1023 | /* | ||
| 1024 | * wake flags | ||
| 1025 | */ | ||
| 1026 | #define WF_SYNC 0x01 /* waker goes to sleep after wakup */ | ||
| 1027 | #define WF_FORK 0x02 /* child wakeup after fork */ | ||
| 1028 | #define WF_MIGRATED 0x04 /* internal use, task got migrated */ | ||
| 1029 | |||
| 1030 | #define ENQUEUE_WAKEUP 1 | ||
| 1031 | #define ENQUEUE_HEAD 2 | ||
| 1032 | #ifdef CONFIG_SMP | ||
| 1033 | #define ENQUEUE_WAKING 4 /* sched_class::task_waking was called */ | ||
| 1034 | #else | ||
| 1035 | #define ENQUEUE_WAKING 0 | ||
| 1036 | #endif | ||
| 1037 | |||
| 1038 | #define DEQUEUE_SLEEP 1 | ||
| 1039 | |||
| 1040 | struct sched_class { | ||
| 1041 | const struct sched_class *next; | ||
| 1042 | |||
| 1043 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags); | ||
| 1044 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags); | ||
| 1045 | void (*yield_task) (struct rq *rq); | ||
| 1046 | bool (*yield_to_task) (struct rq *rq, struct task_struct *p, bool preempt); | ||
| 1047 | |||
| 1048 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); | ||
| 1049 | |||
| 1050 | struct task_struct * (*pick_next_task) (struct rq *rq); | ||
| 1051 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); | ||
| 1052 | |||
| 1053 | #ifdef CONFIG_SMP | ||
| 1054 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); | ||
| 1055 | void (*migrate_task_rq)(struct task_struct *p, int next_cpu); | ||
| 1056 | |||
| 1057 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | ||
| 1058 | void (*post_schedule) (struct rq *this_rq); | ||
| 1059 | void (*task_waking) (struct task_struct *task); | ||
| 1060 | void (*task_woken) (struct rq *this_rq, struct task_struct *task); | ||
| 1061 | |||
| 1062 | void (*set_cpus_allowed)(struct task_struct *p, | ||
| 1063 | const struct cpumask *newmask); | ||
| 1064 | |||
| 1065 | void (*rq_online)(struct rq *rq); | ||
| 1066 | void (*rq_offline)(struct rq *rq); | ||
| 1067 | #endif | ||
| 1068 | |||
| 1069 | void (*set_curr_task) (struct rq *rq); | ||
| 1070 | void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); | ||
| 1071 | void (*task_fork) (struct task_struct *p); | ||
| 1072 | |||
| 1073 | void (*switched_from) (struct rq *this_rq, struct task_struct *task); | ||
| 1074 | void (*switched_to) (struct rq *this_rq, struct task_struct *task); | ||
| 1075 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, | ||
| 1076 | int oldprio); | ||
| 1077 | |||
| 1078 | unsigned int (*get_rr_interval) (struct rq *rq, | ||
| 1079 | struct task_struct *task); | ||
| 1080 | |||
| 1081 | #ifdef CONFIG_FAIR_GROUP_SCHED | ||
| 1082 | void (*task_move_group) (struct task_struct *p, int on_rq); | ||
| 1083 | #endif | ||
| 1084 | }; | ||
| 1085 | |||
| 1086 | struct load_weight { | 920 | struct load_weight { |
| 1087 | unsigned long weight, inv_weight; | 921 | unsigned long weight, inv_weight; |
| 1088 | }; | 922 | }; |
| @@ -1274,8 +1108,10 @@ struct task_struct { | |||
| 1274 | int exit_code, exit_signal; | 1108 | int exit_code, exit_signal; |
| 1275 | int pdeath_signal; /* The signal sent when the parent dies */ | 1109 | int pdeath_signal; /* The signal sent when the parent dies */ |
| 1276 | unsigned int jobctl; /* JOBCTL_*, siglock protected */ | 1110 | unsigned int jobctl; /* JOBCTL_*, siglock protected */ |
| 1277 | /* ??? */ | 1111 | |
| 1112 | /* Used for emulating ABI behavior of previous Linux versions */ | ||
| 1278 | unsigned int personality; | 1113 | unsigned int personality; |
| 1114 | |||
| 1279 | unsigned did_exec:1; | 1115 | unsigned did_exec:1; |
| 1280 | unsigned in_execve:1; /* Tell the LSMs that the process is doing an | 1116 | unsigned in_execve:1; /* Tell the LSMs that the process is doing an |
| 1281 | * execve */ | 1117 | * execve */ |
| @@ -1327,7 +1163,7 @@ struct task_struct { | |||
| 1327 | 1163 | ||
| 1328 | cputime_t utime, stime, utimescaled, stimescaled; | 1164 | cputime_t utime, stime, utimescaled, stimescaled; |
| 1329 | cputime_t gtime; | 1165 | cputime_t gtime; |
| 1330 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | 1166 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE |
| 1331 | struct cputime prev_cputime; | 1167 | struct cputime prev_cputime; |
| 1332 | #endif | 1168 | #endif |
| 1333 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN | 1169 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN |
| @@ -1793,7 +1629,7 @@ extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, | |||
| 1793 | #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ | 1629 | #define PF_SWAPWRITE 0x00800000 /* Allowed to write to swap */ |
| 1794 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ | 1630 | #define PF_SPREAD_PAGE 0x01000000 /* Spread page cache over cpuset */ |
| 1795 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ | 1631 | #define PF_SPREAD_SLAB 0x02000000 /* Spread some slab caches over cpuset */ |
| 1796 | #define PF_THREAD_BOUND 0x04000000 /* Thread bound to specific cpu */ | 1632 | #define PF_NO_SETAFFINITY 0x04000000 /* Userland is not allowed to meddle with cpus_allowed */ |
| 1797 | #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ | 1633 | #define PF_MCE_EARLY 0x08000000 /* Early kill for mce process policy */ |
| 1798 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | 1634 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ |
| 1799 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ | 1635 | #define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ |
| @@ -2622,6 +2458,47 @@ static inline int spin_needbreak(spinlock_t *lock) | |||
| 2622 | } | 2458 | } |
| 2623 | 2459 | ||
| 2624 | /* | 2460 | /* |
| 2461 | * Idle thread specific functions to determine the need_resched | ||
| 2462 | * polling state. We have two versions, one based on TS_POLLING in | ||
| 2463 | * thread_info.status and one based on TIF_POLLING_NRFLAG in | ||
| 2464 | * thread_info.flags | ||
| 2465 | */ | ||
| 2466 | #ifdef TS_POLLING | ||
| 2467 | static inline int tsk_is_polling(struct task_struct *p) | ||
| 2468 | { | ||
| 2469 | return task_thread_info(p)->status & TS_POLLING; | ||
| 2470 | } | ||
| 2471 | static inline void current_set_polling(void) | ||
| 2472 | { | ||
| 2473 | current_thread_info()->status |= TS_POLLING; | ||
| 2474 | } | ||
| 2475 | |||
| 2476 | static inline void current_clr_polling(void) | ||
| 2477 | { | ||
| 2478 | current_thread_info()->status &= ~TS_POLLING; | ||
| 2479 | smp_mb__after_clear_bit(); | ||
| 2480 | } | ||
| 2481 | #elif defined(TIF_POLLING_NRFLAG) | ||
| 2482 | static inline int tsk_is_polling(struct task_struct *p) | ||
| 2483 | { | ||
| 2484 | return test_tsk_thread_flag(p, TIF_POLLING_NRFLAG); | ||
| 2485 | } | ||
| 2486 | static inline void current_set_polling(void) | ||
| 2487 | { | ||
| 2488 | set_thread_flag(TIF_POLLING_NRFLAG); | ||
| 2489 | } | ||
| 2490 | |||
| 2491 | static inline void current_clr_polling(void) | ||
| 2492 | { | ||
| 2493 | clear_thread_flag(TIF_POLLING_NRFLAG); | ||
| 2494 | } | ||
| 2495 | #else | ||
| 2496 | static inline int tsk_is_polling(struct task_struct *p) { return 0; } | ||
| 2497 | static inline void current_set_polling(void) { } | ||
| 2498 | static inline void current_clr_polling(void) { } | ||
| 2499 | #endif | ||
| 2500 | |||
| 2501 | /* | ||
| 2625 | * Thread group CPU time accounting. | 2502 | * Thread group CPU time accounting. |
| 2626 | */ | 2503 | */ |
| 2627 | void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times); | 2504 | void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times); |
| @@ -2681,28 +2558,7 @@ extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask); | |||
| 2681 | extern long sched_getaffinity(pid_t pid, struct cpumask *mask); | 2558 | extern long sched_getaffinity(pid_t pid, struct cpumask *mask); |
| 2682 | 2559 | ||
| 2683 | #ifdef CONFIG_CGROUP_SCHED | 2560 | #ifdef CONFIG_CGROUP_SCHED |
| 2684 | |||
| 2685 | extern struct task_group root_task_group; | 2561 | extern struct task_group root_task_group; |
| 2686 | |||
| 2687 | extern struct task_group *sched_create_group(struct task_group *parent); | ||
| 2688 | extern void sched_online_group(struct task_group *tg, | ||
| 2689 | struct task_group *parent); | ||
| 2690 | extern void sched_destroy_group(struct task_group *tg); | ||
| 2691 | extern void sched_offline_group(struct task_group *tg); | ||
| 2692 | extern void sched_move_task(struct task_struct *tsk); | ||
| 2693 | #ifdef CONFIG_FAIR_GROUP_SCHED | ||
| 2694 | extern int sched_group_set_shares(struct task_group *tg, unsigned long shares); | ||
| 2695 | extern unsigned long sched_group_shares(struct task_group *tg); | ||
| 2696 | #endif | ||
| 2697 | #ifdef CONFIG_RT_GROUP_SCHED | ||
| 2698 | extern int sched_group_set_rt_runtime(struct task_group *tg, | ||
| 2699 | long rt_runtime_us); | ||
| 2700 | extern long sched_group_rt_runtime(struct task_group *tg); | ||
| 2701 | extern int sched_group_set_rt_period(struct task_group *tg, | ||
| 2702 | long rt_period_us); | ||
| 2703 | extern long sched_group_rt_period(struct task_group *tg); | ||
| 2704 | extern int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk); | ||
| 2705 | #endif | ||
| 2706 | #endif /* CONFIG_CGROUP_SCHED */ | 2562 | #endif /* CONFIG_CGROUP_SCHED */ |
| 2707 | 2563 | ||
| 2708 | extern int task_can_switch_user(struct user_struct *up, | 2564 | extern int task_can_switch_user(struct user_struct *up, |
diff --git a/include/linux/security.h b/include/linux/security.h index eee7478cda70..032c366ef1c6 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -1012,6 +1012,10 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1012 | * This hook can be used by the module to update any security state | 1012 | * This hook can be used by the module to update any security state |
| 1013 | * associated with the TUN device's security structure. | 1013 | * associated with the TUN device's security structure. |
| 1014 | * @security pointer to the TUN devices's security structure. | 1014 | * @security pointer to the TUN devices's security structure. |
| 1015 | * @skb_owned_by: | ||
| 1016 | * This hook sets the packet's owning sock. | ||
| 1017 | * @skb is the packet. | ||
| 1018 | * @sk the sock which owns the packet. | ||
| 1015 | * | 1019 | * |
| 1016 | * Security hooks for XFRM operations. | 1020 | * Security hooks for XFRM operations. |
| 1017 | * | 1021 | * |
| @@ -1638,6 +1642,7 @@ struct security_operations { | |||
| 1638 | int (*tun_dev_attach_queue) (void *security); | 1642 | int (*tun_dev_attach_queue) (void *security); |
| 1639 | int (*tun_dev_attach) (struct sock *sk, void *security); | 1643 | int (*tun_dev_attach) (struct sock *sk, void *security); |
| 1640 | int (*tun_dev_open) (void *security); | 1644 | int (*tun_dev_open) (void *security); |
| 1645 | void (*skb_owned_by) (struct sk_buff *skb, struct sock *sk); | ||
| 1641 | #endif /* CONFIG_SECURITY_NETWORK */ | 1646 | #endif /* CONFIG_SECURITY_NETWORK */ |
| 1642 | 1647 | ||
| 1643 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 1648 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| @@ -2588,6 +2593,8 @@ int security_tun_dev_attach_queue(void *security); | |||
| 2588 | int security_tun_dev_attach(struct sock *sk, void *security); | 2593 | int security_tun_dev_attach(struct sock *sk, void *security); |
| 2589 | int security_tun_dev_open(void *security); | 2594 | int security_tun_dev_open(void *security); |
| 2590 | 2595 | ||
| 2596 | void security_skb_owned_by(struct sk_buff *skb, struct sock *sk); | ||
| 2597 | |||
| 2591 | #else /* CONFIG_SECURITY_NETWORK */ | 2598 | #else /* CONFIG_SECURITY_NETWORK */ |
| 2592 | static inline int security_unix_stream_connect(struct sock *sock, | 2599 | static inline int security_unix_stream_connect(struct sock *sock, |
| 2593 | struct sock *other, | 2600 | struct sock *other, |
| @@ -2779,6 +2786,11 @@ static inline int security_tun_dev_open(void *security) | |||
| 2779 | { | 2786 | { |
| 2780 | return 0; | 2787 | return 0; |
| 2781 | } | 2788 | } |
| 2789 | |||
| 2790 | static inline void security_skb_owned_by(struct sk_buff *skb, struct sock *sk) | ||
| 2791 | { | ||
| 2792 | } | ||
| 2793 | |||
| 2782 | #endif /* CONFIG_SECURITY_NETWORK */ | 2794 | #endif /* CONFIG_SECURITY_NETWORK */ |
| 2783 | 2795 | ||
| 2784 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 2796 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
diff --git a/include/linux/serial_s3c.h b/include/linux/serial_s3c.h new file mode 100644 index 000000000000..907d9d1d56cf --- /dev/null +++ b/include/linux/serial_s3c.h | |||
| @@ -0,0 +1,260 @@ | |||
| 1 | /* | ||
| 2 | * Internal header file for Samsung S3C2410 serial ports (UART0-2) | ||
| 3 | * | ||
| 4 | * Copyright (C) 2002 Shane Nay (shane@minirl.com) | ||
| 5 | * | ||
| 6 | * Additional defines, Copyright 2003 Simtec Electronics (linux@simtec.co.uk) | ||
| 7 | * | ||
| 8 | * Adapted from: | ||
| 9 | * | ||
| 10 | * Internal header file for MX1ADS serial ports (UART1 & 2) | ||
| 11 | * | ||
| 12 | * Copyright (C) 2002 Shane Nay (shane@minirl.com) | ||
| 13 | * | ||
| 14 | * This program is free software; you can redistribute it and/or modify | ||
| 15 | * it under the terms of the GNU General Public License as published by | ||
| 16 | * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | * (at your option) any later version. | ||
| 18 | * | ||
| 19 | * This program is distributed in the hope that it will be useful, | ||
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | * GNU General Public License for more details. | ||
| 23 | * | ||
| 24 | * You should have received a copy of the GNU General Public License | ||
| 25 | * along with this program; if not, write to the Free Software | ||
| 26 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef __ASM_ARM_REGS_SERIAL_H | ||
| 30 | #define __ASM_ARM_REGS_SERIAL_H | ||
| 31 | |||
| 32 | #define S3C2410_URXH (0x24) | ||
| 33 | #define S3C2410_UTXH (0x20) | ||
| 34 | #define S3C2410_ULCON (0x00) | ||
| 35 | #define S3C2410_UCON (0x04) | ||
| 36 | #define S3C2410_UFCON (0x08) | ||
| 37 | #define S3C2410_UMCON (0x0C) | ||
| 38 | #define S3C2410_UBRDIV (0x28) | ||
| 39 | #define S3C2410_UTRSTAT (0x10) | ||
| 40 | #define S3C2410_UERSTAT (0x14) | ||
| 41 | #define S3C2410_UFSTAT (0x18) | ||
| 42 | #define S3C2410_UMSTAT (0x1C) | ||
| 43 | |||
| 44 | #define S3C2410_LCON_CFGMASK ((0xF<<3)|(0x3)) | ||
| 45 | |||
| 46 | #define S3C2410_LCON_CS5 (0x0) | ||
| 47 | #define S3C2410_LCON_CS6 (0x1) | ||
| 48 | #define S3C2410_LCON_CS7 (0x2) | ||
| 49 | #define S3C2410_LCON_CS8 (0x3) | ||
| 50 | #define S3C2410_LCON_CSMASK (0x3) | ||
| 51 | |||
| 52 | #define S3C2410_LCON_PNONE (0x0) | ||
| 53 | #define S3C2410_LCON_PEVEN (0x5 << 3) | ||
| 54 | #define S3C2410_LCON_PODD (0x4 << 3) | ||
| 55 | #define S3C2410_LCON_PMASK (0x7 << 3) | ||
| 56 | |||
| 57 | #define S3C2410_LCON_STOPB (1<<2) | ||
| 58 | #define S3C2410_LCON_IRM (1<<6) | ||
| 59 | |||
| 60 | #define S3C2440_UCON_CLKMASK (3<<10) | ||
| 61 | #define S3C2440_UCON_CLKSHIFT (10) | ||
| 62 | #define S3C2440_UCON_PCLK (0<<10) | ||
| 63 | #define S3C2440_UCON_UCLK (1<<10) | ||
| 64 | #define S3C2440_UCON_PCLK2 (2<<10) | ||
| 65 | #define S3C2440_UCON_FCLK (3<<10) | ||
| 66 | #define S3C2443_UCON_EPLL (3<<10) | ||
| 67 | |||
| 68 | #define S3C6400_UCON_CLKMASK (3<<10) | ||
| 69 | #define S3C6400_UCON_CLKSHIFT (10) | ||
| 70 | #define S3C6400_UCON_PCLK (0<<10) | ||
| 71 | #define S3C6400_UCON_PCLK2 (2<<10) | ||
| 72 | #define S3C6400_UCON_UCLK0 (1<<10) | ||
| 73 | #define S3C6400_UCON_UCLK1 (3<<10) | ||
| 74 | |||
| 75 | #define S3C2440_UCON2_FCLK_EN (1<<15) | ||
| 76 | #define S3C2440_UCON0_DIVMASK (15 << 12) | ||
| 77 | #define S3C2440_UCON1_DIVMASK (15 << 12) | ||
| 78 | #define S3C2440_UCON2_DIVMASK (7 << 12) | ||
| 79 | #define S3C2440_UCON_DIVSHIFT (12) | ||
| 80 | |||
| 81 | #define S3C2412_UCON_CLKMASK (3<<10) | ||
| 82 | #define S3C2412_UCON_CLKSHIFT (10) | ||
| 83 | #define S3C2412_UCON_UCLK (1<<10) | ||
| 84 | #define S3C2412_UCON_USYSCLK (3<<10) | ||
| 85 | #define S3C2412_UCON_PCLK (0<<10) | ||
| 86 | #define S3C2412_UCON_PCLK2 (2<<10) | ||
| 87 | |||
| 88 | #define S3C2410_UCON_CLKMASK (1 << 10) | ||
| 89 | #define S3C2410_UCON_CLKSHIFT (10) | ||
| 90 | #define S3C2410_UCON_UCLK (1<<10) | ||
| 91 | #define S3C2410_UCON_SBREAK (1<<4) | ||
| 92 | |||
| 93 | #define S3C2410_UCON_TXILEVEL (1<<9) | ||
| 94 | #define S3C2410_UCON_RXILEVEL (1<<8) | ||
| 95 | #define S3C2410_UCON_TXIRQMODE (1<<2) | ||
| 96 | #define S3C2410_UCON_RXIRQMODE (1<<0) | ||
| 97 | #define S3C2410_UCON_RXFIFO_TOI (1<<7) | ||
| 98 | #define S3C2443_UCON_RXERR_IRQEN (1<<6) | ||
| 99 | #define S3C2443_UCON_LOOPBACK (1<<5) | ||
| 100 | |||
| 101 | #define S3C2410_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | ||
| 102 | S3C2410_UCON_RXILEVEL | \ | ||
| 103 | S3C2410_UCON_TXIRQMODE | \ | ||
| 104 | S3C2410_UCON_RXIRQMODE | \ | ||
| 105 | S3C2410_UCON_RXFIFO_TOI) | ||
| 106 | |||
| 107 | #define S3C2410_UFCON_FIFOMODE (1<<0) | ||
| 108 | #define S3C2410_UFCON_TXTRIG0 (0<<6) | ||
| 109 | #define S3C2410_UFCON_RXTRIG8 (1<<4) | ||
| 110 | #define S3C2410_UFCON_RXTRIG12 (2<<4) | ||
| 111 | |||
| 112 | /* S3C2440 FIFO trigger levels */ | ||
| 113 | #define S3C2440_UFCON_RXTRIG1 (0<<4) | ||
| 114 | #define S3C2440_UFCON_RXTRIG8 (1<<4) | ||
| 115 | #define S3C2440_UFCON_RXTRIG16 (2<<4) | ||
| 116 | #define S3C2440_UFCON_RXTRIG32 (3<<4) | ||
| 117 | |||
| 118 | #define S3C2440_UFCON_TXTRIG0 (0<<6) | ||
| 119 | #define S3C2440_UFCON_TXTRIG16 (1<<6) | ||
| 120 | #define S3C2440_UFCON_TXTRIG32 (2<<6) | ||
| 121 | #define S3C2440_UFCON_TXTRIG48 (3<<6) | ||
| 122 | |||
| 123 | #define S3C2410_UFCON_RESETBOTH (3<<1) | ||
| 124 | #define S3C2410_UFCON_RESETTX (1<<2) | ||
| 125 | #define S3C2410_UFCON_RESETRX (1<<1) | ||
| 126 | |||
| 127 | #define S3C2410_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ | ||
| 128 | S3C2410_UFCON_TXTRIG0 | \ | ||
| 129 | S3C2410_UFCON_RXTRIG8 ) | ||
| 130 | |||
| 131 | #define S3C2410_UMCOM_AFC (1<<4) | ||
| 132 | #define S3C2410_UMCOM_RTS_LOW (1<<0) | ||
| 133 | |||
| 134 | #define S3C2412_UMCON_AFC_63 (0<<5) /* same as s3c2443 */ | ||
| 135 | #define S3C2412_UMCON_AFC_56 (1<<5) | ||
| 136 | #define S3C2412_UMCON_AFC_48 (2<<5) | ||
| 137 | #define S3C2412_UMCON_AFC_40 (3<<5) | ||
| 138 | #define S3C2412_UMCON_AFC_32 (4<<5) | ||
| 139 | #define S3C2412_UMCON_AFC_24 (5<<5) | ||
| 140 | #define S3C2412_UMCON_AFC_16 (6<<5) | ||
| 141 | #define S3C2412_UMCON_AFC_8 (7<<5) | ||
| 142 | |||
| 143 | #define S3C2410_UFSTAT_TXFULL (1<<9) | ||
| 144 | #define S3C2410_UFSTAT_RXFULL (1<<8) | ||
| 145 | #define S3C2410_UFSTAT_TXMASK (15<<4) | ||
| 146 | #define S3C2410_UFSTAT_TXSHIFT (4) | ||
| 147 | #define S3C2410_UFSTAT_RXMASK (15<<0) | ||
| 148 | #define S3C2410_UFSTAT_RXSHIFT (0) | ||
| 149 | |||
| 150 | /* UFSTAT S3C2443 same as S3C2440 */ | ||
| 151 | #define S3C2440_UFSTAT_TXFULL (1<<14) | ||
| 152 | #define S3C2440_UFSTAT_RXFULL (1<<6) | ||
| 153 | #define S3C2440_UFSTAT_TXSHIFT (8) | ||
| 154 | #define S3C2440_UFSTAT_RXSHIFT (0) | ||
| 155 | #define S3C2440_UFSTAT_TXMASK (63<<8) | ||
| 156 | #define S3C2440_UFSTAT_RXMASK (63) | ||
| 157 | |||
| 158 | #define S3C2410_UTRSTAT_TXE (1<<2) | ||
| 159 | #define S3C2410_UTRSTAT_TXFE (1<<1) | ||
| 160 | #define S3C2410_UTRSTAT_RXDR (1<<0) | ||
| 161 | |||
| 162 | #define S3C2410_UERSTAT_OVERRUN (1<<0) | ||
| 163 | #define S3C2410_UERSTAT_FRAME (1<<2) | ||
| 164 | #define S3C2410_UERSTAT_BREAK (1<<3) | ||
| 165 | #define S3C2443_UERSTAT_PARITY (1<<1) | ||
| 166 | |||
| 167 | #define S3C2410_UERSTAT_ANY (S3C2410_UERSTAT_OVERRUN | \ | ||
| 168 | S3C2410_UERSTAT_FRAME | \ | ||
| 169 | S3C2410_UERSTAT_BREAK) | ||
| 170 | |||
| 171 | #define S3C2410_UMSTAT_CTS (1<<0) | ||
| 172 | #define S3C2410_UMSTAT_DeltaCTS (1<<2) | ||
| 173 | |||
| 174 | #define S3C2443_DIVSLOT (0x2C) | ||
| 175 | |||
| 176 | /* S3C64XX interrupt registers. */ | ||
| 177 | #define S3C64XX_UINTP 0x30 | ||
| 178 | #define S3C64XX_UINTSP 0x34 | ||
| 179 | #define S3C64XX_UINTM 0x38 | ||
| 180 | |||
| 181 | #define S3C64XX_UINTM_RXD (0) | ||
| 182 | #define S3C64XX_UINTM_TXD (2) | ||
| 183 | #define S3C64XX_UINTM_RXD_MSK (1 << S3C64XX_UINTM_RXD) | ||
| 184 | #define S3C64XX_UINTM_TXD_MSK (1 << S3C64XX_UINTM_TXD) | ||
| 185 | |||
| 186 | /* Following are specific to S5PV210 */ | ||
| 187 | #define S5PV210_UCON_CLKMASK (1<<10) | ||
| 188 | #define S5PV210_UCON_CLKSHIFT (10) | ||
| 189 | #define S5PV210_UCON_PCLK (0<<10) | ||
| 190 | #define S5PV210_UCON_UCLK (1<<10) | ||
| 191 | |||
| 192 | #define S5PV210_UFCON_TXTRIG0 (0<<8) | ||
| 193 | #define S5PV210_UFCON_TXTRIG4 (1<<8) | ||
| 194 | #define S5PV210_UFCON_TXTRIG8 (2<<8) | ||
| 195 | #define S5PV210_UFCON_TXTRIG16 (3<<8) | ||
| 196 | #define S5PV210_UFCON_TXTRIG32 (4<<8) | ||
| 197 | #define S5PV210_UFCON_TXTRIG64 (5<<8) | ||
| 198 | #define S5PV210_UFCON_TXTRIG128 (6<<8) | ||
| 199 | #define S5PV210_UFCON_TXTRIG256 (7<<8) | ||
| 200 | |||
| 201 | #define S5PV210_UFCON_RXTRIG1 (0<<4) | ||
| 202 | #define S5PV210_UFCON_RXTRIG4 (1<<4) | ||
| 203 | #define S5PV210_UFCON_RXTRIG8 (2<<4) | ||
| 204 | #define S5PV210_UFCON_RXTRIG16 (3<<4) | ||
| 205 | #define S5PV210_UFCON_RXTRIG32 (4<<4) | ||
| 206 | #define S5PV210_UFCON_RXTRIG64 (5<<4) | ||
| 207 | #define S5PV210_UFCON_RXTRIG128 (6<<4) | ||
| 208 | #define S5PV210_UFCON_RXTRIG256 (7<<4) | ||
| 209 | |||
| 210 | #define S5PV210_UFSTAT_TXFULL (1<<24) | ||
| 211 | #define S5PV210_UFSTAT_RXFULL (1<<8) | ||
| 212 | #define S5PV210_UFSTAT_TXMASK (255<<16) | ||
| 213 | #define S5PV210_UFSTAT_TXSHIFT (16) | ||
| 214 | #define S5PV210_UFSTAT_RXMASK (255<<0) | ||
| 215 | #define S5PV210_UFSTAT_RXSHIFT (0) | ||
| 216 | |||
| 217 | #define S3C2410_UCON_CLKSEL0 (1 << 0) | ||
| 218 | #define S3C2410_UCON_CLKSEL1 (1 << 1) | ||
| 219 | #define S3C2410_UCON_CLKSEL2 (1 << 2) | ||
| 220 | #define S3C2410_UCON_CLKSEL3 (1 << 3) | ||
| 221 | |||
| 222 | /* Default values for s5pv210 UCON and UFCON uart registers */ | ||
| 223 | #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ | ||
| 224 | S3C2410_UCON_RXILEVEL | \ | ||
| 225 | S3C2410_UCON_TXIRQMODE | \ | ||
| 226 | S3C2410_UCON_RXIRQMODE | \ | ||
| 227 | S3C2410_UCON_RXFIFO_TOI | \ | ||
| 228 | S3C2443_UCON_RXERR_IRQEN) | ||
| 229 | |||
| 230 | #define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ | ||
| 231 | S5PV210_UFCON_TXTRIG4 | \ | ||
| 232 | S5PV210_UFCON_RXTRIG4) | ||
| 233 | |||
| 234 | #ifndef __ASSEMBLY__ | ||
| 235 | |||
| 236 | /* configuration structure for per-machine configurations for the | ||
| 237 | * serial port | ||
| 238 | * | ||
| 239 | * the pointer is setup by the machine specific initialisation from the | ||
| 240 | * arch/arm/mach-s3c2410/ directory. | ||
| 241 | */ | ||
| 242 | |||
| 243 | struct s3c2410_uartcfg { | ||
| 244 | unsigned char hwport; /* hardware port number */ | ||
| 245 | unsigned char unused; | ||
| 246 | unsigned short flags; | ||
| 247 | upf_t uart_flags; /* default uart flags */ | ||
| 248 | unsigned int clk_sel; | ||
| 249 | |||
| 250 | unsigned int has_fracval; | ||
| 251 | |||
| 252 | unsigned long ucon; /* value of ucon for port */ | ||
| 253 | unsigned long ulcon; /* value of ulcon for port */ | ||
| 254 | unsigned long ufcon; /* value of ufcon for port */ | ||
| 255 | }; | ||
| 256 | |||
| 257 | #endif /* __ASSEMBLY__ */ | ||
| 258 | |||
| 259 | #endif /* __ASM_ARM_REGS_SERIAL_H */ | ||
| 260 | |||
diff --git a/include/linux/spi/spi-tegra.h b/include/linux/spi/spi-tegra.h deleted file mode 100644 index 786932c62edb..000000000000 --- a/include/linux/spi/spi-tegra.h +++ /dev/null | |||
| @@ -1,40 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * spi-tegra.h: SPI interface for Nvidia Tegra20 SLINK controller. | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011 NVIDIA Corporation | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 14 | * more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License along | ||
| 17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef _LINUX_SPI_TEGRA_H | ||
| 22 | #define _LINUX_SPI_TEGRA_H | ||
| 23 | |||
| 24 | struct tegra_spi_platform_data { | ||
| 25 | int dma_req_sel; | ||
| 26 | unsigned int spi_max_frequency; | ||
| 27 | }; | ||
| 28 | |||
| 29 | /* | ||
| 30 | * Controller data from device to pass some info like | ||
| 31 | * hw based chip select can be used or not and if yes | ||
| 32 | * then CS hold and setup time. | ||
| 33 | */ | ||
| 34 | struct tegra_spi_device_controller_data { | ||
| 35 | bool is_hw_based_cs; | ||
| 36 | int cs_setup_clk_count; | ||
| 37 | int cs_hold_clk_count; | ||
| 38 | }; | ||
| 39 | |||
| 40 | #endif /* _LINUX_SPI_TEGRA_H */ | ||
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 38c2b925923d..733eb5ee31c5 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
| @@ -228,6 +228,11 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
| 228 | * every chipselect is connected to a slave. | 228 | * every chipselect is connected to a slave. |
| 229 | * @dma_alignment: SPI controller constraint on DMA buffers alignment. | 229 | * @dma_alignment: SPI controller constraint on DMA buffers alignment. |
| 230 | * @mode_bits: flags understood by this controller driver | 230 | * @mode_bits: flags understood by this controller driver |
| 231 | * @bits_per_word_mask: A mask indicating which values of bits_per_word are | ||
| 232 | * supported by the driver. Bit n indicates that a bits_per_word n+1 is | ||
| 233 | * suported. If set, the SPI core will reject any transfer with an | ||
| 234 | * unsupported bits_per_word. If not set, this value is simply ignored, | ||
| 235 | * and it's up to the individual driver to perform any validation. | ||
| 231 | * @flags: other constraints relevant to this driver | 236 | * @flags: other constraints relevant to this driver |
| 232 | * @bus_lock_spinlock: spinlock for SPI bus locking | 237 | * @bus_lock_spinlock: spinlock for SPI bus locking |
| 233 | * @bus_lock_mutex: mutex for SPI bus locking | 238 | * @bus_lock_mutex: mutex for SPI bus locking |
| @@ -301,6 +306,9 @@ struct spi_master { | |||
| 301 | /* spi_device.mode flags understood by this controller driver */ | 306 | /* spi_device.mode flags understood by this controller driver */ |
| 302 | u16 mode_bits; | 307 | u16 mode_bits; |
| 303 | 308 | ||
| 309 | /* bitmask of supported bits_per_word for transfers */ | ||
| 310 | u32 bits_per_word_mask; | ||
| 311 | |||
| 304 | /* other constraints relevant to this driver */ | 312 | /* other constraints relevant to this driver */ |
| 305 | u16 flags; | 313 | u16 flags; |
| 306 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ | 314 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ |
diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h index a26e2fb604e6..e2369c167dbd 100644 --- a/include/linux/spinlock_up.h +++ b/include/linux/spinlock_up.h | |||
| @@ -16,7 +16,10 @@ | |||
| 16 | * In the debug case, 1 means unlocked, 0 means locked. (the values | 16 | * In the debug case, 1 means unlocked, 0 means locked. (the values |
| 17 | * are inverted, to catch initialization bugs) | 17 | * are inverted, to catch initialization bugs) |
| 18 | * | 18 | * |
| 19 | * No atomicity anywhere, we are on UP. | 19 | * No atomicity anywhere, we are on UP. However, we still need |
| 20 | * the compiler barriers, because we do not want the compiler to | ||
| 21 | * move potentially faulting instructions (notably user accesses) | ||
| 22 | * into the locked sequence, resulting in non-atomic execution. | ||
| 20 | */ | 23 | */ |
| 21 | 24 | ||
| 22 | #ifdef CONFIG_DEBUG_SPINLOCK | 25 | #ifdef CONFIG_DEBUG_SPINLOCK |
| @@ -25,6 +28,7 @@ | |||
| 25 | static inline void arch_spin_lock(arch_spinlock_t *lock) | 28 | static inline void arch_spin_lock(arch_spinlock_t *lock) |
| 26 | { | 29 | { |
| 27 | lock->slock = 0; | 30 | lock->slock = 0; |
| 31 | barrier(); | ||
| 28 | } | 32 | } |
| 29 | 33 | ||
| 30 | static inline void | 34 | static inline void |
| @@ -32,6 +36,7 @@ arch_spin_lock_flags(arch_spinlock_t *lock, unsigned long flags) | |||
| 32 | { | 36 | { |
| 33 | local_irq_save(flags); | 37 | local_irq_save(flags); |
| 34 | lock->slock = 0; | 38 | lock->slock = 0; |
| 39 | barrier(); | ||
| 35 | } | 40 | } |
| 36 | 41 | ||
| 37 | static inline int arch_spin_trylock(arch_spinlock_t *lock) | 42 | static inline int arch_spin_trylock(arch_spinlock_t *lock) |
| @@ -39,32 +44,34 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock) | |||
| 39 | char oldval = lock->slock; | 44 | char oldval = lock->slock; |
| 40 | 45 | ||
| 41 | lock->slock = 0; | 46 | lock->slock = 0; |
| 47 | barrier(); | ||
| 42 | 48 | ||
| 43 | return oldval > 0; | 49 | return oldval > 0; |
| 44 | } | 50 | } |
| 45 | 51 | ||
| 46 | static inline void arch_spin_unlock(arch_spinlock_t *lock) | 52 | static inline void arch_spin_unlock(arch_spinlock_t *lock) |
| 47 | { | 53 | { |
| 54 | barrier(); | ||
| 48 | lock->slock = 1; | 55 | lock->slock = 1; |
| 49 | } | 56 | } |
| 50 | 57 | ||
| 51 | /* | 58 | /* |
| 52 | * Read-write spinlocks. No debug version. | 59 | * Read-write spinlocks. No debug version. |
| 53 | */ | 60 | */ |
| 54 | #define arch_read_lock(lock) do { (void)(lock); } while (0) | 61 | #define arch_read_lock(lock) do { barrier(); (void)(lock); } while (0) |
| 55 | #define arch_write_lock(lock) do { (void)(lock); } while (0) | 62 | #define arch_write_lock(lock) do { barrier(); (void)(lock); } while (0) |
| 56 | #define arch_read_trylock(lock) ({ (void)(lock); 1; }) | 63 | #define arch_read_trylock(lock) ({ barrier(); (void)(lock); 1; }) |
| 57 | #define arch_write_trylock(lock) ({ (void)(lock); 1; }) | 64 | #define arch_write_trylock(lock) ({ barrier(); (void)(lock); 1; }) |
| 58 | #define arch_read_unlock(lock) do { (void)(lock); } while (0) | 65 | #define arch_read_unlock(lock) do { barrier(); (void)(lock); } while (0) |
| 59 | #define arch_write_unlock(lock) do { (void)(lock); } while (0) | 66 | #define arch_write_unlock(lock) do { barrier(); (void)(lock); } while (0) |
| 60 | 67 | ||
| 61 | #else /* DEBUG_SPINLOCK */ | 68 | #else /* DEBUG_SPINLOCK */ |
| 62 | #define arch_spin_is_locked(lock) ((void)(lock), 0) | 69 | #define arch_spin_is_locked(lock) ((void)(lock), 0) |
| 63 | /* for sched.c and kernel_lock.c: */ | 70 | /* for sched.c and kernel_lock.c: */ |
| 64 | # define arch_spin_lock(lock) do { (void)(lock); } while (0) | 71 | # define arch_spin_lock(lock) do { barrier(); (void)(lock); } while (0) |
| 65 | # define arch_spin_lock_flags(lock, flags) do { (void)(lock); } while (0) | 72 | # define arch_spin_lock_flags(lock, flags) do { barrier(); (void)(lock); } while (0) |
| 66 | # define arch_spin_unlock(lock) do { (void)(lock); } while (0) | 73 | # define arch_spin_unlock(lock) do { barrier(); (void)(lock); } while (0) |
| 67 | # define arch_spin_trylock(lock) ({ (void)(lock); 1; }) | 74 | # define arch_spin_trylock(lock) ({ barrier(); (void)(lock); 1; }) |
| 68 | #endif /* DEBUG_SPINLOCK */ | 75 | #endif /* DEBUG_SPINLOCK */ |
| 69 | 76 | ||
| 70 | #define arch_spin_is_contended(lock) (((void)(lock), 0)) | 77 | #define arch_spin_is_contended(lock) (((void)(lock), 0)) |
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h index 9e492be5244b..6fcfe99bd999 100644 --- a/include/linux/ssb/ssb_driver_chipcommon.h +++ b/include/linux/ssb/ssb_driver_chipcommon.h | |||
| @@ -219,6 +219,7 @@ | |||
| 219 | #define SSB_CHIPCO_PMU_CTL 0x0600 /* PMU control */ | 219 | #define SSB_CHIPCO_PMU_CTL 0x0600 /* PMU control */ |
| 220 | #define SSB_CHIPCO_PMU_CTL_ILP_DIV 0xFFFF0000 /* ILP div mask */ | 220 | #define SSB_CHIPCO_PMU_CTL_ILP_DIV 0xFFFF0000 /* ILP div mask */ |
| 221 | #define SSB_CHIPCO_PMU_CTL_ILP_DIV_SHIFT 16 | 221 | #define SSB_CHIPCO_PMU_CTL_ILP_DIV_SHIFT 16 |
| 222 | #define SSB_CHIPCO_PMU_CTL_PLL_UPD 0x00000400 | ||
| 222 | #define SSB_CHIPCO_PMU_CTL_NOILPONW 0x00000200 /* No ILP on wait */ | 223 | #define SSB_CHIPCO_PMU_CTL_NOILPONW 0x00000200 /* No ILP on wait */ |
| 223 | #define SSB_CHIPCO_PMU_CTL_HTREQEN 0x00000100 /* HT req enable */ | 224 | #define SSB_CHIPCO_PMU_CTL_HTREQEN 0x00000100 /* HT req enable */ |
| 224 | #define SSB_CHIPCO_PMU_CTL_ALPREQEN 0x00000080 /* ALP req enable */ | 225 | #define SSB_CHIPCO_PMU_CTL_ALPREQEN 0x00000080 /* ALP req enable */ |
| @@ -667,5 +668,6 @@ enum ssb_pmu_ldo_volt_id { | |||
| 667 | void ssb_pmu_set_ldo_voltage(struct ssb_chipcommon *cc, | 668 | void ssb_pmu_set_ldo_voltage(struct ssb_chipcommon *cc, |
| 668 | enum ssb_pmu_ldo_volt_id id, u32 voltage); | 669 | enum ssb_pmu_ldo_volt_id id, u32 voltage); |
| 669 | void ssb_pmu_set_ldo_paref(struct ssb_chipcommon *cc, bool on); | 670 | void ssb_pmu_set_ldo_paref(struct ssb_chipcommon *cc, bool on); |
| 671 | void ssb_pmu_spuravoid_pllupdate(struct ssb_chipcommon *cc, int spuravoid); | ||
| 670 | 672 | ||
| 671 | #endif /* LINUX_SSB_CHIPCO_H_ */ | 673 | #endif /* LINUX_SSB_CHIPCO_H_ */ |
diff --git a/include/linux/ssbi.h b/include/linux/ssbi.h new file mode 100644 index 000000000000..44ef5da21470 --- /dev/null +++ b/include/linux/ssbi.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | /* Copyright (C) 2010 Google, Inc. | ||
| 2 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
| 3 | * Author: Dima Zavin <dima@android.com> | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 and | ||
| 7 | * only version 2 as published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _LINUX_SSBI_H | ||
| 16 | #define _LINUX_SSBI_H | ||
| 17 | |||
| 18 | #include <linux/types.h> | ||
| 19 | |||
| 20 | struct ssbi_slave_info { | ||
| 21 | const char *name; | ||
| 22 | void *platform_data; | ||
| 23 | }; | ||
| 24 | |||
| 25 | enum ssbi_controller_type { | ||
| 26 | MSM_SBI_CTRL_SSBI = 0, | ||
| 27 | MSM_SBI_CTRL_SSBI2, | ||
| 28 | MSM_SBI_CTRL_PMIC_ARBITER, | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct ssbi_platform_data { | ||
| 32 | struct ssbi_slave_info slave; | ||
| 33 | enum ssbi_controller_type controller_type; | ||
| 34 | }; | ||
| 35 | |||
| 36 | int ssbi_write(struct device *dev, u16 addr, u8 *buf, int len); | ||
| 37 | int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len); | ||
| 38 | #endif | ||
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 58fda1c3c783..0dd00f4f6810 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | /* size of the nodename buffer */ | 22 | /* size of the nodename buffer */ |
| 23 | #define UNX_MAXNODENAME 32 | 23 | #define UNX_MAXNODENAME 32 |
| 24 | 24 | ||
| 25 | struct rpcsec_gss_info; | ||
| 26 | |||
| 25 | /* Work around the lack of a VFS credential */ | 27 | /* Work around the lack of a VFS credential */ |
| 26 | struct auth_cred { | 28 | struct auth_cred { |
| 27 | kuid_t uid; | 29 | kuid_t uid; |
| @@ -103,6 +105,9 @@ struct rpc_authops { | |||
| 103 | int (*pipes_create)(struct rpc_auth *); | 105 | int (*pipes_create)(struct rpc_auth *); |
| 104 | void (*pipes_destroy)(struct rpc_auth *); | 106 | void (*pipes_destroy)(struct rpc_auth *); |
| 105 | int (*list_pseudoflavors)(rpc_authflavor_t *, int); | 107 | int (*list_pseudoflavors)(rpc_authflavor_t *, int); |
| 108 | rpc_authflavor_t (*info2flavor)(struct rpcsec_gss_info *); | ||
| 109 | int (*flavor2info)(rpc_authflavor_t, | ||
| 110 | struct rpcsec_gss_info *); | ||
| 106 | }; | 111 | }; |
| 107 | 112 | ||
| 108 | struct rpc_credops { | 113 | struct rpc_credops { |
| @@ -137,6 +142,10 @@ int rpcauth_register(const struct rpc_authops *); | |||
| 137 | int rpcauth_unregister(const struct rpc_authops *); | 142 | int rpcauth_unregister(const struct rpc_authops *); |
| 138 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); | 143 | struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); |
| 139 | void rpcauth_release(struct rpc_auth *); | 144 | void rpcauth_release(struct rpc_auth *); |
| 145 | rpc_authflavor_t rpcauth_get_pseudoflavor(rpc_authflavor_t, | ||
| 146 | struct rpcsec_gss_info *); | ||
| 147 | int rpcauth_get_gssinfo(rpc_authflavor_t, | ||
| 148 | struct rpcsec_gss_info *); | ||
| 140 | int rpcauth_list_flavors(rpc_authflavor_t *, int); | 149 | int rpcauth_list_flavors(rpc_authflavor_t *, int); |
| 141 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); | 150 | struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); |
| 142 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); | 151 | void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 2cf4ffaa3cd4..e7d492ce7c18 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -124,6 +124,7 @@ struct rpc_create_args { | |||
| 124 | #define RPC_CLNT_CREATE_NOPING (1UL << 4) | 124 | #define RPC_CLNT_CREATE_NOPING (1UL << 4) |
| 125 | #define RPC_CLNT_CREATE_DISCRTRY (1UL << 5) | 125 | #define RPC_CLNT_CREATE_DISCRTRY (1UL << 5) |
| 126 | #define RPC_CLNT_CREATE_QUIET (1UL << 6) | 126 | #define RPC_CLNT_CREATE_QUIET (1UL << 6) |
| 127 | #define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7) | ||
| 127 | 128 | ||
| 128 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); | 129 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); |
| 129 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | 130 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index a19e2547ae6a..f32b7a47e13f 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
| @@ -25,10 +25,21 @@ struct gss_ctx { | |||
| 25 | 25 | ||
| 26 | #define GSS_C_NO_BUFFER ((struct xdr_netobj) 0) | 26 | #define GSS_C_NO_BUFFER ((struct xdr_netobj) 0) |
| 27 | #define GSS_C_NO_CONTEXT ((struct gss_ctx *) 0) | 27 | #define GSS_C_NO_CONTEXT ((struct gss_ctx *) 0) |
| 28 | #define GSS_C_NULL_OID ((struct xdr_netobj) 0) | 28 | #define GSS_C_QOP_DEFAULT (0) |
| 29 | 29 | ||
| 30 | /*XXX arbitrary length - is this set somewhere? */ | 30 | /*XXX arbitrary length - is this set somewhere? */ |
| 31 | #define GSS_OID_MAX_LEN 32 | 31 | #define GSS_OID_MAX_LEN 32 |
| 32 | struct rpcsec_gss_oid { | ||
| 33 | unsigned int len; | ||
| 34 | u8 data[GSS_OID_MAX_LEN]; | ||
| 35 | }; | ||
| 36 | |||
| 37 | /* From RFC 3530 */ | ||
| 38 | struct rpcsec_gss_info { | ||
| 39 | struct rpcsec_gss_oid oid; | ||
| 40 | u32 qop; | ||
| 41 | u32 service; | ||
| 42 | }; | ||
| 32 | 43 | ||
| 33 | /* gss-api prototypes; note that these are somewhat simplified versions of | 44 | /* gss-api prototypes; note that these are somewhat simplified versions of |
| 34 | * the prototypes specified in RFC 2744. */ | 45 | * the prototypes specified in RFC 2744. */ |
| @@ -58,12 +69,14 @@ u32 gss_unwrap( | |||
| 58 | u32 gss_delete_sec_context( | 69 | u32 gss_delete_sec_context( |
| 59 | struct gss_ctx **ctx_id); | 70 | struct gss_ctx **ctx_id); |
| 60 | 71 | ||
| 61 | u32 gss_svc_to_pseudoflavor(struct gss_api_mech *, u32 service); | 72 | rpc_authflavor_t gss_svc_to_pseudoflavor(struct gss_api_mech *, u32 qop, |
| 73 | u32 service); | ||
| 62 | u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); | 74 | u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); |
| 63 | char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); | 75 | char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); |
| 64 | 76 | ||
| 65 | struct pf_desc { | 77 | struct pf_desc { |
| 66 | u32 pseudoflavor; | 78 | u32 pseudoflavor; |
| 79 | u32 qop; | ||
| 67 | u32 service; | 80 | u32 service; |
| 68 | char *name; | 81 | char *name; |
| 69 | char *auth_domain_name; | 82 | char *auth_domain_name; |
| @@ -76,7 +89,7 @@ struct pf_desc { | |||
| 76 | struct gss_api_mech { | 89 | struct gss_api_mech { |
| 77 | struct list_head gm_list; | 90 | struct list_head gm_list; |
| 78 | struct module *gm_owner; | 91 | struct module *gm_owner; |
| 79 | struct xdr_netobj gm_oid; | 92 | struct rpcsec_gss_oid gm_oid; |
| 80 | char *gm_name; | 93 | char *gm_name; |
| 81 | const struct gss_api_ops *gm_ops; | 94 | const struct gss_api_ops *gm_ops; |
| 82 | /* pseudoflavors supported by this mechanism: */ | 95 | /* pseudoflavors supported by this mechanism: */ |
| @@ -117,9 +130,11 @@ struct gss_api_ops { | |||
| 117 | int gss_mech_register(struct gss_api_mech *); | 130 | int gss_mech_register(struct gss_api_mech *); |
| 118 | void gss_mech_unregister(struct gss_api_mech *); | 131 | void gss_mech_unregister(struct gss_api_mech *); |
| 119 | 132 | ||
| 120 | /* returns a mechanism descriptor given an OID, and increments the mechanism's | 133 | /* Given a GSS security tuple, look up a pseudoflavor */ |
| 121 | * reference count. */ | 134 | rpc_authflavor_t gss_mech_info2flavor(struct rpcsec_gss_info *); |
| 122 | struct gss_api_mech * gss_mech_get_by_OID(struct xdr_netobj *); | 135 | |
| 136 | /* Given a pseudoflavor, look up a GSS security tuple */ | ||
| 137 | int gss_mech_flavor2info(rpc_authflavor_t, struct rpcsec_gss_info *); | ||
| 123 | 138 | ||
| 124 | /* Returns a reference to a mechanism, given a name like "krb5" etc. */ | 139 | /* Returns a reference to a mechanism, given a name like "krb5" etc. */ |
| 125 | struct gss_api_mech *gss_mech_get_by_name(const char *); | 140 | struct gss_api_mech *gss_mech_get_by_name(const char *); |
| @@ -130,9 +145,6 @@ struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32); | |||
| 130 | /* Fill in an array with a list of supported pseudoflavors */ | 145 | /* Fill in an array with a list of supported pseudoflavors */ |
| 131 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *, int); | 146 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *, int); |
| 132 | 147 | ||
| 133 | /* Just increments the mechanism's reference count and returns its input: */ | ||
| 134 | struct gss_api_mech * gss_mech_get(struct gss_api_mech *); | ||
| 135 | |||
| 136 | /* For every successful gss_mech_get or gss_mech_get_by_* call there must be a | 148 | /* For every successful gss_mech_get or gss_mech_get_by_* call there must be a |
| 137 | * corresponding call to gss_mech_put. */ | 149 | * corresponding call to gss_mech_put. */ |
| 138 | void gss_mech_put(struct gss_api_mech *); | 150 | void gss_mech_put(struct gss_api_mech *); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 30834be03011..ff5392421cb2 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -255,6 +255,8 @@ static inline int bc_prealloc(struct rpc_rqst *req) | |||
| 255 | } | 255 | } |
| 256 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ | 256 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
| 257 | 257 | ||
| 258 | #define XPRT_CREATE_INFINITE_SLOTS (1U) | ||
| 259 | |||
| 258 | struct xprt_create { | 260 | struct xprt_create { |
| 259 | int ident; /* XPRT_TRANSPORT identifier */ | 261 | int ident; /* XPRT_TRANSPORT identifier */ |
| 260 | struct net * net; | 262 | struct net * net; |
| @@ -263,6 +265,7 @@ struct xprt_create { | |||
| 263 | size_t addrlen; | 265 | size_t addrlen; |
| 264 | const char *servername; | 266 | const char *servername; |
| 265 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ | 267 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ |
| 268 | unsigned int flags; | ||
| 266 | }; | 269 | }; |
| 267 | 270 | ||
| 268 | struct xprt_class { | 271 | struct xprt_class { |
| @@ -279,6 +282,7 @@ struct xprt_class { | |||
| 279 | struct rpc_xprt *xprt_create_transport(struct xprt_create *args); | 282 | struct rpc_xprt *xprt_create_transport(struct xprt_create *args); |
| 280 | void xprt_connect(struct rpc_task *task); | 283 | void xprt_connect(struct rpc_task *task); |
| 281 | void xprt_reserve(struct rpc_task *task); | 284 | void xprt_reserve(struct rpc_task *task); |
| 285 | void xprt_retry_reserve(struct rpc_task *task); | ||
| 282 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); | 286 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); |
| 283 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); | 287 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); |
| 284 | void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); | 288 | void xprt_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task); |
| @@ -334,6 +338,7 @@ int xs_swapper(struct rpc_xprt *xprt, int enable); | |||
| 334 | #define XPRT_CLOSING (6) | 338 | #define XPRT_CLOSING (6) |
| 335 | #define XPRT_CONNECTION_ABORT (7) | 339 | #define XPRT_CONNECTION_ABORT (7) |
| 336 | #define XPRT_CONNECTION_CLOSE (8) | 340 | #define XPRT_CONNECTION_CLOSE (8) |
| 341 | #define XPRT_CONGESTED (9) | ||
| 337 | 342 | ||
| 338 | static inline void xprt_set_connected(struct rpc_xprt *xprt) | 343 | static inline void xprt_set_connected(struct rpc_xprt *xprt) |
| 339 | { | 344 | { |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 2818a123f3ea..1701ce4be746 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -236,7 +236,7 @@ extern unsigned long nr_free_pagecache_pages(void); | |||
| 236 | extern void __lru_cache_add(struct page *, enum lru_list lru); | 236 | extern void __lru_cache_add(struct page *, enum lru_list lru); |
| 237 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); | 237 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); |
| 238 | extern void lru_add_page_tail(struct page *page, struct page *page_tail, | 238 | extern void lru_add_page_tail(struct page *page, struct page *page_tail, |
| 239 | struct lruvec *lruvec); | 239 | struct lruvec *lruvec, struct list_head *head); |
| 240 | extern void activate_page(struct page *); | 240 | extern void activate_page(struct page *); |
| 241 | extern void mark_page_accessed(struct page *); | 241 | extern void mark_page_accessed(struct page *); |
| 242 | extern void lru_add_drain(void); | 242 | extern void lru_add_drain(void); |
| @@ -330,6 +330,9 @@ static inline void mem_cgroup_uncharge_swap(swp_entry_t ent) | |||
| 330 | /* linux/mm/page_io.c */ | 330 | /* linux/mm/page_io.c */ |
| 331 | extern int swap_readpage(struct page *); | 331 | extern int swap_readpage(struct page *); |
| 332 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); | 332 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); |
| 333 | extern void end_swap_bio_write(struct bio *bio, int err); | ||
| 334 | extern int __swap_writepage(struct page *page, struct writeback_control *wbc, | ||
| 335 | void (*end_write_func)(struct bio *, int)); | ||
| 333 | extern int swap_set_page_dirty(struct page *page); | 336 | extern int swap_set_page_dirty(struct page *page); |
| 334 | extern void end_swap_bio_read(struct bio *bio, int err); | 337 | extern void end_swap_bio_read(struct bio *bio, int err); |
| 335 | 338 | ||
| @@ -343,8 +346,9 @@ extern struct address_space swapper_spaces[]; | |||
| 343 | #define swap_address_space(entry) (&swapper_spaces[swp_type(entry)]) | 346 | #define swap_address_space(entry) (&swapper_spaces[swp_type(entry)]) |
| 344 | extern unsigned long total_swapcache_pages(void); | 347 | extern unsigned long total_swapcache_pages(void); |
| 345 | extern void show_swap_cache_info(void); | 348 | extern void show_swap_cache_info(void); |
| 346 | extern int add_to_swap(struct page *); | 349 | extern int add_to_swap(struct page *, struct list_head *list); |
| 347 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); | 350 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); |
| 351 | extern int __add_to_swap_cache(struct page *page, swp_entry_t entry); | ||
| 348 | extern void __delete_from_swap_cache(struct page *); | 352 | extern void __delete_from_swap_cache(struct page *); |
| 349 | extern void delete_from_swap_cache(struct page *); | 353 | extern void delete_from_swap_cache(struct page *); |
| 350 | extern void free_page_and_swap_cache(struct page *); | 354 | extern void free_page_and_swap_cache(struct page *); |
| @@ -461,7 +465,7 @@ static inline struct page *lookup_swap_cache(swp_entry_t swp) | |||
| 461 | return NULL; | 465 | return NULL; |
| 462 | } | 466 | } |
| 463 | 467 | ||
| 464 | static inline int add_to_swap(struct page *page) | 468 | static inline int add_to_swap(struct page *page, struct list_head *list) |
| 465 | { | 469 | { |
| 466 | return 0; | 470 | return 0; |
| 467 | } | 471 | } |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 2de42f9401d2..a5ffd32642fd 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
| @@ -25,6 +25,7 @@ extern int swiotlb_force; | |||
| 25 | extern void swiotlb_init(int verbose); | 25 | extern void swiotlb_init(int verbose); |
| 26 | int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); | 26 | int swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); |
| 27 | extern unsigned long swiotlb_nr_tbl(void); | 27 | extern unsigned long swiotlb_nr_tbl(void); |
| 28 | unsigned long swiotlb_size_or_default(void); | ||
| 28 | extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs); | 29 | extern int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs); |
| 29 | 30 | ||
| 30 | /* | 31 | /* |
diff --git a/include/linux/time.h b/include/linux/time.h index d4835dfdf25e..22d81b3c955b 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
| @@ -181,6 +181,9 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | |||
| 181 | extern int timekeeping_valid_for_hres(void); | 181 | extern int timekeeping_valid_for_hres(void); |
| 182 | extern u64 timekeeping_max_deferment(void); | 182 | extern u64 timekeeping_max_deferment(void); |
| 183 | extern int timekeeping_inject_offset(struct timespec *ts); | 183 | extern int timekeeping_inject_offset(struct timespec *ts); |
| 184 | extern s32 timekeeping_get_tai_offset(void); | ||
| 185 | extern void timekeeping_set_tai_offset(s32 tai_offset); | ||
| 186 | extern void timekeeping_clocktai(struct timespec *ts); | ||
| 184 | 187 | ||
| 185 | struct tms; | 188 | struct tms; |
| 186 | extern void do_sys_times(struct tms *); | 189 | extern void do_sys_times(struct tms *); |
diff --git a/include/linux/timekeeper_internal.h b/include/linux/timekeeper_internal.h index e1d558e237ec..c1825eb436ed 100644 --- a/include/linux/timekeeper_internal.h +++ b/include/linux/timekeeper_internal.h | |||
| @@ -20,6 +20,8 @@ struct timekeeper { | |||
| 20 | u32 shift; | 20 | u32 shift; |
| 21 | /* Number of clock cycles in one NTP interval. */ | 21 | /* Number of clock cycles in one NTP interval. */ |
| 22 | cycle_t cycle_interval; | 22 | cycle_t cycle_interval; |
| 23 | /* Last cycle value (also stored in clock->cycle_last) */ | ||
| 24 | cycle_t cycle_last; | ||
| 23 | /* Number of clock shifted nano seconds in one NTP interval. */ | 25 | /* Number of clock shifted nano seconds in one NTP interval. */ |
| 24 | u64 xtime_interval; | 26 | u64 xtime_interval; |
| 25 | /* shifted nano seconds left over when rounding cycle_interval */ | 27 | /* shifted nano seconds left over when rounding cycle_interval */ |
| @@ -62,8 +64,11 @@ struct timekeeper { | |||
| 62 | ktime_t offs_boot; | 64 | ktime_t offs_boot; |
| 63 | /* The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. */ | 65 | /* The raw monotonic time for the CLOCK_MONOTONIC_RAW posix clock. */ |
| 64 | struct timespec raw_time; | 66 | struct timespec raw_time; |
| 65 | /* Seqlock for all timekeeper values */ | 67 | /* The current UTC to TAI offset in seconds */ |
| 66 | seqlock_t lock; | 68 | s32 tai_offset; |
| 69 | /* Offset clock monotonic -> clock tai */ | ||
| 70 | ktime_t offs_tai; | ||
| 71 | |||
| 67 | }; | 72 | }; |
| 68 | 73 | ||
| 69 | static inline struct timespec tk_xtime(struct timekeeper *tk) | 74 | static inline struct timespec tk_xtime(struct timekeeper *tk) |
diff --git a/include/linux/timex.h b/include/linux/timex.h index 5ec87c60b97c..b3726e61368e 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
| @@ -125,9 +125,6 @@ | |||
| 125 | extern unsigned long tick_usec; /* USER_HZ period (usec) */ | 125 | extern unsigned long tick_usec; /* USER_HZ period (usec) */ |
| 126 | extern unsigned long tick_nsec; /* SHIFTED_HZ period (nsec) */ | 126 | extern unsigned long tick_nsec; /* SHIFTED_HZ period (nsec) */ |
| 127 | 127 | ||
| 128 | extern void ntp_init(void); | ||
| 129 | extern void ntp_clear(void); | ||
| 130 | |||
| 131 | /* Required to safely shift negative values */ | 128 | /* Required to safely shift negative values */ |
| 132 | #define shift_right(x, s) ({ \ | 129 | #define shift_right(x, s) ({ \ |
| 133 | __typeof__(x) __x = (x); \ | 130 | __typeof__(x) __x = (x); \ |
| @@ -140,10 +137,6 @@ extern void ntp_clear(void); | |||
| 140 | #define NTP_INTERVAL_FREQ (HZ) | 137 | #define NTP_INTERVAL_FREQ (HZ) |
| 141 | #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) | 138 | #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) |
| 142 | 139 | ||
| 143 | /* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */ | ||
| 144 | extern u64 ntp_tick_length(void); | ||
| 145 | |||
| 146 | extern int second_overflow(unsigned long secs); | ||
| 147 | extern int do_adjtimex(struct timex *); | 140 | extern int do_adjtimex(struct timex *); |
| 148 | extern void hardpps(const struct timespec *, const struct timespec *); | 141 | extern void hardpps(const struct timespec *, const struct timespec *); |
| 149 | 142 | ||
diff --git a/include/linux/trace_clock.h b/include/linux/trace_clock.h index d563f37e1a1d..1d7ca2739272 100644 --- a/include/linux/trace_clock.h +++ b/include/linux/trace_clock.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | extern u64 notrace trace_clock_local(void); | 17 | extern u64 notrace trace_clock_local(void); |
| 18 | extern u64 notrace trace_clock(void); | 18 | extern u64 notrace trace_clock(void); |
| 19 | extern u64 notrace trace_clock_jiffies(void); | ||
| 19 | extern u64 notrace trace_clock_global(void); | 20 | extern u64 notrace trace_clock_global(void); |
| 20 | extern u64 notrace trace_clock_counter(void); | 21 | extern u64 notrace trace_clock_counter(void); |
| 21 | 22 | ||
diff --git a/include/linux/tty.h b/include/linux/tty.h index c75d886b0307..367a9dfc4ea2 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -255,9 +255,9 @@ struct tty_struct { | |||
| 255 | int count; | 255 | int count; |
| 256 | struct winsize winsize; /* termios mutex */ | 256 | struct winsize winsize; /* termios mutex */ |
| 257 | unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; | 257 | unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; |
| 258 | unsigned char warned:1; | ||
| 259 | unsigned char ctrl_status; /* ctrl_lock */ | 258 | unsigned char ctrl_status; /* ctrl_lock */ |
| 260 | unsigned int receive_room; /* Bytes free for queue */ | 259 | unsigned int receive_room; /* Bytes free for queue */ |
| 260 | int flow_change; | ||
| 261 | 261 | ||
| 262 | struct tty_struct *link; | 262 | struct tty_struct *link; |
| 263 | struct fasync_struct *fasync; | 263 | struct fasync_struct *fasync; |
| @@ -315,9 +315,25 @@ struct tty_file_private { | |||
| 315 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ | 315 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ |
| 316 | #define TTY_HUPPED 18 /* Post driver->hangup() */ | 316 | #define TTY_HUPPED 18 /* Post driver->hangup() */ |
| 317 | #define TTY_HUPPING 21 /* ->hangup() in progress */ | 317 | #define TTY_HUPPING 21 /* ->hangup() in progress */ |
| 318 | #define TTY_LDISC_HALTED 22 /* Line discipline is halted */ | ||
| 318 | 319 | ||
| 319 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) | 320 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) |
| 320 | 321 | ||
| 322 | /* Values for tty->flow_change */ | ||
| 323 | #define TTY_THROTTLE_SAFE 1 | ||
| 324 | #define TTY_UNTHROTTLE_SAFE 2 | ||
| 325 | |||
| 326 | static inline void __tty_set_flow_change(struct tty_struct *tty, int val) | ||
| 327 | { | ||
| 328 | tty->flow_change = val; | ||
| 329 | } | ||
| 330 | |||
| 331 | static inline void tty_set_flow_change(struct tty_struct *tty, int val) | ||
| 332 | { | ||
| 333 | tty->flow_change = val; | ||
| 334 | smp_mb(); | ||
| 335 | } | ||
| 336 | |||
| 321 | #ifdef CONFIG_TTY | 337 | #ifdef CONFIG_TTY |
| 322 | extern void console_init(void); | 338 | extern void console_init(void); |
| 323 | extern void tty_kref_put(struct tty_struct *tty); | 339 | extern void tty_kref_put(struct tty_struct *tty); |
| @@ -400,6 +416,8 @@ extern int tty_write_room(struct tty_struct *tty); | |||
| 400 | extern void tty_driver_flush_buffer(struct tty_struct *tty); | 416 | extern void tty_driver_flush_buffer(struct tty_struct *tty); |
| 401 | extern void tty_throttle(struct tty_struct *tty); | 417 | extern void tty_throttle(struct tty_struct *tty); |
| 402 | extern void tty_unthrottle(struct tty_struct *tty); | 418 | extern void tty_unthrottle(struct tty_struct *tty); |
| 419 | extern int tty_throttle_safe(struct tty_struct *tty); | ||
| 420 | extern int tty_unthrottle_safe(struct tty_struct *tty); | ||
| 403 | extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); | 421 | extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); |
| 404 | extern void tty_driver_remove_tty(struct tty_driver *driver, | 422 | extern void tty_driver_remove_tty(struct tty_driver *driver, |
| 405 | struct tty_struct *tty); | 423 | struct tty_struct *tty); |
| @@ -419,13 +437,28 @@ extern void tty_flush_to_ldisc(struct tty_struct *tty); | |||
| 419 | extern void tty_buffer_free_all(struct tty_port *port); | 437 | extern void tty_buffer_free_all(struct tty_port *port); |
| 420 | extern void tty_buffer_flush(struct tty_struct *tty); | 438 | extern void tty_buffer_flush(struct tty_struct *tty); |
| 421 | extern void tty_buffer_init(struct tty_port *port); | 439 | extern void tty_buffer_init(struct tty_port *port); |
| 422 | extern speed_t tty_get_baud_rate(struct tty_struct *tty); | ||
| 423 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); | 440 | extern speed_t tty_termios_baud_rate(struct ktermios *termios); |
| 424 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); | 441 | extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); |
| 425 | extern void tty_termios_encode_baud_rate(struct ktermios *termios, | 442 | extern void tty_termios_encode_baud_rate(struct ktermios *termios, |
| 426 | speed_t ibaud, speed_t obaud); | 443 | speed_t ibaud, speed_t obaud); |
| 427 | extern void tty_encode_baud_rate(struct tty_struct *tty, | 444 | extern void tty_encode_baud_rate(struct tty_struct *tty, |
| 428 | speed_t ibaud, speed_t obaud); | 445 | speed_t ibaud, speed_t obaud); |
| 446 | |||
| 447 | /** | ||
| 448 | * tty_get_baud_rate - get tty bit rates | ||
| 449 | * @tty: tty to query | ||
| 450 | * | ||
| 451 | * Returns the baud rate as an integer for this terminal. The | ||
| 452 | * termios lock must be held by the caller and the terminal bit | ||
| 453 | * flags may be updated. | ||
| 454 | * | ||
| 455 | * Locking: none | ||
| 456 | */ | ||
| 457 | static inline speed_t tty_get_baud_rate(struct tty_struct *tty) | ||
| 458 | { | ||
| 459 | return tty_termios_baud_rate(&tty->termios); | ||
| 460 | } | ||
| 461 | |||
| 429 | extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); | 462 | extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old); |
| 430 | extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); | 463 | extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b); |
| 431 | extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); | 464 | extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt); |
| @@ -502,6 +535,8 @@ extern int tty_port_carrier_raised(struct tty_port *port); | |||
| 502 | extern void tty_port_raise_dtr_rts(struct tty_port *port); | 535 | extern void tty_port_raise_dtr_rts(struct tty_port *port); |
| 503 | extern void tty_port_lower_dtr_rts(struct tty_port *port); | 536 | extern void tty_port_lower_dtr_rts(struct tty_port *port); |
| 504 | extern void tty_port_hangup(struct tty_port *port); | 537 | extern void tty_port_hangup(struct tty_port *port); |
| 538 | extern void tty_port_tty_hangup(struct tty_port *port, bool check_clocal); | ||
| 539 | extern void tty_port_tty_wakeup(struct tty_port *port); | ||
| 505 | extern int tty_port_block_til_ready(struct tty_port *port, | 540 | extern int tty_port_block_til_ready(struct tty_port *port, |
| 506 | struct tty_struct *tty, struct file *filp); | 541 | struct tty_struct *tty, struct file *filp); |
| 507 | extern int tty_port_close_start(struct tty_port *port, | 542 | extern int tty_port_close_start(struct tty_port *port, |
| @@ -526,8 +561,6 @@ extern void tty_ldisc_release(struct tty_struct *tty, struct tty_struct *o_tty); | |||
| 526 | extern void tty_ldisc_init(struct tty_struct *tty); | 561 | extern void tty_ldisc_init(struct tty_struct *tty); |
| 527 | extern void tty_ldisc_deinit(struct tty_struct *tty); | 562 | extern void tty_ldisc_deinit(struct tty_struct *tty); |
| 528 | extern void tty_ldisc_begin(void); | 563 | extern void tty_ldisc_begin(void); |
| 529 | /* This last one is just for the tty layer internals and shouldn't be used elsewhere */ | ||
| 530 | extern void tty_ldisc_enable(struct tty_struct *tty); | ||
| 531 | 564 | ||
| 532 | 565 | ||
| 533 | /* n_tty.c */ | 566 | /* n_tty.c */ |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 455a0d7bf220..58390c73df8b 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
| @@ -9,89 +9,89 @@ | |||
| 9 | * | 9 | * |
| 10 | * int (*open)(struct tty_struct *); | 10 | * int (*open)(struct tty_struct *); |
| 11 | * | 11 | * |
| 12 | * This function is called when the line discipline is associated | 12 | * This function is called when the line discipline is associated |
| 13 | * with the tty. The line discipline can use this as an | 13 | * with the tty. The line discipline can use this as an |
| 14 | * opportunity to initialize any state needed by the ldisc routines. | 14 | * opportunity to initialize any state needed by the ldisc routines. |
| 15 | * | 15 | * |
| 16 | * void (*close)(struct tty_struct *); | 16 | * void (*close)(struct tty_struct *); |
| 17 | * | 17 | * |
| 18 | * This function is called when the line discipline is being | 18 | * This function is called when the line discipline is being |
| 19 | * shutdown, either because the tty is being closed or because | 19 | * shutdown, either because the tty is being closed or because |
| 20 | * the tty is being changed to use a new line discipline | 20 | * the tty is being changed to use a new line discipline |
| 21 | * | 21 | * |
| 22 | * void (*flush_buffer)(struct tty_struct *tty); | 22 | * void (*flush_buffer)(struct tty_struct *tty); |
| 23 | * | 23 | * |
| 24 | * This function instructs the line discipline to clear its | 24 | * This function instructs the line discipline to clear its |
| 25 | * buffers of any input characters it may have queued to be | 25 | * buffers of any input characters it may have queued to be |
| 26 | * delivered to the user mode process. | 26 | * delivered to the user mode process. |
| 27 | * | 27 | * |
| 28 | * ssize_t (*chars_in_buffer)(struct tty_struct *tty); | 28 | * ssize_t (*chars_in_buffer)(struct tty_struct *tty); |
| 29 | * | 29 | * |
| 30 | * This function returns the number of input characters the line | 30 | * This function returns the number of input characters the line |
| 31 | * discipline may have queued up to be delivered to the user mode | 31 | * discipline may have queued up to be delivered to the user mode |
| 32 | * process. | 32 | * process. |
| 33 | * | 33 | * |
| 34 | * ssize_t (*read)(struct tty_struct * tty, struct file * file, | 34 | * ssize_t (*read)(struct tty_struct * tty, struct file * file, |
| 35 | * unsigned char * buf, size_t nr); | 35 | * unsigned char * buf, size_t nr); |
| 36 | * | 36 | * |
| 37 | * This function is called when the user requests to read from | 37 | * This function is called when the user requests to read from |
| 38 | * the tty. The line discipline will return whatever characters | 38 | * the tty. The line discipline will return whatever characters |
| 39 | * it has buffered up for the user. If this function is not | 39 | * it has buffered up for the user. If this function is not |
| 40 | * defined, the user will receive an EIO error. | 40 | * defined, the user will receive an EIO error. |
| 41 | * | 41 | * |
| 42 | * ssize_t (*write)(struct tty_struct * tty, struct file * file, | 42 | * ssize_t (*write)(struct tty_struct * tty, struct file * file, |
| 43 | * const unsigned char * buf, size_t nr); | 43 | * const unsigned char * buf, size_t nr); |
| 44 | * | 44 | * |
| 45 | * This function is called when the user requests to write to the | 45 | * This function is called when the user requests to write to the |
| 46 | * tty. The line discipline will deliver the characters to the | 46 | * tty. The line discipline will deliver the characters to the |
| 47 | * low-level tty device for transmission, optionally performing | 47 | * low-level tty device for transmission, optionally performing |
| 48 | * some processing on the characters first. If this function is | 48 | * some processing on the characters first. If this function is |
| 49 | * not defined, the user will receive an EIO error. | 49 | * not defined, the user will receive an EIO error. |
| 50 | * | 50 | * |
| 51 | * int (*ioctl)(struct tty_struct * tty, struct file * file, | 51 | * int (*ioctl)(struct tty_struct * tty, struct file * file, |
| 52 | * unsigned int cmd, unsigned long arg); | 52 | * unsigned int cmd, unsigned long arg); |
| 53 | * | 53 | * |
| 54 | * This function is called when the user requests an ioctl which | 54 | * This function is called when the user requests an ioctl which |
| 55 | * is not handled by the tty layer or the low-level tty driver. | 55 | * is not handled by the tty layer or the low-level tty driver. |
| 56 | * It is intended for ioctls which affect line discpline | 56 | * It is intended for ioctls which affect line discpline |
| 57 | * operation. Note that the search order for ioctls is (1) tty | 57 | * operation. Note that the search order for ioctls is (1) tty |
| 58 | * layer, (2) tty low-level driver, (3) line discpline. So a | 58 | * layer, (2) tty low-level driver, (3) line discpline. So a |
| 59 | * low-level driver can "grab" an ioctl request before the line | 59 | * low-level driver can "grab" an ioctl request before the line |
| 60 | * discpline has a chance to see it. | 60 | * discpline has a chance to see it. |
| 61 | * | 61 | * |
| 62 | * long (*compat_ioctl)(struct tty_struct * tty, struct file * file, | 62 | * long (*compat_ioctl)(struct tty_struct * tty, struct file * file, |
| 63 | * unsigned int cmd, unsigned long arg); | 63 | * unsigned int cmd, unsigned long arg); |
| 64 | * | 64 | * |
| 65 | * Process ioctl calls from 32-bit process on 64-bit system | 65 | * Process ioctl calls from 32-bit process on 64-bit system |
| 66 | * | 66 | * |
| 67 | * void (*set_termios)(struct tty_struct *tty, struct ktermios * old); | 67 | * void (*set_termios)(struct tty_struct *tty, struct ktermios * old); |
| 68 | * | 68 | * |
| 69 | * This function notifies the line discpline that a change has | 69 | * This function notifies the line discpline that a change has |
| 70 | * been made to the termios structure. | 70 | * been made to the termios structure. |
| 71 | * | 71 | * |
| 72 | * int (*poll)(struct tty_struct * tty, struct file * file, | 72 | * int (*poll)(struct tty_struct * tty, struct file * file, |
| 73 | * poll_table *wait); | 73 | * poll_table *wait); |
| 74 | * | 74 | * |
| 75 | * This function is called when a user attempts to select/poll on a | 75 | * This function is called when a user attempts to select/poll on a |
| 76 | * tty device. It is solely the responsibility of the line | 76 | * tty device. It is solely the responsibility of the line |
| 77 | * discipline to handle poll requests. | 77 | * discipline to handle poll requests. |
| 78 | * | 78 | * |
| 79 | * void (*receive_buf)(struct tty_struct *, const unsigned char *cp, | 79 | * void (*receive_buf)(struct tty_struct *, const unsigned char *cp, |
| 80 | * char *fp, int count); | 80 | * char *fp, int count); |
| 81 | * | 81 | * |
| 82 | * This function is called by the low-level tty driver to send | 82 | * This function is called by the low-level tty driver to send |
| 83 | * characters received by the hardware to the line discpline for | 83 | * characters received by the hardware to the line discpline for |
| 84 | * processing. <cp> is a pointer to the buffer of input | 84 | * processing. <cp> is a pointer to the buffer of input |
| 85 | * character received by the device. <fp> is a pointer to a | 85 | * character received by the device. <fp> is a pointer to a |
| 86 | * pointer of flag bytes which indicate whether a character was | 86 | * pointer of flag bytes which indicate whether a character was |
| 87 | * received with a parity error, etc. | 87 | * received with a parity error, etc. |
| 88 | * | 88 | * |
| 89 | * void (*write_wakeup)(struct tty_struct *); | 89 | * void (*write_wakeup)(struct tty_struct *); |
| 90 | * | 90 | * |
| 91 | * This function is called by the low-level tty driver to signal | 91 | * This function is called by the low-level tty driver to signal |
| 92 | * that line discpline should try to send more characters to the | 92 | * that line discpline should try to send more characters to the |
| 93 | * low-level driver for transmission. If the line discpline does | 93 | * low-level driver for transmission. If the line discpline does |
| 94 | * not have any more data to send, it can just return. | 94 | * not have any more data to send, it can just return. |
| 95 | * | 95 | * |
| 96 | * int (*hangup)(struct tty_struct *) | 96 | * int (*hangup)(struct tty_struct *) |
| 97 | * | 97 | * |
| @@ -115,7 +115,7 @@ struct tty_ldisc_ops { | |||
| 115 | char *name; | 115 | char *name; |
| 116 | int num; | 116 | int num; |
| 117 | int flags; | 117 | int flags; |
| 118 | 118 | ||
| 119 | /* | 119 | /* |
| 120 | * The following routines are called from above. | 120 | * The following routines are called from above. |
| 121 | */ | 121 | */ |
| @@ -123,19 +123,19 @@ struct tty_ldisc_ops { | |||
| 123 | void (*close)(struct tty_struct *); | 123 | void (*close)(struct tty_struct *); |
| 124 | void (*flush_buffer)(struct tty_struct *tty); | 124 | void (*flush_buffer)(struct tty_struct *tty); |
| 125 | ssize_t (*chars_in_buffer)(struct tty_struct *tty); | 125 | ssize_t (*chars_in_buffer)(struct tty_struct *tty); |
| 126 | ssize_t (*read)(struct tty_struct * tty, struct file * file, | 126 | ssize_t (*read)(struct tty_struct *tty, struct file *file, |
| 127 | unsigned char __user * buf, size_t nr); | 127 | unsigned char __user *buf, size_t nr); |
| 128 | ssize_t (*write)(struct tty_struct * tty, struct file * file, | 128 | ssize_t (*write)(struct tty_struct *tty, struct file *file, |
| 129 | const unsigned char * buf, size_t nr); | 129 | const unsigned char *buf, size_t nr); |
| 130 | int (*ioctl)(struct tty_struct * tty, struct file * file, | 130 | int (*ioctl)(struct tty_struct *tty, struct file *file, |
| 131 | unsigned int cmd, unsigned long arg); | 131 | unsigned int cmd, unsigned long arg); |
| 132 | long (*compat_ioctl)(struct tty_struct * tty, struct file * file, | 132 | long (*compat_ioctl)(struct tty_struct *tty, struct file *file, |
| 133 | unsigned int cmd, unsigned long arg); | 133 | unsigned int cmd, unsigned long arg); |
| 134 | void (*set_termios)(struct tty_struct *tty, struct ktermios * old); | 134 | void (*set_termios)(struct tty_struct *tty, struct ktermios *old); |
| 135 | unsigned int (*poll)(struct tty_struct *, struct file *, | 135 | unsigned int (*poll)(struct tty_struct *, struct file *, |
| 136 | struct poll_table_struct *); | 136 | struct poll_table_struct *); |
| 137 | int (*hangup)(struct tty_struct *tty); | 137 | int (*hangup)(struct tty_struct *tty); |
| 138 | 138 | ||
| 139 | /* | 139 | /* |
| 140 | * The following routines are called from below. | 140 | * The following routines are called from below. |
| 141 | */ | 141 | */ |
| @@ -145,7 +145,7 @@ struct tty_ldisc_ops { | |||
| 145 | void (*dcd_change)(struct tty_struct *, unsigned int); | 145 | void (*dcd_change)(struct tty_struct *, unsigned int); |
| 146 | 146 | ||
| 147 | struct module *owner; | 147 | struct module *owner; |
| 148 | 148 | ||
| 149 | int refcount; | 149 | int refcount; |
| 150 | }; | 150 | }; |
| 151 | 151 | ||
diff --git a/include/linux/ucs2_string.h b/include/linux/ucs2_string.h new file mode 100644 index 000000000000..cbb20afdbc01 --- /dev/null +++ b/include/linux/ucs2_string.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #ifndef _LINUX_UCS2_STRING_H_ | ||
| 2 | #define _LINUX_UCS2_STRING_H_ | ||
| 3 | |||
| 4 | #include <linux/types.h> /* for size_t */ | ||
| 5 | #include <linux/stddef.h> /* for NULL */ | ||
| 6 | |||
| 7 | typedef u16 ucs2_char_t; | ||
| 8 | |||
| 9 | unsigned long ucs2_strnlen(const ucs2_char_t *s, size_t maxlength); | ||
| 10 | unsigned long ucs2_strlen(const ucs2_char_t *s); | ||
| 11 | unsigned long ucs2_strsize(const ucs2_char_t *data, unsigned long maxlength); | ||
| 12 | int ucs2_strncmp(const ucs2_char_t *a, const ucs2_char_t *b, size_t len); | ||
| 13 | |||
| 14 | #endif /* _LINUX_UCS2_STRING_H_ */ | ||
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index 02b83db8e2c5..06f28beed7c2 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
| @@ -38,6 +38,8 @@ struct inode; | |||
| 38 | #define UPROBE_HANDLER_REMOVE 1 | 38 | #define UPROBE_HANDLER_REMOVE 1 |
| 39 | #define UPROBE_HANDLER_MASK 1 | 39 | #define UPROBE_HANDLER_MASK 1 |
| 40 | 40 | ||
| 41 | #define MAX_URETPROBE_DEPTH 64 | ||
| 42 | |||
| 41 | enum uprobe_filter_ctx { | 43 | enum uprobe_filter_ctx { |
| 42 | UPROBE_FILTER_REGISTER, | 44 | UPROBE_FILTER_REGISTER, |
| 43 | UPROBE_FILTER_UNREGISTER, | 45 | UPROBE_FILTER_UNREGISTER, |
| @@ -46,6 +48,9 @@ enum uprobe_filter_ctx { | |||
| 46 | 48 | ||
| 47 | struct uprobe_consumer { | 49 | struct uprobe_consumer { |
| 48 | int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); | 50 | int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); |
| 51 | int (*ret_handler)(struct uprobe_consumer *self, | ||
| 52 | unsigned long func, | ||
| 53 | struct pt_regs *regs); | ||
| 49 | bool (*filter)(struct uprobe_consumer *self, | 54 | bool (*filter)(struct uprobe_consumer *self, |
| 50 | enum uprobe_filter_ctx ctx, | 55 | enum uprobe_filter_ctx ctx, |
| 51 | struct mm_struct *mm); | 56 | struct mm_struct *mm); |
| @@ -68,6 +73,8 @@ struct uprobe_task { | |||
| 68 | enum uprobe_task_state state; | 73 | enum uprobe_task_state state; |
| 69 | struct arch_uprobe_task autask; | 74 | struct arch_uprobe_task autask; |
| 70 | 75 | ||
| 76 | struct return_instance *return_instances; | ||
| 77 | unsigned int depth; | ||
| 71 | struct uprobe *active_uprobe; | 78 | struct uprobe *active_uprobe; |
| 72 | 79 | ||
| 73 | unsigned long xol_vaddr; | 80 | unsigned long xol_vaddr; |
| @@ -100,6 +107,7 @@ struct uprobes_state { | |||
| 100 | extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); | 107 | extern int __weak set_swbp(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
| 101 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); | 108 | extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, unsigned long vaddr); |
| 102 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); | 109 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); |
| 110 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); | ||
| 103 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 111 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
| 104 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); | 112 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); |
| 105 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 113 | extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 4d22d0f6167a..a0bee5a28d1a 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -469,14 +469,12 @@ struct usb3_lpm_parameters { | |||
| 469 | * @lpm_capable: device supports LPM | 469 | * @lpm_capable: device supports LPM |
| 470 | * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM | 470 | * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM |
| 471 | * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled | 471 | * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled |
| 472 | * @usb3_lpm_enabled: USB3 hardware LPM enabled | ||
| 472 | * @string_langid: language ID for strings | 473 | * @string_langid: language ID for strings |
| 473 | * @product: iProduct string, if present (static) | 474 | * @product: iProduct string, if present (static) |
| 474 | * @manufacturer: iManufacturer string, if present (static) | 475 | * @manufacturer: iManufacturer string, if present (static) |
| 475 | * @serial: iSerialNumber string, if present (static) | 476 | * @serial: iSerialNumber string, if present (static) |
| 476 | * @filelist: usbfs files that are open to this device | 477 | * @filelist: usbfs files that are open to this device |
| 477 | * @usb_classdev: USB class device that was created for usbfs device | ||
| 478 | * access from userspace | ||
| 479 | * @usbfs_dentry: usbfs dentry entry for the device | ||
| 480 | * @maxchild: number of ports if hub | 478 | * @maxchild: number of ports if hub |
| 481 | * @quirks: quirks of the whole device | 479 | * @quirks: quirks of the whole device |
| 482 | * @urbnum: number of URBs submitted for the whole device | 480 | * @urbnum: number of URBs submitted for the whole device |
| @@ -619,7 +617,7 @@ static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index) | |||
| 619 | #endif | 617 | #endif |
| 620 | 618 | ||
| 621 | /* USB autosuspend and autoresume */ | 619 | /* USB autosuspend and autoresume */ |
| 622 | #ifdef CONFIG_USB_SUSPEND | 620 | #ifdef CONFIG_PM_RUNTIME |
| 623 | extern void usb_enable_autosuspend(struct usb_device *udev); | 621 | extern void usb_enable_autosuspend(struct usb_device *udev); |
| 624 | extern void usb_disable_autosuspend(struct usb_device *udev); | 622 | extern void usb_disable_autosuspend(struct usb_device *udev); |
| 625 | 623 | ||
| @@ -978,7 +976,12 @@ struct usbdrv_wrap { | |||
| 978 | * the "usbfs" filesystem. This lets devices provide ways to | 976 | * the "usbfs" filesystem. This lets devices provide ways to |
| 979 | * expose information to user space regardless of where they | 977 | * expose information to user space regardless of where they |
| 980 | * do (or don't) show up otherwise in the filesystem. | 978 | * do (or don't) show up otherwise in the filesystem. |
| 981 | * @suspend: Called when the device is going to be suspended by the system. | 979 | * @suspend: Called when the device is going to be suspended by the |
| 980 | * system either from system sleep or runtime suspend context. The | ||
| 981 | * return value will be ignored in system sleep context, so do NOT | ||
| 982 | * try to continue using the device if suspend fails in this case. | ||
| 983 | * Instead, let the resume or reset-resume routine recover from | ||
| 984 | * the failure. | ||
| 982 | * @resume: Called when the device is being resumed by the system. | 985 | * @resume: Called when the device is being resumed by the system. |
| 983 | * @reset_resume: Called when the suspended device has been reset instead | 986 | * @reset_resume: Called when the suspended device has been reset instead |
| 984 | * of being resumed. | 987 | * of being resumed. |
diff --git a/include/linux/usb/cdc-wdm.h b/include/linux/usb/cdc-wdm.h index 719c332620fa..0b3f4295c025 100644 --- a/include/linux/usb/cdc-wdm.h +++ b/include/linux/usb/cdc-wdm.h | |||
| @@ -11,6 +11,8 @@ | |||
| 11 | #ifndef __LINUX_USB_CDC_WDM_H | 11 | #ifndef __LINUX_USB_CDC_WDM_H |
| 12 | #define __LINUX_USB_CDC_WDM_H | 12 | #define __LINUX_USB_CDC_WDM_H |
| 13 | 13 | ||
| 14 | #include <uapi/linux/usb/cdc-wdm.h> | ||
| 15 | |||
| 14 | extern struct usb_driver *usb_cdc_wdm_register(struct usb_interface *intf, | 16 | extern struct usb_driver *usb_cdc_wdm_register(struct usb_interface *intf, |
| 15 | struct usb_endpoint_descriptor *ep, | 17 | struct usb_endpoint_descriptor *ep, |
| 16 | int bufsize, | 18 | int bufsize, |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 9c210f2283df..27603bcbb9b9 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
| @@ -43,4 +43,13 @@ | |||
| 43 | */ | 43 | */ |
| 44 | extern const char *usb_speed_string(enum usb_device_speed speed); | 44 | extern const char *usb_speed_string(enum usb_device_speed speed); |
| 45 | 45 | ||
| 46 | |||
| 47 | /** | ||
| 48 | * usb_state_string - Returns human readable name for the state. | ||
| 49 | * @state: The state to return a human-readable name for. If it's not | ||
| 50 | * any of the states devices in usb_device_state_string enum, | ||
| 51 | * the string UNKNOWN will be returned. | ||
| 52 | */ | ||
| 53 | extern const char *usb_state_string(enum usb_device_state state); | ||
| 54 | |||
| 46 | #endif /* __LINUX_USB_CH9_H */ | 55 | #endif /* __LINUX_USB_CH9_H */ |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 8860594d6364..5e61589fc166 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #include <linux/usb/ch9.h> | 39 | #include <linux/usb/ch9.h> |
| 40 | #include <linux/usb/gadget.h> | 40 | #include <linux/usb/gadget.h> |
| 41 | #include <linux/log2.h> | 41 | #include <linux/log2.h> |
| 42 | #include <linux/configfs.h> | ||
| 42 | 43 | ||
| 43 | /* | 44 | /* |
| 44 | * USB function drivers should return USB_GADGET_DELAYED_STATUS if they | 45 | * USB function drivers should return USB_GADGET_DELAYED_STATUS if they |
| @@ -464,6 +465,8 @@ struct usb_function_driver { | |||
| 464 | }; | 465 | }; |
| 465 | 466 | ||
| 466 | struct usb_function_instance { | 467 | struct usb_function_instance { |
| 468 | struct config_group group; | ||
| 469 | struct list_head cfs_list; | ||
| 467 | struct usb_function_driver *fd; | 470 | struct usb_function_driver *fd; |
| 468 | void (*free_func_inst)(struct usb_function_instance *inst); | 471 | void (*free_func_inst)(struct usb_function_instance *inst); |
| 469 | }; | 472 | }; |
diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h index 51eae14477f7..5615f4d82724 100644 --- a/include/linux/usb/dwc3-omap.h +++ b/include/linux/usb/dwc3-omap.h | |||
| @@ -19,11 +19,11 @@ enum omap_dwc3_vbus_id_status { | |||
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | #if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE)) | 21 | #if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE)) |
| 22 | extern void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status); | 22 | extern int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status); |
| 23 | #else | 23 | #else |
| 24 | static inline void dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status) | 24 | static inline int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status) |
| 25 | { | 25 | { |
| 26 | return; | 26 | return -ENODEV; |
| 27 | } | 27 | } |
| 28 | #endif | 28 | #endif |
| 29 | 29 | ||
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 2e297e80d59a..c454a88abf2e 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
| @@ -482,6 +482,7 @@ struct usb_gadget_ops { | |||
| 482 | * @speed: Speed of current connection to USB host. | 482 | * @speed: Speed of current connection to USB host. |
| 483 | * @max_speed: Maximal speed the UDC can handle. UDC must support this | 483 | * @max_speed: Maximal speed the UDC can handle. UDC must support this |
| 484 | * and all slower speeds. | 484 | * and all slower speeds. |
| 485 | * @state: the state we are now (attached, suspended, configured, etc) | ||
| 485 | * @sg_supported: true if we can handle scatter-gather | 486 | * @sg_supported: true if we can handle scatter-gather |
| 486 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the | 487 | * @is_otg: True if the USB device port uses a Mini-AB jack, so that the |
| 487 | * gadget driver must provide a USB OTG descriptor. | 488 | * gadget driver must provide a USB OTG descriptor. |
| @@ -525,6 +526,7 @@ struct usb_gadget { | |||
| 525 | struct list_head ep_list; /* of usb_ep */ | 526 | struct list_head ep_list; /* of usb_ep */ |
| 526 | enum usb_device_speed speed; | 527 | enum usb_device_speed speed; |
| 527 | enum usb_device_speed max_speed; | 528 | enum usb_device_speed max_speed; |
| 529 | enum usb_device_state state; | ||
| 528 | unsigned sg_supported:1; | 530 | unsigned sg_supported:1; |
| 529 | unsigned is_otg:1; | 531 | unsigned is_otg:1; |
| 530 | unsigned is_a_peripheral:1; | 532 | unsigned is_a_peripheral:1; |
| @@ -872,6 +874,8 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver); | |||
| 872 | */ | 874 | */ |
| 873 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); | 875 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); |
| 874 | 876 | ||
| 877 | extern int usb_add_gadget_udc_release(struct device *parent, | ||
| 878 | struct usb_gadget *gadget, void (*release)(struct device *dev)); | ||
| 875 | extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); | 879 | extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget); |
| 876 | extern void usb_del_gadget_udc(struct usb_gadget *gadget); | 880 | extern void usb_del_gadget_udc(struct usb_gadget *gadget); |
| 877 | extern int udc_attach_driver(const char *name, | 881 | extern int udc_attach_driver(const char *name, |
| @@ -959,6 +963,13 @@ extern void usb_gadget_unmap_request(struct usb_gadget *gadget, | |||
| 959 | 963 | ||
| 960 | /*-------------------------------------------------------------------------*/ | 964 | /*-------------------------------------------------------------------------*/ |
| 961 | 965 | ||
| 966 | /* utility to set gadget state properly */ | ||
| 967 | |||
| 968 | extern void usb_gadget_set_state(struct usb_gadget *gadget, | ||
| 969 | enum usb_device_state state); | ||
| 970 | |||
| 971 | /*-------------------------------------------------------------------------*/ | ||
| 972 | |||
| 962 | /* utility wrapping a simple endpoint selection policy */ | 973 | /* utility wrapping a simple endpoint selection policy */ |
| 963 | 974 | ||
| 964 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, | 975 | extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, |
diff --git a/include/linux/usb/gadget_configfs.h b/include/linux/usb/gadget_configfs.h new file mode 100644 index 000000000000..d74c0ae989d5 --- /dev/null +++ b/include/linux/usb/gadget_configfs.h | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | #ifndef __GADGET_CONFIGFS__ | ||
| 2 | #define __GADGET_CONFIGFS__ | ||
| 3 | |||
| 4 | #include <linux/configfs.h> | ||
| 5 | |||
| 6 | int check_user_usb_string(const char *name, | ||
| 7 | struct usb_gadget_strings *stringtab_dev); | ||
| 8 | |||
| 9 | #define GS_STRINGS_W(__struct, __name) \ | ||
| 10 | static ssize_t __struct##_##__name##_store(struct __struct *gs, \ | ||
| 11 | const char *page, size_t len) \ | ||
| 12 | { \ | ||
| 13 | int ret; \ | ||
| 14 | \ | ||
| 15 | ret = usb_string_copy(page, &gs->__name); \ | ||
| 16 | if (ret) \ | ||
| 17 | return ret; \ | ||
| 18 | return len; \ | ||
| 19 | } | ||
| 20 | |||
| 21 | #define GS_STRINGS_R(__struct, __name) \ | ||
| 22 | static ssize_t __struct##_##__name##_show(struct __struct *gs, \ | ||
| 23 | char *page) \ | ||
| 24 | { \ | ||
| 25 | return sprintf(page, "%s\n", gs->__name ?: ""); \ | ||
| 26 | } | ||
| 27 | |||
| 28 | #define GS_STRING_ITEM_ATTR(struct_name, name) \ | ||
| 29 | static struct struct_name##_attribute struct_name##_##name = \ | ||
| 30 | __CONFIGFS_ATTR(name, S_IRUGO | S_IWUSR, \ | ||
| 31 | struct_name##_##name##_show, \ | ||
| 32 | struct_name##_##name##_store) | ||
| 33 | |||
| 34 | #define GS_STRINGS_RW(struct_name, _name) \ | ||
| 35 | GS_STRINGS_R(struct_name, _name) \ | ||
| 36 | GS_STRINGS_W(struct_name, _name) \ | ||
| 37 | GS_STRING_ITEM_ATTR(struct_name, _name) | ||
| 38 | |||
| 39 | #define USB_CONFIG_STRING_RW_OPS(struct_in) \ | ||
| 40 | CONFIGFS_ATTR_OPS(struct_in); \ | ||
| 41 | \ | ||
| 42 | static struct configfs_item_operations struct_in##_langid_item_ops = { \ | ||
| 43 | .release = struct_in##_attr_release, \ | ||
| 44 | .show_attribute = struct_in##_attr_show, \ | ||
| 45 | .store_attribute = struct_in##_attr_store, \ | ||
| 46 | }; \ | ||
| 47 | \ | ||
| 48 | static struct config_item_type struct_in##_langid_type = { \ | ||
| 49 | .ct_item_ops = &struct_in##_langid_item_ops, \ | ||
| 50 | .ct_attrs = struct_in##_langid_attrs, \ | ||
| 51 | .ct_owner = THIS_MODULE, \ | ||
| 52 | } | ||
| 53 | |||
| 54 | #define USB_CONFIG_STRINGS_LANG(struct_in, struct_member) \ | ||
| 55 | static struct config_group *struct_in##_strings_make( \ | ||
| 56 | struct config_group *group, \ | ||
| 57 | const char *name) \ | ||
| 58 | { \ | ||
| 59 | struct struct_member *gi; \ | ||
| 60 | struct struct_in *gs; \ | ||
| 61 | struct struct_in *new; \ | ||
| 62 | int langs = 0; \ | ||
| 63 | int ret; \ | ||
| 64 | \ | ||
| 65 | new = kzalloc(sizeof(*new), GFP_KERNEL); \ | ||
| 66 | if (!new) \ | ||
| 67 | return ERR_PTR(-ENOMEM); \ | ||
| 68 | \ | ||
| 69 | ret = check_user_usb_string(name, &new->stringtab_dev); \ | ||
| 70 | if (ret) \ | ||
| 71 | goto err; \ | ||
| 72 | config_group_init_type_name(&new->group, name, \ | ||
| 73 | &struct_in##_langid_type); \ | ||
| 74 | \ | ||
| 75 | gi = container_of(group, struct struct_member, strings_group); \ | ||
| 76 | ret = -EEXIST; \ | ||
| 77 | list_for_each_entry(gs, &gi->string_list, list) { \ | ||
| 78 | if (gs->stringtab_dev.language == new->stringtab_dev.language) \ | ||
| 79 | goto err; \ | ||
| 80 | langs++; \ | ||
| 81 | } \ | ||
| 82 | ret = -EOVERFLOW; \ | ||
| 83 | if (langs >= MAX_USB_STRING_LANGS) \ | ||
| 84 | goto err; \ | ||
| 85 | \ | ||
| 86 | list_add_tail(&new->list, &gi->string_list); \ | ||
| 87 | return &new->group; \ | ||
| 88 | err: \ | ||
| 89 | kfree(new); \ | ||
| 90 | return ERR_PTR(ret); \ | ||
| 91 | } \ | ||
| 92 | \ | ||
| 93 | static void struct_in##_strings_drop( \ | ||
| 94 | struct config_group *group, \ | ||
| 95 | struct config_item *item) \ | ||
| 96 | { \ | ||
| 97 | config_item_put(item); \ | ||
| 98 | } \ | ||
| 99 | \ | ||
| 100 | static struct configfs_group_operations struct_in##_strings_ops = { \ | ||
| 101 | .make_group = &struct_in##_strings_make, \ | ||
| 102 | .drop_item = &struct_in##_strings_drop, \ | ||
| 103 | }; \ | ||
| 104 | \ | ||
| 105 | static struct config_item_type struct_in##_strings_type = { \ | ||
| 106 | .ct_group_ops = &struct_in##_strings_ops, \ | ||
| 107 | .ct_owner = THIS_MODULE, \ | ||
| 108 | } | ||
| 109 | |||
| 110 | #endif | ||
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 59694b5e5e90..f5f5c7dfda90 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
| @@ -84,7 +84,7 @@ struct usb_hcd { | |||
| 84 | 84 | ||
| 85 | struct timer_list rh_timer; /* drives root-hub polling */ | 85 | struct timer_list rh_timer; /* drives root-hub polling */ |
| 86 | struct urb *status_urb; /* the current status urb */ | 86 | struct urb *status_urb; /* the current status urb */ |
| 87 | #ifdef CONFIG_USB_SUSPEND | 87 | #ifdef CONFIG_PM_RUNTIME |
| 88 | struct work_struct wakeup_work; /* for remote wakeup */ | 88 | struct work_struct wakeup_work; /* for remote wakeup */ |
| 89 | #endif | 89 | #endif |
| 90 | 90 | ||
| @@ -593,14 +593,14 @@ extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg); | |||
| 593 | extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg); | 593 | extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg); |
| 594 | #endif /* CONFIG_PM */ | 594 | #endif /* CONFIG_PM */ |
| 595 | 595 | ||
| 596 | #ifdef CONFIG_USB_SUSPEND | 596 | #ifdef CONFIG_PM_RUNTIME |
| 597 | extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); | 597 | extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd); |
| 598 | #else | 598 | #else |
| 599 | static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) | 599 | static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd) |
| 600 | { | 600 | { |
| 601 | return; | 601 | return; |
| 602 | } | 602 | } |
| 603 | #endif /* CONFIG_USB_SUSPEND */ | 603 | #endif /* CONFIG_PM_RUNTIME */ |
| 604 | 604 | ||
| 605 | /*-------------------------------------------------------------------------*/ | 605 | /*-------------------------------------------------------------------------*/ |
| 606 | 606 | ||
diff --git a/include/linux/usb/musb-ux500.h b/include/linux/usb/musb-ux500.h new file mode 100644 index 000000000000..1e2c7130f6e1 --- /dev/null +++ b/include/linux/usb/musb-ux500.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2013 ST-Ericsson AB | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __MUSB_UX500_H__ | ||
| 16 | #define __MUSB_UX500_H__ | ||
| 17 | |||
| 18 | enum ux500_musb_vbus_id_status { | ||
| 19 | UX500_MUSB_NONE = 0, | ||
| 20 | UX500_MUSB_VBUS, | ||
| 21 | UX500_MUSB_ID, | ||
| 22 | UX500_MUSB_CHARGER, | ||
| 23 | UX500_MUSB_ENUMERATED, | ||
| 24 | UX500_MUSB_RIDA, | ||
| 25 | UX500_MUSB_RIDB, | ||
| 26 | UX500_MUSB_RIDC, | ||
| 27 | UX500_MUSB_PREPARE, | ||
| 28 | UX500_MUSB_CLEAN, | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif /* __MUSB_UX500_H__ */ | ||
diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h index 28884c717411..148d35171aac 100644 --- a/include/linux/usb/nop-usb-xceiv.h +++ b/include/linux/usb/nop-usb-xceiv.h | |||
| @@ -5,6 +5,11 @@ | |||
| 5 | 5 | ||
| 6 | struct nop_usb_xceiv_platform_data { | 6 | struct nop_usb_xceiv_platform_data { |
| 7 | enum usb_phy_type type; | 7 | enum usb_phy_type type; |
| 8 | unsigned long clk_rate; | ||
| 9 | |||
| 10 | /* if set fails with -EPROBE_DEFER if can't get regulator */ | ||
| 11 | unsigned int needs_vcc:1; | ||
| 12 | unsigned int needs_reset:1; | ||
| 8 | }; | 13 | }; |
| 9 | 14 | ||
| 10 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) | 15 | #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index e8a5fe87c6bd..291e01ba32e5 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
| @@ -36,14 +36,7 @@ struct usb_otg { | |||
| 36 | 36 | ||
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | #ifdef CONFIG_USB_OTG_UTILS | 39 | extern const char *usb_otg_state_string(enum usb_otg_state state); |
| 40 | extern const char *otg_state_string(enum usb_otg_state state); | ||
| 41 | #else | ||
| 42 | static inline const char *otg_state_string(enum usb_otg_state state) | ||
| 43 | { | ||
| 44 | return NULL; | ||
| 45 | } | ||
| 46 | #endif | ||
| 47 | 40 | ||
| 48 | /* Context: can sleep */ | 41 | /* Context: can sleep */ |
| 49 | static inline int | 42 | static inline int |
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index 15847cbdb512..6b5978f57633 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h | |||
| @@ -91,6 +91,9 @@ struct usb_phy { | |||
| 91 | int (*init)(struct usb_phy *x); | 91 | int (*init)(struct usb_phy *x); |
| 92 | void (*shutdown)(struct usb_phy *x); | 92 | void (*shutdown)(struct usb_phy *x); |
| 93 | 93 | ||
| 94 | /* enable/disable VBUS */ | ||
| 95 | int (*set_vbus)(struct usb_phy *x, int on); | ||
| 96 | |||
| 94 | /* effective for B devices, ignored for A-peripheral */ | 97 | /* effective for B devices, ignored for A-peripheral */ |
| 95 | int (*set_power)(struct usb_phy *x, | 98 | int (*set_power)(struct usb_phy *x, |
| 96 | unsigned mA); | 99 | unsigned mA); |
| @@ -160,8 +163,26 @@ usb_phy_shutdown(struct usb_phy *x) | |||
| 160 | x->shutdown(x); | 163 | x->shutdown(x); |
| 161 | } | 164 | } |
| 162 | 165 | ||
| 166 | static inline int | ||
| 167 | usb_phy_vbus_on(struct usb_phy *x) | ||
| 168 | { | ||
| 169 | if (!x->set_vbus) | ||
| 170 | return 0; | ||
| 171 | |||
| 172 | return x->set_vbus(x, true); | ||
| 173 | } | ||
| 174 | |||
| 175 | static inline int | ||
| 176 | usb_phy_vbus_off(struct usb_phy *x) | ||
| 177 | { | ||
| 178 | if (!x->set_vbus) | ||
| 179 | return 0; | ||
| 180 | |||
| 181 | return x->set_vbus(x, false); | ||
| 182 | } | ||
| 183 | |||
| 163 | /* for usb host and peripheral controller drivers */ | 184 | /* for usb host and peripheral controller drivers */ |
| 164 | #ifdef CONFIG_USB_OTG_UTILS | 185 | #if IS_ENABLED(CONFIG_USB_PHY) |
| 165 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); | 186 | extern struct usb_phy *usb_get_phy(enum usb_phy_type type); |
| 166 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, | 187 | extern struct usb_phy *devm_usb_get_phy(struct device *dev, |
| 167 | enum usb_phy_type type); | 188 | enum usb_phy_type type); |
| @@ -176,29 +197,29 @@ extern int usb_bind_phy(const char *dev_name, u8 index, | |||
| 176 | #else | 197 | #else |
| 177 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) | 198 | static inline struct usb_phy *usb_get_phy(enum usb_phy_type type) |
| 178 | { | 199 | { |
| 179 | return NULL; | 200 | return ERR_PTR(-ENXIO); |
| 180 | } | 201 | } |
| 181 | 202 | ||
| 182 | static inline struct usb_phy *devm_usb_get_phy(struct device *dev, | 203 | static inline struct usb_phy *devm_usb_get_phy(struct device *dev, |
| 183 | enum usb_phy_type type) | 204 | enum usb_phy_type type) |
| 184 | { | 205 | { |
| 185 | return NULL; | 206 | return ERR_PTR(-ENXIO); |
| 186 | } | 207 | } |
| 187 | 208 | ||
| 188 | static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) | 209 | static inline struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index) |
| 189 | { | 210 | { |
| 190 | return NULL; | 211 | return ERR_PTR(-ENXIO); |
| 191 | } | 212 | } |
| 192 | 213 | ||
| 193 | static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index) | 214 | static inline struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index) |
| 194 | { | 215 | { |
| 195 | return NULL; | 216 | return ERR_PTR(-ENXIO); |
| 196 | } | 217 | } |
| 197 | 218 | ||
| 198 | static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, | 219 | static inline struct usb_phy *devm_usb_get_phy_by_phandle(struct device *dev, |
| 199 | const char *phandle, u8 index) | 220 | const char *phandle, u8 index) |
| 200 | { | 221 | { |
| 201 | return NULL; | 222 | return ERR_PTR(-ENXIO); |
| 202 | } | 223 | } |
| 203 | 224 | ||
| 204 | static inline void usb_put_phy(struct usb_phy *x) | 225 | static inline void usb_put_phy(struct usb_phy *x) |
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h index c5d36c65c33b..e452ba6ec6bd 100644 --- a/include/linux/usb/renesas_usbhs.h +++ b/include/linux/usb/renesas_usbhs.h | |||
| @@ -62,14 +62,14 @@ struct renesas_usbhs_platform_callback { | |||
| 62 | * Hardware exit function for platform. | 62 | * Hardware exit function for platform. |
| 63 | * it is called when driver was removed | 63 | * it is called when driver was removed |
| 64 | */ | 64 | */ |
| 65 | void (*hardware_exit)(struct platform_device *pdev); | 65 | int (*hardware_exit)(struct platform_device *pdev); |
| 66 | 66 | ||
| 67 | /* | 67 | /* |
| 68 | * option: | 68 | * option: |
| 69 | * | 69 | * |
| 70 | * for board specific clock control | 70 | * for board specific clock control |
| 71 | */ | 71 | */ |
| 72 | void (*power_ctrl)(struct platform_device *pdev, | 72 | int (*power_ctrl)(struct platform_device *pdev, |
| 73 | void __iomem *base, int enable); | 73 | void __iomem *base, int enable); |
| 74 | 74 | ||
| 75 | /* | 75 | /* |
| @@ -77,7 +77,7 @@ struct renesas_usbhs_platform_callback { | |||
| 77 | * | 77 | * |
| 78 | * Phy reset for platform | 78 | * Phy reset for platform |
| 79 | */ | 79 | */ |
| 80 | void (*phy_reset)(struct platform_device *pdev); | 80 | int (*phy_reset)(struct platform_device *pdev); |
| 81 | 81 | ||
| 82 | /* | 82 | /* |
| 83 | * get USB ID function | 83 | * get USB ID function |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 1819b59aab2a..b9b0f7b4e43b 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/kref.h> | 16 | #include <linux/kref.h> |
| 17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
| 18 | #include <linux/serial.h> | ||
| 18 | #include <linux/sysrq.h> | 19 | #include <linux/sysrq.h> |
| 19 | #include <linux/kfifo.h> | 20 | #include <linux/kfifo.h> |
| 20 | 21 | ||
| @@ -61,12 +62,12 @@ | |||
| 61 | * @bulk_out_buffers: pointers to the bulk out buffers for this port | 62 | * @bulk_out_buffers: pointers to the bulk out buffers for this port |
| 62 | * @write_urbs: pointers to the bulk out urbs for this port | 63 | * @write_urbs: pointers to the bulk out urbs for this port |
| 63 | * @write_urbs_free: status bitmap the for bulk out urbs | 64 | * @write_urbs_free: status bitmap the for bulk out urbs |
| 65 | * @icount: interrupt counters | ||
| 64 | * @tx_bytes: number of bytes currently in host stack queues | 66 | * @tx_bytes: number of bytes currently in host stack queues |
| 65 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this | 67 | * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this |
| 66 | * port. | 68 | * port. |
| 67 | * @flags: usb serial port flags | 69 | * @flags: usb serial port flags |
| 68 | * @write_wait: a wait_queue_head_t used by the port. | 70 | * @write_wait: a wait_queue_head_t used by the port. |
| 69 | * @delta_msr_wait: modem-status-change wait queue | ||
| 70 | * @work: work queue entry for the line discipline waking up. | 71 | * @work: work queue entry for the line discipline waking up. |
| 71 | * @throttled: nonzero if the read urb is inactive to throttle the device | 72 | * @throttled: nonzero if the read urb is inactive to throttle the device |
| 72 | * @throttle_req: nonzero if the tty wants to throttle us | 73 | * @throttle_req: nonzero if the tty wants to throttle us |
| @@ -109,11 +110,11 @@ struct usb_serial_port { | |||
| 109 | unsigned long write_urbs_free; | 110 | unsigned long write_urbs_free; |
| 110 | __u8 bulk_out_endpointAddress; | 111 | __u8 bulk_out_endpointAddress; |
| 111 | 112 | ||
| 113 | struct async_icount icount; | ||
| 112 | int tx_bytes; | 114 | int tx_bytes; |
| 113 | 115 | ||
| 114 | unsigned long flags; | 116 | unsigned long flags; |
| 115 | wait_queue_head_t write_wait; | 117 | wait_queue_head_t write_wait; |
| 116 | wait_queue_head_t delta_msr_wait; | ||
| 117 | struct work_struct work; | 118 | struct work_struct work; |
| 118 | char throttled; | 119 | char throttled; |
| 119 | char throttle_req; | 120 | char throttle_req; |
| @@ -272,6 +273,7 @@ struct usb_serial_driver { | |||
| 272 | int (*tiocmget)(struct tty_struct *tty); | 273 | int (*tiocmget)(struct tty_struct *tty); |
| 273 | int (*tiocmset)(struct tty_struct *tty, | 274 | int (*tiocmset)(struct tty_struct *tty, |
| 274 | unsigned int set, unsigned int clear); | 275 | unsigned int set, unsigned int clear); |
| 276 | int (*tiocmiwait)(struct tty_struct *tty, unsigned long arg); | ||
| 275 | int (*get_icount)(struct tty_struct *tty, | 277 | int (*get_icount)(struct tty_struct *tty, |
| 276 | struct serial_icounter_struct *icount); | 278 | struct serial_icounter_struct *icount); |
| 277 | /* Called by the tty layer for port level work. There may or may not | 279 | /* Called by the tty layer for port level work. There may or may not |
| @@ -329,8 +331,10 @@ extern void usb_serial_generic_read_bulk_callback(struct urb *urb); | |||
| 329 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); | 331 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); |
| 330 | extern void usb_serial_generic_throttle(struct tty_struct *tty); | 332 | extern void usb_serial_generic_throttle(struct tty_struct *tty); |
| 331 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); | 333 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); |
| 332 | extern void usb_serial_generic_disconnect(struct usb_serial *serial); | 334 | extern int usb_serial_generic_tiocmiwait(struct tty_struct *tty, |
| 333 | extern void usb_serial_generic_release(struct usb_serial *serial); | 335 | unsigned long arg); |
| 336 | extern int usb_serial_generic_get_icount(struct tty_struct *tty, | ||
| 337 | struct serial_icounter_struct *icount); | ||
| 334 | extern int usb_serial_generic_register(void); | 338 | extern int usb_serial_generic_register(void); |
| 335 | extern void usb_serial_generic_deregister(void); | 339 | extern void usb_serial_generic_deregister(void); |
| 336 | extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, | 340 | extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, |
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h index 9ebebe906925..1b7519a8c0bf 100644 --- a/include/linux/usb/tegra_usb_phy.h +++ b/include/linux/usb/tegra_usb_phy.h | |||
| @@ -61,10 +61,14 @@ struct tegra_usb_phy { | |||
| 61 | struct device *dev; | 61 | struct device *dev; |
| 62 | bool is_legacy_phy; | 62 | bool is_legacy_phy; |
| 63 | bool is_ulpi_phy; | 63 | bool is_ulpi_phy; |
| 64 | void (*set_pts)(struct usb_phy *x, u8 pts_val); | ||
| 65 | void (*set_phcd)(struct usb_phy *x, bool enable); | ||
| 64 | }; | 66 | }; |
| 65 | 67 | ||
| 66 | struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, | 68 | struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, |
| 67 | void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode); | 69 | void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode, |
| 70 | void (*set_pts)(struct usb_phy *x, u8 pts_val), | ||
| 71 | void (*set_phcd)(struct usb_phy *x, bool enable)); | ||
| 68 | 72 | ||
| 69 | void tegra_usb_phy_preresume(struct usb_phy *phy); | 73 | void tegra_usb_phy_preresume(struct usb_phy *phy); |
| 70 | 74 | ||
| @@ -75,8 +79,4 @@ void tegra_ehci_phy_restore_start(struct usb_phy *phy, | |||
| 75 | 79 | ||
| 76 | void tegra_ehci_phy_restore_end(struct usb_phy *phy); | 80 | void tegra_ehci_phy_restore_end(struct usb_phy *phy); |
| 77 | 81 | ||
| 78 | void tegra_ehci_set_pts(struct usb_phy *x, u8 pts_val); | ||
| 79 | |||
| 80 | void tegra_ehci_set_phcd(struct usb_phy *x, bool enable); | ||
| 81 | |||
| 82 | #endif /* __TEGRA_USB_PHY_H */ | 82 | #endif /* __TEGRA_USB_PHY_H */ |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 6071e911c7f4..7d5773a99f20 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
| @@ -3,7 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
| 5 | #include <linux/init.h> | 5 | #include <linux/init.h> |
| 6 | #include <linux/list.h> | ||
| 6 | #include <asm/page.h> /* pgprot_t */ | 7 | #include <asm/page.h> /* pgprot_t */ |
| 8 | #include <linux/rbtree.h> | ||
| 7 | 9 | ||
| 8 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | 10 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ |
| 9 | 11 | ||
| @@ -35,6 +37,17 @@ struct vm_struct { | |||
| 35 | const void *caller; | 37 | const void *caller; |
| 36 | }; | 38 | }; |
| 37 | 39 | ||
| 40 | struct vmap_area { | ||
| 41 | unsigned long va_start; | ||
| 42 | unsigned long va_end; | ||
| 43 | unsigned long flags; | ||
| 44 | struct rb_node rb_node; /* address sorted rbtree */ | ||
| 45 | struct list_head list; /* address sorted list */ | ||
| 46 | struct list_head purge_list; /* "lazy purge" list */ | ||
| 47 | struct vm_struct *vm; | ||
| 48 | struct rcu_head rcu_head; | ||
| 49 | }; | ||
| 50 | |||
| 38 | /* | 51 | /* |
| 39 | * Highlevel APIs for driver use | 52 | * Highlevel APIs for driver use |
| 40 | */ | 53 | */ |
| @@ -130,8 +143,7 @@ extern long vwrite(char *buf, char *addr, unsigned long count); | |||
| 130 | /* | 143 | /* |
| 131 | * Internals. Dont't use.. | 144 | * Internals. Dont't use.. |
| 132 | */ | 145 | */ |
| 133 | extern rwlock_t vmlist_lock; | 146 | extern struct list_head vmap_area_list; |
| 134 | extern struct vm_struct *vmlist; | ||
| 135 | extern __init void vm_area_add_early(struct vm_struct *vm); | 147 | extern __init void vm_area_add_early(struct vm_struct *vm); |
| 136 | extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); | 148 | extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); |
| 137 | 149 | ||
| @@ -158,4 +170,22 @@ pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms) | |||
| 158 | # endif | 170 | # endif |
| 159 | #endif | 171 | #endif |
| 160 | 172 | ||
| 173 | struct vmalloc_info { | ||
| 174 | unsigned long used; | ||
| 175 | unsigned long largest_chunk; | ||
| 176 | }; | ||
| 177 | |||
| 178 | #ifdef CONFIG_MMU | ||
| 179 | #define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START) | ||
| 180 | extern void get_vmalloc_info(struct vmalloc_info *vmi); | ||
| 181 | #else | ||
| 182 | |||
| 183 | #define VMALLOC_TOTAL 0UL | ||
| 184 | #define get_vmalloc_info(vmi) \ | ||
| 185 | do { \ | ||
| 186 | (vmi)->used = 0; \ | ||
| 187 | (vmi)->largest_chunk = 0; \ | ||
| 188 | } while (0) | ||
| 189 | #endif | ||
| 190 | |||
| 161 | #endif /* _LINUX_VMALLOC_H */ | 191 | #endif /* _LINUX_VMALLOC_H */ |
diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h new file mode 100644 index 000000000000..76be077340ea --- /dev/null +++ b/include/linux/vmpressure.h | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | #ifndef __LINUX_VMPRESSURE_H | ||
| 2 | #define __LINUX_VMPRESSURE_H | ||
| 3 | |||
| 4 | #include <linux/mutex.h> | ||
| 5 | #include <linux/list.h> | ||
| 6 | #include <linux/workqueue.h> | ||
| 7 | #include <linux/gfp.h> | ||
| 8 | #include <linux/types.h> | ||
| 9 | #include <linux/cgroup.h> | ||
| 10 | |||
| 11 | struct vmpressure { | ||
| 12 | unsigned long scanned; | ||
| 13 | unsigned long reclaimed; | ||
| 14 | /* The lock is used to keep the scanned/reclaimed above in sync. */ | ||
| 15 | struct mutex sr_lock; | ||
| 16 | |||
| 17 | /* The list of vmpressure_event structs. */ | ||
| 18 | struct list_head events; | ||
| 19 | /* Have to grab the lock on events traversal or modifications. */ | ||
| 20 | struct mutex events_lock; | ||
| 21 | |||
| 22 | struct work_struct work; | ||
| 23 | }; | ||
| 24 | |||
| 25 | struct mem_cgroup; | ||
| 26 | |||
| 27 | #ifdef CONFIG_MEMCG | ||
| 28 | extern void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, | ||
| 29 | unsigned long scanned, unsigned long reclaimed); | ||
| 30 | extern void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, int prio); | ||
| 31 | |||
| 32 | extern void vmpressure_init(struct vmpressure *vmpr); | ||
| 33 | extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); | ||
| 34 | extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); | ||
| 35 | extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); | ||
| 36 | extern int vmpressure_register_event(struct cgroup *cg, struct cftype *cft, | ||
| 37 | struct eventfd_ctx *eventfd, | ||
| 38 | const char *args); | ||
| 39 | extern void vmpressure_unregister_event(struct cgroup *cg, struct cftype *cft, | ||
| 40 | struct eventfd_ctx *eventfd); | ||
| 41 | #else | ||
| 42 | static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, | ||
| 43 | unsigned long scanned, unsigned long reclaimed) {} | ||
| 44 | static inline void vmpressure_prio(gfp_t gfp, struct mem_cgroup *memcg, | ||
| 45 | int prio) {} | ||
| 46 | #endif /* CONFIG_MEMCG */ | ||
| 47 | #endif /* __LINUX_VMPRESSURE_H */ | ||
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 5fd71a7d0dfd..c586679b6fef 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
| @@ -48,13 +48,8 @@ static inline void count_vm_events(enum vm_event_item item, long delta) | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | extern void all_vm_events(unsigned long *); | 50 | extern void all_vm_events(unsigned long *); |
| 51 | #ifdef CONFIG_HOTPLUG | 51 | |
| 52 | extern void vm_events_fold_cpu(int cpu); | 52 | extern void vm_events_fold_cpu(int cpu); |
| 53 | #else | ||
| 54 | static inline void vm_events_fold_cpu(int cpu) | ||
| 55 | { | ||
| 56 | } | ||
| 57 | #endif | ||
| 58 | 53 | ||
| 59 | #else | 54 | #else |
| 60 | 55 | ||
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 8afab27cdbc2..717975639378 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/lockdep.h> | 11 | #include <linux/lockdep.h> |
| 12 | #include <linux/threads.h> | 12 | #include <linux/threads.h> |
| 13 | #include <linux/atomic.h> | 13 | #include <linux/atomic.h> |
| 14 | #include <linux/cpumask.h> | ||
| 14 | 15 | ||
| 15 | struct workqueue_struct; | 16 | struct workqueue_struct; |
| 16 | 17 | ||
| @@ -68,7 +69,7 @@ enum { | |||
| 68 | WORK_STRUCT_COLOR_BITS, | 69 | WORK_STRUCT_COLOR_BITS, |
| 69 | 70 | ||
| 70 | /* data contains off-queue information when !WORK_STRUCT_PWQ */ | 71 | /* data contains off-queue information when !WORK_STRUCT_PWQ */ |
| 71 | WORK_OFFQ_FLAG_BASE = WORK_STRUCT_FLAG_BITS, | 72 | WORK_OFFQ_FLAG_BASE = WORK_STRUCT_COLOR_SHIFT, |
| 72 | 73 | ||
| 73 | WORK_OFFQ_CANCELING = (1 << WORK_OFFQ_FLAG_BASE), | 74 | WORK_OFFQ_CANCELING = (1 << WORK_OFFQ_FLAG_BASE), |
| 74 | 75 | ||
| @@ -115,6 +116,20 @@ struct delayed_work { | |||
| 115 | int cpu; | 116 | int cpu; |
| 116 | }; | 117 | }; |
| 117 | 118 | ||
| 119 | /* | ||
| 120 | * A struct for workqueue attributes. This can be used to change | ||
| 121 | * attributes of an unbound workqueue. | ||
| 122 | * | ||
| 123 | * Unlike other fields, ->no_numa isn't a property of a worker_pool. It | ||
| 124 | * only modifies how apply_workqueue_attrs() select pools and thus doesn't | ||
| 125 | * participate in pool hash calculations or equality comparisons. | ||
| 126 | */ | ||
| 127 | struct workqueue_attrs { | ||
| 128 | int nice; /* nice level */ | ||
| 129 | cpumask_var_t cpumask; /* allowed CPUs */ | ||
| 130 | bool no_numa; /* disable NUMA affinity */ | ||
| 131 | }; | ||
| 132 | |||
| 118 | static inline struct delayed_work *to_delayed_work(struct work_struct *work) | 133 | static inline struct delayed_work *to_delayed_work(struct work_struct *work) |
| 119 | { | 134 | { |
| 120 | return container_of(work, struct delayed_work, work); | 135 | return container_of(work, struct delayed_work, work); |
| @@ -283,9 +298,10 @@ enum { | |||
| 283 | WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ | 298 | WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ |
| 284 | WQ_HIGHPRI = 1 << 4, /* high priority */ | 299 | WQ_HIGHPRI = 1 << 4, /* high priority */ |
| 285 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ | 300 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ |
| 301 | WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ | ||
| 286 | 302 | ||
| 287 | WQ_DRAINING = 1 << 6, /* internal: workqueue is draining */ | 303 | __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ |
| 288 | WQ_RESCUER = 1 << 7, /* internal: workqueue has rescuer */ | 304 | __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ |
| 289 | 305 | ||
| 290 | WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ | 306 | WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ |
| 291 | WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */ | 307 | WQ_MAX_UNBOUND_PER_CPU = 4, /* 4 * #cpus for unbound wq */ |
| @@ -388,7 +404,7 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, | |||
| 388 | * Pointer to the allocated workqueue on success, %NULL on failure. | 404 | * Pointer to the allocated workqueue on success, %NULL on failure. |
| 389 | */ | 405 | */ |
| 390 | #define alloc_ordered_workqueue(fmt, flags, args...) \ | 406 | #define alloc_ordered_workqueue(fmt, flags, args...) \ |
| 391 | alloc_workqueue(fmt, WQ_UNBOUND | (flags), 1, ##args) | 407 | alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | (flags), 1, ##args) |
| 392 | 408 | ||
| 393 | #define create_workqueue(name) \ | 409 | #define create_workqueue(name) \ |
| 394 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) | 410 | alloc_workqueue((name), WQ_MEM_RECLAIM, 1) |
| @@ -399,30 +415,23 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active, | |||
| 399 | 415 | ||
| 400 | extern void destroy_workqueue(struct workqueue_struct *wq); | 416 | extern void destroy_workqueue(struct workqueue_struct *wq); |
| 401 | 417 | ||
| 418 | struct workqueue_attrs *alloc_workqueue_attrs(gfp_t gfp_mask); | ||
| 419 | void free_workqueue_attrs(struct workqueue_attrs *attrs); | ||
| 420 | int apply_workqueue_attrs(struct workqueue_struct *wq, | ||
| 421 | const struct workqueue_attrs *attrs); | ||
| 422 | |||
| 402 | extern bool queue_work_on(int cpu, struct workqueue_struct *wq, | 423 | extern bool queue_work_on(int cpu, struct workqueue_struct *wq, |
| 403 | struct work_struct *work); | 424 | struct work_struct *work); |
| 404 | extern bool queue_work(struct workqueue_struct *wq, struct work_struct *work); | ||
| 405 | extern bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | 425 | extern bool queue_delayed_work_on(int cpu, struct workqueue_struct *wq, |
| 406 | struct delayed_work *work, unsigned long delay); | 426 | struct delayed_work *work, unsigned long delay); |
| 407 | extern bool queue_delayed_work(struct workqueue_struct *wq, | ||
| 408 | struct delayed_work *work, unsigned long delay); | ||
| 409 | extern bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq, | 427 | extern bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq, |
| 410 | struct delayed_work *dwork, unsigned long delay); | 428 | struct delayed_work *dwork, unsigned long delay); |
| 411 | extern bool mod_delayed_work(struct workqueue_struct *wq, | ||
| 412 | struct delayed_work *dwork, unsigned long delay); | ||
| 413 | 429 | ||
| 414 | extern void flush_workqueue(struct workqueue_struct *wq); | 430 | extern void flush_workqueue(struct workqueue_struct *wq); |
| 415 | extern void drain_workqueue(struct workqueue_struct *wq); | 431 | extern void drain_workqueue(struct workqueue_struct *wq); |
| 416 | extern void flush_scheduled_work(void); | 432 | extern void flush_scheduled_work(void); |
| 417 | 433 | ||
| 418 | extern bool schedule_work_on(int cpu, struct work_struct *work); | ||
| 419 | extern bool schedule_work(struct work_struct *work); | ||
| 420 | extern bool schedule_delayed_work_on(int cpu, struct delayed_work *work, | ||
| 421 | unsigned long delay); | ||
| 422 | extern bool schedule_delayed_work(struct delayed_work *work, | ||
| 423 | unsigned long delay); | ||
| 424 | extern int schedule_on_each_cpu(work_func_t func); | 434 | extern int schedule_on_each_cpu(work_func_t func); |
| 425 | extern int keventd_up(void); | ||
| 426 | 435 | ||
| 427 | int execute_in_process_context(work_func_t fn, struct execute_work *); | 436 | int execute_in_process_context(work_func_t fn, struct execute_work *); |
| 428 | 437 | ||
| @@ -435,9 +444,121 @@ extern bool cancel_delayed_work_sync(struct delayed_work *dwork); | |||
| 435 | 444 | ||
| 436 | extern void workqueue_set_max_active(struct workqueue_struct *wq, | 445 | extern void workqueue_set_max_active(struct workqueue_struct *wq, |
| 437 | int max_active); | 446 | int max_active); |
| 438 | extern bool workqueue_congested(unsigned int cpu, struct workqueue_struct *wq); | 447 | extern bool current_is_workqueue_rescuer(void); |
| 448 | extern bool workqueue_congested(int cpu, struct workqueue_struct *wq); | ||
| 439 | extern unsigned int work_busy(struct work_struct *work); | 449 | extern unsigned int work_busy(struct work_struct *work); |
| 440 | 450 | ||
| 451 | /** | ||
| 452 | * queue_work - queue work on a workqueue | ||
| 453 | * @wq: workqueue to use | ||
| 454 | * @work: work to queue | ||
| 455 | * | ||
| 456 | * Returns %false if @work was already on a queue, %true otherwise. | ||
| 457 | * | ||
| 458 | * We queue the work to the CPU on which it was submitted, but if the CPU dies | ||
| 459 | * it can be processed by another CPU. | ||
| 460 | */ | ||
| 461 | static inline bool queue_work(struct workqueue_struct *wq, | ||
| 462 | struct work_struct *work) | ||
| 463 | { | ||
| 464 | return queue_work_on(WORK_CPU_UNBOUND, wq, work); | ||
| 465 | } | ||
| 466 | |||
| 467 | /** | ||
| 468 | * queue_delayed_work - queue work on a workqueue after delay | ||
| 469 | * @wq: workqueue to use | ||
| 470 | * @dwork: delayable work to queue | ||
| 471 | * @delay: number of jiffies to wait before queueing | ||
| 472 | * | ||
| 473 | * Equivalent to queue_delayed_work_on() but tries to use the local CPU. | ||
| 474 | */ | ||
| 475 | static inline bool queue_delayed_work(struct workqueue_struct *wq, | ||
| 476 | struct delayed_work *dwork, | ||
| 477 | unsigned long delay) | ||
| 478 | { | ||
| 479 | return queue_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay); | ||
| 480 | } | ||
| 481 | |||
| 482 | /** | ||
| 483 | * mod_delayed_work - modify delay of or queue a delayed work | ||
| 484 | * @wq: workqueue to use | ||
| 485 | * @dwork: work to queue | ||
| 486 | * @delay: number of jiffies to wait before queueing | ||
| 487 | * | ||
| 488 | * mod_delayed_work_on() on local CPU. | ||
| 489 | */ | ||
| 490 | static inline bool mod_delayed_work(struct workqueue_struct *wq, | ||
| 491 | struct delayed_work *dwork, | ||
| 492 | unsigned long delay) | ||
| 493 | { | ||
| 494 | return mod_delayed_work_on(WORK_CPU_UNBOUND, wq, dwork, delay); | ||
| 495 | } | ||
| 496 | |||
| 497 | /** | ||
| 498 | * schedule_work_on - put work task on a specific cpu | ||
| 499 | * @cpu: cpu to put the work task on | ||
| 500 | * @work: job to be done | ||
| 501 | * | ||
| 502 | * This puts a job on a specific cpu | ||
| 503 | */ | ||
| 504 | static inline bool schedule_work_on(int cpu, struct work_struct *work) | ||
| 505 | { | ||
| 506 | return queue_work_on(cpu, system_wq, work); | ||
| 507 | } | ||
| 508 | |||
| 509 | /** | ||
| 510 | * schedule_work - put work task in global workqueue | ||
| 511 | * @work: job to be done | ||
| 512 | * | ||
| 513 | * Returns %false if @work was already on the kernel-global workqueue and | ||
| 514 | * %true otherwise. | ||
| 515 | * | ||
| 516 | * This puts a job in the kernel-global workqueue if it was not already | ||
| 517 | * queued and leaves it in the same position on the kernel-global | ||
| 518 | * workqueue otherwise. | ||
| 519 | */ | ||
| 520 | static inline bool schedule_work(struct work_struct *work) | ||
| 521 | { | ||
| 522 | return queue_work(system_wq, work); | ||
| 523 | } | ||
| 524 | |||
| 525 | /** | ||
| 526 | * schedule_delayed_work_on - queue work in global workqueue on CPU after delay | ||
| 527 | * @cpu: cpu to use | ||
| 528 | * @dwork: job to be done | ||
| 529 | * @delay: number of jiffies to wait | ||
| 530 | * | ||
| 531 | * After waiting for a given time this puts a job in the kernel-global | ||
| 532 | * workqueue on the specified CPU. | ||
| 533 | */ | ||
| 534 | static inline bool schedule_delayed_work_on(int cpu, struct delayed_work *dwork, | ||
| 535 | unsigned long delay) | ||
| 536 | { | ||
| 537 | return queue_delayed_work_on(cpu, system_wq, dwork, delay); | ||
| 538 | } | ||
| 539 | |||
| 540 | /** | ||
| 541 | * schedule_delayed_work - put work task in global workqueue after delay | ||
| 542 | * @dwork: job to be done | ||
| 543 | * @delay: number of jiffies to wait or 0 for immediate execution | ||
| 544 | * | ||
| 545 | * After waiting for a given time this puts a job in the kernel-global | ||
| 546 | * workqueue. | ||
| 547 | */ | ||
| 548 | static inline bool schedule_delayed_work(struct delayed_work *dwork, | ||
| 549 | unsigned long delay) | ||
| 550 | { | ||
| 551 | return queue_delayed_work(system_wq, dwork, delay); | ||
| 552 | } | ||
| 553 | |||
| 554 | /** | ||
| 555 | * keventd_up - is workqueue initialized yet? | ||
| 556 | */ | ||
| 557 | static inline bool keventd_up(void) | ||
| 558 | { | ||
| 559 | return system_wq != NULL; | ||
| 560 | } | ||
| 561 | |||
| 441 | /* | 562 | /* |
| 442 | * Like above, but uses del_timer() instead of del_timer_sync(). This means, | 563 | * Like above, but uses del_timer() instead of del_timer_sync(). This means, |
| 443 | * if it returns 0 the timer function may be running and the queueing is in | 564 | * if it returns 0 the timer function may be running and the queueing is in |
| @@ -466,12 +587,12 @@ static inline bool __deprecated flush_delayed_work_sync(struct delayed_work *dwo | |||
| 466 | } | 587 | } |
| 467 | 588 | ||
| 468 | #ifndef CONFIG_SMP | 589 | #ifndef CONFIG_SMP |
| 469 | static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) | 590 | static inline long work_on_cpu(int cpu, long (*fn)(void *), void *arg) |
| 470 | { | 591 | { |
| 471 | return fn(arg); | 592 | return fn(arg); |
| 472 | } | 593 | } |
| 473 | #else | 594 | #else |
| 474 | long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg); | 595 | long work_on_cpu(int cpu, long (*fn)(void *), void *arg); |
| 475 | #endif /* CONFIG_SMP */ | 596 | #endif /* CONFIG_SMP */ |
| 476 | 597 | ||
| 477 | #ifdef CONFIG_FREEZER | 598 | #ifdef CONFIG_FREEZER |
| @@ -480,4 +601,11 @@ extern bool freeze_workqueues_busy(void); | |||
| 480 | extern void thaw_workqueues(void); | 601 | extern void thaw_workqueues(void); |
| 481 | #endif /* CONFIG_FREEZER */ | 602 | #endif /* CONFIG_FREEZER */ |
| 482 | 603 | ||
| 604 | #ifdef CONFIG_SYSFS | ||
| 605 | int workqueue_sysfs_register(struct workqueue_struct *wq); | ||
| 606 | #else /* CONFIG_SYSFS */ | ||
| 607 | static inline int workqueue_sysfs_register(struct workqueue_struct *wq) | ||
| 608 | { return 0; } | ||
| 609 | #endif /* CONFIG_SYSFS */ | ||
| 610 | |||
| 483 | #endif | 611 | #endif |
