diff options
Diffstat (limited to 'include/linux')
55 files changed, 800 insertions, 307 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index b0972c4ce81c..d9099b15b472 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -44,6 +44,20 @@ | |||
| 44 | #include <acpi/acpi_numa.h> | 44 | #include <acpi/acpi_numa.h> |
| 45 | #include <asm/acpi.h> | 45 | #include <asm/acpi.h> |
| 46 | 46 | ||
| 47 | static inline acpi_handle acpi_device_handle(struct acpi_device *adev) | ||
| 48 | { | ||
| 49 | return adev ? adev->handle : NULL; | ||
| 50 | } | ||
| 51 | |||
| 52 | #define ACPI_COMPANION(dev) ((dev)->acpi_node.companion) | ||
| 53 | #define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev) | ||
| 54 | #define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) | ||
| 55 | |||
| 56 | static inline const char *acpi_dev_name(struct acpi_device *adev) | ||
| 57 | { | ||
| 58 | return dev_name(&adev->dev); | ||
| 59 | } | ||
| 60 | |||
| 47 | enum acpi_irq_model_id { | 61 | enum acpi_irq_model_id { |
| 48 | ACPI_IRQ_MODEL_PIC = 0, | 62 | ACPI_IRQ_MODEL_PIC = 0, |
| 49 | ACPI_IRQ_MODEL_IOAPIC, | 63 | ACPI_IRQ_MODEL_IOAPIC, |
| @@ -401,6 +415,15 @@ static inline bool acpi_driver_match_device(struct device *dev, | |||
| 401 | 415 | ||
| 402 | #define acpi_disabled 1 | 416 | #define acpi_disabled 1 |
| 403 | 417 | ||
| 418 | #define ACPI_COMPANION(dev) (NULL) | ||
| 419 | #define ACPI_COMPANION_SET(dev, adev) do { } while (0) | ||
| 420 | #define ACPI_HANDLE(dev) (NULL) | ||
| 421 | |||
| 422 | static inline const char *acpi_dev_name(struct acpi_device *adev) | ||
| 423 | { | ||
| 424 | return NULL; | ||
| 425 | } | ||
| 426 | |||
| 404 | static inline void acpi_early_init(void) { } | 427 | static inline void acpi_early_init(void) { } |
| 405 | 428 | ||
| 406 | static inline int early_acpi_boot_init(void) | 429 | static inline int early_acpi_boot_init(void) |
diff --git a/include/linux/assoc_array.h b/include/linux/assoc_array.h new file mode 100644 index 000000000000..a89df3be1686 --- /dev/null +++ b/include/linux/assoc_array.h | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | /* Generic associative array implementation. | ||
| 2 | * | ||
| 3 | * See Documentation/assoc_array.txt for information. | ||
| 4 | * | ||
| 5 | * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved. | ||
| 6 | * Written by David Howells (dhowells@redhat.com) | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public Licence | ||
| 10 | * as published by the Free Software Foundation; either version | ||
| 11 | * 2 of the Licence, or (at your option) any later version. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _LINUX_ASSOC_ARRAY_H | ||
| 15 | #define _LINUX_ASSOC_ARRAY_H | ||
| 16 | |||
| 17 | #ifdef CONFIG_ASSOCIATIVE_ARRAY | ||
| 18 | |||
| 19 | #include <linux/types.h> | ||
| 20 | |||
| 21 | #define ASSOC_ARRAY_KEY_CHUNK_SIZE BITS_PER_LONG /* Key data retrieved in chunks of this size */ | ||
| 22 | |||
| 23 | /* | ||
| 24 | * Generic associative array. | ||
| 25 | */ | ||
| 26 | struct assoc_array { | ||
| 27 | struct assoc_array_ptr *root; /* The node at the root of the tree */ | ||
| 28 | unsigned long nr_leaves_on_tree; | ||
| 29 | }; | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Operations on objects and index keys for use by array manipulation routines. | ||
| 33 | */ | ||
| 34 | struct assoc_array_ops { | ||
| 35 | /* Method to get a chunk of an index key from caller-supplied data */ | ||
| 36 | unsigned long (*get_key_chunk)(const void *index_key, int level); | ||
| 37 | |||
| 38 | /* Method to get a piece of an object's index key */ | ||
| 39 | unsigned long (*get_object_key_chunk)(const void *object, int level); | ||
| 40 | |||
| 41 | /* Is this the object we're looking for? */ | ||
| 42 | bool (*compare_object)(const void *object, const void *index_key); | ||
| 43 | |||
| 44 | /* How different is an object from an index key, to a bit position in | ||
| 45 | * their keys? (or -1 if they're the same) | ||
| 46 | */ | ||
| 47 | int (*diff_objects)(const void *object, const void *index_key); | ||
| 48 | |||
| 49 | /* Method to free an object. */ | ||
| 50 | void (*free_object)(void *object); | ||
| 51 | }; | ||
| 52 | |||
| 53 | /* | ||
| 54 | * Access and manipulation functions. | ||
| 55 | */ | ||
| 56 | struct assoc_array_edit; | ||
| 57 | |||
| 58 | static inline void assoc_array_init(struct assoc_array *array) | ||
| 59 | { | ||
| 60 | array->root = NULL; | ||
| 61 | array->nr_leaves_on_tree = 0; | ||
| 62 | } | ||
| 63 | |||
| 64 | extern int assoc_array_iterate(const struct assoc_array *array, | ||
| 65 | int (*iterator)(const void *object, | ||
| 66 | void *iterator_data), | ||
| 67 | void *iterator_data); | ||
| 68 | extern void *assoc_array_find(const struct assoc_array *array, | ||
| 69 | const struct assoc_array_ops *ops, | ||
| 70 | const void *index_key); | ||
| 71 | extern void assoc_array_destroy(struct assoc_array *array, | ||
| 72 | const struct assoc_array_ops *ops); | ||
| 73 | extern struct assoc_array_edit *assoc_array_insert(struct assoc_array *array, | ||
| 74 | const struct assoc_array_ops *ops, | ||
| 75 | const void *index_key, | ||
| 76 | void *object); | ||
| 77 | extern void assoc_array_insert_set_object(struct assoc_array_edit *edit, | ||
| 78 | void *object); | ||
| 79 | extern struct assoc_array_edit *assoc_array_delete(struct assoc_array *array, | ||
| 80 | const struct assoc_array_ops *ops, | ||
| 81 | const void *index_key); | ||
| 82 | extern struct assoc_array_edit *assoc_array_clear(struct assoc_array *array, | ||
| 83 | const struct assoc_array_ops *ops); | ||
| 84 | extern void assoc_array_apply_edit(struct assoc_array_edit *edit); | ||
| 85 | extern void assoc_array_cancel_edit(struct assoc_array_edit *edit); | ||
| 86 | extern int assoc_array_gc(struct assoc_array *array, | ||
| 87 | const struct assoc_array_ops *ops, | ||
| 88 | bool (*iterator)(void *object, void *iterator_data), | ||
| 89 | void *iterator_data); | ||
| 90 | |||
| 91 | #endif /* CONFIG_ASSOCIATIVE_ARRAY */ | ||
| 92 | #endif /* _LINUX_ASSOC_ARRAY_H */ | ||
diff --git a/include/linux/assoc_array_priv.h b/include/linux/assoc_array_priv.h new file mode 100644 index 000000000000..711275e6681c --- /dev/null +++ b/include/linux/assoc_array_priv.h | |||
| @@ -0,0 +1,182 @@ | |||
| 1 | /* Private definitions for the generic associative array implementation. | ||
| 2 | * | ||
| 3 | * See Documentation/assoc_array.txt for information. | ||
| 4 | * | ||
| 5 | * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved. | ||
| 6 | * Written by David Howells (dhowells@redhat.com) | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public Licence | ||
| 10 | * as published by the Free Software Foundation; either version | ||
| 11 | * 2 of the Licence, or (at your option) any later version. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _LINUX_ASSOC_ARRAY_PRIV_H | ||
| 15 | #define _LINUX_ASSOC_ARRAY_PRIV_H | ||
| 16 | |||
| 17 | #ifdef CONFIG_ASSOCIATIVE_ARRAY | ||
| 18 | |||
| 19 | #include <linux/assoc_array.h> | ||
| 20 | |||
| 21 | #define ASSOC_ARRAY_FAN_OUT 16 /* Number of slots per node */ | ||
| 22 | #define ASSOC_ARRAY_FAN_MASK (ASSOC_ARRAY_FAN_OUT - 1) | ||
| 23 | #define ASSOC_ARRAY_LEVEL_STEP (ilog2(ASSOC_ARRAY_FAN_OUT)) | ||
| 24 | #define ASSOC_ARRAY_LEVEL_STEP_MASK (ASSOC_ARRAY_LEVEL_STEP - 1) | ||
| 25 | #define ASSOC_ARRAY_KEY_CHUNK_MASK (ASSOC_ARRAY_KEY_CHUNK_SIZE - 1) | ||
| 26 | #define ASSOC_ARRAY_KEY_CHUNK_SHIFT (ilog2(BITS_PER_LONG)) | ||
| 27 | |||
| 28 | /* | ||
| 29 | * Undefined type representing a pointer with type information in the bottom | ||
| 30 | * two bits. | ||
| 31 | */ | ||
| 32 | struct assoc_array_ptr; | ||
| 33 | |||
| 34 | /* | ||
| 35 | * An N-way node in the tree. | ||
| 36 | * | ||
| 37 | * Each slot contains one of four things: | ||
| 38 | * | ||
| 39 | * (1) Nothing (NULL). | ||
| 40 | * | ||
| 41 | * (2) A leaf object (pointer types 0). | ||
| 42 | * | ||
| 43 | * (3) A next-level node (pointer type 1, subtype 0). | ||
| 44 | * | ||
| 45 | * (4) A shortcut (pointer type 1, subtype 1). | ||
| 46 | * | ||
| 47 | * The tree is optimised for search-by-ID, but permits reasonable iteration | ||
| 48 | * also. | ||
| 49 | * | ||
| 50 | * The tree is navigated by constructing an index key consisting of an array of | ||
| 51 | * segments, where each segment is ilog2(ASSOC_ARRAY_FAN_OUT) bits in size. | ||
| 52 | * | ||
| 53 | * The segments correspond to levels of the tree (the first segment is used at | ||
| 54 | * level 0, the second at level 1, etc.). | ||
| 55 | */ | ||
| 56 | struct assoc_array_node { | ||
| 57 | struct assoc_array_ptr *back_pointer; | ||
| 58 | u8 parent_slot; | ||
| 59 | struct assoc_array_ptr *slots[ASSOC_ARRAY_FAN_OUT]; | ||
| 60 | unsigned long nr_leaves_on_branch; | ||
| 61 | }; | ||
| 62 | |||
| 63 | /* | ||
| 64 | * A shortcut through the index space out to where a collection of nodes/leaves | ||
| 65 | * with the same IDs live. | ||
| 66 | */ | ||
| 67 | struct assoc_array_shortcut { | ||
| 68 | struct assoc_array_ptr *back_pointer; | ||
| 69 | int parent_slot; | ||
| 70 | int skip_to_level; | ||
| 71 | struct assoc_array_ptr *next_node; | ||
| 72 | unsigned long index_key[]; | ||
| 73 | }; | ||
| 74 | |||
| 75 | /* | ||
| 76 | * Preallocation cache. | ||
| 77 | */ | ||
| 78 | struct assoc_array_edit { | ||
| 79 | struct rcu_head rcu; | ||
| 80 | struct assoc_array *array; | ||
| 81 | const struct assoc_array_ops *ops; | ||
| 82 | const struct assoc_array_ops *ops_for_excised_subtree; | ||
| 83 | struct assoc_array_ptr *leaf; | ||
| 84 | struct assoc_array_ptr **leaf_p; | ||
| 85 | struct assoc_array_ptr *dead_leaf; | ||
| 86 | struct assoc_array_ptr *new_meta[3]; | ||
| 87 | struct assoc_array_ptr *excised_meta[1]; | ||
| 88 | struct assoc_array_ptr *excised_subtree; | ||
| 89 | struct assoc_array_ptr **set_backpointers[ASSOC_ARRAY_FAN_OUT]; | ||
| 90 | struct assoc_array_ptr *set_backpointers_to; | ||
| 91 | struct assoc_array_node *adjust_count_on; | ||
| 92 | long adjust_count_by; | ||
| 93 | struct { | ||
| 94 | struct assoc_array_ptr **ptr; | ||
| 95 | struct assoc_array_ptr *to; | ||
| 96 | } set[2]; | ||
| 97 | struct { | ||
| 98 | u8 *p; | ||
| 99 | u8 to; | ||
| 100 | } set_parent_slot[1]; | ||
| 101 | u8 segment_cache[ASSOC_ARRAY_FAN_OUT + 1]; | ||
| 102 | }; | ||
| 103 | |||
| 104 | /* | ||
| 105 | * Internal tree member pointers are marked in the bottom one or two bits to | ||
| 106 | * indicate what type they are so that we don't have to look behind every | ||
| 107 | * pointer to see what it points to. | ||
| 108 | * | ||
| 109 | * We provide functions to test type annotations and to create and translate | ||
| 110 | * the annotated pointers. | ||
| 111 | */ | ||
| 112 | #define ASSOC_ARRAY_PTR_TYPE_MASK 0x1UL | ||
| 113 | #define ASSOC_ARRAY_PTR_LEAF_TYPE 0x0UL /* Points to leaf (or nowhere) */ | ||
| 114 | #define ASSOC_ARRAY_PTR_META_TYPE 0x1UL /* Points to node or shortcut */ | ||
| 115 | #define ASSOC_ARRAY_PTR_SUBTYPE_MASK 0x2UL | ||
| 116 | #define ASSOC_ARRAY_PTR_NODE_SUBTYPE 0x0UL | ||
| 117 | #define ASSOC_ARRAY_PTR_SHORTCUT_SUBTYPE 0x2UL | ||
| 118 | |||
| 119 | static inline bool assoc_array_ptr_is_meta(const struct assoc_array_ptr *x) | ||
| 120 | { | ||
| 121 | return (unsigned long)x & ASSOC_ARRAY_PTR_TYPE_MASK; | ||
| 122 | } | ||
| 123 | static inline bool assoc_array_ptr_is_leaf(const struct assoc_array_ptr *x) | ||
| 124 | { | ||
| 125 | return !assoc_array_ptr_is_meta(x); | ||
| 126 | } | ||
| 127 | static inline bool assoc_array_ptr_is_shortcut(const struct assoc_array_ptr *x) | ||
| 128 | { | ||
| 129 | return (unsigned long)x & ASSOC_ARRAY_PTR_SUBTYPE_MASK; | ||
| 130 | } | ||
| 131 | static inline bool assoc_array_ptr_is_node(const struct assoc_array_ptr *x) | ||
| 132 | { | ||
| 133 | return !assoc_array_ptr_is_shortcut(x); | ||
| 134 | } | ||
| 135 | |||
| 136 | static inline void *assoc_array_ptr_to_leaf(const struct assoc_array_ptr *x) | ||
| 137 | { | ||
| 138 | return (void *)((unsigned long)x & ~ASSOC_ARRAY_PTR_TYPE_MASK); | ||
| 139 | } | ||
| 140 | |||
| 141 | static inline | ||
| 142 | unsigned long __assoc_array_ptr_to_meta(const struct assoc_array_ptr *x) | ||
| 143 | { | ||
| 144 | return (unsigned long)x & | ||
| 145 | ~(ASSOC_ARRAY_PTR_SUBTYPE_MASK | ASSOC_ARRAY_PTR_TYPE_MASK); | ||
| 146 | } | ||
| 147 | static inline | ||
| 148 | struct assoc_array_node *assoc_array_ptr_to_node(const struct assoc_array_ptr *x) | ||
| 149 | { | ||
| 150 | return (struct assoc_array_node *)__assoc_array_ptr_to_meta(x); | ||
| 151 | } | ||
| 152 | static inline | ||
| 153 | struct assoc_array_shortcut *assoc_array_ptr_to_shortcut(const struct assoc_array_ptr *x) | ||
| 154 | { | ||
| 155 | return (struct assoc_array_shortcut *)__assoc_array_ptr_to_meta(x); | ||
| 156 | } | ||
| 157 | |||
| 158 | static inline | ||
| 159 | struct assoc_array_ptr *__assoc_array_x_to_ptr(const void *p, unsigned long t) | ||
| 160 | { | ||
| 161 | return (struct assoc_array_ptr *)((unsigned long)p | t); | ||
| 162 | } | ||
| 163 | static inline | ||
| 164 | struct assoc_array_ptr *assoc_array_leaf_to_ptr(const void *p) | ||
| 165 | { | ||
| 166 | return __assoc_array_x_to_ptr(p, ASSOC_ARRAY_PTR_LEAF_TYPE); | ||
| 167 | } | ||
| 168 | static inline | ||
| 169 | struct assoc_array_ptr *assoc_array_node_to_ptr(const struct assoc_array_node *p) | ||
| 170 | { | ||
| 171 | return __assoc_array_x_to_ptr( | ||
| 172 | p, ASSOC_ARRAY_PTR_META_TYPE | ASSOC_ARRAY_PTR_NODE_SUBTYPE); | ||
| 173 | } | ||
| 174 | static inline | ||
| 175 | struct assoc_array_ptr *assoc_array_shortcut_to_ptr(const struct assoc_array_shortcut *p) | ||
| 176 | { | ||
| 177 | return __assoc_array_x_to_ptr( | ||
| 178 | p, ASSOC_ARRAY_PTR_META_TYPE | ASSOC_ARRAY_PTR_SHORTCUT_SUBTYPE); | ||
| 179 | } | ||
| 180 | |||
| 181 | #endif /* CONFIG_ASSOCIATIVE_ARRAY */ | ||
| 182 | #endif /* _LINUX_ASSOC_ARRAY_PRIV_H */ | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index 729a4d165bcc..a40641954c29 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -73,6 +73,8 @@ struct audit_field { | |||
| 73 | void *lsm_rule; | 73 | void *lsm_rule; |
| 74 | }; | 74 | }; |
| 75 | 75 | ||
| 76 | extern int is_audit_feature_set(int which); | ||
| 77 | |||
| 76 | extern int __init audit_register_class(int class, unsigned *list); | 78 | extern int __init audit_register_class(int class, unsigned *list); |
| 77 | extern int audit_classify_syscall(int abi, unsigned syscall); | 79 | extern int audit_classify_syscall(int abi, unsigned syscall); |
| 78 | extern int audit_classify_arch(int arch); | 80 | extern int audit_classify_arch(int arch); |
| @@ -207,7 +209,7 @@ static inline int audit_get_sessionid(struct task_struct *tsk) | |||
| 207 | 209 | ||
| 208 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); | 210 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); |
| 209 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); | 211 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); |
| 210 | extern int __audit_bprm(struct linux_binprm *bprm); | 212 | extern void __audit_bprm(struct linux_binprm *bprm); |
| 211 | extern int __audit_socketcall(int nargs, unsigned long *args); | 213 | extern int __audit_socketcall(int nargs, unsigned long *args); |
| 212 | extern int __audit_sockaddr(int len, void *addr); | 214 | extern int __audit_sockaddr(int len, void *addr); |
| 213 | extern void __audit_fd_pair(int fd1, int fd2); | 215 | extern void __audit_fd_pair(int fd1, int fd2); |
| @@ -236,11 +238,10 @@ static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid | |||
| 236 | if (unlikely(!audit_dummy_context())) | 238 | if (unlikely(!audit_dummy_context())) |
| 237 | __audit_ipc_set_perm(qbytes, uid, gid, mode); | 239 | __audit_ipc_set_perm(qbytes, uid, gid, mode); |
| 238 | } | 240 | } |
| 239 | static inline int audit_bprm(struct linux_binprm *bprm) | 241 | static inline void audit_bprm(struct linux_binprm *bprm) |
| 240 | { | 242 | { |
| 241 | if (unlikely(!audit_dummy_context())) | 243 | if (unlikely(!audit_dummy_context())) |
| 242 | return __audit_bprm(bprm); | 244 | __audit_bprm(bprm); |
| 243 | return 0; | ||
| 244 | } | 245 | } |
| 245 | static inline int audit_socketcall(int nargs, unsigned long *args) | 246 | static inline int audit_socketcall(int nargs, unsigned long *args) |
| 246 | { | 247 | { |
| @@ -367,10 +368,8 @@ static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) | |||
| 367 | static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, | 368 | static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, |
| 368 | gid_t gid, umode_t mode) | 369 | gid_t gid, umode_t mode) |
| 369 | { } | 370 | { } |
| 370 | static inline int audit_bprm(struct linux_binprm *bprm) | 371 | static inline void audit_bprm(struct linux_binprm *bprm) |
| 371 | { | 372 | { } |
| 372 | return 0; | ||
| 373 | } | ||
| 374 | static inline int audit_socketcall(int nargs, unsigned long *args) | 373 | static inline int audit_socketcall(int nargs, unsigned long *args) |
| 375 | { | 374 | { |
| 376 | return 0; | 375 | return 0; |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index f26ec20f6354..1b135d49b279 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -505,6 +505,9 @@ struct request_queue { | |||
| 505 | (1 << QUEUE_FLAG_SAME_COMP) | \ | 505 | (1 << QUEUE_FLAG_SAME_COMP) | \ |
| 506 | (1 << QUEUE_FLAG_ADD_RANDOM)) | 506 | (1 << QUEUE_FLAG_ADD_RANDOM)) |
| 507 | 507 | ||
| 508 | #define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | ||
| 509 | (1 << QUEUE_FLAG_SAME_COMP)) | ||
| 510 | |||
| 508 | static inline void queue_lockdep_assert_held(struct request_queue *q) | 511 | static inline void queue_lockdep_assert_held(struct request_queue *q) |
| 509 | { | 512 | { |
| 510 | if (q->queue_lock) | 513 | if (q->queue_lock) |
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h index 973ce10c40b6..dc1bd3dcf11f 100644 --- a/include/linux/compiler-intel.h +++ b/include/linux/compiler-intel.h | |||
| @@ -28,8 +28,6 @@ | |||
| 28 | 28 | ||
| 29 | #endif | 29 | #endif |
| 30 | 30 | ||
| 31 | #define uninitialized_var(x) x | ||
| 32 | |||
| 33 | #ifndef __HAVE_BUILTIN_BSWAP16__ | 31 | #ifndef __HAVE_BUILTIN_BSWAP16__ |
| 34 | /* icc has this, but it's called _bswap16 */ | 32 | /* icc has this, but it's called _bswap16 */ |
| 35 | #define __HAVE_BUILTIN_BSWAP16__ | 33 | #define __HAVE_BUILTIN_BSWAP16__ |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 57e87e749a48..bf72e9ac6de0 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
| @@ -29,8 +29,10 @@ struct vfsmount; | |||
| 29 | /* The hash is always the low bits of hash_len */ | 29 | /* The hash is always the low bits of hash_len */ |
| 30 | #ifdef __LITTLE_ENDIAN | 30 | #ifdef __LITTLE_ENDIAN |
| 31 | #define HASH_LEN_DECLARE u32 hash; u32 len; | 31 | #define HASH_LEN_DECLARE u32 hash; u32 len; |
| 32 | #define bytemask_from_count(cnt) (~(~0ul << (cnt)*8)) | ||
| 32 | #else | 33 | #else |
| 33 | #define HASH_LEN_DECLARE u32 len; u32 hash; | 34 | #define HASH_LEN_DECLARE u32 len; u32 hash; |
| 35 | #define bytemask_from_count(cnt) (~(~0ul >> (cnt)*8)) | ||
| 34 | #endif | 36 | #endif |
| 35 | 37 | ||
| 36 | /* | 38 | /* |
diff --git a/include/linux/device.h b/include/linux/device.h index b025925df7f7..952b01033c32 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -644,9 +644,11 @@ struct device_dma_parameters { | |||
| 644 | unsigned long segment_boundary_mask; | 644 | unsigned long segment_boundary_mask; |
| 645 | }; | 645 | }; |
| 646 | 646 | ||
| 647 | struct acpi_device; | ||
| 648 | |||
| 647 | struct acpi_dev_node { | 649 | struct acpi_dev_node { |
| 648 | #ifdef CONFIG_ACPI | 650 | #ifdef CONFIG_ACPI |
| 649 | void *handle; | 651 | struct acpi_device *companion; |
| 650 | #endif | 652 | #endif |
| 651 | }; | 653 | }; |
| 652 | 654 | ||
| @@ -790,14 +792,6 @@ static inline struct device *kobj_to_dev(struct kobject *kobj) | |||
| 790 | return container_of(kobj, struct device, kobj); | 792 | return container_of(kobj, struct device, kobj); |
| 791 | } | 793 | } |
| 792 | 794 | ||
| 793 | #ifdef CONFIG_ACPI | ||
| 794 | #define ACPI_HANDLE(dev) ((dev)->acpi_node.handle) | ||
| 795 | #define ACPI_HANDLE_SET(dev, _handle_) (dev)->acpi_node.handle = (_handle_) | ||
| 796 | #else | ||
| 797 | #define ACPI_HANDLE(dev) (NULL) | ||
| 798 | #define ACPI_HANDLE_SET(dev, _handle_) do { } while (0) | ||
| 799 | #endif | ||
| 800 | |||
| 801 | /* Get the wakeup routines, which depend on struct device */ | 795 | /* Get the wakeup routines, which depend on struct device */ |
| 802 | #include <linux/pm_wakeup.h> | 796 | #include <linux/pm_wakeup.h> |
| 803 | 797 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 0bc727534108..41cf0c399288 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -45,13 +45,13 @@ static inline int dma_submit_error(dma_cookie_t cookie) | |||
| 45 | 45 | ||
| 46 | /** | 46 | /** |
| 47 | * enum dma_status - DMA transaction status | 47 | * enum dma_status - DMA transaction status |
| 48 | * @DMA_SUCCESS: transaction completed successfully | 48 | * @DMA_COMPLETE: transaction completed |
| 49 | * @DMA_IN_PROGRESS: transaction not yet processed | 49 | * @DMA_IN_PROGRESS: transaction not yet processed |
| 50 | * @DMA_PAUSED: transaction is paused | 50 | * @DMA_PAUSED: transaction is paused |
| 51 | * @DMA_ERROR: transaction failed | 51 | * @DMA_ERROR: transaction failed |
| 52 | */ | 52 | */ |
| 53 | enum dma_status { | 53 | enum dma_status { |
| 54 | DMA_SUCCESS, | 54 | DMA_COMPLETE, |
| 55 | DMA_IN_PROGRESS, | 55 | DMA_IN_PROGRESS, |
| 56 | DMA_PAUSED, | 56 | DMA_PAUSED, |
| 57 | DMA_ERROR, | 57 | DMA_ERROR, |
| @@ -171,12 +171,6 @@ struct dma_interleaved_template { | |||
| 171 | * @DMA_CTRL_ACK - if clear, the descriptor cannot be reused until the client | 171 | * @DMA_CTRL_ACK - if clear, the descriptor cannot be reused until the client |
| 172 | * acknowledges receipt, i.e. has has a chance to establish any dependency | 172 | * acknowledges receipt, i.e. has has a chance to establish any dependency |
| 173 | * chains | 173 | * chains |
| 174 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) | ||
| 175 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) | ||
| 176 | * @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single | ||
| 177 | * (if not set, do the source dma-unmapping as page) | ||
| 178 | * @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single | ||
| 179 | * (if not set, do the destination dma-unmapping as page) | ||
| 180 | * @DMA_PREP_PQ_DISABLE_P - prevent generation of P while generating Q | 174 | * @DMA_PREP_PQ_DISABLE_P - prevent generation of P while generating Q |
| 181 | * @DMA_PREP_PQ_DISABLE_Q - prevent generation of Q while generating P | 175 | * @DMA_PREP_PQ_DISABLE_Q - prevent generation of Q while generating P |
| 182 | * @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as | 176 | * @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as |
| @@ -188,14 +182,10 @@ struct dma_interleaved_template { | |||
| 188 | enum dma_ctrl_flags { | 182 | enum dma_ctrl_flags { |
| 189 | DMA_PREP_INTERRUPT = (1 << 0), | 183 | DMA_PREP_INTERRUPT = (1 << 0), |
| 190 | DMA_CTRL_ACK = (1 << 1), | 184 | DMA_CTRL_ACK = (1 << 1), |
| 191 | DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2), | 185 | DMA_PREP_PQ_DISABLE_P = (1 << 2), |
| 192 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), | 186 | DMA_PREP_PQ_DISABLE_Q = (1 << 3), |
| 193 | DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4), | 187 | DMA_PREP_CONTINUE = (1 << 4), |
| 194 | DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5), | 188 | DMA_PREP_FENCE = (1 << 5), |
| 195 | DMA_PREP_PQ_DISABLE_P = (1 << 6), | ||
| 196 | DMA_PREP_PQ_DISABLE_Q = (1 << 7), | ||
| 197 | DMA_PREP_CONTINUE = (1 << 8), | ||
| 198 | DMA_PREP_FENCE = (1 << 9), | ||
| 199 | }; | 189 | }; |
| 200 | 190 | ||
| 201 | /** | 191 | /** |
| @@ -413,6 +403,17 @@ void dma_chan_cleanup(struct kref *kref); | |||
| 413 | typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param); | 403 | typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param); |
| 414 | 404 | ||
| 415 | typedef void (*dma_async_tx_callback)(void *dma_async_param); | 405 | typedef void (*dma_async_tx_callback)(void *dma_async_param); |
| 406 | |||
| 407 | struct dmaengine_unmap_data { | ||
| 408 | u8 to_cnt; | ||
| 409 | u8 from_cnt; | ||
| 410 | u8 bidi_cnt; | ||
| 411 | struct device *dev; | ||
| 412 | struct kref kref; | ||
| 413 | size_t len; | ||
| 414 | dma_addr_t addr[0]; | ||
| 415 | }; | ||
| 416 | |||
| 416 | /** | 417 | /** |
| 417 | * struct dma_async_tx_descriptor - async transaction descriptor | 418 | * struct dma_async_tx_descriptor - async transaction descriptor |
| 418 | * ---dma generic offload fields--- | 419 | * ---dma generic offload fields--- |
| @@ -438,6 +439,7 @@ struct dma_async_tx_descriptor { | |||
| 438 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); | 439 | dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); |
| 439 | dma_async_tx_callback callback; | 440 | dma_async_tx_callback callback; |
| 440 | void *callback_param; | 441 | void *callback_param; |
| 442 | struct dmaengine_unmap_data *unmap; | ||
| 441 | #ifdef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH | 443 | #ifdef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH |
| 442 | struct dma_async_tx_descriptor *next; | 444 | struct dma_async_tx_descriptor *next; |
| 443 | struct dma_async_tx_descriptor *parent; | 445 | struct dma_async_tx_descriptor *parent; |
| @@ -445,6 +447,40 @@ struct dma_async_tx_descriptor { | |||
| 445 | #endif | 447 | #endif |
| 446 | }; | 448 | }; |
| 447 | 449 | ||
| 450 | #ifdef CONFIG_DMA_ENGINE | ||
| 451 | static inline void dma_set_unmap(struct dma_async_tx_descriptor *tx, | ||
| 452 | struct dmaengine_unmap_data *unmap) | ||
| 453 | { | ||
| 454 | kref_get(&unmap->kref); | ||
| 455 | tx->unmap = unmap; | ||
| 456 | } | ||
| 457 | |||
| 458 | struct dmaengine_unmap_data * | ||
| 459 | dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags); | ||
| 460 | void dmaengine_unmap_put(struct dmaengine_unmap_data *unmap); | ||
| 461 | #else | ||
| 462 | static inline void dma_set_unmap(struct dma_async_tx_descriptor *tx, | ||
| 463 | struct dmaengine_unmap_data *unmap) | ||
| 464 | { | ||
| 465 | } | ||
| 466 | static inline struct dmaengine_unmap_data * | ||
| 467 | dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags) | ||
| 468 | { | ||
| 469 | return NULL; | ||
| 470 | } | ||
| 471 | static inline void dmaengine_unmap_put(struct dmaengine_unmap_data *unmap) | ||
| 472 | { | ||
| 473 | } | ||
| 474 | #endif | ||
| 475 | |||
| 476 | static inline void dma_descriptor_unmap(struct dma_async_tx_descriptor *tx) | ||
| 477 | { | ||
| 478 | if (tx->unmap) { | ||
| 479 | dmaengine_unmap_put(tx->unmap); | ||
| 480 | tx->unmap = NULL; | ||
| 481 | } | ||
| 482 | } | ||
| 483 | |||
| 448 | #ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH | 484 | #ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH |
| 449 | static inline void txd_lock(struct dma_async_tx_descriptor *txd) | 485 | static inline void txd_lock(struct dma_async_tx_descriptor *txd) |
| 450 | { | 486 | { |
| @@ -979,10 +1015,10 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie, | |||
| 979 | { | 1015 | { |
| 980 | if (last_complete <= last_used) { | 1016 | if (last_complete <= last_used) { |
| 981 | if ((cookie <= last_complete) || (cookie > last_used)) | 1017 | if ((cookie <= last_complete) || (cookie > last_used)) |
| 982 | return DMA_SUCCESS; | 1018 | return DMA_COMPLETE; |
| 983 | } else { | 1019 | } else { |
| 984 | if ((cookie <= last_complete) && (cookie > last_used)) | 1020 | if ((cookie <= last_complete) && (cookie > last_used)) |
| 985 | return DMA_SUCCESS; | 1021 | return DMA_COMPLETE; |
| 986 | } | 1022 | } |
| 987 | return DMA_IN_PROGRESS; | 1023 | return DMA_IN_PROGRESS; |
| 988 | } | 1024 | } |
| @@ -1013,11 +1049,11 @@ static inline struct dma_chan *dma_find_channel(enum dma_transaction_type tx_typ | |||
| 1013 | } | 1049 | } |
| 1014 | static inline enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie) | 1050 | static inline enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie) |
| 1015 | { | 1051 | { |
| 1016 | return DMA_SUCCESS; | 1052 | return DMA_COMPLETE; |
| 1017 | } | 1053 | } |
| 1018 | static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) | 1054 | static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) |
| 1019 | { | 1055 | { |
| 1020 | return DMA_SUCCESS; | 1056 | return DMA_COMPLETE; |
| 1021 | } | 1057 | } |
| 1022 | static inline void dma_issue_pending_all(void) | 1058 | static inline void dma_issue_pending_all(void) |
| 1023 | { | 1059 | { |
diff --git a/include/linux/efi.h b/include/linux/efi.h index bc5687d0f315..11ce6784a196 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -801,6 +801,8 @@ struct efivar_entry { | |||
| 801 | struct efi_variable var; | 801 | struct efi_variable var; |
| 802 | struct list_head list; | 802 | struct list_head list; |
| 803 | struct kobject kobj; | 803 | struct kobject kobj; |
| 804 | bool scanning; | ||
| 805 | bool deleting; | ||
| 804 | }; | 806 | }; |
| 805 | 807 | ||
| 806 | 808 | ||
| @@ -866,6 +868,8 @@ void efivar_run_worker(void); | |||
| 866 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) | 868 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) |
| 867 | int efivars_sysfs_init(void); | 869 | int efivars_sysfs_init(void); |
| 868 | 870 | ||
| 871 | #define EFIVARS_DATA_SIZE_MAX 1024 | ||
| 872 | |||
| 869 | #endif /* CONFIG_EFI_VARS */ | 873 | #endif /* CONFIG_EFI_VARS */ |
| 870 | 874 | ||
| 871 | #endif /* _LINUX_EFI_H */ | 875 | #endif /* _LINUX_EFI_H */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index bf5d574ebdf4..121f11f001c0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -2622,7 +2622,9 @@ extern int simple_write_begin(struct file *file, struct address_space *mapping, | |||
| 2622 | extern int simple_write_end(struct file *file, struct address_space *mapping, | 2622 | extern int simple_write_end(struct file *file, struct address_space *mapping, |
| 2623 | loff_t pos, unsigned len, unsigned copied, | 2623 | loff_t pos, unsigned len, unsigned copied, |
| 2624 | struct page *page, void *fsdata); | 2624 | struct page *page, void *fsdata); |
| 2625 | extern int always_delete_dentry(const struct dentry *); | ||
| 2625 | extern struct inode *alloc_anon_inode(struct super_block *); | 2626 | extern struct inode *alloc_anon_inode(struct super_block *); |
| 2627 | extern const struct dentry_operations simple_dentry_operations; | ||
| 2626 | 2628 | ||
| 2627 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); | 2629 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, unsigned int flags); |
| 2628 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); | 2630 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 9abbe630c456..8c9b7a1c4138 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -248,6 +248,9 @@ struct ftrace_event_call { | |||
| 248 | #ifdef CONFIG_PERF_EVENTS | 248 | #ifdef CONFIG_PERF_EVENTS |
| 249 | int perf_refcount; | 249 | int perf_refcount; |
| 250 | struct hlist_head __percpu *perf_events; | 250 | struct hlist_head __percpu *perf_events; |
| 251 | |||
| 252 | int (*perf_perm)(struct ftrace_event_call *, | ||
| 253 | struct perf_event *); | ||
| 251 | #endif | 254 | #endif |
| 252 | }; | 255 | }; |
| 253 | 256 | ||
| @@ -317,6 +320,19 @@ struct ftrace_event_file { | |||
| 317 | } \ | 320 | } \ |
| 318 | early_initcall(trace_init_flags_##name); | 321 | early_initcall(trace_init_flags_##name); |
| 319 | 322 | ||
| 323 | #define __TRACE_EVENT_PERF_PERM(name, expr...) \ | ||
| 324 | static int perf_perm_##name(struct ftrace_event_call *tp_event, \ | ||
| 325 | struct perf_event *p_event) \ | ||
| 326 | { \ | ||
| 327 | return ({ expr; }); \ | ||
| 328 | } \ | ||
| 329 | static int __init trace_init_perf_perm_##name(void) \ | ||
| 330 | { \ | ||
| 331 | event_##name.perf_perm = &perf_perm_##name; \ | ||
| 332 | return 0; \ | ||
| 333 | } \ | ||
| 334 | early_initcall(trace_init_perf_perm_##name); | ||
| 335 | |||
| 320 | #define PERF_MAX_TRACE_SIZE 2048 | 336 | #define PERF_MAX_TRACE_SIZE 2048 |
| 321 | 337 | ||
| 322 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ | 338 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h index 023bc346b877..c0894dd8827b 100644 --- a/include/linux/genl_magic_func.h +++ b/include/linux/genl_magic_func.h | |||
| @@ -273,49 +273,40 @@ static struct genl_family ZZZ_genl_family __read_mostly = { | |||
| 273 | * Magic: define multicast groups | 273 | * Magic: define multicast groups |
| 274 | * Magic: define multicast group registration helper | 274 | * Magic: define multicast group registration helper |
| 275 | */ | 275 | */ |
| 276 | #define ZZZ_genl_mcgrps CONCAT_(GENL_MAGIC_FAMILY, _genl_mcgrps) | ||
| 277 | static const struct genl_multicast_group ZZZ_genl_mcgrps[] = { | ||
| 278 | #undef GENL_mc_group | ||
| 279 | #define GENL_mc_group(group) { .name = #group, }, | ||
| 280 | #include GENL_MAGIC_INCLUDE_FILE | ||
| 281 | }; | ||
| 282 | |||
| 283 | enum CONCAT_(GENL_MAGIC_FAMILY, group_ids) { | ||
| 284 | #undef GENL_mc_group | ||
| 285 | #define GENL_mc_group(group) CONCAT_(GENL_MAGIC_FAMILY, _group_ ## group), | ||
| 286 | #include GENL_MAGIC_INCLUDE_FILE | ||
| 287 | }; | ||
| 288 | |||
| 276 | #undef GENL_mc_group | 289 | #undef GENL_mc_group |
| 277 | #define GENL_mc_group(group) \ | 290 | #define GENL_mc_group(group) \ |
| 278 | static struct genl_multicast_group \ | ||
| 279 | CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group) __read_mostly = { \ | ||
| 280 | .name = #group, \ | ||
| 281 | }; \ | ||
| 282 | static int CONCAT_(GENL_MAGIC_FAMILY, _genl_multicast_ ## group)( \ | 291 | static int CONCAT_(GENL_MAGIC_FAMILY, _genl_multicast_ ## group)( \ |
| 283 | struct sk_buff *skb, gfp_t flags) \ | 292 | struct sk_buff *skb, gfp_t flags) \ |
| 284 | { \ | 293 | { \ |
| 285 | unsigned int group_id = \ | 294 | unsigned int group_id = \ |
| 286 | CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group).id; \ | 295 | CONCAT_(GENL_MAGIC_FAMILY, _group_ ## group); \ |
| 287 | if (!group_id) \ | 296 | return genlmsg_multicast(&ZZZ_genl_family, skb, 0, \ |
| 288 | return -EINVAL; \ | 297 | group_id, flags); \ |
| 289 | return genlmsg_multicast(skb, 0, group_id, flags); \ | ||
| 290 | } | 298 | } |
| 291 | 299 | ||
| 292 | #include GENL_MAGIC_INCLUDE_FILE | 300 | #include GENL_MAGIC_INCLUDE_FILE |
| 293 | 301 | ||
| 294 | int CONCAT_(GENL_MAGIC_FAMILY, _genl_register)(void) | ||
| 295 | { | ||
| 296 | int err = genl_register_family_with_ops(&ZZZ_genl_family, | ||
| 297 | ZZZ_genl_ops, ARRAY_SIZE(ZZZ_genl_ops)); | ||
| 298 | if (err) | ||
| 299 | return err; | ||
| 300 | #undef GENL_mc_group | ||
| 301 | #define GENL_mc_group(group) \ | ||
| 302 | err = genl_register_mc_group(&ZZZ_genl_family, \ | ||
| 303 | &CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group)); \ | ||
| 304 | if (err) \ | ||
| 305 | goto fail; \ | ||
| 306 | else \ | ||
| 307 | pr_info("%s: mcg %s: %u\n", #group, \ | ||
| 308 | __stringify(GENL_MAGIC_FAMILY), \ | ||
| 309 | CONCAT_(GENL_MAGIC_FAMILY, _mcg_ ## group).id); | ||
| 310 | |||
| 311 | #include GENL_MAGIC_INCLUDE_FILE | ||
| 312 | |||
| 313 | #undef GENL_mc_group | 302 | #undef GENL_mc_group |
| 314 | #define GENL_mc_group(group) | 303 | #define GENL_mc_group(group) |
| 315 | return 0; | 304 | |
| 316 | fail: | 305 | int CONCAT_(GENL_MAGIC_FAMILY, _genl_register)(void) |
| 317 | genl_unregister_family(&ZZZ_genl_family); | 306 | { |
| 318 | return err; | 307 | return genl_register_family_with_ops_groups(&ZZZ_genl_family, \ |
| 308 | ZZZ_genl_ops, \ | ||
| 309 | ZZZ_genl_mcgrps); | ||
| 319 | } | 310 | } |
| 320 | 311 | ||
| 321 | void CONCAT_(GENL_MAGIC_FAMILY, _genl_unregister)(void) | 312 | void CONCAT_(GENL_MAGIC_FAMILY, _genl_unregister)(void) |
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 656a27efb2c8..3ea2cf6b0e6c 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h | |||
| @@ -2,9 +2,12 @@ | |||
| 2 | #define __LINUX_GPIO_DRIVER_H | 2 | #define __LINUX_GPIO_DRIVER_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/module.h> | ||
| 5 | 6 | ||
| 6 | struct device; | 7 | struct device; |
| 7 | struct gpio_desc; | 8 | struct gpio_desc; |
| 9 | struct of_phandle_args; | ||
| 10 | struct device_node; | ||
| 8 | struct seq_file; | 11 | struct seq_file; |
| 9 | 12 | ||
| 10 | /** | 13 | /** |
| @@ -125,6 +128,13 @@ extern struct gpio_chip *gpiochip_find(void *data, | |||
| 125 | int gpiod_lock_as_irq(struct gpio_desc *desc); | 128 | int gpiod_lock_as_irq(struct gpio_desc *desc); |
| 126 | void gpiod_unlock_as_irq(struct gpio_desc *desc); | 129 | void gpiod_unlock_as_irq(struct gpio_desc *desc); |
| 127 | 130 | ||
| 131 | enum gpio_lookup_flags { | ||
| 132 | GPIO_ACTIVE_HIGH = (0 << 0), | ||
| 133 | GPIO_ACTIVE_LOW = (1 << 0), | ||
| 134 | GPIO_OPEN_DRAIN = (1 << 1), | ||
| 135 | GPIO_OPEN_SOURCE = (1 << 2), | ||
| 136 | }; | ||
| 137 | |||
| 128 | /** | 138 | /** |
| 129 | * Lookup table for associating GPIOs to specific devices and functions using | 139 | * Lookup table for associating GPIOs to specific devices and functions using |
| 130 | * platform data. | 140 | * platform data. |
| @@ -152,9 +162,9 @@ struct gpiod_lookup { | |||
| 152 | */ | 162 | */ |
| 153 | unsigned int idx; | 163 | unsigned int idx; |
| 154 | /* | 164 | /* |
| 155 | * mask of GPIOF_* values | 165 | * mask of GPIO_* values |
| 156 | */ | 166 | */ |
| 157 | unsigned long flags; | 167 | enum gpio_lookup_flags flags; |
| 158 | }; | 168 | }; |
| 159 | 169 | ||
| 160 | /* | 170 | /* |
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h index a265af294ea4..b914ca3f57ba 100644 --- a/include/linux/hid-sensor-hub.h +++ b/include/linux/hid-sensor-hub.h | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | 21 | ||
| 22 | #include <linux/hid.h> | 22 | #include <linux/hid.h> |
| 23 | #include <linux/hid-sensor-ids.h> | 23 | #include <linux/hid-sensor-ids.h> |
| 24 | #include <linux/iio/iio.h> | ||
| 25 | #include <linux/iio/trigger.h> | ||
| 24 | 26 | ||
| 25 | /** | 27 | /** |
| 26 | * struct hid_sensor_hub_attribute_info - Attribute info | 28 | * struct hid_sensor_hub_attribute_info - Attribute info |
| @@ -40,6 +42,8 @@ struct hid_sensor_hub_attribute_info { | |||
| 40 | s32 units; | 42 | s32 units; |
| 41 | s32 unit_expo; | 43 | s32 unit_expo; |
| 42 | s32 size; | 44 | s32 size; |
| 45 | s32 logical_minimum; | ||
| 46 | s32 logical_maximum; | ||
| 43 | }; | 47 | }; |
| 44 | 48 | ||
| 45 | /** | 49 | /** |
| @@ -184,6 +188,7 @@ struct hid_sensor_common { | |||
| 184 | struct platform_device *pdev; | 188 | struct platform_device *pdev; |
| 185 | unsigned usage_id; | 189 | unsigned usage_id; |
| 186 | bool data_ready; | 190 | bool data_ready; |
| 191 | struct iio_trigger *trigger; | ||
| 187 | struct hid_sensor_hub_attribute_info poll; | 192 | struct hid_sensor_hub_attribute_info poll; |
| 188 | struct hid_sensor_hub_attribute_info report_state; | 193 | struct hid_sensor_hub_attribute_info report_state; |
| 189 | struct hid_sensor_hub_attribute_info power_state; | 194 | struct hid_sensor_hub_attribute_info power_state; |
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h index 4f945d3ed49f..8323775ac21d 100644 --- a/include/linux/hid-sensor-ids.h +++ b/include/linux/hid-sensor-ids.h | |||
| @@ -117,4 +117,16 @@ | |||
| 117 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 | 117 | #define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 |
| 118 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 | 118 | #define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 |
| 119 | 119 | ||
| 120 | /* Power state enumerations */ | ||
| 121 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM 0x00 | ||
| 122 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM 0x01 | ||
| 123 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D1_LOW_POWER_ENUM 0x02 | ||
| 124 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D2_STANDBY_WITH_WAKE_ENUM 0x03 | ||
| 125 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D3_SLEEP_WITH_WAKE_ENUM 0x04 | ||
| 126 | #define HID_USAGE_SENSOR_PROP_POWER_STATE_D4_POWER_OFF_ENUM 0x05 | ||
| 127 | |||
| 128 | /* Report State enumerations */ | ||
| 129 | #define HID_USAGE_SENSOR_PROP_REPORTING_STATE_NO_EVENTS_ENUM 0x00 | ||
| 130 | #define HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM 0x01 | ||
| 131 | |||
| 120 | #endif | 132 | #endif |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index acd2010328f3..bd7e98752222 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -31,6 +31,7 @@ struct hugepage_subpool *hugepage_new_subpool(long nr_blocks); | |||
| 31 | void hugepage_put_subpool(struct hugepage_subpool *spool); | 31 | void hugepage_put_subpool(struct hugepage_subpool *spool); |
| 32 | 32 | ||
| 33 | int PageHuge(struct page *page); | 33 | int PageHuge(struct page *page); |
| 34 | int PageHeadHuge(struct page *page_head); | ||
| 34 | 35 | ||
| 35 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | 36 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); |
| 36 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); | 37 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| @@ -69,7 +70,6 @@ int dequeue_hwpoisoned_huge_page(struct page *page); | |||
| 69 | bool isolate_huge_page(struct page *page, struct list_head *list); | 70 | bool isolate_huge_page(struct page *page, struct list_head *list); |
| 70 | void putback_active_hugepage(struct page *page); | 71 | void putback_active_hugepage(struct page *page); |
| 71 | bool is_hugepage_active(struct page *page); | 72 | bool is_hugepage_active(struct page *page); |
| 72 | void copy_huge_page(struct page *dst, struct page *src); | ||
| 73 | 73 | ||
| 74 | #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE | 74 | #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE |
| 75 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); | 75 | pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); |
| @@ -104,6 +104,11 @@ static inline int PageHuge(struct page *page) | |||
| 104 | return 0; | 104 | return 0; |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | static inline int PageHeadHuge(struct page *page_head) | ||
| 108 | { | ||
| 109 | return 0; | ||
| 110 | } | ||
| 111 | |||
| 107 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) | 112 | static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) |
| 108 | { | 113 | { |
| 109 | } | 114 | } |
| @@ -137,12 +142,12 @@ static inline int dequeue_hwpoisoned_huge_page(struct page *page) | |||
| 137 | return 0; | 142 | return 0; |
| 138 | } | 143 | } |
| 139 | 144 | ||
| 140 | #define isolate_huge_page(p, l) false | 145 | static inline bool isolate_huge_page(struct page *page, struct list_head *list) |
| 141 | #define putback_active_hugepage(p) do {} while (0) | ||
| 142 | #define is_hugepage_active(x) false | ||
| 143 | static inline void copy_huge_page(struct page *dst, struct page *src) | ||
| 144 | { | 146 | { |
| 147 | return false; | ||
| 145 | } | 148 | } |
| 149 | #define putback_active_hugepage(p) do {} while (0) | ||
| 150 | #define is_hugepage_active(x) false | ||
| 146 | 151 | ||
| 147 | static inline unsigned long hugetlb_change_protection(struct vm_area_struct *vma, | 152 | static inline unsigned long hugetlb_change_protection(struct vm_area_struct *vma, |
| 148 | unsigned long address, unsigned long end, pgprot_t newprot) | 153 | unsigned long address, unsigned long end, pgprot_t newprot) |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index c2702856295e..84ba5ac39e03 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
| @@ -119,4 +119,21 @@ extern int macvlan_link_register(struct rtnl_link_ops *ops); | |||
| 119 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, | 119 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, |
| 120 | struct net_device *dev); | 120 | struct net_device *dev); |
| 121 | 121 | ||
| 122 | #if IS_ENABLED(CONFIG_MACVLAN) | ||
| 123 | static inline struct net_device * | ||
| 124 | macvlan_dev_real_dev(const struct net_device *dev) | ||
| 125 | { | ||
| 126 | struct macvlan_dev *macvlan = netdev_priv(dev); | ||
| 127 | |||
| 128 | return macvlan->lowerdev; | ||
| 129 | } | ||
| 130 | #else | ||
| 131 | static inline struct net_device * | ||
| 132 | macvlan_dev_real_dev(const struct net_device *dev) | ||
| 133 | { | ||
| 134 | BUG(); | ||
| 135 | return NULL; | ||
| 136 | } | ||
| 137 | #endif | ||
| 138 | |||
| 122 | #endif /* _LINUX_IF_MACVLAN_H */ | 139 | #endif /* _LINUX_IF_MACVLAN_H */ |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 5d89d1b808a6..c56c350324e4 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <uapi/linux/ipv6.h> | 4 | #include <uapi/linux/ipv6.h> |
| 5 | 5 | ||
| 6 | #define ipv6_optlen(p) (((p)->hdrlen+1) << 3) | 6 | #define ipv6_optlen(p) (((p)->hdrlen+1) << 3) |
| 7 | #define ipv6_authlen(p) (((p)->hdrlen+2) << 2) | ||
| 7 | /* | 8 | /* |
| 8 | * This structure contains configuration options per IPv6 link. | 9 | * This structure contains configuration options per IPv6 link. |
| 9 | */ | 10 | */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 56bb0dc8b7d4..7dc10036eff5 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
| @@ -70,6 +70,9 @@ typedef void (*irq_preflow_handler_t)(struct irq_data *data); | |||
| 70 | * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context | 70 | * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context |
| 71 | * IRQ_NESTED_TRHEAD - Interrupt nests into another thread | 71 | * IRQ_NESTED_TRHEAD - Interrupt nests into another thread |
| 72 | * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable | 72 | * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable |
| 73 | * IRQ_IS_POLLED - Always polled by another interrupt. Exclude | ||
| 74 | * it from the spurious interrupt detection | ||
| 75 | * mechanism and from core side polling. | ||
| 73 | */ | 76 | */ |
| 74 | enum { | 77 | enum { |
| 75 | IRQ_TYPE_NONE = 0x00000000, | 78 | IRQ_TYPE_NONE = 0x00000000, |
| @@ -94,12 +97,14 @@ enum { | |||
| 94 | IRQ_NESTED_THREAD = (1 << 15), | 97 | IRQ_NESTED_THREAD = (1 << 15), |
| 95 | IRQ_NOTHREAD = (1 << 16), | 98 | IRQ_NOTHREAD = (1 << 16), |
| 96 | IRQ_PER_CPU_DEVID = (1 << 17), | 99 | IRQ_PER_CPU_DEVID = (1 << 17), |
| 100 | IRQ_IS_POLLED = (1 << 18), | ||
| 97 | }; | 101 | }; |
| 98 | 102 | ||
| 99 | #define IRQF_MODIFY_MASK \ | 103 | #define IRQF_MODIFY_MASK \ |
| 100 | (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ | 104 | (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ |
| 101 | IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ | 105 | IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ |
| 102 | IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID) | 106 | IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID | \ |
| 107 | IRQ_IS_POLLED) | ||
| 103 | 108 | ||
| 104 | #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) | 109 | #define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) |
| 105 | 110 | ||
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h index 714ba08dc092..e374e369fb2f 100644 --- a/include/linux/irqreturn.h +++ b/include/linux/irqreturn.h | |||
| @@ -14,6 +14,6 @@ enum irqreturn { | |||
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | typedef enum irqreturn irqreturn_t; | 16 | typedef enum irqreturn irqreturn_t; |
| 17 | #define IRQ_RETVAL(x) ((x) != IRQ_NONE) | 17 | #define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) |
| 18 | 18 | ||
| 19 | #endif | 19 | #endif |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d4e98d13eff4..ecb87544cc5d 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -193,7 +193,8 @@ extern int _cond_resched(void); | |||
| 193 | (__x < 0) ? -__x : __x; \ | 193 | (__x < 0) ? -__x : __x; \ |
| 194 | }) | 194 | }) |
| 195 | 195 | ||
| 196 | #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP) | 196 | #if defined(CONFIG_MMU) && \ |
| 197 | (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)) | ||
| 197 | void might_fault(void); | 198 | void might_fault(void); |
| 198 | #else | 199 | #else |
| 199 | static inline void might_fault(void) { } | 200 | static inline void might_fault(void) { } |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d78d28a733b1..5fd33dc1fe3a 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
| @@ -198,6 +198,9 @@ extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; | |||
| 198 | extern size_t vmcoreinfo_size; | 198 | extern size_t vmcoreinfo_size; |
| 199 | extern size_t vmcoreinfo_max_size; | 199 | extern size_t vmcoreinfo_max_size; |
| 200 | 200 | ||
| 201 | /* flag to track if kexec reboot is in progress */ | ||
| 202 | extern bool kexec_in_progress; | ||
| 203 | |||
| 201 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, | 204 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, |
| 202 | unsigned long long *crash_size, unsigned long long *crash_base); | 205 | unsigned long long *crash_size, unsigned long long *crash_base); |
| 203 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, | 206 | int parse_crashkernel_high(char *cmdline, unsigned long long system_ram, |
diff --git a/include/linux/key-type.h b/include/linux/key-type.h index 518a53afb9ea..a74c3a84dfdd 100644 --- a/include/linux/key-type.h +++ b/include/linux/key-type.h | |||
| @@ -45,6 +45,7 @@ struct key_preparsed_payload { | |||
| 45 | const void *data; /* Raw data */ | 45 | const void *data; /* Raw data */ |
| 46 | size_t datalen; /* Raw datalen */ | 46 | size_t datalen; /* Raw datalen */ |
| 47 | size_t quotalen; /* Quota length for proposed payload */ | 47 | size_t quotalen; /* Quota length for proposed payload */ |
| 48 | bool trusted; /* True if key is trusted */ | ||
| 48 | }; | 49 | }; |
| 49 | 50 | ||
| 50 | typedef int (*request_key_actor_t)(struct key_construction *key, | 51 | typedef int (*request_key_actor_t)(struct key_construction *key, |
| @@ -63,6 +64,11 @@ struct key_type { | |||
| 63 | */ | 64 | */ |
| 64 | size_t def_datalen; | 65 | size_t def_datalen; |
| 65 | 66 | ||
| 67 | /* Default key search algorithm. */ | ||
| 68 | unsigned def_lookup_type; | ||
| 69 | #define KEYRING_SEARCH_LOOKUP_DIRECT 0x0000 /* Direct lookup by description. */ | ||
| 70 | #define KEYRING_SEARCH_LOOKUP_ITERATE 0x0001 /* Iterative search. */ | ||
| 71 | |||
| 66 | /* vet a description */ | 72 | /* vet a description */ |
| 67 | int (*vet_description)(const char *description); | 73 | int (*vet_description)(const char *description); |
| 68 | 74 | ||
diff --git a/include/linux/key.h b/include/linux/key.h index 4dfde1161c5e..80d677483e31 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/sysctl.h> | 22 | #include <linux/sysctl.h> |
| 23 | #include <linux/rwsem.h> | 23 | #include <linux/rwsem.h> |
| 24 | #include <linux/atomic.h> | 24 | #include <linux/atomic.h> |
| 25 | #include <linux/assoc_array.h> | ||
| 25 | 26 | ||
| 26 | #ifdef __KERNEL__ | 27 | #ifdef __KERNEL__ |
| 27 | #include <linux/uidgid.h> | 28 | #include <linux/uidgid.h> |
| @@ -82,6 +83,12 @@ struct key_owner; | |||
| 82 | struct keyring_list; | 83 | struct keyring_list; |
| 83 | struct keyring_name; | 84 | struct keyring_name; |
| 84 | 85 | ||
| 86 | struct keyring_index_key { | ||
| 87 | struct key_type *type; | ||
| 88 | const char *description; | ||
| 89 | size_t desc_len; | ||
| 90 | }; | ||
| 91 | |||
| 85 | /*****************************************************************************/ | 92 | /*****************************************************************************/ |
| 86 | /* | 93 | /* |
| 87 | * key reference with possession attribute handling | 94 | * key reference with possession attribute handling |
| @@ -99,7 +106,7 @@ struct keyring_name; | |||
| 99 | typedef struct __key_reference_with_attributes *key_ref_t; | 106 | typedef struct __key_reference_with_attributes *key_ref_t; |
| 100 | 107 | ||
| 101 | static inline key_ref_t make_key_ref(const struct key *key, | 108 | static inline key_ref_t make_key_ref(const struct key *key, |
| 102 | unsigned long possession) | 109 | bool possession) |
| 103 | { | 110 | { |
| 104 | return (key_ref_t) ((unsigned long) key | possession); | 111 | return (key_ref_t) ((unsigned long) key | possession); |
| 105 | } | 112 | } |
| @@ -109,7 +116,7 @@ static inline struct key *key_ref_to_ptr(const key_ref_t key_ref) | |||
| 109 | return (struct key *) ((unsigned long) key_ref & ~1UL); | 116 | return (struct key *) ((unsigned long) key_ref & ~1UL); |
| 110 | } | 117 | } |
| 111 | 118 | ||
| 112 | static inline unsigned long is_key_possessed(const key_ref_t key_ref) | 119 | static inline bool is_key_possessed(const key_ref_t key_ref) |
| 113 | { | 120 | { |
| 114 | return (unsigned long) key_ref & 1UL; | 121 | return (unsigned long) key_ref & 1UL; |
| 115 | } | 122 | } |
| @@ -129,7 +136,6 @@ struct key { | |||
| 129 | struct list_head graveyard_link; | 136 | struct list_head graveyard_link; |
| 130 | struct rb_node serial_node; | 137 | struct rb_node serial_node; |
| 131 | }; | 138 | }; |
| 132 | struct key_type *type; /* type of key */ | ||
| 133 | struct rw_semaphore sem; /* change vs change sem */ | 139 | struct rw_semaphore sem; /* change vs change sem */ |
| 134 | struct key_user *user; /* owner of this key */ | 140 | struct key_user *user; /* owner of this key */ |
| 135 | void *security; /* security data for this key */ | 141 | void *security; /* security data for this key */ |
| @@ -162,13 +168,21 @@ struct key { | |||
| 162 | #define KEY_FLAG_NEGATIVE 5 /* set if key is negative */ | 168 | #define KEY_FLAG_NEGATIVE 5 /* set if key is negative */ |
| 163 | #define KEY_FLAG_ROOT_CAN_CLEAR 6 /* set if key can be cleared by root without permission */ | 169 | #define KEY_FLAG_ROOT_CAN_CLEAR 6 /* set if key can be cleared by root without permission */ |
| 164 | #define KEY_FLAG_INVALIDATED 7 /* set if key has been invalidated */ | 170 | #define KEY_FLAG_INVALIDATED 7 /* set if key has been invalidated */ |
| 171 | #define KEY_FLAG_TRUSTED 8 /* set if key is trusted */ | ||
| 172 | #define KEY_FLAG_TRUSTED_ONLY 9 /* set if keyring only accepts links to trusted keys */ | ||
| 165 | 173 | ||
| 166 | /* the description string | 174 | /* the key type and key description string |
| 167 | * - this is used to match a key against search criteria | 175 | * - the desc is used to match a key against search criteria |
| 168 | * - this should be a printable string | 176 | * - it should be a printable string |
| 169 | * - eg: for krb5 AFS, this might be "afs@REDHAT.COM" | 177 | * - eg: for krb5 AFS, this might be "afs@REDHAT.COM" |
| 170 | */ | 178 | */ |
| 171 | char *description; | 179 | union { |
| 180 | struct keyring_index_key index_key; | ||
| 181 | struct { | ||
| 182 | struct key_type *type; /* type of key */ | ||
| 183 | char *description; | ||
| 184 | }; | ||
| 185 | }; | ||
| 172 | 186 | ||
| 173 | /* type specific data | 187 | /* type specific data |
| 174 | * - this is used by the keyring type to index the name | 188 | * - this is used by the keyring type to index the name |
| @@ -185,11 +199,14 @@ struct key { | |||
| 185 | * whatever | 199 | * whatever |
| 186 | */ | 200 | */ |
| 187 | union { | 201 | union { |
| 188 | unsigned long value; | 202 | union { |
| 189 | void __rcu *rcudata; | 203 | unsigned long value; |
| 190 | void *data; | 204 | void __rcu *rcudata; |
| 191 | struct keyring_list __rcu *subscriptions; | 205 | void *data; |
| 192 | } payload; | 206 | void *data2[2]; |
| 207 | } payload; | ||
| 208 | struct assoc_array keys; | ||
| 209 | }; | ||
| 193 | }; | 210 | }; |
| 194 | 211 | ||
| 195 | extern struct key *key_alloc(struct key_type *type, | 212 | extern struct key *key_alloc(struct key_type *type, |
| @@ -203,18 +220,23 @@ extern struct key *key_alloc(struct key_type *type, | |||
| 203 | #define KEY_ALLOC_IN_QUOTA 0x0000 /* add to quota, reject if would overrun */ | 220 | #define KEY_ALLOC_IN_QUOTA 0x0000 /* add to quota, reject if would overrun */ |
| 204 | #define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */ | 221 | #define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */ |
| 205 | #define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */ | 222 | #define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */ |
| 223 | #define KEY_ALLOC_TRUSTED 0x0004 /* Key should be flagged as trusted */ | ||
| 206 | 224 | ||
| 207 | extern void key_revoke(struct key *key); | 225 | extern void key_revoke(struct key *key); |
| 208 | extern void key_invalidate(struct key *key); | 226 | extern void key_invalidate(struct key *key); |
| 209 | extern void key_put(struct key *key); | 227 | extern void key_put(struct key *key); |
| 210 | 228 | ||
| 211 | static inline struct key *key_get(struct key *key) | 229 | static inline struct key *__key_get(struct key *key) |
| 212 | { | 230 | { |
| 213 | if (key) | 231 | atomic_inc(&key->usage); |
| 214 | atomic_inc(&key->usage); | ||
| 215 | return key; | 232 | return key; |
| 216 | } | 233 | } |
| 217 | 234 | ||
| 235 | static inline struct key *key_get(struct key *key) | ||
| 236 | { | ||
| 237 | return key ? __key_get(key) : key; | ||
| 238 | } | ||
| 239 | |||
| 218 | static inline void key_ref_put(key_ref_t key_ref) | 240 | static inline void key_ref_put(key_ref_t key_ref) |
| 219 | { | 241 | { |
| 220 | key_put(key_ref_to_ptr(key_ref)); | 242 | key_put(key_ref_to_ptr(key_ref)); |
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index 2d0c9071bcfb..cab2dd279076 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h | |||
| @@ -39,7 +39,8 @@ enum sec_device_type { | |||
| 39 | struct sec_pmic_dev { | 39 | struct sec_pmic_dev { |
| 40 | struct device *dev; | 40 | struct device *dev; |
| 41 | struct sec_platform_data *pdata; | 41 | struct sec_platform_data *pdata; |
| 42 | struct regmap *regmap; | 42 | struct regmap *regmap_pmic; |
| 43 | struct regmap *regmap_rtc; | ||
| 43 | struct i2c_client *i2c; | 44 | struct i2c_client *i2c; |
| 44 | struct i2c_client *rtc; | 45 | struct i2c_client *rtc; |
| 45 | 46 | ||
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index ad05ce60c1c9..2e5b194b9b19 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | #define PHY_ID_KSZ8021 0x00221555 | 22 | #define PHY_ID_KSZ8021 0x00221555 |
| 23 | #define PHY_ID_KSZ8031 0x00221556 | 23 | #define PHY_ID_KSZ8031 0x00221556 |
| 24 | #define PHY_ID_KSZ8041 0x00221510 | 24 | #define PHY_ID_KSZ8041 0x00221510 |
| 25 | /* undocumented */ | ||
| 26 | #define PHY_ID_KSZ8041RNLI 0x00221537 | ||
| 25 | #define PHY_ID_KSZ8051 0x00221550 | 27 | #define PHY_ID_KSZ8051 0x00221550 |
| 26 | /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */ | 28 | /* same id: ks8001 Rev. A/B, and ks8721 Rev 3. */ |
| 27 | #define PHY_ID_KSZ8001 0x0022161A | 29 | #define PHY_ID_KSZ8001 0x0022161A |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 0548eb201e05..1cedd000cf29 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -1318,7 +1318,6 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a | |||
| 1318 | 1318 | ||
| 1319 | #if USE_SPLIT_PTE_PTLOCKS | 1319 | #if USE_SPLIT_PTE_PTLOCKS |
| 1320 | #if BLOATED_SPINLOCKS | 1320 | #if BLOATED_SPINLOCKS |
| 1321 | void __init ptlock_cache_init(void); | ||
| 1322 | extern bool ptlock_alloc(struct page *page); | 1321 | extern bool ptlock_alloc(struct page *page); |
| 1323 | extern void ptlock_free(struct page *page); | 1322 | extern void ptlock_free(struct page *page); |
| 1324 | 1323 | ||
| @@ -1327,7 +1326,6 @@ static inline spinlock_t *ptlock_ptr(struct page *page) | |||
| 1327 | return page->ptl; | 1326 | return page->ptl; |
| 1328 | } | 1327 | } |
| 1329 | #else /* BLOATED_SPINLOCKS */ | 1328 | #else /* BLOATED_SPINLOCKS */ |
| 1330 | static inline void ptlock_cache_init(void) {} | ||
| 1331 | static inline bool ptlock_alloc(struct page *page) | 1329 | static inline bool ptlock_alloc(struct page *page) |
| 1332 | { | 1330 | { |
| 1333 | return true; | 1331 | return true; |
| @@ -1380,17 +1378,10 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd) | |||
| 1380 | { | 1378 | { |
| 1381 | return &mm->page_table_lock; | 1379 | return &mm->page_table_lock; |
| 1382 | } | 1380 | } |
| 1383 | static inline void ptlock_cache_init(void) {} | ||
| 1384 | static inline bool ptlock_init(struct page *page) { return true; } | 1381 | static inline bool ptlock_init(struct page *page) { return true; } |
| 1385 | static inline void pte_lock_deinit(struct page *page) {} | 1382 | static inline void pte_lock_deinit(struct page *page) {} |
| 1386 | #endif /* USE_SPLIT_PTE_PTLOCKS */ | 1383 | #endif /* USE_SPLIT_PTE_PTLOCKS */ |
| 1387 | 1384 | ||
| 1388 | static inline void pgtable_init(void) | ||
| 1389 | { | ||
| 1390 | ptlock_cache_init(); | ||
| 1391 | pgtable_cache_init(); | ||
| 1392 | } | ||
| 1393 | |||
| 1394 | static inline bool pgtable_page_ctor(struct page *page) | 1385 | static inline bool pgtable_page_ctor(struct page *page) |
| 1395 | { | 1386 | { |
| 1396 | inc_zone_page_state(page, NR_PAGETABLE); | 1387 | inc_zone_page_state(page, NR_PAGETABLE); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 10f5a7272b80..bd299418a934 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -44,18 +44,22 @@ struct page { | |||
| 44 | /* First double word block */ | 44 | /* First double word block */ |
| 45 | unsigned long flags; /* Atomic flags, some possibly | 45 | unsigned long flags; /* Atomic flags, some possibly |
| 46 | * updated asynchronously */ | 46 | * updated asynchronously */ |
| 47 | struct address_space *mapping; /* If low bit clear, points to | 47 | union { |
| 48 | * inode address_space, or NULL. | 48 | struct address_space *mapping; /* If low bit clear, points to |
| 49 | * If page mapped as anonymous | 49 | * inode address_space, or NULL. |
| 50 | * memory, low bit is set, and | 50 | * If page mapped as anonymous |
| 51 | * it points to anon_vma object: | 51 | * memory, low bit is set, and |
| 52 | * see PAGE_MAPPING_ANON below. | 52 | * it points to anon_vma object: |
| 53 | */ | 53 | * see PAGE_MAPPING_ANON below. |
| 54 | */ | ||
| 55 | void *s_mem; /* slab first object */ | ||
| 56 | }; | ||
| 57 | |||
| 54 | /* Second double word */ | 58 | /* Second double word */ |
| 55 | struct { | 59 | struct { |
| 56 | union { | 60 | union { |
| 57 | pgoff_t index; /* Our offset within mapping. */ | 61 | pgoff_t index; /* Our offset within mapping. */ |
| 58 | void *freelist; /* slub/slob first free object */ | 62 | void *freelist; /* sl[aou]b first free object */ |
| 59 | bool pfmemalloc; /* If set by the page allocator, | 63 | bool pfmemalloc; /* If set by the page allocator, |
| 60 | * ALLOC_NO_WATERMARKS was set | 64 | * ALLOC_NO_WATERMARKS was set |
| 61 | * and the low watermark was not | 65 | * and the low watermark was not |
| @@ -65,9 +69,6 @@ struct page { | |||
| 65 | * this page is only used to | 69 | * this page is only used to |
| 66 | * free other pages. | 70 | * free other pages. |
| 67 | */ | 71 | */ |
| 68 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS | ||
| 69 | pgtable_t pmd_huge_pte; /* protected by page->ptl */ | ||
| 70 | #endif | ||
| 71 | }; | 72 | }; |
| 72 | 73 | ||
| 73 | union { | 74 | union { |
| @@ -114,6 +115,7 @@ struct page { | |||
| 114 | }; | 115 | }; |
| 115 | atomic_t _count; /* Usage count, see below. */ | 116 | atomic_t _count; /* Usage count, see below. */ |
| 116 | }; | 117 | }; |
| 118 | unsigned int active; /* SLAB */ | ||
| 117 | }; | 119 | }; |
| 118 | }; | 120 | }; |
| 119 | 121 | ||
| @@ -135,6 +137,12 @@ struct page { | |||
| 135 | 137 | ||
| 136 | struct list_head list; /* slobs list of pages */ | 138 | struct list_head list; /* slobs list of pages */ |
| 137 | struct slab *slab_page; /* slab fields */ | 139 | struct slab *slab_page; /* slab fields */ |
| 140 | struct rcu_head rcu_head; /* Used by SLAB | ||
| 141 | * when destroying via RCU | ||
| 142 | */ | ||
| 143 | #if defined(CONFIG_TRANSPARENT_HUGEPAGE) && USE_SPLIT_PMD_PTLOCKS | ||
| 144 | pgtable_t pmd_huge_pte; /* protected by page->ptl */ | ||
| 145 | #endif | ||
| 138 | }; | 146 | }; |
| 139 | 147 | ||
| 140 | /* Remainder is not double word aligned */ | 148 | /* Remainder is not double word aligned */ |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 87cce50bd121..009b02481436 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
| @@ -26,11 +26,11 @@ struct msi_desc { | |||
| 26 | struct { | 26 | struct { |
| 27 | __u8 is_msix : 1; | 27 | __u8 is_msix : 1; |
| 28 | __u8 multiple: 3; /* log2 number of messages */ | 28 | __u8 multiple: 3; /* log2 number of messages */ |
| 29 | __u8 maskbit : 1; /* mask-pending bit supported ? */ | 29 | __u8 maskbit : 1; /* mask-pending bit supported ? */ |
| 30 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ | 30 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ |
| 31 | __u8 pos; /* Location of the msi capability */ | 31 | __u8 pos; /* Location of the msi capability */ |
| 32 | __u16 entry_nr; /* specific enabled entry */ | 32 | __u16 entry_nr; /* specific enabled entry */ |
| 33 | unsigned default_irq; /* default pre-assigned irq */ | 33 | unsigned default_irq; /* default pre-assigned irq */ |
| 34 | } msi_attrib; | 34 | } msi_attrib; |
| 35 | 35 | ||
| 36 | u32 masked; /* mask bits */ | 36 | u32 masked; /* mask bits */ |
diff --git a/include/linux/net.h b/include/linux/net.h index b292a0435571..69be3e6079c8 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -164,6 +164,14 @@ struct proto_ops { | |||
| 164 | #endif | 164 | #endif |
| 165 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, | 165 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, |
| 166 | struct msghdr *m, size_t total_len); | 166 | struct msghdr *m, size_t total_len); |
| 167 | /* Notes for implementing recvmsg: | ||
| 168 | * =============================== | ||
| 169 | * msg->msg_namelen should get updated by the recvmsg handlers | ||
| 170 | * iff msg_name != NULL. It is by default 0 to prevent | ||
| 171 | * returning uninitialized memory to user space. The recvfrom | ||
| 172 | * handlers can assume that msg.msg_name is either NULL or has | ||
| 173 | * a minimum size of sizeof(struct sockaddr_storage). | ||
| 174 | */ | ||
| 167 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, | 175 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, |
| 168 | struct msghdr *m, size_t total_len, | 176 | struct msghdr *m, size_t total_len, |
| 169 | int flags); | 177 | int flags); |
| @@ -173,7 +181,7 @@ struct proto_ops { | |||
| 173 | int offset, size_t size, int flags); | 181 | int offset, size_t size, int flags); |
| 174 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, | 182 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, |
| 175 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); | 183 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); |
| 176 | void (*set_peek_off)(struct sock *sk, int val); | 184 | int (*set_peek_off)(struct sock *sk, int val); |
| 177 | }; | 185 | }; |
| 178 | 186 | ||
| 179 | #define DECLARE_SOCKADDR(type, dst, src) \ | 187 | #define DECLARE_SOCKADDR(type, dst, src) \ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7f0ed423a360..d9a550bf3e8e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -1255,7 +1255,7 @@ struct net_device { | |||
| 1255 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | 1255 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ |
| 1256 | unsigned char addr_assign_type; /* hw address assignment type */ | 1256 | unsigned char addr_assign_type; /* hw address assignment type */ |
| 1257 | unsigned char addr_len; /* hardware address length */ | 1257 | unsigned char addr_len; /* hardware address length */ |
| 1258 | unsigned char neigh_priv_len; | 1258 | unsigned short neigh_priv_len; |
| 1259 | unsigned short dev_id; /* Used to differentiate devices | 1259 | unsigned short dev_id; /* Used to differentiate devices |
| 1260 | * that share the same link | 1260 | * that share the same link |
| 1261 | * layer address | 1261 | * layer address |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index c1637062c1ce..12c2cb947df5 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -413,16 +413,6 @@ enum lock_type4 { | |||
| 413 | #define NFS4_VERSION 4 | 413 | #define NFS4_VERSION 4 |
| 414 | #define NFS4_MINOR_VERSION 0 | 414 | #define NFS4_MINOR_VERSION 0 |
| 415 | 415 | ||
| 416 | #if defined(CONFIG_NFS_V4_2) | ||
| 417 | #define NFS4_MAX_MINOR_VERSION 2 | ||
| 418 | #else | ||
| 419 | #if defined(CONFIG_NFS_V4_1) | ||
| 420 | #define NFS4_MAX_MINOR_VERSION 1 | ||
| 421 | #else | ||
| 422 | #define NFS4_MAX_MINOR_VERSION 0 | ||
| 423 | #endif /* CONFIG_NFS_V4_1 */ | ||
| 424 | #endif /* CONFIG_NFS_V4_2 */ | ||
| 425 | |||
| 426 | #define NFS4_DEBUG 1 | 416 | #define NFS4_DEBUG 1 |
| 427 | 417 | ||
| 428 | /* Index of predefined Linux client operations */ | 418 | /* Index of predefined Linux client operations */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 14a48207a304..48997374eaf0 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -507,24 +507,6 @@ extern int nfs_mountpoint_expiry_timeout; | |||
| 507 | extern void nfs_release_automount_timer(void); | 507 | extern void nfs_release_automount_timer(void); |
| 508 | 508 | ||
| 509 | /* | 509 | /* |
| 510 | * linux/fs/nfs/nfs4proc.c | ||
| 511 | */ | ||
| 512 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL | ||
| 513 | extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); | ||
| 514 | static inline void nfs4_label_free(struct nfs4_label *label) | ||
| 515 | { | ||
| 516 | if (label) { | ||
| 517 | kfree(label->label); | ||
| 518 | kfree(label); | ||
| 519 | } | ||
| 520 | return; | ||
| 521 | } | ||
| 522 | #else | ||
| 523 | static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } | ||
| 524 | static inline void nfs4_label_free(void *label) {} | ||
| 525 | #endif | ||
| 526 | |||
| 527 | /* | ||
| 528 | * linux/fs/nfs/unlink.c | 510 | * linux/fs/nfs/unlink.c |
| 529 | */ | 511 | */ |
| 530 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); | 512 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); |
diff --git a/include/linux/padata.h b/include/linux/padata.h index 86292beebfe2..438694650471 100644 --- a/include/linux/padata.h +++ b/include/linux/padata.h | |||
| @@ -129,10 +129,9 @@ struct parallel_data { | |||
| 129 | struct padata_serial_queue __percpu *squeue; | 129 | struct padata_serial_queue __percpu *squeue; |
| 130 | atomic_t reorder_objects; | 130 | atomic_t reorder_objects; |
| 131 | atomic_t refcnt; | 131 | atomic_t refcnt; |
| 132 | atomic_t seq_nr; | ||
| 132 | struct padata_cpumask cpumask; | 133 | struct padata_cpumask cpumask; |
| 133 | spinlock_t lock ____cacheline_aligned; | 134 | spinlock_t lock ____cacheline_aligned; |
| 134 | spinlock_t seq_lock; | ||
| 135 | unsigned int seq_nr; | ||
| 136 | unsigned int processed; | 135 | unsigned int processed; |
| 137 | struct timer_list timer; | 136 | struct timer_list timer; |
| 138 | }; | 137 | }; |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index d006f0ca60f4..5a462c4e5009 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
| @@ -27,7 +27,7 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | |||
| 27 | while (!pci_is_root_bus(pbus)) | 27 | while (!pci_is_root_bus(pbus)) |
| 28 | pbus = pbus->parent; | 28 | pbus = pbus->parent; |
| 29 | 29 | ||
| 30 | return DEVICE_ACPI_HANDLE(pbus->bridge); | 30 | return ACPI_HANDLE(pbus->bridge); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | 33 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) |
| @@ -39,7 +39,7 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | |||
| 39 | else | 39 | else |
| 40 | dev = &pbus->self->dev; | 40 | dev = &pbus->self->dev; |
| 41 | 41 | ||
| 42 | return DEVICE_ACPI_HANDLE(dev); | 42 | return ACPI_HANDLE(dev); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void acpi_pci_add_bus(struct pci_bus *bus); | 45 | void acpi_pci_add_bus(struct pci_bus *bus); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 835ec7bf6c05..a13d6825e586 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -32,7 +32,6 @@ | |||
| 32 | #include <linux/irqreturn.h> | 32 | #include <linux/irqreturn.h> |
| 33 | #include <uapi/linux/pci.h> | 33 | #include <uapi/linux/pci.h> |
| 34 | 34 | ||
| 35 | /* Include the ID list */ | ||
| 36 | #include <linux/pci_ids.h> | 35 | #include <linux/pci_ids.h> |
| 37 | 36 | ||
| 38 | /* | 37 | /* |
| @@ -42,9 +41,10 @@ | |||
| 42 | * | 41 | * |
| 43 | * 7:3 = slot | 42 | * 7:3 = slot |
| 44 | * 2:0 = function | 43 | * 2:0 = function |
| 45 | * PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined uapi/linux/pci.h | 44 | * |
| 45 | * PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() are defined in uapi/linux/pci.h. | ||
| 46 | * In the interest of not exposing interfaces to user-space unnecessarily, | 46 | * In the interest of not exposing interfaces to user-space unnecessarily, |
| 47 | * the following kernel only defines are being added here. | 47 | * the following kernel-only defines are being added here. |
| 48 | */ | 48 | */ |
| 49 | #define PCI_DEVID(bus, devfn) ((((u16)bus) << 8) | devfn) | 49 | #define PCI_DEVID(bus, devfn) ((((u16)bus) << 8) | devfn) |
| 50 | /* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */ | 50 | /* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */ |
| @@ -153,10 +153,10 @@ enum pcie_reset_state { | |||
| 153 | /* Reset is NOT asserted (Use to deassert reset) */ | 153 | /* Reset is NOT asserted (Use to deassert reset) */ |
| 154 | pcie_deassert_reset = (__force pcie_reset_state_t) 1, | 154 | pcie_deassert_reset = (__force pcie_reset_state_t) 1, |
| 155 | 155 | ||
| 156 | /* Use #PERST to reset PCI-E device */ | 156 | /* Use #PERST to reset PCIe device */ |
| 157 | pcie_warm_reset = (__force pcie_reset_state_t) 2, | 157 | pcie_warm_reset = (__force pcie_reset_state_t) 2, |
| 158 | 158 | ||
| 159 | /* Use PCI-E Hot Reset to reset device */ | 159 | /* Use PCIe Hot Reset to reset device */ |
| 160 | pcie_hot_reset = (__force pcie_reset_state_t) 3 | 160 | pcie_hot_reset = (__force pcie_reset_state_t) 3 |
| 161 | }; | 161 | }; |
| 162 | 162 | ||
| @@ -259,13 +259,13 @@ struct pci_dev { | |||
| 259 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ | 259 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ |
| 260 | u8 revision; /* PCI revision, low byte of class word */ | 260 | u8 revision; /* PCI revision, low byte of class word */ |
| 261 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ | 261 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ |
| 262 | u8 pcie_cap; /* PCI-E capability offset */ | 262 | u8 pcie_cap; /* PCIe capability offset */ |
| 263 | u8 msi_cap; /* MSI capability offset */ | 263 | u8 msi_cap; /* MSI capability offset */ |
| 264 | u8 msix_cap; /* MSI-X capability offset */ | 264 | u8 msix_cap; /* MSI-X capability offset */ |
| 265 | u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */ | 265 | u8 pcie_mpss:3; /* PCIe Max Payload Size Supported */ |
| 266 | u8 rom_base_reg; /* which config register controls the ROM */ | 266 | u8 rom_base_reg; /* which config register controls the ROM */ |
| 267 | u8 pin; /* which interrupt pin this device uses */ | 267 | u8 pin; /* which interrupt pin this device uses */ |
| 268 | u16 pcie_flags_reg; /* cached PCI-E Capabilities Register */ | 268 | u16 pcie_flags_reg; /* cached PCIe Capabilities Register */ |
| 269 | 269 | ||
| 270 | struct pci_driver *driver; /* which driver has allocated this device */ | 270 | struct pci_driver *driver; /* which driver has allocated this device */ |
| 271 | u64 dma_mask; /* Mask of the bits of bus address this | 271 | u64 dma_mask; /* Mask of the bits of bus address this |
| @@ -300,7 +300,7 @@ struct pci_dev { | |||
| 300 | unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ | 300 | unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ |
| 301 | 301 | ||
| 302 | #ifdef CONFIG_PCIEASPM | 302 | #ifdef CONFIG_PCIEASPM |
| 303 | struct pcie_link_state *link_state; /* ASPM link state. */ | 303 | struct pcie_link_state *link_state; /* ASPM link state */ |
| 304 | #endif | 304 | #endif |
| 305 | 305 | ||
| 306 | pci_channel_state_t error_state; /* current connectivity state */ | 306 | pci_channel_state_t error_state; /* current connectivity state */ |
| @@ -317,7 +317,7 @@ struct pci_dev { | |||
| 317 | 317 | ||
| 318 | bool match_driver; /* Skip attaching driver */ | 318 | bool match_driver; /* Skip attaching driver */ |
| 319 | /* These fields are used by common fixups */ | 319 | /* These fields are used by common fixups */ |
| 320 | unsigned int transparent:1; /* Transparent PCI bridge */ | 320 | unsigned int transparent:1; /* Subtractive decode PCI bridge */ |
| 321 | unsigned int multifunction:1;/* Part of multi-function device */ | 321 | unsigned int multifunction:1;/* Part of multi-function device */ |
| 322 | /* keep track of device state */ | 322 | /* keep track of device state */ |
| 323 | unsigned int is_added:1; | 323 | unsigned int is_added:1; |
| @@ -326,7 +326,7 @@ struct pci_dev { | |||
| 326 | unsigned int block_cfg_access:1; /* config space access is blocked */ | 326 | unsigned int block_cfg_access:1; /* config space access is blocked */ |
| 327 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ | 327 | unsigned int broken_parity_status:1; /* Device generates false positive parity */ |
| 328 | unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ | 328 | unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ |
| 329 | unsigned int msi_enabled:1; | 329 | unsigned int msi_enabled:1; |
| 330 | unsigned int msix_enabled:1; | 330 | unsigned int msix_enabled:1; |
| 331 | unsigned int ari_enabled:1; /* ARI forwarding */ | 331 | unsigned int ari_enabled:1; /* ARI forwarding */ |
| 332 | unsigned int is_managed:1; | 332 | unsigned int is_managed:1; |
| @@ -371,7 +371,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev) | |||
| 371 | if (dev->is_virtfn) | 371 | if (dev->is_virtfn) |
| 372 | dev = dev->physfn; | 372 | dev = dev->physfn; |
| 373 | #endif | 373 | #endif |
| 374 | |||
| 375 | return dev; | 374 | return dev; |
| 376 | } | 375 | } |
| 377 | 376 | ||
| @@ -456,7 +455,7 @@ struct pci_bus { | |||
| 456 | char name[48]; | 455 | char name[48]; |
| 457 | 456 | ||
| 458 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ | 457 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ |
| 459 | pci_bus_flags_t bus_flags; /* Inherited by child busses */ | 458 | pci_bus_flags_t bus_flags; /* inherited by child buses */ |
| 460 | struct device *bridge; | 459 | struct device *bridge; |
| 461 | struct device dev; | 460 | struct device dev; |
| 462 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ | 461 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ |
| @@ -468,7 +467,7 @@ struct pci_bus { | |||
| 468 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) | 467 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) |
| 469 | 468 | ||
| 470 | /* | 469 | /* |
| 471 | * Returns true if the pci bus is root (behind host-pci bridge), | 470 | * Returns true if the PCI bus is root (behind host-PCI bridge), |
| 472 | * false otherwise | 471 | * false otherwise |
| 473 | * | 472 | * |
| 474 | * Some code assumes that "bus->self == NULL" means that bus is a root bus. | 473 | * Some code assumes that "bus->self == NULL" means that bus is a root bus. |
| @@ -510,7 +509,7 @@ static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { return false; | |||
| 510 | #define PCIBIOS_BUFFER_TOO_SMALL 0x89 | 509 | #define PCIBIOS_BUFFER_TOO_SMALL 0x89 |
| 511 | 510 | ||
| 512 | /* | 511 | /* |
| 513 | * Translate above to generic errno for passing back through non-pci. | 512 | * Translate above to generic errno for passing back through non-PCI code. |
| 514 | */ | 513 | */ |
| 515 | static inline int pcibios_err_to_errno(int err) | 514 | static inline int pcibios_err_to_errno(int err) |
| 516 | { | 515 | { |
| @@ -561,11 +560,12 @@ struct pci_dynids { | |||
| 561 | struct list_head list; /* for IDs added at runtime */ | 560 | struct list_head list; /* for IDs added at runtime */ |
| 562 | }; | 561 | }; |
| 563 | 562 | ||
| 564 | /* ---------------------------------------------------------------- */ | 563 | |
| 565 | /** PCI Error Recovery System (PCI-ERS). If a PCI device driver provides | 564 | /* |
| 566 | * a set of callbacks in struct pci_error_handlers, then that device driver | 565 | * PCI Error Recovery System (PCI-ERS). If a PCI device driver provides |
| 567 | * will be notified of PCI bus errors, and will be driven to recovery | 566 | * a set of callbacks in struct pci_error_handlers, that device driver |
| 568 | * when an error occurs. | 567 | * will be notified of PCI bus errors, and will be driven to recovery |
| 568 | * when an error occurs. | ||
| 569 | */ | 569 | */ |
| 570 | 570 | ||
| 571 | typedef unsigned int __bitwise pci_ers_result_t; | 571 | typedef unsigned int __bitwise pci_ers_result_t; |
| @@ -609,7 +609,6 @@ struct pci_error_handlers { | |||
| 609 | void (*resume)(struct pci_dev *dev); | 609 | void (*resume)(struct pci_dev *dev); |
| 610 | }; | 610 | }; |
| 611 | 611 | ||
| 612 | /* ---------------------------------------------------------------- */ | ||
| 613 | 612 | ||
| 614 | struct module; | 613 | struct module; |
| 615 | struct pci_driver { | 614 | struct pci_driver { |
| @@ -713,10 +712,10 @@ extern enum pcie_bus_config_types pcie_bus_config; | |||
| 713 | 712 | ||
| 714 | extern struct bus_type pci_bus_type; | 713 | extern struct bus_type pci_bus_type; |
| 715 | 714 | ||
| 716 | /* Do NOT directly access these two variables, unless you are arch specific pci | 715 | /* Do NOT directly access these two variables, unless you are arch-specific PCI |
| 717 | * code, or pci core code. */ | 716 | * code, or PCI core code. */ |
| 718 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ | 717 | extern struct list_head pci_root_buses; /* list of all known PCI buses */ |
| 719 | /* Some device drivers need know if pci is initiated */ | 718 | /* Some device drivers need know if PCI is initiated */ |
| 720 | int no_pci_devices(void); | 719 | int no_pci_devices(void); |
| 721 | 720 | ||
| 722 | void pcibios_resource_survey_bus(struct pci_bus *bus); | 721 | void pcibios_resource_survey_bus(struct pci_bus *bus); |
| @@ -724,7 +723,7 @@ void pcibios_add_bus(struct pci_bus *bus); | |||
| 724 | void pcibios_remove_bus(struct pci_bus *bus); | 723 | void pcibios_remove_bus(struct pci_bus *bus); |
| 725 | void pcibios_fixup_bus(struct pci_bus *); | 724 | void pcibios_fixup_bus(struct pci_bus *); |
| 726 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); | 725 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); |
| 727 | /* Architecture specific versions may override this (weak) */ | 726 | /* Architecture-specific versions may override this (weak) */ |
| 728 | char *pcibios_setup(char *str); | 727 | char *pcibios_setup(char *str); |
| 729 | 728 | ||
| 730 | /* Used only when drivers/pci/setup.c is used */ | 729 | /* Used only when drivers/pci/setup.c is used */ |
| @@ -961,6 +960,7 @@ void pci_update_resource(struct pci_dev *dev, int resno); | |||
| 961 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 960 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
| 962 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); | 961 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); |
| 963 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); | 962 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); |
| 963 | bool pci_device_is_present(struct pci_dev *pdev); | ||
| 964 | 964 | ||
| 965 | /* ROM control related routines */ | 965 | /* ROM control related routines */ |
| 966 | int pci_enable_rom(struct pci_dev *pdev); | 966 | int pci_enable_rom(struct pci_dev *pdev); |
| @@ -1258,7 +1258,7 @@ void pci_cfg_access_unlock(struct pci_dev *dev); | |||
| 1258 | 1258 | ||
| 1259 | /* | 1259 | /* |
| 1260 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), | 1260 | * PCI domain support. Sometimes called PCI segment (eg by ACPI), |
| 1261 | * a PCI domain is defined to be a set of PCI busses which share | 1261 | * a PCI domain is defined to be a set of PCI buses which share |
| 1262 | * configuration space. | 1262 | * configuration space. |
| 1263 | */ | 1263 | */ |
| 1264 | #ifdef CONFIG_PCI_DOMAINS | 1264 | #ifdef CONFIG_PCI_DOMAINS |
| @@ -1568,65 +1568,65 @@ enum pci_fixup_pass { | |||
| 1568 | /* Anonymous variables would be nice... */ | 1568 | /* Anonymous variables would be nice... */ |
| 1569 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ | 1569 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ |
| 1570 | class_shift, hook) \ | 1570 | class_shift, hook) \ |
| 1571 | static const struct pci_fixup __pci_fixup_##name __used \ | 1571 | static const struct pci_fixup __PASTE(__pci_fixup_##name,__LINE__) __used \ |
| 1572 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ | 1572 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ |
| 1573 | = { vendor, device, class, class_shift, hook }; | 1573 | = { vendor, device, class, class_shift, hook }; |
| 1574 | 1574 | ||
| 1575 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ | 1575 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ |
| 1576 | class_shift, hook) \ | 1576 | class_shift, hook) \ |
| 1577 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1577 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
| 1578 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1578 | hook, vendor, device, class, class_shift, hook) |
| 1579 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ | 1579 | #define DECLARE_PCI_FIXUP_CLASS_HEADER(vendor, device, class, \ |
| 1580 | class_shift, hook) \ | 1580 | class_shift, hook) \ |
| 1581 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1581 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
| 1582 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1582 | hook, vendor, device, class, class_shift, hook) |
| 1583 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ | 1583 | #define DECLARE_PCI_FIXUP_CLASS_FINAL(vendor, device, class, \ |
| 1584 | class_shift, hook) \ | 1584 | class_shift, hook) \ |
| 1585 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1585 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
| 1586 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1586 | hook, vendor, device, class, class_shift, hook) |
| 1587 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ | 1587 | #define DECLARE_PCI_FIXUP_CLASS_ENABLE(vendor, device, class, \ |
| 1588 | class_shift, hook) \ | 1588 | class_shift, hook) \ |
| 1589 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1589 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
| 1590 | vendor##device##hook, vendor, device, class, class_shift, hook) | 1590 | hook, vendor, device, class, class_shift, hook) |
| 1591 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ | 1591 | #define DECLARE_PCI_FIXUP_CLASS_RESUME(vendor, device, class, \ |
| 1592 | class_shift, hook) \ | 1592 | class_shift, hook) \ |
| 1593 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1593 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
| 1594 | resume##vendor##device##hook, vendor, device, class, \ | 1594 | resume##hook, vendor, device, class, \ |
| 1595 | class_shift, hook) | 1595 | class_shift, hook) |
| 1596 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ | 1596 | #define DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(vendor, device, class, \ |
| 1597 | class_shift, hook) \ | 1597 | class_shift, hook) \ |
| 1598 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1598 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
| 1599 | resume_early##vendor##device##hook, vendor, device, \ | 1599 | resume_early##hook, vendor, device, \ |
| 1600 | class, class_shift, hook) | 1600 | class, class_shift, hook) |
| 1601 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ | 1601 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND(vendor, device, class, \ |
| 1602 | class_shift, hook) \ | 1602 | class_shift, hook) \ |
| 1603 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1603 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
| 1604 | suspend##vendor##device##hook, vendor, device, class, \ | 1604 | suspend##hook, vendor, device, class, \ |
| 1605 | class_shift, hook) | 1605 | class_shift, hook) |
| 1606 | 1606 | ||
| 1607 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ | 1607 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ |
| 1608 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1608 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
| 1609 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1609 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1610 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ | 1610 | #define DECLARE_PCI_FIXUP_HEADER(vendor, device, hook) \ |
| 1611 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ | 1611 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_header, \ |
| 1612 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1612 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1613 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ | 1613 | #define DECLARE_PCI_FIXUP_FINAL(vendor, device, hook) \ |
| 1614 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ | 1614 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_final, \ |
| 1615 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1615 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1616 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ | 1616 | #define DECLARE_PCI_FIXUP_ENABLE(vendor, device, hook) \ |
| 1617 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ | 1617 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_enable, \ |
| 1618 | vendor##device##hook, vendor, device, PCI_ANY_ID, 0, hook) | 1618 | hook, vendor, device, PCI_ANY_ID, 0, hook) |
| 1619 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ | 1619 | #define DECLARE_PCI_FIXUP_RESUME(vendor, device, hook) \ |
| 1620 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ | 1620 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume, \ |
| 1621 | resume##vendor##device##hook, vendor, device, \ | 1621 | resume##hook, vendor, device, \ |
| 1622 | PCI_ANY_ID, 0, hook) | 1622 | PCI_ANY_ID, 0, hook) |
| 1623 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ | 1623 | #define DECLARE_PCI_FIXUP_RESUME_EARLY(vendor, device, hook) \ |
| 1624 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ | 1624 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_resume_early, \ |
| 1625 | resume_early##vendor##device##hook, vendor, device, \ | 1625 | resume_early##hook, vendor, device, \ |
| 1626 | PCI_ANY_ID, 0, hook) | 1626 | PCI_ANY_ID, 0, hook) |
| 1627 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ | 1627 | #define DECLARE_PCI_FIXUP_SUSPEND(vendor, device, hook) \ |
| 1628 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1628 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
| 1629 | suspend##vendor##device##hook, vendor, device, \ | 1629 | suspend##hook, vendor, device, \ |
| 1630 | PCI_ANY_ID, 0, hook) | 1630 | PCI_ANY_ID, 0, hook) |
| 1631 | 1631 | ||
| 1632 | #ifdef CONFIG_PCI_QUIRKS | 1632 | #ifdef CONFIG_PCI_QUIRKS |
| @@ -1672,7 +1672,7 @@ extern u8 pci_cache_line_size; | |||
| 1672 | extern unsigned long pci_hotplug_io_size; | 1672 | extern unsigned long pci_hotplug_io_size; |
| 1673 | extern unsigned long pci_hotplug_mem_size; | 1673 | extern unsigned long pci_hotplug_mem_size; |
| 1674 | 1674 | ||
| 1675 | /* Architecture specific versions may override these (weak) */ | 1675 | /* Architecture-specific versions may override these (weak) */ |
| 1676 | int pcibios_add_platform_entries(struct pci_dev *dev); | 1676 | int pcibios_add_platform_entries(struct pci_dev *dev); |
| 1677 | void pcibios_disable_device(struct pci_dev *dev); | 1677 | void pcibios_disable_device(struct pci_dev *dev); |
| 1678 | void pcibios_set_master(struct pci_dev *dev); | 1678 | void pcibios_set_master(struct pci_dev *dev); |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 430dd963707b..a2e2f1d17e16 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
| @@ -39,8 +39,8 @@ | |||
| 39 | * @hardware_test: Called to run a specified hardware test on the specified | 39 | * @hardware_test: Called to run a specified hardware test on the specified |
| 40 | * slot. | 40 | * slot. |
| 41 | * @get_power_status: Called to get the current power status of a slot. | 41 | * @get_power_status: Called to get the current power status of a slot. |
| 42 | * If this field is NULL, the value passed in the struct hotplug_slot_info | 42 | * If this field is NULL, the value passed in the struct hotplug_slot_info |
| 43 | * will be used when this value is requested by a user. | 43 | * will be used when this value is requested by a user. |
| 44 | * @get_attention_status: Called to get the current attention status of a slot. | 44 | * @get_attention_status: Called to get the current attention status of a slot. |
| 45 | * If this field is NULL, the value passed in the struct hotplug_slot_info | 45 | * If this field is NULL, the value passed in the struct hotplug_slot_info |
| 46 | * will be used when this value is requested by a user. | 46 | * will be used when this value is requested by a user. |
| @@ -191,4 +191,3 @@ static inline int pci_get_hp_params(struct pci_dev *dev, | |||
| 191 | 191 | ||
| 192 | void pci_configure_slot(struct pci_dev *dev); | 192 | void pci_configure_slot(struct pci_dev *dev); |
| 193 | #endif | 193 | #endif |
| 194 | |||
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index 9572669eea97..4f1089f2cc98 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) | 23 | #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) |
| 24 | 24 | ||
| 25 | struct pcie_device { | 25 | struct pcie_device { |
| 26 | int irq; /* Service IRQ/MSI/MSI-X Vector */ | 26 | int irq; /* Service IRQ/MSI/MSI-X Vector */ |
| 27 | struct pci_dev *port; /* Root/Upstream/Downstream Port */ | 27 | struct pci_dev *port; /* Root/Upstream/Downstream Port */ |
| 28 | u32 service; /* Port service this device represents */ | 28 | u32 service; /* Port service this device represents */ |
| 29 | void *priv_data; /* Service Private Data */ | 29 | void *priv_data; /* Service Private Data */ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 64ab823f7b74..48a4dc3cb8cf 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -559,6 +559,7 @@ static inline int phy_read_status(struct phy_device *phydev) { | |||
| 559 | return phydev->drv->read_status(phydev); | 559 | return phydev->drv->read_status(phydev); |
| 560 | } | 560 | } |
| 561 | 561 | ||
| 562 | int genphy_setup_forced(struct phy_device *phydev); | ||
| 562 | int genphy_restart_aneg(struct phy_device *phydev); | 563 | int genphy_restart_aneg(struct phy_device *phydev); |
| 563 | int genphy_config_aneg(struct phy_device *phydev); | 564 | int genphy_config_aneg(struct phy_device *phydev); |
| 564 | int genphy_update_link(struct phy_device *phydev); | 565 | int genphy_update_link(struct phy_device *phydev); |
diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h index 179fb91bb5f2..f50821cb64be 100644 --- a/include/linux/platform_data/edma.h +++ b/include/linux/platform_data/edma.h | |||
| @@ -67,10 +67,10 @@ struct edmacc_param { | |||
| 67 | #define ITCCHEN BIT(23) | 67 | #define ITCCHEN BIT(23) |
| 68 | 68 | ||
| 69 | /*ch_status paramater of callback function possible values*/ | 69 | /*ch_status paramater of callback function possible values*/ |
| 70 | #define DMA_COMPLETE 1 | 70 | #define EDMA_DMA_COMPLETE 1 |
| 71 | #define DMA_CC_ERROR 2 | 71 | #define EDMA_DMA_CC_ERROR 2 |
| 72 | #define DMA_TC1_ERROR 3 | 72 | #define EDMA_DMA_TC1_ERROR 3 |
| 73 | #define DMA_TC2_ERROR 4 | 73 | #define EDMA_DMA_TC2_ERROR 4 |
| 74 | 74 | ||
| 75 | enum address_mode { | 75 | enum address_mode { |
| 76 | INCR = 0, | 76 | INCR = 0, |
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h index 931bc616219f..d169820203dd 100644 --- a/include/linux/preempt_mask.h +++ b/include/linux/preempt_mask.h | |||
| @@ -11,36 +11,23 @@ | |||
| 11 | * - bits 0-7 are the preemption count (max preemption depth: 256) | 11 | * - bits 0-7 are the preemption count (max preemption depth: 256) |
| 12 | * - bits 8-15 are the softirq count (max # of softirqs: 256) | 12 | * - bits 8-15 are the softirq count (max # of softirqs: 256) |
| 13 | * | 13 | * |
| 14 | * The hardirq count can in theory reach the same as NR_IRQS. | 14 | * The hardirq count could in theory be the same as the number of |
| 15 | * In reality, the number of nested IRQS is limited to the stack | 15 | * interrupts in the system, but we run all interrupt handlers with |
| 16 | * size as well. For archs with over 1000 IRQS it is not practical | 16 | * interrupts disabled, so we cannot have nesting interrupts. Though |
| 17 | * to expect that they will all nest. We give a max of 10 bits for | 17 | * there are a few palaeontologic drivers which reenable interrupts in |
| 18 | * hardirq nesting. An arch may choose to give less than 10 bits. | 18 | * the handler, so we need more than one bit here. |
| 19 | * m68k expects it to be 8. | ||
| 20 | * | 19 | * |
| 21 | * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024) | 20 | * PREEMPT_MASK: 0x000000ff |
| 22 | * - bit 26 is the NMI_MASK | 21 | * SOFTIRQ_MASK: 0x0000ff00 |
| 23 | * - bit 27 is the PREEMPT_ACTIVE flag | 22 | * HARDIRQ_MASK: 0x000f0000 |
| 24 | * | 23 | * NMI_MASK: 0x00100000 |
| 25 | * PREEMPT_MASK: 0x000000ff | 24 | * PREEMPT_ACTIVE: 0x00200000 |
| 26 | * SOFTIRQ_MASK: 0x0000ff00 | ||
| 27 | * HARDIRQ_MASK: 0x03ff0000 | ||
| 28 | * NMI_MASK: 0x04000000 | ||
| 29 | */ | 25 | */ |
| 30 | #define PREEMPT_BITS 8 | 26 | #define PREEMPT_BITS 8 |
| 31 | #define SOFTIRQ_BITS 8 | 27 | #define SOFTIRQ_BITS 8 |
| 28 | #define HARDIRQ_BITS 4 | ||
| 32 | #define NMI_BITS 1 | 29 | #define NMI_BITS 1 |
| 33 | 30 | ||
| 34 | #define MAX_HARDIRQ_BITS 10 | ||
| 35 | |||
| 36 | #ifndef HARDIRQ_BITS | ||
| 37 | # define HARDIRQ_BITS MAX_HARDIRQ_BITS | ||
| 38 | #endif | ||
| 39 | |||
| 40 | #if HARDIRQ_BITS > MAX_HARDIRQ_BITS | ||
| 41 | #error HARDIRQ_BITS too high! | ||
| 42 | #endif | ||
| 43 | |||
| 44 | #define PREEMPT_SHIFT 0 | 31 | #define PREEMPT_SHIFT 0 |
| 45 | #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) | 32 | #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) |
| 46 | #define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) | 33 | #define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) |
| @@ -60,15 +47,9 @@ | |||
| 60 | 47 | ||
| 61 | #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) | 48 | #define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET) |
| 62 | 49 | ||
| 63 | #ifndef PREEMPT_ACTIVE | ||
| 64 | #define PREEMPT_ACTIVE_BITS 1 | 50 | #define PREEMPT_ACTIVE_BITS 1 |
| 65 | #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) | 51 | #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) |
| 66 | #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT) | 52 | #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT) |
| 67 | #endif | ||
| 68 | |||
| 69 | #if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS)) | ||
| 70 | #error PREEMPT_ACTIVE is too low! | ||
| 71 | #endif | ||
| 72 | 53 | ||
| 73 | #define hardirq_count() (preempt_count() & HARDIRQ_MASK) | 54 | #define hardirq_count() (preempt_count() & HARDIRQ_MASK) |
| 74 | #define softirq_count() (preempt_count() & SOFTIRQ_MASK) | 55 | #define softirq_count() (preempt_count() & SOFTIRQ_MASK) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 6f7ffa460089..768b037dfacb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -22,7 +22,7 @@ struct sched_param { | |||
| 22 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
| 23 | #include <linux/nodemask.h> | 23 | #include <linux/nodemask.h> |
| 24 | #include <linux/mm_types.h> | 24 | #include <linux/mm_types.h> |
| 25 | #include <linux/preempt.h> | 25 | #include <linux/preempt_mask.h> |
| 26 | 26 | ||
| 27 | #include <asm/page.h> | 27 | #include <asm/page.h> |
| 28 | #include <asm/ptrace.h> | 28 | #include <asm/ptrace.h> |
| @@ -831,8 +831,6 @@ struct sched_domain { | |||
| 831 | unsigned int balance_interval; /* initialise to 1. units in ms. */ | 831 | unsigned int balance_interval; /* initialise to 1. units in ms. */ |
| 832 | unsigned int nr_balance_failed; /* initialise to 0 */ | 832 | unsigned int nr_balance_failed; /* initialise to 0 */ |
| 833 | 833 | ||
| 834 | u64 last_update; | ||
| 835 | |||
| 836 | /* idle_balance() stats */ | 834 | /* idle_balance() stats */ |
| 837 | u64 max_newidle_lb_cost; | 835 | u64 max_newidle_lb_cost; |
| 838 | unsigned long next_decay_max_lb_cost; | 836 | unsigned long next_decay_max_lb_cost; |
diff --git a/include/linux/security.h b/include/linux/security.h index 9d37e2b9d3ec..5623a7f965b7 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -1052,17 +1052,25 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1052 | * @xfrm_policy_delete_security: | 1052 | * @xfrm_policy_delete_security: |
| 1053 | * @ctx contains the xfrm_sec_ctx. | 1053 | * @ctx contains the xfrm_sec_ctx. |
| 1054 | * Authorize deletion of xp->security. | 1054 | * Authorize deletion of xp->security. |
| 1055 | * @xfrm_state_alloc_security: | 1055 | * @xfrm_state_alloc: |
| 1056 | * @x contains the xfrm_state being added to the Security Association | 1056 | * @x contains the xfrm_state being added to the Security Association |
| 1057 | * Database by the XFRM system. | 1057 | * Database by the XFRM system. |
| 1058 | * @sec_ctx contains the security context information being provided by | 1058 | * @sec_ctx contains the security context information being provided by |
| 1059 | * the user-level SA generation program (e.g., setkey or racoon). | 1059 | * the user-level SA generation program (e.g., setkey or racoon). |
| 1060 | * @secid contains the secid from which to take the mls portion of the context. | ||
| 1061 | * Allocate a security structure to the x->security field; the security | 1060 | * Allocate a security structure to the x->security field; the security |
| 1062 | * field is initialized to NULL when the xfrm_state is allocated. Set the | 1061 | * field is initialized to NULL when the xfrm_state is allocated. Set the |
| 1063 | * context to correspond to either sec_ctx or polsec, with the mls portion | 1062 | * context to correspond to sec_ctx. Return 0 if operation was successful |
| 1064 | * taken from secid in the latter case. | 1063 | * (memory to allocate, legal context). |
| 1065 | * Return 0 if operation was successful (memory to allocate, legal context). | 1064 | * @xfrm_state_alloc_acquire: |
| 1065 | * @x contains the xfrm_state being added to the Security Association | ||
| 1066 | * Database by the XFRM system. | ||
| 1067 | * @polsec contains the policy's security context. | ||
| 1068 | * @secid contains the secid from which to take the mls portion of the | ||
| 1069 | * context. | ||
| 1070 | * Allocate a security structure to the x->security field; the security | ||
| 1071 | * field is initialized to NULL when the xfrm_state is allocated. Set the | ||
| 1072 | * context to correspond to secid. Return 0 if operation was successful | ||
| 1073 | * (memory to allocate, legal context). | ||
| 1066 | * @xfrm_state_free_security: | 1074 | * @xfrm_state_free_security: |
| 1067 | * @x contains the xfrm_state. | 1075 | * @x contains the xfrm_state. |
| 1068 | * Deallocate x->security. | 1076 | * Deallocate x->security. |
| @@ -1679,9 +1687,11 @@ struct security_operations { | |||
| 1679 | int (*xfrm_policy_clone_security) (struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctx); | 1687 | int (*xfrm_policy_clone_security) (struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctx); |
| 1680 | void (*xfrm_policy_free_security) (struct xfrm_sec_ctx *ctx); | 1688 | void (*xfrm_policy_free_security) (struct xfrm_sec_ctx *ctx); |
| 1681 | int (*xfrm_policy_delete_security) (struct xfrm_sec_ctx *ctx); | 1689 | int (*xfrm_policy_delete_security) (struct xfrm_sec_ctx *ctx); |
| 1682 | int (*xfrm_state_alloc_security) (struct xfrm_state *x, | 1690 | int (*xfrm_state_alloc) (struct xfrm_state *x, |
| 1683 | struct xfrm_user_sec_ctx *sec_ctx, | 1691 | struct xfrm_user_sec_ctx *sec_ctx); |
| 1684 | u32 secid); | 1692 | int (*xfrm_state_alloc_acquire) (struct xfrm_state *x, |
| 1693 | struct xfrm_sec_ctx *polsec, | ||
| 1694 | u32 secid); | ||
| 1685 | void (*xfrm_state_free_security) (struct xfrm_state *x); | 1695 | void (*xfrm_state_free_security) (struct xfrm_state *x); |
| 1686 | int (*xfrm_state_delete_security) (struct xfrm_state *x); | 1696 | int (*xfrm_state_delete_security) (struct xfrm_state *x); |
| 1687 | int (*xfrm_policy_lookup) (struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir); | 1697 | int (*xfrm_policy_lookup) (struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir); |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 1e8a8b6e837d..cf87a24c0f92 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
| @@ -354,6 +354,35 @@ static inline void read_sequnlock_excl(seqlock_t *sl) | |||
| 354 | spin_unlock(&sl->lock); | 354 | spin_unlock(&sl->lock); |
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | /** | ||
| 358 | * read_seqbegin_or_lock - begin a sequence number check or locking block | ||
| 359 | * @lock: sequence lock | ||
| 360 | * @seq : sequence number to be checked | ||
| 361 | * | ||
| 362 | * First try it once optimistically without taking the lock. If that fails, | ||
| 363 | * take the lock. The sequence number is also used as a marker for deciding | ||
| 364 | * whether to be a reader (even) or writer (odd). | ||
| 365 | * N.B. seq must be initialized to an even number to begin with. | ||
| 366 | */ | ||
| 367 | static inline void read_seqbegin_or_lock(seqlock_t *lock, int *seq) | ||
| 368 | { | ||
| 369 | if (!(*seq & 1)) /* Even */ | ||
| 370 | *seq = read_seqbegin(lock); | ||
| 371 | else /* Odd */ | ||
| 372 | read_seqlock_excl(lock); | ||
| 373 | } | ||
| 374 | |||
| 375 | static inline int need_seqretry(seqlock_t *lock, int seq) | ||
| 376 | { | ||
| 377 | return !(seq & 1) && read_seqretry(lock, seq); | ||
| 378 | } | ||
| 379 | |||
| 380 | static inline void done_seqretry(seqlock_t *lock, int seq) | ||
| 381 | { | ||
| 382 | if (seq & 1) | ||
| 383 | read_sequnlock_excl(lock); | ||
| 384 | } | ||
| 385 | |||
| 357 | static inline void read_seqlock_excl_bh(seqlock_t *sl) | 386 | static inline void read_seqlock_excl_bh(seqlock_t *sl) |
| 358 | { | 387 | { |
| 359 | spin_lock_bh(&sl->lock); | 388 | spin_lock_bh(&sl->lock); |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 30aa0dc60d75..9d55438bc4ad 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
| @@ -47,6 +47,8 @@ extern int shmem_init(void); | |||
| 47 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); | 47 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); |
| 48 | extern struct file *shmem_file_setup(const char *name, | 48 | extern struct file *shmem_file_setup(const char *name, |
| 49 | loff_t size, unsigned long flags); | 49 | loff_t size, unsigned long flags); |
| 50 | extern struct file *shmem_kernel_file_setup(const char *name, loff_t size, | ||
| 51 | unsigned long flags); | ||
| 50 | extern int shmem_zero_setup(struct vm_area_struct *); | 52 | extern int shmem_zero_setup(struct vm_area_struct *); |
| 51 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); | 53 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); |
| 52 | extern void shmem_unlock_mapping(struct address_space *mapping); | 54 | extern void shmem_unlock_mapping(struct address_space *mapping); |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 74f105847d13..1e2f4fe12773 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -53,7 +53,14 @@ | |||
| 53 | * } | 53 | * } |
| 54 | * rcu_read_unlock(); | 54 | * rcu_read_unlock(); |
| 55 | * | 55 | * |
| 56 | * See also the comment on struct slab_rcu in mm/slab.c. | 56 | * This is useful if we need to approach a kernel structure obliquely, |
| 57 | * from its address obtained without the usual locking. We can lock | ||
| 58 | * the structure to stabilize it and check it's still at the given address, | ||
| 59 | * only if we can be sure that the memory has not been meanwhile reused | ||
| 60 | * for some other kind of object (which our subsystem's lock might corrupt). | ||
| 61 | * | ||
| 62 | * rcu_read_lock before reading the address, then rcu_read_unlock after | ||
| 63 | * taking the spinlock within the structure expected at that address. | ||
| 57 | */ | 64 | */ |
| 58 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ | 65 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* Defer freeing slabs to RCU */ |
| 59 | #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ | 66 | #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ |
| @@ -381,10 +388,55 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) | |||
| 381 | /** | 388 | /** |
| 382 | * kmalloc - allocate memory | 389 | * kmalloc - allocate memory |
| 383 | * @size: how many bytes of memory are required. | 390 | * @size: how many bytes of memory are required. |
| 384 | * @flags: the type of memory to allocate (see kcalloc). | 391 | * @flags: the type of memory to allocate. |
| 385 | * | 392 | * |
| 386 | * kmalloc is the normal method of allocating memory | 393 | * kmalloc is the normal method of allocating memory |
| 387 | * for objects smaller than page size in the kernel. | 394 | * for objects smaller than page size in the kernel. |
| 395 | * | ||
| 396 | * The @flags argument may be one of: | ||
| 397 | * | ||
| 398 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
| 399 | * | ||
| 400 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
| 401 | * | ||
| 402 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. | ||
| 403 | * For example, use this inside interrupt handlers. | ||
| 404 | * | ||
| 405 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
| 406 | * | ||
| 407 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
| 408 | * | ||
| 409 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
| 410 | * | ||
| 411 | * %GFP_NOWAIT - Allocation will not sleep. | ||
| 412 | * | ||
| 413 | * %GFP_THISNODE - Allocate node-local memory only. | ||
| 414 | * | ||
| 415 | * %GFP_DMA - Allocation suitable for DMA. | ||
| 416 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
| 417 | * slab created with SLAB_DMA. | ||
| 418 | * | ||
| 419 | * Also it is possible to set different flags by OR'ing | ||
| 420 | * in one or more of the following additional @flags: | ||
| 421 | * | ||
| 422 | * %__GFP_COLD - Request cache-cold pages instead of | ||
| 423 | * trying to return cache-warm pages. | ||
| 424 | * | ||
| 425 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
| 426 | * | ||
| 427 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
| 428 | * (think twice before using). | ||
| 429 | * | ||
| 430 | * %__GFP_NORETRY - If memory is not immediately available, | ||
| 431 | * then give up at once. | ||
| 432 | * | ||
| 433 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
| 434 | * | ||
| 435 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
| 436 | * | ||
| 437 | * There are other flags available as well, but these are not intended | ||
| 438 | * for general use, and so are not documented here. For a full list of | ||
| 439 | * potential flags, always refer to linux/gfp.h. | ||
| 388 | */ | 440 | */ |
| 389 | static __always_inline void *kmalloc(size_t size, gfp_t flags) | 441 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
| 390 | { | 442 | { |
| @@ -495,61 +547,6 @@ int cache_show(struct kmem_cache *s, struct seq_file *m); | |||
| 495 | void print_slabinfo_header(struct seq_file *m); | 547 | void print_slabinfo_header(struct seq_file *m); |
| 496 | 548 | ||
| 497 | /** | 549 | /** |
| 498 | * kmalloc - allocate memory | ||
| 499 | * @size: how many bytes of memory are required. | ||
| 500 | * @flags: the type of memory to allocate. | ||
| 501 | * | ||
| 502 | * The @flags argument may be one of: | ||
| 503 | * | ||
| 504 | * %GFP_USER - Allocate memory on behalf of user. May sleep. | ||
| 505 | * | ||
| 506 | * %GFP_KERNEL - Allocate normal kernel ram. May sleep. | ||
| 507 | * | ||
| 508 | * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. | ||
| 509 | * For example, use this inside interrupt handlers. | ||
| 510 | * | ||
| 511 | * %GFP_HIGHUSER - Allocate pages from high memory. | ||
| 512 | * | ||
| 513 | * %GFP_NOIO - Do not do any I/O at all while trying to get memory. | ||
| 514 | * | ||
| 515 | * %GFP_NOFS - Do not make any fs calls while trying to get memory. | ||
| 516 | * | ||
| 517 | * %GFP_NOWAIT - Allocation will not sleep. | ||
| 518 | * | ||
| 519 | * %GFP_THISNODE - Allocate node-local memory only. | ||
| 520 | * | ||
| 521 | * %GFP_DMA - Allocation suitable for DMA. | ||
| 522 | * Should only be used for kmalloc() caches. Otherwise, use a | ||
| 523 | * slab created with SLAB_DMA. | ||
| 524 | * | ||
| 525 | * Also it is possible to set different flags by OR'ing | ||
| 526 | * in one or more of the following additional @flags: | ||
| 527 | * | ||
| 528 | * %__GFP_COLD - Request cache-cold pages instead of | ||
| 529 | * trying to return cache-warm pages. | ||
| 530 | * | ||
| 531 | * %__GFP_HIGH - This allocation has high priority and may use emergency pools. | ||
| 532 | * | ||
| 533 | * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail | ||
| 534 | * (think twice before using). | ||
| 535 | * | ||
| 536 | * %__GFP_NORETRY - If memory is not immediately available, | ||
| 537 | * then give up at once. | ||
| 538 | * | ||
| 539 | * %__GFP_NOWARN - If allocation fails, don't issue any warnings. | ||
| 540 | * | ||
| 541 | * %__GFP_REPEAT - If allocation fails initially, try once more before failing. | ||
| 542 | * | ||
| 543 | * There are other flags available as well, but these are not intended | ||
| 544 | * for general use, and so are not documented here. For a full list of | ||
| 545 | * potential flags, always refer to linux/gfp.h. | ||
| 546 | * | ||
| 547 | * kmalloc is the normal method of allocating memory | ||
| 548 | * in the kernel. | ||
| 549 | */ | ||
| 550 | static __always_inline void *kmalloc(size_t size, gfp_t flags); | ||
| 551 | |||
| 552 | /** | ||
| 553 | * kmalloc_array - allocate memory for an array. | 550 | * kmalloc_array - allocate memory for an array. |
| 554 | * @n: number of elements. | 551 | * @n: number of elements. |
| 555 | * @size: element size. | 552 | * @size: element size. |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index e9346b4f1ef4..09bfffb08a56 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -27,8 +27,8 @@ struct kmem_cache { | |||
| 27 | 27 | ||
| 28 | size_t colour; /* cache colouring range */ | 28 | size_t colour; /* cache colouring range */ |
| 29 | unsigned int colour_off; /* colour offset */ | 29 | unsigned int colour_off; /* colour offset */ |
| 30 | struct kmem_cache *slabp_cache; | 30 | struct kmem_cache *freelist_cache; |
| 31 | unsigned int slab_size; | 31 | unsigned int freelist_size; |
| 32 | 32 | ||
| 33 | /* constructor func */ | 33 | /* constructor func */ |
| 34 | void (*ctor)(void *obj); | 34 | void (*ctor)(void *obj); |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index cc0b67eada42..f56bfa9e4526 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | enum stat_item { | 11 | enum stat_item { |
| 12 | ALLOC_FASTPATH, /* Allocation from cpu slab */ | 12 | ALLOC_FASTPATH, /* Allocation from cpu slab */ |
| 13 | ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */ | 13 | ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */ |
| 14 | FREE_FASTPATH, /* Free to cpu slub */ | 14 | FREE_FASTPATH, /* Free to cpu slab */ |
| 15 | FREE_SLOWPATH, /* Freeing not to cpu slab */ | 15 | FREE_SLOWPATH, /* Freeing not to cpu slab */ |
| 16 | FREE_FROZEN, /* Freeing to frozen slab */ | 16 | FREE_FROZEN, /* Freeing to frozen slab */ |
| 17 | FREE_ADD_PARTIAL, /* Freeing moves slab to partial list */ | 17 | FREE_ADD_PARTIAL, /* Freeing moves slab to partial list */ |
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h index c98cfa406952..fd4498329c7c 100644 --- a/include/linux/tegra-powergate.h +++ b/include/linux/tegra-powergate.h | |||
| @@ -45,6 +45,7 @@ struct clk; | |||
| 45 | 45 | ||
| 46 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D | 46 | #define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D |
| 47 | 47 | ||
| 48 | #ifdef CONFIG_ARCH_TEGRA | ||
| 48 | int tegra_powergate_is_powered(int id); | 49 | int tegra_powergate_is_powered(int id); |
| 49 | int tegra_powergate_power_on(int id); | 50 | int tegra_powergate_power_on(int id); |
| 50 | int tegra_powergate_power_off(int id); | 51 | int tegra_powergate_power_off(int id); |
| @@ -52,5 +53,31 @@ int tegra_powergate_remove_clamping(int id); | |||
| 52 | 53 | ||
| 53 | /* Must be called with clk disabled, and returns with clk enabled */ | 54 | /* Must be called with clk disabled, and returns with clk enabled */ |
| 54 | int tegra_powergate_sequence_power_up(int id, struct clk *clk); | 55 | int tegra_powergate_sequence_power_up(int id, struct clk *clk); |
| 56 | #else | ||
| 57 | static inline int tegra_powergate_is_powered(int id) | ||
| 58 | { | ||
| 59 | return -ENOSYS; | ||
| 60 | } | ||
| 61 | |||
| 62 | static inline int tegra_powergate_power_on(int id) | ||
| 63 | { | ||
| 64 | return -ENOSYS; | ||
| 65 | } | ||
| 66 | |||
| 67 | static inline int tegra_powergate_power_off(int id) | ||
| 68 | { | ||
| 69 | return -ENOSYS; | ||
| 70 | } | ||
| 71 | |||
| 72 | static inline int tegra_powergate_remove_clamping(int id) | ||
| 73 | { | ||
| 74 | return -ENOSYS; | ||
| 75 | } | ||
| 76 | |||
| 77 | static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk) | ||
| 78 | { | ||
| 79 | return -ENOSYS; | ||
| 80 | } | ||
| 81 | #endif | ||
| 55 | 82 | ||
| 56 | #endif /* _MACH_TEGRA_POWERGATE_H_ */ | 83 | #endif /* _MACH_TEGRA_POWERGATE_H_ */ |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index ebeab360d851..f16dc0a40049 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -267,6 +267,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 267 | 267 | ||
| 268 | #define TRACE_EVENT_FLAGS(event, flag) | 268 | #define TRACE_EVENT_FLAGS(event, flag) |
| 269 | 269 | ||
| 270 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
| 271 | |||
| 270 | #endif /* DECLARE_TRACE */ | 272 | #endif /* DECLARE_TRACE */ |
| 271 | 273 | ||
| 272 | #ifndef TRACE_EVENT | 274 | #ifndef TRACE_EVENT |
| @@ -399,4 +401,6 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 399 | 401 | ||
| 400 | #define TRACE_EVENT_FLAGS(event, flag) | 402 | #define TRACE_EVENT_FLAGS(event, flag) |
| 401 | 403 | ||
| 404 | #define TRACE_EVENT_PERF_PERM(event, expr...) | ||
| 405 | |||
| 402 | #endif /* ifdef TRACE_EVENT (see note above) */ | 406 | #endif /* ifdef TRACE_EVENT (see note above) */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 7454865ad148..512ab162832c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -1264,6 +1264,8 @@ typedef void (*usb_complete_t)(struct urb *); | |||
| 1264 | * @sg: scatter gather buffer list, the buffer size of each element in | 1264 | * @sg: scatter gather buffer list, the buffer size of each element in |
| 1265 | * the list (except the last) must be divisible by the endpoint's | 1265 | * the list (except the last) must be divisible by the endpoint's |
| 1266 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' | 1266 | * max packet size if no_sg_constraint isn't set in 'struct usb_bus' |
| 1267 | * (FIXME: scatter-gather under xHCI is broken for periodic transfers. | ||
| 1268 | * Do not use urb->sg for interrupt endpoints for now, only bulk.) | ||
| 1267 | * @num_mapped_sgs: (internal) number of mapped sg entries | 1269 | * @num_mapped_sgs: (internal) number of mapped sg entries |
| 1268 | * @num_sgs: number of entries in the sg list | 1270 | * @num_sgs: number of entries in the sg list |
| 1269 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may | 1271 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may |
diff --git a/include/linux/usb/wusb.h b/include/linux/usb/wusb.h index 0c4d4ca370ec..eeb28329fa3c 100644 --- a/include/linux/usb/wusb.h +++ b/include/linux/usb/wusb.h | |||
| @@ -271,6 +271,8 @@ static inline u8 wusb_key_index(int index, int type, int originator) | |||
| 271 | #define WUSB_KEY_INDEX_TYPE_GTK 2 | 271 | #define WUSB_KEY_INDEX_TYPE_GTK 2 |
| 272 | #define WUSB_KEY_INDEX_ORIGINATOR_HOST 0 | 272 | #define WUSB_KEY_INDEX_ORIGINATOR_HOST 0 |
| 273 | #define WUSB_KEY_INDEX_ORIGINATOR_DEVICE 1 | 273 | #define WUSB_KEY_INDEX_ORIGINATOR_DEVICE 1 |
| 274 | /* bits 0-3 used for the key index. */ | ||
| 275 | #define WUSB_KEY_INDEX_MAX 15 | ||
| 274 | 276 | ||
| 275 | /* A CCM Nonce, defined in WUSB1.0[6.4.1] */ | 277 | /* A CCM Nonce, defined in WUSB1.0[6.4.1] */ |
| 276 | struct aes_ccm_nonce { | 278 | struct aes_ccm_nonce { |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 4db29859464f..4836ba3c1cd8 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
| @@ -27,6 +27,12 @@ struct user_namespace { | |||
| 27 | kuid_t owner; | 27 | kuid_t owner; |
| 28 | kgid_t group; | 28 | kgid_t group; |
| 29 | unsigned int proc_inum; | 29 | unsigned int proc_inum; |
| 30 | |||
| 31 | /* Register of per-UID persistent keyrings for this namespace */ | ||
| 32 | #ifdef CONFIG_PERSISTENT_KEYRINGS | ||
| 33 | struct key *persistent_keyring_register; | ||
| 34 | struct rw_semaphore persistent_keyring_register_sem; | ||
| 35 | #endif | ||
| 30 | }; | 36 | }; |
| 31 | 37 | ||
| 32 | extern struct user_namespace init_user_ns; | 38 | extern struct user_namespace init_user_ns; |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 61939ba30aa0..eaa00b10abaa 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -278,6 +278,31 @@ do { \ | |||
| 278 | __ret; \ | 278 | __ret; \ |
| 279 | }) | 279 | }) |
| 280 | 280 | ||
| 281 | #define __wait_event_cmd(wq, condition, cmd1, cmd2) \ | ||
| 282 | (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0, \ | ||
| 283 | cmd1; schedule(); cmd2) | ||
| 284 | |||
| 285 | /** | ||
| 286 | * wait_event_cmd - sleep until a condition gets true | ||
| 287 | * @wq: the waitqueue to wait on | ||
| 288 | * @condition: a C expression for the event to wait for | ||
| 289 | * cmd1: the command will be executed before sleep | ||
| 290 | * cmd2: the command will be executed after sleep | ||
| 291 | * | ||
| 292 | * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the | ||
| 293 | * @condition evaluates to true. The @condition is checked each time | ||
| 294 | * the waitqueue @wq is woken up. | ||
| 295 | * | ||
| 296 | * wake_up() has to be called after changing any variable that could | ||
| 297 | * change the result of the wait condition. | ||
| 298 | */ | ||
| 299 | #define wait_event_cmd(wq, condition, cmd1, cmd2) \ | ||
| 300 | do { \ | ||
| 301 | if (condition) \ | ||
| 302 | break; \ | ||
| 303 | __wait_event_cmd(wq, condition, cmd1, cmd2); \ | ||
| 304 | } while (0) | ||
| 305 | |||
| 281 | #define __wait_event_interruptible(wq, condition) \ | 306 | #define __wait_event_interruptible(wq, condition) \ |
| 282 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ | 307 | ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0, \ |
| 283 | schedule()) | 308 | schedule()) |
