diff options
Diffstat (limited to 'include')
148 files changed, 4434 insertions, 943 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 636c59f2003a..c13c919ab99e 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -382,6 +382,7 @@ const char *acpi_power_state_string(int state); | |||
382 | int acpi_device_get_power(struct acpi_device *device, int *state); | 382 | int acpi_device_get_power(struct acpi_device *device, int *state); |
383 | int acpi_device_set_power(struct acpi_device *device, int state); | 383 | int acpi_device_set_power(struct acpi_device *device, int state); |
384 | int acpi_bus_init_power(struct acpi_device *device); | 384 | int acpi_bus_init_power(struct acpi_device *device); |
385 | int acpi_device_fix_up_power(struct acpi_device *device); | ||
385 | int acpi_bus_update_power(acpi_handle handle, int *state_p); | 386 | int acpi_bus_update_power(acpi_handle handle, int *state_p); |
386 | bool acpi_bus_power_manageable(acpi_handle handle); | 387 | bool acpi_bus_power_manageable(acpi_handle handle); |
387 | 388 | ||
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index e6168a24b9f0..b420939f5eb5 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -123,7 +123,9 @@ extern int register_dock_notifier(struct notifier_block *nb); | |||
123 | extern void unregister_dock_notifier(struct notifier_block *nb); | 123 | extern void unregister_dock_notifier(struct notifier_block *nb); |
124 | extern int register_hotplug_dock_device(acpi_handle handle, | 124 | extern int register_hotplug_dock_device(acpi_handle handle, |
125 | const struct acpi_dock_ops *ops, | 125 | const struct acpi_dock_ops *ops, |
126 | void *context); | 126 | void *context, |
127 | void (*init)(void *), | ||
128 | void (*release)(void *)); | ||
127 | extern void unregister_hotplug_dock_device(acpi_handle handle); | 129 | extern void unregister_hotplug_dock_device(acpi_handle handle); |
128 | #else | 130 | #else |
129 | static inline int is_dock_device(acpi_handle handle) | 131 | static inline int is_dock_device(acpi_handle handle) |
@@ -139,7 +141,9 @@ static inline void unregister_dock_notifier(struct notifier_block *nb) | |||
139 | } | 141 | } |
140 | static inline int register_hotplug_dock_device(acpi_handle handle, | 142 | static inline int register_hotplug_dock_device(acpi_handle handle, |
141 | const struct acpi_dock_ops *ops, | 143 | const struct acpi_dock_ops *ops, |
142 | void *context) | 144 | void *context, |
145 | void (*init)(void *), | ||
146 | void (*release)(void *)) | ||
143 | { | 147 | { |
144 | return -ENODEV; | 148 | return -ENODEV; |
145 | } | 149 | } |
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index ac9da00e9f2c..d5afe96adba6 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h | |||
@@ -343,8 +343,12 @@ extern void ioport_unmap(void __iomem *p); | |||
343 | #endif /* CONFIG_GENERIC_IOMAP */ | 343 | #endif /* CONFIG_GENERIC_IOMAP */ |
344 | #endif /* CONFIG_HAS_IOPORT */ | 344 | #endif /* CONFIG_HAS_IOPORT */ |
345 | 345 | ||
346 | #ifndef xlate_dev_kmem_ptr | ||
346 | #define xlate_dev_kmem_ptr(p) p | 347 | #define xlate_dev_kmem_ptr(p) p |
348 | #endif | ||
349 | #ifndef xlate_dev_mem_ptr | ||
347 | #define xlate_dev_mem_ptr(p) __va(p) | 350 | #define xlate_dev_mem_ptr(p) __va(p) |
351 | #endif | ||
348 | 352 | ||
349 | #ifdef CONFIG_VIRT_TO_BUS | 353 | #ifdef CONFIG_VIRT_TO_BUS |
350 | #ifndef virt_to_bus | 354 | #ifndef virt_to_bus |
diff --git a/include/asm-generic/kvm_para.h b/include/asm-generic/kvm_para.h index 9d96605f160a..fa25becbdcaf 100644 --- a/include/asm-generic/kvm_para.h +++ b/include/asm-generic/kvm_para.h | |||
@@ -18,4 +18,9 @@ static inline unsigned int kvm_arch_para_features(void) | |||
18 | return 0; | 18 | return 0; |
19 | } | 19 | } |
20 | 20 | ||
21 | static inline bool kvm_para_available(void) | ||
22 | { | ||
23 | return false; | ||
24 | } | ||
25 | |||
21 | #endif | 26 | #endif |
diff --git a/include/asm-generic/mutex-dec.h b/include/asm-generic/mutex-dec.h index f104af7cf437..d4f9fb4e53df 100644 --- a/include/asm-generic/mutex-dec.h +++ b/include/asm-generic/mutex-dec.h | |||
@@ -28,17 +28,15 @@ __mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *)) | |||
28 | * __mutex_fastpath_lock_retval - try to take the lock by moving the count | 28 | * __mutex_fastpath_lock_retval - try to take the lock by moving the count |
29 | * from 1 to a 0 value | 29 | * from 1 to a 0 value |
30 | * @count: pointer of type atomic_t | 30 | * @count: pointer of type atomic_t |
31 | * @fail_fn: function to call if the original value was not 1 | ||
32 | * | 31 | * |
33 | * Change the count from 1 to a value lower than 1, and call <fail_fn> if | 32 | * Change the count from 1 to a value lower than 1. This function returns 0 |
34 | * it wasn't 1 originally. This function returns 0 if the fastpath succeeds, | 33 | * if the fastpath succeeds, or -1 otherwise. |
35 | * or anything the slow path function returns. | ||
36 | */ | 34 | */ |
37 | static inline int | 35 | static inline int |
38 | __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) | 36 | __mutex_fastpath_lock_retval(atomic_t *count) |
39 | { | 37 | { |
40 | if (unlikely(atomic_dec_return(count) < 0)) | 38 | if (unlikely(atomic_dec_return(count) < 0)) |
41 | return fail_fn(count); | 39 | return -1; |
42 | return 0; | 40 | return 0; |
43 | } | 41 | } |
44 | 42 | ||
diff --git a/include/asm-generic/mutex-null.h b/include/asm-generic/mutex-null.h index e1bbbc72b6a2..61069ed334e2 100644 --- a/include/asm-generic/mutex-null.h +++ b/include/asm-generic/mutex-null.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #define _ASM_GENERIC_MUTEX_NULL_H | 11 | #define _ASM_GENERIC_MUTEX_NULL_H |
12 | 12 | ||
13 | #define __mutex_fastpath_lock(count, fail_fn) fail_fn(count) | 13 | #define __mutex_fastpath_lock(count, fail_fn) fail_fn(count) |
14 | #define __mutex_fastpath_lock_retval(count, fail_fn) fail_fn(count) | 14 | #define __mutex_fastpath_lock_retval(count) (-1) |
15 | #define __mutex_fastpath_unlock(count, fail_fn) fail_fn(count) | 15 | #define __mutex_fastpath_unlock(count, fail_fn) fail_fn(count) |
16 | #define __mutex_fastpath_trylock(count, fail_fn) fail_fn(count) | 16 | #define __mutex_fastpath_trylock(count, fail_fn) fail_fn(count) |
17 | #define __mutex_slowpath_needs_to_unlock() 1 | 17 | #define __mutex_slowpath_needs_to_unlock() 1 |
diff --git a/include/asm-generic/mutex-xchg.h b/include/asm-generic/mutex-xchg.h index c04e0db8a2d6..f169ec064785 100644 --- a/include/asm-generic/mutex-xchg.h +++ b/include/asm-generic/mutex-xchg.h | |||
@@ -39,18 +39,16 @@ __mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *)) | |||
39 | * __mutex_fastpath_lock_retval - try to take the lock by moving the count | 39 | * __mutex_fastpath_lock_retval - try to take the lock by moving the count |
40 | * from 1 to a 0 value | 40 | * from 1 to a 0 value |
41 | * @count: pointer of type atomic_t | 41 | * @count: pointer of type atomic_t |
42 | * @fail_fn: function to call if the original value was not 1 | ||
43 | * | 42 | * |
44 | * Change the count from 1 to a value lower than 1, and call <fail_fn> if it | 43 | * Change the count from 1 to a value lower than 1. This function returns 0 |
45 | * wasn't 1 originally. This function returns 0 if the fastpath succeeds, | 44 | * if the fastpath succeeds, or -1 otherwise. |
46 | * or anything the slow path function returns | ||
47 | */ | 45 | */ |
48 | static inline int | 46 | static inline int |
49 | __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *)) | 47 | __mutex_fastpath_lock_retval(atomic_t *count) |
50 | { | 48 | { |
51 | if (unlikely(atomic_xchg(count, 0) != 1)) | 49 | if (unlikely(atomic_xchg(count, 0) != 1)) |
52 | if (likely(atomic_xchg(count, -1) != 1)) | 50 | if (likely(atomic_xchg(count, -1) != 1)) |
53 | return fail_fn(count); | 51 | return -1; |
54 | return 0; | 52 | return 0; |
55 | } | 53 | } |
56 | 54 | ||
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index a59ff51b0166..b1836987d506 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -692,4 +692,8 @@ static inline pmd_t pmd_mknuma(pmd_t pmd) | |||
692 | 692 | ||
693 | #endif /* !__ASSEMBLY__ */ | 693 | #endif /* !__ASSEMBLY__ */ |
694 | 694 | ||
695 | #ifndef io_remap_pfn_range | ||
696 | #define io_remap_pfn_range remap_pfn_range | ||
697 | #endif | ||
698 | |||
695 | #endif /* _ASM_GENERIC_PGTABLE_H */ | 699 | #endif /* _ASM_GENERIC_PGTABLE_H */ |
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index b1b1fa6ffffe..13821c339a41 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h | |||
@@ -97,11 +97,9 @@ struct mmu_gather { | |||
97 | unsigned long start; | 97 | unsigned long start; |
98 | unsigned long end; | 98 | unsigned long end; |
99 | unsigned int need_flush : 1, /* Did free PTEs */ | 99 | unsigned int need_flush : 1, /* Did free PTEs */ |
100 | fast_mode : 1; /* No batching */ | ||
101 | |||
102 | /* we are in the middle of an operation to clear | 100 | /* we are in the middle of an operation to clear |
103 | * a full mm and can make some optimizations */ | 101 | * a full mm and can make some optimizations */ |
104 | unsigned int fullmm : 1, | 102 | fullmm : 1, |
105 | /* we have performed an operation which | 103 | /* we have performed an operation which |
106 | * requires a complete flush of the tlb */ | 104 | * requires a complete flush of the tlb */ |
107 | need_flush_all : 1; | 105 | need_flush_all : 1; |
@@ -114,19 +112,6 @@ struct mmu_gather { | |||
114 | 112 | ||
115 | #define HAVE_GENERIC_MMU_GATHER | 113 | #define HAVE_GENERIC_MMU_GATHER |
116 | 114 | ||
117 | static inline int tlb_fast_mode(struct mmu_gather *tlb) | ||
118 | { | ||
119 | #ifdef CONFIG_SMP | ||
120 | return tlb->fast_mode; | ||
121 | #else | ||
122 | /* | ||
123 | * For UP we don't need to worry about TLB flush | ||
124 | * and page free order so much.. | ||
125 | */ | ||
126 | return 1; | ||
127 | #endif | ||
128 | } | ||
129 | |||
130 | void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm); | 115 | void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm); |
131 | void tlb_flush_mmu(struct mmu_gather *tlb); | 116 | void tlb_flush_mmu(struct mmu_gather *tlb); |
132 | void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, | 117 | void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, |
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h index c184aa8ec8cd..dc1269c74a52 100644 --- a/include/asm-generic/uaccess.h +++ b/include/asm-generic/uaccess.h | |||
@@ -163,7 +163,7 @@ static inline __must_check long __copy_to_user(void __user *to, | |||
163 | 163 | ||
164 | #define put_user(x, ptr) \ | 164 | #define put_user(x, ptr) \ |
165 | ({ \ | 165 | ({ \ |
166 | might_sleep(); \ | 166 | might_fault(); \ |
167 | access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \ | 167 | access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \ |
168 | __put_user(x, ptr) : \ | 168 | __put_user(x, ptr) : \ |
169 | -EFAULT; \ | 169 | -EFAULT; \ |
@@ -225,7 +225,7 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
225 | 225 | ||
226 | #define get_user(x, ptr) \ | 226 | #define get_user(x, ptr) \ |
227 | ({ \ | 227 | ({ \ |
228 | might_sleep(); \ | 228 | might_fault(); \ |
229 | access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \ | 229 | access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \ |
230 | __get_user(x, ptr) : \ | 230 | __get_user(x, ptr) : \ |
231 | -EFAULT; \ | 231 | -EFAULT; \ |
@@ -255,7 +255,7 @@ extern int __get_user_bad(void) __attribute__((noreturn)); | |||
255 | static inline long copy_from_user(void *to, | 255 | static inline long copy_from_user(void *to, |
256 | const void __user * from, unsigned long n) | 256 | const void __user * from, unsigned long n) |
257 | { | 257 | { |
258 | might_sleep(); | 258 | might_fault(); |
259 | if (access_ok(VERIFY_READ, from, n)) | 259 | if (access_ok(VERIFY_READ, from, n)) |
260 | return __copy_from_user(to, from, n); | 260 | return __copy_from_user(to, from, n); |
261 | else | 261 | else |
@@ -265,7 +265,7 @@ static inline long copy_from_user(void *to, | |||
265 | static inline long copy_to_user(void __user *to, | 265 | static inline long copy_to_user(void __user *to, |
266 | const void *from, unsigned long n) | 266 | const void *from, unsigned long n) |
267 | { | 267 | { |
268 | might_sleep(); | 268 | might_fault(); |
269 | if (access_ok(VERIFY_WRITE, to, n)) | 269 | if (access_ok(VERIFY_WRITE, to, n)) |
270 | return __copy_to_user(to, from, n); | 270 | return __copy_to_user(to, from, n); |
271 | else | 271 | else |
@@ -336,7 +336,7 @@ __clear_user(void __user *to, unsigned long n) | |||
336 | static inline __must_check unsigned long | 336 | static inline __must_check unsigned long |
337 | clear_user(void __user *to, unsigned long n) | 337 | clear_user(void __user *to, unsigned long n) |
338 | { | 338 | { |
339 | might_sleep(); | 339 | might_fault(); |
340 | if (!access_ok(VERIFY_WRITE, to, n)) | 340 | if (!access_ok(VERIFY_WRITE, to, n)) |
341 | return n; | 341 | return n; |
342 | 342 | ||
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index eb58d2d7d971..4f2737208c42 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -68,14 +68,6 @@ | |||
68 | * are handled as text/data or they can be discarded (which | 68 | * are handled as text/data or they can be discarded (which |
69 | * often happens at runtime) | 69 | * often happens at runtime) |
70 | */ | 70 | */ |
71 | #ifdef CONFIG_HOTPLUG | ||
72 | #define DEV_KEEP(sec) *(.dev##sec) | ||
73 | #define DEV_DISCARD(sec) | ||
74 | #else | ||
75 | #define DEV_KEEP(sec) | ||
76 | #define DEV_DISCARD(sec) *(.dev##sec) | ||
77 | #endif | ||
78 | |||
79 | #ifdef CONFIG_HOTPLUG_CPU | 71 | #ifdef CONFIG_HOTPLUG_CPU |
80 | #define CPU_KEEP(sec) *(.cpu##sec) | 72 | #define CPU_KEEP(sec) *(.cpu##sec) |
81 | #define CPU_DISCARD(sec) | 73 | #define CPU_DISCARD(sec) |
@@ -182,8 +174,6 @@ | |||
182 | *(.data) \ | 174 | *(.data) \ |
183 | *(.ref.data) \ | 175 | *(.ref.data) \ |
184 | *(.data..shared_aligned) /* percpu related */ \ | 176 | *(.data..shared_aligned) /* percpu related */ \ |
185 | DEV_KEEP(init.data) \ | ||
186 | DEV_KEEP(exit.data) \ | ||
187 | CPU_KEEP(init.data) \ | 177 | CPU_KEEP(init.data) \ |
188 | CPU_KEEP(exit.data) \ | 178 | CPU_KEEP(exit.data) \ |
189 | MEM_KEEP(init.data) \ | 179 | MEM_KEEP(init.data) \ |
@@ -372,8 +362,6 @@ | |||
372 | /* __*init sections */ \ | 362 | /* __*init sections */ \ |
373 | __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ | 363 | __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ |
374 | *(.ref.rodata) \ | 364 | *(.ref.rodata) \ |
375 | DEV_KEEP(init.rodata) \ | ||
376 | DEV_KEEP(exit.rodata) \ | ||
377 | CPU_KEEP(init.rodata) \ | 365 | CPU_KEEP(init.rodata) \ |
378 | CPU_KEEP(exit.rodata) \ | 366 | CPU_KEEP(exit.rodata) \ |
379 | MEM_KEEP(init.rodata) \ | 367 | MEM_KEEP(init.rodata) \ |
@@ -416,8 +404,6 @@ | |||
416 | *(.text.hot) \ | 404 | *(.text.hot) \ |
417 | *(.text) \ | 405 | *(.text) \ |
418 | *(.ref.text) \ | 406 | *(.ref.text) \ |
419 | DEV_KEEP(init.text) \ | ||
420 | DEV_KEEP(exit.text) \ | ||
421 | CPU_KEEP(init.text) \ | 407 | CPU_KEEP(init.text) \ |
422 | CPU_KEEP(exit.text) \ | 408 | CPU_KEEP(exit.text) \ |
423 | MEM_KEEP(init.text) \ | 409 | MEM_KEEP(init.text) \ |
@@ -503,7 +489,6 @@ | |||
503 | /* init and exit section handling */ | 489 | /* init and exit section handling */ |
504 | #define INIT_DATA \ | 490 | #define INIT_DATA \ |
505 | *(.init.data) \ | 491 | *(.init.data) \ |
506 | DEV_DISCARD(init.data) \ | ||
507 | CPU_DISCARD(init.data) \ | 492 | CPU_DISCARD(init.data) \ |
508 | MEM_DISCARD(init.data) \ | 493 | MEM_DISCARD(init.data) \ |
509 | KERNEL_CTORS() \ | 494 | KERNEL_CTORS() \ |
@@ -511,7 +496,6 @@ | |||
511 | *(.init.rodata) \ | 496 | *(.init.rodata) \ |
512 | FTRACE_EVENTS() \ | 497 | FTRACE_EVENTS() \ |
513 | TRACE_SYSCALLS() \ | 498 | TRACE_SYSCALLS() \ |
514 | DEV_DISCARD(init.rodata) \ | ||
515 | CPU_DISCARD(init.rodata) \ | 499 | CPU_DISCARD(init.rodata) \ |
516 | MEM_DISCARD(init.rodata) \ | 500 | MEM_DISCARD(init.rodata) \ |
517 | CLK_OF_TABLES() \ | 501 | CLK_OF_TABLES() \ |
@@ -521,14 +505,11 @@ | |||
521 | 505 | ||
522 | #define INIT_TEXT \ | 506 | #define INIT_TEXT \ |
523 | *(.init.text) \ | 507 | *(.init.text) \ |
524 | DEV_DISCARD(init.text) \ | ||
525 | CPU_DISCARD(init.text) \ | 508 | CPU_DISCARD(init.text) \ |
526 | MEM_DISCARD(init.text) | 509 | MEM_DISCARD(init.text) |
527 | 510 | ||
528 | #define EXIT_DATA \ | 511 | #define EXIT_DATA \ |
529 | *(.exit.data) \ | 512 | *(.exit.data) \ |
530 | DEV_DISCARD(exit.data) \ | ||
531 | DEV_DISCARD(exit.rodata) \ | ||
532 | CPU_DISCARD(exit.data) \ | 513 | CPU_DISCARD(exit.data) \ |
533 | CPU_DISCARD(exit.rodata) \ | 514 | CPU_DISCARD(exit.rodata) \ |
534 | MEM_DISCARD(exit.data) \ | 515 | MEM_DISCARD(exit.data) \ |
@@ -536,7 +517,6 @@ | |||
536 | 517 | ||
537 | #define EXIT_TEXT \ | 518 | #define EXIT_TEXT \ |
538 | *(.exit.text) \ | 519 | *(.exit.text) \ |
539 | DEV_DISCARD(exit.text) \ | ||
540 | CPU_DISCARD(exit.text) \ | 520 | CPU_DISCARD(exit.text) \ |
541 | MEM_DISCARD(exit.text) | 521 | MEM_DISCARD(exit.text) |
542 | 522 | ||
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h index e6c9c4cc9b23..c463ce990c48 100644 --- a/include/clocksource/arm_arch_timer.h +++ b/include/clocksource/arm_arch_timer.h | |||
@@ -32,7 +32,7 @@ | |||
32 | #ifdef CONFIG_ARM_ARCH_TIMER | 32 | #ifdef CONFIG_ARM_ARCH_TIMER |
33 | 33 | ||
34 | extern u32 arch_timer_get_rate(void); | 34 | extern u32 arch_timer_get_rate(void); |
35 | extern u64 (*arch_timer_read_counter)(void); | 35 | extern u64 arch_timer_read_counter(void); |
36 | extern struct timecounter *arch_timer_get_timecounter(void); | 36 | extern struct timecounter *arch_timer_get_timecounter(void); |
37 | 37 | ||
38 | #else | 38 | #else |
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h new file mode 100644 index 000000000000..8279f427c60f --- /dev/null +++ b/include/dt-bindings/clk/exynos-audss-clk.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * This header provides constants for Samsung audio subsystem | ||
3 | * clock controller. | ||
4 | * | ||
5 | * The constants defined in this header are being used in dts | ||
6 | * and exynos audss driver. | ||
7 | */ | ||
8 | |||
9 | #ifndef _DT_BINDINGS_CLK_EXYNOS_AUDSS_H | ||
10 | #define _DT_BINDINGS_CLK_EXYNOS_AUDSS_H | ||
11 | |||
12 | #define EXYNOS_MOUT_AUDSS 0 | ||
13 | #define EXYNOS_MOUT_I2S 1 | ||
14 | #define EXYNOS_DOUT_SRP 2 | ||
15 | #define EXYNOS_DOUT_AUD_BUS 3 | ||
16 | #define EXYNOS_DOUT_I2S 4 | ||
17 | #define EXYNOS_SRP_CLK 5 | ||
18 | #define EXYNOS_I2S_BUS 6 | ||
19 | #define EXYNOS_SCLK_I2S 7 | ||
20 | #define EXYNOS_PCM_BUS 8 | ||
21 | #define EXYNOS_SCLK_PCM 9 | ||
22 | |||
23 | #define EXYNOS_AUDSS_MAX_CLKS 10 | ||
24 | |||
25 | #endif | ||
diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h new file mode 100644 index 000000000000..7fcdf90879f2 --- /dev/null +++ b/include/dt-bindings/clock/imx6sl-clock.h | |||
@@ -0,0 +1,148 @@ | |||
1 | /* | ||
2 | * Copyright 2013 Freescale Semiconductor, Inc. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #ifndef __DT_BINDINGS_CLOCK_IMX6SL_H | ||
11 | #define __DT_BINDINGS_CLOCK_IMX6SL_H | ||
12 | |||
13 | #define IMX6SL_CLK_DUMMY 0 | ||
14 | #define IMX6SL_CLK_CKIL 1 | ||
15 | #define IMX6SL_CLK_OSC 2 | ||
16 | #define IMX6SL_CLK_PLL1_SYS 3 | ||
17 | #define IMX6SL_CLK_PLL2_BUS 4 | ||
18 | #define IMX6SL_CLK_PLL3_USB_OTG 5 | ||
19 | #define IMX6SL_CLK_PLL4_AUDIO 6 | ||
20 | #define IMX6SL_CLK_PLL5_VIDEO 7 | ||
21 | #define IMX6SL_CLK_PLL6_ENET 8 | ||
22 | #define IMX6SL_CLK_PLL7_USB_HOST 9 | ||
23 | #define IMX6SL_CLK_USBPHY1 10 | ||
24 | #define IMX6SL_CLK_USBPHY2 11 | ||
25 | #define IMX6SL_CLK_USBPHY1_GATE 12 | ||
26 | #define IMX6SL_CLK_USBPHY2_GATE 13 | ||
27 | #define IMX6SL_CLK_PLL4_POST_DIV 14 | ||
28 | #define IMX6SL_CLK_PLL5_POST_DIV 15 | ||
29 | #define IMX6SL_CLK_PLL5_VIDEO_DIV 16 | ||
30 | #define IMX6SL_CLK_ENET_REF 17 | ||
31 | #define IMX6SL_CLK_PLL2_PFD0 18 | ||
32 | #define IMX6SL_CLK_PLL2_PFD1 19 | ||
33 | #define IMX6SL_CLK_PLL2_PFD2 20 | ||
34 | #define IMX6SL_CLK_PLL3_PFD0 21 | ||
35 | #define IMX6SL_CLK_PLL3_PFD1 22 | ||
36 | #define IMX6SL_CLK_PLL3_PFD2 23 | ||
37 | #define IMX6SL_CLK_PLL3_PFD3 24 | ||
38 | #define IMX6SL_CLK_PLL2_198M 25 | ||
39 | #define IMX6SL_CLK_PLL3_120M 26 | ||
40 | #define IMX6SL_CLK_PLL3_80M 27 | ||
41 | #define IMX6SL_CLK_PLL3_60M 28 | ||
42 | #define IMX6SL_CLK_STEP 29 | ||
43 | #define IMX6SL_CLK_PLL1_SW 30 | ||
44 | #define IMX6SL_CLK_OCRAM_ALT_SEL 31 | ||
45 | #define IMX6SL_CLK_OCRAM_SEL 32 | ||
46 | #define IMX6SL_CLK_PRE_PERIPH2_SEL 33 | ||
47 | #define IMX6SL_CLK_PRE_PERIPH_SEL 34 | ||
48 | #define IMX6SL_CLK_PERIPH2_CLK2_SEL 35 | ||
49 | #define IMX6SL_CLK_PERIPH_CLK2_SEL 36 | ||
50 | #define IMX6SL_CLK_CSI_SEL 37 | ||
51 | #define IMX6SL_CLK_LCDIF_AXI_SEL 38 | ||
52 | #define IMX6SL_CLK_USDHC1_SEL 39 | ||
53 | #define IMX6SL_CLK_USDHC2_SEL 40 | ||
54 | #define IMX6SL_CLK_USDHC3_SEL 41 | ||
55 | #define IMX6SL_CLK_USDHC4_SEL 42 | ||
56 | #define IMX6SL_CLK_SSI1_SEL 43 | ||
57 | #define IMX6SL_CLK_SSI2_SEL 44 | ||
58 | #define IMX6SL_CLK_SSI3_SEL 45 | ||
59 | #define IMX6SL_CLK_PERCLK_SEL 46 | ||
60 | #define IMX6SL_CLK_PXP_AXI_SEL 47 | ||
61 | #define IMX6SL_CLK_EPDC_AXI_SEL 48 | ||
62 | #define IMX6SL_CLK_GPU2D_OVG_SEL 49 | ||
63 | #define IMX6SL_CLK_GPU2D_SEL 50 | ||
64 | #define IMX6SL_CLK_LCDIF_PIX_SEL 51 | ||
65 | #define IMX6SL_CLK_EPDC_PIX_SEL 52 | ||
66 | #define IMX6SL_CLK_SPDIF0_SEL 53 | ||
67 | #define IMX6SL_CLK_SPDIF1_SEL 54 | ||
68 | #define IMX6SL_CLK_EXTERN_AUDIO_SEL 55 | ||
69 | #define IMX6SL_CLK_ECSPI_SEL 56 | ||
70 | #define IMX6SL_CLK_UART_SEL 57 | ||
71 | #define IMX6SL_CLK_PERIPH 58 | ||
72 | #define IMX6SL_CLK_PERIPH2 59 | ||
73 | #define IMX6SL_CLK_OCRAM_PODF 60 | ||
74 | #define IMX6SL_CLK_PERIPH_CLK2_PODF 61 | ||
75 | #define IMX6SL_CLK_PERIPH2_CLK2_PODF 62 | ||
76 | #define IMX6SL_CLK_IPG 63 | ||
77 | #define IMX6SL_CLK_CSI_PODF 64 | ||
78 | #define IMX6SL_CLK_LCDIF_AXI_PODF 65 | ||
79 | #define IMX6SL_CLK_USDHC1_PODF 66 | ||
80 | #define IMX6SL_CLK_USDHC2_PODF 67 | ||
81 | #define IMX6SL_CLK_USDHC3_PODF 68 | ||
82 | #define IMX6SL_CLK_USDHC4_PODF 69 | ||
83 | #define IMX6SL_CLK_SSI1_PRED 70 | ||
84 | #define IMX6SL_CLK_SSI1_PODF 71 | ||
85 | #define IMX6SL_CLK_SSI2_PRED 72 | ||
86 | #define IMX6SL_CLK_SSI2_PODF 73 | ||
87 | #define IMX6SL_CLK_SSI3_PRED 74 | ||
88 | #define IMX6SL_CLK_SSI3_PODF 75 | ||
89 | #define IMX6SL_CLK_PERCLK 76 | ||
90 | #define IMX6SL_CLK_PXP_AXI_PODF 77 | ||
91 | #define IMX6SL_CLK_EPDC_AXI_PODF 78 | ||
92 | #define IMX6SL_CLK_GPU2D_OVG_PODF 79 | ||
93 | #define IMX6SL_CLK_GPU2D_PODF 80 | ||
94 | #define IMX6SL_CLK_LCDIF_PIX_PRED 81 | ||
95 | #define IMX6SL_CLK_EPDC_PIX_PRED 82 | ||
96 | #define IMX6SL_CLK_LCDIF_PIX_PODF 83 | ||
97 | #define IMX6SL_CLK_EPDC_PIX_PODF 84 | ||
98 | #define IMX6SL_CLK_SPDIF0_PRED 85 | ||
99 | #define IMX6SL_CLK_SPDIF0_PODF 86 | ||
100 | #define IMX6SL_CLK_SPDIF1_PRED 87 | ||
101 | #define IMX6SL_CLK_SPDIF1_PODF 88 | ||
102 | #define IMX6SL_CLK_EXTERN_AUDIO_PRED 89 | ||
103 | #define IMX6SL_CLK_EXTERN_AUDIO_PODF 90 | ||
104 | #define IMX6SL_CLK_ECSPI_ROOT 91 | ||
105 | #define IMX6SL_CLK_UART_ROOT 92 | ||
106 | #define IMX6SL_CLK_AHB 93 | ||
107 | #define IMX6SL_CLK_MMDC_ROOT 94 | ||
108 | #define IMX6SL_CLK_ARM 95 | ||
109 | #define IMX6SL_CLK_ECSPI1 96 | ||
110 | #define IMX6SL_CLK_ECSPI2 97 | ||
111 | #define IMX6SL_CLK_ECSPI3 98 | ||
112 | #define IMX6SL_CLK_ECSPI4 99 | ||
113 | #define IMX6SL_CLK_EPIT1 100 | ||
114 | #define IMX6SL_CLK_EPIT2 101 | ||
115 | #define IMX6SL_CLK_EXTERN_AUDIO 102 | ||
116 | #define IMX6SL_CLK_GPT 103 | ||
117 | #define IMX6SL_CLK_GPT_SERIAL 104 | ||
118 | #define IMX6SL_CLK_GPU2D_OVG 105 | ||
119 | #define IMX6SL_CLK_I2C1 106 | ||
120 | #define IMX6SL_CLK_I2C2 107 | ||
121 | #define IMX6SL_CLK_I2C3 108 | ||
122 | #define IMX6SL_CLK_OCOTP 109 | ||
123 | #define IMX6SL_CLK_CSI 110 | ||
124 | #define IMX6SL_CLK_PXP_AXI 111 | ||
125 | #define IMX6SL_CLK_EPDC_AXI 112 | ||
126 | #define IMX6SL_CLK_LCDIF_AXI 113 | ||
127 | #define IMX6SL_CLK_LCDIF_PIX 114 | ||
128 | #define IMX6SL_CLK_EPDC_PIX 115 | ||
129 | #define IMX6SL_CLK_OCRAM 116 | ||
130 | #define IMX6SL_CLK_PWM1 117 | ||
131 | #define IMX6SL_CLK_PWM2 118 | ||
132 | #define IMX6SL_CLK_PWM3 119 | ||
133 | #define IMX6SL_CLK_PWM4 120 | ||
134 | #define IMX6SL_CLK_SDMA 121 | ||
135 | #define IMX6SL_CLK_SPDIF 122 | ||
136 | #define IMX6SL_CLK_SSI1 123 | ||
137 | #define IMX6SL_CLK_SSI2 124 | ||
138 | #define IMX6SL_CLK_SSI3 125 | ||
139 | #define IMX6SL_CLK_UART 126 | ||
140 | #define IMX6SL_CLK_UART_SERIAL 127 | ||
141 | #define IMX6SL_CLK_USBOH3 128 | ||
142 | #define IMX6SL_CLK_USDHC1 129 | ||
143 | #define IMX6SL_CLK_USDHC2 130 | ||
144 | #define IMX6SL_CLK_USDHC3 131 | ||
145 | #define IMX6SL_CLK_USDHC4 132 | ||
146 | #define IMX6SL_CLK_CLK_END 133 | ||
147 | |||
148 | #endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */ | ||
diff --git a/include/dt-bindings/clock/tegra114-car.h b/include/dt-bindings/clock/tegra114-car.h new file mode 100644 index 000000000000..614aec417902 --- /dev/null +++ b/include/dt-bindings/clock/tegra114-car.h | |||
@@ -0,0 +1,342 @@ | |||
1 | /* | ||
2 | * This header provides constants for binding nvidia,tegra114-car. | ||
3 | * | ||
4 | * The first 160 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB | ||
5 | * registers. These IDs often match those in the CAR's RST_DEVICES registers, | ||
6 | * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In | ||
7 | * this case, those clocks are assigned IDs above 160 in order to highlight | ||
8 | * this issue. Implementations that interpret these clock IDs as bit values | ||
9 | * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to | ||
10 | * explicitly handle these special cases. | ||
11 | * | ||
12 | * The balance of the clocks controlled by the CAR are assigned IDs of 160 and | ||
13 | * above. | ||
14 | */ | ||
15 | |||
16 | #ifndef _DT_BINDINGS_CLOCK_TEGRA114_CAR_H | ||
17 | #define _DT_BINDINGS_CLOCK_TEGRA114_CAR_H | ||
18 | |||
19 | /* 0 */ | ||
20 | /* 1 */ | ||
21 | /* 2 */ | ||
22 | /* 3 */ | ||
23 | #define TEGRA114_CLK_RTC 4 | ||
24 | #define TEGRA114_CLK_TIMER 5 | ||
25 | #define TEGRA114_CLK_UARTA 6 | ||
26 | /* 7 (register bit affects uartb and vfir) */ | ||
27 | /* 8 */ | ||
28 | #define TEGRA114_CLK_SDMMC2 9 | ||
29 | /* 10 (register bit affects spdif_in and spdif_out) */ | ||
30 | #define TEGRA114_CLK_I2S1 11 | ||
31 | #define TEGRA114_CLK_I2C1 12 | ||
32 | #define TEGRA114_CLK_NDFLASH 13 | ||
33 | #define TEGRA114_CLK_SDMMC1 14 | ||
34 | #define TEGRA114_CLK_SDMMC4 15 | ||
35 | /* 16 */ | ||
36 | #define TEGRA114_CLK_PWM 17 | ||
37 | #define TEGRA114_CLK_I2S2 18 | ||
38 | #define TEGRA114_CLK_EPP 19 | ||
39 | /* 20 (register bit affects vi and vi_sensor) */ | ||
40 | #define TEGRA114_CLK_GR_2D 21 | ||
41 | #define TEGRA114_CLK_USBD 22 | ||
42 | #define TEGRA114_CLK_ISP 23 | ||
43 | #define TEGRA114_CLK_GR_3D 24 | ||
44 | /* 25 */ | ||
45 | #define TEGRA114_CLK_DISP2 26 | ||
46 | #define TEGRA114_CLK_DISP1 27 | ||
47 | #define TEGRA114_CLK_HOST1X 28 | ||
48 | #define TEGRA114_CLK_VCP 29 | ||
49 | #define TEGRA114_CLK_I2S0 30 | ||
50 | /* 31 */ | ||
51 | |||
52 | /* 32 */ | ||
53 | /* 33 */ | ||
54 | #define TEGRA114_CLK_APBDMA 34 | ||
55 | /* 35 */ | ||
56 | #define TEGRA114_CLK_KBC 36 | ||
57 | /* 37 */ | ||
58 | /* 38 */ | ||
59 | /* 39 (register bit affects fuse and fuse_burn) */ | ||
60 | #define TEGRA114_CLK_KFUSE 40 | ||
61 | #define TEGRA114_CLK_SBC1 41 | ||
62 | #define TEGRA114_CLK_NOR 42 | ||
63 | /* 43 */ | ||
64 | #define TEGRA114_CLK_SBC2 44 | ||
65 | /* 45 */ | ||
66 | #define TEGRA114_CLK_SBC3 46 | ||
67 | #define TEGRA114_CLK_I2C5 47 | ||
68 | #define TEGRA114_CLK_DSIA 48 | ||
69 | /* 49 */ | ||
70 | #define TEGRA114_CLK_MIPI 50 | ||
71 | #define TEGRA114_CLK_HDMI 51 | ||
72 | #define TEGRA114_CLK_CSI 52 | ||
73 | /* 53 */ | ||
74 | #define TEGRA114_CLK_I2C2 54 | ||
75 | #define TEGRA114_CLK_UARTC 55 | ||
76 | #define TEGRA114_CLK_MIPI_CAL 56 | ||
77 | #define TEGRA114_CLK_EMC 57 | ||
78 | #define TEGRA114_CLK_USB2 58 | ||
79 | #define TEGRA114_CLK_USB3 59 | ||
80 | /* 60 */ | ||
81 | #define TEGRA114_CLK_VDE 61 | ||
82 | #define TEGRA114_CLK_BSEA 62 | ||
83 | #define TEGRA114_CLK_BSEV 63 | ||
84 | |||
85 | /* 64 */ | ||
86 | #define TEGRA114_CLK_UARTD 65 | ||
87 | /* 66 */ | ||
88 | #define TEGRA114_CLK_I2C3 67 | ||
89 | #define TEGRA114_CLK_SBC4 68 | ||
90 | #define TEGRA114_CLK_SDMMC3 69 | ||
91 | /* 70 */ | ||
92 | #define TEGRA114_CLK_OWR 71 | ||
93 | /* 72 */ | ||
94 | #define TEGRA114_CLK_CSITE 73 | ||
95 | /* 74 */ | ||
96 | /* 75 */ | ||
97 | #define TEGRA114_CLK_LA 76 | ||
98 | #define TEGRA114_CLK_TRACE 77 | ||
99 | #define TEGRA114_CLK_SOC_THERM 78 | ||
100 | #define TEGRA114_CLK_DTV 79 | ||
101 | #define TEGRA114_CLK_NDSPEED 80 | ||
102 | #define TEGRA114_CLK_I2CSLOW 81 | ||
103 | #define TEGRA114_CLK_DSIB 82 | ||
104 | #define TEGRA114_CLK_TSEC 83 | ||
105 | /* 84 */ | ||
106 | /* 85 */ | ||
107 | /* 86 */ | ||
108 | /* 87 */ | ||
109 | /* 88 */ | ||
110 | #define TEGRA114_CLK_XUSB_HOST 89 | ||
111 | /* 90 */ | ||
112 | #define TEGRA114_CLK_MSENC 91 | ||
113 | #define TEGRA114_CLK_CSUS 92 | ||
114 | /* 93 */ | ||
115 | /* 94 */ | ||
116 | /* 95 (bit affects xusb_dev and xusb_dev_src) */ | ||
117 | |||
118 | /* 96 */ | ||
119 | /* 97 */ | ||
120 | /* 98 */ | ||
121 | #define TEGRA114_CLK_MSELECT 99 | ||
122 | #define TEGRA114_CLK_TSENSOR 100 | ||
123 | #define TEGRA114_CLK_I2S3 101 | ||
124 | #define TEGRA114_CLK_I2S4 102 | ||
125 | #define TEGRA114_CLK_I2C4 103 | ||
126 | #define TEGRA114_CLK_SBC5 104 | ||
127 | #define TEGRA114_CLK_SBC6 105 | ||
128 | #define TEGRA114_CLK_D_AUDIO 106 | ||
129 | #define TEGRA114_CLK_APBIF 107 | ||
130 | #define TEGRA114_CLK_DAM0 108 | ||
131 | #define TEGRA114_CLK_DAM1 109 | ||
132 | #define TEGRA114_CLK_DAM2 110 | ||
133 | #define TEGRA114_CLK_HDA2CODEC_2X 111 | ||
134 | /* 112 */ | ||
135 | #define TEGRA114_CLK_AUDIO0_2X 113 | ||
136 | #define TEGRA114_CLK_AUDIO1_2X 114 | ||
137 | #define TEGRA114_CLK_AUDIO2_2X 115 | ||
138 | #define TEGRA114_CLK_AUDIO3_2X 116 | ||
139 | #define TEGRA114_CLK_AUDIO4_2X 117 | ||
140 | #define TEGRA114_CLK_SPDIF_2X 118 | ||
141 | #define TEGRA114_CLK_ACTMON 119 | ||
142 | #define TEGRA114_CLK_EXTERN1 120 | ||
143 | #define TEGRA114_CLK_EXTERN2 121 | ||
144 | #define TEGRA114_CLK_EXTERN3 122 | ||
145 | /* 123 */ | ||
146 | /* 124 */ | ||
147 | #define TEGRA114_CLK_HDA 125 | ||
148 | /* 126 */ | ||
149 | #define TEGRA114_CLK_SE 127 | ||
150 | |||
151 | #define TEGRA114_CLK_HDA2HDMI 128 | ||
152 | /* 129 */ | ||
153 | /* 130 */ | ||
154 | /* 131 */ | ||
155 | /* 132 */ | ||
156 | /* 133 */ | ||
157 | /* 134 */ | ||
158 | /* 135 */ | ||
159 | /* 136 */ | ||
160 | /* 137 */ | ||
161 | /* 138 */ | ||
162 | /* 139 */ | ||
163 | /* 140 */ | ||
164 | /* 141 */ | ||
165 | /* 142 */ | ||
166 | /* 143 (bit affects xusb_falcon_src, xusb_fs_src, */ | ||
167 | /* xusb_host_src and xusb_ss_src) */ | ||
168 | #define TEGRA114_CLK_CILAB 144 | ||
169 | #define TEGRA114_CLK_CILCD 145 | ||
170 | #define TEGRA114_CLK_CILE 146 | ||
171 | #define TEGRA114_CLK_DSIALP 147 | ||
172 | #define TEGRA114_CLK_DSIBLP 148 | ||
173 | /* 149 */ | ||
174 | #define TEGRA114_CLK_DDS 150 | ||
175 | /* 151 */ | ||
176 | #define TEGRA114_CLK_DP2 152 | ||
177 | #define TEGRA114_CLK_AMX 153 | ||
178 | #define TEGRA114_CLK_ADX 154 | ||
179 | /* 155 (bit affects dfll_ref and dfll_soc) */ | ||
180 | #define TEGRA114_CLK_XUSB_SS 156 | ||
181 | /* 157 */ | ||
182 | /* 158 */ | ||
183 | /* 159 */ | ||
184 | |||
185 | /* 160 */ | ||
186 | /* 161 */ | ||
187 | /* 162 */ | ||
188 | /* 163 */ | ||
189 | /* 164 */ | ||
190 | /* 165 */ | ||
191 | /* 166 */ | ||
192 | /* 167 */ | ||
193 | /* 168 */ | ||
194 | /* 169 */ | ||
195 | /* 170 */ | ||
196 | /* 171 */ | ||
197 | /* 172 */ | ||
198 | /* 173 */ | ||
199 | /* 174 */ | ||
200 | /* 175 */ | ||
201 | /* 176 */ | ||
202 | /* 177 */ | ||
203 | /* 178 */ | ||
204 | /* 179 */ | ||
205 | /* 180 */ | ||
206 | /* 181 */ | ||
207 | /* 182 */ | ||
208 | /* 183 */ | ||
209 | /* 184 */ | ||
210 | /* 185 */ | ||
211 | /* 186 */ | ||
212 | /* 187 */ | ||
213 | /* 188 */ | ||
214 | /* 189 */ | ||
215 | /* 190 */ | ||
216 | /* 191 */ | ||
217 | |||
218 | #define TEGRA114_CLK_UARTB 192 | ||
219 | #define TEGRA114_CLK_VFIR 193 | ||
220 | #define TEGRA114_CLK_SPDIF_IN 194 | ||
221 | #define TEGRA114_CLK_SPDIF_OUT 195 | ||
222 | #define TEGRA114_CLK_VI 196 | ||
223 | #define TEGRA114_CLK_VI_SENSOR 197 | ||
224 | #define TEGRA114_CLK_FUSE 198 | ||
225 | #define TEGRA114_CLK_FUSE_BURN 199 | ||
226 | #define TEGRA114_CLK_CLK_32K 200 | ||
227 | #define TEGRA114_CLK_CLK_M 201 | ||
228 | #define TEGRA114_CLK_CLK_M_DIV2 202 | ||
229 | #define TEGRA114_CLK_CLK_M_DIV4 203 | ||
230 | #define TEGRA114_CLK_PLL_REF 204 | ||
231 | #define TEGRA114_CLK_PLL_C 205 | ||
232 | #define TEGRA114_CLK_PLL_C_OUT1 206 | ||
233 | #define TEGRA114_CLK_PLL_C2 207 | ||
234 | #define TEGRA114_CLK_PLL_C3 208 | ||
235 | #define TEGRA114_CLK_PLL_M 209 | ||
236 | #define TEGRA114_CLK_PLL_M_OUT1 210 | ||
237 | #define TEGRA114_CLK_PLL_P 211 | ||
238 | #define TEGRA114_CLK_PLL_P_OUT1 212 | ||
239 | #define TEGRA114_CLK_PLL_P_OUT2 213 | ||
240 | #define TEGRA114_CLK_PLL_P_OUT3 214 | ||
241 | #define TEGRA114_CLK_PLL_P_OUT4 215 | ||
242 | #define TEGRA114_CLK_PLL_A 216 | ||
243 | #define TEGRA114_CLK_PLL_A_OUT0 217 | ||
244 | #define TEGRA114_CLK_PLL_D 218 | ||
245 | #define TEGRA114_CLK_PLL_D_OUT0 219 | ||
246 | #define TEGRA114_CLK_PLL_D2 220 | ||
247 | #define TEGRA114_CLK_PLL_D2_OUT0 221 | ||
248 | #define TEGRA114_CLK_PLL_U 222 | ||
249 | #define TEGRA114_CLK_PLL_U_480M 223 | ||
250 | |||
251 | #define TEGRA114_CLK_PLL_U_60M 224 | ||
252 | #define TEGRA114_CLK_PLL_U_48M 225 | ||
253 | #define TEGRA114_CLK_PLL_U_12M 226 | ||
254 | #define TEGRA114_CLK_PLL_X 227 | ||
255 | #define TEGRA114_CLK_PLL_X_OUT0 228 | ||
256 | #define TEGRA114_CLK_PLL_RE_VCO 229 | ||
257 | #define TEGRA114_CLK_PLL_RE_OUT 230 | ||
258 | #define TEGRA114_CLK_PLL_E_OUT0 231 | ||
259 | #define TEGRA114_CLK_SPDIF_IN_SYNC 232 | ||
260 | #define TEGRA114_CLK_I2S0_SYNC 233 | ||
261 | #define TEGRA114_CLK_I2S1_SYNC 234 | ||
262 | #define TEGRA114_CLK_I2S2_SYNC 235 | ||
263 | #define TEGRA114_CLK_I2S3_SYNC 236 | ||
264 | #define TEGRA114_CLK_I2S4_SYNC 237 | ||
265 | #define TEGRA114_CLK_VIMCLK_SYNC 238 | ||
266 | #define TEGRA114_CLK_AUDIO0 239 | ||
267 | #define TEGRA114_CLK_AUDIO1 240 | ||
268 | #define TEGRA114_CLK_AUDIO2 241 | ||
269 | #define TEGRA114_CLK_AUDIO3 242 | ||
270 | #define TEGRA114_CLK_AUDIO4 243 | ||
271 | #define TEGRA114_CLK_SPDIF 244 | ||
272 | #define TEGRA114_CLK_CLK_OUT_1 245 | ||
273 | #define TEGRA114_CLK_CLK_OUT_2 246 | ||
274 | #define TEGRA114_CLK_CLK_OUT_3 247 | ||
275 | #define TEGRA114_CLK_BLINK 248 | ||
276 | /* 249 */ | ||
277 | /* 250 */ | ||
278 | /* 251 */ | ||
279 | #define TEGRA114_CLK_XUSB_HOST_SRC 252 | ||
280 | #define TEGRA114_CLK_XUSB_FALCON_SRC 253 | ||
281 | #define TEGRA114_CLK_XUSB_FS_SRC 254 | ||
282 | #define TEGRA114_CLK_XUSB_SS_SRC 255 | ||
283 | |||
284 | #define TEGRA114_CLK_XUSB_DEV_SRC 256 | ||
285 | #define TEGRA114_CLK_XUSB_DEV 257 | ||
286 | #define TEGRA114_CLK_XUSB_HS_SRC 258 | ||
287 | #define TEGRA114_CLK_SCLK 259 | ||
288 | #define TEGRA114_CLK_HCLK 260 | ||
289 | #define TEGRA114_CLK_PCLK 261 | ||
290 | #define TEGRA114_CLK_CCLK_G 262 | ||
291 | #define TEGRA114_CLK_CCLK_LP 263 | ||
292 | /* 264 */ | ||
293 | /* 265 */ | ||
294 | /* 266 */ | ||
295 | /* 267 */ | ||
296 | /* 268 */ | ||
297 | /* 269 */ | ||
298 | /* 270 */ | ||
299 | /* 271 */ | ||
300 | /* 272 */ | ||
301 | /* 273 */ | ||
302 | /* 274 */ | ||
303 | /* 275 */ | ||
304 | /* 276 */ | ||
305 | /* 277 */ | ||
306 | /* 278 */ | ||
307 | /* 279 */ | ||
308 | /* 280 */ | ||
309 | /* 281 */ | ||
310 | /* 282 */ | ||
311 | /* 283 */ | ||
312 | /* 284 */ | ||
313 | /* 285 */ | ||
314 | /* 286 */ | ||
315 | /* 287 */ | ||
316 | |||
317 | /* 288 */ | ||
318 | /* 289 */ | ||
319 | /* 290 */ | ||
320 | /* 291 */ | ||
321 | /* 292 */ | ||
322 | /* 293 */ | ||
323 | /* 294 */ | ||
324 | /* 295 */ | ||
325 | /* 296 */ | ||
326 | /* 297 */ | ||
327 | /* 298 */ | ||
328 | /* 299 */ | ||
329 | #define TEGRA114_CLK_AUDIO0_MUX 300 | ||
330 | #define TEGRA114_CLK_AUDIO1_MUX 301 | ||
331 | #define TEGRA114_CLK_AUDIO2_MUX 302 | ||
332 | #define TEGRA114_CLK_AUDIO3_MUX 303 | ||
333 | #define TEGRA114_CLK_AUDIO4_MUX 304 | ||
334 | #define TEGRA114_CLK_SPDIF_MUX 305 | ||
335 | #define TEGRA114_CLK_CLK_OUT_1_MUX 306 | ||
336 | #define TEGRA114_CLK_CLK_OUT_2_MUX 307 | ||
337 | #define TEGRA114_CLK_CLK_OUT_3_MUX 308 | ||
338 | #define TEGRA114_CLK_DSIA_MUX 309 | ||
339 | #define TEGRA114_CLK_DSIB_MUX 310 | ||
340 | #define TEGRA114_CLK_CLK_MAX 311 | ||
341 | |||
342 | #endif /* _DT_BINDINGS_CLOCK_TEGRA114_CAR_H */ | ||
diff --git a/include/dt-bindings/clock/tegra20-car.h b/include/dt-bindings/clock/tegra20-car.h new file mode 100644 index 000000000000..a1ae9a8fdd6c --- /dev/null +++ b/include/dt-bindings/clock/tegra20-car.h | |||
@@ -0,0 +1,158 @@ | |||
1 | /* | ||
2 | * This header provides constants for binding nvidia,tegra20-car. | ||
3 | * | ||
4 | * The first 96 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB | ||
5 | * registers. These IDs often match those in the CAR's RST_DEVICES registers, | ||
6 | * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In | ||
7 | * this case, those clocks are assigned IDs above 95 in order to highlight | ||
8 | * this issue. Implementations that interpret these clock IDs as bit values | ||
9 | * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to | ||
10 | * explicitly handle these special cases. | ||
11 | * | ||
12 | * The balance of the clocks controlled by the CAR are assigned IDs of 96 and | ||
13 | * above. | ||
14 | */ | ||
15 | |||
16 | #ifndef _DT_BINDINGS_CLOCK_TEGRA20_CAR_H | ||
17 | #define _DT_BINDINGS_CLOCK_TEGRA20_CAR_H | ||
18 | |||
19 | #define TEGRA20_CLK_CPU 0 | ||
20 | /* 1 */ | ||
21 | /* 2 */ | ||
22 | #define TEGRA20_CLK_AC97 3 | ||
23 | #define TEGRA20_CLK_RTC 4 | ||
24 | #define TEGRA20_CLK_TIMER 5 | ||
25 | #define TEGRA20_CLK_UARTA 6 | ||
26 | /* 7 (register bit affects uart2 and vfir) */ | ||
27 | #define TEGRA20_CLK_GPIO 8 | ||
28 | #define TEGRA20_CLK_SDMMC2 9 | ||
29 | /* 10 (register bit affects spdif_in and spdif_out) */ | ||
30 | #define TEGRA20_CLK_I2S1 11 | ||
31 | #define TEGRA20_CLK_I2C1 12 | ||
32 | #define TEGRA20_CLK_NDFLASH 13 | ||
33 | #define TEGRA20_CLK_SDMMC1 14 | ||
34 | #define TEGRA20_CLK_SDMMC4 15 | ||
35 | #define TEGRA20_CLK_TWC 16 | ||
36 | #define TEGRA20_CLK_PWM 17 | ||
37 | #define TEGRA20_CLK_I2S2 18 | ||
38 | #define TEGRA20_CLK_EPP 19 | ||
39 | /* 20 (register bit affects vi and vi_sensor) */ | ||
40 | #define TEGRA20_CLK_GR2D 21 | ||
41 | #define TEGRA20_CLK_USBD 22 | ||
42 | #define TEGRA20_CLK_ISP 23 | ||
43 | #define TEGRA20_CLK_GR3D 24 | ||
44 | #define TEGRA20_CLK_IDE 25 | ||
45 | #define TEGRA20_CLK_DISP2 26 | ||
46 | #define TEGRA20_CLK_DISP1 27 | ||
47 | #define TEGRA20_CLK_HOST1X 28 | ||
48 | #define TEGRA20_CLK_VCP 29 | ||
49 | /* 30 */ | ||
50 | #define TEGRA20_CLK_CACHE2 31 | ||
51 | |||
52 | #define TEGRA20_CLK_MEM 32 | ||
53 | #define TEGRA20_CLK_AHBDMA 33 | ||
54 | #define TEGRA20_CLK_APBDMA 34 | ||
55 | /* 35 */ | ||
56 | #define TEGRA20_CLK_KBC 36 | ||
57 | #define TEGRA20_CLK_STAT_MON 37 | ||
58 | #define TEGRA20_CLK_PMC 38 | ||
59 | #define TEGRA20_CLK_FUSE 39 | ||
60 | #define TEGRA20_CLK_KFUSE 40 | ||
61 | #define TEGRA20_CLK_SBC1 41 | ||
62 | #define TEGRA20_CLK_NOR 42 | ||
63 | #define TEGRA20_CLK_SPI 43 | ||
64 | #define TEGRA20_CLK_SBC2 44 | ||
65 | #define TEGRA20_CLK_XIO 45 | ||
66 | #define TEGRA20_CLK_SBC3 46 | ||
67 | #define TEGRA20_CLK_DVC 47 | ||
68 | #define TEGRA20_CLK_DSI 48 | ||
69 | /* 49 (register bit affects tvo and cve) */ | ||
70 | #define TEGRA20_CLK_MIPI 50 | ||
71 | #define TEGRA20_CLK_HDMI 51 | ||
72 | #define TEGRA20_CLK_CSI 52 | ||
73 | #define TEGRA20_CLK_TVDAC 53 | ||
74 | #define TEGRA20_CLK_I2C2 54 | ||
75 | #define TEGRA20_CLK_UARTC 55 | ||
76 | /* 56 */ | ||
77 | #define TEGRA20_CLK_EMC 57 | ||
78 | #define TEGRA20_CLK_USB2 58 | ||
79 | #define TEGRA20_CLK_USB3 59 | ||
80 | #define TEGRA20_CLK_MPE 60 | ||
81 | #define TEGRA20_CLK_VDE 61 | ||
82 | #define TEGRA20_CLK_BSEA 62 | ||
83 | #define TEGRA20_CLK_BSEV 63 | ||
84 | |||
85 | #define TEGRA20_CLK_SPEEDO 64 | ||
86 | #define TEGRA20_CLK_UARTD 65 | ||
87 | #define TEGRA20_CLK_UARTE 66 | ||
88 | #define TEGRA20_CLK_I2C3 67 | ||
89 | #define TEGRA20_CLK_SBC4 68 | ||
90 | #define TEGRA20_CLK_SDMMC3 69 | ||
91 | #define TEGRA20_CLK_PEX 70 | ||
92 | #define TEGRA20_CLK_OWR 71 | ||
93 | #define TEGRA20_CLK_AFI 72 | ||
94 | #define TEGRA20_CLK_CSITE 73 | ||
95 | #define TEGRA20_CLK_PCIE_XCLK 74 | ||
96 | #define TEGRA20_CLK_AVPUCQ 75 | ||
97 | #define TEGRA20_CLK_LA 76 | ||
98 | /* 77 */ | ||
99 | /* 78 */ | ||
100 | /* 79 */ | ||
101 | /* 80 */ | ||
102 | /* 81 */ | ||
103 | /* 82 */ | ||
104 | /* 83 */ | ||
105 | #define TEGRA20_CLK_IRAMA 84 | ||
106 | #define TEGRA20_CLK_IRAMB 85 | ||
107 | #define TEGRA20_CLK_IRAMC 86 | ||
108 | #define TEGRA20_CLK_IRAMD 87 | ||
109 | #define TEGRA20_CLK_CRAM2 88 | ||
110 | #define TEGRA20_CLK_AUDIO_2X 89 /* a/k/a audio_2x_sync_clk */ | ||
111 | #define TEGRA20_CLK_CLK_D 90 | ||
112 | /* 91 */ | ||
113 | #define TEGRA20_CLK_CSUS 92 | ||
114 | #define TEGRA20_CLK_CDEV2 93 | ||
115 | #define TEGRA20_CLK_CDEV1 94 | ||
116 | /* 95 */ | ||
117 | |||
118 | #define TEGRA20_CLK_UARTB 96 | ||
119 | #define TEGRA20_CLK_VFIR 97 | ||
120 | #define TEGRA20_CLK_SPDIF_IN 98 | ||
121 | #define TEGRA20_CLK_SPDIF_OUT 99 | ||
122 | #define TEGRA20_CLK_VI 100 | ||
123 | #define TEGRA20_CLK_VI_SENSOR 101 | ||
124 | #define TEGRA20_CLK_TVO 102 | ||
125 | #define TEGRA20_CLK_CVE 103 | ||
126 | #define TEGRA20_CLK_OSC 104 | ||
127 | #define TEGRA20_CLK_CLK_32K 105 /* a/k/a clk_s */ | ||
128 | #define TEGRA20_CLK_CLK_M 106 | ||
129 | #define TEGRA20_CLK_SCLK 107 | ||
130 | #define TEGRA20_CLK_CCLK 108 | ||
131 | #define TEGRA20_CLK_HCLK 109 | ||
132 | #define TEGRA20_CLK_PCLK 110 | ||
133 | #define TEGRA20_CLK_BLINK 111 | ||
134 | #define TEGRA20_CLK_PLL_A 112 | ||
135 | #define TEGRA20_CLK_PLL_A_OUT0 113 | ||
136 | #define TEGRA20_CLK_PLL_C 114 | ||
137 | #define TEGRA20_CLK_PLL_C_OUT1 115 | ||
138 | #define TEGRA20_CLK_PLL_D 116 | ||
139 | #define TEGRA20_CLK_PLL_D_OUT0 117 | ||
140 | #define TEGRA20_CLK_PLL_E 118 | ||
141 | #define TEGRA20_CLK_PLL_M 119 | ||
142 | #define TEGRA20_CLK_PLL_M_OUT1 120 | ||
143 | #define TEGRA20_CLK_PLL_P 121 | ||
144 | #define TEGRA20_CLK_PLL_P_OUT1 122 | ||
145 | #define TEGRA20_CLK_PLL_P_OUT2 123 | ||
146 | #define TEGRA20_CLK_PLL_P_OUT3 124 | ||
147 | #define TEGRA20_CLK_PLL_P_OUT4 125 | ||
148 | #define TEGRA20_CLK_PLL_S 126 | ||
149 | #define TEGRA20_CLK_PLL_U 127 | ||
150 | |||
151 | #define TEGRA20_CLK_PLL_X 128 | ||
152 | #define TEGRA20_CLK_COP 129 /* a/k/a avp */ | ||
153 | #define TEGRA20_CLK_AUDIO 130 /* a/k/a audio_sync_clk */ | ||
154 | #define TEGRA20_CLK_PLL_REF 131 | ||
155 | #define TEGRA20_CLK_TWD 132 | ||
156 | #define TEGRA20_CLK_CLK_MAX 133 | ||
157 | |||
158 | #endif /* _DT_BINDINGS_CLOCK_TEGRA20_CAR_H */ | ||
diff --git a/include/dt-bindings/clock/tegra30-car.h b/include/dt-bindings/clock/tegra30-car.h new file mode 100644 index 000000000000..e40fae8f9a8d --- /dev/null +++ b/include/dt-bindings/clock/tegra30-car.h | |||
@@ -0,0 +1,265 @@ | |||
1 | /* | ||
2 | * This header provides constants for binding nvidia,tegra30-car. | ||
3 | * | ||
4 | * The first 130 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB | ||
5 | * registers. These IDs often match those in the CAR's RST_DEVICES registers, | ||
6 | * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In | ||
7 | * this case, those clocks are assigned IDs above 160 in order to highlight | ||
8 | * this issue. Implementations that interpret these clock IDs as bit values | ||
9 | * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to | ||
10 | * explicitly handle these special cases. | ||
11 | * | ||
12 | * The balance of the clocks controlled by the CAR are assigned IDs of 160 and | ||
13 | * above. | ||
14 | */ | ||
15 | |||
16 | #ifndef _DT_BINDINGS_CLOCK_TEGRA30_CAR_H | ||
17 | #define _DT_BINDINGS_CLOCK_TEGRA30_CAR_H | ||
18 | |||
19 | #define TEGRA30_CLK_CPU 0 | ||
20 | /* 1 */ | ||
21 | /* 2 */ | ||
22 | /* 3 */ | ||
23 | #define TEGRA30_CLK_RTC 4 | ||
24 | #define TEGRA30_CLK_TIMER 5 | ||
25 | #define TEGRA30_CLK_UARTA 6 | ||
26 | /* 7 (register bit affects uartb and vfir) */ | ||
27 | #define TEGRA30_CLK_GPIO 8 | ||
28 | #define TEGRA30_CLK_SDMMC2 9 | ||
29 | /* 10 (register bit affects spdif_in and spdif_out) */ | ||
30 | #define TEGRA30_CLK_I2S1 11 | ||
31 | #define TEGRA30_CLK_I2C1 12 | ||
32 | #define TEGRA30_CLK_NDFLASH 13 | ||
33 | #define TEGRA30_CLK_SDMMC1 14 | ||
34 | #define TEGRA30_CLK_SDMMC4 15 | ||
35 | /* 16 */ | ||
36 | #define TEGRA30_CLK_PWM 17 | ||
37 | #define TEGRA30_CLK_I2S2 18 | ||
38 | #define TEGRA30_CLK_EPP 19 | ||
39 | /* 20 (register bit affects vi and vi_sensor) */ | ||
40 | #define TEGRA30_CLK_GR2D 21 | ||
41 | #define TEGRA30_CLK_USBD 22 | ||
42 | #define TEGRA30_CLK_ISP 23 | ||
43 | #define TEGRA30_CLK_GR3D 24 | ||
44 | /* 25 */ | ||
45 | #define TEGRA30_CLK_DISP2 26 | ||
46 | #define TEGRA30_CLK_DISP1 27 | ||
47 | #define TEGRA30_CLK_HOST1X 28 | ||
48 | #define TEGRA30_CLK_VCP 29 | ||
49 | #define TEGRA30_CLK_I2S0 30 | ||
50 | #define TEGRA30_CLK_COP_CACHE 31 | ||
51 | |||
52 | #define TEGRA30_CLK_MC 32 | ||
53 | #define TEGRA30_CLK_AHBDMA 33 | ||
54 | #define TEGRA30_CLK_APBDMA 34 | ||
55 | /* 35 */ | ||
56 | #define TEGRA30_CLK_KBC 36 | ||
57 | #define TEGRA30_CLK_STATMON 37 | ||
58 | #define TEGRA30_CLK_PMC 38 | ||
59 | /* 39 (register bit affects fuse and fuse_burn) */ | ||
60 | #define TEGRA30_CLK_KFUSE 40 | ||
61 | #define TEGRA30_CLK_SBC1 41 | ||
62 | #define TEGRA30_CLK_NOR 42 | ||
63 | /* 43 */ | ||
64 | #define TEGRA30_CLK_SBC2 44 | ||
65 | /* 45 */ | ||
66 | #define TEGRA30_CLK_SBC3 46 | ||
67 | #define TEGRA30_CLK_I2C5 47 | ||
68 | #define TEGRA30_CLK_DSIA 48 | ||
69 | /* 49 (register bit affects cve and tvo) */ | ||
70 | #define TEGRA30_CLK_MIPI 50 | ||
71 | #define TEGRA30_CLK_HDMI 51 | ||
72 | #define TEGRA30_CLK_CSI 52 | ||
73 | #define TEGRA30_CLK_TVDAC 53 | ||
74 | #define TEGRA30_CLK_I2C2 54 | ||
75 | #define TEGRA30_CLK_UARTC 55 | ||
76 | /* 56 */ | ||
77 | #define TEGRA30_CLK_EMC 57 | ||
78 | #define TEGRA30_CLK_USB2 58 | ||
79 | #define TEGRA30_CLK_USB3 59 | ||
80 | #define TEGRA30_CLK_MPE 60 | ||
81 | #define TEGRA30_CLK_VDE 61 | ||
82 | #define TEGRA30_CLK_BSEA 62 | ||
83 | #define TEGRA30_CLK_BSEV 63 | ||
84 | |||
85 | #define TEGRA30_CLK_SPEEDO 64 | ||
86 | #define TEGRA30_CLK_UARTD 65 | ||
87 | #define TEGRA30_CLK_UARTE 66 | ||
88 | #define TEGRA30_CLK_I2C3 67 | ||
89 | #define TEGRA30_CLK_SBC4 68 | ||
90 | #define TEGRA30_CLK_SDMMC3 69 | ||
91 | #define TEGRA30_CLK_PCIE 70 | ||
92 | #define TEGRA30_CLK_OWR 71 | ||
93 | #define TEGRA30_CLK_AFI 72 | ||
94 | #define TEGRA30_CLK_CSITE 73 | ||
95 | #define TEGRA30_CLK_PCIEX 74 | ||
96 | #define TEGRA30_CLK_AVPUCQ 75 | ||
97 | #define TEGRA30_CLK_LA 76 | ||
98 | /* 77 */ | ||
99 | /* 78 */ | ||
100 | #define TEGRA30_CLK_DTV 79 | ||
101 | #define TEGRA30_CLK_NDSPEED 80 | ||
102 | #define TEGRA30_CLK_I2CSLOW 81 | ||
103 | #define TEGRA30_CLK_DSIB 82 | ||
104 | /* 83 */ | ||
105 | #define TEGRA30_CLK_IRAMA 84 | ||
106 | #define TEGRA30_CLK_IRAMB 85 | ||
107 | #define TEGRA30_CLK_IRAMC 86 | ||
108 | #define TEGRA30_CLK_IRAMD 87 | ||
109 | #define TEGRA30_CLK_CRAM2 88 | ||
110 | /* 89 */ | ||
111 | #define TEGRA30_CLK_AUDIO_2X 90 /* a/k/a audio_2x_sync_clk */ | ||
112 | /* 91 */ | ||
113 | #define TEGRA30_CLK_CSUS 92 | ||
114 | #define TEGRA30_CLK_CDEV2 93 | ||
115 | #define TEGRA30_CLK_CDEV1 94 | ||
116 | /* 95 */ | ||
117 | |||
118 | #define TEGRA30_CLK_CPU_G 96 | ||
119 | #define TEGRA30_CLK_CPU_LP 97 | ||
120 | #define TEGRA30_CLK_GR3D2 98 | ||
121 | #define TEGRA30_CLK_MSELECT 99 | ||
122 | #define TEGRA30_CLK_TSENSOR 100 | ||
123 | #define TEGRA30_CLK_I2S3 101 | ||
124 | #define TEGRA30_CLK_I2S4 102 | ||
125 | #define TEGRA30_CLK_I2C4 103 | ||
126 | #define TEGRA30_CLK_SBC5 104 | ||
127 | #define TEGRA30_CLK_SBC6 105 | ||
128 | #define TEGRA30_CLK_D_AUDIO 106 | ||
129 | #define TEGRA30_CLK_APBIF 107 | ||
130 | #define TEGRA30_CLK_DAM0 108 | ||
131 | #define TEGRA30_CLK_DAM1 109 | ||
132 | #define TEGRA30_CLK_DAM2 110 | ||
133 | #define TEGRA30_CLK_HDA2CODEC_2X 111 | ||
134 | #define TEGRA30_CLK_ATOMICS 112 | ||
135 | #define TEGRA30_CLK_AUDIO0_2X 113 | ||
136 | #define TEGRA30_CLK_AUDIO1_2X 114 | ||
137 | #define TEGRA30_CLK_AUDIO2_2X 115 | ||
138 | #define TEGRA30_CLK_AUDIO3_2X 116 | ||
139 | #define TEGRA30_CLK_AUDIO4_2X 117 | ||
140 | #define TEGRA30_CLK_SPDIF_2X 118 | ||
141 | #define TEGRA30_CLK_ACTMON 119 | ||
142 | #define TEGRA30_CLK_EXTERN1 120 | ||
143 | #define TEGRA30_CLK_EXTERN2 121 | ||
144 | #define TEGRA30_CLK_EXTERN3 122 | ||
145 | #define TEGRA30_CLK_SATA_OOB 123 | ||
146 | #define TEGRA30_CLK_SATA 124 | ||
147 | #define TEGRA30_CLK_HDA 125 | ||
148 | /* 126 */ | ||
149 | #define TEGRA30_CLK_SE 127 | ||
150 | |||
151 | #define TEGRA30_CLK_HDA2HDMI 128 | ||
152 | #define TEGRA30_CLK_SATA_COLD 129 | ||
153 | /* 130 */ | ||
154 | /* 131 */ | ||
155 | /* 132 */ | ||
156 | /* 133 */ | ||
157 | /* 134 */ | ||
158 | /* 135 */ | ||
159 | /* 136 */ | ||
160 | /* 137 */ | ||
161 | /* 138 */ | ||
162 | /* 139 */ | ||
163 | /* 140 */ | ||
164 | /* 141 */ | ||
165 | /* 142 */ | ||
166 | /* 143 */ | ||
167 | /* 144 */ | ||
168 | /* 145 */ | ||
169 | /* 146 */ | ||
170 | /* 147 */ | ||
171 | /* 148 */ | ||
172 | /* 149 */ | ||
173 | /* 150 */ | ||
174 | /* 151 */ | ||
175 | /* 152 */ | ||
176 | /* 153 */ | ||
177 | /* 154 */ | ||
178 | /* 155 */ | ||
179 | /* 156 */ | ||
180 | /* 157 */ | ||
181 | /* 158 */ | ||
182 | /* 159 */ | ||
183 | |||
184 | #define TEGRA30_CLK_UARTB 160 | ||
185 | #define TEGRA30_CLK_VFIR 161 | ||
186 | #define TEGRA30_CLK_SPDIF_IN 162 | ||
187 | #define TEGRA30_CLK_SPDIF_OUT 163 | ||
188 | #define TEGRA30_CLK_VI 164 | ||
189 | #define TEGRA30_CLK_VI_SENSOR 165 | ||
190 | #define TEGRA30_CLK_FUSE 166 | ||
191 | #define TEGRA30_CLK_FUSE_BURN 167 | ||
192 | #define TEGRA30_CLK_CVE 168 | ||
193 | #define TEGRA30_CLK_TVO 169 | ||
194 | #define TEGRA30_CLK_CLK_32K 170 | ||
195 | #define TEGRA30_CLK_CLK_M 171 | ||
196 | #define TEGRA30_CLK_CLK_M_DIV2 172 | ||
197 | #define TEGRA30_CLK_CLK_M_DIV4 173 | ||
198 | #define TEGRA30_CLK_PLL_REF 174 | ||
199 | #define TEGRA30_CLK_PLL_C 175 | ||
200 | #define TEGRA30_CLK_PLL_C_OUT1 176 | ||
201 | #define TEGRA30_CLK_PLL_M 177 | ||
202 | #define TEGRA30_CLK_PLL_M_OUT1 178 | ||
203 | #define TEGRA30_CLK_PLL_P 179 | ||
204 | #define TEGRA30_CLK_PLL_P_OUT1 180 | ||
205 | #define TEGRA30_CLK_PLL_P_OUT2 181 | ||
206 | #define TEGRA30_CLK_PLL_P_OUT3 182 | ||
207 | #define TEGRA30_CLK_PLL_P_OUT4 183 | ||
208 | #define TEGRA30_CLK_PLL_A 184 | ||
209 | #define TEGRA30_CLK_PLL_A_OUT0 185 | ||
210 | #define TEGRA30_CLK_PLL_D 186 | ||
211 | #define TEGRA30_CLK_PLL_D_OUT0 187 | ||
212 | #define TEGRA30_CLK_PLL_D2 188 | ||
213 | #define TEGRA30_CLK_PLL_D2_OUT0 189 | ||
214 | #define TEGRA30_CLK_PLL_U 190 | ||
215 | #define TEGRA30_CLK_PLL_X 191 | ||
216 | |||
217 | #define TEGRA30_CLK_PLL_X_OUT0 192 | ||
218 | #define TEGRA30_CLK_PLL_E 193 | ||
219 | #define TEGRA30_CLK_SPDIF_IN_SYNC 194 | ||
220 | #define TEGRA30_CLK_I2S0_SYNC 195 | ||
221 | #define TEGRA30_CLK_I2S1_SYNC 196 | ||
222 | #define TEGRA30_CLK_I2S2_SYNC 197 | ||
223 | #define TEGRA30_CLK_I2S3_SYNC 198 | ||
224 | #define TEGRA30_CLK_I2S4_SYNC 199 | ||
225 | #define TEGRA30_CLK_VIMCLK_SYNC 200 | ||
226 | #define TEGRA30_CLK_AUDIO0 201 | ||
227 | #define TEGRA30_CLK_AUDIO1 202 | ||
228 | #define TEGRA30_CLK_AUDIO2 203 | ||
229 | #define TEGRA30_CLK_AUDIO3 204 | ||
230 | #define TEGRA30_CLK_AUDIO4 205 | ||
231 | #define TEGRA30_CLK_SPDIF 206 | ||
232 | #define TEGRA30_CLK_CLK_OUT_1 207 /* (extern1) */ | ||
233 | #define TEGRA30_CLK_CLK_OUT_2 208 /* (extern2) */ | ||
234 | #define TEGRA30_CLK_CLK_OUT_3 209 /* (extern3) */ | ||
235 | #define TEGRA30_CLK_SCLK 210 | ||
236 | #define TEGRA30_CLK_BLINK 211 | ||
237 | #define TEGRA30_CLK_CCLK_G 212 | ||
238 | #define TEGRA30_CLK_CCLK_LP 213 | ||
239 | #define TEGRA30_CLK_TWD 214 | ||
240 | #define TEGRA30_CLK_CML0 215 | ||
241 | #define TEGRA30_CLK_CML1 216 | ||
242 | #define TEGRA30_CLK_HCLK 217 | ||
243 | #define TEGRA30_CLK_PCLK 218 | ||
244 | /* 219 */ | ||
245 | /* 220 */ | ||
246 | /* 221 */ | ||
247 | /* 222 */ | ||
248 | /* 223 */ | ||
249 | |||
250 | /* 288 */ | ||
251 | /* 289 */ | ||
252 | /* 290 */ | ||
253 | /* 291 */ | ||
254 | /* 292 */ | ||
255 | /* 293 */ | ||
256 | /* 294 */ | ||
257 | /* 295 */ | ||
258 | /* 296 */ | ||
259 | /* 297 */ | ||
260 | /* 298 */ | ||
261 | /* 299 */ | ||
262 | #define TEGRA30_CLK_CLK_OUT_1_MUX 300 | ||
263 | #define TEGRA30_CLK_CLK_MAX 301 | ||
264 | |||
265 | #endif /* _DT_BINDINGS_CLOCK_TEGRA30_CAR_H */ | ||
diff --git a/include/dt-bindings/clock/vf610-clock.h b/include/dt-bindings/clock/vf610-clock.h new file mode 100644 index 000000000000..15e997fa78f2 --- /dev/null +++ b/include/dt-bindings/clock/vf610-clock.h | |||
@@ -0,0 +1,163 @@ | |||
1 | /* | ||
2 | * Copyright 2013 Freescale Semiconductor, Inc. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #ifndef __DT_BINDINGS_CLOCK_VF610_H | ||
11 | #define __DT_BINDINGS_CLOCK_VF610_H | ||
12 | |||
13 | #define VF610_CLK_DUMMY 0 | ||
14 | #define VF610_CLK_SIRC_128K 1 | ||
15 | #define VF610_CLK_SIRC_32K 2 | ||
16 | #define VF610_CLK_FIRC 3 | ||
17 | #define VF610_CLK_SXOSC 4 | ||
18 | #define VF610_CLK_FXOSC 5 | ||
19 | #define VF610_CLK_FXOSC_HALF 6 | ||
20 | #define VF610_CLK_SLOW_CLK_SEL 7 | ||
21 | #define VF610_CLK_FASK_CLK_SEL 8 | ||
22 | #define VF610_CLK_AUDIO_EXT 9 | ||
23 | #define VF610_CLK_ENET_EXT 10 | ||
24 | #define VF610_CLK_PLL1_MAIN 11 | ||
25 | #define VF610_CLK_PLL1_PFD1 12 | ||
26 | #define VF610_CLK_PLL1_PFD2 13 | ||
27 | #define VF610_CLK_PLL1_PFD3 14 | ||
28 | #define VF610_CLK_PLL1_PFD4 15 | ||
29 | #define VF610_CLK_PLL2_MAIN 16 | ||
30 | #define VF610_CLK_PLL2_PFD1 17 | ||
31 | #define VF610_CLK_PLL2_PFD2 18 | ||
32 | #define VF610_CLK_PLL2_PFD3 19 | ||
33 | #define VF610_CLK_PLL2_PFD4 20 | ||
34 | #define VF610_CLK_PLL3_MAIN 21 | ||
35 | #define VF610_CLK_PLL3_PFD1 22 | ||
36 | #define VF610_CLK_PLL3_PFD2 23 | ||
37 | #define VF610_CLK_PLL3_PFD3 24 | ||
38 | #define VF610_CLK_PLL3_PFD4 25 | ||
39 | #define VF610_CLK_PLL4_MAIN 26 | ||
40 | #define VF610_CLK_PLL5_MAIN 27 | ||
41 | #define VF610_CLK_PLL6_MAIN 28 | ||
42 | #define VF610_CLK_PLL3_MAIN_DIV 29 | ||
43 | #define VF610_CLK_PLL4_MAIN_DIV 30 | ||
44 | #define VF610_CLK_PLL6_MAIN_DIV 31 | ||
45 | #define VF610_CLK_PLL1_PFD_SEL 32 | ||
46 | #define VF610_CLK_PLL2_PFD_SEL 33 | ||
47 | #define VF610_CLK_SYS_SEL 34 | ||
48 | #define VF610_CLK_DDR_SEL 35 | ||
49 | #define VF610_CLK_SYS_BUS 36 | ||
50 | #define VF610_CLK_PLATFORM_BUS 37 | ||
51 | #define VF610_CLK_IPG_BUS 38 | ||
52 | #define VF610_CLK_UART0 39 | ||
53 | #define VF610_CLK_UART1 40 | ||
54 | #define VF610_CLK_UART2 41 | ||
55 | #define VF610_CLK_UART3 42 | ||
56 | #define VF610_CLK_UART4 43 | ||
57 | #define VF610_CLK_UART5 44 | ||
58 | #define VF610_CLK_PIT 45 | ||
59 | #define VF610_CLK_I2C0 46 | ||
60 | #define VF610_CLK_I2C1 47 | ||
61 | #define VF610_CLK_I2C2 48 | ||
62 | #define VF610_CLK_I2C3 49 | ||
63 | #define VF610_CLK_FTM0_EXT_SEL 50 | ||
64 | #define VF610_CLK_FTM0_FIX_SEL 51 | ||
65 | #define VF610_CLK_FTM0_EXT_FIX_EN 52 | ||
66 | #define VF610_CLK_FTM1_EXT_SEL 53 | ||
67 | #define VF610_CLK_FTM1_FIX_SEL 54 | ||
68 | #define VF610_CLK_FTM1_EXT_FIX_EN 55 | ||
69 | #define VF610_CLK_FTM2_EXT_SEL 56 | ||
70 | #define VF610_CLK_FTM2_FIX_SEL 57 | ||
71 | #define VF610_CLK_FTM2_EXT_FIX_EN 58 | ||
72 | #define VF610_CLK_FTM3_EXT_SEL 59 | ||
73 | #define VF610_CLK_FTM3_FIX_SEL 60 | ||
74 | #define VF610_CLK_FTM3_EXT_FIX_EN 61 | ||
75 | #define VF610_CLK_FTM0 62 | ||
76 | #define VF610_CLK_FTM1 63 | ||
77 | #define VF610_CLK_FTM2 64 | ||
78 | #define VF610_CLK_FTM3 65 | ||
79 | #define VF610_CLK_ENET_50M 66 | ||
80 | #define VF610_CLK_ENET_25M 67 | ||
81 | #define VF610_CLK_ENET_SEL 68 | ||
82 | #define VF610_CLK_ENET 69 | ||
83 | #define VF610_CLK_ENET_TS_SEL 70 | ||
84 | #define VF610_CLK_ENET_TS 71 | ||
85 | #define VF610_CLK_DSPI0 72 | ||
86 | #define VF610_CLK_DSPI1 73 | ||
87 | #define VF610_CLK_DSPI2 74 | ||
88 | #define VF610_CLK_DSPI3 75 | ||
89 | #define VF610_CLK_WDT 76 | ||
90 | #define VF610_CLK_ESDHC0_SEL 77 | ||
91 | #define VF610_CLK_ESDHC0_EN 78 | ||
92 | #define VF610_CLK_ESDHC0_DIV 79 | ||
93 | #define VF610_CLK_ESDHC0 80 | ||
94 | #define VF610_CLK_ESDHC1_SEL 81 | ||
95 | #define VF610_CLK_ESDHC1_EN 82 | ||
96 | #define VF610_CLK_ESDHC1_DIV 83 | ||
97 | #define VF610_CLK_ESDHC1 84 | ||
98 | #define VF610_CLK_DCU0_SEL 85 | ||
99 | #define VF610_CLK_DCU0_EN 86 | ||
100 | #define VF610_CLK_DCU0_DIV 87 | ||
101 | #define VF610_CLK_DCU0 88 | ||
102 | #define VF610_CLK_DCU1_SEL 89 | ||
103 | #define VF610_CLK_DCU1_EN 90 | ||
104 | #define VF610_CLK_DCU1_DIV 91 | ||
105 | #define VF610_CLK_DCU1 92 | ||
106 | #define VF610_CLK_ESAI_SEL 93 | ||
107 | #define VF610_CLK_ESAI_EN 94 | ||
108 | #define VF610_CLK_ESAI_DIV 95 | ||
109 | #define VF610_CLK_ESAI 96 | ||
110 | #define VF610_CLK_SAI0_SEL 97 | ||
111 | #define VF610_CLK_SAI0_EN 98 | ||
112 | #define VF610_CLK_SAI0_DIV 99 | ||
113 | #define VF610_CLK_SAI0 100 | ||
114 | #define VF610_CLK_SAI1_SEL 101 | ||
115 | #define VF610_CLK_SAI1_EN 102 | ||
116 | #define VF610_CLK_SAI1_DIV 103 | ||
117 | #define VF610_CLK_SAI1 104 | ||
118 | #define VF610_CLK_SAI2_SEL 105 | ||
119 | #define VF610_CLK_SAI2_EN 106 | ||
120 | #define VF610_CLK_SAI2_DIV 107 | ||
121 | #define VF610_CLK_SAI2 108 | ||
122 | #define VF610_CLK_SAI3_SEL 109 | ||
123 | #define VF610_CLK_SAI3_EN 110 | ||
124 | #define VF610_CLK_SAI3_DIV 111 | ||
125 | #define VF610_CLK_SAI3 112 | ||
126 | #define VF610_CLK_USBC0 113 | ||
127 | #define VF610_CLK_USBC1 114 | ||
128 | #define VF610_CLK_QSPI0_SEL 115 | ||
129 | #define VF610_CLK_QSPI0_EN 116 | ||
130 | #define VF610_CLK_QSPI0_X4_DIV 117 | ||
131 | #define VF610_CLK_QSPI0_X2_DIV 118 | ||
132 | #define VF610_CLK_QSPI0_X1_DIV 119 | ||
133 | #define VF610_CLK_QSPI1_SEL 120 | ||
134 | #define VF610_CLK_QSPI1_EN 121 | ||
135 | #define VF610_CLK_QSPI1_X4_DIV 122 | ||
136 | #define VF610_CLK_QSPI1_X2_DIV 123 | ||
137 | #define VF610_CLK_QSPI1_X1_DIV 124 | ||
138 | #define VF610_CLK_QSPI0 125 | ||
139 | #define VF610_CLK_QSPI1 126 | ||
140 | #define VF610_CLK_NFC_SEL 127 | ||
141 | #define VF610_CLK_NFC_EN 128 | ||
142 | #define VF610_CLK_NFC_PRE_DIV 129 | ||
143 | #define VF610_CLK_NFC_FRAC_DIV 130 | ||
144 | #define VF610_CLK_NFC_INV 131 | ||
145 | #define VF610_CLK_NFC 132 | ||
146 | #define VF610_CLK_VADC_SEL 133 | ||
147 | #define VF610_CLK_VADC_EN 134 | ||
148 | #define VF610_CLK_VADC_DIV 135 | ||
149 | #define VF610_CLK_VADC_DIV_HALF 136 | ||
150 | #define VF610_CLK_VADC 137 | ||
151 | #define VF610_CLK_ADC0 138 | ||
152 | #define VF610_CLK_ADC1 139 | ||
153 | #define VF610_CLK_DAC0 140 | ||
154 | #define VF610_CLK_DAC1 141 | ||
155 | #define VF610_CLK_FLEXCAN0 142 | ||
156 | #define VF610_CLK_FLEXCAN1 143 | ||
157 | #define VF610_CLK_ASRC 144 | ||
158 | #define VF610_CLK_GPU_SEL 145 | ||
159 | #define VF610_CLK_GPU_EN 146 | ||
160 | #define VF610_CLK_GPU2D 147 | ||
161 | #define VF610_CLK_END 148 | ||
162 | |||
163 | #endif /* __DT_BINDINGS_CLOCK_VF610_H */ | ||
diff --git a/include/dt-bindings/dma/at91.h b/include/dt-bindings/dma/at91.h new file mode 100644 index 000000000000..e835037a77b4 --- /dev/null +++ b/include/dt-bindings/dma/at91.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * This header provides macros for at91 dma bindings. | ||
3 | * | ||
4 | * Copyright (C) 2013 Ludovic Desroches <ludovic.desroches@atmel.com> | ||
5 | * | ||
6 | * GPLv2 only | ||
7 | */ | ||
8 | |||
9 | #ifndef __DT_BINDINGS_AT91_DMA_H__ | ||
10 | #define __DT_BINDINGS_AT91_DMA_H__ | ||
11 | |||
12 | /* | ||
13 | * Source and/or destination peripheral ID | ||
14 | */ | ||
15 | #define AT91_DMA_CFG_PER_ID_MASK (0xff) | ||
16 | #define AT91_DMA_CFG_PER_ID(id) (id & AT91_DMA_CFG_PER_ID_MASK) | ||
17 | |||
18 | /* | ||
19 | * FIFO configuration: it defines when a request is serviced. | ||
20 | */ | ||
21 | #define AT91_DMA_CFG_FIFOCFG_OFFSET (8) | ||
22 | #define AT91_DMA_CFG_FIFOCFG_MASK (0xf << AT91_DMA_CFG_FIFOCFG_OFFSET) | ||
23 | #define AT91_DMA_CFG_FIFOCFG_HALF (0x0 << AT91_DMA_CFG_FIFOCFG_OFFSET) /* half FIFO (default behavior) */ | ||
24 | #define AT91_DMA_CFG_FIFOCFG_ALAP (0x1 << AT91_DMA_CFG_FIFOCFG_OFFSET) /* largest defined AHB burst */ | ||
25 | #define AT91_DMA_CFG_FIFOCFG_ASAP (0x2 << AT91_DMA_CFG_FIFOCFG_OFFSET) /* single AHB access */ | ||
26 | |||
27 | #endif /* __DT_BINDINGS_AT91_DMA_H__ */ | ||
diff --git a/include/dt-bindings/gpio/tegra-gpio.h b/include/dt-bindings/gpio/tegra-gpio.h new file mode 100644 index 000000000000..4d179c00f081 --- /dev/null +++ b/include/dt-bindings/gpio/tegra-gpio.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * This header provides constants for binding nvidia,tegra*-gpio. | ||
3 | * | ||
4 | * The first cell in Tegra's GPIO specifier is the GPIO ID. The macros below | ||
5 | * provide names for this. | ||
6 | * | ||
7 | * The second cell contains standard flag values specified in gpio.h. | ||
8 | */ | ||
9 | |||
10 | #ifndef _DT_BINDINGS_GPIO_TEGRA_GPIO_H | ||
11 | #define _DT_BINDINGS_GPIO_TEGRA_GPIO_H | ||
12 | |||
13 | #include <dt-bindings/gpio/gpio.h> | ||
14 | |||
15 | #define TEGRA_GPIO_BANK_ID_A 0 | ||
16 | #define TEGRA_GPIO_BANK_ID_B 1 | ||
17 | #define TEGRA_GPIO_BANK_ID_C 2 | ||
18 | #define TEGRA_GPIO_BANK_ID_D 3 | ||
19 | #define TEGRA_GPIO_BANK_ID_E 4 | ||
20 | #define TEGRA_GPIO_BANK_ID_F 5 | ||
21 | #define TEGRA_GPIO_BANK_ID_G 6 | ||
22 | #define TEGRA_GPIO_BANK_ID_H 7 | ||
23 | #define TEGRA_GPIO_BANK_ID_I 8 | ||
24 | #define TEGRA_GPIO_BANK_ID_J 9 | ||
25 | #define TEGRA_GPIO_BANK_ID_K 10 | ||
26 | #define TEGRA_GPIO_BANK_ID_L 11 | ||
27 | #define TEGRA_GPIO_BANK_ID_M 12 | ||
28 | #define TEGRA_GPIO_BANK_ID_N 13 | ||
29 | #define TEGRA_GPIO_BANK_ID_O 14 | ||
30 | #define TEGRA_GPIO_BANK_ID_P 15 | ||
31 | #define TEGRA_GPIO_BANK_ID_Q 16 | ||
32 | #define TEGRA_GPIO_BANK_ID_R 17 | ||
33 | #define TEGRA_GPIO_BANK_ID_S 18 | ||
34 | #define TEGRA_GPIO_BANK_ID_T 19 | ||
35 | #define TEGRA_GPIO_BANK_ID_U 20 | ||
36 | #define TEGRA_GPIO_BANK_ID_V 21 | ||
37 | #define TEGRA_GPIO_BANK_ID_W 22 | ||
38 | #define TEGRA_GPIO_BANK_ID_X 23 | ||
39 | #define TEGRA_GPIO_BANK_ID_Y 24 | ||
40 | #define TEGRA_GPIO_BANK_ID_Z 25 | ||
41 | #define TEGRA_GPIO_BANK_ID_AA 26 | ||
42 | #define TEGRA_GPIO_BANK_ID_BB 27 | ||
43 | #define TEGRA_GPIO_BANK_ID_CC 28 | ||
44 | #define TEGRA_GPIO_BANK_ID_DD 29 | ||
45 | #define TEGRA_GPIO_BANK_ID_EE 30 | ||
46 | |||
47 | #define TEGRA_GPIO(bank, offset) \ | ||
48 | ((TEGRA_GPIO_BANK_ID_##bank * 8) + offset) | ||
49 | |||
50 | #endif | ||
diff --git a/include/dt-bindings/pinctrl/am33xx.h b/include/dt-bindings/pinctrl/am33xx.h new file mode 100644 index 000000000000..469e0325e6f4 --- /dev/null +++ b/include/dt-bindings/pinctrl/am33xx.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * This header provides constants specific to AM33XX pinctrl bindings. | ||
3 | */ | ||
4 | |||
5 | #ifndef _DT_BINDINGS_PINCTRL_AM33XX_H | ||
6 | #define _DT_BINDINGS_PINCTRL_AM33XX_H | ||
7 | |||
8 | #include <include/dt-bindings/pinctrl/omap.h> | ||
9 | |||
10 | /* am33xx specific mux bit defines */ | ||
11 | #undef PULL_ENA | ||
12 | #undef INPUT_EN | ||
13 | |||
14 | #define PULL_DISABLE (1 << 3) | ||
15 | #define INPUT_EN (1 << 5) | ||
16 | #define SLEWCTRL_FAST (1 << 6) | ||
17 | |||
18 | /* update macro depending on INPUT_EN and PULL_ENA */ | ||
19 | #undef PIN_OUTPUT | ||
20 | #undef PIN_OUTPUT_PULLUP | ||
21 | #undef PIN_OUTPUT_PULLDOWN | ||
22 | #undef PIN_INPUT | ||
23 | #undef PIN_INPUT_PULLUP | ||
24 | #undef PIN_INPUT_PULLDOWN | ||
25 | |||
26 | #define PIN_OUTPUT (PULL_DISABLE) | ||
27 | #define PIN_OUTPUT_PULLUP (PULL_UP) | ||
28 | #define PIN_OUTPUT_PULLDOWN 0 | ||
29 | #define PIN_INPUT (INPUT_EN | PULL_DISABLE) | ||
30 | #define PIN_INPUT_PULLUP (INPUT_EN | PULL_UP) | ||
31 | #define PIN_INPUT_PULLDOWN (INPUT_EN) | ||
32 | |||
33 | /* undef non-existing modes */ | ||
34 | #undef PIN_OFF_NONE | ||
35 | #undef PIN_OFF_OUTPUT_HIGH | ||
36 | #undef PIN_OFF_OUTPUT_LOW | ||
37 | #undef PIN_OFF_INPUT_PULLUP | ||
38 | #undef PIN_OFF_INPUT_PULLDOWN | ||
39 | #undef PIN_OFF_WAKEUPENABLE | ||
40 | |||
41 | #endif | ||
42 | |||
diff --git a/include/dt-bindings/pinctrl/at91.h b/include/dt-bindings/pinctrl/at91.h new file mode 100644 index 000000000000..d7988b4d8af9 --- /dev/null +++ b/include/dt-bindings/pinctrl/at91.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | * This header provides constants for most at91 pinctrl bindings. | ||
3 | * | ||
4 | * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | ||
5 | * | ||
6 | * GPLv2 only | ||
7 | */ | ||
8 | |||
9 | #ifndef __DT_BINDINGS_AT91_PINCTRL_H__ | ||
10 | #define __DT_BINDINGS_AT91_PINCTRL_H__ | ||
11 | |||
12 | #define AT91_PINCTRL_NONE (0 << 0) | ||
13 | #define AT91_PINCTRL_PULL_UP (1 << 0) | ||
14 | #define AT91_PINCTRL_MULTI_DRIVE (1 << 1) | ||
15 | #define AT91_PINCTRL_DEGLITCH (1 << 2) | ||
16 | #define AT91_PINCTRL_PULL_DOWN (1 << 3) | ||
17 | #define AT91_PINCTRL_DIS_SCHMIT (1 << 4) | ||
18 | #define AT91_PINCTRL_DEBOUNCE (1 << 16) | ||
19 | #define AT91_PINCTRL_DEBOUNCE_VA(x) (x << 17) | ||
20 | |||
21 | #define AT91_PINCTRL_PULL_UP_DEGLITCH (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DEGLITCH) | ||
22 | |||
23 | #define AT91_PIOA 0 | ||
24 | #define AT91_PIOB 1 | ||
25 | #define AT91_PIOC 2 | ||
26 | #define AT91_PIOD 3 | ||
27 | #define AT91_PIOE 4 | ||
28 | |||
29 | #define AT91_PERIPH_GPIO 0 | ||
30 | #define AT91_PERIPH_A 1 | ||
31 | #define AT91_PERIPH_B 2 | ||
32 | #define AT91_PERIPH_C 3 | ||
33 | #define AT91_PERIPH_D 4 | ||
34 | |||
35 | #endif /* __DT_BINDINGS_AT91_PINCTRL_H__ */ | ||
diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h new file mode 100644 index 000000000000..edbd250809cb --- /dev/null +++ b/include/dt-bindings/pinctrl/omap.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * This header provides constants for OMAP pinctrl bindings. | ||
3 | * | ||
4 | * Copyright (C) 2009 Nokia | ||
5 | * Copyright (C) 2009-2010 Texas Instruments | ||
6 | */ | ||
7 | |||
8 | #ifndef _DT_BINDINGS_PINCTRL_OMAP_H | ||
9 | #define _DT_BINDINGS_PINCTRL_OMAP_H | ||
10 | |||
11 | /* 34xx mux mode options for each pin. See TRM for options */ | ||
12 | #define MUX_MODE0 0 | ||
13 | #define MUX_MODE1 1 | ||
14 | #define MUX_MODE2 2 | ||
15 | #define MUX_MODE3 3 | ||
16 | #define MUX_MODE4 4 | ||
17 | #define MUX_MODE5 5 | ||
18 | #define MUX_MODE6 6 | ||
19 | #define MUX_MODE7 7 | ||
20 | |||
21 | /* 24xx/34xx mux bit defines */ | ||
22 | #define PULL_ENA (1 << 3) | ||
23 | #define PULL_UP (1 << 4) | ||
24 | #define ALTELECTRICALSEL (1 << 5) | ||
25 | |||
26 | /* 34xx specific mux bit defines */ | ||
27 | #define INPUT_EN (1 << 8) | ||
28 | #define OFF_EN (1 << 9) | ||
29 | #define OFFOUT_EN (1 << 10) | ||
30 | #define OFFOUT_VAL (1 << 11) | ||
31 | #define OFF_PULL_EN (1 << 12) | ||
32 | #define OFF_PULL_UP (1 << 13) | ||
33 | #define WAKEUP_EN (1 << 14) | ||
34 | |||
35 | /* 44xx specific mux bit defines */ | ||
36 | #define WAKEUP_EVENT (1 << 15) | ||
37 | |||
38 | /* Active pin states */ | ||
39 | #define PIN_OUTPUT 0 | ||
40 | #define PIN_OUTPUT_PULLUP (PIN_OUTPUT | PULL_ENA | PULL_UP) | ||
41 | #define PIN_OUTPUT_PULLDOWN (PIN_OUTPUT | PULL_ENA) | ||
42 | #define PIN_INPUT INPUT_EN | ||
43 | #define PIN_INPUT_PULLUP (PULL_ENA | INPUT_EN | PULL_UP) | ||
44 | #define PIN_INPUT_PULLDOWN (PULL_ENA | INPUT_EN) | ||
45 | |||
46 | /* Off mode states */ | ||
47 | #define PIN_OFF_NONE 0 | ||
48 | #define PIN_OFF_OUTPUT_HIGH (OFF_EN | OFFOUT_EN | OFFOUT_VAL) | ||
49 | #define PIN_OFF_OUTPUT_LOW (OFF_EN | OFFOUT_EN) | ||
50 | #define PIN_OFF_INPUT_PULLUP (OFF_EN | OFF_PULL_EN | OFF_PULL_UP) | ||
51 | #define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN) | ||
52 | #define PIN_OFF_WAKEUPENABLE WAKEUP_EN | ||
53 | |||
54 | #endif | ||
55 | |||
diff --git a/include/linux/arm-cci.h b/include/linux/arm-cci.h new file mode 100644 index 000000000000..79d6edf446d5 --- /dev/null +++ b/include/linux/arm-cci.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * CCI cache coherent interconnect support | ||
3 | * | ||
4 | * Copyright (C) 2013 ARM Ltd. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #ifndef __LINUX_ARM_CCI_H | ||
22 | #define __LINUX_ARM_CCI_H | ||
23 | |||
24 | #include <linux/errno.h> | ||
25 | #include <linux/types.h> | ||
26 | |||
27 | struct device_node; | ||
28 | |||
29 | #ifdef CONFIG_ARM_CCI | ||
30 | extern bool cci_probed(void); | ||
31 | extern int cci_ace_get_port(struct device_node *dn); | ||
32 | extern int cci_disable_port_by_cpu(u64 mpidr); | ||
33 | extern int __cci_control_port_by_device(struct device_node *dn, bool enable); | ||
34 | extern int __cci_control_port_by_index(u32 port, bool enable); | ||
35 | #else | ||
36 | static inline bool cci_probed(void) { return false; } | ||
37 | static inline int cci_ace_get_port(struct device_node *dn) | ||
38 | { | ||
39 | return -ENODEV; | ||
40 | } | ||
41 | static inline int cci_disable_port_by_cpu(u64 mpidr) { return -ENODEV; } | ||
42 | static inline int __cci_control_port_by_device(struct device_node *dn, | ||
43 | bool enable) | ||
44 | { | ||
45 | return -ENODEV; | ||
46 | } | ||
47 | static inline int __cci_control_port_by_index(u32 port, bool enable) | ||
48 | { | ||
49 | return -ENODEV; | ||
50 | } | ||
51 | #endif | ||
52 | #define cci_disable_port_by_device(dev) \ | ||
53 | __cci_control_port_by_device(dev, false) | ||
54 | #define cci_enable_port_by_device(dev) \ | ||
55 | __cci_control_port_by_device(dev, true) | ||
56 | #define cci_disable_port_by_index(dev) \ | ||
57 | __cci_control_port_by_index(dev, false) | ||
58 | #define cci_enable_port_by_index(dev) \ | ||
59 | __cci_control_port_by_index(dev, true) | ||
60 | |||
61 | #endif | ||
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 9e52b0626b39..f5a3b838ddb0 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -198,7 +198,8 @@ extern int buffer_heads_over_limit; | |||
198 | * Generic address_space_operations implementations for buffer_head-backed | 198 | * Generic address_space_operations implementations for buffer_head-backed |
199 | * address_spaces. | 199 | * address_spaces. |
200 | */ | 200 | */ |
201 | void block_invalidatepage(struct page *page, unsigned long offset); | 201 | void block_invalidatepage(struct page *page, unsigned int offset, |
202 | unsigned int length); | ||
202 | int block_write_full_page(struct page *page, get_block_t *get_block, | 203 | int block_write_full_page(struct page *page, get_block_t *get_block, |
203 | struct writeback_control *wbc); | 204 | struct writeback_control *wbc); |
204 | int block_write_full_page_endio(struct page *page, get_block_t *get_block, | 205 | int block_write_full_page_endio(struct page *page, get_block_t *get_block, |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 5047355b9a0f..fd097ecfcd97 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/workqueue.h> | 20 | #include <linux/workqueue.h> |
21 | #include <linux/xattr.h> | 21 | #include <linux/xattr.h> |
22 | #include <linux/fs.h> | 22 | #include <linux/fs.h> |
23 | #include <linux/percpu-refcount.h> | ||
23 | 24 | ||
24 | #ifdef CONFIG_CGROUPS | 25 | #ifdef CONFIG_CGROUPS |
25 | 26 | ||
@@ -72,13 +73,8 @@ struct cgroup_subsys_state { | |||
72 | */ | 73 | */ |
73 | struct cgroup *cgroup; | 74 | struct cgroup *cgroup; |
74 | 75 | ||
75 | /* | 76 | /* reference count - access via css_[try]get() and css_put() */ |
76 | * State maintained by the cgroup system to allow subsystems | 77 | struct percpu_ref refcnt; |
77 | * to be "busy". Should be accessed via css_get(), | ||
78 | * css_tryget() and css_put(). | ||
79 | */ | ||
80 | |||
81 | atomic_t refcnt; | ||
82 | 78 | ||
83 | unsigned long flags; | 79 | unsigned long flags; |
84 | /* ID for this css, if possible */ | 80 | /* ID for this css, if possible */ |
@@ -94,56 +90,52 @@ enum { | |||
94 | CSS_ONLINE = (1 << 1), /* between ->css_online() and ->css_offline() */ | 90 | CSS_ONLINE = (1 << 1), /* between ->css_online() and ->css_offline() */ |
95 | }; | 91 | }; |
96 | 92 | ||
97 | /* Caller must verify that the css is not for root cgroup */ | 93 | /** |
98 | static inline void __css_get(struct cgroup_subsys_state *css, int count) | 94 | * css_get - obtain a reference on the specified css |
99 | { | 95 | * @css: target css |
100 | atomic_add(count, &css->refcnt); | 96 | * |
101 | } | 97 | * The caller must already have a reference. |
102 | |||
103 | /* | ||
104 | * Call css_get() to hold a reference on the css; it can be used | ||
105 | * for a reference obtained via: | ||
106 | * - an existing ref-counted reference to the css | ||
107 | * - task->cgroups for a locked task | ||
108 | */ | 98 | */ |
109 | |||
110 | static inline void css_get(struct cgroup_subsys_state *css) | 99 | static inline void css_get(struct cgroup_subsys_state *css) |
111 | { | 100 | { |
112 | /* We don't need to reference count the root state */ | 101 | /* We don't need to reference count the root state */ |
113 | if (!(css->flags & CSS_ROOT)) | 102 | if (!(css->flags & CSS_ROOT)) |
114 | __css_get(css, 1); | 103 | percpu_ref_get(&css->refcnt); |
115 | } | 104 | } |
116 | 105 | ||
117 | /* | 106 | /** |
118 | * Call css_tryget() to take a reference on a css if your existing | 107 | * css_tryget - try to obtain a reference on the specified css |
119 | * (known-valid) reference isn't already ref-counted. Returns false if | 108 | * @css: target css |
120 | * the css has been destroyed. | 109 | * |
110 | * Obtain a reference on @css if it's alive. The caller naturally needs to | ||
111 | * ensure that @css is accessible but doesn't have to be holding a | ||
112 | * reference on it - IOW, RCU protected access is good enough for this | ||
113 | * function. Returns %true if a reference count was successfully obtained; | ||
114 | * %false otherwise. | ||
121 | */ | 115 | */ |
122 | |||
123 | extern bool __css_tryget(struct cgroup_subsys_state *css); | ||
124 | static inline bool css_tryget(struct cgroup_subsys_state *css) | 116 | static inline bool css_tryget(struct cgroup_subsys_state *css) |
125 | { | 117 | { |
126 | if (css->flags & CSS_ROOT) | 118 | if (css->flags & CSS_ROOT) |
127 | return true; | 119 | return true; |
128 | return __css_tryget(css); | 120 | return percpu_ref_tryget(&css->refcnt); |
129 | } | 121 | } |
130 | 122 | ||
131 | /* | 123 | /** |
132 | * css_put() should be called to release a reference taken by | 124 | * css_put - put a css reference |
133 | * css_get() or css_tryget() | 125 | * @css: target css |
126 | * | ||
127 | * Put a reference obtained via css_get() and css_tryget(). | ||
134 | */ | 128 | */ |
135 | |||
136 | extern void __css_put(struct cgroup_subsys_state *css); | ||
137 | static inline void css_put(struct cgroup_subsys_state *css) | 129 | static inline void css_put(struct cgroup_subsys_state *css) |
138 | { | 130 | { |
139 | if (!(css->flags & CSS_ROOT)) | 131 | if (!(css->flags & CSS_ROOT)) |
140 | __css_put(css); | 132 | percpu_ref_put(&css->refcnt); |
141 | } | 133 | } |
142 | 134 | ||
143 | /* bits in struct cgroup flags field */ | 135 | /* bits in struct cgroup flags field */ |
144 | enum { | 136 | enum { |
145 | /* Control Group is dead */ | 137 | /* Control Group is dead */ |
146 | CGRP_REMOVED, | 138 | CGRP_DEAD, |
147 | /* | 139 | /* |
148 | * Control Group has previously had a child cgroup or a task, | 140 | * Control Group has previously had a child cgroup or a task, |
149 | * but no longer (only if CGRP_NOTIFY_ON_RELEASE is set) | 141 | * but no longer (only if CGRP_NOTIFY_ON_RELEASE is set) |
@@ -169,12 +161,6 @@ struct cgroup_name { | |||
169 | struct cgroup { | 161 | struct cgroup { |
170 | unsigned long flags; /* "unsigned long" so bitops work */ | 162 | unsigned long flags; /* "unsigned long" so bitops work */ |
171 | 163 | ||
172 | /* | ||
173 | * count users of this cgroup. >0 means busy, but doesn't | ||
174 | * necessarily indicate the number of tasks in the cgroup | ||
175 | */ | ||
176 | atomic_t count; | ||
177 | |||
178 | int id; /* ida allocated in-hierarchy ID */ | 164 | int id; /* ida allocated in-hierarchy ID */ |
179 | 165 | ||
180 | /* | 166 | /* |
@@ -189,6 +175,14 @@ struct cgroup { | |||
189 | struct dentry *dentry; /* cgroup fs entry, RCU protected */ | 175 | struct dentry *dentry; /* cgroup fs entry, RCU protected */ |
190 | 176 | ||
191 | /* | 177 | /* |
178 | * Monotonically increasing unique serial number which defines a | ||
179 | * uniform order among all cgroups. It's guaranteed that all | ||
180 | * ->children lists are in the ascending order of ->serial_nr. | ||
181 | * It's used to allow interrupting and resuming iterations. | ||
182 | */ | ||
183 | u64 serial_nr; | ||
184 | |||
185 | /* | ||
192 | * This is a copy of dentry->d_name, and it's needed because | 186 | * This is a copy of dentry->d_name, and it's needed because |
193 | * we can't use dentry->d_name in cgroup_path(). | 187 | * we can't use dentry->d_name in cgroup_path(). |
194 | * | 188 | * |
@@ -207,13 +201,10 @@ struct cgroup { | |||
207 | struct cgroupfs_root *root; | 201 | struct cgroupfs_root *root; |
208 | 202 | ||
209 | /* | 203 | /* |
210 | * List of cg_cgroup_links pointing at css_sets with | 204 | * List of cgrp_cset_links pointing at css_sets with tasks in this |
211 | * tasks in this cgroup. Protected by css_set_lock | 205 | * cgroup. Protected by css_set_lock. |
212 | */ | 206 | */ |
213 | struct list_head css_sets; | 207 | struct list_head cset_links; |
214 | |||
215 | struct list_head allcg_node; /* cgroupfs_root->allcg_list */ | ||
216 | struct list_head cft_q_node; /* used during cftype add/rm */ | ||
217 | 208 | ||
218 | /* | 209 | /* |
219 | * Linked list running through all cgroups that can | 210 | * Linked list running through all cgroups that can |
@@ -229,9 +220,10 @@ struct cgroup { | |||
229 | struct list_head pidlists; | 220 | struct list_head pidlists; |
230 | struct mutex pidlist_mutex; | 221 | struct mutex pidlist_mutex; |
231 | 222 | ||
232 | /* For RCU-protected deletion */ | 223 | /* For css percpu_ref killing and RCU-protected deletion */ |
233 | struct rcu_head rcu_head; | 224 | struct rcu_head rcu_head; |
234 | struct work_struct free_work; | 225 | struct work_struct destroy_work; |
226 | atomic_t css_kill_cnt; | ||
235 | 227 | ||
236 | /* List of events which userspace want to receive */ | 228 | /* List of events which userspace want to receive */ |
237 | struct list_head event_list; | 229 | struct list_head event_list; |
@@ -269,18 +261,33 @@ enum { | |||
269 | * | 261 | * |
270 | * - Remount is disallowed. | 262 | * - Remount is disallowed. |
271 | * | 263 | * |
272 | * - memcg: use_hierarchy is on by default and the cgroup file for | 264 | * - rename(2) is disallowed. |
273 | * the flag is not created. | ||
274 | * | 265 | * |
275 | * The followings are planned changes. | 266 | * - "tasks" is removed. Everything should be at process |
267 | * granularity. Use "cgroup.procs" instead. | ||
276 | * | 268 | * |
277 | * - release_agent will be disallowed once replacement notification | 269 | * - "release_agent" and "notify_on_release" are removed. |
278 | * mechanism is implemented. | 270 | * Replacement notification mechanism will be implemented. |
271 | * | ||
272 | * - cpuset: tasks will be kept in empty cpusets when hotplug happens | ||
273 | * and take masks of ancestors with non-empty cpus/mems, instead of | ||
274 | * being moved to an ancestor. | ||
275 | * | ||
276 | * - cpuset: a task can be moved into an empty cpuset, and again it | ||
277 | * takes masks of ancestors. | ||
278 | * | ||
279 | * - memcg: use_hierarchy is on by default and the cgroup file for | ||
280 | * the flag is not created. | ||
279 | */ | 281 | */ |
280 | CGRP_ROOT_SANE_BEHAVIOR = (1 << 0), | 282 | CGRP_ROOT_SANE_BEHAVIOR = (1 << 0), |
281 | 283 | ||
282 | CGRP_ROOT_NOPREFIX = (1 << 1), /* mounted subsystems have no named prefix */ | 284 | CGRP_ROOT_NOPREFIX = (1 << 1), /* mounted subsystems have no named prefix */ |
283 | CGRP_ROOT_XATTR = (1 << 2), /* supports extended attributes */ | 285 | CGRP_ROOT_XATTR = (1 << 2), /* supports extended attributes */ |
286 | |||
287 | /* mount options live below bit 16 */ | ||
288 | CGRP_ROOT_OPTION_MASK = (1 << 16) - 1, | ||
289 | |||
290 | CGRP_ROOT_SUBSYS_BOUND = (1 << 16), /* subsystems finished binding */ | ||
284 | }; | 291 | }; |
285 | 292 | ||
286 | /* | 293 | /* |
@@ -291,18 +298,12 @@ enum { | |||
291 | struct cgroupfs_root { | 298 | struct cgroupfs_root { |
292 | struct super_block *sb; | 299 | struct super_block *sb; |
293 | 300 | ||
294 | /* | 301 | /* The bitmask of subsystems attached to this hierarchy */ |
295 | * The bitmask of subsystems intended to be attached to this | ||
296 | * hierarchy | ||
297 | */ | ||
298 | unsigned long subsys_mask; | 302 | unsigned long subsys_mask; |
299 | 303 | ||
300 | /* Unique id for this hierarchy. */ | 304 | /* Unique id for this hierarchy. */ |
301 | int hierarchy_id; | 305 | int hierarchy_id; |
302 | 306 | ||
303 | /* The bitmask of subsystems currently attached to this hierarchy */ | ||
304 | unsigned long actual_subsys_mask; | ||
305 | |||
306 | /* A list running through the attached subsystems */ | 307 | /* A list running through the attached subsystems */ |
307 | struct list_head subsys_list; | 308 | struct list_head subsys_list; |
308 | 309 | ||
@@ -315,9 +316,6 @@ struct cgroupfs_root { | |||
315 | /* A list running through the active hierarchies */ | 316 | /* A list running through the active hierarchies */ |
316 | struct list_head root_list; | 317 | struct list_head root_list; |
317 | 318 | ||
318 | /* All cgroups on this root, cgroup_mutex protected */ | ||
319 | struct list_head allcg_list; | ||
320 | |||
321 | /* Hierarchy-specific flags */ | 319 | /* Hierarchy-specific flags */ |
322 | unsigned long flags; | 320 | unsigned long flags; |
323 | 321 | ||
@@ -357,11 +355,10 @@ struct css_set { | |||
357 | struct list_head tasks; | 355 | struct list_head tasks; |
358 | 356 | ||
359 | /* | 357 | /* |
360 | * List of cg_cgroup_link objects on link chains from | 358 | * List of cgrp_cset_links pointing at cgroups referenced from this |
361 | * cgroups referenced from this css_set. Protected by | 359 | * css_set. Protected by css_set_lock. |
362 | * css_set_lock | ||
363 | */ | 360 | */ |
364 | struct list_head cg_links; | 361 | struct list_head cgrp_links; |
365 | 362 | ||
366 | /* | 363 | /* |
367 | * Set of subsystem states, one for each subsystem. This array | 364 | * Set of subsystem states, one for each subsystem. This array |
@@ -394,9 +391,11 @@ struct cgroup_map_cb { | |||
394 | */ | 391 | */ |
395 | 392 | ||
396 | /* cftype->flags */ | 393 | /* cftype->flags */ |
397 | #define CFTYPE_ONLY_ON_ROOT (1U << 0) /* only create on root cg */ | 394 | enum { |
398 | #define CFTYPE_NOT_ON_ROOT (1U << 1) /* don't create on root cg */ | 395 | CFTYPE_ONLY_ON_ROOT = (1 << 0), /* only create on root cg */ |
399 | #define CFTYPE_INSANE (1U << 2) /* don't create if sane_behavior */ | 396 | CFTYPE_NOT_ON_ROOT = (1 << 1), /* don't create on root cg */ |
397 | CFTYPE_INSANE = (1 << 2), /* don't create if sane_behavior */ | ||
398 | }; | ||
400 | 399 | ||
401 | #define MAX_CFTYPE_NAME 64 | 400 | #define MAX_CFTYPE_NAME 64 |
402 | 401 | ||
@@ -442,13 +441,13 @@ struct cftype { | |||
442 | * entry. The key/value pairs (and their ordering) should not | 441 | * entry. The key/value pairs (and their ordering) should not |
443 | * change between reboots. | 442 | * change between reboots. |
444 | */ | 443 | */ |
445 | int (*read_map)(struct cgroup *cont, struct cftype *cft, | 444 | int (*read_map)(struct cgroup *cgrp, struct cftype *cft, |
446 | struct cgroup_map_cb *cb); | 445 | struct cgroup_map_cb *cb); |
447 | /* | 446 | /* |
448 | * read_seq_string() is used for outputting a simple sequence | 447 | * read_seq_string() is used for outputting a simple sequence |
449 | * using seqfile. | 448 | * using seqfile. |
450 | */ | 449 | */ |
451 | int (*read_seq_string)(struct cgroup *cont, struct cftype *cft, | 450 | int (*read_seq_string)(struct cgroup *cgrp, struct cftype *cft, |
452 | struct seq_file *m); | 451 | struct seq_file *m); |
453 | 452 | ||
454 | ssize_t (*write)(struct cgroup *cgrp, struct cftype *cft, | 453 | ssize_t (*write)(struct cgroup *cgrp, struct cftype *cft, |
@@ -538,10 +537,11 @@ static inline const char *cgroup_name(const struct cgroup *cgrp) | |||
538 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); | 537 | int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
539 | int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); | 538 | int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); |
540 | 539 | ||
541 | int cgroup_is_removed(const struct cgroup *cgrp); | ||
542 | bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor); | 540 | bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor); |
543 | 541 | ||
544 | int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen); | 542 | int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen); |
543 | int task_cgroup_path_from_hierarchy(struct task_struct *task, int hierarchy_id, | ||
544 | char *buf, size_t buflen); | ||
545 | 545 | ||
546 | int cgroup_task_count(const struct cgroup *cgrp); | 546 | int cgroup_task_count(const struct cgroup *cgrp); |
547 | 547 | ||
@@ -646,22 +646,60 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state( | |||
646 | return cgrp->subsys[subsys_id]; | 646 | return cgrp->subsys[subsys_id]; |
647 | } | 647 | } |
648 | 648 | ||
649 | /* | 649 | /** |
650 | * function to get the cgroup_subsys_state which allows for extra | 650 | * task_css_set_check - obtain a task's css_set with extra access conditions |
651 | * rcu_dereference_check() conditions, such as locks used during the | 651 | * @task: the task to obtain css_set for |
652 | * cgroup_subsys::attach() methods. | 652 | * @__c: extra condition expression to be passed to rcu_dereference_check() |
653 | * | ||
654 | * A task's css_set is RCU protected, initialized and exited while holding | ||
655 | * task_lock(), and can only be modified while holding both cgroup_mutex | ||
656 | * and task_lock() while the task is alive. This macro verifies that the | ||
657 | * caller is inside proper critical section and returns @task's css_set. | ||
658 | * | ||
659 | * The caller can also specify additional allowed conditions via @__c, such | ||
660 | * as locks used during the cgroup_subsys::attach() methods. | ||
653 | */ | 661 | */ |
654 | #ifdef CONFIG_PROVE_RCU | 662 | #ifdef CONFIG_PROVE_RCU |
655 | extern struct mutex cgroup_mutex; | 663 | extern struct mutex cgroup_mutex; |
656 | #define task_subsys_state_check(task, subsys_id, __c) \ | 664 | #define task_css_set_check(task, __c) \ |
657 | rcu_dereference_check((task)->cgroups->subsys[(subsys_id)], \ | 665 | rcu_dereference_check((task)->cgroups, \ |
658 | lockdep_is_held(&(task)->alloc_lock) || \ | 666 | lockdep_is_held(&(task)->alloc_lock) || \ |
659 | lockdep_is_held(&cgroup_mutex) || (__c)) | 667 | lockdep_is_held(&cgroup_mutex) || (__c)) |
660 | #else | 668 | #else |
661 | #define task_subsys_state_check(task, subsys_id, __c) \ | 669 | #define task_css_set_check(task, __c) \ |
662 | rcu_dereference((task)->cgroups->subsys[(subsys_id)]) | 670 | rcu_dereference((task)->cgroups) |
663 | #endif | 671 | #endif |
664 | 672 | ||
673 | /** | ||
674 | * task_subsys_state_check - obtain css for (task, subsys) w/ extra access conds | ||
675 | * @task: the target task | ||
676 | * @subsys_id: the target subsystem ID | ||
677 | * @__c: extra condition expression to be passed to rcu_dereference_check() | ||
678 | * | ||
679 | * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The | ||
680 | * synchronization rules are the same as task_css_set_check(). | ||
681 | */ | ||
682 | #define task_subsys_state_check(task, subsys_id, __c) \ | ||
683 | task_css_set_check((task), (__c))->subsys[(subsys_id)] | ||
684 | |||
685 | /** | ||
686 | * task_css_set - obtain a task's css_set | ||
687 | * @task: the task to obtain css_set for | ||
688 | * | ||
689 | * See task_css_set_check(). | ||
690 | */ | ||
691 | static inline struct css_set *task_css_set(struct task_struct *task) | ||
692 | { | ||
693 | return task_css_set_check(task, false); | ||
694 | } | ||
695 | |||
696 | /** | ||
697 | * task_subsys_state - obtain css for (task, subsys) | ||
698 | * @task: the target task | ||
699 | * @subsys_id: the target subsystem ID | ||
700 | * | ||
701 | * See task_subsys_state_check(). | ||
702 | */ | ||
665 | static inline struct cgroup_subsys_state * | 703 | static inline struct cgroup_subsys_state * |
666 | task_subsys_state(struct task_struct *task, int subsys_id) | 704 | task_subsys_state(struct task_struct *task, int subsys_id) |
667 | { | 705 | { |
@@ -674,12 +712,14 @@ static inline struct cgroup* task_cgroup(struct task_struct *task, | |||
674 | return task_subsys_state(task, subsys_id)->cgroup; | 712 | return task_subsys_state(task, subsys_id)->cgroup; |
675 | } | 713 | } |
676 | 714 | ||
715 | struct cgroup *cgroup_next_sibling(struct cgroup *pos); | ||
716 | |||
677 | /** | 717 | /** |
678 | * cgroup_for_each_child - iterate through children of a cgroup | 718 | * cgroup_for_each_child - iterate through children of a cgroup |
679 | * @pos: the cgroup * to use as the loop cursor | 719 | * @pos: the cgroup * to use as the loop cursor |
680 | * @cgroup: cgroup whose children to walk | 720 | * @cgrp: cgroup whose children to walk |
681 | * | 721 | * |
682 | * Walk @cgroup's children. Must be called under rcu_read_lock(). A child | 722 | * Walk @cgrp's children. Must be called under rcu_read_lock(). A child |
683 | * cgroup which hasn't finished ->css_online() or already has finished | 723 | * cgroup which hasn't finished ->css_online() or already has finished |
684 | * ->css_offline() may show up during traversal and it's each subsystem's | 724 | * ->css_offline() may show up during traversal and it's each subsystem's |
685 | * responsibility to verify that each @pos is alive. | 725 | * responsibility to verify that each @pos is alive. |
@@ -687,9 +727,15 @@ static inline struct cgroup* task_cgroup(struct task_struct *task, | |||
687 | * If a subsystem synchronizes against the parent in its ->css_online() and | 727 | * If a subsystem synchronizes against the parent in its ->css_online() and |
688 | * before starting iterating, a cgroup which finished ->css_online() is | 728 | * before starting iterating, a cgroup which finished ->css_online() is |
689 | * guaranteed to be visible in the future iterations. | 729 | * guaranteed to be visible in the future iterations. |
730 | * | ||
731 | * It is allowed to temporarily drop RCU read lock during iteration. The | ||
732 | * caller is responsible for ensuring that @pos remains accessible until | ||
733 | * the start of the next iteration by, for example, bumping the css refcnt. | ||
690 | */ | 734 | */ |
691 | #define cgroup_for_each_child(pos, cgroup) \ | 735 | #define cgroup_for_each_child(pos, cgrp) \ |
692 | list_for_each_entry_rcu(pos, &(cgroup)->children, sibling) | 736 | for ((pos) = list_first_or_null_rcu(&(cgrp)->children, \ |
737 | struct cgroup, sibling); \ | ||
738 | (pos); (pos) = cgroup_next_sibling((pos))) | ||
693 | 739 | ||
694 | struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos, | 740 | struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos, |
695 | struct cgroup *cgroup); | 741 | struct cgroup *cgroup); |
@@ -707,7 +753,7 @@ struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos); | |||
707 | * | 753 | * |
708 | * If a subsystem synchronizes against the parent in its ->css_online() and | 754 | * If a subsystem synchronizes against the parent in its ->css_online() and |
709 | * before starting iterating, and synchronizes against @pos on each | 755 | * before starting iterating, and synchronizes against @pos on each |
710 | * iteration, any descendant cgroup which finished ->css_offline() is | 756 | * iteration, any descendant cgroup which finished ->css_online() is |
711 | * guaranteed to be visible in the future iterations. | 757 | * guaranteed to be visible in the future iterations. |
712 | * | 758 | * |
713 | * In other words, the following guarantees that a descendant can't escape | 759 | * In other words, the following guarantees that a descendant can't escape |
@@ -748,6 +794,10 @@ struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos); | |||
748 | * Alternatively, a subsystem may choose to use a single global lock to | 794 | * Alternatively, a subsystem may choose to use a single global lock to |
749 | * synchronize ->css_online() and ->css_offline() against tree-walking | 795 | * synchronize ->css_online() and ->css_offline() against tree-walking |
750 | * operations. | 796 | * operations. |
797 | * | ||
798 | * It is allowed to temporarily drop RCU read lock during iteration. The | ||
799 | * caller is responsible for ensuring that @pos remains accessible until | ||
800 | * the start of the next iteration by, for example, bumping the css refcnt. | ||
751 | */ | 801 | */ |
752 | #define cgroup_for_each_descendant_pre(pos, cgroup) \ | 802 | #define cgroup_for_each_descendant_pre(pos, cgroup) \ |
753 | for (pos = cgroup_next_descendant_pre(NULL, (cgroup)); (pos); \ | 803 | for (pos = cgroup_next_descendant_pre(NULL, (cgroup)); (pos); \ |
@@ -771,7 +821,7 @@ struct cgroup *cgroup_next_descendant_post(struct cgroup *pos, | |||
771 | 821 | ||
772 | /* A cgroup_iter should be treated as an opaque object */ | 822 | /* A cgroup_iter should be treated as an opaque object */ |
773 | struct cgroup_iter { | 823 | struct cgroup_iter { |
774 | struct list_head *cg_link; | 824 | struct list_head *cset_link; |
775 | struct list_head *task; | 825 | struct list_head *task; |
776 | }; | 826 | }; |
777 | 827 | ||
@@ -827,7 +877,6 @@ bool css_is_ancestor(struct cgroup_subsys_state *cg, | |||
827 | 877 | ||
828 | /* Get id and depth of css */ | 878 | /* Get id and depth of css */ |
829 | unsigned short css_id(struct cgroup_subsys_state *css); | 879 | unsigned short css_id(struct cgroup_subsys_state *css); |
830 | unsigned short css_depth(struct cgroup_subsys_state *css); | ||
831 | struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id); | 880 | struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id); |
832 | 881 | ||
833 | #else /* !CONFIG_CGROUPS */ | 882 | #else /* !CONFIG_CGROUPS */ |
@@ -838,8 +887,6 @@ static inline void cgroup_fork(struct task_struct *p) {} | |||
838 | static inline void cgroup_post_fork(struct task_struct *p) {} | 887 | static inline void cgroup_post_fork(struct task_struct *p) {} |
839 | static inline void cgroup_exit(struct task_struct *p, int callbacks) {} | 888 | static inline void cgroup_exit(struct task_struct *p, int callbacks) {} |
840 | 889 | ||
841 | static inline void cgroup_lock(void) {} | ||
842 | static inline void cgroup_unlock(void) {} | ||
843 | static inline int cgroupstats_build(struct cgroupstats *stats, | 890 | static inline int cgroupstats_build(struct cgroupstats *stats, |
844 | struct dentry *dentry) | 891 | struct dentry *dentry) |
845 | { | 892 | { |
diff --git a/include/linux/clk/mvebu.h b/include/linux/clk/mvebu.h deleted file mode 100644 index 8c4ae713b063..000000000000 --- a/include/linux/clk/mvebu.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License as published by | ||
4 | * the Free Software Foundation; either version 2 of the License, or | ||
5 | * (at your option) any later version. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | * | ||
12 | * You should have received a copy of the GNU General Public License | ||
13 | * along with this program; if not, write to the Free Software | ||
14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
15 | */ | ||
16 | |||
17 | #ifndef __CLK_MVEBU_H_ | ||
18 | #define __CLK_MVEBU_H_ | ||
19 | |||
20 | void __init mvebu_clocks_init(void); | ||
21 | |||
22 | #endif | ||
diff --git a/include/linux/clk/zynq.h b/include/linux/clk/zynq.h index 56be7cd9aa8b..e062d317ccce 100644 --- a/include/linux/clk/zynq.h +++ b/include/linux/clk/zynq.h | |||
@@ -1,4 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2013 Xilinx Inc. | ||
2 | * Copyright (C) 2012 National Instruments | 3 | * Copyright (C) 2012 National Instruments |
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
@@ -19,6 +20,11 @@ | |||
19 | #ifndef __LINUX_CLK_ZYNQ_H_ | 20 | #ifndef __LINUX_CLK_ZYNQ_H_ |
20 | #define __LINUX_CLK_ZYNQ_H_ | 21 | #define __LINUX_CLK_ZYNQ_H_ |
21 | 22 | ||
22 | void __init xilinx_zynq_clocks_init(void __iomem *slcr); | 23 | #include <linux/spinlock.h> |
23 | 24 | ||
25 | void zynq_clock_init(void __iomem *slcr); | ||
26 | |||
27 | struct clk *clk_register_zynq_pll(const char *name, const char *parent, | ||
28 | void __iomem *pll_ctrl, void __iomem *pll_status, u8 lock_index, | ||
29 | spinlock_t *lock); | ||
24 | #endif | 30 | #endif |
diff --git a/include/linux/completion.h b/include/linux/completion.h index 33f0280fd533..3cd574d5b19e 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * (C) Copyright 2001 Linus Torvalds | 5 | * (C) Copyright 2001 Linus Torvalds |
6 | * | 6 | * |
7 | * Atomic wait-for-completion handler data structures. | 7 | * Atomic wait-for-completion handler data structures. |
8 | * See kernel/sched.c for details. | 8 | * See kernel/sched/core.c for details. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/wait.h> | 11 | #include <linux/wait.h> |
diff --git a/include/linux/console.h b/include/linux/console.h index 73bab0f58af5..7571a16bd653 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -75,10 +75,7 @@ extern const struct consw newport_con; /* SGI Newport console */ | |||
75 | extern const struct consw prom_con; /* SPARC PROM console */ | 75 | extern const struct consw prom_con; /* SPARC PROM console */ |
76 | 76 | ||
77 | int con_is_bound(const struct consw *csw); | 77 | int con_is_bound(const struct consw *csw); |
78 | int register_con_driver(const struct consw *csw, int first, int last); | ||
79 | int unregister_con_driver(const struct consw *csw); | ||
80 | int do_unregister_con_driver(const struct consw *csw); | 78 | int do_unregister_con_driver(const struct consw *csw); |
81 | int take_over_console(const struct consw *sw, int first, int last, int deflt); | ||
82 | int do_take_over_console(const struct consw *sw, int first, int last, int deflt); | 79 | int do_take_over_console(const struct consw *sw, int first, int last, int deflt); |
83 | void give_up_console(const struct consw *sw); | 80 | void give_up_console(const struct consw *sw); |
84 | #ifdef CONFIG_HW_CONSOLE | 81 | #ifdef CONFIG_HW_CONSOLE |
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index 365f4a61bf04..fc09d7b0dacf 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
5 | #include <linux/percpu.h> | 5 | #include <linux/percpu.h> |
6 | #include <linux/vtime.h> | ||
6 | #include <asm/ptrace.h> | 7 | #include <asm/ptrace.h> |
7 | 8 | ||
8 | struct context_tracking { | 9 | struct context_tracking { |
@@ -19,6 +20,26 @@ struct context_tracking { | |||
19 | } state; | 20 | } state; |
20 | }; | 21 | }; |
21 | 22 | ||
23 | static inline void __guest_enter(void) | ||
24 | { | ||
25 | /* | ||
26 | * This is running in ioctl context so we can avoid | ||
27 | * the call to vtime_account() with its unnecessary idle check. | ||
28 | */ | ||
29 | vtime_account_system(current); | ||
30 | current->flags |= PF_VCPU; | ||
31 | } | ||
32 | |||
33 | static inline void __guest_exit(void) | ||
34 | { | ||
35 | /* | ||
36 | * This is running in ioctl context so we can avoid | ||
37 | * the call to vtime_account() with its unnecessary idle check. | ||
38 | */ | ||
39 | vtime_account_system(current); | ||
40 | current->flags &= ~PF_VCPU; | ||
41 | } | ||
42 | |||
22 | #ifdef CONFIG_CONTEXT_TRACKING | 43 | #ifdef CONFIG_CONTEXT_TRACKING |
23 | DECLARE_PER_CPU(struct context_tracking, context_tracking); | 44 | DECLARE_PER_CPU(struct context_tracking, context_tracking); |
24 | 45 | ||
@@ -35,6 +56,9 @@ static inline bool context_tracking_active(void) | |||
35 | extern void user_enter(void); | 56 | extern void user_enter(void); |
36 | extern void user_exit(void); | 57 | extern void user_exit(void); |
37 | 58 | ||
59 | extern void guest_enter(void); | ||
60 | extern void guest_exit(void); | ||
61 | |||
38 | static inline enum ctx_state exception_enter(void) | 62 | static inline enum ctx_state exception_enter(void) |
39 | { | 63 | { |
40 | enum ctx_state prev_ctx; | 64 | enum ctx_state prev_ctx; |
@@ -57,6 +81,17 @@ extern void context_tracking_task_switch(struct task_struct *prev, | |||
57 | static inline bool context_tracking_in_user(void) { return false; } | 81 | static inline bool context_tracking_in_user(void) { return false; } |
58 | static inline void user_enter(void) { } | 82 | static inline void user_enter(void) { } |
59 | static inline void user_exit(void) { } | 83 | static inline void user_exit(void) { } |
84 | |||
85 | static inline void guest_enter(void) | ||
86 | { | ||
87 | __guest_enter(); | ||
88 | } | ||
89 | |||
90 | static inline void guest_exit(void) | ||
91 | { | ||
92 | __guest_exit(); | ||
93 | } | ||
94 | |||
60 | static inline enum ctx_state exception_enter(void) { return 0; } | 95 | static inline enum ctx_state exception_enter(void) { return 0; } |
61 | static inline void exception_exit(enum ctx_state prev_ctx) { } | 96 | static inline void exception_exit(enum ctx_state prev_ctx) { } |
62 | static inline void context_tracking_task_switch(struct task_struct *prev, | 97 | static inline void context_tracking_task_switch(struct task_struct *prev, |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index c6f6e0839b61..9f3c7e81270a 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -175,6 +175,8 @@ extern struct bus_type cpu_subsys; | |||
175 | 175 | ||
176 | extern void get_online_cpus(void); | 176 | extern void get_online_cpus(void); |
177 | extern void put_online_cpus(void); | 177 | extern void put_online_cpus(void); |
178 | extern void cpu_hotplug_disable(void); | ||
179 | extern void cpu_hotplug_enable(void); | ||
178 | #define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri) | 180 | #define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri) |
179 | #define register_hotcpu_notifier(nb) register_cpu_notifier(nb) | 181 | #define register_hotcpu_notifier(nb) register_cpu_notifier(nb) |
180 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) | 182 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) |
@@ -198,6 +200,8 @@ static inline void cpu_hotplug_driver_unlock(void) | |||
198 | 200 | ||
199 | #define get_online_cpus() do { } while (0) | 201 | #define get_online_cpus() do { } while (0) |
200 | #define put_online_cpus() do { } while (0) | 202 | #define put_online_cpus() do { } while (0) |
203 | #define cpu_hotplug_disable() do { } while (0) | ||
204 | #define cpu_hotplug_enable() do { } while (0) | ||
201 | #define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) | 205 | #define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) |
202 | /* These aren't inline functions due to a GCC bug. */ | 206 | /* These aren't inline functions due to a GCC bug. */ |
203 | #define register_hotcpu_notifier(nb) ({ (void)(nb); 0; }) | 207 | #define register_hotcpu_notifier(nb) ({ (void)(nb); 0; }) |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 1a6bb81f0fe5..f42dbe145479 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -146,10 +146,8 @@ enum dentry_d_lock_class | |||
146 | struct dentry_operations { | 146 | struct dentry_operations { |
147 | int (*d_revalidate)(struct dentry *, unsigned int); | 147 | int (*d_revalidate)(struct dentry *, unsigned int); |
148 | int (*d_weak_revalidate)(struct dentry *, unsigned int); | 148 | int (*d_weak_revalidate)(struct dentry *, unsigned int); |
149 | int (*d_hash)(const struct dentry *, const struct inode *, | 149 | int (*d_hash)(const struct dentry *, struct qstr *); |
150 | struct qstr *); | 150 | int (*d_compare)(const struct dentry *, const struct dentry *, |
151 | int (*d_compare)(const struct dentry *, const struct inode *, | ||
152 | const struct dentry *, const struct inode *, | ||
153 | unsigned int, const char *, const struct qstr *); | 151 | unsigned int, const char *, const struct qstr *); |
154 | int (*d_delete)(const struct dentry *); | 152 | int (*d_delete)(const struct dentry *); |
155 | void (*d_release)(struct dentry *); | 153 | void (*d_release)(struct dentry *); |
@@ -246,6 +244,8 @@ extern struct dentry * d_make_root(struct inode *); | |||
246 | /* <clickety>-<click> the ramfs-type tree */ | 244 | /* <clickety>-<click> the ramfs-type tree */ |
247 | extern void d_genocide(struct dentry *); | 245 | extern void d_genocide(struct dentry *); |
248 | 246 | ||
247 | extern void d_tmpfile(struct dentry *, struct inode *); | ||
248 | |||
249 | extern struct dentry *d_find_alias(struct inode *); | 249 | extern struct dentry *d_find_alias(struct inode *); |
250 | extern void d_prune_aliases(struct inode *); | 250 | extern void d_prune_aliases(struct inode *); |
251 | 251 | ||
@@ -300,8 +300,7 @@ extern struct dentry *d_lookup(const struct dentry *, const struct qstr *); | |||
300 | extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *); | 300 | extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *); |
301 | extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *); | 301 | extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *); |
302 | extern struct dentry *__d_lookup_rcu(const struct dentry *parent, | 302 | extern struct dentry *__d_lookup_rcu(const struct dentry *parent, |
303 | const struct qstr *name, | 303 | const struct qstr *name, unsigned *seq); |
304 | unsigned *seq, struct inode *inode); | ||
305 | 304 | ||
306 | /** | 305 | /** |
307 | * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok | 306 | * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 63f2465807d4..d68b4ea7343c 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -79,6 +79,8 @@ struct dentry *debugfs_create_x64(const char *name, umode_t mode, | |||
79 | struct dentry *parent, u64 *value); | 79 | struct dentry *parent, u64 *value); |
80 | struct dentry *debugfs_create_size_t(const char *name, umode_t mode, | 80 | struct dentry *debugfs_create_size_t(const char *name, umode_t mode, |
81 | struct dentry *parent, size_t *value); | 81 | struct dentry *parent, size_t *value); |
82 | struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, | ||
83 | struct dentry *parent, atomic_t *value); | ||
82 | struct dentry *debugfs_create_bool(const char *name, umode_t mode, | 84 | struct dentry *debugfs_create_bool(const char *name, umode_t mode, |
83 | struct dentry *parent, u32 *value); | 85 | struct dentry *parent, u32 *value); |
84 | 86 | ||
diff --git a/include/linux/device.h b/include/linux/device.h index c0a126125325..9d4835a8f8b8 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -80,6 +80,7 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | |||
80 | * bus-specific setup | 80 | * bus-specific setup |
81 | * @p: The private data of the driver core, only the driver core can | 81 | * @p: The private data of the driver core, only the driver core can |
82 | * touch this. | 82 | * touch this. |
83 | * @lock_key: Lock class key for use by the lock validator | ||
83 | * | 84 | * |
84 | * A bus is a channel between the processor and one or more devices. For the | 85 | * A bus is a channel between the processor and one or more devices. For the |
85 | * purposes of the device model, all devices are connected via a bus, even if | 86 | * purposes of the device model, all devices are connected via a bus, even if |
@@ -635,6 +636,7 @@ struct acpi_dev_node { | |||
635 | * segment limitations. | 636 | * segment limitations. |
636 | * @dma_pools: Dma pools (if dma'ble device). | 637 | * @dma_pools: Dma pools (if dma'ble device). |
637 | * @dma_mem: Internal for coherent mem override. | 638 | * @dma_mem: Internal for coherent mem override. |
639 | * @cma_area: Contiguous memory area for dma allocations | ||
638 | * @archdata: For arch-specific additions. | 640 | * @archdata: For arch-specific additions. |
639 | * @of_node: Associated device tree node. | 641 | * @of_node: Associated device tree node. |
640 | * @acpi_node: Associated ACPI device node. | 642 | * @acpi_node: Associated ACPI device node. |
@@ -648,6 +650,7 @@ struct acpi_dev_node { | |||
648 | * @release: Callback to free the device after all references have | 650 | * @release: Callback to free the device after all references have |
649 | * gone away. This should be set by the allocator of the | 651 | * gone away. This should be set by the allocator of the |
650 | * device (i.e. the bus driver that discovered the device). | 652 | * device (i.e. the bus driver that discovered the device). |
653 | * @iommu_group: IOMMU group the device belongs to. | ||
651 | * | 654 | * |
652 | * At the lowest level, every device in a Linux system is represented by an | 655 | * At the lowest level, every device in a Linux system is represented by an |
653 | * instance of struct device. The device structure contains the information | 656 | * instance of struct device. The device structure contains the information |
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h index dd755ce2a5eb..07261d52a6df 100644 --- a/include/linux/dw_apb_timer.h +++ b/include/linux/dw_apb_timer.h | |||
@@ -53,5 +53,4 @@ void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs); | |||
53 | cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); | 53 | cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); |
54 | void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs); | 54 | void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs); |
55 | 55 | ||
56 | extern void dw_apb_timer_init(void); | ||
57 | #endif /* __DW_APB_TIMER_H__ */ | 56 | #endif /* __DW_APB_TIMER_H__ */ |
diff --git a/include/linux/efi.h b/include/linux/efi.h index 2bc0ad78d058..21ae6b3c0359 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -287,20 +287,20 @@ typedef struct { | |||
287 | 287 | ||
288 | typedef struct { | 288 | typedef struct { |
289 | efi_table_hdr_t hdr; | 289 | efi_table_hdr_t hdr; |
290 | unsigned long get_time; | 290 | void *get_time; |
291 | unsigned long set_time; | 291 | void *set_time; |
292 | unsigned long get_wakeup_time; | 292 | void *get_wakeup_time; |
293 | unsigned long set_wakeup_time; | 293 | void *set_wakeup_time; |
294 | unsigned long set_virtual_address_map; | 294 | void *set_virtual_address_map; |
295 | unsigned long convert_pointer; | 295 | void *convert_pointer; |
296 | unsigned long get_variable; | 296 | void *get_variable; |
297 | unsigned long get_next_variable; | 297 | void *get_next_variable; |
298 | unsigned long set_variable; | 298 | void *set_variable; |
299 | unsigned long get_next_high_mono_count; | 299 | void *get_next_high_mono_count; |
300 | unsigned long reset_system; | 300 | void *reset_system; |
301 | unsigned long update_capsule; | 301 | void *update_capsule; |
302 | unsigned long query_capsule_caps; | 302 | void *query_capsule_caps; |
303 | unsigned long query_variable_info; | 303 | void *query_variable_info; |
304 | } efi_runtime_services_t; | 304 | } efi_runtime_services_t; |
305 | 305 | ||
306 | typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); | 306 | typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); |
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index df6fab82f87e..383d5e39b280 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h | |||
@@ -20,8 +20,8 @@ | |||
20 | #define F2FS_BLKSIZE 4096 /* support only 4KB block */ | 20 | #define F2FS_BLKSIZE 4096 /* support only 4KB block */ |
21 | #define F2FS_MAX_EXTENSION 64 /* # of extension entries */ | 21 | #define F2FS_MAX_EXTENSION 64 /* # of extension entries */ |
22 | 22 | ||
23 | #define NULL_ADDR 0x0U | 23 | #define NULL_ADDR ((block_t)0) /* used as block_t addresses */ |
24 | #define NEW_ADDR -1U | 24 | #define NEW_ADDR ((block_t)-1) /* used as block_t addresses */ |
25 | 25 | ||
26 | #define F2FS_ROOT_INO(sbi) (sbi->root_ino_num) | 26 | #define F2FS_ROOT_INO(sbi) (sbi->root_ino_num) |
27 | #define F2FS_NODE_INO(sbi) (sbi->node_ino_num) | 27 | #define F2FS_NODE_INO(sbi) (sbi->node_ino_num) |
diff --git a/include/linux/filter.h b/include/linux/filter.h index c050dcc322a4..f65f5a69db8f 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -46,6 +46,7 @@ extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | |||
46 | extern int sk_detach_filter(struct sock *sk); | 46 | extern int sk_detach_filter(struct sock *sk); |
47 | extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); | 47 | extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); |
48 | extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned len); | 48 | extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned len); |
49 | extern void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to); | ||
49 | 50 | ||
50 | #ifdef CONFIG_BPF_JIT | 51 | #ifdef CONFIG_BPF_JIT |
51 | #include <stdarg.h> | 52 | #include <stdarg.h> |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index e4279fedb93a..e154c1005cd1 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -47,8 +47,6 @@ int request_firmware_nowait( | |||
47 | void (*cont)(const struct firmware *fw, void *context)); | 47 | void (*cont)(const struct firmware *fw, void *context)); |
48 | 48 | ||
49 | void release_firmware(const struct firmware *fw); | 49 | void release_firmware(const struct firmware *fw); |
50 | int cache_firmware(const char *name); | ||
51 | int uncache_firmware(const char *name); | ||
52 | #else | 50 | #else |
53 | static inline int request_firmware(const struct firmware **fw, | 51 | static inline int request_firmware(const struct firmware **fw, |
54 | const char *name, | 52 | const char *name, |
@@ -68,15 +66,6 @@ static inline void release_firmware(const struct firmware *fw) | |||
68 | { | 66 | { |
69 | } | 67 | } |
70 | 68 | ||
71 | static inline int cache_firmware(const char *name) | ||
72 | { | ||
73 | return -ENOENT; | ||
74 | } | ||
75 | |||
76 | static inline int uncache_firmware(const char *name) | ||
77 | { | ||
78 | return -EINVAL; | ||
79 | } | ||
80 | #endif | 69 | #endif |
81 | 70 | ||
82 | #endif | 71 | #endif |
diff --git a/include/linux/fmc-sdb.h b/include/linux/fmc-sdb.h new file mode 100644 index 000000000000..1974317a9b3d --- /dev/null +++ b/include/linux/fmc-sdb.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * This file is separate from sdb.h, because I want that one to remain | ||
3 | * unchanged (as far as possible) from the official sdb distribution | ||
4 | * | ||
5 | * This file and associated functionality are a playground for me to | ||
6 | * understand stuff which will later be implemented in more generic places. | ||
7 | */ | ||
8 | #include <linux/sdb.h> | ||
9 | |||
10 | /* This is the union of all currently defined types */ | ||
11 | union sdb_record { | ||
12 | struct sdb_interconnect ic; | ||
13 | struct sdb_device dev; | ||
14 | struct sdb_bridge bridge; | ||
15 | struct sdb_integration integr; | ||
16 | struct sdb_empty empty; | ||
17 | }; | ||
18 | |||
19 | struct fmc_device; | ||
20 | |||
21 | /* Every sdb table is turned into this structure */ | ||
22 | struct sdb_array { | ||
23 | int len; | ||
24 | int level; | ||
25 | unsigned long baseaddr; | ||
26 | struct fmc_device *fmc; /* the device that hosts it */ | ||
27 | struct sdb_array *parent; /* NULL at root */ | ||
28 | union sdb_record *record; /* copies of the struct */ | ||
29 | struct sdb_array **subtree; /* only valid for bridge items */ | ||
30 | }; | ||
31 | |||
32 | extern int fmc_scan_sdb_tree(struct fmc_device *fmc, unsigned long address); | ||
33 | extern void fmc_show_sdb_tree(const struct fmc_device *fmc); | ||
34 | extern signed long fmc_find_sdb_device(struct sdb_array *tree, uint64_t vendor, | ||
35 | uint32_t device, unsigned long *sz); | ||
36 | extern int fmc_free_sdb_tree(struct fmc_device *fmc); | ||
diff --git a/include/linux/fmc.h b/include/linux/fmc.h new file mode 100644 index 000000000000..a5f0aa5c2a8d --- /dev/null +++ b/include/linux/fmc.h | |||
@@ -0,0 +1,237 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 CERN (www.cern.ch) | ||
3 | * Author: Alessandro Rubini <rubini@gnudd.com> | ||
4 | * | ||
5 | * Released according to the GNU GPL, version 2 or any later version. | ||
6 | * | ||
7 | * This work is part of the White Rabbit project, a research effort led | ||
8 | * by CERN, the European Institute for Nuclear Research. | ||
9 | */ | ||
10 | #ifndef __LINUX_FMC_H__ | ||
11 | #define __LINUX_FMC_H__ | ||
12 | #include <linux/types.h> | ||
13 | #include <linux/moduleparam.h> | ||
14 | #include <linux/device.h> | ||
15 | #include <linux/list.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/io.h> | ||
18 | |||
19 | struct fmc_device; | ||
20 | struct fmc_driver; | ||
21 | |||
22 | /* | ||
23 | * This bus abstraction is developed separately from drivers, so we need | ||
24 | * to check the version of the data structures we receive. | ||
25 | */ | ||
26 | |||
27 | #define FMC_MAJOR 3 | ||
28 | #define FMC_MINOR 0 | ||
29 | #define FMC_VERSION ((FMC_MAJOR << 16) | FMC_MINOR) | ||
30 | #define __FMC_MAJOR(x) ((x) >> 16) | ||
31 | #define __FMC_MINOR(x) ((x) & 0xffff) | ||
32 | |||
33 | /* | ||
34 | * The device identification, as defined by the IPMI FRU (Field Replaceable | ||
35 | * Unit) includes four different strings to describe the device. Here we | ||
36 | * only match the "Board Manufacturer" and the "Board Product Name", | ||
37 | * ignoring the "Board Serial Number" and "Board Part Number". All 4 are | ||
38 | * expected to be strings, so they are treated as zero-terminated C strings. | ||
39 | * Unspecified string (NULL) means "any", so if both are unspecified this | ||
40 | * is a catch-all driver. So null entries are allowed and we use array | ||
41 | * and length. This is unlike pci and usb that use null-terminated arrays | ||
42 | */ | ||
43 | struct fmc_fru_id { | ||
44 | char *manufacturer; | ||
45 | char *product_name; | ||
46 | }; | ||
47 | |||
48 | /* | ||
49 | * If the FPGA is already programmed (think Etherbone or the second | ||
50 | * SVEC slot), we can match on SDB devices in the memory image. This | ||
51 | * match uses an array of devices that must all be present, and the | ||
52 | * match is based on vendor and device only. Further checks are expected | ||
53 | * to happen in the probe function. Zero means "any" and catch-all is allowed. | ||
54 | */ | ||
55 | struct fmc_sdb_one_id { | ||
56 | uint64_t vendor; | ||
57 | uint32_t device; | ||
58 | }; | ||
59 | struct fmc_sdb_id { | ||
60 | struct fmc_sdb_one_id *cores; | ||
61 | int cores_nr; | ||
62 | }; | ||
63 | |||
64 | struct fmc_device_id { | ||
65 | struct fmc_fru_id *fru_id; | ||
66 | int fru_id_nr; | ||
67 | struct fmc_sdb_id *sdb_id; | ||
68 | int sdb_id_nr; | ||
69 | }; | ||
70 | |||
71 | /* This sizes the module_param_array used by generic module parameters */ | ||
72 | #define FMC_MAX_CARDS 32 | ||
73 | |||
74 | /* The driver is a pretty simple thing */ | ||
75 | struct fmc_driver { | ||
76 | unsigned long version; | ||
77 | struct device_driver driver; | ||
78 | int (*probe)(struct fmc_device *); | ||
79 | int (*remove)(struct fmc_device *); | ||
80 | const struct fmc_device_id id_table; | ||
81 | /* What follows is for generic module parameters */ | ||
82 | int busid_n; | ||
83 | int busid_val[FMC_MAX_CARDS]; | ||
84 | int gw_n; | ||
85 | char *gw_val[FMC_MAX_CARDS]; | ||
86 | }; | ||
87 | #define to_fmc_driver(x) container_of((x), struct fmc_driver, driver) | ||
88 | |||
89 | /* These are the generic parameters, that drivers may instantiate */ | ||
90 | #define FMC_PARAM_BUSID(_d) \ | ||
91 | module_param_array_named(busid, _d.busid_val, int, &_d.busid_n, 0444) | ||
92 | #define FMC_PARAM_GATEWARE(_d) \ | ||
93 | module_param_array_named(gateware, _d.gw_val, charp, &_d.gw_n, 0444) | ||
94 | |||
95 | /* | ||
96 | * Drivers may need to configure gpio pins in the carrier. To read input | ||
97 | * (a very uncommon operation, and definitely not in the hot paths), just | ||
98 | * configure one gpio only and get 0 or 1 as retval of the config method | ||
99 | */ | ||
100 | struct fmc_gpio { | ||
101 | char *carrier_name; /* name or NULL for virtual pins */ | ||
102 | int gpio; | ||
103 | int _gpio; /* internal use by the carrier */ | ||
104 | int mode; /* GPIOF_DIR_OUT etc, from <linux/gpio.h> */ | ||
105 | int irqmode; /* IRQF_TRIGGER_LOW and so on */ | ||
106 | }; | ||
107 | |||
108 | /* The numbering of gpio pins allows access to raw pins or virtual roles */ | ||
109 | #define FMC_GPIO_RAW(x) (x) /* 4096 of them */ | ||
110 | #define __FMC_GPIO_IS_RAW(x) ((x) < 0x1000) | ||
111 | #define FMC_GPIO_IRQ(x) ((x) + 0x1000) /* 256 of them */ | ||
112 | #define FMC_GPIO_LED(x) ((x) + 0x1100) /* 256 of them */ | ||
113 | #define FMC_GPIO_KEY(x) ((x) + 0x1200) /* 256 of them */ | ||
114 | #define FMC_GPIO_TP(x) ((x) + 0x1300) /* 256 of them */ | ||
115 | #define FMC_GPIO_USER(x) ((x) + 0x1400) /* 256 of them */ | ||
116 | /* We may add SCL and SDA, or other roles if the need arises */ | ||
117 | |||
118 | /* GPIOF_DIR_IN etc are missing before 3.0. copy from <linux/gpio.h> */ | ||
119 | #ifndef GPIOF_DIR_IN | ||
120 | # define GPIOF_DIR_OUT (0 << 0) | ||
121 | # define GPIOF_DIR_IN (1 << 0) | ||
122 | # define GPIOF_INIT_LOW (0 << 1) | ||
123 | # define GPIOF_INIT_HIGH (1 << 1) | ||
124 | #endif | ||
125 | |||
126 | /* | ||
127 | * The operations are offered by each carrier and should make driver | ||
128 | * design completely independent of the carrier. Named GPIO pins may be | ||
129 | * the exception. | ||
130 | */ | ||
131 | struct fmc_operations { | ||
132 | uint32_t (*read32)(struct fmc_device *fmc, int offset); | ||
133 | void (*write32)(struct fmc_device *fmc, uint32_t value, int offset); | ||
134 | int (*validate)(struct fmc_device *fmc, struct fmc_driver *drv); | ||
135 | int (*reprogram)(struct fmc_device *f, struct fmc_driver *d, char *gw); | ||
136 | int (*irq_request)(struct fmc_device *fmc, irq_handler_t h, | ||
137 | char *name, int flags); | ||
138 | void (*irq_ack)(struct fmc_device *fmc); | ||
139 | int (*irq_free)(struct fmc_device *fmc); | ||
140 | int (*gpio_config)(struct fmc_device *fmc, struct fmc_gpio *gpio, | ||
141 | int ngpio); | ||
142 | int (*read_ee)(struct fmc_device *fmc, int pos, void *d, int l); | ||
143 | int (*write_ee)(struct fmc_device *fmc, int pos, const void *d, int l); | ||
144 | }; | ||
145 | |||
146 | /* Prefer this helper rather than calling of fmc->reprogram directly */ | ||
147 | extern int fmc_reprogram(struct fmc_device *f, struct fmc_driver *d, char *gw, | ||
148 | int sdb_entry); | ||
149 | |||
150 | /* | ||
151 | * The device reports all information needed to access hw. | ||
152 | * | ||
153 | * If we have eeprom_len and not contents, the core reads it. | ||
154 | * Then, parsing of identifiers is done by the core which fills fmc_fru_id.. | ||
155 | * Similarly a device that must be matched based on SDB cores must | ||
156 | * fill the entry point and the core will scan the bus (FIXME: sdb match) | ||
157 | */ | ||
158 | struct fmc_device { | ||
159 | unsigned long version; | ||
160 | unsigned long flags; | ||
161 | struct module *owner; /* char device must pin it */ | ||
162 | struct fmc_fru_id id; /* for EEPROM-based match */ | ||
163 | struct fmc_operations *op; /* carrier-provided */ | ||
164 | int irq; /* according to host bus. 0 == none */ | ||
165 | int eeprom_len; /* Usually 8kB, may be less */ | ||
166 | int eeprom_addr; /* 0x50, 0x52 etc */ | ||
167 | uint8_t *eeprom; /* Full contents or leading part */ | ||
168 | char *carrier_name; /* "SPEC" or similar, for special use */ | ||
169 | void *carrier_data; /* "struct spec *" or equivalent */ | ||
170 | __iomem void *fpga_base; /* May be NULL (Etherbone) */ | ||
171 | __iomem void *slot_base; /* Set by the driver */ | ||
172 | struct fmc_device **devarray; /* Allocated by the bus */ | ||
173 | int slot_id; /* Index in the slot array */ | ||
174 | int nr_slots; /* Number of slots in this carrier */ | ||
175 | unsigned long memlen; /* Used for the char device */ | ||
176 | struct device dev; /* For Linux use */ | ||
177 | struct device *hwdev; /* The underlying hardware device */ | ||
178 | unsigned long sdbfs_entry; | ||
179 | struct sdb_array *sdb; | ||
180 | uint32_t device_id; /* Filled by the device */ | ||
181 | char *mezzanine_name; /* Defaults to ``fmc'' */ | ||
182 | void *mezzanine_data; | ||
183 | }; | ||
184 | #define to_fmc_device(x) container_of((x), struct fmc_device, dev) | ||
185 | |||
186 | #define FMC_DEVICE_HAS_GOLDEN 1 | ||
187 | #define FMC_DEVICE_HAS_CUSTOM 2 | ||
188 | #define FMC_DEVICE_NO_MEZZANINE 4 | ||
189 | #define FMC_DEVICE_MATCH_SDB 8 /* fmc-core must scan sdb in fpga */ | ||
190 | |||
191 | /* | ||
192 | * If fpga_base can be used, the carrier offers no readl/writel methods, and | ||
193 | * this expands to a single, fast, I/O access. | ||
194 | */ | ||
195 | static inline uint32_t fmc_readl(struct fmc_device *fmc, int offset) | ||
196 | { | ||
197 | if (unlikely(fmc->op->read32)) | ||
198 | return fmc->op->read32(fmc, offset); | ||
199 | return readl(fmc->fpga_base + offset); | ||
200 | } | ||
201 | static inline void fmc_writel(struct fmc_device *fmc, uint32_t val, int off) | ||
202 | { | ||
203 | if (unlikely(fmc->op->write32)) | ||
204 | fmc->op->write32(fmc, val, off); | ||
205 | else | ||
206 | writel(val, fmc->fpga_base + off); | ||
207 | } | ||
208 | |||
209 | /* pci-like naming */ | ||
210 | static inline void *fmc_get_drvdata(const struct fmc_device *fmc) | ||
211 | { | ||
212 | return dev_get_drvdata(&fmc->dev); | ||
213 | } | ||
214 | |||
215 | static inline void fmc_set_drvdata(struct fmc_device *fmc, void *data) | ||
216 | { | ||
217 | dev_set_drvdata(&fmc->dev, data); | ||
218 | } | ||
219 | |||
220 | /* The 4 access points */ | ||
221 | extern int fmc_driver_register(struct fmc_driver *drv); | ||
222 | extern void fmc_driver_unregister(struct fmc_driver *drv); | ||
223 | extern int fmc_device_register(struct fmc_device *tdev); | ||
224 | extern void fmc_device_unregister(struct fmc_device *tdev); | ||
225 | |||
226 | /* Two more for device sets, all driven by the same FPGA */ | ||
227 | extern int fmc_device_register_n(struct fmc_device **devs, int n); | ||
228 | extern void fmc_device_unregister_n(struct fmc_device **devs, int n); | ||
229 | |||
230 | /* Internal cross-calls between files; not exported to other modules */ | ||
231 | extern int fmc_match(struct device *dev, struct device_driver *drv); | ||
232 | extern int fmc_fill_id_info(struct fmc_device *fmc); | ||
233 | extern void fmc_free_id_info(struct fmc_device *fmc); | ||
234 | extern void fmc_dump_eeprom(const struct fmc_device *fmc); | ||
235 | extern void fmc_dump_sdb(const struct fmc_device *fmc); | ||
236 | |||
237 | #endif /* __LINUX_FMC_H__ */ | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 43db02e9c9fa..2b82c8041490 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -364,7 +364,7 @@ struct address_space_operations { | |||
364 | 364 | ||
365 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ | 365 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ |
366 | sector_t (*bmap)(struct address_space *, sector_t); | 366 | sector_t (*bmap)(struct address_space *, sector_t); |
367 | void (*invalidatepage) (struct page *, unsigned long); | 367 | void (*invalidatepage) (struct page *, unsigned int, unsigned int); |
368 | int (*releasepage) (struct page *, gfp_t); | 368 | int (*releasepage) (struct page *, gfp_t); |
369 | void (*freepage)(struct page *); | 369 | void (*freepage)(struct page *); |
370 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 370 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
@@ -908,6 +908,7 @@ struct file_lock_operations { | |||
908 | 908 | ||
909 | struct lock_manager_operations { | 909 | struct lock_manager_operations { |
910 | int (*lm_compare_owner)(struct file_lock *, struct file_lock *); | 910 | int (*lm_compare_owner)(struct file_lock *, struct file_lock *); |
911 | unsigned long (*lm_owner_key)(struct file_lock *); | ||
911 | void (*lm_notify)(struct file_lock *); /* unblock callback */ | 912 | void (*lm_notify)(struct file_lock *); /* unblock callback */ |
912 | int (*lm_grant)(struct file_lock *, struct file_lock *, int); | 913 | int (*lm_grant)(struct file_lock *, struct file_lock *, int); |
913 | void (*lm_break)(struct file_lock *); | 914 | void (*lm_break)(struct file_lock *); |
@@ -926,9 +927,27 @@ int locks_in_grace(struct net *); | |||
926 | /* that will die - we need it for nfs_lock_info */ | 927 | /* that will die - we need it for nfs_lock_info */ |
927 | #include <linux/nfs_fs_i.h> | 928 | #include <linux/nfs_fs_i.h> |
928 | 929 | ||
930 | /* | ||
931 | * struct file_lock represents a generic "file lock". It's used to represent | ||
932 | * POSIX byte range locks, BSD (flock) locks, and leases. It's important to | ||
933 | * note that the same struct is used to represent both a request for a lock and | ||
934 | * the lock itself, but the same object is never used for both. | ||
935 | * | ||
936 | * FIXME: should we create a separate "struct lock_request" to help distinguish | ||
937 | * these two uses? | ||
938 | * | ||
939 | * The i_flock list is ordered by: | ||
940 | * | ||
941 | * 1) lock type -- FL_LEASEs first, then FL_FLOCK, and finally FL_POSIX | ||
942 | * 2) lock owner | ||
943 | * 3) lock range start | ||
944 | * 4) lock range end | ||
945 | * | ||
946 | * Obviously, the last two criteria only matter for POSIX locks. | ||
947 | */ | ||
929 | struct file_lock { | 948 | struct file_lock { |
930 | struct file_lock *fl_next; /* singly linked list for this inode */ | 949 | struct file_lock *fl_next; /* singly linked list for this inode */ |
931 | struct list_head fl_link; /* doubly linked list of all locks */ | 950 | struct hlist_node fl_link; /* node in global lists */ |
932 | struct list_head fl_block; /* circular list of blocked processes */ | 951 | struct list_head fl_block; /* circular list of blocked processes */ |
933 | fl_owner_t fl_owner; | 952 | fl_owner_t fl_owner; |
934 | unsigned int fl_flags; | 953 | unsigned int fl_flags; |
@@ -994,7 +1013,7 @@ extern void locks_release_private(struct file_lock *); | |||
994 | extern void posix_test_lock(struct file *, struct file_lock *); | 1013 | extern void posix_test_lock(struct file *, struct file_lock *); |
995 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); | 1014 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); |
996 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | 1015 | extern int posix_lock_file_wait(struct file *, struct file_lock *); |
997 | extern int posix_unblock_lock(struct file *, struct file_lock *); | 1016 | extern int posix_unblock_lock(struct file_lock *); |
998 | extern int vfs_test_lock(struct file *, struct file_lock *); | 1017 | extern int vfs_test_lock(struct file *, struct file_lock *); |
999 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); | 1018 | extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); |
1000 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); | 1019 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); |
@@ -1006,9 +1025,6 @@ extern int vfs_setlease(struct file *, long, struct file_lock **); | |||
1006 | extern int lease_modify(struct file_lock **, int); | 1025 | extern int lease_modify(struct file_lock **, int); |
1007 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); | 1026 | extern int lock_may_read(struct inode *, loff_t start, unsigned long count); |
1008 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); | 1027 | extern int lock_may_write(struct inode *, loff_t start, unsigned long count); |
1009 | extern void locks_delete_block(struct file_lock *waiter); | ||
1010 | extern void lock_flocks(void); | ||
1011 | extern void unlock_flocks(void); | ||
1012 | #else /* !CONFIG_FILE_LOCKING */ | 1028 | #else /* !CONFIG_FILE_LOCKING */ |
1013 | static inline int fcntl_getlk(struct file *file, struct flock __user *user) | 1029 | static inline int fcntl_getlk(struct file *file, struct flock __user *user) |
1014 | { | 1030 | { |
@@ -1084,8 +1100,7 @@ static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl) | |||
1084 | return -ENOLCK; | 1100 | return -ENOLCK; |
1085 | } | 1101 | } |
1086 | 1102 | ||
1087 | static inline int posix_unblock_lock(struct file *filp, | 1103 | static inline int posix_unblock_lock(struct file_lock *waiter) |
1088 | struct file_lock *waiter) | ||
1089 | { | 1104 | { |
1090 | return -ENOENT; | 1105 | return -ENOENT; |
1091 | } | 1106 | } |
@@ -1150,19 +1165,6 @@ static inline int lock_may_write(struct inode *inode, loff_t start, | |||
1150 | { | 1165 | { |
1151 | return 1; | 1166 | return 1; |
1152 | } | 1167 | } |
1153 | |||
1154 | static inline void locks_delete_block(struct file_lock *waiter) | ||
1155 | { | ||
1156 | } | ||
1157 | |||
1158 | static inline void lock_flocks(void) | ||
1159 | { | ||
1160 | } | ||
1161 | |||
1162 | static inline void unlock_flocks(void) | ||
1163 | { | ||
1164 | } | ||
1165 | |||
1166 | #endif /* !CONFIG_FILE_LOCKING */ | 1168 | #endif /* !CONFIG_FILE_LOCKING */ |
1167 | 1169 | ||
1168 | 1170 | ||
@@ -1506,6 +1508,11 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | |||
1506 | * to have different dirent layouts depending on the binary type. | 1508 | * to have different dirent layouts depending on the binary type. |
1507 | */ | 1509 | */ |
1508 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); | 1510 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); |
1511 | struct dir_context { | ||
1512 | const filldir_t actor; | ||
1513 | loff_t pos; | ||
1514 | }; | ||
1515 | |||
1509 | struct block_device_operations; | 1516 | struct block_device_operations; |
1510 | 1517 | ||
1511 | /* These macros are for out of kernel modules to test that | 1518 | /* These macros are for out of kernel modules to test that |
@@ -1521,7 +1528,7 @@ struct file_operations { | |||
1521 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); | 1528 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); |
1522 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | 1529 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1523 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | 1530 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1524 | int (*readdir) (struct file *, void *, filldir_t); | 1531 | int (*iterate) (struct file *, struct dir_context *); |
1525 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | 1532 | unsigned int (*poll) (struct file *, struct poll_table_struct *); |
1526 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | 1533 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
1527 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); | 1534 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
@@ -1575,6 +1582,7 @@ struct inode_operations { | |||
1575 | int (*atomic_open)(struct inode *, struct dentry *, | 1582 | int (*atomic_open)(struct inode *, struct dentry *, |
1576 | struct file *, unsigned open_flag, | 1583 | struct file *, unsigned open_flag, |
1577 | umode_t create_mode, int *opened); | 1584 | umode_t create_mode, int *opened); |
1585 | int (*tmpfile) (struct inode *, struct dentry *, umode_t); | ||
1578 | } ____cacheline_aligned; | 1586 | } ____cacheline_aligned; |
1579 | 1587 | ||
1580 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | 1588 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, |
@@ -1738,6 +1746,7 @@ struct super_operations { | |||
1738 | #define I_REFERENCED (1 << 8) | 1746 | #define I_REFERENCED (1 << 8) |
1739 | #define __I_DIO_WAKEUP 9 | 1747 | #define __I_DIO_WAKEUP 9 |
1740 | #define I_DIO_WAKEUP (1 << I_DIO_WAKEUP) | 1748 | #define I_DIO_WAKEUP (1 << I_DIO_WAKEUP) |
1749 | #define I_LINKABLE (1 << 10) | ||
1741 | 1750 | ||
1742 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) | 1751 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) |
1743 | 1752 | ||
@@ -1891,7 +1900,6 @@ extern int current_umask(void); | |||
1891 | extern struct kobject *fs_kobj; | 1900 | extern struct kobject *fs_kobj; |
1892 | 1901 | ||
1893 | #define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK) | 1902 | #define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK) |
1894 | extern int rw_verify_area(int, struct file *, loff_t *, size_t); | ||
1895 | 1903 | ||
1896 | #define FLOCK_VERIFY_READ 1 | 1904 | #define FLOCK_VERIFY_READ 1 |
1897 | #define FLOCK_VERIFY_WRITE 2 | 1905 | #define FLOCK_VERIFY_WRITE 2 |
@@ -2304,7 +2312,6 @@ extern struct file * open_exec(const char *); | |||
2304 | /* fs/dcache.c -- generic fs support functions */ | 2312 | /* fs/dcache.c -- generic fs support functions */ |
2305 | extern int is_subdir(struct dentry *, struct dentry *); | 2313 | extern int is_subdir(struct dentry *, struct dentry *); |
2306 | extern int path_is_under(struct path *, struct path *); | 2314 | extern int path_is_under(struct path *, struct path *); |
2307 | extern ino_t find_inode_number(struct dentry *, struct qstr *); | ||
2308 | 2315 | ||
2309 | #include <linux/err.h> | 2316 | #include <linux/err.h> |
2310 | 2317 | ||
@@ -2414,16 +2421,17 @@ extern ssize_t generic_file_splice_write(struct pipe_inode_info *, | |||
2414 | struct file *, loff_t *, size_t, unsigned int); | 2421 | struct file *, loff_t *, size_t, unsigned int); |
2415 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, | 2422 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, |
2416 | struct file *out, loff_t *, size_t len, unsigned int flags); | 2423 | struct file *out, loff_t *, size_t len, unsigned int flags); |
2417 | extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | ||
2418 | size_t len, unsigned int flags); | ||
2419 | 2424 | ||
2420 | extern void | 2425 | extern void |
2421 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | 2426 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); |
2422 | extern loff_t noop_llseek(struct file *file, loff_t offset, int whence); | 2427 | extern loff_t noop_llseek(struct file *file, loff_t offset, int whence); |
2423 | extern loff_t no_llseek(struct file *file, loff_t offset, int whence); | 2428 | extern loff_t no_llseek(struct file *file, loff_t offset, int whence); |
2429 | extern loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize); | ||
2424 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence); | 2430 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence); |
2425 | extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, | 2431 | extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, |
2426 | int whence, loff_t maxsize, loff_t eof); | 2432 | int whence, loff_t maxsize, loff_t eof); |
2433 | extern loff_t fixed_size_llseek(struct file *file, loff_t offset, | ||
2434 | int whence, loff_t size); | ||
2427 | extern int generic_file_open(struct inode * inode, struct file * filp); | 2435 | extern int generic_file_open(struct inode * inode, struct file * filp); |
2428 | extern int nonseekable_open(struct inode * inode, struct file * filp); | 2436 | extern int nonseekable_open(struct inode * inode, struct file * filp); |
2429 | 2437 | ||
@@ -2496,6 +2504,7 @@ loff_t inode_get_bytes(struct inode *inode); | |||
2496 | void inode_set_bytes(struct inode *inode, loff_t bytes); | 2504 | void inode_set_bytes(struct inode *inode, loff_t bytes); |
2497 | 2505 | ||
2498 | extern int vfs_readdir(struct file *, filldir_t, void *); | 2506 | extern int vfs_readdir(struct file *, filldir_t, void *); |
2507 | extern int iterate_dir(struct file *, struct dir_context *); | ||
2499 | 2508 | ||
2500 | extern int vfs_stat(const char __user *, struct kstat *); | 2509 | extern int vfs_stat(const char __user *, struct kstat *); |
2501 | extern int vfs_lstat(const char __user *, struct kstat *); | 2510 | extern int vfs_lstat(const char __user *, struct kstat *); |
@@ -2526,7 +2535,7 @@ extern void iterate_supers_type(struct file_system_type *, | |||
2526 | extern int dcache_dir_open(struct inode *, struct file *); | 2535 | extern int dcache_dir_open(struct inode *, struct file *); |
2527 | extern int dcache_dir_close(struct inode *, struct file *); | 2536 | extern int dcache_dir_close(struct inode *, struct file *); |
2528 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); | 2537 | extern loff_t dcache_dir_lseek(struct file *, loff_t, int); |
2529 | extern int dcache_readdir(struct file *, void *, filldir_t); | 2538 | extern int dcache_readdir(struct file *, struct dir_context *); |
2530 | extern int simple_setattr(struct dentry *, struct iattr *); | 2539 | extern int simple_setattr(struct dentry *, struct iattr *); |
2531 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 2540 | extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
2532 | extern int simple_statfs(struct dentry *, struct kstatfs *); | 2541 | extern int simple_statfs(struct dentry *, struct kstatfs *); |
@@ -2690,4 +2699,41 @@ static inline void inode_has_no_xattr(struct inode *inode) | |||
2690 | inode->i_flags |= S_NOSEC; | 2699 | inode->i_flags |= S_NOSEC; |
2691 | } | 2700 | } |
2692 | 2701 | ||
2702 | static inline bool dir_emit(struct dir_context *ctx, | ||
2703 | const char *name, int namelen, | ||
2704 | u64 ino, unsigned type) | ||
2705 | { | ||
2706 | return ctx->actor(ctx, name, namelen, ctx->pos, ino, type) == 0; | ||
2707 | } | ||
2708 | static inline bool dir_emit_dot(struct file *file, struct dir_context *ctx) | ||
2709 | { | ||
2710 | return ctx->actor(ctx, ".", 1, ctx->pos, | ||
2711 | file->f_path.dentry->d_inode->i_ino, DT_DIR) == 0; | ||
2712 | } | ||
2713 | static inline bool dir_emit_dotdot(struct file *file, struct dir_context *ctx) | ||
2714 | { | ||
2715 | return ctx->actor(ctx, "..", 2, ctx->pos, | ||
2716 | parent_ino(file->f_path.dentry), DT_DIR) == 0; | ||
2717 | } | ||
2718 | static inline bool dir_emit_dots(struct file *file, struct dir_context *ctx) | ||
2719 | { | ||
2720 | if (ctx->pos == 0) { | ||
2721 | if (!dir_emit_dot(file, ctx)) | ||
2722 | return false; | ||
2723 | ctx->pos = 1; | ||
2724 | } | ||
2725 | if (ctx->pos == 1) { | ||
2726 | if (!dir_emit_dotdot(file, ctx)) | ||
2727 | return false; | ||
2728 | ctx->pos = 2; | ||
2729 | } | ||
2730 | return true; | ||
2731 | } | ||
2732 | static inline bool dir_relax(struct inode *inode) | ||
2733 | { | ||
2734 | mutex_unlock(&inode->i_mutex); | ||
2735 | mutex_lock(&inode->i_mutex); | ||
2736 | return !IS_DEADDIR(inode); | ||
2737 | } | ||
2738 | |||
2693 | #endif /* _LINUX_FS_H */ | 2739 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index 5dfa0aa216b6..a9ff9a36b86d 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
@@ -97,7 +97,8 @@ struct fscache_operation { | |||
97 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ | 97 | #define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ |
98 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ | 98 | #define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ |
99 | #define FSCACHE_OP_DEC_READ_CNT 6 /* decrement object->n_reads on destruction */ | 99 | #define FSCACHE_OP_DEC_READ_CNT 6 /* decrement object->n_reads on destruction */ |
100 | #define FSCACHE_OP_KEEP_FLAGS 0x0070 /* flags to keep when repurposing an op */ | 100 | #define FSCACHE_OP_UNUSE_COOKIE 7 /* call fscache_unuse_cookie() on completion */ |
101 | #define FSCACHE_OP_KEEP_FLAGS 0x00f0 /* flags to keep when repurposing an op */ | ||
101 | 102 | ||
102 | enum fscache_operation_state state; | 103 | enum fscache_operation_state state; |
103 | atomic_t usage; | 104 | atomic_t usage; |
@@ -150,7 +151,7 @@ struct fscache_retrieval { | |||
150 | void *context; /* netfs read context (pinned) */ | 151 | void *context; /* netfs read context (pinned) */ |
151 | struct list_head to_do; /* list of things to be done by the backend */ | 152 | struct list_head to_do; /* list of things to be done by the backend */ |
152 | unsigned long start_time; /* time at which retrieval started */ | 153 | unsigned long start_time; /* time at which retrieval started */ |
153 | unsigned n_pages; /* number of pages to be retrieved */ | 154 | atomic_t n_pages; /* number of pages to be retrieved */ |
154 | }; | 155 | }; |
155 | 156 | ||
156 | typedef int (*fscache_page_retrieval_func_t)(struct fscache_retrieval *op, | 157 | typedef int (*fscache_page_retrieval_func_t)(struct fscache_retrieval *op, |
@@ -194,15 +195,14 @@ static inline void fscache_enqueue_retrieval(struct fscache_retrieval *op) | |||
194 | static inline void fscache_retrieval_complete(struct fscache_retrieval *op, | 195 | static inline void fscache_retrieval_complete(struct fscache_retrieval *op, |
195 | int n_pages) | 196 | int n_pages) |
196 | { | 197 | { |
197 | op->n_pages -= n_pages; | 198 | atomic_sub(n_pages, &op->n_pages); |
198 | if (op->n_pages <= 0) | 199 | if (atomic_read(&op->n_pages) <= 0) |
199 | fscache_op_complete(&op->op, true); | 200 | fscache_op_complete(&op->op, true); |
200 | } | 201 | } |
201 | 202 | ||
202 | /** | 203 | /** |
203 | * fscache_put_retrieval - Drop a reference to a retrieval operation | 204 | * fscache_put_retrieval - Drop a reference to a retrieval operation |
204 | * @op: The retrieval operation affected | 205 | * @op: The retrieval operation affected |
205 | * @n_pages: The number of pages to account for | ||
206 | * | 206 | * |
207 | * Drop a reference to a retrieval operation. | 207 | * Drop a reference to a retrieval operation. |
208 | */ | 208 | */ |
@@ -314,6 +314,7 @@ struct fscache_cache_ops { | |||
314 | struct fscache_cookie { | 314 | struct fscache_cookie { |
315 | atomic_t usage; /* number of users of this cookie */ | 315 | atomic_t usage; /* number of users of this cookie */ |
316 | atomic_t n_children; /* number of children of this cookie */ | 316 | atomic_t n_children; /* number of children of this cookie */ |
317 | atomic_t n_active; /* number of active users of netfs ptrs */ | ||
317 | spinlock_t lock; | 318 | spinlock_t lock; |
318 | spinlock_t stores_lock; /* lock on page store tree */ | 319 | spinlock_t stores_lock; /* lock on page store tree */ |
319 | struct hlist_head backing_objects; /* object(s) backing this file/index */ | 320 | struct hlist_head backing_objects; /* object(s) backing this file/index */ |
@@ -326,13 +327,11 @@ struct fscache_cookie { | |||
326 | 327 | ||
327 | unsigned long flags; | 328 | unsigned long flags; |
328 | #define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ | 329 | #define FSCACHE_COOKIE_LOOKING_UP 0 /* T if non-index cookie being looked up still */ |
329 | #define FSCACHE_COOKIE_CREATING 1 /* T if non-index object being created still */ | 330 | #define FSCACHE_COOKIE_NO_DATA_YET 1 /* T if new object with no cached data yet */ |
330 | #define FSCACHE_COOKIE_NO_DATA_YET 2 /* T if new object with no cached data yet */ | 331 | #define FSCACHE_COOKIE_UNAVAILABLE 2 /* T if cookie is unavailable (error, etc) */ |
331 | #define FSCACHE_COOKIE_PENDING_FILL 3 /* T if pending initial fill on object */ | 332 | #define FSCACHE_COOKIE_INVALIDATING 3 /* T if cookie is being invalidated */ |
332 | #define FSCACHE_COOKIE_FILLING 4 /* T if filling object incrementally */ | 333 | #define FSCACHE_COOKIE_RELINQUISHED 4 /* T if cookie has been relinquished */ |
333 | #define FSCACHE_COOKIE_UNAVAILABLE 5 /* T if cookie is unavailable (error, etc) */ | 334 | #define FSCACHE_COOKIE_RETIRED 5 /* T if cookie was retired */ |
334 | #define FSCACHE_COOKIE_WAITING_ON_READS 6 /* T if cookie is waiting on reads */ | ||
335 | #define FSCACHE_COOKIE_INVALIDATING 7 /* T if cookie is being invalidated */ | ||
336 | }; | 335 | }; |
337 | 336 | ||
338 | extern struct fscache_cookie fscache_fsdef_index; | 337 | extern struct fscache_cookie fscache_fsdef_index; |
@@ -341,45 +340,40 @@ extern struct fscache_cookie fscache_fsdef_index; | |||
341 | * Event list for fscache_object::{event_mask,events} | 340 | * Event list for fscache_object::{event_mask,events} |
342 | */ | 341 | */ |
343 | enum { | 342 | enum { |
344 | FSCACHE_OBJECT_EV_REQUEUE, /* T if object should be requeued */ | 343 | FSCACHE_OBJECT_EV_NEW_CHILD, /* T if object has a new child */ |
344 | FSCACHE_OBJECT_EV_PARENT_READY, /* T if object's parent is ready */ | ||
345 | FSCACHE_OBJECT_EV_UPDATE, /* T if object should be updated */ | 345 | FSCACHE_OBJECT_EV_UPDATE, /* T if object should be updated */ |
346 | FSCACHE_OBJECT_EV_INVALIDATE, /* T if cache requested object invalidation */ | 346 | FSCACHE_OBJECT_EV_INVALIDATE, /* T if cache requested object invalidation */ |
347 | FSCACHE_OBJECT_EV_CLEARED, /* T if accessors all gone */ | 347 | FSCACHE_OBJECT_EV_CLEARED, /* T if accessors all gone */ |
348 | FSCACHE_OBJECT_EV_ERROR, /* T if fatal error occurred during processing */ | 348 | FSCACHE_OBJECT_EV_ERROR, /* T if fatal error occurred during processing */ |
349 | FSCACHE_OBJECT_EV_RELEASE, /* T if netfs requested object release */ | 349 | FSCACHE_OBJECT_EV_KILL, /* T if netfs relinquished or cache withdrew object */ |
350 | FSCACHE_OBJECT_EV_RETIRE, /* T if netfs requested object retirement */ | ||
351 | FSCACHE_OBJECT_EV_WITHDRAW, /* T if cache requested object withdrawal */ | ||
352 | NR_FSCACHE_OBJECT_EVENTS | 350 | NR_FSCACHE_OBJECT_EVENTS |
353 | }; | 351 | }; |
354 | 352 | ||
355 | #define FSCACHE_OBJECT_EVENTS_MASK ((1UL << NR_FSCACHE_OBJECT_EVENTS) - 1) | 353 | #define FSCACHE_OBJECT_EVENTS_MASK ((1UL << NR_FSCACHE_OBJECT_EVENTS) - 1) |
356 | 354 | ||
357 | /* | 355 | /* |
356 | * States for object state machine. | ||
357 | */ | ||
358 | struct fscache_transition { | ||
359 | unsigned long events; | ||
360 | const struct fscache_state *transit_to; | ||
361 | }; | ||
362 | |||
363 | struct fscache_state { | ||
364 | char name[24]; | ||
365 | char short_name[8]; | ||
366 | const struct fscache_state *(*work)(struct fscache_object *object, | ||
367 | int event); | ||
368 | const struct fscache_transition transitions[]; | ||
369 | }; | ||
370 | |||
371 | /* | ||
358 | * on-disk cache file or index handle | 372 | * on-disk cache file or index handle |
359 | */ | 373 | */ |
360 | struct fscache_object { | 374 | struct fscache_object { |
361 | enum fscache_object_state { | 375 | const struct fscache_state *state; /* Object state machine state */ |
362 | FSCACHE_OBJECT_INIT, /* object in initial unbound state */ | 376 | const struct fscache_transition *oob_table; /* OOB state transition table */ |
363 | FSCACHE_OBJECT_LOOKING_UP, /* looking up object */ | ||
364 | FSCACHE_OBJECT_CREATING, /* creating object */ | ||
365 | |||
366 | /* active states */ | ||
367 | FSCACHE_OBJECT_AVAILABLE, /* cleaning up object after creation */ | ||
368 | FSCACHE_OBJECT_ACTIVE, /* object is usable */ | ||
369 | FSCACHE_OBJECT_INVALIDATING, /* object is invalidating */ | ||
370 | FSCACHE_OBJECT_UPDATING, /* object is updating */ | ||
371 | |||
372 | /* terminal states */ | ||
373 | FSCACHE_OBJECT_DYING, /* object waiting for accessors to finish */ | ||
374 | FSCACHE_OBJECT_LC_DYING, /* object cleaning up after lookup/create */ | ||
375 | FSCACHE_OBJECT_ABORT_INIT, /* abort the init state */ | ||
376 | FSCACHE_OBJECT_RELEASING, /* releasing object */ | ||
377 | FSCACHE_OBJECT_RECYCLING, /* retiring object */ | ||
378 | FSCACHE_OBJECT_WITHDRAWING, /* withdrawing object */ | ||
379 | FSCACHE_OBJECT_DEAD, /* object is now dead */ | ||
380 | FSCACHE_OBJECT__NSTATES | ||
381 | } state; | ||
382 | |||
383 | int debug_id; /* debugging ID */ | 377 | int debug_id; /* debugging ID */ |
384 | int n_children; /* number of child objects */ | 378 | int n_children; /* number of child objects */ |
385 | int n_ops; /* number of extant ops on object */ | 379 | int n_ops; /* number of extant ops on object */ |
@@ -390,6 +384,7 @@ struct fscache_object { | |||
390 | spinlock_t lock; /* state and operations lock */ | 384 | spinlock_t lock; /* state and operations lock */ |
391 | 385 | ||
392 | unsigned long lookup_jif; /* time at which lookup started */ | 386 | unsigned long lookup_jif; /* time at which lookup started */ |
387 | unsigned long oob_event_mask; /* OOB events this object is interested in */ | ||
393 | unsigned long event_mask; /* events this object is interested in */ | 388 | unsigned long event_mask; /* events this object is interested in */ |
394 | unsigned long events; /* events to be processed by this object | 389 | unsigned long events; /* events to be processed by this object |
395 | * (order is important - using fls) */ | 390 | * (order is important - using fls) */ |
@@ -398,6 +393,9 @@ struct fscache_object { | |||
398 | #define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ | 393 | #define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ |
399 | #define FSCACHE_OBJECT_PENDING_WRITE 1 /* T if object has pending write */ | 394 | #define FSCACHE_OBJECT_PENDING_WRITE 1 /* T if object has pending write */ |
400 | #define FSCACHE_OBJECT_WAITING 2 /* T if object is waiting on its parent */ | 395 | #define FSCACHE_OBJECT_WAITING 2 /* T if object is waiting on its parent */ |
396 | #define FSCACHE_OBJECT_IS_LIVE 3 /* T if object is not withdrawn or relinquished */ | ||
397 | #define FSCACHE_OBJECT_IS_LOOKED_UP 4 /* T if object has been looked up */ | ||
398 | #define FSCACHE_OBJECT_IS_AVAILABLE 5 /* T if object has become active */ | ||
401 | 399 | ||
402 | struct list_head cache_link; /* link in cache->object_list */ | 400 | struct list_head cache_link; /* link in cache->object_list */ |
403 | struct hlist_node cookie_link; /* link in cookie->backing_objects */ | 401 | struct hlist_node cookie_link; /* link in cookie->backing_objects */ |
@@ -415,62 +413,40 @@ struct fscache_object { | |||
415 | loff_t store_limit_l; /* current storage limit */ | 413 | loff_t store_limit_l; /* current storage limit */ |
416 | }; | 414 | }; |
417 | 415 | ||
418 | extern const char *fscache_object_states[]; | 416 | extern void fscache_object_init(struct fscache_object *, struct fscache_cookie *, |
417 | struct fscache_cache *); | ||
418 | extern void fscache_object_destroy(struct fscache_object *); | ||
419 | 419 | ||
420 | #define fscache_object_is_active(obj) \ | 420 | extern void fscache_object_lookup_negative(struct fscache_object *object); |
421 | (!test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \ | 421 | extern void fscache_obtained_object(struct fscache_object *object); |
422 | (obj)->state >= FSCACHE_OBJECT_AVAILABLE && \ | ||
423 | (obj)->state < FSCACHE_OBJECT_DYING) | ||
424 | 422 | ||
425 | #define fscache_object_is_dead(obj) \ | 423 | static inline bool fscache_object_is_live(struct fscache_object *object) |
426 | (test_bit(FSCACHE_IOERROR, &(obj)->cache->flags) && \ | 424 | { |
427 | (obj)->state >= FSCACHE_OBJECT_DYING) | 425 | return test_bit(FSCACHE_OBJECT_IS_LIVE, &object->flags); |
426 | } | ||
428 | 427 | ||
429 | extern void fscache_object_work_func(struct work_struct *work); | 428 | static inline bool fscache_object_is_dying(struct fscache_object *object) |
429 | { | ||
430 | return !fscache_object_is_live(object); | ||
431 | } | ||
430 | 432 | ||
431 | /** | 433 | static inline bool fscache_object_is_available(struct fscache_object *object) |
432 | * fscache_object_init - Initialise a cache object description | ||
433 | * @object: Object description | ||
434 | * | ||
435 | * Initialise a cache object description to its basic values. | ||
436 | * | ||
437 | * See Documentation/filesystems/caching/backend-api.txt for a complete | ||
438 | * description. | ||
439 | */ | ||
440 | static inline | ||
441 | void fscache_object_init(struct fscache_object *object, | ||
442 | struct fscache_cookie *cookie, | ||
443 | struct fscache_cache *cache) | ||
444 | { | 434 | { |
445 | atomic_inc(&cache->object_count); | 435 | return test_bit(FSCACHE_OBJECT_IS_AVAILABLE, &object->flags); |
446 | |||
447 | object->state = FSCACHE_OBJECT_INIT; | ||
448 | spin_lock_init(&object->lock); | ||
449 | INIT_LIST_HEAD(&object->cache_link); | ||
450 | INIT_HLIST_NODE(&object->cookie_link); | ||
451 | INIT_WORK(&object->work, fscache_object_work_func); | ||
452 | INIT_LIST_HEAD(&object->dependents); | ||
453 | INIT_LIST_HEAD(&object->dep_link); | ||
454 | INIT_LIST_HEAD(&object->pending_ops); | ||
455 | object->n_children = 0; | ||
456 | object->n_ops = object->n_in_progress = object->n_exclusive = 0; | ||
457 | object->events = object->event_mask = 0; | ||
458 | object->flags = 0; | ||
459 | object->store_limit = 0; | ||
460 | object->store_limit_l = 0; | ||
461 | object->cache = cache; | ||
462 | object->cookie = cookie; | ||
463 | object->parent = NULL; | ||
464 | } | 436 | } |
465 | 437 | ||
466 | extern void fscache_object_lookup_negative(struct fscache_object *object); | 438 | static inline bool fscache_object_is_active(struct fscache_object *object) |
467 | extern void fscache_obtained_object(struct fscache_object *object); | 439 | { |
440 | return fscache_object_is_available(object) && | ||
441 | fscache_object_is_live(object) && | ||
442 | !test_bit(FSCACHE_IOERROR, &object->cache->flags); | ||
443 | } | ||
468 | 444 | ||
469 | #ifdef CONFIG_FSCACHE_OBJECT_LIST | 445 | static inline bool fscache_object_is_dead(struct fscache_object *object) |
470 | extern void fscache_object_destroy(struct fscache_object *object); | 446 | { |
471 | #else | 447 | return fscache_object_is_dying(object) && |
472 | #define fscache_object_destroy(object) do {} while(0) | 448 | test_bit(FSCACHE_IOERROR, &object->cache->flags); |
473 | #endif | 449 | } |
474 | 450 | ||
475 | /** | 451 | /** |
476 | * fscache_object_destroyed - Note destruction of an object in a cache | 452 | * fscache_object_destroyed - Note destruction of an object in a cache |
@@ -531,6 +507,33 @@ static inline void fscache_end_io(struct fscache_retrieval *op, | |||
531 | op->end_io_func(page, op->context, error); | 507 | op->end_io_func(page, op->context, error); |
532 | } | 508 | } |
533 | 509 | ||
510 | /** | ||
511 | * fscache_use_cookie - Request usage of cookie attached to an object | ||
512 | * @object: Object description | ||
513 | * | ||
514 | * Request usage of the cookie attached to an object. NULL is returned if the | ||
515 | * relinquishment had reduced the cookie usage count to 0. | ||
516 | */ | ||
517 | static inline bool fscache_use_cookie(struct fscache_object *object) | ||
518 | { | ||
519 | struct fscache_cookie *cookie = object->cookie; | ||
520 | return atomic_inc_not_zero(&cookie->n_active) != 0; | ||
521 | } | ||
522 | |||
523 | /** | ||
524 | * fscache_unuse_cookie - Cease usage of cookie attached to an object | ||
525 | * @object: Object description | ||
526 | * | ||
527 | * Cease usage of the cookie attached to an object. When the users count | ||
528 | * reaches zero then the cookie relinquishment will be permitted to proceed. | ||
529 | */ | ||
530 | static inline void fscache_unuse_cookie(struct fscache_object *object) | ||
531 | { | ||
532 | struct fscache_cookie *cookie = object->cookie; | ||
533 | if (atomic_dec_and_test(&cookie->n_active)) | ||
534 | wake_up_atomic_t(&cookie->n_active); | ||
535 | } | ||
536 | |||
534 | /* | 537 | /* |
535 | * out-of-line cache backend functions | 538 | * out-of-line cache backend functions |
536 | */ | 539 | */ |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index a78680a92dba..1c804b057fb1 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -38,7 +38,7 @@ static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u3 | |||
38 | static inline int fsnotify_perm(struct file *file, int mask) | 38 | static inline int fsnotify_perm(struct file *file, int mask) |
39 | { | 39 | { |
40 | struct path *path = &file->f_path; | 40 | struct path *path = &file->f_path; |
41 | struct inode *inode = path->dentry->d_inode; | 41 | struct inode *inode = file_inode(file); |
42 | __u32 fsnotify_mask = 0; | 42 | __u32 fsnotify_mask = 0; |
43 | int ret; | 43 | int ret; |
44 | 44 | ||
@@ -192,7 +192,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
192 | static inline void fsnotify_access(struct file *file) | 192 | static inline void fsnotify_access(struct file *file) |
193 | { | 193 | { |
194 | struct path *path = &file->f_path; | 194 | struct path *path = &file->f_path; |
195 | struct inode *inode = path->dentry->d_inode; | 195 | struct inode *inode = file_inode(file); |
196 | __u32 mask = FS_ACCESS; | 196 | __u32 mask = FS_ACCESS; |
197 | 197 | ||
198 | if (S_ISDIR(inode->i_mode)) | 198 | if (S_ISDIR(inode->i_mode)) |
@@ -210,7 +210,7 @@ static inline void fsnotify_access(struct file *file) | |||
210 | static inline void fsnotify_modify(struct file *file) | 210 | static inline void fsnotify_modify(struct file *file) |
211 | { | 211 | { |
212 | struct path *path = &file->f_path; | 212 | struct path *path = &file->f_path; |
213 | struct inode *inode = path->dentry->d_inode; | 213 | struct inode *inode = file_inode(file); |
214 | __u32 mask = FS_MODIFY; | 214 | __u32 mask = FS_MODIFY; |
215 | 215 | ||
216 | if (S_ISDIR(inode->i_mode)) | 216 | if (S_ISDIR(inode->i_mode)) |
@@ -228,7 +228,7 @@ static inline void fsnotify_modify(struct file *file) | |||
228 | static inline void fsnotify_open(struct file *file) | 228 | static inline void fsnotify_open(struct file *file) |
229 | { | 229 | { |
230 | struct path *path = &file->f_path; | 230 | struct path *path = &file->f_path; |
231 | struct inode *inode = path->dentry->d_inode; | 231 | struct inode *inode = file_inode(file); |
232 | __u32 mask = FS_OPEN; | 232 | __u32 mask = FS_OPEN; |
233 | 233 | ||
234 | if (S_ISDIR(inode->i_mode)) | 234 | if (S_ISDIR(inode->i_mode)) |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index c1d6555d2567..05bcc0903766 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -128,7 +128,7 @@ extern void synchronize_irq(unsigned int irq); | |||
128 | # define synchronize_irq(irq) barrier() | 128 | # define synchronize_irq(irq) barrier() |
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | #if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) | 131 | #if defined(CONFIG_TINY_RCU) |
132 | 132 | ||
133 | static inline void rcu_nmi_enter(void) | 133 | static inline void rcu_nmi_enter(void) |
134 | { | 134 | { |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 981546ad231c..89d4fbf681e7 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -362,6 +362,17 @@ static inline int hstate_index(struct hstate *h) | |||
362 | return h - hstates; | 362 | return h - hstates; |
363 | } | 363 | } |
364 | 364 | ||
365 | pgoff_t __basepage_index(struct page *page); | ||
366 | |||
367 | /* Return page->index in PAGE_SIZE units */ | ||
368 | static inline pgoff_t basepage_index(struct page *page) | ||
369 | { | ||
370 | if (!PageCompound(page)) | ||
371 | return page->index; | ||
372 | |||
373 | return __basepage_index(page); | ||
374 | } | ||
375 | |||
365 | #else /* CONFIG_HUGETLB_PAGE */ | 376 | #else /* CONFIG_HUGETLB_PAGE */ |
366 | struct hstate {}; | 377 | struct hstate {}; |
367 | #define alloc_huge_page_node(h, nid) NULL | 378 | #define alloc_huge_page_node(h, nid) NULL |
@@ -382,6 +393,11 @@ static inline unsigned int pages_per_huge_page(struct hstate *h) | |||
382 | } | 393 | } |
383 | #define hstate_index_to_shift(index) 0 | 394 | #define hstate_index_to_shift(index) 0 |
384 | #define hstate_index(h) 0 | 395 | #define hstate_index(h) 0 |
396 | |||
397 | static inline pgoff_t basepage_index(struct page *page) | ||
398 | { | ||
399 | return page->index; | ||
400 | } | ||
385 | #endif /* CONFIG_HUGETLB_PAGE */ | 401 | #endif /* CONFIG_HUGETLB_PAGE */ |
386 | 402 | ||
387 | #endif /* _LINUX_HUGETLB_H */ | 403 | #endif /* _LINUX_HUGETLB_H */ |
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index c2559847d7ee..fae8bac907ef 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
@@ -909,6 +909,7 @@ enum vmbus_channel_state { | |||
909 | CHANNEL_OFFER_STATE, | 909 | CHANNEL_OFFER_STATE, |
910 | CHANNEL_OPENING_STATE, | 910 | CHANNEL_OPENING_STATE, |
911 | CHANNEL_OPEN_STATE, | 911 | CHANNEL_OPEN_STATE, |
912 | CHANNEL_OPENED_STATE, | ||
912 | }; | 913 | }; |
913 | 914 | ||
914 | struct vmbus_channel_debug_info { | 915 | struct vmbus_channel_debug_info { |
@@ -1046,6 +1047,38 @@ struct vmbus_channel { | |||
1046 | * preserve the earlier behavior. | 1047 | * preserve the earlier behavior. |
1047 | */ | 1048 | */ |
1048 | u32 target_vp; | 1049 | u32 target_vp; |
1050 | /* | ||
1051 | * Support for sub-channels. For high performance devices, | ||
1052 | * it will be useful to have multiple sub-channels to support | ||
1053 | * a scalable communication infrastructure with the host. | ||
1054 | * The support for sub-channels is implemented as an extention | ||
1055 | * to the current infrastructure. | ||
1056 | * The initial offer is considered the primary channel and this | ||
1057 | * offer message will indicate if the host supports sub-channels. | ||
1058 | * The guest is free to ask for sub-channels to be offerred and can | ||
1059 | * open these sub-channels as a normal "primary" channel. However, | ||
1060 | * all sub-channels will have the same type and instance guids as the | ||
1061 | * primary channel. Requests sent on a given channel will result in a | ||
1062 | * response on the same channel. | ||
1063 | */ | ||
1064 | |||
1065 | /* | ||
1066 | * Sub-channel creation callback. This callback will be called in | ||
1067 | * process context when a sub-channel offer is received from the host. | ||
1068 | * The guest can open the sub-channel in the context of this callback. | ||
1069 | */ | ||
1070 | void (*sc_creation_callback)(struct vmbus_channel *new_sc); | ||
1071 | |||
1072 | spinlock_t sc_lock; | ||
1073 | /* | ||
1074 | * All Sub-channels of a primary channel are linked here. | ||
1075 | */ | ||
1076 | struct list_head sc_list; | ||
1077 | /* | ||
1078 | * The primary channel this sub-channel belongs to. | ||
1079 | * This will be NULL for the primary channel. | ||
1080 | */ | ||
1081 | struct vmbus_channel *primary_channel; | ||
1049 | }; | 1082 | }; |
1050 | 1083 | ||
1051 | static inline void set_channel_read_state(struct vmbus_channel *c, bool state) | 1084 | static inline void set_channel_read_state(struct vmbus_channel *c, bool state) |
@@ -1057,6 +1090,34 @@ void vmbus_onmessage(void *context); | |||
1057 | 1090 | ||
1058 | int vmbus_request_offers(void); | 1091 | int vmbus_request_offers(void); |
1059 | 1092 | ||
1093 | /* | ||
1094 | * APIs for managing sub-channels. | ||
1095 | */ | ||
1096 | |||
1097 | void vmbus_set_sc_create_callback(struct vmbus_channel *primary_channel, | ||
1098 | void (*sc_cr_cb)(struct vmbus_channel *new_sc)); | ||
1099 | |||
1100 | /* | ||
1101 | * Retrieve the (sub) channel on which to send an outgoing request. | ||
1102 | * When a primary channel has multiple sub-channels, we choose a | ||
1103 | * channel whose VCPU binding is closest to the VCPU on which | ||
1104 | * this call is being made. | ||
1105 | */ | ||
1106 | struct vmbus_channel *vmbus_get_outgoing_channel(struct vmbus_channel *primary); | ||
1107 | |||
1108 | /* | ||
1109 | * Check if sub-channels have already been offerred. This API will be useful | ||
1110 | * when the driver is unloaded after establishing sub-channels. In this case, | ||
1111 | * when the driver is re-loaded, the driver would have to check if the | ||
1112 | * subchannels have already been established before attempting to request | ||
1113 | * the creation of sub-channels. | ||
1114 | * This function returns TRUE to indicate that subchannels have already been | ||
1115 | * created. | ||
1116 | * This function should be invoked after setting the callback function for | ||
1117 | * sub-channel creation. | ||
1118 | */ | ||
1119 | bool vmbus_are_subchannels_present(struct vmbus_channel *primary); | ||
1120 | |||
1060 | /* The format must be the same as struct vmdata_gpa_direct */ | 1121 | /* The format must be the same as struct vmdata_gpa_direct */ |
1061 | struct vmbus_channel_packet_page_buffer { | 1122 | struct vmbus_channel_packet_page_buffer { |
1062 | u16 type; | 1123 | u16 type; |
@@ -1327,6 +1388,15 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver); | |||
1327 | 0x8e, 0x77, 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8 \ | 1388 | 0x8e, 0x77, 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8 \ |
1328 | } | 1389 | } |
1329 | 1390 | ||
1391 | /* | ||
1392 | * Synthetic FC GUID | ||
1393 | * {2f9bcc4a-0069-4af3-b76b-6fd0be528cda} | ||
1394 | */ | ||
1395 | #define HV_SYNTHFC_GUID \ | ||
1396 | .guid = { \ | ||
1397 | 0x4A, 0xCC, 0x9B, 0x2F, 0x69, 0x00, 0xF3, 0x4A, \ | ||
1398 | 0xB7, 0x6B, 0x6F, 0xD0, 0xBE, 0x52, 0x8C, 0xDA \ | ||
1399 | } | ||
1330 | 1400 | ||
1331 | /* | 1401 | /* |
1332 | * Common header for Hyper-V ICs | 1402 | * Common header for Hyper-V ICs |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 12b4d55a02af..d5569734f672 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -30,7 +30,6 @@ static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) | |||
30 | 30 | ||
31 | int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); | 31 | int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); |
32 | 32 | ||
33 | int mac_pton(const char *s, u8 *mac); | ||
34 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | 33 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); |
35 | 34 | ||
36 | #endif /* _LINUX_IF_ETHER_H */ | 35 | #endif /* _LINUX_IF_ETHER_H */ |
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index 4474557904f6..16fae6436d0e 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
@@ -249,12 +249,12 @@ team_get_first_port_txable_rcu(struct team *team, struct team_port *port) | |||
249 | return port; | 249 | return port; |
250 | cur = port; | 250 | cur = port; |
251 | list_for_each_entry_continue_rcu(cur, &team->port_list, list) | 251 | list_for_each_entry_continue_rcu(cur, &team->port_list, list) |
252 | if (team_port_txable(port)) | 252 | if (team_port_txable(cur)) |
253 | return cur; | 253 | return cur; |
254 | list_for_each_entry_rcu(cur, &team->port_list, list) { | 254 | list_for_each_entry_rcu(cur, &team->port_list, list) { |
255 | if (cur == port) | 255 | if (cur == port) |
256 | break; | 256 | break; |
257 | if (team_port_txable(port)) | 257 | if (team_port_txable(cur)) |
258 | return cur; | 258 | return cur; |
259 | } | 259 | } |
260 | return NULL; | 260 | return NULL; |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 52bd03b38962..637fa71de0c7 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -44,7 +44,7 @@ struct vlan_hdr { | |||
44 | * struct vlan_ethhdr - vlan ethernet header (ethhdr + vlan_hdr) | 44 | * struct vlan_ethhdr - vlan ethernet header (ethhdr + vlan_hdr) |
45 | * @h_dest: destination ethernet address | 45 | * @h_dest: destination ethernet address |
46 | * @h_source: source ethernet address | 46 | * @h_source: source ethernet address |
47 | * @h_vlan_proto: ethernet protocol (always 0x8100) | 47 | * @h_vlan_proto: ethernet protocol |
48 | * @h_vlan_TCI: priority and VLAN ID | 48 | * @h_vlan_TCI: priority and VLAN ID |
49 | * @h_vlan_encapsulated_proto: packet type ID or len | 49 | * @h_vlan_encapsulated_proto: packet type ID or len |
50 | */ | 50 | */ |
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h index 172c5b23cb84..72b26940730d 100644 --- a/include/linux/iio/common/st_sensors.h +++ b/include/linux/iio/common/st_sensors.h | |||
@@ -24,14 +24,10 @@ | |||
24 | #define ST_SENSORS_FULLSCALE_AVL_MAX 10 | 24 | #define ST_SENSORS_FULLSCALE_AVL_MAX 10 |
25 | 25 | ||
26 | #define ST_SENSORS_NUMBER_ALL_CHANNELS 4 | 26 | #define ST_SENSORS_NUMBER_ALL_CHANNELS 4 |
27 | #define ST_SENSORS_NUMBER_DATA_CHANNELS 3 | ||
28 | #define ST_SENSORS_ENABLE_ALL_AXIS 0x07 | 27 | #define ST_SENSORS_ENABLE_ALL_AXIS 0x07 |
29 | #define ST_SENSORS_BYTE_FOR_CHANNEL 2 | ||
30 | #define ST_SENSORS_SCAN_X 0 | 28 | #define ST_SENSORS_SCAN_X 0 |
31 | #define ST_SENSORS_SCAN_Y 1 | 29 | #define ST_SENSORS_SCAN_Y 1 |
32 | #define ST_SENSORS_SCAN_Z 2 | 30 | #define ST_SENSORS_SCAN_Z 2 |
33 | #define ST_SENSORS_DEFAULT_12_REALBITS 12 | ||
34 | #define ST_SENSORS_DEFAULT_16_REALBITS 16 | ||
35 | #define ST_SENSORS_DEFAULT_POWER_ON_VALUE 0x01 | 31 | #define ST_SENSORS_DEFAULT_POWER_ON_VALUE 0x01 |
36 | #define ST_SENSORS_DEFAULT_POWER_OFF_VALUE 0x00 | 32 | #define ST_SENSORS_DEFAULT_POWER_OFF_VALUE 0x00 |
37 | #define ST_SENSORS_DEFAULT_WAI_ADDRESS 0x0f | 33 | #define ST_SENSORS_DEFAULT_WAI_ADDRESS 0x0f |
@@ -42,20 +38,20 @@ | |||
42 | #define ST_SENSORS_MAX_NAME 17 | 38 | #define ST_SENSORS_MAX_NAME 17 |
43 | #define ST_SENSORS_MAX_4WAI 7 | 39 | #define ST_SENSORS_MAX_4WAI 7 |
44 | 40 | ||
45 | #define ST_SENSORS_LSM_CHANNELS(device_type, index, mod, endian, bits, addr) \ | 41 | #define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \ |
42 | ch2, s, endian, rbits, sbits, addr) \ | ||
46 | { \ | 43 | { \ |
47 | .type = device_type, \ | 44 | .type = device_type, \ |
48 | .modified = 1, \ | 45 | .modified = mod, \ |
49 | .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ | 46 | .info_mask_separate = mask, \ |
50 | BIT(IIO_CHAN_INFO_SCALE), \ | ||
51 | .scan_index = index, \ | 47 | .scan_index = index, \ |
52 | .channel2 = mod, \ | 48 | .channel2 = ch2, \ |
53 | .address = addr, \ | 49 | .address = addr, \ |
54 | .scan_type = { \ | 50 | .scan_type = { \ |
55 | .sign = 's', \ | 51 | .sign = s, \ |
56 | .realbits = bits, \ | 52 | .realbits = rbits, \ |
57 | .shift = 16 - bits, \ | 53 | .shift = sbits - rbits, \ |
58 | .storagebits = 16, \ | 54 | .storagebits = sbits, \ |
59 | .endianness = endian, \ | 55 | .endianness = endian, \ |
60 | }, \ | 56 | }, \ |
61 | } | 57 | } |
@@ -204,6 +200,7 @@ struct st_sensors { | |||
204 | * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread. | 200 | * @multiread_bit: Use or not particular bit for [I2C/SPI] multiread. |
205 | * @buffer_data: Data used by buffer part. | 201 | * @buffer_data: Data used by buffer part. |
206 | * @odr: Output data rate of the sensor [Hz]. | 202 | * @odr: Output data rate of the sensor [Hz]. |
203 | * num_data_channels: Number of data channels used in buffer. | ||
207 | * @get_irq_data_ready: Function to get the IRQ used for data ready signal. | 204 | * @get_irq_data_ready: Function to get the IRQ used for data ready signal. |
208 | * @tf: Transfer function structure used by I/O operations. | 205 | * @tf: Transfer function structure used by I/O operations. |
209 | * @tb: Transfer buffers and mutex used by I/O operations. | 206 | * @tb: Transfer buffers and mutex used by I/O operations. |
@@ -220,6 +217,7 @@ struct st_sensor_data { | |||
220 | char *buffer_data; | 217 | char *buffer_data; |
221 | 218 | ||
222 | unsigned int odr; | 219 | unsigned int odr; |
220 | unsigned int num_data_channels; | ||
223 | 221 | ||
224 | unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev); | 222 | unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev); |
225 | 223 | ||
diff --git a/include/linux/iio/frequency/adf4350.h b/include/linux/iio/frequency/adf4350.h index be91f344d5fc..ffd8c8f90928 100644 --- a/include/linux/iio/frequency/adf4350.h +++ b/include/linux/iio/frequency/adf4350.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * ADF4350/ADF4351 SPI PLL driver | 2 | * ADF4350/ADF4351 SPI PLL driver |
3 | * | 3 | * |
4 | * Copyright 2012 Analog Devices Inc. | 4 | * Copyright 2012-2013 Analog Devices Inc. |
5 | * | 5 | * |
6 | * Licensed under the GPL-2. | 6 | * Licensed under the GPL-2. |
7 | */ | 7 | */ |
@@ -41,7 +41,7 @@ | |||
41 | #define ADF4350_REG2_RDIV2_EN (1 << 24) | 41 | #define ADF4350_REG2_RDIV2_EN (1 << 24) |
42 | #define ADF4350_REG2_RMULT2_EN (1 << 25) | 42 | #define ADF4350_REG2_RMULT2_EN (1 << 25) |
43 | #define ADF4350_REG2_MUXOUT(x) ((x) << 26) | 43 | #define ADF4350_REG2_MUXOUT(x) ((x) << 26) |
44 | #define ADF4350_REG2_NOISE_MODE(x) ((x) << 29) | 44 | #define ADF4350_REG2_NOISE_MODE(x) (((unsigned)(x)) << 29) |
45 | #define ADF4350_MUXOUT_THREESTATE 0 | 45 | #define ADF4350_MUXOUT_THREESTATE 0 |
46 | #define ADF4350_MUXOUT_DVDD 1 | 46 | #define ADF4350_MUXOUT_DVDD 1 |
47 | #define ADF4350_MUXOUT_GND 2 | 47 | #define ADF4350_MUXOUT_GND 2 |
diff --git a/include/linux/ipmi-fru.h b/include/linux/ipmi-fru.h new file mode 100644 index 000000000000..4d3a76380e32 --- /dev/null +++ b/include/linux/ipmi-fru.h | |||
@@ -0,0 +1,135 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 CERN (www.cern.ch) | ||
3 | * Author: Alessandro Rubini <rubini@gnudd.com> | ||
4 | * | ||
5 | * Released according to the GNU GPL, version 2 or any later version. | ||
6 | * | ||
7 | * This work is part of the White Rabbit project, a research effort led | ||
8 | * by CERN, the European Institute for Nuclear Research. | ||
9 | */ | ||
10 | #ifndef __LINUX_IPMI_FRU_H__ | ||
11 | #define __LINUX_IPMI_FRU_H__ | ||
12 | #ifdef __KERNEL__ | ||
13 | # include <linux/types.h> | ||
14 | # include <linux/string.h> | ||
15 | #else | ||
16 | # include <stdint.h> | ||
17 | # include <string.h> | ||
18 | #endif | ||
19 | |||
20 | /* | ||
21 | * These structures match the unaligned crap we have in FRU1011.pdf | ||
22 | * (http://download.intel.com/design/servers/ipmi/FRU1011.pdf) | ||
23 | */ | ||
24 | |||
25 | /* chapter 8, page 5 */ | ||
26 | struct fru_common_header { | ||
27 | uint8_t format; /* 0x01 */ | ||
28 | uint8_t internal_use_off; /* multiple of 8 bytes */ | ||
29 | uint8_t chassis_info_off; /* multiple of 8 bytes */ | ||
30 | uint8_t board_area_off; /* multiple of 8 bytes */ | ||
31 | uint8_t product_area_off; /* multiple of 8 bytes */ | ||
32 | uint8_t multirecord_off; /* multiple of 8 bytes */ | ||
33 | uint8_t pad; /* must be 0 */ | ||
34 | uint8_t checksum; /* sum modulo 256 must be 0 */ | ||
35 | }; | ||
36 | |||
37 | /* chapter 9, page 5 -- internal_use: not used by us */ | ||
38 | |||
39 | /* chapter 10, page 6 -- chassis info: not used by us */ | ||
40 | |||
41 | /* chapter 13, page 9 -- used by board_info_area below */ | ||
42 | struct fru_type_length { | ||
43 | uint8_t type_length; | ||
44 | uint8_t data[0]; | ||
45 | }; | ||
46 | |||
47 | /* chapter 11, page 7 */ | ||
48 | struct fru_board_info_area { | ||
49 | uint8_t format; /* 0x01 */ | ||
50 | uint8_t area_len; /* multiple of 8 bytes */ | ||
51 | uint8_t language; /* I hope it's 0 */ | ||
52 | uint8_t mfg_date[3]; /* LSB, minutes since 1996-01-01 */ | ||
53 | struct fru_type_length tl[0]; /* type-length stuff follows */ | ||
54 | |||
55 | /* | ||
56 | * the TL there are in order: | ||
57 | * Board Manufacturer | ||
58 | * Board Product Name | ||
59 | * Board Serial Number | ||
60 | * Board Part Number | ||
61 | * FRU File ID (may be null) | ||
62 | * more manufacturer-specific stuff | ||
63 | * 0xc1 as a terminator | ||
64 | * 0x00 pad to a multiple of 8 bytes - 1 | ||
65 | * checksum (sum of all stuff module 256 must be zero) | ||
66 | */ | ||
67 | }; | ||
68 | |||
69 | enum fru_type { | ||
70 | FRU_TYPE_BINARY = 0x00, | ||
71 | FRU_TYPE_BCDPLUS = 0x40, | ||
72 | FRU_TYPE_ASCII6 = 0x80, | ||
73 | FRU_TYPE_ASCII = 0xc0, /* not ascii: depends on language */ | ||
74 | }; | ||
75 | |||
76 | /* | ||
77 | * some helpers | ||
78 | */ | ||
79 | static inline struct fru_board_info_area *fru_get_board_area( | ||
80 | const struct fru_common_header *header) | ||
81 | { | ||
82 | /* we know for sure that the header is 8 bytes in size */ | ||
83 | return (struct fru_board_info_area *)(header + header->board_area_off); | ||
84 | } | ||
85 | |||
86 | static inline int fru_type(struct fru_type_length *tl) | ||
87 | { | ||
88 | return tl->type_length & 0xc0; | ||
89 | } | ||
90 | |||
91 | static inline int fru_length(struct fru_type_length *tl) | ||
92 | { | ||
93 | return (tl->type_length & 0x3f) + 1; /* len of whole record */ | ||
94 | } | ||
95 | |||
96 | /* assume ascii-latin1 encoding */ | ||
97 | static inline int fru_strlen(struct fru_type_length *tl) | ||
98 | { | ||
99 | return fru_length(tl) - 1; | ||
100 | } | ||
101 | |||
102 | static inline char *fru_strcpy(char *dest, struct fru_type_length *tl) | ||
103 | { | ||
104 | int len = fru_strlen(tl); | ||
105 | memcpy(dest, tl->data, len); | ||
106 | dest[len] = '\0'; | ||
107 | return dest; | ||
108 | } | ||
109 | |||
110 | static inline struct fru_type_length *fru_next_tl(struct fru_type_length *tl) | ||
111 | { | ||
112 | return tl + fru_length(tl); | ||
113 | } | ||
114 | |||
115 | static inline int fru_is_eof(struct fru_type_length *tl) | ||
116 | { | ||
117 | return tl->type_length == 0xc1; | ||
118 | } | ||
119 | |||
120 | /* | ||
121 | * External functions defined in fru-parse.c. | ||
122 | */ | ||
123 | extern int fru_header_cksum_ok(struct fru_common_header *header); | ||
124 | extern int fru_bia_cksum_ok(struct fru_board_info_area *bia); | ||
125 | |||
126 | /* All these 4 return allocated strings by calling fru_alloc() */ | ||
127 | extern char *fru_get_board_manufacturer(struct fru_common_header *header); | ||
128 | extern char *fru_get_product_name(struct fru_common_header *header); | ||
129 | extern char *fru_get_serial_number(struct fru_common_header *header); | ||
130 | extern char *fru_get_part_number(struct fru_common_header *header); | ||
131 | |||
132 | /* This must be defined by the caller of the above functions */ | ||
133 | extern void *fru_alloc(size_t size); | ||
134 | |||
135 | #endif /* __LINUX_IMPI_FRU_H__ */ | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index bc4e06611958..f04d3ba335cb 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -119,6 +119,7 @@ struct irq_domain; | |||
119 | 119 | ||
120 | /** | 120 | /** |
121 | * struct irq_data - per irq and irq chip data passed down to chip functions | 121 | * struct irq_data - per irq and irq chip data passed down to chip functions |
122 | * @mask: precomputed bitmask for accessing the chip registers | ||
122 | * @irq: interrupt number | 123 | * @irq: interrupt number |
123 | * @hwirq: hardware interrupt number, local to the interrupt domain | 124 | * @hwirq: hardware interrupt number, local to the interrupt domain |
124 | * @node: node index useful for balancing | 125 | * @node: node index useful for balancing |
@@ -138,6 +139,7 @@ struct irq_domain; | |||
138 | * irq_data. | 139 | * irq_data. |
139 | */ | 140 | */ |
140 | struct irq_data { | 141 | struct irq_data { |
142 | u32 mask; | ||
141 | unsigned int irq; | 143 | unsigned int irq; |
142 | unsigned long hwirq; | 144 | unsigned long hwirq; |
143 | unsigned int node; | 145 | unsigned int node; |
@@ -294,6 +296,7 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) | |||
294 | * @irq_suspend: function called from core code on suspend once per chip | 296 | * @irq_suspend: function called from core code on suspend once per chip |
295 | * @irq_resume: function called from core code on resume once per chip | 297 | * @irq_resume: function called from core code on resume once per chip |
296 | * @irq_pm_shutdown: function called from core code on shutdown once per chip | 298 | * @irq_pm_shutdown: function called from core code on shutdown once per chip |
299 | * @irq_calc_mask: Optional function to set irq_data.mask for special cases | ||
297 | * @irq_print_chip: optional to print special chip info in show_interrupts | 300 | * @irq_print_chip: optional to print special chip info in show_interrupts |
298 | * @flags: chip specific flags | 301 | * @flags: chip specific flags |
299 | */ | 302 | */ |
@@ -325,6 +328,8 @@ struct irq_chip { | |||
325 | void (*irq_resume)(struct irq_data *data); | 328 | void (*irq_resume)(struct irq_data *data); |
326 | void (*irq_pm_shutdown)(struct irq_data *data); | 329 | void (*irq_pm_shutdown)(struct irq_data *data); |
327 | 330 | ||
331 | void (*irq_calc_mask)(struct irq_data *data); | ||
332 | |||
328 | void (*irq_print_chip)(struct irq_data *data, struct seq_file *p); | 333 | void (*irq_print_chip)(struct irq_data *data, struct seq_file *p); |
329 | 334 | ||
330 | unsigned long flags; | 335 | unsigned long flags; |
@@ -579,6 +584,12 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d) | |||
579 | return d->msi_desc; | 584 | return d->msi_desc; |
580 | } | 585 | } |
581 | 586 | ||
587 | static inline u32 irq_get_trigger_type(unsigned int irq) | ||
588 | { | ||
589 | struct irq_data *d = irq_get_irq_data(irq); | ||
590 | return d ? irqd_get_trigger_type(d) : 0; | ||
591 | } | ||
592 | |||
582 | int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, | 593 | int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, |
583 | struct module *owner); | 594 | struct module *owner); |
584 | 595 | ||
@@ -644,6 +655,8 @@ struct irq_chip_regs { | |||
644 | * @regs: Register offsets for this chip | 655 | * @regs: Register offsets for this chip |
645 | * @handler: Flow handler associated with this chip | 656 | * @handler: Flow handler associated with this chip |
646 | * @type: Chip can handle these flow types | 657 | * @type: Chip can handle these flow types |
658 | * @mask_cache_priv: Cached mask register private to the chip type | ||
659 | * @mask_cache: Pointer to cached mask register | ||
647 | * | 660 | * |
648 | * A irq_generic_chip can have several instances of irq_chip_type when | 661 | * A irq_generic_chip can have several instances of irq_chip_type when |
649 | * it requires different functions and register offsets for different | 662 | * it requires different functions and register offsets for different |
@@ -654,6 +667,8 @@ struct irq_chip_type { | |||
654 | struct irq_chip_regs regs; | 667 | struct irq_chip_regs regs; |
655 | irq_flow_handler_t handler; | 668 | irq_flow_handler_t handler; |
656 | u32 type; | 669 | u32 type; |
670 | u32 mask_cache_priv; | ||
671 | u32 *mask_cache; | ||
657 | }; | 672 | }; |
658 | 673 | ||
659 | /** | 674 | /** |
@@ -662,13 +677,16 @@ struct irq_chip_type { | |||
662 | * @reg_base: Register base address (virtual) | 677 | * @reg_base: Register base address (virtual) |
663 | * @irq_base: Interrupt base nr for this chip | 678 | * @irq_base: Interrupt base nr for this chip |
664 | * @irq_cnt: Number of interrupts handled by this chip | 679 | * @irq_cnt: Number of interrupts handled by this chip |
665 | * @mask_cache: Cached mask register | 680 | * @mask_cache: Cached mask register shared between all chip types |
666 | * @type_cache: Cached type register | 681 | * @type_cache: Cached type register |
667 | * @polarity_cache: Cached polarity register | 682 | * @polarity_cache: Cached polarity register |
668 | * @wake_enabled: Interrupt can wakeup from suspend | 683 | * @wake_enabled: Interrupt can wakeup from suspend |
669 | * @wake_active: Interrupt is marked as an wakeup from suspend source | 684 | * @wake_active: Interrupt is marked as an wakeup from suspend source |
670 | * @num_ct: Number of available irq_chip_type instances (usually 1) | 685 | * @num_ct: Number of available irq_chip_type instances (usually 1) |
671 | * @private: Private data for non generic chip callbacks | 686 | * @private: Private data for non generic chip callbacks |
687 | * @installed: bitfield to denote installed interrupts | ||
688 | * @unused: bitfield to denote unused interrupts | ||
689 | * @domain: irq domain pointer | ||
672 | * @list: List head for keeping track of instances | 690 | * @list: List head for keeping track of instances |
673 | * @chip_types: Array of interrupt irq_chip_types | 691 | * @chip_types: Array of interrupt irq_chip_types |
674 | * | 692 | * |
@@ -690,6 +708,9 @@ struct irq_chip_generic { | |||
690 | u32 wake_active; | 708 | u32 wake_active; |
691 | unsigned int num_ct; | 709 | unsigned int num_ct; |
692 | void *private; | 710 | void *private; |
711 | unsigned long installed; | ||
712 | unsigned long unused; | ||
713 | struct irq_domain *domain; | ||
693 | struct list_head list; | 714 | struct list_head list; |
694 | struct irq_chip_type chip_types[0]; | 715 | struct irq_chip_type chip_types[0]; |
695 | }; | 716 | }; |
@@ -700,10 +721,32 @@ struct irq_chip_generic { | |||
700 | * @IRQ_GC_INIT_NESTED_LOCK: Set the lock class of the irqs to nested for | 721 | * @IRQ_GC_INIT_NESTED_LOCK: Set the lock class of the irqs to nested for |
701 | * irq chips which need to call irq_set_wake() on | 722 | * irq chips which need to call irq_set_wake() on |
702 | * the parent irq. Usually GPIO implementations | 723 | * the parent irq. Usually GPIO implementations |
724 | * @IRQ_GC_MASK_CACHE_PER_TYPE: Mask cache is chip type private | ||
725 | * @IRQ_GC_NO_MASK: Do not calculate irq_data->mask | ||
703 | */ | 726 | */ |
704 | enum irq_gc_flags { | 727 | enum irq_gc_flags { |
705 | IRQ_GC_INIT_MASK_CACHE = 1 << 0, | 728 | IRQ_GC_INIT_MASK_CACHE = 1 << 0, |
706 | IRQ_GC_INIT_NESTED_LOCK = 1 << 1, | 729 | IRQ_GC_INIT_NESTED_LOCK = 1 << 1, |
730 | IRQ_GC_MASK_CACHE_PER_TYPE = 1 << 2, | ||
731 | IRQ_GC_NO_MASK = 1 << 3, | ||
732 | }; | ||
733 | |||
734 | /* | ||
735 | * struct irq_domain_chip_generic - Generic irq chip data structure for irq domains | ||
736 | * @irqs_per_chip: Number of interrupts per chip | ||
737 | * @num_chips: Number of chips | ||
738 | * @irq_flags_to_set: IRQ* flags to set on irq setup | ||
739 | * @irq_flags_to_clear: IRQ* flags to clear on irq setup | ||
740 | * @gc_flags: Generic chip specific setup flags | ||
741 | * @gc: Array of pointers to generic interrupt chips | ||
742 | */ | ||
743 | struct irq_domain_chip_generic { | ||
744 | unsigned int irqs_per_chip; | ||
745 | unsigned int num_chips; | ||
746 | unsigned int irq_flags_to_clear; | ||
747 | unsigned int irq_flags_to_set; | ||
748 | enum irq_gc_flags gc_flags; | ||
749 | struct irq_chip_generic *gc[0]; | ||
707 | }; | 750 | }; |
708 | 751 | ||
709 | /* Generic chip callback functions */ | 752 | /* Generic chip callback functions */ |
@@ -729,6 +772,14 @@ int irq_setup_alt_chip(struct irq_data *d, unsigned int type); | |||
729 | void irq_remove_generic_chip(struct irq_chip_generic *gc, u32 msk, | 772 | void irq_remove_generic_chip(struct irq_chip_generic *gc, u32 msk, |
730 | unsigned int clr, unsigned int set); | 773 | unsigned int clr, unsigned int set); |
731 | 774 | ||
775 | struct irq_chip_generic *irq_get_domain_generic_chip(struct irq_domain *d, unsigned int hw_irq); | ||
776 | int irq_alloc_domain_generic_chips(struct irq_domain *d, int irqs_per_chip, | ||
777 | int num_ct, const char *name, | ||
778 | irq_flow_handler_t handler, | ||
779 | unsigned int clr, unsigned int set, | ||
780 | enum irq_gc_flags flags); | ||
781 | |||
782 | |||
732 | static inline struct irq_chip_type *irq_data_get_chip_type(struct irq_data *d) | 783 | static inline struct irq_chip_type *irq_data_get_chip_type(struct irq_data *d) |
733 | { | 784 | { |
734 | return container_of(d->chip, struct irq_chip_type, chip); | 785 | return container_of(d->chip, struct irq_chip_type, chip); |
diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h index e0006f1d35a0..14d79131f53d 100644 --- a/include/linux/irqchip.h +++ b/include/linux/irqchip.h | |||
@@ -11,6 +11,10 @@ | |||
11 | #ifndef _LINUX_IRQCHIP_H | 11 | #ifndef _LINUX_IRQCHIP_H |
12 | #define _LINUX_IRQCHIP_H | 12 | #define _LINUX_IRQCHIP_H |
13 | 13 | ||
14 | #ifdef CONFIG_IRQCHIP | ||
14 | void irqchip_init(void); | 15 | void irqchip_init(void); |
16 | #else | ||
17 | static inline void irqchip_init(void) {} | ||
18 | #endif | ||
15 | 19 | ||
16 | #endif | 20 | #endif |
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 0d5b17bf5e51..ba2c708adcff 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h | |||
@@ -66,6 +66,10 @@ struct irq_domain_ops { | |||
66 | unsigned long *out_hwirq, unsigned int *out_type); | 66 | unsigned long *out_hwirq, unsigned int *out_type); |
67 | }; | 67 | }; |
68 | 68 | ||
69 | extern struct irq_domain_ops irq_generic_chip_ops; | ||
70 | |||
71 | struct irq_domain_chip_generic; | ||
72 | |||
69 | /** | 73 | /** |
70 | * struct irq_domain - Hardware interrupt number translation object | 74 | * struct irq_domain - Hardware interrupt number translation object |
71 | * @link: Element in global irq_domain list. | 75 | * @link: Element in global irq_domain list. |
@@ -109,8 +113,16 @@ struct irq_domain { | |||
109 | 113 | ||
110 | /* Optional device node pointer */ | 114 | /* Optional device node pointer */ |
111 | struct device_node *of_node; | 115 | struct device_node *of_node; |
116 | /* Optional pointer to generic interrupt chips */ | ||
117 | struct irq_domain_chip_generic *gc; | ||
112 | }; | 118 | }; |
113 | 119 | ||
120 | #define IRQ_DOMAIN_MAP_LEGACY 0 /* driver allocated fixed range of irqs. | ||
121 | * ie. legacy 8259, gets irqs 1..15 */ | ||
122 | #define IRQ_DOMAIN_MAP_NOMAP 1 /* no fast reverse mapping */ | ||
123 | #define IRQ_DOMAIN_MAP_LINEAR 2 /* linear map of interrupts */ | ||
124 | #define IRQ_DOMAIN_MAP_TREE 3 /* radix tree */ | ||
125 | |||
114 | #ifdef CONFIG_IRQ_DOMAIN | 126 | #ifdef CONFIG_IRQ_DOMAIN |
115 | struct irq_domain *irq_domain_add_simple(struct device_node *of_node, | 127 | struct irq_domain *irq_domain_add_simple(struct device_node *of_node, |
116 | unsigned int size, | 128 | unsigned int size, |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 7e0b622503c4..8685d1be12c7 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/buffer_head.h> | 27 | #include <linux/buffer_head.h> |
28 | #include <linux/journal-head.h> | 28 | #include <linux/journal-head.h> |
29 | #include <linux/stddef.h> | 29 | #include <linux/stddef.h> |
30 | #include <linux/bit_spinlock.h> | ||
31 | #include <linux/mutex.h> | 30 | #include <linux/mutex.h> |
32 | #include <linux/timer.h> | 31 | #include <linux/timer.h> |
33 | #include <linux/lockdep.h> | 32 | #include <linux/lockdep.h> |
@@ -244,6 +243,31 @@ typedef struct journal_superblock_s | |||
244 | 243 | ||
245 | #include <linux/fs.h> | 244 | #include <linux/fs.h> |
246 | #include <linux/sched.h> | 245 | #include <linux/sched.h> |
246 | |||
247 | enum jbd_state_bits { | ||
248 | BH_JBD /* Has an attached ext3 journal_head */ | ||
249 | = BH_PrivateStart, | ||
250 | BH_JWrite, /* Being written to log (@@@ DEBUGGING) */ | ||
251 | BH_Freed, /* Has been freed (truncated) */ | ||
252 | BH_Revoked, /* Has been revoked from the log */ | ||
253 | BH_RevokeValid, /* Revoked flag is valid */ | ||
254 | BH_JBDDirty, /* Is dirty but journaled */ | ||
255 | BH_State, /* Pins most journal_head state */ | ||
256 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | ||
257 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ | ||
258 | BH_JBDPrivateStart, /* First bit available for private use by FS */ | ||
259 | }; | ||
260 | |||
261 | BUFFER_FNS(JBD, jbd) | ||
262 | BUFFER_FNS(JWrite, jwrite) | ||
263 | BUFFER_FNS(JBDDirty, jbddirty) | ||
264 | TAS_BUFFER_FNS(JBDDirty, jbddirty) | ||
265 | BUFFER_FNS(Revoked, revoked) | ||
266 | TAS_BUFFER_FNS(Revoked, revoked) | ||
267 | BUFFER_FNS(RevokeValid, revokevalid) | ||
268 | TAS_BUFFER_FNS(RevokeValid, revokevalid) | ||
269 | BUFFER_FNS(Freed, freed) | ||
270 | |||
247 | #include <linux/jbd_common.h> | 271 | #include <linux/jbd_common.h> |
248 | 272 | ||
249 | #define J_ASSERT(assert) BUG_ON(!(assert)) | 273 | #define J_ASSERT(assert) BUG_ON(!(assert)) |
@@ -840,7 +864,7 @@ extern void journal_release_buffer (handle_t *, struct buffer_head *); | |||
840 | extern int journal_forget (handle_t *, struct buffer_head *); | 864 | extern int journal_forget (handle_t *, struct buffer_head *); |
841 | extern void journal_sync_buffer (struct buffer_head *); | 865 | extern void journal_sync_buffer (struct buffer_head *); |
842 | extern void journal_invalidatepage(journal_t *, | 866 | extern void journal_invalidatepage(journal_t *, |
843 | struct page *, unsigned long); | 867 | struct page *, unsigned int, unsigned int); |
844 | extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); | 868 | extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); |
845 | extern int journal_stop(handle_t *); | 869 | extern int journal_stop(handle_t *); |
846 | extern int journal_flush (journal_t *); | 870 | extern int journal_flush (journal_t *); |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 6e051f472edb..d5b50a19463c 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/buffer_head.h> | 26 | #include <linux/buffer_head.h> |
27 | #include <linux/journal-head.h> | 27 | #include <linux/journal-head.h> |
28 | #include <linux/stddef.h> | 28 | #include <linux/stddef.h> |
29 | #include <linux/bit_spinlock.h> | ||
30 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
31 | #include <linux/timer.h> | 30 | #include <linux/timer.h> |
32 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
@@ -57,17 +56,13 @@ | |||
57 | */ | 56 | */ |
58 | #define JBD2_EXPENSIVE_CHECKING | 57 | #define JBD2_EXPENSIVE_CHECKING |
59 | extern ushort jbd2_journal_enable_debug; | 58 | extern ushort jbd2_journal_enable_debug; |
59 | void __jbd2_debug(int level, const char *file, const char *func, | ||
60 | unsigned int line, const char *fmt, ...); | ||
60 | 61 | ||
61 | #define jbd_debug(n, f, a...) \ | 62 | #define jbd_debug(n, fmt, a...) \ |
62 | do { \ | 63 | __jbd2_debug((n), __FILE__, __func__, __LINE__, (fmt), ##a) |
63 | if ((n) <= jbd2_journal_enable_debug) { \ | ||
64 | printk (KERN_DEBUG "(%s, %d): %s: ", \ | ||
65 | __FILE__, __LINE__, __func__); \ | ||
66 | printk (f, ## a); \ | ||
67 | } \ | ||
68 | } while (0) | ||
69 | #else | 64 | #else |
70 | #define jbd_debug(f, a...) /**/ | 65 | #define jbd_debug(n, fmt, a...) /**/ |
71 | #endif | 66 | #endif |
72 | 67 | ||
73 | extern void *jbd2_alloc(size_t size, gfp_t flags); | 68 | extern void *jbd2_alloc(size_t size, gfp_t flags); |
@@ -302,6 +297,34 @@ typedef struct journal_superblock_s | |||
302 | 297 | ||
303 | #include <linux/fs.h> | 298 | #include <linux/fs.h> |
304 | #include <linux/sched.h> | 299 | #include <linux/sched.h> |
300 | |||
301 | enum jbd_state_bits { | ||
302 | BH_JBD /* Has an attached ext3 journal_head */ | ||
303 | = BH_PrivateStart, | ||
304 | BH_JWrite, /* Being written to log (@@@ DEBUGGING) */ | ||
305 | BH_Freed, /* Has been freed (truncated) */ | ||
306 | BH_Revoked, /* Has been revoked from the log */ | ||
307 | BH_RevokeValid, /* Revoked flag is valid */ | ||
308 | BH_JBDDirty, /* Is dirty but journaled */ | ||
309 | BH_State, /* Pins most journal_head state */ | ||
310 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | ||
311 | BH_Shadow, /* IO on shadow buffer is running */ | ||
312 | BH_Verified, /* Metadata block has been verified ok */ | ||
313 | BH_JBDPrivateStart, /* First bit available for private use by FS */ | ||
314 | }; | ||
315 | |||
316 | BUFFER_FNS(JBD, jbd) | ||
317 | BUFFER_FNS(JWrite, jwrite) | ||
318 | BUFFER_FNS(JBDDirty, jbddirty) | ||
319 | TAS_BUFFER_FNS(JBDDirty, jbddirty) | ||
320 | BUFFER_FNS(Revoked, revoked) | ||
321 | TAS_BUFFER_FNS(Revoked, revoked) | ||
322 | BUFFER_FNS(RevokeValid, revokevalid) | ||
323 | TAS_BUFFER_FNS(RevokeValid, revokevalid) | ||
324 | BUFFER_FNS(Freed, freed) | ||
325 | BUFFER_FNS(Shadow, shadow) | ||
326 | BUFFER_FNS(Verified, verified) | ||
327 | |||
305 | #include <linux/jbd_common.h> | 328 | #include <linux/jbd_common.h> |
306 | 329 | ||
307 | #define J_ASSERT(assert) BUG_ON(!(assert)) | 330 | #define J_ASSERT(assert) BUG_ON(!(assert)) |
@@ -382,8 +405,15 @@ struct jbd2_revoke_table_s; | |||
382 | 405 | ||
383 | struct jbd2_journal_handle | 406 | struct jbd2_journal_handle |
384 | { | 407 | { |
385 | /* Which compound transaction is this update a part of? */ | 408 | union { |
386 | transaction_t *h_transaction; | 409 | /* Which compound transaction is this update a part of? */ |
410 | transaction_t *h_transaction; | ||
411 | /* Which journal handle belongs to - used iff h_reserved set */ | ||
412 | journal_t *h_journal; | ||
413 | }; | ||
414 | |||
415 | /* Handle reserved for finishing the logical operation */ | ||
416 | handle_t *h_rsv_handle; | ||
387 | 417 | ||
388 | /* Number of remaining buffers we are allowed to dirty: */ | 418 | /* Number of remaining buffers we are allowed to dirty: */ |
389 | int h_buffer_credits; | 419 | int h_buffer_credits; |
@@ -398,6 +428,7 @@ struct jbd2_journal_handle | |||
398 | /* Flags [no locking] */ | 428 | /* Flags [no locking] */ |
399 | unsigned int h_sync: 1; /* sync-on-close */ | 429 | unsigned int h_sync: 1; /* sync-on-close */ |
400 | unsigned int h_jdata: 1; /* force data journaling */ | 430 | unsigned int h_jdata: 1; /* force data journaling */ |
431 | unsigned int h_reserved: 1; /* handle with reserved credits */ | ||
401 | unsigned int h_aborted: 1; /* fatal error on handle */ | 432 | unsigned int h_aborted: 1; /* fatal error on handle */ |
402 | unsigned int h_type: 8; /* for handle statistics */ | 433 | unsigned int h_type: 8; /* for handle statistics */ |
403 | unsigned int h_line_no: 16; /* for handle statistics */ | 434 | unsigned int h_line_no: 16; /* for handle statistics */ |
@@ -524,12 +555,6 @@ struct transaction_s | |||
524 | struct journal_head *t_checkpoint_io_list; | 555 | struct journal_head *t_checkpoint_io_list; |
525 | 556 | ||
526 | /* | 557 | /* |
527 | * Doubly-linked circular list of temporary buffers currently undergoing | ||
528 | * IO in the log [j_list_lock] | ||
529 | */ | ||
530 | struct journal_head *t_iobuf_list; | ||
531 | |||
532 | /* | ||
533 | * Doubly-linked circular list of metadata buffers being shadowed by log | 558 | * Doubly-linked circular list of metadata buffers being shadowed by log |
534 | * IO. The IO buffers on the iobuf list and the shadow buffers on this | 559 | * IO. The IO buffers on the iobuf list and the shadow buffers on this |
535 | * list match each other one for one at all times. [j_list_lock] | 560 | * list match each other one for one at all times. [j_list_lock] |
@@ -537,12 +562,6 @@ struct transaction_s | |||
537 | struct journal_head *t_shadow_list; | 562 | struct journal_head *t_shadow_list; |
538 | 563 | ||
539 | /* | 564 | /* |
540 | * Doubly-linked circular list of control buffers being written to the | ||
541 | * log. [j_list_lock] | ||
542 | */ | ||
543 | struct journal_head *t_log_list; | ||
544 | |||
545 | /* | ||
546 | * List of inodes whose data we've modified in data=ordered mode. | 565 | * List of inodes whose data we've modified in data=ordered mode. |
547 | * [j_list_lock] | 566 | * [j_list_lock] |
548 | */ | 567 | */ |
@@ -671,11 +690,10 @@ jbd2_time_diff(unsigned long start, unsigned long end) | |||
671 | * waiting for checkpointing | 690 | * waiting for checkpointing |
672 | * @j_wait_transaction_locked: Wait queue for waiting for a locked transaction | 691 | * @j_wait_transaction_locked: Wait queue for waiting for a locked transaction |
673 | * to start committing, or for a barrier lock to be released | 692 | * to start committing, or for a barrier lock to be released |
674 | * @j_wait_logspace: Wait queue for waiting for checkpointing to complete | ||
675 | * @j_wait_done_commit: Wait queue for waiting for commit to complete | 693 | * @j_wait_done_commit: Wait queue for waiting for commit to complete |
676 | * @j_wait_checkpoint: Wait queue to trigger checkpointing | ||
677 | * @j_wait_commit: Wait queue to trigger commit | 694 | * @j_wait_commit: Wait queue to trigger commit |
678 | * @j_wait_updates: Wait queue to wait for updates to complete | 695 | * @j_wait_updates: Wait queue to wait for updates to complete |
696 | * @j_wait_reserved: Wait queue to wait for reserved buffer credits to drop | ||
679 | * @j_checkpoint_mutex: Mutex for locking against concurrent checkpoints | 697 | * @j_checkpoint_mutex: Mutex for locking against concurrent checkpoints |
680 | * @j_head: Journal head - identifies the first unused block in the journal | 698 | * @j_head: Journal head - identifies the first unused block in the journal |
681 | * @j_tail: Journal tail - identifies the oldest still-used block in the | 699 | * @j_tail: Journal tail - identifies the oldest still-used block in the |
@@ -689,6 +707,7 @@ jbd2_time_diff(unsigned long start, unsigned long end) | |||
689 | * journal | 707 | * journal |
690 | * @j_fs_dev: Device which holds the client fs. For internal journal this will | 708 | * @j_fs_dev: Device which holds the client fs. For internal journal this will |
691 | * be equal to j_dev | 709 | * be equal to j_dev |
710 | * @j_reserved_credits: Number of buffers reserved from the running transaction | ||
692 | * @j_maxlen: Total maximum capacity of the journal region on disk. | 711 | * @j_maxlen: Total maximum capacity of the journal region on disk. |
693 | * @j_list_lock: Protects the buffer lists and internal buffer state. | 712 | * @j_list_lock: Protects the buffer lists and internal buffer state. |
694 | * @j_inode: Optional inode where we store the journal. If present, all journal | 713 | * @j_inode: Optional inode where we store the journal. If present, all journal |
@@ -778,21 +797,18 @@ struct journal_s | |||
778 | */ | 797 | */ |
779 | wait_queue_head_t j_wait_transaction_locked; | 798 | wait_queue_head_t j_wait_transaction_locked; |
780 | 799 | ||
781 | /* Wait queue for waiting for checkpointing to complete */ | ||
782 | wait_queue_head_t j_wait_logspace; | ||
783 | |||
784 | /* Wait queue for waiting for commit to complete */ | 800 | /* Wait queue for waiting for commit to complete */ |
785 | wait_queue_head_t j_wait_done_commit; | 801 | wait_queue_head_t j_wait_done_commit; |
786 | 802 | ||
787 | /* Wait queue to trigger checkpointing */ | ||
788 | wait_queue_head_t j_wait_checkpoint; | ||
789 | |||
790 | /* Wait queue to trigger commit */ | 803 | /* Wait queue to trigger commit */ |
791 | wait_queue_head_t j_wait_commit; | 804 | wait_queue_head_t j_wait_commit; |
792 | 805 | ||
793 | /* Wait queue to wait for updates to complete */ | 806 | /* Wait queue to wait for updates to complete */ |
794 | wait_queue_head_t j_wait_updates; | 807 | wait_queue_head_t j_wait_updates; |
795 | 808 | ||
809 | /* Wait queue to wait for reserved buffer credits to drop */ | ||
810 | wait_queue_head_t j_wait_reserved; | ||
811 | |||
796 | /* Semaphore for locking against concurrent checkpoints */ | 812 | /* Semaphore for locking against concurrent checkpoints */ |
797 | struct mutex j_checkpoint_mutex; | 813 | struct mutex j_checkpoint_mutex; |
798 | 814 | ||
@@ -847,6 +863,9 @@ struct journal_s | |||
847 | /* Total maximum capacity of the journal region on disk. */ | 863 | /* Total maximum capacity of the journal region on disk. */ |
848 | unsigned int j_maxlen; | 864 | unsigned int j_maxlen; |
849 | 865 | ||
866 | /* Number of buffers reserved from the running transaction */ | ||
867 | atomic_t j_reserved_credits; | ||
868 | |||
850 | /* | 869 | /* |
851 | * Protects the buffer lists and internal buffer state. | 870 | * Protects the buffer lists and internal buffer state. |
852 | */ | 871 | */ |
@@ -991,9 +1010,17 @@ extern void __jbd2_journal_file_buffer(struct journal_head *, transaction_t *, i | |||
991 | extern void __journal_free_buffer(struct journal_head *bh); | 1010 | extern void __journal_free_buffer(struct journal_head *bh); |
992 | extern void jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int); | 1011 | extern void jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int); |
993 | extern void __journal_clean_data_list(transaction_t *transaction); | 1012 | extern void __journal_clean_data_list(transaction_t *transaction); |
1013 | static inline void jbd2_file_log_bh(struct list_head *head, struct buffer_head *bh) | ||
1014 | { | ||
1015 | list_add_tail(&bh->b_assoc_buffers, head); | ||
1016 | } | ||
1017 | static inline void jbd2_unfile_log_bh(struct buffer_head *bh) | ||
1018 | { | ||
1019 | list_del_init(&bh->b_assoc_buffers); | ||
1020 | } | ||
994 | 1021 | ||
995 | /* Log buffer allocation */ | 1022 | /* Log buffer allocation */ |
996 | extern struct journal_head * jbd2_journal_get_descriptor_buffer(journal_t *); | 1023 | struct buffer_head *jbd2_journal_get_descriptor_buffer(journal_t *journal); |
997 | int jbd2_journal_next_log_block(journal_t *, unsigned long long *); | 1024 | int jbd2_journal_next_log_block(journal_t *, unsigned long long *); |
998 | int jbd2_journal_get_log_tail(journal_t *journal, tid_t *tid, | 1025 | int jbd2_journal_get_log_tail(journal_t *journal, tid_t *tid, |
999 | unsigned long *block); | 1026 | unsigned long *block); |
@@ -1039,11 +1066,10 @@ extern void jbd2_buffer_abort_trigger(struct journal_head *jh, | |||
1039 | struct jbd2_buffer_trigger_type *triggers); | 1066 | struct jbd2_buffer_trigger_type *triggers); |
1040 | 1067 | ||
1041 | /* Buffer IO */ | 1068 | /* Buffer IO */ |
1042 | extern int | 1069 | extern int jbd2_journal_write_metadata_buffer(transaction_t *transaction, |
1043 | jbd2_journal_write_metadata_buffer(transaction_t *transaction, | 1070 | struct journal_head *jh_in, |
1044 | struct journal_head *jh_in, | 1071 | struct buffer_head **bh_out, |
1045 | struct journal_head **jh_out, | 1072 | sector_t blocknr); |
1046 | unsigned long long blocknr); | ||
1047 | 1073 | ||
1048 | /* Transaction locking */ | 1074 | /* Transaction locking */ |
1049 | extern void __wait_on_journal (journal_t *); | 1075 | extern void __wait_on_journal (journal_t *); |
@@ -1076,10 +1102,14 @@ static inline handle_t *journal_current_handle(void) | |||
1076 | */ | 1102 | */ |
1077 | 1103 | ||
1078 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); | 1104 | extern handle_t *jbd2_journal_start(journal_t *, int nblocks); |
1079 | extern handle_t *jbd2__journal_start(journal_t *, int nblocks, gfp_t gfp_mask, | 1105 | extern handle_t *jbd2__journal_start(journal_t *, int blocks, int rsv_blocks, |
1080 | unsigned int type, unsigned int line_no); | 1106 | gfp_t gfp_mask, unsigned int type, |
1107 | unsigned int line_no); | ||
1081 | extern int jbd2_journal_restart(handle_t *, int nblocks); | 1108 | extern int jbd2_journal_restart(handle_t *, int nblocks); |
1082 | extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask); | 1109 | extern int jbd2__journal_restart(handle_t *, int nblocks, gfp_t gfp_mask); |
1110 | extern int jbd2_journal_start_reserved(handle_t *handle, | ||
1111 | unsigned int type, unsigned int line_no); | ||
1112 | extern void jbd2_journal_free_reserved(handle_t *handle); | ||
1083 | extern int jbd2_journal_extend (handle_t *, int nblocks); | 1113 | extern int jbd2_journal_extend (handle_t *, int nblocks); |
1084 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); | 1114 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); |
1085 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); | 1115 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); |
@@ -1090,7 +1120,7 @@ extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *); | |||
1090 | extern int jbd2_journal_forget (handle_t *, struct buffer_head *); | 1120 | extern int jbd2_journal_forget (handle_t *, struct buffer_head *); |
1091 | extern void journal_sync_buffer (struct buffer_head *); | 1121 | extern void journal_sync_buffer (struct buffer_head *); |
1092 | extern int jbd2_journal_invalidatepage(journal_t *, | 1122 | extern int jbd2_journal_invalidatepage(journal_t *, |
1093 | struct page *, unsigned long); | 1123 | struct page *, unsigned int, unsigned int); |
1094 | extern int jbd2_journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); | 1124 | extern int jbd2_journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); |
1095 | extern int jbd2_journal_stop(handle_t *); | 1125 | extern int jbd2_journal_stop(handle_t *); |
1096 | extern int jbd2_journal_flush (journal_t *); | 1126 | extern int jbd2_journal_flush (journal_t *); |
@@ -1125,6 +1155,7 @@ extern void jbd2_journal_ack_err (journal_t *); | |||
1125 | extern int jbd2_journal_clear_err (journal_t *); | 1155 | extern int jbd2_journal_clear_err (journal_t *); |
1126 | extern int jbd2_journal_bmap(journal_t *, unsigned long, unsigned long long *); | 1156 | extern int jbd2_journal_bmap(journal_t *, unsigned long, unsigned long long *); |
1127 | extern int jbd2_journal_force_commit(journal_t *); | 1157 | extern int jbd2_journal_force_commit(journal_t *); |
1158 | extern int jbd2_journal_force_commit_nested(journal_t *); | ||
1128 | extern int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *inode); | 1159 | extern int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *inode); |
1129 | extern int jbd2_journal_begin_ordered_truncate(journal_t *journal, | 1160 | extern int jbd2_journal_begin_ordered_truncate(journal_t *journal, |
1130 | struct jbd2_inode *inode, loff_t new_size); | 1161 | struct jbd2_inode *inode, loff_t new_size); |
@@ -1178,8 +1209,10 @@ extern int jbd2_journal_init_revoke_caches(void); | |||
1178 | extern void jbd2_journal_destroy_revoke(journal_t *); | 1209 | extern void jbd2_journal_destroy_revoke(journal_t *); |
1179 | extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *); | 1210 | extern int jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *); |
1180 | extern int jbd2_journal_cancel_revoke(handle_t *, struct journal_head *); | 1211 | extern int jbd2_journal_cancel_revoke(handle_t *, struct journal_head *); |
1181 | extern void jbd2_journal_write_revoke_records(journal_t *, | 1212 | extern void jbd2_journal_write_revoke_records(journal_t *journal, |
1182 | transaction_t *, int); | 1213 | transaction_t *transaction, |
1214 | struct list_head *log_bufs, | ||
1215 | int write_op); | ||
1183 | 1216 | ||
1184 | /* Recovery revoke support */ | 1217 | /* Recovery revoke support */ |
1185 | extern int jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t); | 1218 | extern int jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t); |
@@ -1195,11 +1228,9 @@ extern void jbd2_clear_buffer_revoked_flags(journal_t *journal); | |||
1195 | * transitions on demand. | 1228 | * transitions on demand. |
1196 | */ | 1229 | */ |
1197 | 1230 | ||
1198 | int __jbd2_log_space_left(journal_t *); /* Called with journal locked */ | ||
1199 | int jbd2_log_start_commit(journal_t *journal, tid_t tid); | 1231 | int jbd2_log_start_commit(journal_t *journal, tid_t tid); |
1200 | int __jbd2_log_start_commit(journal_t *journal, tid_t tid); | 1232 | int __jbd2_log_start_commit(journal_t *journal, tid_t tid); |
1201 | int jbd2_journal_start_commit(journal_t *journal, tid_t *tid); | 1233 | int jbd2_journal_start_commit(journal_t *journal, tid_t *tid); |
1202 | int jbd2_journal_force_commit_nested(journal_t *journal); | ||
1203 | int jbd2_log_wait_commit(journal_t *journal, tid_t tid); | 1234 | int jbd2_log_wait_commit(journal_t *journal, tid_t tid); |
1204 | int jbd2_complete_transaction(journal_t *journal, tid_t tid); | 1235 | int jbd2_complete_transaction(journal_t *journal, tid_t tid); |
1205 | int jbd2_log_do_checkpoint(journal_t *journal); | 1236 | int jbd2_log_do_checkpoint(journal_t *journal); |
@@ -1235,7 +1266,7 @@ static inline int is_journal_aborted(journal_t *journal) | |||
1235 | 1266 | ||
1236 | static inline int is_handle_aborted(handle_t *handle) | 1267 | static inline int is_handle_aborted(handle_t *handle) |
1237 | { | 1268 | { |
1238 | if (handle->h_aborted) | 1269 | if (handle->h_aborted || !handle->h_transaction) |
1239 | return 1; | 1270 | return 1; |
1240 | return is_journal_aborted(handle->h_transaction->t_journal); | 1271 | return is_journal_aborted(handle->h_transaction->t_journal); |
1241 | } | 1272 | } |
@@ -1266,16 +1297,37 @@ extern int jbd2_journal_blocks_per_page(struct inode *inode); | |||
1266 | extern size_t journal_tag_bytes(journal_t *journal); | 1297 | extern size_t journal_tag_bytes(journal_t *journal); |
1267 | 1298 | ||
1268 | /* | 1299 | /* |
1300 | * We reserve t_outstanding_credits >> JBD2_CONTROL_BLOCKS_SHIFT for | ||
1301 | * transaction control blocks. | ||
1302 | */ | ||
1303 | #define JBD2_CONTROL_BLOCKS_SHIFT 5 | ||
1304 | |||
1305 | /* | ||
1269 | * Return the minimum number of blocks which must be free in the journal | 1306 | * Return the minimum number of blocks which must be free in the journal |
1270 | * before a new transaction may be started. Must be called under j_state_lock. | 1307 | * before a new transaction may be started. Must be called under j_state_lock. |
1271 | */ | 1308 | */ |
1272 | static inline int jbd_space_needed(journal_t *journal) | 1309 | static inline int jbd2_space_needed(journal_t *journal) |
1273 | { | 1310 | { |
1274 | int nblocks = journal->j_max_transaction_buffers; | 1311 | int nblocks = journal->j_max_transaction_buffers; |
1275 | if (journal->j_committing_transaction) | 1312 | return nblocks + (nblocks >> JBD2_CONTROL_BLOCKS_SHIFT); |
1276 | nblocks += atomic_read(&journal->j_committing_transaction-> | 1313 | } |
1277 | t_outstanding_credits); | 1314 | |
1278 | return nblocks; | 1315 | /* |
1316 | * Return number of free blocks in the log. Must be called under j_state_lock. | ||
1317 | */ | ||
1318 | static inline unsigned long jbd2_log_space_left(journal_t *journal) | ||
1319 | { | ||
1320 | /* Allow for rounding errors */ | ||
1321 | unsigned long free = journal->j_free - 32; | ||
1322 | |||
1323 | if (journal->j_committing_transaction) { | ||
1324 | unsigned long committing = atomic_read(&journal-> | ||
1325 | j_committing_transaction->t_outstanding_credits); | ||
1326 | |||
1327 | /* Transaction + control blocks */ | ||
1328 | free -= committing + (committing >> JBD2_CONTROL_BLOCKS_SHIFT); | ||
1329 | } | ||
1330 | return free; | ||
1279 | } | 1331 | } |
1280 | 1332 | ||
1281 | /* | 1333 | /* |
@@ -1286,11 +1338,9 @@ static inline int jbd_space_needed(journal_t *journal) | |||
1286 | #define BJ_None 0 /* Not journaled */ | 1338 | #define BJ_None 0 /* Not journaled */ |
1287 | #define BJ_Metadata 1 /* Normal journaled metadata */ | 1339 | #define BJ_Metadata 1 /* Normal journaled metadata */ |
1288 | #define BJ_Forget 2 /* Buffer superseded by this transaction */ | 1340 | #define BJ_Forget 2 /* Buffer superseded by this transaction */ |
1289 | #define BJ_IO 3 /* Buffer is for temporary IO use */ | 1341 | #define BJ_Shadow 3 /* Buffer contents being shadowed to the log */ |
1290 | #define BJ_Shadow 4 /* Buffer contents being shadowed to the log */ | 1342 | #define BJ_Reserved 4 /* Buffer is reserved for access by journal */ |
1291 | #define BJ_LogCtl 5 /* Buffer contains log descriptors */ | 1343 | #define BJ_Types 5 |
1292 | #define BJ_Reserved 6 /* Buffer is reserved for access by journal */ | ||
1293 | #define BJ_Types 7 | ||
1294 | 1344 | ||
1295 | extern int jbd_blocks_per_page(struct inode *inode); | 1345 | extern int jbd_blocks_per_page(struct inode *inode); |
1296 | 1346 | ||
@@ -1319,6 +1369,19 @@ static inline u32 jbd2_chksum(journal_t *journal, u32 crc, | |||
1319 | return *(u32 *)desc.ctx; | 1369 | return *(u32 *)desc.ctx; |
1320 | } | 1370 | } |
1321 | 1371 | ||
1372 | /* Return most recent uncommitted transaction */ | ||
1373 | static inline tid_t jbd2_get_latest_transaction(journal_t *journal) | ||
1374 | { | ||
1375 | tid_t tid; | ||
1376 | |||
1377 | read_lock(&journal->j_state_lock); | ||
1378 | tid = journal->j_commit_request; | ||
1379 | if (journal->j_running_transaction) | ||
1380 | tid = journal->j_running_transaction->t_tid; | ||
1381 | read_unlock(&journal->j_state_lock); | ||
1382 | return tid; | ||
1383 | } | ||
1384 | |||
1322 | #ifdef __KERNEL__ | 1385 | #ifdef __KERNEL__ |
1323 | 1386 | ||
1324 | #define buffer_trace_init(bh) do {} while (0) | 1387 | #define buffer_trace_init(bh) do {} while (0) |
diff --git a/include/linux/jbd_common.h b/include/linux/jbd_common.h index 6133679bc4c0..3dc53432355f 100644 --- a/include/linux/jbd_common.h +++ b/include/linux/jbd_common.h | |||
@@ -1,31 +1,7 @@ | |||
1 | #ifndef _LINUX_JBD_STATE_H | 1 | #ifndef _LINUX_JBD_STATE_H |
2 | #define _LINUX_JBD_STATE_H | 2 | #define _LINUX_JBD_STATE_H |
3 | 3 | ||
4 | enum jbd_state_bits { | 4 | #include <linux/bit_spinlock.h> |
5 | BH_JBD /* Has an attached ext3 journal_head */ | ||
6 | = BH_PrivateStart, | ||
7 | BH_JWrite, /* Being written to log (@@@ DEBUGGING) */ | ||
8 | BH_Freed, /* Has been freed (truncated) */ | ||
9 | BH_Revoked, /* Has been revoked from the log */ | ||
10 | BH_RevokeValid, /* Revoked flag is valid */ | ||
11 | BH_JBDDirty, /* Is dirty but journaled */ | ||
12 | BH_State, /* Pins most journal_head state */ | ||
13 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | ||
14 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ | ||
15 | BH_Verified, /* Metadata block has been verified ok */ | ||
16 | BH_JBDPrivateStart, /* First bit available for private use by FS */ | ||
17 | }; | ||
18 | |||
19 | BUFFER_FNS(JBD, jbd) | ||
20 | BUFFER_FNS(JWrite, jwrite) | ||
21 | BUFFER_FNS(JBDDirty, jbddirty) | ||
22 | TAS_BUFFER_FNS(JBDDirty, jbddirty) | ||
23 | BUFFER_FNS(Revoked, revoked) | ||
24 | TAS_BUFFER_FNS(Revoked, revoked) | ||
25 | BUFFER_FNS(RevokeValid, revokevalid) | ||
26 | TAS_BUFFER_FNS(RevokeValid, revokevalid) | ||
27 | BUFFER_FNS(Freed, freed) | ||
28 | BUFFER_FNS(Verified, verified) | ||
29 | 5 | ||
30 | static inline struct buffer_head *jh2bh(struct journal_head *jh) | 6 | static inline struct buffer_head *jh2bh(struct journal_head *jh) |
31 | { | 7 | { |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e9ef6d6b51d5..7e6b97e77fb9 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -193,13 +193,10 @@ extern int _cond_resched(void); | |||
193 | (__x < 0) ? -__x : __x; \ | 193 | (__x < 0) ? -__x : __x; \ |
194 | }) | 194 | }) |
195 | 195 | ||
196 | #ifdef CONFIG_PROVE_LOCKING | 196 | #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP) |
197 | void might_fault(void); | 197 | void might_fault(void); |
198 | #else | 198 | #else |
199 | static inline void might_fault(void) | 199 | static inline void might_fault(void) { } |
200 | { | ||
201 | might_sleep(); | ||
202 | } | ||
203 | #endif | 200 | #endif |
204 | 201 | ||
205 | extern struct atomic_notifier_head panic_notifier_list; | 202 | extern struct atomic_notifier_head panic_notifier_list; |
@@ -450,6 +447,8 @@ static inline char * __deprecated pack_hex_byte(char *buf, u8 byte) | |||
450 | extern int hex_to_bin(char ch); | 447 | extern int hex_to_bin(char ch); |
451 | extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); | 448 | extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); |
452 | 449 | ||
450 | int mac_pton(const char *s, u8 *mac); | ||
451 | |||
453 | /* | 452 | /* |
454 | * General tracing related utility functions - trace_printk(), | 453 | * General tracing related utility functions - trace_printk(), |
455 | * tracing_on/tracing_off and tracing_start()/tracing_stop | 454 | * tracing_on/tracing_off and tracing_start()/tracing_stop |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index f0eea07d2c2b..8db53cfaccdb 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/ratelimit.h> | 23 | #include <linux/ratelimit.h> |
24 | #include <linux/err.h> | 24 | #include <linux/err.h> |
25 | #include <linux/irqflags.h> | 25 | #include <linux/irqflags.h> |
26 | #include <linux/context_tracking.h> | ||
26 | #include <asm/signal.h> | 27 | #include <asm/signal.h> |
27 | 28 | ||
28 | #include <linux/kvm.h> | 29 | #include <linux/kvm.h> |
@@ -760,42 +761,6 @@ static inline int kvm_iommu_unmap_guest(struct kvm *kvm) | |||
760 | } | 761 | } |
761 | #endif | 762 | #endif |
762 | 763 | ||
763 | static inline void __guest_enter(void) | ||
764 | { | ||
765 | /* | ||
766 | * This is running in ioctl context so we can avoid | ||
767 | * the call to vtime_account() with its unnecessary idle check. | ||
768 | */ | ||
769 | vtime_account_system(current); | ||
770 | current->flags |= PF_VCPU; | ||
771 | } | ||
772 | |||
773 | static inline void __guest_exit(void) | ||
774 | { | ||
775 | /* | ||
776 | * This is running in ioctl context so we can avoid | ||
777 | * the call to vtime_account() with its unnecessary idle check. | ||
778 | */ | ||
779 | vtime_account_system(current); | ||
780 | current->flags &= ~PF_VCPU; | ||
781 | } | ||
782 | |||
783 | #ifdef CONFIG_CONTEXT_TRACKING | ||
784 | extern void guest_enter(void); | ||
785 | extern void guest_exit(void); | ||
786 | |||
787 | #else /* !CONFIG_CONTEXT_TRACKING */ | ||
788 | static inline void guest_enter(void) | ||
789 | { | ||
790 | __guest_enter(); | ||
791 | } | ||
792 | |||
793 | static inline void guest_exit(void) | ||
794 | { | ||
795 | __guest_exit(); | ||
796 | } | ||
797 | #endif /* !CONFIG_CONTEXT_TRACKING */ | ||
798 | |||
799 | static inline void kvm_guest_enter(void) | 764 | static inline void kvm_guest_enter(void) |
800 | { | 765 | { |
801 | unsigned long flags; | 766 | unsigned long flags; |
diff --git a/include/linux/list.h b/include/linux/list.h index 6a1f8df9144b..b83e5657365a 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -362,6 +362,17 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
362 | list_entry((ptr)->next, type, member) | 362 | list_entry((ptr)->next, type, member) |
363 | 363 | ||
364 | /** | 364 | /** |
365 | * list_first_entry_or_null - get the first element from a list | ||
366 | * @ptr: the list head to take the element from. | ||
367 | * @type: the type of the struct this is embedded in. | ||
368 | * @member: the name of the list_struct within the struct. | ||
369 | * | ||
370 | * Note that if the list is empty, it returns NULL. | ||
371 | */ | ||
372 | #define list_first_entry_or_null(ptr, type, member) \ | ||
373 | (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) | ||
374 | |||
375 | /** | ||
365 | * list_for_each - iterate over a list | 376 | * list_for_each - iterate over a list |
366 | * @pos: the &struct list_head to use as a loop cursor. | 377 | * @pos: the &struct list_head to use as a loop cursor. |
367 | * @head: the head for your list. | 378 | * @head: the head for your list. |
diff --git a/include/linux/loop.h b/include/linux/loop.h deleted file mode 100644 index 460b60fa7adf..000000000000 --- a/include/linux/loop.h +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/loop.h | ||
3 | * | ||
4 | * Written by Theodore Ts'o, 3/29/93. | ||
5 | * | ||
6 | * Copyright 1993 by Theodore Ts'o. Redistribution of this file is | ||
7 | * permitted under the GNU General Public License. | ||
8 | */ | ||
9 | #ifndef _LINUX_LOOP_H | ||
10 | #define _LINUX_LOOP_H | ||
11 | |||
12 | #include <linux/bio.h> | ||
13 | #include <linux/blkdev.h> | ||
14 | #include <linux/spinlock.h> | ||
15 | #include <linux/mutex.h> | ||
16 | #include <uapi/linux/loop.h> | ||
17 | |||
18 | /* Possible states of device */ | ||
19 | enum { | ||
20 | Lo_unbound, | ||
21 | Lo_bound, | ||
22 | Lo_rundown, | ||
23 | }; | ||
24 | |||
25 | struct loop_func_table; | ||
26 | |||
27 | struct loop_device { | ||
28 | int lo_number; | ||
29 | int lo_refcnt; | ||
30 | loff_t lo_offset; | ||
31 | loff_t lo_sizelimit; | ||
32 | int lo_flags; | ||
33 | int (*transfer)(struct loop_device *, int cmd, | ||
34 | struct page *raw_page, unsigned raw_off, | ||
35 | struct page *loop_page, unsigned loop_off, | ||
36 | int size, sector_t real_block); | ||
37 | char lo_file_name[LO_NAME_SIZE]; | ||
38 | char lo_crypt_name[LO_NAME_SIZE]; | ||
39 | char lo_encrypt_key[LO_KEY_SIZE]; | ||
40 | int lo_encrypt_key_size; | ||
41 | struct loop_func_table *lo_encryption; | ||
42 | __u32 lo_init[2]; | ||
43 | kuid_t lo_key_owner; /* Who set the key */ | ||
44 | int (*ioctl)(struct loop_device *, int cmd, | ||
45 | unsigned long arg); | ||
46 | |||
47 | struct file * lo_backing_file; | ||
48 | struct block_device *lo_device; | ||
49 | unsigned lo_blocksize; | ||
50 | void *key_data; | ||
51 | |||
52 | gfp_t old_gfp_mask; | ||
53 | |||
54 | spinlock_t lo_lock; | ||
55 | struct bio_list lo_bio_list; | ||
56 | unsigned int lo_bio_count; | ||
57 | int lo_state; | ||
58 | struct mutex lo_ctl_mutex; | ||
59 | struct task_struct *lo_thread; | ||
60 | wait_queue_head_t lo_event; | ||
61 | /* wait queue for incoming requests */ | ||
62 | wait_queue_head_t lo_req_wait; | ||
63 | |||
64 | struct request_queue *lo_queue; | ||
65 | struct gendisk *lo_disk; | ||
66 | }; | ||
67 | |||
68 | /* Support for loadable transfer modules */ | ||
69 | struct loop_func_table { | ||
70 | int number; /* filter type */ | ||
71 | int (*transfer)(struct loop_device *lo, int cmd, | ||
72 | struct page *raw_page, unsigned raw_off, | ||
73 | struct page *loop_page, unsigned loop_off, | ||
74 | int size, sector_t real_block); | ||
75 | int (*init)(struct loop_device *, const struct loop_info64 *); | ||
76 | /* release is called from loop_unregister_transfer or clr_fd */ | ||
77 | int (*release)(struct loop_device *); | ||
78 | int (*ioctl)(struct loop_device *, int cmd, unsigned long arg); | ||
79 | struct module *owner; | ||
80 | }; | ||
81 | |||
82 | int loop_register_transfer(struct loop_func_table *funcs); | ||
83 | int loop_unregister_transfer(int number); | ||
84 | |||
85 | #endif | ||
diff --git a/include/linux/math64.h b/include/linux/math64.h index b8ba85544721..2913b86eb12a 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h | |||
@@ -6,7 +6,8 @@ | |||
6 | 6 | ||
7 | #if BITS_PER_LONG == 64 | 7 | #if BITS_PER_LONG == 64 |
8 | 8 | ||
9 | #define div64_long(x,y) div64_s64((x),(y)) | 9 | #define div64_long(x, y) div64_s64((x), (y)) |
10 | #define div64_ul(x, y) div64_u64((x), (y)) | ||
10 | 11 | ||
11 | /** | 12 | /** |
12 | * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder | 13 | * div_u64_rem - unsigned 64bit divide with 32bit divisor with remainder |
@@ -47,7 +48,8 @@ static inline s64 div64_s64(s64 dividend, s64 divisor) | |||
47 | 48 | ||
48 | #elif BITS_PER_LONG == 32 | 49 | #elif BITS_PER_LONG == 32 |
49 | 50 | ||
50 | #define div64_long(x,y) div_s64((x),(y)) | 51 | #define div64_long(x, y) div_s64((x), (y)) |
52 | #define div64_ul(x, y) div_u64((x), (y)) | ||
51 | 53 | ||
52 | #ifndef div_u64_rem | 54 | #ifndef div_u64_rem |
53 | static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) | 55 | static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) |
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h index 0ab61320ffa8..7dd6524d2aac 100644 --- a/include/linux/mfd/davinci_voicecodec.h +++ b/include/linux/mfd/davinci_voicecodec.h | |||
@@ -26,8 +26,7 @@ | |||
26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
27 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
28 | #include <linux/mfd/core.h> | 28 | #include <linux/mfd/core.h> |
29 | 29 | #include <linux/platform_data/edma.h> | |
30 | #include <mach/edma.h> | ||
31 | 30 | ||
32 | /* | 31 | /* |
33 | * Register values. | 32 | * Register values. |
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 8f21daf62fb5..9b81b2bdc46b 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/leds.h> | 20 | #include <linux/leds.h> |
21 | #include <linux/regmap.h> | 21 | #include <linux/regmap.h> |
22 | #include <linux/regulator/driver.h> | 22 | #include <linux/regulator/driver.h> |
23 | #include <linux/extcon.h> | ||
24 | #include <linux/usb/phy_companion.h> | ||
23 | 25 | ||
24 | #define PALMAS_NUM_CLIENTS 3 | 26 | #define PALMAS_NUM_CLIENTS 3 |
25 | 27 | ||
@@ -37,6 +39,12 @@ struct palmas_gpadc; | |||
37 | struct palmas_resource; | 39 | struct palmas_resource; |
38 | struct palmas_usb; | 40 | struct palmas_usb; |
39 | 41 | ||
42 | enum palmas_usb_state { | ||
43 | PALMAS_USB_STATE_DISCONNECT, | ||
44 | PALMAS_USB_STATE_VBUS, | ||
45 | PALMAS_USB_STATE_ID, | ||
46 | }; | ||
47 | |||
40 | struct palmas { | 48 | struct palmas { |
41 | struct device *dev; | 49 | struct device *dev; |
42 | 50 | ||
@@ -180,9 +188,6 @@ struct palmas_pmic_platform_data { | |||
180 | }; | 188 | }; |
181 | 189 | ||
182 | struct palmas_usb_platform_data { | 190 | struct palmas_usb_platform_data { |
183 | /* Set this if platform wishes its own vbus control */ | ||
184 | int no_control_vbus; | ||
185 | |||
186 | /* Do we enable the wakeup comparator on probe */ | 191 | /* Do we enable the wakeup comparator on probe */ |
187 | int wakeup; | 192 | int wakeup; |
188 | }; | 193 | }; |
@@ -350,22 +355,19 @@ struct palmas_usb { | |||
350 | struct palmas *palmas; | 355 | struct palmas *palmas; |
351 | struct device *dev; | 356 | struct device *dev; |
352 | 357 | ||
353 | /* for vbus reporting with irqs disabled */ | 358 | struct extcon_dev edev; |
354 | spinlock_t lock; | ||
355 | |||
356 | struct regulator *vbus_reg; | ||
357 | 359 | ||
358 | /* used to set vbus, in atomic path */ | 360 | /* used to set vbus, in atomic path */ |
359 | struct work_struct set_vbus_work; | 361 | struct work_struct set_vbus_work; |
360 | 362 | ||
361 | int irq1; | 363 | int id_otg_irq; |
362 | int irq2; | 364 | int id_irq; |
363 | int irq3; | 365 | int vbus_otg_irq; |
364 | int irq4; | 366 | int vbus_irq; |
365 | 367 | ||
366 | int vbus_enable; | 368 | int vbus_enable; |
367 | 369 | ||
368 | u8 linkstat; | 370 | enum palmas_usb_state linkstat; |
369 | }; | 371 | }; |
370 | 372 | ||
371 | #define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator) | 373 | #define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator) |
diff --git a/include/linux/mfd/syscon/clps711x.h b/include/linux/mfd/syscon/clps711x.h new file mode 100644 index 000000000000..26355abae515 --- /dev/null +++ b/include/linux/mfd/syscon/clps711x.h | |||
@@ -0,0 +1,94 @@ | |||
1 | /* | ||
2 | * CLPS711X system register bits definitions | ||
3 | * | ||
4 | * Copyright (C) 2013 Alexander Shiyan <shc_work@mail.ru> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_MFD_SYSCON_CLPS711X_H_ | ||
13 | #define _LINUX_MFD_SYSCON_CLPS711X_H_ | ||
14 | |||
15 | #define SYSCON_OFFSET (0x00) | ||
16 | #define SYSFLG_OFFSET (0x40) | ||
17 | |||
18 | #define SYSCON1_KBDSCAN(x) ((x) & 15) | ||
19 | #define SYSCON1_KBDSCAN_MASK (15) | ||
20 | #define SYSCON1_TC1M (1 << 4) | ||
21 | #define SYSCON1_TC1S (1 << 5) | ||
22 | #define SYSCON1_TC2M (1 << 6) | ||
23 | #define SYSCON1_TC2S (1 << 7) | ||
24 | #define SYSCON1_BZTOG (1 << 9) | ||
25 | #define SYSCON1_BZMOD (1 << 10) | ||
26 | #define SYSCON1_DBGEN (1 << 11) | ||
27 | #define SYSCON1_LCDEN (1 << 12) | ||
28 | #define SYSCON1_CDENTX (1 << 13) | ||
29 | #define SYSCON1_CDENRX (1 << 14) | ||
30 | #define SYSCON1_SIREN (1 << 15) | ||
31 | #define SYSCON1_ADCKSEL(x) (((x) & 3) << 16) | ||
32 | #define SYSCON1_ADCKSEL_MASK (3 << 16) | ||
33 | #define SYSCON1_EXCKEN (1 << 18) | ||
34 | #define SYSCON1_WAKEDIS (1 << 19) | ||
35 | #define SYSCON1_IRTXM (1 << 20) | ||
36 | |||
37 | #define SYSCON2_SERSEL (1 << 0) | ||
38 | #define SYSCON2_KBD6 (1 << 1) | ||
39 | #define SYSCON2_DRAMZ (1 << 2) | ||
40 | #define SYSCON2_KBWEN (1 << 3) | ||
41 | #define SYSCON2_SS2TXEN (1 << 4) | ||
42 | #define SYSCON2_PCCARD1 (1 << 5) | ||
43 | #define SYSCON2_PCCARD2 (1 << 6) | ||
44 | #define SYSCON2_SS2RXEN (1 << 7) | ||
45 | #define SYSCON2_SS2MAEN (1 << 9) | ||
46 | #define SYSCON2_OSTB (1 << 12) | ||
47 | #define SYSCON2_CLKENSL (1 << 13) | ||
48 | #define SYSCON2_BUZFREQ (1 << 14) | ||
49 | |||
50 | #define SYSCON3_ADCCON (1 << 0) | ||
51 | #define SYSCON3_CLKCTL0 (1 << 1) | ||
52 | #define SYSCON3_CLKCTL1 (1 << 2) | ||
53 | #define SYSCON3_DAISEL (1 << 3) | ||
54 | #define SYSCON3_ADCCKNSEN (1 << 4) | ||
55 | #define SYSCON3_VERSN(x) (((x) >> 5) & 7) | ||
56 | #define SYSCON3_VERSN_MASK (7 << 5) | ||
57 | #define SYSCON3_FASTWAKE (1 << 8) | ||
58 | #define SYSCON3_DAIEN (1 << 9) | ||
59 | #define SYSCON3_128FS SYSCON3_DAIEN | ||
60 | #define SYSCON3_ENPD67 (1 << 10) | ||
61 | |||
62 | #define SYSCON_UARTEN (1 << 8) | ||
63 | |||
64 | #define SYSFLG1_MCDR (1 << 0) | ||
65 | #define SYSFLG1_DCDET (1 << 1) | ||
66 | #define SYSFLG1_WUDR (1 << 2) | ||
67 | #define SYSFLG1_WUON (1 << 3) | ||
68 | #define SYSFLG1_CTS (1 << 8) | ||
69 | #define SYSFLG1_DSR (1 << 9) | ||
70 | #define SYSFLG1_DCD (1 << 10) | ||
71 | #define SYSFLG1_NBFLG (1 << 12) | ||
72 | #define SYSFLG1_RSTFLG (1 << 13) | ||
73 | #define SYSFLG1_PFFLG (1 << 14) | ||
74 | #define SYSFLG1_CLDFLG (1 << 15) | ||
75 | #define SYSFLG1_CRXFE (1 << 24) | ||
76 | #define SYSFLG1_CTXFF (1 << 25) | ||
77 | #define SYSFLG1_SSIBUSY (1 << 26) | ||
78 | #define SYSFLG1_ID (1 << 29) | ||
79 | #define SYSFLG1_VERID(x) (((x) >> 30) & 3) | ||
80 | #define SYSFLG1_VERID_MASK (3 << 30) | ||
81 | |||
82 | #define SYSFLG2_SSRXOF (1 << 0) | ||
83 | #define SYSFLG2_RESVAL (1 << 1) | ||
84 | #define SYSFLG2_RESFRM (1 << 2) | ||
85 | #define SYSFLG2_SS2RXFE (1 << 3) | ||
86 | #define SYSFLG2_SS2TXFF (1 << 4) | ||
87 | #define SYSFLG2_SS2TXUF (1 << 5) | ||
88 | #define SYSFLG2_CKMODE (1 << 6) | ||
89 | |||
90 | #define SYSFLG_UBUSY (1 << 11) | ||
91 | #define SYSFLG_URXFE (1 << 22) | ||
92 | #define SYSFLG_UTXFF (1 << 23) | ||
93 | |||
94 | #endif | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index e0c8528a41a4..66d881f1d576 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1041,7 +1041,8 @@ int get_kernel_page(unsigned long start, int write, struct page **pages); | |||
1041 | struct page *get_dump_page(unsigned long addr); | 1041 | struct page *get_dump_page(unsigned long addr); |
1042 | 1042 | ||
1043 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); | 1043 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); |
1044 | extern void do_invalidatepage(struct page *page, unsigned long offset); | 1044 | extern void do_invalidatepage(struct page *page, unsigned int offset, |
1045 | unsigned int length); | ||
1045 | 1046 | ||
1046 | int __set_page_dirty_nobuffers(struct page *page); | 1047 | int __set_page_dirty_nobuffers(struct page *page); |
1047 | int __set_page_dirty_no_writeback(struct page *page); | 1048 | int __set_page_dirty_no_writeback(struct page *page); |
diff --git a/include/linux/mutex-debug.h b/include/linux/mutex-debug.h index 731d77d6e155..4ac8b1977b73 100644 --- a/include/linux/mutex-debug.h +++ b/include/linux/mutex-debug.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/linkage.h> | 4 | #include <linux/linkage.h> |
5 | #include <linux/lockdep.h> | 5 | #include <linux/lockdep.h> |
6 | #include <linux/debug_locks.h> | ||
6 | 7 | ||
7 | /* | 8 | /* |
8 | * Mutexes - debugging helpers: | 9 | * Mutexes - debugging helpers: |
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 433da8a1a426..3793ed7feeeb 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #ifndef __LINUX_MUTEX_H | 10 | #ifndef __LINUX_MUTEX_H |
11 | #define __LINUX_MUTEX_H | 11 | #define __LINUX_MUTEX_H |
12 | 12 | ||
13 | #include <asm/current.h> | ||
13 | #include <linux/list.h> | 14 | #include <linux/list.h> |
14 | #include <linux/spinlock_types.h> | 15 | #include <linux/spinlock_types.h> |
15 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
@@ -77,6 +78,40 @@ struct mutex_waiter { | |||
77 | #endif | 78 | #endif |
78 | }; | 79 | }; |
79 | 80 | ||
81 | struct ww_class { | ||
82 | atomic_long_t stamp; | ||
83 | struct lock_class_key acquire_key; | ||
84 | struct lock_class_key mutex_key; | ||
85 | const char *acquire_name; | ||
86 | const char *mutex_name; | ||
87 | }; | ||
88 | |||
89 | struct ww_acquire_ctx { | ||
90 | struct task_struct *task; | ||
91 | unsigned long stamp; | ||
92 | unsigned acquired; | ||
93 | #ifdef CONFIG_DEBUG_MUTEXES | ||
94 | unsigned done_acquire; | ||
95 | struct ww_class *ww_class; | ||
96 | struct ww_mutex *contending_lock; | ||
97 | #endif | ||
98 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
99 | struct lockdep_map dep_map; | ||
100 | #endif | ||
101 | #ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH | ||
102 | unsigned deadlock_inject_interval; | ||
103 | unsigned deadlock_inject_countdown; | ||
104 | #endif | ||
105 | }; | ||
106 | |||
107 | struct ww_mutex { | ||
108 | struct mutex base; | ||
109 | struct ww_acquire_ctx *ctx; | ||
110 | #ifdef CONFIG_DEBUG_MUTEXES | ||
111 | struct ww_class *ww_class; | ||
112 | #endif | ||
113 | }; | ||
114 | |||
80 | #ifdef CONFIG_DEBUG_MUTEXES | 115 | #ifdef CONFIG_DEBUG_MUTEXES |
81 | # include <linux/mutex-debug.h> | 116 | # include <linux/mutex-debug.h> |
82 | #else | 117 | #else |
@@ -101,8 +136,11 @@ static inline void mutex_destroy(struct mutex *lock) {} | |||
101 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 136 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
102 | # define __DEP_MAP_MUTEX_INITIALIZER(lockname) \ | 137 | # define __DEP_MAP_MUTEX_INITIALIZER(lockname) \ |
103 | , .dep_map = { .name = #lockname } | 138 | , .dep_map = { .name = #lockname } |
139 | # define __WW_CLASS_MUTEX_INITIALIZER(lockname, ww_class) \ | ||
140 | , .ww_class = &ww_class | ||
104 | #else | 141 | #else |
105 | # define __DEP_MAP_MUTEX_INITIALIZER(lockname) | 142 | # define __DEP_MAP_MUTEX_INITIALIZER(lockname) |
143 | # define __WW_CLASS_MUTEX_INITIALIZER(lockname, ww_class) | ||
106 | #endif | 144 | #endif |
107 | 145 | ||
108 | #define __MUTEX_INITIALIZER(lockname) \ | 146 | #define __MUTEX_INITIALIZER(lockname) \ |
@@ -112,13 +150,49 @@ static inline void mutex_destroy(struct mutex *lock) {} | |||
112 | __DEBUG_MUTEX_INITIALIZER(lockname) \ | 150 | __DEBUG_MUTEX_INITIALIZER(lockname) \ |
113 | __DEP_MAP_MUTEX_INITIALIZER(lockname) } | 151 | __DEP_MAP_MUTEX_INITIALIZER(lockname) } |
114 | 152 | ||
153 | #define __WW_CLASS_INITIALIZER(ww_class) \ | ||
154 | { .stamp = ATOMIC_LONG_INIT(0) \ | ||
155 | , .acquire_name = #ww_class "_acquire" \ | ||
156 | , .mutex_name = #ww_class "_mutex" } | ||
157 | |||
158 | #define __WW_MUTEX_INITIALIZER(lockname, class) \ | ||
159 | { .base = { \__MUTEX_INITIALIZER(lockname) } \ | ||
160 | __WW_CLASS_MUTEX_INITIALIZER(lockname, class) } | ||
161 | |||
115 | #define DEFINE_MUTEX(mutexname) \ | 162 | #define DEFINE_MUTEX(mutexname) \ |
116 | struct mutex mutexname = __MUTEX_INITIALIZER(mutexname) | 163 | struct mutex mutexname = __MUTEX_INITIALIZER(mutexname) |
117 | 164 | ||
165 | #define DEFINE_WW_CLASS(classname) \ | ||
166 | struct ww_class classname = __WW_CLASS_INITIALIZER(classname) | ||
167 | |||
168 | #define DEFINE_WW_MUTEX(mutexname, ww_class) \ | ||
169 | struct ww_mutex mutexname = __WW_MUTEX_INITIALIZER(mutexname, ww_class) | ||
170 | |||
171 | |||
118 | extern void __mutex_init(struct mutex *lock, const char *name, | 172 | extern void __mutex_init(struct mutex *lock, const char *name, |
119 | struct lock_class_key *key); | 173 | struct lock_class_key *key); |
120 | 174 | ||
121 | /** | 175 | /** |
176 | * ww_mutex_init - initialize the w/w mutex | ||
177 | * @lock: the mutex to be initialized | ||
178 | * @ww_class: the w/w class the mutex should belong to | ||
179 | * | ||
180 | * Initialize the w/w mutex to unlocked state and associate it with the given | ||
181 | * class. | ||
182 | * | ||
183 | * It is not allowed to initialize an already locked mutex. | ||
184 | */ | ||
185 | static inline void ww_mutex_init(struct ww_mutex *lock, | ||
186 | struct ww_class *ww_class) | ||
187 | { | ||
188 | __mutex_init(&lock->base, ww_class->mutex_name, &ww_class->mutex_key); | ||
189 | lock->ctx = NULL; | ||
190 | #ifdef CONFIG_DEBUG_MUTEXES | ||
191 | lock->ww_class = ww_class; | ||
192 | #endif | ||
193 | } | ||
194 | |||
195 | /** | ||
122 | * mutex_is_locked - is the mutex locked | 196 | * mutex_is_locked - is the mutex locked |
123 | * @lock: the mutex to be queried | 197 | * @lock: the mutex to be queried |
124 | * | 198 | * |
@@ -136,6 +210,7 @@ static inline int mutex_is_locked(struct mutex *lock) | |||
136 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 210 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
137 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); | 211 | extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass); |
138 | extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock); | 212 | extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock); |
213 | |||
139 | extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, | 214 | extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock, |
140 | unsigned int subclass); | 215 | unsigned int subclass); |
141 | extern int __must_check mutex_lock_killable_nested(struct mutex *lock, | 216 | extern int __must_check mutex_lock_killable_nested(struct mutex *lock, |
@@ -147,7 +222,7 @@ extern int __must_check mutex_lock_killable_nested(struct mutex *lock, | |||
147 | 222 | ||
148 | #define mutex_lock_nest_lock(lock, nest_lock) \ | 223 | #define mutex_lock_nest_lock(lock, nest_lock) \ |
149 | do { \ | 224 | do { \ |
150 | typecheck(struct lockdep_map *, &(nest_lock)->dep_map); \ | 225 | typecheck(struct lockdep_map *, &(nest_lock)->dep_map); \ |
151 | _mutex_lock_nest_lock(lock, &(nest_lock)->dep_map); \ | 226 | _mutex_lock_nest_lock(lock, &(nest_lock)->dep_map); \ |
152 | } while (0) | 227 | } while (0) |
153 | 228 | ||
@@ -170,6 +245,292 @@ extern int __must_check mutex_lock_killable(struct mutex *lock); | |||
170 | */ | 245 | */ |
171 | extern int mutex_trylock(struct mutex *lock); | 246 | extern int mutex_trylock(struct mutex *lock); |
172 | extern void mutex_unlock(struct mutex *lock); | 247 | extern void mutex_unlock(struct mutex *lock); |
248 | |||
249 | /** | ||
250 | * ww_acquire_init - initialize a w/w acquire context | ||
251 | * @ctx: w/w acquire context to initialize | ||
252 | * @ww_class: w/w class of the context | ||
253 | * | ||
254 | * Initializes an context to acquire multiple mutexes of the given w/w class. | ||
255 | * | ||
256 | * Context-based w/w mutex acquiring can be done in any order whatsoever within | ||
257 | * a given lock class. Deadlocks will be detected and handled with the | ||
258 | * wait/wound logic. | ||
259 | * | ||
260 | * Mixing of context-based w/w mutex acquiring and single w/w mutex locking can | ||
261 | * result in undetected deadlocks and is so forbidden. Mixing different contexts | ||
262 | * for the same w/w class when acquiring mutexes can also result in undetected | ||
263 | * deadlocks, and is hence also forbidden. Both types of abuse will be caught by | ||
264 | * enabling CONFIG_PROVE_LOCKING. | ||
265 | * | ||
266 | * Nesting of acquire contexts for _different_ w/w classes is possible, subject | ||
267 | * to the usual locking rules between different lock classes. | ||
268 | * | ||
269 | * An acquire context must be released with ww_acquire_fini by the same task | ||
270 | * before the memory is freed. It is recommended to allocate the context itself | ||
271 | * on the stack. | ||
272 | */ | ||
273 | static inline void ww_acquire_init(struct ww_acquire_ctx *ctx, | ||
274 | struct ww_class *ww_class) | ||
275 | { | ||
276 | ctx->task = current; | ||
277 | ctx->stamp = atomic_long_inc_return(&ww_class->stamp); | ||
278 | ctx->acquired = 0; | ||
279 | #ifdef CONFIG_DEBUG_MUTEXES | ||
280 | ctx->ww_class = ww_class; | ||
281 | ctx->done_acquire = 0; | ||
282 | ctx->contending_lock = NULL; | ||
283 | #endif | ||
284 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
285 | debug_check_no_locks_freed((void *)ctx, sizeof(*ctx)); | ||
286 | lockdep_init_map(&ctx->dep_map, ww_class->acquire_name, | ||
287 | &ww_class->acquire_key, 0); | ||
288 | mutex_acquire(&ctx->dep_map, 0, 0, _RET_IP_); | ||
289 | #endif | ||
290 | #ifdef CONFIG_DEBUG_WW_MUTEX_SLOWPATH | ||
291 | ctx->deadlock_inject_interval = 1; | ||
292 | ctx->deadlock_inject_countdown = ctx->stamp & 0xf; | ||
293 | #endif | ||
294 | } | ||
295 | |||
296 | /** | ||
297 | * ww_acquire_done - marks the end of the acquire phase | ||
298 | * @ctx: the acquire context | ||
299 | * | ||
300 | * Marks the end of the acquire phase, any further w/w mutex lock calls using | ||
301 | * this context are forbidden. | ||
302 | * | ||
303 | * Calling this function is optional, it is just useful to document w/w mutex | ||
304 | * code and clearly designated the acquire phase from actually using the locked | ||
305 | * data structures. | ||
306 | */ | ||
307 | static inline void ww_acquire_done(struct ww_acquire_ctx *ctx) | ||
308 | { | ||
309 | #ifdef CONFIG_DEBUG_MUTEXES | ||
310 | lockdep_assert_held(ctx); | ||
311 | |||
312 | DEBUG_LOCKS_WARN_ON(ctx->done_acquire); | ||
313 | ctx->done_acquire = 1; | ||
314 | #endif | ||
315 | } | ||
316 | |||
317 | /** | ||
318 | * ww_acquire_fini - releases a w/w acquire context | ||
319 | * @ctx: the acquire context to free | ||
320 | * | ||
321 | * Releases a w/w acquire context. This must be called _after_ all acquired w/w | ||
322 | * mutexes have been released with ww_mutex_unlock. | ||
323 | */ | ||
324 | static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx) | ||
325 | { | ||
326 | #ifdef CONFIG_DEBUG_MUTEXES | ||
327 | mutex_release(&ctx->dep_map, 0, _THIS_IP_); | ||
328 | |||
329 | DEBUG_LOCKS_WARN_ON(ctx->acquired); | ||
330 | if (!config_enabled(CONFIG_PROVE_LOCKING)) | ||
331 | /* | ||
332 | * lockdep will normally handle this, | ||
333 | * but fail without anyway | ||
334 | */ | ||
335 | ctx->done_acquire = 1; | ||
336 | |||
337 | if (!config_enabled(CONFIG_DEBUG_LOCK_ALLOC)) | ||
338 | /* ensure ww_acquire_fini will still fail if called twice */ | ||
339 | ctx->acquired = ~0U; | ||
340 | #endif | ||
341 | } | ||
342 | |||
343 | extern int __must_check __ww_mutex_lock(struct ww_mutex *lock, | ||
344 | struct ww_acquire_ctx *ctx); | ||
345 | extern int __must_check __ww_mutex_lock_interruptible(struct ww_mutex *lock, | ||
346 | struct ww_acquire_ctx *ctx); | ||
347 | |||
348 | /** | ||
349 | * ww_mutex_lock - acquire the w/w mutex | ||
350 | * @lock: the mutex to be acquired | ||
351 | * @ctx: w/w acquire context, or NULL to acquire only a single lock. | ||
352 | * | ||
353 | * Lock the w/w mutex exclusively for this task. | ||
354 | * | ||
355 | * Deadlocks within a given w/w class of locks are detected and handled with the | ||
356 | * wait/wound algorithm. If the lock isn't immediately avaiable this function | ||
357 | * will either sleep until it is (wait case). Or it selects the current context | ||
358 | * for backing off by returning -EDEADLK (wound case). Trying to acquire the | ||
359 | * same lock with the same context twice is also detected and signalled by | ||
360 | * returning -EALREADY. Returns 0 if the mutex was successfully acquired. | ||
361 | * | ||
362 | * In the wound case the caller must release all currently held w/w mutexes for | ||
363 | * the given context and then wait for this contending lock to be available by | ||
364 | * calling ww_mutex_lock_slow. Alternatively callers can opt to not acquire this | ||
365 | * lock and proceed with trying to acquire further w/w mutexes (e.g. when | ||
366 | * scanning through lru lists trying to free resources). | ||
367 | * | ||
368 | * The mutex must later on be released by the same task that | ||
369 | * acquired it. The task may not exit without first unlocking the mutex. Also, | ||
370 | * kernel memory where the mutex resides must not be freed with the mutex still | ||
371 | * locked. The mutex must first be initialized (or statically defined) before it | ||
372 | * can be locked. memset()-ing the mutex to 0 is not allowed. The mutex must be | ||
373 | * of the same w/w lock class as was used to initialize the acquire context. | ||
374 | * | ||
375 | * A mutex acquired with this function must be released with ww_mutex_unlock. | ||
376 | */ | ||
377 | static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) | ||
378 | { | ||
379 | if (ctx) | ||
380 | return __ww_mutex_lock(lock, ctx); | ||
381 | else { | ||
382 | mutex_lock(&lock->base); | ||
383 | return 0; | ||
384 | } | ||
385 | } | ||
386 | |||
387 | /** | ||
388 | * ww_mutex_lock_interruptible - acquire the w/w mutex, interruptible | ||
389 | * @lock: the mutex to be acquired | ||
390 | * @ctx: w/w acquire context | ||
391 | * | ||
392 | * Lock the w/w mutex exclusively for this task. | ||
393 | * | ||
394 | * Deadlocks within a given w/w class of locks are detected and handled with the | ||
395 | * wait/wound algorithm. If the lock isn't immediately avaiable this function | ||
396 | * will either sleep until it is (wait case). Or it selects the current context | ||
397 | * for backing off by returning -EDEADLK (wound case). Trying to acquire the | ||
398 | * same lock with the same context twice is also detected and signalled by | ||
399 | * returning -EALREADY. Returns 0 if the mutex was successfully acquired. If a | ||
400 | * signal arrives while waiting for the lock then this function returns -EINTR. | ||
401 | * | ||
402 | * In the wound case the caller must release all currently held w/w mutexes for | ||
403 | * the given context and then wait for this contending lock to be available by | ||
404 | * calling ww_mutex_lock_slow_interruptible. Alternatively callers can opt to | ||
405 | * not acquire this lock and proceed with trying to acquire further w/w mutexes | ||
406 | * (e.g. when scanning through lru lists trying to free resources). | ||
407 | * | ||
408 | * The mutex must later on be released by the same task that | ||
409 | * acquired it. The task may not exit without first unlocking the mutex. Also, | ||
410 | * kernel memory where the mutex resides must not be freed with the mutex still | ||
411 | * locked. The mutex must first be initialized (or statically defined) before it | ||
412 | * can be locked. memset()-ing the mutex to 0 is not allowed. The mutex must be | ||
413 | * of the same w/w lock class as was used to initialize the acquire context. | ||
414 | * | ||
415 | * A mutex acquired with this function must be released with ww_mutex_unlock. | ||
416 | */ | ||
417 | static inline int __must_check ww_mutex_lock_interruptible(struct ww_mutex *lock, | ||
418 | struct ww_acquire_ctx *ctx) | ||
419 | { | ||
420 | if (ctx) | ||
421 | return __ww_mutex_lock_interruptible(lock, ctx); | ||
422 | else | ||
423 | return mutex_lock_interruptible(&lock->base); | ||
424 | } | ||
425 | |||
426 | /** | ||
427 | * ww_mutex_lock_slow - slowpath acquiring of the w/w mutex | ||
428 | * @lock: the mutex to be acquired | ||
429 | * @ctx: w/w acquire context | ||
430 | * | ||
431 | * Acquires a w/w mutex with the given context after a wound case. This function | ||
432 | * will sleep until the lock becomes available. | ||
433 | * | ||
434 | * The caller must have released all w/w mutexes already acquired with the | ||
435 | * context and then call this function on the contended lock. | ||
436 | * | ||
437 | * Afterwards the caller may continue to (re)acquire the other w/w mutexes it | ||
438 | * needs with ww_mutex_lock. Note that the -EALREADY return code from | ||
439 | * ww_mutex_lock can be used to avoid locking this contended mutex twice. | ||
440 | * | ||
441 | * It is forbidden to call this function with any other w/w mutexes associated | ||
442 | * with the context held. It is forbidden to call this on anything else than the | ||
443 | * contending mutex. | ||
444 | * | ||
445 | * Note that the slowpath lock acquiring can also be done by calling | ||
446 | * ww_mutex_lock directly. This function here is simply to help w/w mutex | ||
447 | * locking code readability by clearly denoting the slowpath. | ||
448 | */ | ||
449 | static inline void | ||
450 | ww_mutex_lock_slow(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) | ||
451 | { | ||
452 | int ret; | ||
453 | #ifdef CONFIG_DEBUG_MUTEXES | ||
454 | DEBUG_LOCKS_WARN_ON(!ctx->contending_lock); | ||
455 | #endif | ||
456 | ret = ww_mutex_lock(lock, ctx); | ||
457 | (void)ret; | ||
458 | } | ||
459 | |||
460 | /** | ||
461 | * ww_mutex_lock_slow_interruptible - slowpath acquiring of the w/w mutex, | ||
462 | * interruptible | ||
463 | * @lock: the mutex to be acquired | ||
464 | * @ctx: w/w acquire context | ||
465 | * | ||
466 | * Acquires a w/w mutex with the given context after a wound case. This function | ||
467 | * will sleep until the lock becomes available and returns 0 when the lock has | ||
468 | * been acquired. If a signal arrives while waiting for the lock then this | ||
469 | * function returns -EINTR. | ||
470 | * | ||
471 | * The caller must have released all w/w mutexes already acquired with the | ||
472 | * context and then call this function on the contended lock. | ||
473 | * | ||
474 | * Afterwards the caller may continue to (re)acquire the other w/w mutexes it | ||
475 | * needs with ww_mutex_lock. Note that the -EALREADY return code from | ||
476 | * ww_mutex_lock can be used to avoid locking this contended mutex twice. | ||
477 | * | ||
478 | * It is forbidden to call this function with any other w/w mutexes associated | ||
479 | * with the given context held. It is forbidden to call this on anything else | ||
480 | * than the contending mutex. | ||
481 | * | ||
482 | * Note that the slowpath lock acquiring can also be done by calling | ||
483 | * ww_mutex_lock_interruptible directly. This function here is simply to help | ||
484 | * w/w mutex locking code readability by clearly denoting the slowpath. | ||
485 | */ | ||
486 | static inline int __must_check | ||
487 | ww_mutex_lock_slow_interruptible(struct ww_mutex *lock, | ||
488 | struct ww_acquire_ctx *ctx) | ||
489 | { | ||
490 | #ifdef CONFIG_DEBUG_MUTEXES | ||
491 | DEBUG_LOCKS_WARN_ON(!ctx->contending_lock); | ||
492 | #endif | ||
493 | return ww_mutex_lock_interruptible(lock, ctx); | ||
494 | } | ||
495 | |||
496 | extern void ww_mutex_unlock(struct ww_mutex *lock); | ||
497 | |||
498 | /** | ||
499 | * ww_mutex_trylock - tries to acquire the w/w mutex without acquire context | ||
500 | * @lock: mutex to lock | ||
501 | * | ||
502 | * Trylocks a mutex without acquire context, so no deadlock detection is | ||
503 | * possible. Returns 1 if the mutex has been acquired successfully, 0 otherwise. | ||
504 | */ | ||
505 | static inline int __must_check ww_mutex_trylock(struct ww_mutex *lock) | ||
506 | { | ||
507 | return mutex_trylock(&lock->base); | ||
508 | } | ||
509 | |||
510 | /*** | ||
511 | * ww_mutex_destroy - mark a w/w mutex unusable | ||
512 | * @lock: the mutex to be destroyed | ||
513 | * | ||
514 | * This function marks the mutex uninitialized, and any subsequent | ||
515 | * use of the mutex is forbidden. The mutex must not be locked when | ||
516 | * this function is called. | ||
517 | */ | ||
518 | static inline void ww_mutex_destroy(struct ww_mutex *lock) | ||
519 | { | ||
520 | mutex_destroy(&lock->base); | ||
521 | } | ||
522 | |||
523 | /** | ||
524 | * ww_mutex_is_locked - is the w/w mutex locked | ||
525 | * @lock: the mutex to be queried | ||
526 | * | ||
527 | * Returns 1 if the mutex is locked, 0 if unlocked. | ||
528 | */ | ||
529 | static inline bool ww_mutex_is_locked(struct ww_mutex *lock) | ||
530 | { | ||
531 | return mutex_is_locked(&lock->base); | ||
532 | } | ||
533 | |||
173 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); | 534 | extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); |
174 | 535 | ||
175 | #ifndef CONFIG_HAVE_ARCH_MUTEX_CPU_RELAX | 536 | #ifndef CONFIG_HAVE_ARCH_MUTEX_CPU_RELAX |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 60584b185a0c..96e4c21e15e0 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1695,6 +1695,7 @@ extern int init_dummy_netdev(struct net_device *dev); | |||
1695 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); | 1695 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); |
1696 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); | 1696 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); |
1697 | extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); | 1697 | extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); |
1698 | extern int netdev_get_name(struct net *net, char *name, int ifindex); | ||
1698 | extern int dev_restart(struct net_device *dev); | 1699 | extern int dev_restart(struct net_device *dev); |
1699 | #ifdef CONFIG_NETPOLL_TRAP | 1700 | #ifdef CONFIG_NETPOLL_TRAP |
1700 | extern int netpoll_trap(void); | 1701 | extern int netpoll_trap(void); |
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 98ffb54988b6..2d4df6ce043e 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
@@ -17,6 +17,22 @@ extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, | |||
17 | 17 | ||
18 | extern int ipv6_netfilter_init(void); | 18 | extern int ipv6_netfilter_init(void); |
19 | extern void ipv6_netfilter_fini(void); | 19 | extern void ipv6_netfilter_fini(void); |
20 | |||
21 | /* | ||
22 | * Hook functions for ipv6 to allow xt_* modules to be built-in even | ||
23 | * if IPv6 is a module. | ||
24 | */ | ||
25 | struct nf_ipv6_ops { | ||
26 | int (*chk_addr)(struct net *net, const struct in6_addr *addr, | ||
27 | const struct net_device *dev, int strict); | ||
28 | }; | ||
29 | |||
30 | extern const struct nf_ipv6_ops __rcu *nf_ipv6_ops; | ||
31 | static inline const struct nf_ipv6_ops *nf_get_ipv6_ops(void) | ||
32 | { | ||
33 | return rcu_dereference(nf_ipv6_ops); | ||
34 | } | ||
35 | |||
20 | #else /* CONFIG_NETFILTER */ | 36 | #else /* CONFIG_NETFILTER */ |
21 | static inline int ipv6_netfilter_init(void) { return 0; } | 37 | static inline int ipv6_netfilter_init(void) { return 0; } |
22 | static inline void ipv6_netfilter_fini(void) { return; } | 38 | static inline void ipv6_netfilter_fini(void) { return; } |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h index 0506eb53519b..4c2e6f26432c 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h | |||
@@ -4,6 +4,36 @@ | |||
4 | #include <linux/errno.h> | 4 | #include <linux/errno.h> |
5 | #include <linux/of.h> | 5 | #include <linux/of.h> |
6 | 6 | ||
7 | struct of_pci_range_parser { | ||
8 | struct device_node *node; | ||
9 | const __be32 *range; | ||
10 | const __be32 *end; | ||
11 | int np; | ||
12 | int pna; | ||
13 | }; | ||
14 | |||
15 | struct of_pci_range { | ||
16 | u32 pci_space; | ||
17 | u64 pci_addr; | ||
18 | u64 cpu_addr; | ||
19 | u64 size; | ||
20 | u32 flags; | ||
21 | }; | ||
22 | |||
23 | #define for_each_of_pci_range(parser, range) \ | ||
24 | for (; of_pci_range_parser_one(parser, range);) | ||
25 | |||
26 | static inline void of_pci_range_to_resource(struct of_pci_range *range, | ||
27 | struct device_node *np, | ||
28 | struct resource *res) | ||
29 | { | ||
30 | res->flags = range->flags; | ||
31 | res->start = range->cpu_addr; | ||
32 | res->end = range->cpu_addr + range->size - 1; | ||
33 | res->parent = res->child = res->sibling = NULL; | ||
34 | res->name = np->full_name; | ||
35 | } | ||
36 | |||
7 | #ifdef CONFIG_OF_ADDRESS | 37 | #ifdef CONFIG_OF_ADDRESS |
8 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); | 38 | extern u64 of_translate_address(struct device_node *np, const __be32 *addr); |
9 | extern bool of_can_translate_address(struct device_node *dev); | 39 | extern bool of_can_translate_address(struct device_node *dev); |
@@ -27,6 +57,11 @@ static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } | |||
27 | #define pci_address_to_pio pci_address_to_pio | 57 | #define pci_address_to_pio pci_address_to_pio |
28 | #endif | 58 | #endif |
29 | 59 | ||
60 | extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, | ||
61 | struct device_node *node); | ||
62 | extern struct of_pci_range *of_pci_range_parser_one( | ||
63 | struct of_pci_range_parser *parser, | ||
64 | struct of_pci_range *range); | ||
30 | #else /* CONFIG_OF_ADDRESS */ | 65 | #else /* CONFIG_OF_ADDRESS */ |
31 | #ifndef of_address_to_resource | 66 | #ifndef of_address_to_resource |
32 | static inline int of_address_to_resource(struct device_node *dev, int index, | 67 | static inline int of_address_to_resource(struct device_node *dev, int index, |
@@ -53,6 +88,19 @@ static inline const __be32 *of_get_address(struct device_node *dev, int index, | |||
53 | { | 88 | { |
54 | return NULL; | 89 | return NULL; |
55 | } | 90 | } |
91 | |||
92 | static inline int of_pci_range_parser_init(struct of_pci_range_parser *parser, | ||
93 | struct device_node *node) | ||
94 | { | ||
95 | return -1; | ||
96 | } | ||
97 | |||
98 | static inline struct of_pci_range *of_pci_range_parser_one( | ||
99 | struct of_pci_range_parser *parser, | ||
100 | struct of_pci_range *range) | ||
101 | { | ||
102 | return NULL; | ||
103 | } | ||
56 | #endif /* CONFIG_OF_ADDRESS */ | 104 | #endif /* CONFIG_OF_ADDRESS */ |
57 | 105 | ||
58 | 106 | ||
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index bb115deb7612..7a04826018c0 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h | |||
@@ -10,5 +10,7 @@ int of_irq_map_pci(const struct pci_dev *pdev, struct of_irq *out_irq); | |||
10 | struct device_node; | 10 | struct device_node; |
11 | struct device_node *of_pci_find_child_device(struct device_node *parent, | 11 | struct device_node *of_pci_find_child_device(struct device_node *parent, |
12 | unsigned int devfn); | 12 | unsigned int devfn); |
13 | int of_pci_get_devfn(struct device_node *np); | ||
14 | int of_pci_parse_bus_range(struct device_node *node, struct resource *res); | ||
13 | 15 | ||
14 | #endif | 16 | #endif |
diff --git a/include/linux/omap-mailbox.h b/include/linux/omap-mailbox.h new file mode 100644 index 000000000000..f8322d9cd235 --- /dev/null +++ b/include/linux/omap-mailbox.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * omap-mailbox: interprocessor communication module for OMAP | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef OMAP_MAILBOX_H | ||
10 | #define OMAP_MAILBOX_H | ||
11 | |||
12 | typedef u32 mbox_msg_t; | ||
13 | struct omap_mbox; | ||
14 | |||
15 | typedef int __bitwise omap_mbox_irq_t; | ||
16 | #define IRQ_TX ((__force omap_mbox_irq_t) 1) | ||
17 | #define IRQ_RX ((__force omap_mbox_irq_t) 2) | ||
18 | |||
19 | int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg); | ||
20 | |||
21 | struct omap_mbox *omap_mbox_get(const char *, struct notifier_block *nb); | ||
22 | void omap_mbox_put(struct omap_mbox *mbox, struct notifier_block *nb); | ||
23 | |||
24 | void omap_mbox_save_ctx(struct omap_mbox *mbox); | ||
25 | void omap_mbox_restore_ctx(struct omap_mbox *mbox); | ||
26 | void omap_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq); | ||
27 | void omap_mbox_disable_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq); | ||
28 | |||
29 | #endif /* OMAP_MAILBOX_H */ | ||
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h new file mode 100644 index 000000000000..95961f0bf62d --- /dev/null +++ b/include/linux/percpu-refcount.h | |||
@@ -0,0 +1,174 @@ | |||
1 | /* | ||
2 | * Percpu refcounts: | ||
3 | * (C) 2012 Google, Inc. | ||
4 | * Author: Kent Overstreet <koverstreet@google.com> | ||
5 | * | ||
6 | * This implements a refcount with similar semantics to atomic_t - atomic_inc(), | ||
7 | * atomic_dec_and_test() - but percpu. | ||
8 | * | ||
9 | * There's one important difference between percpu refs and normal atomic_t | ||
10 | * refcounts; you have to keep track of your initial refcount, and then when you | ||
11 | * start shutting down you call percpu_ref_kill() _before_ dropping the initial | ||
12 | * refcount. | ||
13 | * | ||
14 | * The refcount will have a range of 0 to ((1U << 31) - 1), i.e. one bit less | ||
15 | * than an atomic_t - this is because of the way shutdown works, see | ||
16 | * percpu_ref_kill()/PCPU_COUNT_BIAS. | ||
17 | * | ||
18 | * Before you call percpu_ref_kill(), percpu_ref_put() does not check for the | ||
19 | * refcount hitting 0 - it can't, if it was in percpu mode. percpu_ref_kill() | ||
20 | * puts the ref back in single atomic_t mode, collecting the per cpu refs and | ||
21 | * issuing the appropriate barriers, and then marks the ref as shutting down so | ||
22 | * that percpu_ref_put() will check for the ref hitting 0. After it returns, | ||
23 | * it's safe to drop the initial ref. | ||
24 | * | ||
25 | * USAGE: | ||
26 | * | ||
27 | * See fs/aio.c for some example usage; it's used there for struct kioctx, which | ||
28 | * is created when userspaces calls io_setup(), and destroyed when userspace | ||
29 | * calls io_destroy() or the process exits. | ||
30 | * | ||
31 | * In the aio code, kill_ioctx() is called when we wish to destroy a kioctx; it | ||
32 | * calls percpu_ref_kill(), then hlist_del_rcu() and sychronize_rcu() to remove | ||
33 | * the kioctx from the proccess's list of kioctxs - after that, there can't be | ||
34 | * any new users of the kioctx (from lookup_ioctx()) and it's then safe to drop | ||
35 | * the initial ref with percpu_ref_put(). | ||
36 | * | ||
37 | * Code that does a two stage shutdown like this often needs some kind of | ||
38 | * explicit synchronization to ensure the initial refcount can only be dropped | ||
39 | * once - percpu_ref_kill() does this for you, it returns true once and false if | ||
40 | * someone else already called it. The aio code uses it this way, but it's not | ||
41 | * necessary if the code has some other mechanism to synchronize teardown. | ||
42 | * around. | ||
43 | */ | ||
44 | |||
45 | #ifndef _LINUX_PERCPU_REFCOUNT_H | ||
46 | #define _LINUX_PERCPU_REFCOUNT_H | ||
47 | |||
48 | #include <linux/atomic.h> | ||
49 | #include <linux/kernel.h> | ||
50 | #include <linux/percpu.h> | ||
51 | #include <linux/rcupdate.h> | ||
52 | |||
53 | struct percpu_ref; | ||
54 | typedef void (percpu_ref_func_t)(struct percpu_ref *); | ||
55 | |||
56 | struct percpu_ref { | ||
57 | atomic_t count; | ||
58 | /* | ||
59 | * The low bit of the pointer indicates whether the ref is in percpu | ||
60 | * mode; if set, then get/put will manipulate the atomic_t (this is a | ||
61 | * hack because we need to keep the pointer around for | ||
62 | * percpu_ref_kill_rcu()) | ||
63 | */ | ||
64 | unsigned __percpu *pcpu_count; | ||
65 | percpu_ref_func_t *release; | ||
66 | percpu_ref_func_t *confirm_kill; | ||
67 | struct rcu_head rcu; | ||
68 | }; | ||
69 | |||
70 | int __must_check percpu_ref_init(struct percpu_ref *ref, | ||
71 | percpu_ref_func_t *release); | ||
72 | void percpu_ref_cancel_init(struct percpu_ref *ref); | ||
73 | void percpu_ref_kill_and_confirm(struct percpu_ref *ref, | ||
74 | percpu_ref_func_t *confirm_kill); | ||
75 | |||
76 | /** | ||
77 | * percpu_ref_kill - drop the initial ref | ||
78 | * @ref: percpu_ref to kill | ||
79 | * | ||
80 | * Must be used to drop the initial ref on a percpu refcount; must be called | ||
81 | * precisely once before shutdown. | ||
82 | * | ||
83 | * Puts @ref in non percpu mode, then does a call_rcu() before gathering up the | ||
84 | * percpu counters and dropping the initial ref. | ||
85 | */ | ||
86 | static inline void percpu_ref_kill(struct percpu_ref *ref) | ||
87 | { | ||
88 | return percpu_ref_kill_and_confirm(ref, NULL); | ||
89 | } | ||
90 | |||
91 | #define PCPU_STATUS_BITS 2 | ||
92 | #define PCPU_STATUS_MASK ((1 << PCPU_STATUS_BITS) - 1) | ||
93 | #define PCPU_REF_PTR 0 | ||
94 | #define PCPU_REF_DEAD 1 | ||
95 | |||
96 | #define REF_STATUS(count) (((unsigned long) count) & PCPU_STATUS_MASK) | ||
97 | |||
98 | /** | ||
99 | * percpu_ref_get - increment a percpu refcount | ||
100 | * @ref: percpu_ref to get | ||
101 | * | ||
102 | * Analagous to atomic_inc(). | ||
103 | */ | ||
104 | static inline void percpu_ref_get(struct percpu_ref *ref) | ||
105 | { | ||
106 | unsigned __percpu *pcpu_count; | ||
107 | |||
108 | rcu_read_lock_sched(); | ||
109 | |||
110 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | ||
111 | |||
112 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) | ||
113 | __this_cpu_inc(*pcpu_count); | ||
114 | else | ||
115 | atomic_inc(&ref->count); | ||
116 | |||
117 | rcu_read_unlock_sched(); | ||
118 | } | ||
119 | |||
120 | /** | ||
121 | * percpu_ref_tryget - try to increment a percpu refcount | ||
122 | * @ref: percpu_ref to try-get | ||
123 | * | ||
124 | * Increment a percpu refcount unless it has already been killed. Returns | ||
125 | * %true on success; %false on failure. | ||
126 | * | ||
127 | * Completion of percpu_ref_kill() in itself doesn't guarantee that tryget | ||
128 | * will fail. For such guarantee, percpu_ref_kill_and_confirm() should be | ||
129 | * used. After the confirm_kill callback is invoked, it's guaranteed that | ||
130 | * no new reference will be given out by percpu_ref_tryget(). | ||
131 | */ | ||
132 | static inline bool percpu_ref_tryget(struct percpu_ref *ref) | ||
133 | { | ||
134 | unsigned __percpu *pcpu_count; | ||
135 | int ret = false; | ||
136 | |||
137 | rcu_read_lock_sched(); | ||
138 | |||
139 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | ||
140 | |||
141 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) { | ||
142 | __this_cpu_inc(*pcpu_count); | ||
143 | ret = true; | ||
144 | } | ||
145 | |||
146 | rcu_read_unlock_sched(); | ||
147 | |||
148 | return ret; | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * percpu_ref_put - decrement a percpu refcount | ||
153 | * @ref: percpu_ref to put | ||
154 | * | ||
155 | * Decrement the refcount, and if 0, call the release function (which was passed | ||
156 | * to percpu_ref_init()) | ||
157 | */ | ||
158 | static inline void percpu_ref_put(struct percpu_ref *ref) | ||
159 | { | ||
160 | unsigned __percpu *pcpu_count; | ||
161 | |||
162 | rcu_read_lock_sched(); | ||
163 | |||
164 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | ||
165 | |||
166 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) | ||
167 | __this_cpu_dec(*pcpu_count); | ||
168 | else if (unlikely(atomic_dec_and_test(&ref->count))) | ||
169 | ref->release(ref); | ||
170 | |||
171 | rcu_read_unlock_sched(); | ||
172 | } | ||
173 | |||
174 | #endif | ||
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index f463a46424e2..8873f82c7baa 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -73,13 +73,18 @@ struct perf_raw_record { | |||
73 | * | 73 | * |
74 | * support for mispred, predicted is optional. In case it | 74 | * support for mispred, predicted is optional. In case it |
75 | * is not supported mispred = predicted = 0. | 75 | * is not supported mispred = predicted = 0. |
76 | * | ||
77 | * in_tx: running in a hardware transaction | ||
78 | * abort: aborting a hardware transaction | ||
76 | */ | 79 | */ |
77 | struct perf_branch_entry { | 80 | struct perf_branch_entry { |
78 | __u64 from; | 81 | __u64 from; |
79 | __u64 to; | 82 | __u64 to; |
80 | __u64 mispred:1, /* target mispredicted */ | 83 | __u64 mispred:1, /* target mispredicted */ |
81 | predicted:1,/* target predicted */ | 84 | predicted:1,/* target predicted */ |
82 | reserved:62; | 85 | in_tx:1, /* in transaction */ |
86 | abort:1, /* transaction abort */ | ||
87 | reserved:60; | ||
83 | }; | 88 | }; |
84 | 89 | ||
85 | /* | 90 | /* |
@@ -113,6 +118,8 @@ struct hw_perf_event_extra { | |||
113 | int idx; /* index in shared_regs->regs[] */ | 118 | int idx; /* index in shared_regs->regs[] */ |
114 | }; | 119 | }; |
115 | 120 | ||
121 | struct event_constraint; | ||
122 | |||
116 | /** | 123 | /** |
117 | * struct hw_perf_event - performance event hardware details: | 124 | * struct hw_perf_event - performance event hardware details: |
118 | */ | 125 | */ |
@@ -131,6 +138,8 @@ struct hw_perf_event { | |||
131 | 138 | ||
132 | struct hw_perf_event_extra extra_reg; | 139 | struct hw_perf_event_extra extra_reg; |
133 | struct hw_perf_event_extra branch_reg; | 140 | struct hw_perf_event_extra branch_reg; |
141 | |||
142 | struct event_constraint *constraint; | ||
134 | }; | 143 | }; |
135 | struct { /* software */ | 144 | struct { /* software */ |
136 | struct hrtimer hrtimer; | 145 | struct hrtimer hrtimer; |
@@ -188,12 +197,13 @@ struct pmu { | |||
188 | 197 | ||
189 | struct device *dev; | 198 | struct device *dev; |
190 | const struct attribute_group **attr_groups; | 199 | const struct attribute_group **attr_groups; |
191 | char *name; | 200 | const char *name; |
192 | int type; | 201 | int type; |
193 | 202 | ||
194 | int * __percpu pmu_disable_count; | 203 | int * __percpu pmu_disable_count; |
195 | struct perf_cpu_context * __percpu pmu_cpu_context; | 204 | struct perf_cpu_context * __percpu pmu_cpu_context; |
196 | int task_ctx_nr; | 205 | int task_ctx_nr; |
206 | int hrtimer_interval_ms; | ||
197 | 207 | ||
198 | /* | 208 | /* |
199 | * Fully disable/enable this PMU, can be used to protect from the PMI | 209 | * Fully disable/enable this PMU, can be used to protect from the PMI |
@@ -389,8 +399,7 @@ struct perf_event { | |||
389 | /* mmap bits */ | 399 | /* mmap bits */ |
390 | struct mutex mmap_mutex; | 400 | struct mutex mmap_mutex; |
391 | atomic_t mmap_count; | 401 | atomic_t mmap_count; |
392 | int mmap_locked; | 402 | |
393 | struct user_struct *mmap_user; | ||
394 | struct ring_buffer *rb; | 403 | struct ring_buffer *rb; |
395 | struct list_head rb_entry; | 404 | struct list_head rb_entry; |
396 | 405 | ||
@@ -501,8 +510,9 @@ struct perf_cpu_context { | |||
501 | struct perf_event_context *task_ctx; | 510 | struct perf_event_context *task_ctx; |
502 | int active_oncpu; | 511 | int active_oncpu; |
503 | int exclusive; | 512 | int exclusive; |
513 | struct hrtimer hrtimer; | ||
514 | ktime_t hrtimer_interval; | ||
504 | struct list_head rotation_list; | 515 | struct list_head rotation_list; |
505 | int jiffies_interval; | ||
506 | struct pmu *unique_pmu; | 516 | struct pmu *unique_pmu; |
507 | struct perf_cgroup *cgrp; | 517 | struct perf_cgroup *cgrp; |
508 | }; | 518 | }; |
@@ -518,7 +528,7 @@ struct perf_output_handle { | |||
518 | 528 | ||
519 | #ifdef CONFIG_PERF_EVENTS | 529 | #ifdef CONFIG_PERF_EVENTS |
520 | 530 | ||
521 | extern int perf_pmu_register(struct pmu *pmu, char *name, int type); | 531 | extern int perf_pmu_register(struct pmu *pmu, const char *name, int type); |
522 | extern void perf_pmu_unregister(struct pmu *pmu); | 532 | extern void perf_pmu_unregister(struct pmu *pmu); |
523 | 533 | ||
524 | extern int perf_num_counters(void); | 534 | extern int perf_num_counters(void); |
@@ -696,10 +706,17 @@ static inline void perf_callchain_store(struct perf_callchain_entry *entry, u64 | |||
696 | extern int sysctl_perf_event_paranoid; | 706 | extern int sysctl_perf_event_paranoid; |
697 | extern int sysctl_perf_event_mlock; | 707 | extern int sysctl_perf_event_mlock; |
698 | extern int sysctl_perf_event_sample_rate; | 708 | extern int sysctl_perf_event_sample_rate; |
709 | extern int sysctl_perf_cpu_time_max_percent; | ||
710 | |||
711 | extern void perf_sample_event_took(u64 sample_len_ns); | ||
699 | 712 | ||
700 | extern int perf_proc_update_handler(struct ctl_table *table, int write, | 713 | extern int perf_proc_update_handler(struct ctl_table *table, int write, |
701 | void __user *buffer, size_t *lenp, | 714 | void __user *buffer, size_t *lenp, |
702 | loff_t *ppos); | 715 | loff_t *ppos); |
716 | extern int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write, | ||
717 | void __user *buffer, size_t *lenp, | ||
718 | loff_t *ppos); | ||
719 | |||
703 | 720 | ||
704 | static inline bool perf_paranoid_tracepoint_raw(void) | 721 | static inline bool perf_paranoid_tracepoint_raw(void) |
705 | { | 722 | { |
@@ -743,6 +760,7 @@ extern unsigned int perf_output_skip(struct perf_output_handle *handle, | |||
743 | unsigned int len); | 760 | unsigned int len); |
744 | extern int perf_swevent_get_recursion_context(void); | 761 | extern int perf_swevent_get_recursion_context(void); |
745 | extern void perf_swevent_put_recursion_context(int rctx); | 762 | extern void perf_swevent_put_recursion_context(int rctx); |
763 | extern u64 perf_swevent_set_period(struct perf_event *event); | ||
746 | extern void perf_event_enable(struct perf_event *event); | 764 | extern void perf_event_enable(struct perf_event *event); |
747 | extern void perf_event_disable(struct perf_event *event); | 765 | extern void perf_event_disable(struct perf_event *event); |
748 | extern int __perf_event_disable(void *info); | 766 | extern int __perf_event_disable(void *info); |
@@ -782,6 +800,7 @@ static inline void perf_event_fork(struct task_struct *tsk) { } | |||
782 | static inline void perf_event_init(void) { } | 800 | static inline void perf_event_init(void) { } |
783 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | 801 | static inline int perf_swevent_get_recursion_context(void) { return -1; } |
784 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 802 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
803 | static inline u64 perf_swevent_set_period(struct perf_event *event) { return 0; } | ||
785 | static inline void perf_event_enable(struct perf_event *event) { } | 804 | static inline void perf_event_enable(struct perf_event *event) { } |
786 | static inline void perf_event_disable(struct perf_event *event) { } | 805 | static inline void perf_event_disable(struct perf_event *event) { } |
787 | static inline int __perf_event_disable(void *info) { return -1; } | 806 | static inline int __perf_event_disable(void *info) { return -1; } |
@@ -803,7 +822,7 @@ static inline void perf_restore_debug_store(void) { } | |||
803 | #define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x)) | 822 | #define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x)) |
804 | 823 | ||
805 | /* | 824 | /* |
806 | * This has to have a higher priority than migration_notifier in sched.c. | 825 | * This has to have a higher priority than migration_notifier in sched/core.c. |
807 | */ | 826 | */ |
808 | #define perf_cpu_notifier(fn) \ | 827 | #define perf_cpu_notifier(fn) \ |
809 | do { \ | 828 | do { \ |
diff --git a/include/linux/platform_data/ad7303.h b/include/linux/platform_data/ad7303.h new file mode 100644 index 000000000000..de6a7a6b4bbf --- /dev/null +++ b/include/linux/platform_data/ad7303.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Analog Devices AD7303 DAC driver | ||
3 | * | ||
4 | * Copyright 2013 Analog Devices Inc. | ||
5 | * | ||
6 | * Licensed under the GPL-2. | ||
7 | */ | ||
8 | |||
9 | #ifndef __IIO_ADC_AD7303_H__ | ||
10 | #define __IIO_ADC_AD7303_H__ | ||
11 | |||
12 | /** | ||
13 | * struct ad7303_platform_data - AD7303 platform data | ||
14 | * @use_external_ref: If set to true use an external voltage reference connected | ||
15 | * to the REF pin, otherwise use the internal reference derived from Vdd. | ||
16 | */ | ||
17 | struct ad7303_platform_data { | ||
18 | bool use_external_ref; | ||
19 | }; | ||
20 | |||
21 | #endif | ||
diff --git a/include/linux/platform_data/dma-ste-dma40.h b/include/linux/platform_data/dma-ste-dma40.h index 4b781014b0a0..1bb9b1852256 100644 --- a/include/linux/platform_data/dma-ste-dma40.h +++ b/include/linux/platform_data/dma-ste-dma40.h | |||
@@ -70,23 +70,8 @@ enum stedma40_flow_ctrl { | |||
70 | STEDMA40_FLOW_CTRL, | 70 | STEDMA40_FLOW_CTRL, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | enum stedma40_periph_data_width { | ||
74 | STEDMA40_BYTE_WIDTH = STEDMA40_ESIZE_8_BIT, | ||
75 | STEDMA40_HALFWORD_WIDTH = STEDMA40_ESIZE_16_BIT, | ||
76 | STEDMA40_WORD_WIDTH = STEDMA40_ESIZE_32_BIT, | ||
77 | STEDMA40_DOUBLEWORD_WIDTH = STEDMA40_ESIZE_64_BIT | ||
78 | }; | ||
79 | |||
80 | enum stedma40_xfer_dir { | ||
81 | STEDMA40_MEM_TO_MEM = 1, | ||
82 | STEDMA40_MEM_TO_PERIPH, | ||
83 | STEDMA40_PERIPH_TO_MEM, | ||
84 | STEDMA40_PERIPH_TO_PERIPH | ||
85 | }; | ||
86 | |||
87 | |||
88 | /** | 73 | /** |
89 | * struct stedma40_chan_cfg - dst/src channel configuration | 74 | * struct stedma40_half_channel_info - dst/src channel configuration |
90 | * | 75 | * |
91 | * @big_endian: true if the src/dst should be read as big endian | 76 | * @big_endian: true if the src/dst should be read as big endian |
92 | * @data_width: Data width of the src/dst hardware | 77 | * @data_width: Data width of the src/dst hardware |
@@ -95,7 +80,7 @@ enum stedma40_xfer_dir { | |||
95 | */ | 80 | */ |
96 | struct stedma40_half_channel_info { | 81 | struct stedma40_half_channel_info { |
97 | bool big_endian; | 82 | bool big_endian; |
98 | enum stedma40_periph_data_width data_width; | 83 | enum dma_slave_buswidth data_width; |
99 | int psize; | 84 | int psize; |
100 | enum stedma40_flow_ctrl flow_ctrl; | 85 | enum stedma40_flow_ctrl flow_ctrl; |
101 | }; | 86 | }; |
@@ -109,8 +94,7 @@ struct stedma40_half_channel_info { | |||
109 | * version 3+, i.e DB8500v2+ | 94 | * version 3+, i.e DB8500v2+ |
110 | * @mode: channel mode: physical, logical, or operation | 95 | * @mode: channel mode: physical, logical, or operation |
111 | * @mode_opt: options for the chosen channel mode | 96 | * @mode_opt: options for the chosen channel mode |
112 | * @src_dev_type: Src device type | 97 | * @dev_type: src/dst device type (driver uses dir to figure out which) |
113 | * @dst_dev_type: Dst device type | ||
114 | * @src_info: Parameters for dst half channel | 98 | * @src_info: Parameters for dst half channel |
115 | * @dst_info: Parameters for dst half channel | 99 | * @dst_info: Parameters for dst half channel |
116 | * @use_fixed_channel: if true, use physical channel specified by phy_channel | 100 | * @use_fixed_channel: if true, use physical channel specified by phy_channel |
@@ -121,13 +105,12 @@ struct stedma40_half_channel_info { | |||
121 | * | 105 | * |
122 | */ | 106 | */ |
123 | struct stedma40_chan_cfg { | 107 | struct stedma40_chan_cfg { |
124 | enum stedma40_xfer_dir dir; | 108 | enum dma_transfer_direction dir; |
125 | bool high_priority; | 109 | bool high_priority; |
126 | bool realtime; | 110 | bool realtime; |
127 | enum stedma40_mode mode; | 111 | enum stedma40_mode mode; |
128 | enum stedma40_mode_opt mode_opt; | 112 | enum stedma40_mode_opt mode_opt; |
129 | int src_dev_type; | 113 | int dev_type; |
130 | int dst_dev_type; | ||
131 | struct stedma40_half_channel_info src_info; | 114 | struct stedma40_half_channel_info src_info; |
132 | struct stedma40_half_channel_info dst_info; | 115 | struct stedma40_half_channel_info dst_info; |
133 | 116 | ||
@@ -138,13 +121,8 @@ struct stedma40_chan_cfg { | |||
138 | /** | 121 | /** |
139 | * struct stedma40_platform_data - Configuration struct for the dma device. | 122 | * struct stedma40_platform_data - Configuration struct for the dma device. |
140 | * | 123 | * |
141 | * @dev_len: length of dev_tx and dev_rx | ||
142 | * @dev_tx: mapping between destination event line and io address | 124 | * @dev_tx: mapping between destination event line and io address |
143 | * @dev_rx: mapping between source event line and io address | 125 | * @dev_rx: mapping between source event line and io address |
144 | * @memcpy: list of memcpy event lines | ||
145 | * @memcpy_len: length of memcpy | ||
146 | * @memcpy_conf_phy: default configuration of physical channel memcpy | ||
147 | * @memcpy_conf_log: default configuration of logical channel memcpy | ||
148 | * @disabled_channels: A vector, ending with -1, that marks physical channels | 126 | * @disabled_channels: A vector, ending with -1, that marks physical channels |
149 | * that are for different reasons not available for the driver. | 127 | * that are for different reasons not available for the driver. |
150 | * @soft_lli_chans: A vector, that marks physical channels will use LLI by SW | 128 | * @soft_lli_chans: A vector, that marks physical channels will use LLI by SW |
@@ -154,22 +132,17 @@ struct stedma40_chan_cfg { | |||
154 | * @num_of_soft_lli_chans: The number of channels that needs to be configured | 132 | * @num_of_soft_lli_chans: The number of channels that needs to be configured |
155 | * to use SoftLLI. | 133 | * to use SoftLLI. |
156 | * @use_esram_lcla: flag for mapping the lcla into esram region | 134 | * @use_esram_lcla: flag for mapping the lcla into esram region |
135 | * @num_of_memcpy_chans: The number of channels reserved for memcpy. | ||
157 | * @num_of_phy_chans: The number of physical channels implemented in HW. | 136 | * @num_of_phy_chans: The number of physical channels implemented in HW. |
158 | * 0 means reading the number of channels from DMA HW but this is only valid | 137 | * 0 means reading the number of channels from DMA HW but this is only valid |
159 | * for 'multiple of 4' channels, like 8. | 138 | * for 'multiple of 4' channels, like 8. |
160 | */ | 139 | */ |
161 | struct stedma40_platform_data { | 140 | struct stedma40_platform_data { |
162 | u32 dev_len; | ||
163 | const dma_addr_t *dev_tx; | ||
164 | const dma_addr_t *dev_rx; | ||
165 | int *memcpy; | ||
166 | u32 memcpy_len; | ||
167 | struct stedma40_chan_cfg *memcpy_conf_phy; | ||
168 | struct stedma40_chan_cfg *memcpy_conf_log; | ||
169 | int disabled_channels[STEDMA40_MAX_PHYS]; | 141 | int disabled_channels[STEDMA40_MAX_PHYS]; |
170 | int *soft_lli_chans; | 142 | int *soft_lli_chans; |
171 | int num_of_soft_lli_chans; | 143 | int num_of_soft_lli_chans; |
172 | bool use_esram_lcla; | 144 | bool use_esram_lcla; |
145 | int num_of_memcpy_chans; | ||
173 | int num_of_phy_chans; | 146 | int num_of_phy_chans; |
174 | }; | 147 | }; |
175 | 148 | ||
diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h new file mode 100644 index 000000000000..57300fd7cc03 --- /dev/null +++ b/include/linux/platform_data/edma.h | |||
@@ -0,0 +1,183 @@ | |||
1 | /* | ||
2 | * TI EDMA definitions | ||
3 | * | ||
4 | * Copyright (C) 2006-2013 Texas Instruments. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License as published by the | ||
8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
9 | * option) any later version. | ||
10 | */ | ||
11 | |||
12 | /* | ||
13 | * This EDMA3 programming framework exposes two basic kinds of resource: | ||
14 | * | ||
15 | * Channel Triggers transfers, usually from a hardware event but | ||
16 | * also manually or by "chaining" from DMA completions. | ||
17 | * Each channel is coupled to a Parameter RAM (PaRAM) slot. | ||
18 | * | ||
19 | * Slot Each PaRAM slot holds a DMA transfer descriptor (PaRAM | ||
20 | * "set"), source and destination addresses, a link to a | ||
21 | * next PaRAM slot (if any), options for the transfer, and | ||
22 | * instructions for updating those addresses. There are | ||
23 | * more than twice as many slots as event channels. | ||
24 | * | ||
25 | * Each PaRAM set describes a sequence of transfers, either for one large | ||
26 | * buffer or for several discontiguous smaller buffers. An EDMA transfer | ||
27 | * is driven only from a channel, which performs the transfers specified | ||
28 | * in its PaRAM slot until there are no more transfers. When that last | ||
29 | * transfer completes, the "link" field may be used to reload the channel's | ||
30 | * PaRAM slot with a new transfer descriptor. | ||
31 | * | ||
32 | * The EDMA Channel Controller (CC) maps requests from channels into physical | ||
33 | * Transfer Controller (TC) requests when the channel triggers (by hardware | ||
34 | * or software events, or by chaining). The two physical DMA channels provided | ||
35 | * by the TCs are thus shared by many logical channels. | ||
36 | * | ||
37 | * DaVinci hardware also has a "QDMA" mechanism which is not currently | ||
38 | * supported through this interface. (DSP firmware uses it though.) | ||
39 | */ | ||
40 | |||
41 | #ifndef EDMA_H_ | ||
42 | #define EDMA_H_ | ||
43 | |||
44 | /* PaRAM slots are laid out like this */ | ||
45 | struct edmacc_param { | ||
46 | unsigned int opt; | ||
47 | unsigned int src; | ||
48 | unsigned int a_b_cnt; | ||
49 | unsigned int dst; | ||
50 | unsigned int src_dst_bidx; | ||
51 | unsigned int link_bcntrld; | ||
52 | unsigned int src_dst_cidx; | ||
53 | unsigned int ccnt; | ||
54 | }; | ||
55 | |||
56 | /* fields in edmacc_param.opt */ | ||
57 | #define SAM BIT(0) | ||
58 | #define DAM BIT(1) | ||
59 | #define SYNCDIM BIT(2) | ||
60 | #define STATIC BIT(3) | ||
61 | #define EDMA_FWID (0x07 << 8) | ||
62 | #define TCCMODE BIT(11) | ||
63 | #define EDMA_TCC(t) ((t) << 12) | ||
64 | #define TCINTEN BIT(20) | ||
65 | #define ITCINTEN BIT(21) | ||
66 | #define TCCHEN BIT(22) | ||
67 | #define ITCCHEN BIT(23) | ||
68 | |||
69 | /*ch_status paramater of callback function possible values*/ | ||
70 | #define DMA_COMPLETE 1 | ||
71 | #define DMA_CC_ERROR 2 | ||
72 | #define DMA_TC1_ERROR 3 | ||
73 | #define DMA_TC2_ERROR 4 | ||
74 | |||
75 | enum address_mode { | ||
76 | INCR = 0, | ||
77 | FIFO = 1 | ||
78 | }; | ||
79 | |||
80 | enum fifo_width { | ||
81 | W8BIT = 0, | ||
82 | W16BIT = 1, | ||
83 | W32BIT = 2, | ||
84 | W64BIT = 3, | ||
85 | W128BIT = 4, | ||
86 | W256BIT = 5 | ||
87 | }; | ||
88 | |||
89 | enum dma_event_q { | ||
90 | EVENTQ_0 = 0, | ||
91 | EVENTQ_1 = 1, | ||
92 | EVENTQ_2 = 2, | ||
93 | EVENTQ_3 = 3, | ||
94 | EVENTQ_DEFAULT = -1 | ||
95 | }; | ||
96 | |||
97 | enum sync_dimension { | ||
98 | ASYNC = 0, | ||
99 | ABSYNC = 1 | ||
100 | }; | ||
101 | |||
102 | #define EDMA_CTLR_CHAN(ctlr, chan) (((ctlr) << 16) | (chan)) | ||
103 | #define EDMA_CTLR(i) ((i) >> 16) | ||
104 | #define EDMA_CHAN_SLOT(i) ((i) & 0xffff) | ||
105 | |||
106 | #define EDMA_CHANNEL_ANY -1 /* for edma_alloc_channel() */ | ||
107 | #define EDMA_SLOT_ANY -1 /* for edma_alloc_slot() */ | ||
108 | #define EDMA_CONT_PARAMS_ANY 1001 | ||
109 | #define EDMA_CONT_PARAMS_FIXED_EXACT 1002 | ||
110 | #define EDMA_CONT_PARAMS_FIXED_NOT_EXACT 1003 | ||
111 | |||
112 | #define EDMA_MAX_CC 2 | ||
113 | |||
114 | /* alloc/free DMA channels and their dedicated parameter RAM slots */ | ||
115 | int edma_alloc_channel(int channel, | ||
116 | void (*callback)(unsigned channel, u16 ch_status, void *data), | ||
117 | void *data, enum dma_event_q); | ||
118 | void edma_free_channel(unsigned channel); | ||
119 | |||
120 | /* alloc/free parameter RAM slots */ | ||
121 | int edma_alloc_slot(unsigned ctlr, int slot); | ||
122 | void edma_free_slot(unsigned slot); | ||
123 | |||
124 | /* alloc/free a set of contiguous parameter RAM slots */ | ||
125 | int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count); | ||
126 | int edma_free_cont_slots(unsigned slot, int count); | ||
127 | |||
128 | /* calls that operate on part of a parameter RAM slot */ | ||
129 | void edma_set_src(unsigned slot, dma_addr_t src_port, | ||
130 | enum address_mode mode, enum fifo_width); | ||
131 | void edma_set_dest(unsigned slot, dma_addr_t dest_port, | ||
132 | enum address_mode mode, enum fifo_width); | ||
133 | void edma_get_position(unsigned slot, dma_addr_t *src, dma_addr_t *dst); | ||
134 | void edma_set_src_index(unsigned slot, s16 src_bidx, s16 src_cidx); | ||
135 | void edma_set_dest_index(unsigned slot, s16 dest_bidx, s16 dest_cidx); | ||
136 | void edma_set_transfer_params(unsigned slot, u16 acnt, u16 bcnt, u16 ccnt, | ||
137 | u16 bcnt_rld, enum sync_dimension sync_mode); | ||
138 | void edma_link(unsigned from, unsigned to); | ||
139 | void edma_unlink(unsigned from); | ||
140 | |||
141 | /* calls that operate on an entire parameter RAM slot */ | ||
142 | void edma_write_slot(unsigned slot, const struct edmacc_param *params); | ||
143 | void edma_read_slot(unsigned slot, struct edmacc_param *params); | ||
144 | |||
145 | /* channel control operations */ | ||
146 | int edma_start(unsigned channel); | ||
147 | void edma_stop(unsigned channel); | ||
148 | void edma_clean_channel(unsigned channel); | ||
149 | void edma_clear_event(unsigned channel); | ||
150 | void edma_pause(unsigned channel); | ||
151 | void edma_resume(unsigned channel); | ||
152 | |||
153 | struct edma_rsv_info { | ||
154 | |||
155 | const s16 (*rsv_chans)[2]; | ||
156 | const s16 (*rsv_slots)[2]; | ||
157 | }; | ||
158 | |||
159 | /* platform_data for EDMA driver */ | ||
160 | struct edma_soc_info { | ||
161 | |||
162 | /* how many dma resources of each type */ | ||
163 | unsigned n_channel; | ||
164 | unsigned n_region; | ||
165 | unsigned n_slot; | ||
166 | unsigned n_tc; | ||
167 | unsigned n_cc; | ||
168 | /* | ||
169 | * Default queue is expected to be a low-priority queue. | ||
170 | * This way, long transfers on the default queue started | ||
171 | * by the codec engine will not cause audio defects. | ||
172 | */ | ||
173 | enum dma_event_q default_queue; | ||
174 | |||
175 | /* Resource reservation for other cores */ | ||
176 | struct edma_rsv_info *rsv; | ||
177 | |||
178 | s8 (*queue_tc_mapping)[2]; | ||
179 | s8 (*queue_priority_mapping)[2]; | ||
180 | const s16 (*xbar_chans)[2]; | ||
181 | }; | ||
182 | |||
183 | #endif | ||
diff --git a/include/linux/platform_data/gpio-rcar.h b/include/linux/platform_data/gpio-rcar.h index b253f77a7ddf..2d8d69432813 100644 --- a/include/linux/platform_data/gpio-rcar.h +++ b/include/linux/platform_data/gpio-rcar.h | |||
@@ -17,10 +17,13 @@ | |||
17 | #define __GPIO_RCAR_H__ | 17 | #define __GPIO_RCAR_H__ |
18 | 18 | ||
19 | struct gpio_rcar_config { | 19 | struct gpio_rcar_config { |
20 | unsigned int gpio_base; | 20 | int gpio_base; |
21 | unsigned int irq_base; | 21 | unsigned int irq_base; |
22 | unsigned int number_of_pins; | 22 | unsigned int number_of_pins; |
23 | const char *pctl_name; | 23 | const char *pctl_name; |
24 | unsigned has_both_edge_trigger:1; | ||
24 | }; | 25 | }; |
25 | 26 | ||
27 | #define RCAR_GP_PIN(bank, pin) (((bank) * 32) + (pin)) | ||
28 | |||
26 | #endif /* __GPIO_RCAR_H__ */ | 29 | #endif /* __GPIO_RCAR_H__ */ |
diff --git a/include/linux/platform_data/mailbox-omap.h b/include/linux/platform_data/mailbox-omap.h new file mode 100644 index 000000000000..4631dbb4255e --- /dev/null +++ b/include/linux/platform_data/mailbox-omap.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * mailbox-omap.h | ||
3 | * | ||
4 | * Copyright (C) 2013 Texas Instruments, Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * version 2 as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef _PLAT_MAILBOX_H | ||
17 | #define _PLAT_MAILBOX_H | ||
18 | |||
19 | /* Interrupt register configuration types */ | ||
20 | #define MBOX_INTR_CFG_TYPE1 (0) | ||
21 | #define MBOX_INTR_CFG_TYPE2 (1) | ||
22 | |||
23 | /** | ||
24 | * struct omap_mbox_dev_info - OMAP mailbox device attribute info | ||
25 | * @name: name of the mailbox device | ||
26 | * @tx_id: mailbox queue id used for transmitting messages | ||
27 | * @rx_id: mailbox queue id on which messages are received | ||
28 | * @irq_id: irq identifier number to use from the hwmod data | ||
29 | * @usr_id: mailbox user id for identifying the interrupt into | ||
30 | * the MPU interrupt controller. | ||
31 | */ | ||
32 | struct omap_mbox_dev_info { | ||
33 | const char *name; | ||
34 | u32 tx_id; | ||
35 | u32 rx_id; | ||
36 | u32 irq_id; | ||
37 | u32 usr_id; | ||
38 | }; | ||
39 | |||
40 | /** | ||
41 | * struct omap_mbox_pdata - OMAP mailbox platform data | ||
42 | * @intr_type: type of interrupt configuration registers used | ||
43 | while programming mailbox queue interrupts | ||
44 | * @num_users: number of users (processor devices) that the mailbox | ||
45 | * h/w block can interrupt | ||
46 | * @num_fifos: number of h/w fifos within the mailbox h/w block | ||
47 | * @info_cnt: number of mailbox devices for the platform | ||
48 | * @info: array of mailbox device attributes | ||
49 | */ | ||
50 | struct omap_mbox_pdata { | ||
51 | u32 intr_type; | ||
52 | u32 num_users; | ||
53 | u32 num_fifos; | ||
54 | u32 info_cnt; | ||
55 | struct omap_mbox_dev_info *info; | ||
56 | }; | ||
57 | |||
58 | #endif /* _PLAT_MAILBOX_H */ | ||
diff --git a/include/linux/platform_data/omap_ocp2scp.h b/include/linux/platform_data/omap_ocp2scp.h deleted file mode 100644 index 5c6c3939355f..000000000000 --- a/include/linux/platform_data/omap_ocp2scp.h +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* | ||
2 | * omap_ocp2scp.h -- ocp2scp header file | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * Author: Kishon Vijay Abraham I <kishon@ti.com> | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #ifndef __DRIVERS_OMAP_OCP2SCP_H | ||
20 | #define __DRIVERS_OMAP_OCP2SCP_H | ||
21 | |||
22 | struct omap_ocp2scp_dev { | ||
23 | const char *drv_name; | ||
24 | struct resource *res; | ||
25 | }; | ||
26 | |||
27 | struct omap_ocp2scp_platform_data { | ||
28 | int dev_cnt; | ||
29 | struct omap_ocp2scp_dev **devices; | ||
30 | }; | ||
31 | #endif /* __DRIVERS_OMAP_OCP2SCP_H */ | ||
diff --git a/include/linux/platform_data/pinctrl-coh901.h b/include/linux/platform_data/pinctrl-coh901.h deleted file mode 100644 index dfbc65d10484..000000000000 --- a/include/linux/platform_data/pinctrl-coh901.h +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2012 ST-Ericsson AB | ||
3 | * License terms: GNU General Public License (GPL) version 2 | ||
4 | * GPIO block resgister definitions and inline macros for | ||
5 | * U300 GPIO COH 901 335 or COH 901 571/3 | ||
6 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
7 | */ | ||
8 | |||
9 | #ifndef __MACH_U300_GPIO_U300_H | ||
10 | #define __MACH_U300_GPIO_U300_H | ||
11 | |||
12 | /** | ||
13 | * struct u300_gpio_platform - U300 GPIO platform data | ||
14 | * @ports: number of GPIO block ports | ||
15 | * @gpio_base: first GPIO number for this block (use a free range) | ||
16 | */ | ||
17 | struct u300_gpio_platform { | ||
18 | u8 ports; | ||
19 | int gpio_base; | ||
20 | }; | ||
21 | |||
22 | #endif /* __MACH_U300_GPIO_U300_H */ | ||
diff --git a/include/linux/platform_data/spi-davinci.h b/include/linux/platform_data/spi-davinci.h index 7af305b37868..8dc2fa47a2aa 100644 --- a/include/linux/platform_data/spi-davinci.h +++ b/include/linux/platform_data/spi-davinci.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #ifndef __ARCH_ARM_DAVINCI_SPI_H | 19 | #ifndef __ARCH_ARM_DAVINCI_SPI_H |
20 | #define __ARCH_ARM_DAVINCI_SPI_H | 20 | #define __ARCH_ARM_DAVINCI_SPI_H |
21 | 21 | ||
22 | #include <mach/edma.h> | 22 | #include <linux/platform_data/edma.h> |
23 | 23 | ||
24 | #define SPI_INTERN_CS 0xFF | 24 | #define SPI_INTERN_CS 0xFF |
25 | 25 | ||
diff --git a/include/linux/platform_data/usb-musb-ux500.h b/include/linux/platform_data/usb-musb-ux500.h index 4c1cc50a595a..dd9c83ac7de0 100644 --- a/include/linux/platform_data/usb-musb-ux500.h +++ b/include/linux/platform_data/usb-musb-ux500.h | |||
@@ -9,14 +9,11 @@ | |||
9 | 9 | ||
10 | #include <linux/dmaengine.h> | 10 | #include <linux/dmaengine.h> |
11 | 11 | ||
12 | #define UX500_MUSB_DMA_NUM_RX_CHANNELS 8 | 12 | #define UX500_MUSB_DMA_NUM_RX_TX_CHANNELS 8 |
13 | #define UX500_MUSB_DMA_NUM_TX_CHANNELS 8 | ||
14 | 13 | ||
15 | struct ux500_musb_board_data { | 14 | struct ux500_musb_board_data { |
16 | void **dma_rx_param_array; | 15 | void **dma_rx_param_array; |
17 | void **dma_tx_param_array; | 16 | void **dma_tx_param_array; |
18 | u32 num_rx_channels; | ||
19 | u32 num_tx_channels; | ||
20 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); | 17 | bool (*dma_filter)(struct dma_chan *chan, void *filter_param); |
21 | }; | 18 | }; |
22 | 19 | ||
diff --git a/include/linux/platform_data/usb-rcar-phy.h b/include/linux/platform_data/usb-rcar-phy.h new file mode 100644 index 000000000000..8ec6964a32a5 --- /dev/null +++ b/include/linux/platform_data/usb-rcar-phy.h | |||
@@ -0,0 +1,28 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2013 Renesas Solutions Corp. | ||
3 | * Copyright (C) 2013 Cogent Embedded, Inc. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef __USB_RCAR_PHY_H | ||
11 | #define __USB_RCAR_PHY_H | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | |||
15 | struct rcar_phy_platform_data { | ||
16 | bool ferrite_bead:1; /* (R8A7778 only) */ | ||
17 | |||
18 | bool port1_func:1; /* true: port 1 used by function, false: host */ | ||
19 | unsigned penc1:1; /* Output of the PENC1 pin in function mode */ | ||
20 | struct { /* Overcurrent pin control for ports 0..2 */ | ||
21 | bool select_3_3v:1; /* true: USB_OVCn pin, false: OVCn pin */ | ||
22 | /* Set to false on port 1 in function mode */ | ||
23 | bool active_high:1; /* true: active high, false: active low */ | ||
24 | /* Set to true on port 1 in function mode */ | ||
25 | } ovc_pin[3]; /* (R8A7778 only has 2 ports) */ | ||
26 | }; | ||
27 | |||
28 | #endif /* __USB_RCAR_PHY_H */ | ||
diff --git a/include/linux/platform_data/usb3503.h b/include/linux/platform_data/usb3503.h index 85dcc709f7e9..1d1b6ef871f6 100644 --- a/include/linux/platform_data/usb3503.h +++ b/include/linux/platform_data/usb3503.h | |||
@@ -3,6 +3,10 @@ | |||
3 | 3 | ||
4 | #define USB3503_I2C_NAME "usb3503" | 4 | #define USB3503_I2C_NAME "usb3503" |
5 | 5 | ||
6 | #define USB3503_OFF_PORT1 (1 << 1) | ||
7 | #define USB3503_OFF_PORT2 (1 << 2) | ||
8 | #define USB3503_OFF_PORT3 (1 << 3) | ||
9 | |||
6 | enum usb3503_mode { | 10 | enum usb3503_mode { |
7 | USB3503_MODE_UNKNOWN, | 11 | USB3503_MODE_UNKNOWN, |
8 | USB3503_MODE_HUB, | 12 | USB3503_MODE_HUB, |
@@ -11,6 +15,7 @@ enum usb3503_mode { | |||
11 | 15 | ||
12 | struct usb3503_platform_data { | 16 | struct usb3503_platform_data { |
13 | enum usb3503_mode initial_mode; | 17 | enum usb3503_mode initial_mode; |
18 | u8 port_off_mask; | ||
14 | int gpio_intn; | 19 | int gpio_intn; |
15 | int gpio_connect; | 20 | int gpio_connect; |
16 | int gpio_reset; | 21 | int gpio_reset; |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 9abf1db6aea6..cd46ee58b9dc 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -180,7 +180,13 @@ struct platform_driver { | |||
180 | const struct platform_device_id *id_table; | 180 | const struct platform_device_id *id_table; |
181 | }; | 181 | }; |
182 | 182 | ||
183 | extern int platform_driver_register(struct platform_driver *); | 183 | /* |
184 | * use a macro to avoid include chaining to get THIS_MODULE | ||
185 | */ | ||
186 | #define platform_driver_register(drv) \ | ||
187 | __platform_driver_register(drv, THIS_MODULE) | ||
188 | extern int __platform_driver_register(struct platform_driver *, | ||
189 | struct module *); | ||
184 | extern void platform_driver_unregister(struct platform_driver *); | 190 | extern void platform_driver_unregister(struct platform_driver *); |
185 | 191 | ||
186 | /* non-hotpluggable platform devices may use this so that probe() and | 192 | /* non-hotpluggable platform devices may use this so that probe() and |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 87a03c746f17..f5d4723cdb3d 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -33,9 +33,25 @@ do { \ | |||
33 | preempt_schedule(); \ | 33 | preempt_schedule(); \ |
34 | } while (0) | 34 | } while (0) |
35 | 35 | ||
36 | #ifdef CONFIG_CONTEXT_TRACKING | ||
37 | |||
38 | void preempt_schedule_context(void); | ||
39 | |||
40 | #define preempt_check_resched_context() \ | ||
41 | do { \ | ||
42 | if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \ | ||
43 | preempt_schedule_context(); \ | ||
44 | } while (0) | ||
45 | #else | ||
46 | |||
47 | #define preempt_check_resched_context() preempt_check_resched() | ||
48 | |||
49 | #endif /* CONFIG_CONTEXT_TRACKING */ | ||
50 | |||
36 | #else /* !CONFIG_PREEMPT */ | 51 | #else /* !CONFIG_PREEMPT */ |
37 | 52 | ||
38 | #define preempt_check_resched() do { } while (0) | 53 | #define preempt_check_resched() do { } while (0) |
54 | #define preempt_check_resched_context() do { } while (0) | ||
39 | 55 | ||
40 | #endif /* CONFIG_PREEMPT */ | 56 | #endif /* CONFIG_PREEMPT */ |
41 | 57 | ||
@@ -88,7 +104,7 @@ do { \ | |||
88 | do { \ | 104 | do { \ |
89 | preempt_enable_no_resched_notrace(); \ | 105 | preempt_enable_no_resched_notrace(); \ |
90 | barrier(); \ | 106 | barrier(); \ |
91 | preempt_check_resched(); \ | 107 | preempt_check_resched_context(); \ |
92 | } while (0) | 108 | } while (0) |
93 | 109 | ||
94 | #else /* !CONFIG_PREEMPT_COUNT */ | 110 | #else /* !CONFIG_PREEMPT_COUNT */ |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 8089e35d47ac..f4b1001a4676 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -461,6 +461,26 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
461 | &(pos)->member)), typeof(*(pos)), member)) | 461 | &(pos)->member)), typeof(*(pos)), member)) |
462 | 462 | ||
463 | /** | 463 | /** |
464 | * hlist_for_each_entry_rcu_notrace - iterate over rcu list of given type (for tracing) | ||
465 | * @pos: the type * to use as a loop cursor. | ||
466 | * @head: the head for your list. | ||
467 | * @member: the name of the hlist_node within the struct. | ||
468 | * | ||
469 | * This list-traversal primitive may safely run concurrently with | ||
470 | * the _rcu list-mutation primitives such as hlist_add_head_rcu() | ||
471 | * as long as the traversal is guarded by rcu_read_lock(). | ||
472 | * | ||
473 | * This is the same as hlist_for_each_entry_rcu() except that it does | ||
474 | * not do any RCU debugging or tracing. | ||
475 | */ | ||
476 | #define hlist_for_each_entry_rcu_notrace(pos, head, member) \ | ||
477 | for (pos = hlist_entry_safe (rcu_dereference_raw_notrace(hlist_first_rcu(head)),\ | ||
478 | typeof(*(pos)), member); \ | ||
479 | pos; \ | ||
480 | pos = hlist_entry_safe(rcu_dereference_raw_notrace(hlist_next_rcu(\ | ||
481 | &(pos)->member)), typeof(*(pos)), member)) | ||
482 | |||
483 | /** | ||
464 | * hlist_for_each_entry_rcu_bh - iterate over rcu list of given type | 484 | * hlist_for_each_entry_rcu_bh - iterate over rcu list of given type |
465 | * @pos: the type * to use as a loop cursor. | 485 | * @pos: the type * to use as a loop cursor. |
466 | * @head: the head for your list. | 486 | * @head: the head for your list. |
diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h index 2ae13714828b..1c33dd7da4a7 100644 --- a/include/linux/rculist_nulls.h +++ b/include/linux/rculist_nulls.h | |||
@@ -105,9 +105,14 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n, | |||
105 | * @head: the head for your list. | 105 | * @head: the head for your list. |
106 | * @member: the name of the hlist_nulls_node within the struct. | 106 | * @member: the name of the hlist_nulls_node within the struct. |
107 | * | 107 | * |
108 | * The barrier() is needed to make sure compiler doesn't cache first element [1], | ||
109 | * as this loop can be restarted [2] | ||
110 | * [1] Documentation/atomic_ops.txt around line 114 | ||
111 | * [2] Documentation/RCU/rculist_nulls.txt around line 146 | ||
108 | */ | 112 | */ |
109 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ | 113 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ |
110 | for (pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \ | 114 | for (({barrier();}), \ |
115 | pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \ | ||
111 | (!is_a_nulls(pos)) && \ | 116 | (!is_a_nulls(pos)) && \ |
112 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ | 117 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ |
113 | pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos))) | 118 | pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos))) |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 4ccd68e49b00..4b14bdc911d7 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -216,6 +216,7 @@ static inline int rcu_preempt_depth(void) | |||
216 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ | 216 | #endif /* #else #ifdef CONFIG_PREEMPT_RCU */ |
217 | 217 | ||
218 | /* Internal to kernel */ | 218 | /* Internal to kernel */ |
219 | extern void rcu_init(void); | ||
219 | extern void rcu_sched_qs(int cpu); | 220 | extern void rcu_sched_qs(int cpu); |
220 | extern void rcu_bh_qs(int cpu); | 221 | extern void rcu_bh_qs(int cpu); |
221 | extern void rcu_check_callbacks(int cpu, int user); | 222 | extern void rcu_check_callbacks(int cpu, int user); |
@@ -239,8 +240,6 @@ static inline void rcu_user_hooks_switch(struct task_struct *prev, | |||
239 | struct task_struct *next) { } | 240 | struct task_struct *next) { } |
240 | #endif /* CONFIG_RCU_USER_QS */ | 241 | #endif /* CONFIG_RCU_USER_QS */ |
241 | 242 | ||
242 | extern void exit_rcu(void); | ||
243 | |||
244 | /** | 243 | /** |
245 | * RCU_NONIDLE - Indicate idle-loop code that needs RCU readers | 244 | * RCU_NONIDLE - Indicate idle-loop code that needs RCU readers |
246 | * @a: Code that RCU needs to pay attention to. | 245 | * @a: Code that RCU needs to pay attention to. |
@@ -277,7 +276,7 @@ void wait_rcu_gp(call_rcu_func_t crf); | |||
277 | 276 | ||
278 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 277 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
279 | #include <linux/rcutree.h> | 278 | #include <linux/rcutree.h> |
280 | #elif defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) | 279 | #elif defined(CONFIG_TINY_RCU) |
281 | #include <linux/rcutiny.h> | 280 | #include <linux/rcutiny.h> |
282 | #else | 281 | #else |
283 | #error "Unknown RCU implementation specified to kernel configuration" | 282 | #error "Unknown RCU implementation specified to kernel configuration" |
@@ -640,6 +639,15 @@ static inline void rcu_preempt_sleep_check(void) | |||
640 | 639 | ||
641 | #define rcu_dereference_raw(p) rcu_dereference_check(p, 1) /*@@@ needed? @@@*/ | 640 | #define rcu_dereference_raw(p) rcu_dereference_check(p, 1) /*@@@ needed? @@@*/ |
642 | 641 | ||
642 | /* | ||
643 | * The tracing infrastructure traces RCU (we want that), but unfortunately | ||
644 | * some of the RCU checks causes tracing to lock up the system. | ||
645 | * | ||
646 | * The tracing version of rcu_dereference_raw() must not call | ||
647 | * rcu_read_lock_held(). | ||
648 | */ | ||
649 | #define rcu_dereference_raw_notrace(p) __rcu_dereference_check((p), 1, __rcu) | ||
650 | |||
643 | /** | 651 | /** |
644 | * rcu_access_index() - fetch RCU index with no dereferencing | 652 | * rcu_access_index() - fetch RCU index with no dereferencing |
645 | * @p: The index to read | 653 | * @p: The index to read |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 4e56a9c69a35..e31005ee339e 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -27,10 +27,6 @@ | |||
27 | 27 | ||
28 | #include <linux/cache.h> | 28 | #include <linux/cache.h> |
29 | 29 | ||
30 | static inline void rcu_init(void) | ||
31 | { | ||
32 | } | ||
33 | |||
34 | static inline void rcu_barrier_bh(void) | 30 | static inline void rcu_barrier_bh(void) |
35 | { | 31 | { |
36 | wait_rcu_gp(call_rcu_bh); | 32 | wait_rcu_gp(call_rcu_bh); |
@@ -41,8 +37,6 @@ static inline void rcu_barrier_sched(void) | |||
41 | wait_rcu_gp(call_rcu_sched); | 37 | wait_rcu_gp(call_rcu_sched); |
42 | } | 38 | } |
43 | 39 | ||
44 | #ifdef CONFIG_TINY_RCU | ||
45 | |||
46 | static inline void synchronize_rcu_expedited(void) | 40 | static inline void synchronize_rcu_expedited(void) |
47 | { | 41 | { |
48 | synchronize_sched(); /* Only one CPU, so pretty fast anyway!!! */ | 42 | synchronize_sched(); /* Only one CPU, so pretty fast anyway!!! */ |
@@ -53,17 +47,6 @@ static inline void rcu_barrier(void) | |||
53 | rcu_barrier_sched(); /* Only one CPU, so only one list of callbacks! */ | 47 | rcu_barrier_sched(); /* Only one CPU, so only one list of callbacks! */ |
54 | } | 48 | } |
55 | 49 | ||
56 | #else /* #ifdef CONFIG_TINY_RCU */ | ||
57 | |||
58 | void synchronize_rcu_expedited(void); | ||
59 | |||
60 | static inline void rcu_barrier(void) | ||
61 | { | ||
62 | wait_rcu_gp(call_rcu); | ||
63 | } | ||
64 | |||
65 | #endif /* #else #ifdef CONFIG_TINY_RCU */ | ||
66 | |||
67 | static inline void synchronize_rcu_bh(void) | 50 | static inline void synchronize_rcu_bh(void) |
68 | { | 51 | { |
69 | synchronize_sched(); | 52 | synchronize_sched(); |
@@ -85,35 +68,15 @@ static inline void kfree_call_rcu(struct rcu_head *head, | |||
85 | call_rcu(head, func); | 68 | call_rcu(head, func); |
86 | } | 69 | } |
87 | 70 | ||
88 | #ifdef CONFIG_TINY_RCU | ||
89 | |||
90 | static inline void rcu_preempt_note_context_switch(void) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) | 71 | static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) |
95 | { | 72 | { |
96 | *delta_jiffies = ULONG_MAX; | 73 | *delta_jiffies = ULONG_MAX; |
97 | return 0; | 74 | return 0; |
98 | } | 75 | } |
99 | 76 | ||
100 | #else /* #ifdef CONFIG_TINY_RCU */ | ||
101 | |||
102 | void rcu_preempt_note_context_switch(void); | ||
103 | int rcu_preempt_needs_cpu(void); | ||
104 | |||
105 | static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) | ||
106 | { | ||
107 | *delta_jiffies = ULONG_MAX; | ||
108 | return rcu_preempt_needs_cpu(); | ||
109 | } | ||
110 | |||
111 | #endif /* #else #ifdef CONFIG_TINY_RCU */ | ||
112 | |||
113 | static inline void rcu_note_context_switch(int cpu) | 77 | static inline void rcu_note_context_switch(int cpu) |
114 | { | 78 | { |
115 | rcu_sched_qs(cpu); | 79 | rcu_sched_qs(cpu); |
116 | rcu_preempt_note_context_switch(); | ||
117 | } | 80 | } |
118 | 81 | ||
119 | /* | 82 | /* |
@@ -156,6 +119,10 @@ static inline void rcu_cpu_stall_reset(void) | |||
156 | { | 119 | { |
157 | } | 120 | } |
158 | 121 | ||
122 | static inline void exit_rcu(void) | ||
123 | { | ||
124 | } | ||
125 | |||
159 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 126 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
160 | extern int rcu_scheduler_active __read_mostly; | 127 | extern int rcu_scheduler_active __read_mostly; |
161 | extern void rcu_scheduler_starting(void); | 128 | extern void rcu_scheduler_starting(void); |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 952b79339304..226169d1bd2b 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -30,7 +30,6 @@ | |||
30 | #ifndef __LINUX_RCUTREE_H | 30 | #ifndef __LINUX_RCUTREE_H |
31 | #define __LINUX_RCUTREE_H | 31 | #define __LINUX_RCUTREE_H |
32 | 32 | ||
33 | extern void rcu_init(void); | ||
34 | extern void rcu_note_context_switch(int cpu); | 33 | extern void rcu_note_context_switch(int cpu); |
35 | extern int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); | 34 | extern int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); |
36 | extern void rcu_cpu_stall_reset(void); | 35 | extern void rcu_cpu_stall_reset(void); |
@@ -86,6 +85,8 @@ extern void rcu_force_quiescent_state(void); | |||
86 | extern void rcu_bh_force_quiescent_state(void); | 85 | extern void rcu_bh_force_quiescent_state(void); |
87 | extern void rcu_sched_force_quiescent_state(void); | 86 | extern void rcu_sched_force_quiescent_state(void); |
88 | 87 | ||
88 | extern void exit_rcu(void); | ||
89 | |||
89 | extern void rcu_scheduler_starting(void); | 90 | extern void rcu_scheduler_starting(void); |
90 | extern int rcu_scheduler_active __read_mostly; | 91 | extern int rcu_scheduler_active __read_mostly; |
91 | 92 | ||
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index 5951e3f38878..26806775b11b 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
@@ -111,6 +111,9 @@ static inline struct page *sg_page(struct scatterlist *sg) | |||
111 | static inline void sg_set_buf(struct scatterlist *sg, const void *buf, | 111 | static inline void sg_set_buf(struct scatterlist *sg, const void *buf, |
112 | unsigned int buflen) | 112 | unsigned int buflen) |
113 | { | 113 | { |
114 | #ifdef CONFIG_DEBUG_SG | ||
115 | BUG_ON(!virt_addr_valid(buf)); | ||
116 | #endif | ||
114 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); | 117 | sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); |
115 | } | 118 | } |
116 | 119 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 178a8d909f14..ec80684a0127 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -924,7 +924,7 @@ struct load_weight { | |||
924 | struct sched_avg { | 924 | struct sched_avg { |
925 | /* | 925 | /* |
926 | * These sums represent an infinite geometric series and so are bound | 926 | * These sums represent an infinite geometric series and so are bound |
927 | * above by 1024/(1-y). Thus we only need a u32 to store them for for all | 927 | * above by 1024/(1-y). Thus we only need a u32 to store them for all |
928 | * choices of y < 1-2^(-32)*1024. | 928 | * choices of y < 1-2^(-32)*1024. |
929 | */ | 929 | */ |
930 | u32 runnable_avg_sum, runnable_avg_period; | 930 | u32 runnable_avg_sum, runnable_avg_period; |
@@ -994,12 +994,7 @@ struct sched_entity { | |||
994 | struct cfs_rq *my_q; | 994 | struct cfs_rq *my_q; |
995 | #endif | 995 | #endif |
996 | 996 | ||
997 | /* | 997 | #ifdef CONFIG_SMP |
998 | * Load-tracking only depends on SMP, FAIR_GROUP_SCHED dependency below may be | ||
999 | * removed when useful for applications beyond shares distribution (e.g. | ||
1000 | * load-balance). | ||
1001 | */ | ||
1002 | #if defined(CONFIG_SMP) && defined(CONFIG_FAIR_GROUP_SCHED) | ||
1003 | /* Per-entity load-tracking */ | 998 | /* Per-entity load-tracking */ |
1004 | struct sched_avg avg; | 999 | struct sched_avg avg; |
1005 | #endif | 1000 | #endif |
diff --git a/include/linux/sdb.h b/include/linux/sdb.h new file mode 100644 index 000000000000..fbb76a46c8a5 --- /dev/null +++ b/include/linux/sdb.h | |||
@@ -0,0 +1,159 @@ | |||
1 | /* | ||
2 | * This is the official version 1.1 of sdb.h | ||
3 | */ | ||
4 | #ifndef __SDB_H__ | ||
5 | #define __SDB_H__ | ||
6 | #ifdef __KERNEL__ | ||
7 | #include <linux/types.h> | ||
8 | #else | ||
9 | #include <stdint.h> | ||
10 | #endif | ||
11 | |||
12 | /* | ||
13 | * All structures are 64 bytes long and are expected | ||
14 | * to live in an array, one for each interconnect. | ||
15 | * Most fields of the structures are shared among the | ||
16 | * various types, and most-specific fields are at the | ||
17 | * beginning (for alignment reasons, and to keep the | ||
18 | * magic number at the head of the interconnect record | ||
19 | */ | ||
20 | |||
21 | /* Product, 40 bytes at offset 24, 8-byte aligned | ||
22 | * | ||
23 | * device_id is vendor-assigned; version is device-specific, | ||
24 | * date is hex (e.g 0x20120501), name is UTF-8, blank-filled | ||
25 | * and not terminated with a 0 byte. | ||
26 | */ | ||
27 | struct sdb_product { | ||
28 | uint64_t vendor_id; /* 0x18..0x1f */ | ||
29 | uint32_t device_id; /* 0x20..0x23 */ | ||
30 | uint32_t version; /* 0x24..0x27 */ | ||
31 | uint32_t date; /* 0x28..0x2b */ | ||
32 | uint8_t name[19]; /* 0x2c..0x3e */ | ||
33 | uint8_t record_type; /* 0x3f */ | ||
34 | }; | ||
35 | |||
36 | /* | ||
37 | * Component, 56 bytes at offset 8, 8-byte aligned | ||
38 | * | ||
39 | * The address range is first to last, inclusive | ||
40 | * (for example 0x100000 - 0x10ffff) | ||
41 | */ | ||
42 | struct sdb_component { | ||
43 | uint64_t addr_first; /* 0x08..0x0f */ | ||
44 | uint64_t addr_last; /* 0x10..0x17 */ | ||
45 | struct sdb_product product; /* 0x18..0x3f */ | ||
46 | }; | ||
47 | |||
48 | /* Type of the SDB record */ | ||
49 | enum sdb_record_type { | ||
50 | sdb_type_interconnect = 0x00, | ||
51 | sdb_type_device = 0x01, | ||
52 | sdb_type_bridge = 0x02, | ||
53 | sdb_type_integration = 0x80, | ||
54 | sdb_type_repo_url = 0x81, | ||
55 | sdb_type_synthesis = 0x82, | ||
56 | sdb_type_empty = 0xFF, | ||
57 | }; | ||
58 | |||
59 | /* Type 0: interconnect (first of the array) | ||
60 | * | ||
61 | * sdb_records is the length of the table including this first | ||
62 | * record, version is 1. The bus type is enumerated later. | ||
63 | */ | ||
64 | #define SDB_MAGIC 0x5344422d /* "SDB-" */ | ||
65 | struct sdb_interconnect { | ||
66 | uint32_t sdb_magic; /* 0x00-0x03 */ | ||
67 | uint16_t sdb_records; /* 0x04-0x05 */ | ||
68 | uint8_t sdb_version; /* 0x06 */ | ||
69 | uint8_t sdb_bus_type; /* 0x07 */ | ||
70 | struct sdb_component sdb_component; /* 0x08-0x3f */ | ||
71 | }; | ||
72 | |||
73 | /* Type 1: device | ||
74 | * | ||
75 | * class is 0 for "custom device", other values are | ||
76 | * to be standardized; ABI version is for the driver, | ||
77 | * bus-specific bits are defined by each bus (see below) | ||
78 | */ | ||
79 | struct sdb_device { | ||
80 | uint16_t abi_class; /* 0x00-0x01 */ | ||
81 | uint8_t abi_ver_major; /* 0x02 */ | ||
82 | uint8_t abi_ver_minor; /* 0x03 */ | ||
83 | uint32_t bus_specific; /* 0x04-0x07 */ | ||
84 | struct sdb_component sdb_component; /* 0x08-0x3f */ | ||
85 | }; | ||
86 | |||
87 | /* Type 2: bridge | ||
88 | * | ||
89 | * child is the address of the nested SDB table | ||
90 | */ | ||
91 | struct sdb_bridge { | ||
92 | uint64_t sdb_child; /* 0x00-0x07 */ | ||
93 | struct sdb_component sdb_component; /* 0x08-0x3f */ | ||
94 | }; | ||
95 | |||
96 | /* Type 0x80: integration | ||
97 | * | ||
98 | * all types with bit 7 set are meta-information, so | ||
99 | * software can ignore the types it doesn't know. Here we | ||
100 | * just provide product information for an aggregate device | ||
101 | */ | ||
102 | struct sdb_integration { | ||
103 | uint8_t reserved[24]; /* 0x00-0x17 */ | ||
104 | struct sdb_product product; /* 0x08-0x3f */ | ||
105 | }; | ||
106 | |||
107 | /* Type 0x81: Top module repository url | ||
108 | * | ||
109 | * again, an informative field that software can ignore | ||
110 | */ | ||
111 | struct sdb_repo_url { | ||
112 | uint8_t repo_url[63]; /* 0x00-0x3e */ | ||
113 | uint8_t record_type; /* 0x3f */ | ||
114 | }; | ||
115 | |||
116 | /* Type 0x82: Synthesis tool information | ||
117 | * | ||
118 | * this informative record | ||
119 | */ | ||
120 | struct sdb_synthesis { | ||
121 | uint8_t syn_name[16]; /* 0x00-0x0f */ | ||
122 | uint8_t commit_id[16]; /* 0x10-0x1f */ | ||
123 | uint8_t tool_name[8]; /* 0x20-0x27 */ | ||
124 | uint32_t tool_version; /* 0x28-0x2b */ | ||
125 | uint32_t date; /* 0x2c-0x2f */ | ||
126 | uint8_t user_name[15]; /* 0x30-0x3e */ | ||
127 | uint8_t record_type; /* 0x3f */ | ||
128 | }; | ||
129 | |||
130 | /* Type 0xff: empty | ||
131 | * | ||
132 | * this allows keeping empty slots during development, | ||
133 | * so they can be filled later with minimal efforts and | ||
134 | * no misleading description is ever shipped -- hopefully. | ||
135 | * It can also be used to pad a table to a desired length. | ||
136 | */ | ||
137 | struct sdb_empty { | ||
138 | uint8_t reserved[63]; /* 0x00-0x3e */ | ||
139 | uint8_t record_type; /* 0x3f */ | ||
140 | }; | ||
141 | |||
142 | /* The type of bus, for bus-specific flags */ | ||
143 | enum sdb_bus_type { | ||
144 | sdb_wishbone = 0x00, | ||
145 | sdb_data = 0x01, | ||
146 | }; | ||
147 | |||
148 | #define SDB_WB_WIDTH_MASK 0x0f | ||
149 | #define SDB_WB_ACCESS8 0x01 | ||
150 | #define SDB_WB_ACCESS16 0x02 | ||
151 | #define SDB_WB_ACCESS32 0x04 | ||
152 | #define SDB_WB_ACCESS64 0x08 | ||
153 | #define SDB_WB_LITTLE_ENDIAN 0x80 | ||
154 | |||
155 | #define SDB_DATA_READ 0x04 | ||
156 | #define SDB_DATA_WRITE 0x02 | ||
157 | #define SDB_DATA_EXEC 0x01 | ||
158 | |||
159 | #endif /* __SDB_H__ */ | ||
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 87d4bbc773fc..b98291ac7f14 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -31,6 +31,13 @@ | |||
31 | #include <linux/sysrq.h> | 31 | #include <linux/sysrq.h> |
32 | #include <uapi/linux/serial_core.h> | 32 | #include <uapi/linux/serial_core.h> |
33 | 33 | ||
34 | #ifdef CONFIG_SERIAL_CORE_CONSOLE | ||
35 | #define uart_console(port) \ | ||
36 | ((port)->cons && (port)->cons->index == (port)->line) | ||
37 | #else | ||
38 | #define uart_console(port) (0) | ||
39 | #endif | ||
40 | |||
34 | struct uart_port; | 41 | struct uart_port; |
35 | struct serial_struct; | 42 | struct serial_struct; |
36 | struct device; | 43 | struct device; |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index eb763adf9815..d34049712a4d 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/sh_dma.h> | 5 | #include <linux/sh_dma.h> |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) | 8 | * Generic header for SuperH (H)SCI(F) (used by sh/sh64/h8300 and related parts) |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #define SCIx_NOT_SUPPORTED (-1) | 11 | #define SCIx_NOT_SUPPORTED (-1) |
@@ -16,6 +16,7 @@ enum { | |||
16 | SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ | 16 | SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ |
17 | SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ | 17 | SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ |
18 | SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ | 18 | SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ |
19 | SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */ | ||
19 | }; | 20 | }; |
20 | 21 | ||
21 | #define SCSCR_TIE (1 << 7) | 22 | #define SCSCR_TIE (1 << 7) |
@@ -37,7 +38,7 @@ enum { | |||
37 | 38 | ||
38 | #define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER) | 39 | #define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER) |
39 | 40 | ||
40 | /* SCxSR SCIF */ | 41 | /* SCxSR SCIF, HSCIF */ |
41 | #define SCIF_ER 0x0080 | 42 | #define SCIF_ER 0x0080 |
42 | #define SCIF_TEND 0x0040 | 43 | #define SCIF_TEND 0x0040 |
43 | #define SCIF_TDFE 0x0020 | 44 | #define SCIF_TDFE 0x0020 |
@@ -55,6 +56,9 @@ enum { | |||
55 | #define SCSPTR_SPB2IO (1 << 1) | 56 | #define SCSPTR_SPB2IO (1 << 1) |
56 | #define SCSPTR_SPB2DT (1 << 0) | 57 | #define SCSPTR_SPB2DT (1 << 0) |
57 | 58 | ||
59 | /* HSSRR HSCIF */ | ||
60 | #define HSCIF_SRE 0x8000 | ||
61 | |||
58 | /* Offsets into the sci_port->irqs array */ | 62 | /* Offsets into the sci_port->irqs array */ |
59 | enum { | 63 | enum { |
60 | SCIx_ERI_IRQ, | 64 | SCIx_ERI_IRQ, |
@@ -90,6 +94,7 @@ enum { | |||
90 | SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, | 94 | SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
91 | SCIx_SH4_SCIF_FIFODATA_REGTYPE, | 95 | SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
92 | SCIx_SH7705_SCIF_REGTYPE, | 96 | SCIx_SH7705_SCIF_REGTYPE, |
97 | SCIx_HSCIF_REGTYPE, | ||
93 | 98 | ||
94 | SCIx_NR_REGTYPES, | 99 | SCIx_NR_REGTYPES, |
95 | }; | 100 | }; |
@@ -115,6 +120,7 @@ enum { | |||
115 | SCSMR, SCBRR, SCSCR, SCxSR, | 120 | SCSMR, SCBRR, SCSCR, SCxSR, |
116 | SCFCR, SCFDR, SCxTDR, SCxRDR, | 121 | SCFCR, SCFDR, SCxTDR, SCxRDR, |
117 | SCLSR, SCTFDR, SCRFDR, SCSPTR, | 122 | SCLSR, SCTFDR, SCRFDR, SCSPTR, |
123 | HSSRR, | ||
118 | 124 | ||
119 | SCIx_NR_REGS, | 125 | SCIx_NR_REGS, |
120 | }; | 126 | }; |
@@ -137,7 +143,7 @@ struct plat_sci_port { | |||
137 | unsigned long mapbase; /* resource base */ | 143 | unsigned long mapbase; /* resource base */ |
138 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ | 144 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ |
139 | unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */ | 145 | unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */ |
140 | unsigned int type; /* SCI / SCIF / IRDA */ | 146 | unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ |
141 | upf_t flags; /* UPF_* flags */ | 147 | upf_t flags; /* UPF_* flags */ |
142 | unsigned long capabilities; /* Port features/capabilities */ | 148 | unsigned long capabilities; /* Port features/capabilities */ |
143 | 149 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2e0ced1af3b1..dec1748cd002 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -627,6 +627,7 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb) | |||
627 | } | 627 | } |
628 | 628 | ||
629 | extern void kfree_skb(struct sk_buff *skb); | 629 | extern void kfree_skb(struct sk_buff *skb); |
630 | extern void kfree_skb_list(struct sk_buff *segs); | ||
630 | extern void skb_tx_error(struct sk_buff *skb); | 631 | extern void skb_tx_error(struct sk_buff *skb); |
631 | extern void consume_skb(struct sk_buff *skb); | 632 | extern void consume_skb(struct sk_buff *skb); |
632 | extern void __kfree_skb(struct sk_buff *skb); | 633 | extern void __kfree_skb(struct sk_buff *skb); |
@@ -2852,6 +2853,21 @@ static inline int skb_tnl_header_len(const struct sk_buff *inner_skb) | |||
2852 | SKB_GSO_CB(inner_skb)->mac_offset; | 2853 | SKB_GSO_CB(inner_skb)->mac_offset; |
2853 | } | 2854 | } |
2854 | 2855 | ||
2856 | static inline int gso_pskb_expand_head(struct sk_buff *skb, int extra) | ||
2857 | { | ||
2858 | int new_headroom, headroom; | ||
2859 | int ret; | ||
2860 | |||
2861 | headroom = skb_headroom(skb); | ||
2862 | ret = pskb_expand_head(skb, extra, 0, GFP_ATOMIC); | ||
2863 | if (ret) | ||
2864 | return ret; | ||
2865 | |||
2866 | new_headroom = skb_headroom(skb); | ||
2867 | SKB_GSO_CB(skb)->mac_offset += (new_headroom - headroom); | ||
2868 | return 0; | ||
2869 | } | ||
2870 | |||
2855 | static inline bool skb_is_gso(const struct sk_buff *skb) | 2871 | static inline bool skb_is_gso(const struct sk_buff *skb) |
2856 | { | 2872 | { |
2857 | return skb_shinfo(skb)->gso_size; | 2873 | return skb_shinfo(skb)->gso_size; |
diff --git a/include/linux/smp.h b/include/linux/smp.h index e6564c1dc552..c8488763277f 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
12 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/irqflags.h> | ||
14 | 15 | ||
15 | extern void cpu_idle(void); | 16 | extern void cpu_idle(void); |
16 | 17 | ||
@@ -139,13 +140,17 @@ static inline int up_smp_call_function(smp_call_func_t func, void *info) | |||
139 | } | 140 | } |
140 | #define smp_call_function(func, info, wait) \ | 141 | #define smp_call_function(func, info, wait) \ |
141 | (up_smp_call_function(func, info)) | 142 | (up_smp_call_function(func, info)) |
142 | #define on_each_cpu(func,info,wait) \ | 143 | |
143 | ({ \ | 144 | static inline int on_each_cpu(smp_call_func_t func, void *info, int wait) |
144 | local_irq_disable(); \ | 145 | { |
145 | func(info); \ | 146 | unsigned long flags; |
146 | local_irq_enable(); \ | 147 | |
147 | 0; \ | 148 | local_irq_save(flags); |
148 | }) | 149 | func(info); |
150 | local_irq_restore(flags); | ||
151 | return 0; | ||
152 | } | ||
153 | |||
149 | /* | 154 | /* |
150 | * Note we still need to test the mask even for UP | 155 | * Note we still need to test the mask even for UP |
151 | * because we actually can get an empty mask from | 156 | * because we actually can get an empty mask from |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 33bf2dfab19d..b10ce4b341ea 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -320,6 +320,9 @@ extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); | |||
320 | 320 | ||
321 | struct timespec; | 321 | struct timespec; |
322 | 322 | ||
323 | /* The __sys_...msg variants allow MSG_CMSG_COMPAT */ | ||
324 | extern long __sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags); | ||
325 | extern long __sys_sendmsg(int fd, struct msghdr __user *msg, unsigned flags); | ||
323 | extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, | 326 | extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, |
324 | unsigned int flags, struct timespec *timeout); | 327 | unsigned int flags, struct timespec *timeout); |
325 | extern int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg, | 328 | extern int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg, |
diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h index e2369c167dbd..8b3ac0d718eb 100644 --- a/include/linux/spinlock_up.h +++ b/include/linux/spinlock_up.h | |||
@@ -67,7 +67,7 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock) | |||
67 | 67 | ||
68 | #else /* DEBUG_SPINLOCK */ | 68 | #else /* DEBUG_SPINLOCK */ |
69 | #define arch_spin_is_locked(lock) ((void)(lock), 0) | 69 | #define arch_spin_is_locked(lock) ((void)(lock), 0) |
70 | /* for sched.c and kernel_lock.c: */ | 70 | /* for sched/core.c and kernel_lock.c: */ |
71 | # define arch_spin_lock(lock) do { barrier(); (void)(lock); } while (0) | 71 | # define arch_spin_lock(lock) do { barrier(); (void)(lock); } while (0) |
72 | # define arch_spin_lock_flags(lock, flags) do { barrier(); (void)(lock); } while (0) | 72 | # define arch_spin_lock_flags(lock, flags) do { barrier(); (void)(lock); } while (0) |
73 | # define arch_spin_unlock(lock) do { barrier(); (void)(lock); } while (0) | 73 | # define arch_spin_unlock(lock) do { barrier(); (void)(lock); } while (0) |
diff --git a/include/linux/splice.h b/include/linux/splice.h index 09a545a7dfa3..74575cbf2d6f 100644 --- a/include/linux/splice.h +++ b/include/linux/splice.h | |||
@@ -35,6 +35,7 @@ struct splice_desc { | |||
35 | void *data; /* cookie */ | 35 | void *data; /* cookie */ |
36 | } u; | 36 | } u; |
37 | loff_t pos; /* file position */ | 37 | loff_t pos; /* file position */ |
38 | loff_t *opos; /* sendfile: output position */ | ||
38 | size_t num_spliced; /* number of bytes already spliced */ | 39 | size_t num_spliced; /* number of bytes already spliced */ |
39 | bool need_wakeup; /* need to wake up writer */ | 40 | bool need_wakeup; /* need to wake up writer */ |
40 | }; | 41 | }; |
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 04f4121a23ae..c114614ed172 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
@@ -237,47 +237,4 @@ static inline void srcu_read_unlock(struct srcu_struct *sp, int idx) | |||
237 | __srcu_read_unlock(sp, idx); | 237 | __srcu_read_unlock(sp, idx); |
238 | } | 238 | } |
239 | 239 | ||
240 | /** | ||
241 | * srcu_read_lock_raw - register a new reader for an SRCU-protected structure. | ||
242 | * @sp: srcu_struct in which to register the new reader. | ||
243 | * | ||
244 | * Enter an SRCU read-side critical section. Similar to srcu_read_lock(), | ||
245 | * but avoids the RCU-lockdep checking. This means that it is legal to | ||
246 | * use srcu_read_lock_raw() in one context, for example, in an exception | ||
247 | * handler, and then have the matching srcu_read_unlock_raw() in another | ||
248 | * context, for example in the task that took the exception. | ||
249 | * | ||
250 | * However, the entire SRCU read-side critical section must reside within a | ||
251 | * single task. For example, beware of using srcu_read_lock_raw() in | ||
252 | * a device interrupt handler and srcu_read_unlock() in the interrupted | ||
253 | * task: This will not work if interrupts are threaded. | ||
254 | */ | ||
255 | static inline int srcu_read_lock_raw(struct srcu_struct *sp) | ||
256 | { | ||
257 | unsigned long flags; | ||
258 | int ret; | ||
259 | |||
260 | local_irq_save(flags); | ||
261 | ret = __srcu_read_lock(sp); | ||
262 | local_irq_restore(flags); | ||
263 | return ret; | ||
264 | } | ||
265 | |||
266 | /** | ||
267 | * srcu_read_unlock_raw - unregister reader from an SRCU-protected structure. | ||
268 | * @sp: srcu_struct in which to unregister the old reader. | ||
269 | * @idx: return value from corresponding srcu_read_lock_raw(). | ||
270 | * | ||
271 | * Exit an SRCU read-side critical section without lockdep-RCU checking. | ||
272 | * See srcu_read_lock_raw() for more details. | ||
273 | */ | ||
274 | static inline void srcu_read_unlock_raw(struct srcu_struct *sp, int idx) | ||
275 | { | ||
276 | unsigned long flags; | ||
277 | |||
278 | local_irq_save(flags); | ||
279 | __srcu_read_unlock(sp, idx); | ||
280 | local_irq_restore(flags); | ||
281 | } | ||
282 | |||
283 | #endif | 240 | #endif |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 47ead515c811..c5fd30d2a415 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -137,6 +137,7 @@ static inline void make_migration_entry_read(swp_entry_t *entry) | |||
137 | 137 | ||
138 | extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | 138 | extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, |
139 | unsigned long address); | 139 | unsigned long address); |
140 | extern void migration_entry_wait_huge(struct mm_struct *mm, pte_t *pte); | ||
140 | #else | 141 | #else |
141 | 142 | ||
142 | #define make_migration_entry(page, write) swp_entry(0, 0) | 143 | #define make_migration_entry(page, write) swp_entry(0, 0) |
@@ -148,6 +149,8 @@ static inline int is_migration_entry(swp_entry_t swp) | |||
148 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } | 149 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } |
149 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | 150 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, |
150 | unsigned long address) { } | 151 | unsigned long address) { } |
152 | static inline void migration_entry_wait_huge(struct mm_struct *mm, | ||
153 | pte_t *pte) { } | ||
151 | static inline int is_write_migration_entry(swp_entry_t entry) | 154 | static inline int is_write_migration_entry(swp_entry_t entry) |
152 | { | 155 | { |
153 | return 0; | 156 | return 0; |
diff --git a/include/linux/syslog.h b/include/linux/syslog.h index 38911391a139..98a3153c0f96 100644 --- a/include/linux/syslog.h +++ b/include/linux/syslog.h | |||
@@ -44,8 +44,8 @@ | |||
44 | /* Return size of the log buffer */ | 44 | /* Return size of the log buffer */ |
45 | #define SYSLOG_ACTION_SIZE_BUFFER 10 | 45 | #define SYSLOG_ACTION_SIZE_BUFFER 10 |
46 | 46 | ||
47 | #define SYSLOG_FROM_CALL 0 | 47 | #define SYSLOG_FROM_READER 0 |
48 | #define SYSLOG_FROM_FILE 1 | 48 | #define SYSLOG_FROM_PROC 1 |
49 | 49 | ||
50 | int do_syslog(int type, char __user *buf, int count, bool from_file); | 50 | int do_syslog(int type, char __user *buf, int count, bool from_file); |
51 | 51 | ||
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 2f322c38bd4d..ebeab360d851 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -145,8 +145,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
145 | TP_PROTO(data_proto), \ | 145 | TP_PROTO(data_proto), \ |
146 | TP_ARGS(data_args), \ | 146 | TP_ARGS(data_args), \ |
147 | TP_CONDITION(cond), \ | 147 | TP_CONDITION(cond), \ |
148 | rcu_idle_exit(), \ | 148 | rcu_irq_enter(), \ |
149 | rcu_idle_enter()); \ | 149 | rcu_irq_exit()); \ |
150 | } | 150 | } |
151 | #else | 151 | #else |
152 | #define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) | 152 | #define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) |
@@ -378,6 +378,8 @@ static inline void tracepoint_synchronize_unregister(void) | |||
378 | #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) | 378 | #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) |
379 | #define DEFINE_EVENT(template, name, proto, args) \ | 379 | #define DEFINE_EVENT(template, name, proto, args) \ |
380 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 380 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
381 | #define DEFINE_EVENT_FN(template, name, proto, args, reg, unreg)\ | ||
382 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | ||
381 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 383 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
382 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 384 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
383 | #define DEFINE_EVENT_CONDITION(template, name, proto, \ | 385 | #define DEFINE_EVENT_CONDITION(template, name, proto, \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 8780bd2a272a..01ac30efd6a6 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -272,7 +272,6 @@ struct tty_struct { | |||
272 | #define N_TTY_BUF_SIZE 4096 | 272 | #define N_TTY_BUF_SIZE 4096 |
273 | 273 | ||
274 | unsigned char closing:1; | 274 | unsigned char closing:1; |
275 | unsigned short minimum_to_wake; | ||
276 | unsigned char *write_buf; | 275 | unsigned char *write_buf; |
277 | int write_cnt; | 276 | int write_cnt; |
278 | /* If the tty has a pending do_SAK, queue it here - akpm */ | 277 | /* If the tty has a pending do_SAK, queue it here - akpm */ |
@@ -309,8 +308,6 @@ struct tty_file_private { | |||
309 | #define TTY_LDISC 9 /* Line discipline attached */ | 308 | #define TTY_LDISC 9 /* Line discipline attached */ |
310 | #define TTY_LDISC_CHANGING 10 /* Line discipline changing */ | 309 | #define TTY_LDISC_CHANGING 10 /* Line discipline changing */ |
311 | #define TTY_LDISC_OPEN 11 /* Line discipline is open */ | 310 | #define TTY_LDISC_OPEN 11 /* Line discipline is open */ |
312 | #define TTY_HW_COOK_OUT 14 /* Hardware can do output cooking */ | ||
313 | #define TTY_HW_COOK_IN 15 /* Hardware can do input cooking */ | ||
314 | #define TTY_PTY_LOCK 16 /* pty private */ | 311 | #define TTY_PTY_LOCK 16 /* pty private */ |
315 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ | 312 | #define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ |
316 | #define TTY_HUPPED 18 /* Post driver->hangup() */ | 313 | #define TTY_HUPPED 18 /* Post driver->hangup() */ |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 58390c73df8b..a1b048999821 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -100,6 +100,11 @@ | |||
100 | * seek to perform this action quickly but should wait until | 100 | * seek to perform this action quickly but should wait until |
101 | * any pending driver I/O is completed. | 101 | * any pending driver I/O is completed. |
102 | * | 102 | * |
103 | * void (*fasync)(struct tty_struct *, int on) | ||
104 | * | ||
105 | * Notify line discipline when signal-driven I/O is enabled or | ||
106 | * disabled. | ||
107 | * | ||
103 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status) | 108 | * void (*dcd_change)(struct tty_struct *tty, unsigned int status) |
104 | * | 109 | * |
105 | * Tells the discipline that the DCD pin has changed its status. | 110 | * Tells the discipline that the DCD pin has changed its status. |
@@ -110,6 +115,52 @@ | |||
110 | #include <linux/wait.h> | 115 | #include <linux/wait.h> |
111 | #include <linux/wait.h> | 116 | #include <linux/wait.h> |
112 | 117 | ||
118 | |||
119 | /* | ||
120 | * the semaphore definition | ||
121 | */ | ||
122 | struct ld_semaphore { | ||
123 | long count; | ||
124 | raw_spinlock_t wait_lock; | ||
125 | unsigned int wait_readers; | ||
126 | struct list_head read_wait; | ||
127 | struct list_head write_wait; | ||
128 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
129 | struct lockdep_map dep_map; | ||
130 | #endif | ||
131 | }; | ||
132 | |||
133 | extern void __init_ldsem(struct ld_semaphore *sem, const char *name, | ||
134 | struct lock_class_key *key); | ||
135 | |||
136 | #define init_ldsem(sem) \ | ||
137 | do { \ | ||
138 | static struct lock_class_key __key; \ | ||
139 | \ | ||
140 | __init_ldsem((sem), #sem, &__key); \ | ||
141 | } while (0) | ||
142 | |||
143 | |||
144 | extern int ldsem_down_read(struct ld_semaphore *sem, long timeout); | ||
145 | extern int ldsem_down_read_trylock(struct ld_semaphore *sem); | ||
146 | extern int ldsem_down_write(struct ld_semaphore *sem, long timeout); | ||
147 | extern int ldsem_down_write_trylock(struct ld_semaphore *sem); | ||
148 | extern void ldsem_up_read(struct ld_semaphore *sem); | ||
149 | extern void ldsem_up_write(struct ld_semaphore *sem); | ||
150 | |||
151 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
152 | extern int ldsem_down_read_nested(struct ld_semaphore *sem, int subclass, | ||
153 | long timeout); | ||
154 | extern int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass, | ||
155 | long timeout); | ||
156 | #else | ||
157 | # define ldsem_down_read_nested(sem, subclass, timeout) \ | ||
158 | ldsem_down_read(sem, timeout) | ||
159 | # define ldsem_down_write_nested(sem, subclass, timeout) \ | ||
160 | ldsem_down_write(sem, timeout) | ||
161 | #endif | ||
162 | |||
163 | |||
113 | struct tty_ldisc_ops { | 164 | struct tty_ldisc_ops { |
114 | int magic; | 165 | int magic; |
115 | char *name; | 166 | char *name; |
@@ -143,6 +194,7 @@ struct tty_ldisc_ops { | |||
143 | char *fp, int count); | 194 | char *fp, int count); |
144 | void (*write_wakeup)(struct tty_struct *); | 195 | void (*write_wakeup)(struct tty_struct *); |
145 | void (*dcd_change)(struct tty_struct *, unsigned int); | 196 | void (*dcd_change)(struct tty_struct *, unsigned int); |
197 | void (*fasync)(struct tty_struct *tty, int on); | ||
146 | 198 | ||
147 | struct module *owner; | 199 | struct module *owner; |
148 | 200 | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index a0bee5a28d1a..a232b7ece1f6 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -394,6 +394,22 @@ enum usb_port_connect_type { | |||
394 | }; | 394 | }; |
395 | 395 | ||
396 | /* | 396 | /* |
397 | * USB 2.0 Link Power Management (LPM) parameters. | ||
398 | */ | ||
399 | struct usb2_lpm_parameters { | ||
400 | /* Best effort service latency indicate how long the host will drive | ||
401 | * resume on an exit from L1. | ||
402 | */ | ||
403 | unsigned int besl; | ||
404 | |||
405 | /* Timeout value in microseconds for the L1 inactivity (LPM) timer. | ||
406 | * When the timer counts to zero, the parent hub will initiate a LPM | ||
407 | * transition to L1. | ||
408 | */ | ||
409 | int timeout; | ||
410 | }; | ||
411 | |||
412 | /* | ||
397 | * USB 3.0 Link Power Management (LPM) parameters. | 413 | * USB 3.0 Link Power Management (LPM) parameters. |
398 | * | 414 | * |
399 | * PEL and SEL are USB 3.0 Link PM latencies for device-initiated LPM exit. | 415 | * PEL and SEL are USB 3.0 Link PM latencies for device-initiated LPM exit. |
@@ -468,6 +484,7 @@ struct usb3_lpm_parameters { | |||
468 | * @wusb: device is Wireless USB | 484 | * @wusb: device is Wireless USB |
469 | * @lpm_capable: device supports LPM | 485 | * @lpm_capable: device supports LPM |
470 | * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM | 486 | * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM |
487 | * @usb2_hw_lpm_besl_capable: device can perform USB2 hardware BESL LPM | ||
471 | * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled | 488 | * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled |
472 | * @usb3_lpm_enabled: USB3 hardware LPM enabled | 489 | * @usb3_lpm_enabled: USB3 hardware LPM enabled |
473 | * @string_langid: language ID for strings | 490 | * @string_langid: language ID for strings |
@@ -487,6 +504,7 @@ struct usb3_lpm_parameters { | |||
487 | * specific data for the device. | 504 | * specific data for the device. |
488 | * @slot_id: Slot ID assigned by xHCI | 505 | * @slot_id: Slot ID assigned by xHCI |
489 | * @removable: Device can be physically removed from this port | 506 | * @removable: Device can be physically removed from this port |
507 | * @l1_params: best effor service latency for USB2 L1 LPM state, and L1 timeout. | ||
490 | * @u1_params: exit latencies for USB3 U1 LPM state, and hub-initiated timeout. | 508 | * @u1_params: exit latencies for USB3 U1 LPM state, and hub-initiated timeout. |
491 | * @u2_params: exit latencies for USB3 U2 LPM state, and hub-initiated timeout. | 509 | * @u2_params: exit latencies for USB3 U2 LPM state, and hub-initiated timeout. |
492 | * @lpm_disable_count: Ref count used by usb_disable_lpm() and usb_enable_lpm() | 510 | * @lpm_disable_count: Ref count used by usb_disable_lpm() and usb_enable_lpm() |
@@ -538,6 +556,7 @@ struct usb_device { | |||
538 | unsigned wusb:1; | 556 | unsigned wusb:1; |
539 | unsigned lpm_capable:1; | 557 | unsigned lpm_capable:1; |
540 | unsigned usb2_hw_lpm_capable:1; | 558 | unsigned usb2_hw_lpm_capable:1; |
559 | unsigned usb2_hw_lpm_besl_capable:1; | ||
541 | unsigned usb2_hw_lpm_enabled:1; | 560 | unsigned usb2_hw_lpm_enabled:1; |
542 | unsigned usb3_lpm_enabled:1; | 561 | unsigned usb3_lpm_enabled:1; |
543 | int string_langid; | 562 | int string_langid; |
@@ -566,6 +585,7 @@ struct usb_device { | |||
566 | struct wusb_dev *wusb_dev; | 585 | struct wusb_dev *wusb_dev; |
567 | int slot_id; | 586 | int slot_id; |
568 | enum usb_device_removable removable; | 587 | enum usb_device_removable removable; |
588 | struct usb2_lpm_parameters l1_params; | ||
569 | struct usb3_lpm_parameters u1_params; | 589 | struct usb3_lpm_parameters u1_params; |
570 | struct usb3_lpm_parameters u2_params; | 590 | struct usb3_lpm_parameters u2_params; |
571 | unsigned lpm_disable_count; | 591 | unsigned lpm_disable_count; |
@@ -717,6 +737,7 @@ const struct usb_device_id *usb_match_id(struct usb_interface *interface, | |||
717 | extern int usb_match_one_id(struct usb_interface *interface, | 737 | extern int usb_match_one_id(struct usb_interface *interface, |
718 | const struct usb_device_id *id); | 738 | const struct usb_device_id *id); |
719 | 739 | ||
740 | extern int usb_for_each_dev(void *data, int (*fn)(struct usb_device *, void *)); | ||
720 | extern struct usb_interface *usb_find_interface(struct usb_driver *drv, | 741 | extern struct usb_interface *usb_find_interface(struct usb_driver *drv, |
721 | int minor); | 742 | int minor); |
722 | extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev, | 743 | extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev, |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index 544825dde823..25629948c842 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
@@ -7,32 +7,33 @@ | |||
7 | 7 | ||
8 | #include <linux/usb/otg.h> | 8 | #include <linux/usb/otg.h> |
9 | 9 | ||
10 | struct ci13xxx; | 10 | struct ci_hdrc; |
11 | struct ci13xxx_platform_data { | 11 | struct ci_hdrc_platform_data { |
12 | const char *name; | 12 | const char *name; |
13 | /* offset of the capability registers */ | 13 | /* offset of the capability registers */ |
14 | uintptr_t capoffset; | 14 | uintptr_t capoffset; |
15 | unsigned power_budget; | 15 | unsigned power_budget; |
16 | struct usb_phy *phy; | 16 | struct usb_phy *phy; |
17 | enum usb_phy_interface phy_mode; | ||
17 | unsigned long flags; | 18 | unsigned long flags; |
18 | #define CI13XXX_REGS_SHARED BIT(0) | 19 | #define CI_HDRC_REGS_SHARED BIT(0) |
19 | #define CI13XXX_REQUIRE_TRANSCEIVER BIT(1) | 20 | #define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1) |
20 | #define CI13XXX_PULLUP_ON_VBUS BIT(2) | 21 | #define CI_HDRC_PULLUP_ON_VBUS BIT(2) |
21 | #define CI13XXX_DISABLE_STREAMING BIT(3) | 22 | #define CI_HDRC_DISABLE_STREAMING BIT(3) |
22 | 23 | enum usb_dr_mode dr_mode; | |
23 | #define CI13XXX_CONTROLLER_RESET_EVENT 0 | 24 | #define CI_HDRC_CONTROLLER_RESET_EVENT 0 |
24 | #define CI13XXX_CONTROLLER_STOPPED_EVENT 1 | 25 | #define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 |
25 | void (*notify_event) (struct ci13xxx *ci, unsigned event); | 26 | void (*notify_event) (struct ci_hdrc *ci, unsigned event); |
26 | }; | 27 | }; |
27 | 28 | ||
28 | /* Default offset of capability registers */ | 29 | /* Default offset of capability registers */ |
29 | #define DEF_CAPOFFSET 0x100 | 30 | #define DEF_CAPOFFSET 0x100 |
30 | 31 | ||
31 | /* Add ci13xxx device */ | 32 | /* Add ci hdrc device */ |
32 | struct platform_device *ci13xxx_add_device(struct device *dev, | 33 | struct platform_device *ci_hdrc_add_device(struct device *dev, |
33 | struct resource *res, int nres, | 34 | struct resource *res, int nres, |
34 | struct ci13xxx_platform_data *platdata); | 35 | struct ci_hdrc_platform_data *platdata); |
35 | /* Remove ci13xxx device */ | 36 | /* Remove ci hdrc device */ |
36 | void ci13xxx_remove_device(struct platform_device *pdev); | 37 | void ci_hdrc_remove_device(struct platform_device *pdev); |
37 | 38 | ||
38 | #endif | 39 | #endif |
diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h index 99238b096f7e..7eb4dcd0d386 100644 --- a/include/linux/usb/ehci_pdriver.h +++ b/include/linux/usb/ehci_pdriver.h | |||
@@ -19,6 +19,9 @@ | |||
19 | #ifndef __USB_CORE_EHCI_PDRIVER_H | 19 | #ifndef __USB_CORE_EHCI_PDRIVER_H |
20 | #define __USB_CORE_EHCI_PDRIVER_H | 20 | #define __USB_CORE_EHCI_PDRIVER_H |
21 | 21 | ||
22 | struct platform_device; | ||
23 | struct usb_hcd; | ||
24 | |||
22 | /** | 25 | /** |
23 | * struct usb_ehci_pdata - platform_data for generic ehci driver | 26 | * struct usb_ehci_pdata - platform_data for generic ehci driver |
24 | * | 27 | * |
@@ -50,6 +53,7 @@ struct usb_ehci_pdata { | |||
50 | /* Turn on only VBUS suspend power and hotplug detection, | 53 | /* Turn on only VBUS suspend power and hotplug detection, |
51 | * turn off everything else */ | 54 | * turn off everything else */ |
52 | void (*power_suspend)(struct platform_device *pdev); | 55 | void (*power_suspend)(struct platform_device *pdev); |
56 | int (*pre_setup)(struct usb_hcd *hcd); | ||
53 | }; | 57 | }; |
54 | 58 | ||
55 | #endif /* __USB_CORE_EHCI_PDRIVER_H */ | 59 | #endif /* __USB_CORE_EHCI_PDRIVER_H */ |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index f5f5c7dfda90..1e88377e22f4 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -218,6 +218,7 @@ struct hc_driver { | |||
218 | #define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */ | 218 | #define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */ |
219 | #define HCD_USB11 0x0010 /* USB 1.1 */ | 219 | #define HCD_USB11 0x0010 /* USB 1.1 */ |
220 | #define HCD_USB2 0x0020 /* USB 2.0 */ | 220 | #define HCD_USB2 0x0020 /* USB 2.0 */ |
221 | #define HCD_USB25 0x0030 /* Wireless USB 1.0 (USB 2.5)*/ | ||
221 | #define HCD_USB3 0x0040 /* USB 3.0 */ | 222 | #define HCD_USB3 0x0040 /* USB 3.0 */ |
222 | #define HCD_MASK 0x0070 | 223 | #define HCD_MASK 0x0070 |
223 | 224 | ||
diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h new file mode 100644 index 000000000000..a0ef405368b8 --- /dev/null +++ b/include/linux/usb/of.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * OF helpers for usb devices. | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | |||
7 | #ifndef __LINUX_USB_OF_H | ||
8 | #define __LINUX_USB_OF_H | ||
9 | |||
10 | #include <linux/usb/otg.h> | ||
11 | #include <linux/usb/phy.h> | ||
12 | |||
13 | #if IS_ENABLED(CONFIG_OF) | ||
14 | enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np); | ||
15 | #else | ||
16 | static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np) | ||
17 | { | ||
18 | return USB_DR_MODE_UNKNOWN; | ||
19 | } | ||
20 | #endif | ||
21 | |||
22 | #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_PHY) | ||
23 | enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np); | ||
24 | #else | ||
25 | static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np) | ||
26 | { | ||
27 | return USBPHY_INTERFACE_MODE_UNKNOWN; | ||
28 | } | ||
29 | |||
30 | #endif | ||
31 | |||
32 | #endif /* __LINUX_USB_OF_H */ | ||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 291e01ba32e5..154332b7c8c0 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -92,4 +92,11 @@ otg_start_srp(struct usb_otg *otg) | |||
92 | /* for OTG controller drivers (and maybe other stuff) */ | 92 | /* for OTG controller drivers (and maybe other stuff) */ |
93 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); | 93 | extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num); |
94 | 94 | ||
95 | enum usb_dr_mode { | ||
96 | USB_DR_MODE_UNKNOWN, | ||
97 | USB_DR_MODE_HOST, | ||
98 | USB_DR_MODE_PERIPHERAL, | ||
99 | USB_DR_MODE_OTG, | ||
100 | }; | ||
101 | |||
95 | #endif /* __LINUX_USB_OTG_H */ | 102 | #endif /* __LINUX_USB_OTG_H */ |
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index 6b5978f57633..44036808bf0f 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h | |||
@@ -12,6 +12,15 @@ | |||
12 | #include <linux/notifier.h> | 12 | #include <linux/notifier.h> |
13 | #include <linux/usb.h> | 13 | #include <linux/usb.h> |
14 | 14 | ||
15 | enum usb_phy_interface { | ||
16 | USBPHY_INTERFACE_MODE_UNKNOWN, | ||
17 | USBPHY_INTERFACE_MODE_UTMI, | ||
18 | USBPHY_INTERFACE_MODE_UTMIW, | ||
19 | USBPHY_INTERFACE_MODE_ULPI, | ||
20 | USBPHY_INTERFACE_MODE_SERIAL, | ||
21 | USBPHY_INTERFACE_MODE_HSIC, | ||
22 | }; | ||
23 | |||
15 | enum usb_phy_events { | 24 | enum usb_phy_events { |
16 | USB_EVENT_NONE, /* no events or cable disconnected */ | 25 | USB_EVENT_NONE, /* no events or cable disconnected */ |
17 | USB_EVENT_VBUS, /* vbus valid event */ | 26 | USB_EVENT_VBUS, /* vbus valid event */ |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 302ddf55d2da..d528b8045150 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -19,10 +19,6 @@ | |||
19 | #include <linux/sysrq.h> | 19 | #include <linux/sysrq.h> |
20 | #include <linux/kfifo.h> | 20 | #include <linux/kfifo.h> |
21 | 21 | ||
22 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ | ||
23 | #define SERIAL_TTY_MINORS 254 /* loads of devices :) */ | ||
24 | #define SERIAL_TTY_NO_MINOR 255 /* No minor was assigned */ | ||
25 | |||
26 | /* The maximum number of ports one device can grab at once */ | 22 | /* The maximum number of ports one device can grab at once */ |
27 | #define MAX_NUM_PORTS 8 | 23 | #define MAX_NUM_PORTS 8 |
28 | 24 | ||
@@ -37,7 +33,8 @@ | |||
37 | * @serial: pointer back to the struct usb_serial owner of this port. | 33 | * @serial: pointer back to the struct usb_serial owner of this port. |
38 | * @port: pointer to the corresponding tty_port for this port. | 34 | * @port: pointer to the corresponding tty_port for this port. |
39 | * @lock: spinlock to grab when updating portions of this structure. | 35 | * @lock: spinlock to grab when updating portions of this structure. |
40 | * @number: the number of the port (the minor number). | 36 | * @minor: the minor number of the port |
37 | * @port_number: the struct usb_serial port number of this port (starts at 0) | ||
41 | * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. | 38 | * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. |
42 | * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. | 39 | * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. |
43 | * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe | 40 | * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe |
@@ -80,7 +77,8 @@ struct usb_serial_port { | |||
80 | struct usb_serial *serial; | 77 | struct usb_serial *serial; |
81 | struct tty_port port; | 78 | struct tty_port port; |
82 | spinlock_t lock; | 79 | spinlock_t lock; |
83 | unsigned char number; | 80 | u32 minor; |
81 | u8 port_number; | ||
84 | 82 | ||
85 | unsigned char *interrupt_in_buffer; | 83 | unsigned char *interrupt_in_buffer; |
86 | struct urb *interrupt_in_urb; | 84 | struct urb *interrupt_in_urb; |
@@ -140,7 +138,6 @@ static inline void usb_set_serial_port_data(struct usb_serial_port *port, | |||
140 | * @dev: pointer to the struct usb_device for this device | 138 | * @dev: pointer to the struct usb_device for this device |
141 | * @type: pointer to the struct usb_serial_driver for this device | 139 | * @type: pointer to the struct usb_serial_driver for this device |
142 | * @interface: pointer to the struct usb_interface for this device | 140 | * @interface: pointer to the struct usb_interface for this device |
143 | * @minor: the starting minor number for this device | ||
144 | * @num_ports: the number of ports this device has | 141 | * @num_ports: the number of ports this device has |
145 | * @num_interrupt_in: number of interrupt in endpoints we have | 142 | * @num_interrupt_in: number of interrupt in endpoints we have |
146 | * @num_interrupt_out: number of interrupt out endpoints we have | 143 | * @num_interrupt_out: number of interrupt out endpoints we have |
@@ -159,7 +156,7 @@ struct usb_serial { | |||
159 | unsigned char disconnected:1; | 156 | unsigned char disconnected:1; |
160 | unsigned char suspending:1; | 157 | unsigned char suspending:1; |
161 | unsigned char attached:1; | 158 | unsigned char attached:1; |
162 | unsigned char minor; | 159 | unsigned char minors_reserved:1; |
163 | unsigned char num_ports; | 160 | unsigned char num_ports; |
164 | unsigned char num_port_pointers; | 161 | unsigned char num_port_pointers; |
165 | char num_interrupt_in; | 162 | char num_interrupt_in; |
@@ -319,7 +316,7 @@ static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} | |||
319 | #endif | 316 | #endif |
320 | 317 | ||
321 | /* Functions needed by other parts of the usbserial core */ | 318 | /* Functions needed by other parts of the usbserial core */ |
322 | extern struct usb_serial *usb_serial_get_by_index(unsigned int minor); | 319 | extern struct usb_serial_port *usb_serial_port_get_by_minor(unsigned int minor); |
323 | extern void usb_serial_put(struct usb_serial *serial); | 320 | extern void usb_serial_put(struct usb_serial *serial); |
324 | extern int usb_serial_generic_open(struct tty_struct *tty, | 321 | extern int usb_serial_generic_open(struct tty_struct *tty, |
325 | struct usb_serial_port *port); | 322 | struct usb_serial_port *port); |
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h index 1b7519a8c0bf..d2ca919a5b73 100644 --- a/include/linux/usb/tegra_usb_phy.h +++ b/include/linux/usb/tegra_usb_phy.h | |||
@@ -42,6 +42,7 @@ enum tegra_usb_phy_port_speed { | |||
42 | enum tegra_usb_phy_mode { | 42 | enum tegra_usb_phy_mode { |
43 | TEGRA_USB_PHY_MODE_DEVICE, | 43 | TEGRA_USB_PHY_MODE_DEVICE, |
44 | TEGRA_USB_PHY_MODE_HOST, | 44 | TEGRA_USB_PHY_MODE_HOST, |
45 | TEGRA_USB_PHY_MODE_OTG, | ||
45 | }; | 46 | }; |
46 | 47 | ||
47 | struct tegra_xtal_freq; | 48 | struct tegra_xtal_freq; |
@@ -61,14 +62,10 @@ struct tegra_usb_phy { | |||
61 | struct device *dev; | 62 | struct device *dev; |
62 | bool is_legacy_phy; | 63 | bool is_legacy_phy; |
63 | bool is_ulpi_phy; | 64 | bool is_ulpi_phy; |
64 | void (*set_pts)(struct usb_phy *x, u8 pts_val); | 65 | int reset_gpio; |
65 | void (*set_phcd)(struct usb_phy *x, bool enable); | ||
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance, | 68 | struct usb_phy *tegra_usb_get_phy(struct device_node *dn); |
69 | void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode, | ||
70 | void (*set_pts)(struct usb_phy *x, u8 pts_val), | ||
71 | void (*set_phcd)(struct usb_phy *x, bool enable)); | ||
72 | 69 | ||
73 | void tegra_usb_phy_preresume(struct usb_phy *phy); | 70 | void tegra_usb_phy_preresume(struct usb_phy *phy); |
74 | 71 | ||
diff --git a/include/linux/usb/wusb-wa.h b/include/linux/usb/wusb-wa.h index f9dec37f617b..6be985b2a434 100644 --- a/include/linux/usb/wusb-wa.h +++ b/include/linux/usb/wusb-wa.h | |||
@@ -92,11 +92,20 @@ struct usb_rpipe_descriptor { | |||
92 | __le16 wRPipeIndex; | 92 | __le16 wRPipeIndex; |
93 | __le16 wRequests; | 93 | __le16 wRequests; |
94 | __le16 wBlocks; /* rw if 0 */ | 94 | __le16 wBlocks; /* rw if 0 */ |
95 | __le16 wMaxPacketSize; /* rw? */ | 95 | __le16 wMaxPacketSize; /* rw */ |
96 | u8 bHSHubAddress; /* reserved: 0 */ | 96 | union { |
97 | u8 bHSHubPort; /* ??? FIXME ??? */ | 97 | u8 dwa_bHSHubAddress; /* rw: DWA. */ |
98 | u8 hwa_bMaxBurst; /* rw: HWA. */ | ||
99 | }; | ||
100 | union { | ||
101 | u8 dwa_bHSHubPort; /* rw: DWA. */ | ||
102 | u8 hwa_bDeviceInfoIndex; /* rw: HWA. */ | ||
103 | }; | ||
98 | u8 bSpeed; /* rw: xfer rate 'enum uwb_phy_rate' */ | 104 | u8 bSpeed; /* rw: xfer rate 'enum uwb_phy_rate' */ |
99 | u8 bDeviceAddress; /* rw: Target device address */ | 105 | union { |
106 | u8 dwa_bDeviceAddress; /* rw: DWA Target device address. */ | ||
107 | u8 hwa_reserved; /* rw: HWA. */ | ||
108 | }; | ||
100 | u8 bEndpointAddress; /* rw: Target EP address */ | 109 | u8 bEndpointAddress; /* rw: Target EP address */ |
101 | u8 bDataSequence; /* ro: Current Data sequence */ | 110 | u8 bDataSequence; /* ro: Current Data sequence */ |
102 | __le32 dwCurrentWindow; /* ro */ | 111 | __le32 dwCurrentWindow; /* ro */ |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 0d33fca48774..8d7634247fb4 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -133,8 +133,6 @@ void change_console(struct vc_data *new_vc); | |||
133 | void reset_vc(struct vc_data *vc); | 133 | void reset_vc(struct vc_data *vc); |
134 | extern int do_unbind_con_driver(const struct consw *csw, int first, int last, | 134 | extern int do_unbind_con_driver(const struct consw *csw, int first, int last, |
135 | int deflt); | 135 | int deflt); |
136 | extern int unbind_con_driver(const struct consw *csw, int first, int last, | ||
137 | int deflt); | ||
138 | int vty_init(const struct file_operations *console_fops); | 136 | int vty_init(const struct file_operations *console_fops); |
139 | 137 | ||
140 | static inline bool vt_force_oops_output(struct vc_data *vc) | 138 | static inline bool vt_force_oops_output(struct vc_data *vc) |
diff --git a/include/linux/vtime.h b/include/linux/vtime.h index 71a5782d8c59..b1dd2db80076 100644 --- a/include/linux/vtime.h +++ b/include/linux/vtime.h | |||
@@ -34,7 +34,7 @@ static inline void vtime_user_exit(struct task_struct *tsk) | |||
34 | } | 34 | } |
35 | extern void vtime_guest_enter(struct task_struct *tsk); | 35 | extern void vtime_guest_enter(struct task_struct *tsk); |
36 | extern void vtime_guest_exit(struct task_struct *tsk); | 36 | extern void vtime_guest_exit(struct task_struct *tsk); |
37 | extern void vtime_init_idle(struct task_struct *tsk); | 37 | extern void vtime_init_idle(struct task_struct *tsk, int cpu); |
38 | #else | 38 | #else |
39 | static inline void vtime_account_irq_exit(struct task_struct *tsk) | 39 | static inline void vtime_account_irq_exit(struct task_struct *tsk) |
40 | { | 40 | { |
@@ -45,7 +45,7 @@ static inline void vtime_user_enter(struct task_struct *tsk) { } | |||
45 | static inline void vtime_user_exit(struct task_struct *tsk) { } | 45 | static inline void vtime_user_exit(struct task_struct *tsk) { } |
46 | static inline void vtime_guest_enter(struct task_struct *tsk) { } | 46 | static inline void vtime_guest_enter(struct task_struct *tsk) { } |
47 | static inline void vtime_guest_exit(struct task_struct *tsk) { } | 47 | static inline void vtime_guest_exit(struct task_struct *tsk) { } |
48 | static inline void vtime_init_idle(struct task_struct *tsk) { } | 48 | static inline void vtime_init_idle(struct task_struct *tsk, int cpu) { } |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #ifdef CONFIG_IRQ_TIME_ACCOUNTING | 51 | #ifdef CONFIG_IRQ_TIME_ACCOUNTING |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 1133695eb067..f487a4750b7f 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -23,6 +23,7 @@ struct __wait_queue { | |||
23 | struct wait_bit_key { | 23 | struct wait_bit_key { |
24 | void *flags; | 24 | void *flags; |
25 | int bit_nr; | 25 | int bit_nr; |
26 | #define WAIT_ATOMIC_T_BIT_NR -1 | ||
26 | }; | 27 | }; |
27 | 28 | ||
28 | struct wait_bit_queue { | 29 | struct wait_bit_queue { |
@@ -60,6 +61,9 @@ struct task_struct; | |||
60 | #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ | 61 | #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ |
61 | { .flags = word, .bit_nr = bit, } | 62 | { .flags = word, .bit_nr = bit, } |
62 | 63 | ||
64 | #define __WAIT_ATOMIC_T_KEY_INITIALIZER(p) \ | ||
65 | { .flags = p, .bit_nr = WAIT_ATOMIC_T_BIT_NR, } | ||
66 | |||
63 | extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *); | 67 | extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *); |
64 | 68 | ||
65 | #define init_waitqueue_head(q) \ | 69 | #define init_waitqueue_head(q) \ |
@@ -146,8 +150,10 @@ void __wake_up_bit(wait_queue_head_t *, void *, int); | |||
146 | int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); | 150 | int __wait_on_bit(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); |
147 | int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); | 151 | int __wait_on_bit_lock(wait_queue_head_t *, struct wait_bit_queue *, int (*)(void *), unsigned); |
148 | void wake_up_bit(void *, int); | 152 | void wake_up_bit(void *, int); |
153 | void wake_up_atomic_t(atomic_t *); | ||
149 | int out_of_line_wait_on_bit(void *, int, int (*)(void *), unsigned); | 154 | int out_of_line_wait_on_bit(void *, int, int (*)(void *), unsigned); |
150 | int out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned); | 155 | int out_of_line_wait_on_bit_lock(void *, int, int (*)(void *), unsigned); |
156 | int out_of_line_wait_on_atomic_t(atomic_t *, int (*)(atomic_t *), unsigned); | ||
151 | wait_queue_head_t *bit_waitqueue(void *, int); | 157 | wait_queue_head_t *bit_waitqueue(void *, int); |
152 | 158 | ||
153 | #define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL) | 159 | #define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL) |
@@ -902,5 +908,23 @@ static inline int wait_on_bit_lock(void *word, int bit, | |||
902 | return 0; | 908 | return 0; |
903 | return out_of_line_wait_on_bit_lock(word, bit, action, mode); | 909 | return out_of_line_wait_on_bit_lock(word, bit, action, mode); |
904 | } | 910 | } |
911 | |||
912 | /** | ||
913 | * wait_on_atomic_t - Wait for an atomic_t to become 0 | ||
914 | * @val: The atomic value being waited on, a kernel virtual address | ||
915 | * @action: the function used to sleep, which may take special actions | ||
916 | * @mode: the task state to sleep in | ||
917 | * | ||
918 | * Wait for an atomic_t to become 0. We abuse the bit-wait waitqueue table for | ||
919 | * the purpose of getting a waitqueue, but we set the key to a bit number | ||
920 | * outside of the target 'word'. | ||
921 | */ | ||
922 | static inline | ||
923 | int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode) | ||
924 | { | ||
925 | if (atomic_read(val) == 0) | ||
926 | return 0; | ||
927 | return out_of_line_wait_on_atomic_t(val, action, mode); | ||
928 | } | ||
905 | 929 | ||
906 | #endif | 930 | #endif |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 623488fdc1f5..a9f4119c7e2e 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -303,6 +303,33 @@ enum { | |||
303 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ | 303 | WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ |
304 | WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ | 304 | WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ |
305 | 305 | ||
306 | /* | ||
307 | * Per-cpu workqueues are generally preferred because they tend to | ||
308 | * show better performance thanks to cache locality. Per-cpu | ||
309 | * workqueues exclude the scheduler from choosing the CPU to | ||
310 | * execute the worker threads, which has an unfortunate side effect | ||
311 | * of increasing power consumption. | ||
312 | * | ||
313 | * The scheduler considers a CPU idle if it doesn't have any task | ||
314 | * to execute and tries to keep idle cores idle to conserve power; | ||
315 | * however, for example, a per-cpu work item scheduled from an | ||
316 | * interrupt handler on an idle CPU will force the scheduler to | ||
317 | * excute the work item on that CPU breaking the idleness, which in | ||
318 | * turn may lead to more scheduling choices which are sub-optimal | ||
319 | * in terms of power consumption. | ||
320 | * | ||
321 | * Workqueues marked with WQ_POWER_EFFICIENT are per-cpu by default | ||
322 | * but become unbound if workqueue.power_efficient kernel param is | ||
323 | * specified. Per-cpu workqueues which are identified to | ||
324 | * contribute significantly to power-consumption are identified and | ||
325 | * marked with this flag and enabling the power_efficient mode | ||
326 | * leads to noticeable power saving at the cost of small | ||
327 | * performance disadvantage. | ||
328 | * | ||
329 | * http://thread.gmane.org/gmane.linux.kernel/1480396 | ||
330 | */ | ||
331 | WQ_POWER_EFFICIENT = 1 << 7, | ||
332 | |||
306 | __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ | 333 | __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ |
307 | __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ | 334 | __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ |
308 | 335 | ||
@@ -333,11 +360,19 @@ enum { | |||
333 | * | 360 | * |
334 | * system_freezable_wq is equivalent to system_wq except that it's | 361 | * system_freezable_wq is equivalent to system_wq except that it's |
335 | * freezable. | 362 | * freezable. |
363 | * | ||
364 | * *_power_efficient_wq are inclined towards saving power and converted | ||
365 | * into WQ_UNBOUND variants if 'wq_power_efficient' is enabled; otherwise, | ||
366 | * they are same as their non-power-efficient counterparts - e.g. | ||
367 | * system_power_efficient_wq is identical to system_wq if | ||
368 | * 'wq_power_efficient' is disabled. See WQ_POWER_EFFICIENT for more info. | ||
336 | */ | 369 | */ |
337 | extern struct workqueue_struct *system_wq; | 370 | extern struct workqueue_struct *system_wq; |
338 | extern struct workqueue_struct *system_long_wq; | 371 | extern struct workqueue_struct *system_long_wq; |
339 | extern struct workqueue_struct *system_unbound_wq; | 372 | extern struct workqueue_struct *system_unbound_wq; |
340 | extern struct workqueue_struct *system_freezable_wq; | 373 | extern struct workqueue_struct *system_freezable_wq; |
374 | extern struct workqueue_struct *system_power_efficient_wq; | ||
375 | extern struct workqueue_struct *system_freezable_power_efficient_wq; | ||
341 | 376 | ||
342 | static inline struct workqueue_struct * __deprecated __system_nrt_wq(void) | 377 | static inline struct workqueue_struct * __deprecated __system_nrt_wq(void) |
343 | { | 378 | { |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 579a5007c696..abfe11787af3 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -78,6 +78,7 @@ struct writeback_control { | |||
78 | unsigned tagged_writepages:1; /* tag-and-write to avoid livelock */ | 78 | unsigned tagged_writepages:1; /* tag-and-write to avoid livelock */ |
79 | unsigned for_reclaim:1; /* Invoked from the page allocator */ | 79 | unsigned for_reclaim:1; /* Invoked from the page allocator */ |
80 | unsigned range_cyclic:1; /* range_start is cyclic */ | 80 | unsigned range_cyclic:1; /* range_start is cyclic */ |
81 | unsigned for_sync:1; /* sync(2) WB_SYNC_ALL writeback */ | ||
81 | }; | 82 | }; |
82 | 83 | ||
83 | /* | 84 | /* |
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index d3eef01da648..0f4555b2a31b 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h | |||
@@ -110,6 +110,8 @@ int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | |||
110 | struct v4l2_buffer *buf); | 110 | struct v4l2_buffer *buf); |
111 | int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | 111 | int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, |
112 | struct v4l2_buffer *buf); | 112 | struct v4l2_buffer *buf); |
113 | int v4l2_m2m_create_bufs(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | ||
114 | struct v4l2_create_buffers *create); | ||
113 | 115 | ||
114 | int v4l2_m2m_expbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, | 116 | int v4l2_m2m_expbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, |
115 | struct v4l2_exportbuffer *eb); | 117 | struct v4l2_exportbuffer *eb); |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 84a6440f1f19..21f702704f24 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
@@ -65,7 +65,7 @@ extern int addrconf_set_dstaddr(struct net *net, | |||
65 | 65 | ||
66 | extern int ipv6_chk_addr(struct net *net, | 66 | extern int ipv6_chk_addr(struct net *net, |
67 | const struct in6_addr *addr, | 67 | const struct in6_addr *addr, |
68 | struct net_device *dev, | 68 | const struct net_device *dev, |
69 | int strict); | 69 | int strict); |
70 | 70 | ||
71 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 71 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 35a57cd1704c..7cb6d360d147 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -1117,6 +1117,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event); | |||
1117 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); | 1117 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); |
1118 | int mgmt_index_added(struct hci_dev *hdev); | 1118 | int mgmt_index_added(struct hci_dev *hdev); |
1119 | int mgmt_index_removed(struct hci_dev *hdev); | 1119 | int mgmt_index_removed(struct hci_dev *hdev); |
1120 | int mgmt_set_powered_failed(struct hci_dev *hdev, int err); | ||
1120 | int mgmt_powered(struct hci_dev *hdev, u8 powered); | 1121 | int mgmt_powered(struct hci_dev *hdev, u8 powered); |
1121 | int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); | 1122 | int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); |
1122 | int mgmt_connectable(struct hci_dev *hdev, u8 connectable); | 1123 | int mgmt_connectable(struct hci_dev *hdev, u8 connectable); |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 22980a7c3873..9944c3e68c5d 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
@@ -42,6 +42,7 @@ | |||
42 | #define MGMT_STATUS_NOT_POWERED 0x0f | 42 | #define MGMT_STATUS_NOT_POWERED 0x0f |
43 | #define MGMT_STATUS_CANCELLED 0x10 | 43 | #define MGMT_STATUS_CANCELLED 0x10 |
44 | #define MGMT_STATUS_INVALID_INDEX 0x11 | 44 | #define MGMT_STATUS_INVALID_INDEX 0x11 |
45 | #define MGMT_STATUS_RFKILLED 0x12 | ||
45 | 46 | ||
46 | struct mgmt_hdr { | 47 | struct mgmt_hdr { |
47 | __le16 opcode; | 48 | __le16 opcode; |
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index 4b6f0b28f41f..09b1360e10bf 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h | |||
@@ -95,10 +95,10 @@ struct ip_tunnel_net { | |||
95 | int ip_tunnel_init(struct net_device *dev); | 95 | int ip_tunnel_init(struct net_device *dev); |
96 | void ip_tunnel_uninit(struct net_device *dev); | 96 | void ip_tunnel_uninit(struct net_device *dev); |
97 | void ip_tunnel_dellink(struct net_device *dev, struct list_head *head); | 97 | void ip_tunnel_dellink(struct net_device *dev, struct list_head *head); |
98 | int __net_init ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, | 98 | int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, |
99 | struct rtnl_link_ops *ops, char *devname); | 99 | struct rtnl_link_ops *ops, char *devname); |
100 | 100 | ||
101 | void __net_exit ip_tunnel_delete_net(struct ip_tunnel_net *itn); | 101 | void ip_tunnel_delete_net(struct ip_tunnel_net *itn); |
102 | 102 | ||
103 | void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, | 103 | void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, |
104 | const struct iphdr *tnl_params); | 104 | const struct iphdr *tnl_params); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index f10818fc8804..e7f4e21cc3e1 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -679,22 +679,26 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask, | |||
679 | #endif | 679 | #endif |
680 | 680 | ||
681 | struct psched_ratecfg { | 681 | struct psched_ratecfg { |
682 | u64 rate_bps; | 682 | u64 rate_bps; |
683 | u32 mult; | 683 | u32 mult; |
684 | u32 shift; | 684 | u16 overhead; |
685 | u8 shift; | ||
685 | }; | 686 | }; |
686 | 687 | ||
687 | static inline u64 psched_l2t_ns(const struct psched_ratecfg *r, | 688 | static inline u64 psched_l2t_ns(const struct psched_ratecfg *r, |
688 | unsigned int len) | 689 | unsigned int len) |
689 | { | 690 | { |
690 | return ((u64)len * r->mult) >> r->shift; | 691 | return ((u64)(len + r->overhead) * r->mult) >> r->shift; |
691 | } | 692 | } |
692 | 693 | ||
693 | extern void psched_ratecfg_precompute(struct psched_ratecfg *r, u32 rate); | 694 | extern void psched_ratecfg_precompute(struct psched_ratecfg *r, const struct tc_ratespec *conf); |
694 | 695 | ||
695 | static inline u32 psched_ratecfg_getrate(const struct psched_ratecfg *r) | 696 | static inline void psched_ratecfg_getrate(struct tc_ratespec *res, |
697 | const struct psched_ratecfg *r) | ||
696 | { | 698 | { |
697 | return r->rate_bps >> 3; | 699 | memset(res, 0, sizeof(*res)); |
700 | res->rate = r->rate_bps >> 3; | ||
701 | res->overhead = r->overhead; | ||
698 | } | 702 | } |
699 | 703 | ||
700 | #endif | 704 | #endif |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index ae16531d0d35..94ce082b29dc 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1160,6 +1160,8 @@ static inline void xfrm_sk_free_policy(struct sock *sk) | |||
1160 | } | 1160 | } |
1161 | } | 1161 | } |
1162 | 1162 | ||
1163 | extern void xfrm_garbage_collect(struct net *net); | ||
1164 | |||
1163 | #else | 1165 | #else |
1164 | 1166 | ||
1165 | static inline void xfrm_sk_free_policy(struct sock *sk) {} | 1167 | static inline void xfrm_sk_free_policy(struct sock *sk) {} |
@@ -1194,6 +1196,9 @@ static inline int xfrm6_policy_check_reverse(struct sock *sk, int dir, | |||
1194 | { | 1196 | { |
1195 | return 1; | 1197 | return 1; |
1196 | } | 1198 | } |
1199 | static inline void xfrm_garbage_collect(struct net *net) | ||
1200 | { | ||
1201 | } | ||
1197 | #endif | 1202 | #endif |
1198 | 1203 | ||
1199 | static __inline__ | 1204 | static __inline__ |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index d4609029f014..385c6329a967 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -450,7 +450,8 @@ enum snd_soc_dapm_type { | |||
450 | snd_soc_dapm_aif_in, /* audio interface input */ | 450 | snd_soc_dapm_aif_in, /* audio interface input */ |
451 | snd_soc_dapm_aif_out, /* audio interface output */ | 451 | snd_soc_dapm_aif_out, /* audio interface output */ |
452 | snd_soc_dapm_siggen, /* signal generator */ | 452 | snd_soc_dapm_siggen, /* signal generator */ |
453 | snd_soc_dapm_dai, /* link to DAI structure */ | 453 | snd_soc_dapm_dai_in, /* link to DAI structure */ |
454 | snd_soc_dapm_dai_out, | ||
454 | snd_soc_dapm_dai_link, /* link between two DAI structures */ | 455 | snd_soc_dapm_dai_link, /* link between two DAI structures */ |
455 | }; | 456 | }; |
456 | 457 | ||
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index 1905ca8dd399..02e1003568a4 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h | |||
@@ -44,6 +44,10 @@ | |||
44 | #define DEFINE_EVENT(template, name, proto, args) \ | 44 | #define DEFINE_EVENT(template, name, proto, args) \ |
45 | DEFINE_TRACE(name) | 45 | DEFINE_TRACE(name) |
46 | 46 | ||
47 | #undef DEFINE_EVENT_FN | ||
48 | #define DEFINE_EVENT_FN(template, name, proto, args, reg, unreg) \ | ||
49 | DEFINE_TRACE_FN(name, reg, unreg) | ||
50 | |||
47 | #undef DEFINE_EVENT_PRINT | 51 | #undef DEFINE_EVENT_PRINT |
48 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 52 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
49 | DEFINE_TRACE(name) | 53 | DEFINE_TRACE(name) |
@@ -91,6 +95,7 @@ | |||
91 | #undef TRACE_EVENT_CONDITION | 95 | #undef TRACE_EVENT_CONDITION |
92 | #undef DECLARE_EVENT_CLASS | 96 | #undef DECLARE_EVENT_CLASS |
93 | #undef DEFINE_EVENT | 97 | #undef DEFINE_EVENT |
98 | #undef DEFINE_EVENT_FN | ||
94 | #undef DEFINE_EVENT_PRINT | 99 | #undef DEFINE_EVENT_PRINT |
95 | #undef DEFINE_EVENT_CONDITION | 100 | #undef DEFINE_EVENT_CONDITION |
96 | #undef TRACE_HEADER_MULTI_READ | 101 | #undef TRACE_HEADER_MULTI_READ |
diff --git a/include/trace/events/ext3.h b/include/trace/events/ext3.h index 15d11a39be47..6797b9de90ed 100644 --- a/include/trace/events/ext3.h +++ b/include/trace/events/ext3.h | |||
@@ -290,13 +290,14 @@ DEFINE_EVENT(ext3__page_op, ext3_releasepage, | |||
290 | ); | 290 | ); |
291 | 291 | ||
292 | TRACE_EVENT(ext3_invalidatepage, | 292 | TRACE_EVENT(ext3_invalidatepage, |
293 | TP_PROTO(struct page *page, unsigned long offset), | 293 | TP_PROTO(struct page *page, unsigned int offset, unsigned int length), |
294 | 294 | ||
295 | TP_ARGS(page, offset), | 295 | TP_ARGS(page, offset, length), |
296 | 296 | ||
297 | TP_STRUCT__entry( | 297 | TP_STRUCT__entry( |
298 | __field( pgoff_t, index ) | 298 | __field( pgoff_t, index ) |
299 | __field( unsigned long, offset ) | 299 | __field( unsigned int, offset ) |
300 | __field( unsigned int, length ) | ||
300 | __field( ino_t, ino ) | 301 | __field( ino_t, ino ) |
301 | __field( dev_t, dev ) | 302 | __field( dev_t, dev ) |
302 | 303 | ||
@@ -305,14 +306,15 @@ TRACE_EVENT(ext3_invalidatepage, | |||
305 | TP_fast_assign( | 306 | TP_fast_assign( |
306 | __entry->index = page->index; | 307 | __entry->index = page->index; |
307 | __entry->offset = offset; | 308 | __entry->offset = offset; |
309 | __entry->length = length; | ||
308 | __entry->ino = page->mapping->host->i_ino; | 310 | __entry->ino = page->mapping->host->i_ino; |
309 | __entry->dev = page->mapping->host->i_sb->s_dev; | 311 | __entry->dev = page->mapping->host->i_sb->s_dev; |
310 | ), | 312 | ), |
311 | 313 | ||
312 | TP_printk("dev %d,%d ino %lu page_index %lu offset %lu", | 314 | TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u", |
313 | MAJOR(__entry->dev), MINOR(__entry->dev), | 315 | MAJOR(__entry->dev), MINOR(__entry->dev), |
314 | (unsigned long) __entry->ino, | 316 | (unsigned long) __entry->ino, |
315 | __entry->index, __entry->offset) | 317 | __entry->index, __entry->offset, __entry->length) |
316 | ); | 318 | ); |
317 | 319 | ||
318 | TRACE_EVENT(ext3_discard_blocks, | 320 | TRACE_EVENT(ext3_discard_blocks, |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 8ee15b97cd38..2068db241f22 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -19,6 +19,57 @@ struct extent_status; | |||
19 | 19 | ||
20 | #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) | 20 | #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) |
21 | 21 | ||
22 | #define show_mballoc_flags(flags) __print_flags(flags, "|", \ | ||
23 | { EXT4_MB_HINT_MERGE, "HINT_MERGE" }, \ | ||
24 | { EXT4_MB_HINT_RESERVED, "HINT_RESV" }, \ | ||
25 | { EXT4_MB_HINT_METADATA, "HINT_MDATA" }, \ | ||
26 | { EXT4_MB_HINT_FIRST, "HINT_FIRST" }, \ | ||
27 | { EXT4_MB_HINT_BEST, "HINT_BEST" }, \ | ||
28 | { EXT4_MB_HINT_DATA, "HINT_DATA" }, \ | ||
29 | { EXT4_MB_HINT_NOPREALLOC, "HINT_NOPREALLOC" }, \ | ||
30 | { EXT4_MB_HINT_GROUP_ALLOC, "HINT_GRP_ALLOC" }, \ | ||
31 | { EXT4_MB_HINT_GOAL_ONLY, "HINT_GOAL_ONLY" }, \ | ||
32 | { EXT4_MB_HINT_TRY_GOAL, "HINT_TRY_GOAL" }, \ | ||
33 | { EXT4_MB_DELALLOC_RESERVED, "DELALLOC_RESV" }, \ | ||
34 | { EXT4_MB_STREAM_ALLOC, "STREAM_ALLOC" }, \ | ||
35 | { EXT4_MB_USE_ROOT_BLOCKS, "USE_ROOT_BLKS" }, \ | ||
36 | { EXT4_MB_USE_RESERVED, "USE_RESV" }) | ||
37 | |||
38 | #define show_map_flags(flags) __print_flags(flags, "|", \ | ||
39 | { EXT4_GET_BLOCKS_CREATE, "CREATE" }, \ | ||
40 | { EXT4_GET_BLOCKS_UNINIT_EXT, "UNINIT" }, \ | ||
41 | { EXT4_GET_BLOCKS_DELALLOC_RESERVE, "DELALLOC" }, \ | ||
42 | { EXT4_GET_BLOCKS_PRE_IO, "PRE_IO" }, \ | ||
43 | { EXT4_GET_BLOCKS_CONVERT, "CONVERT" }, \ | ||
44 | { EXT4_GET_BLOCKS_METADATA_NOFAIL, "METADATA_NOFAIL" }, \ | ||
45 | { EXT4_GET_BLOCKS_NO_NORMALIZE, "NO_NORMALIZE" }, \ | ||
46 | { EXT4_GET_BLOCKS_KEEP_SIZE, "KEEP_SIZE" }, \ | ||
47 | { EXT4_GET_BLOCKS_NO_LOCK, "NO_LOCK" }, \ | ||
48 | { EXT4_GET_BLOCKS_NO_PUT_HOLE, "NO_PUT_HOLE" }) | ||
49 | |||
50 | #define show_mflags(flags) __print_flags(flags, "", \ | ||
51 | { EXT4_MAP_NEW, "N" }, \ | ||
52 | { EXT4_MAP_MAPPED, "M" }, \ | ||
53 | { EXT4_MAP_UNWRITTEN, "U" }, \ | ||
54 | { EXT4_MAP_BOUNDARY, "B" }, \ | ||
55 | { EXT4_MAP_UNINIT, "u" }, \ | ||
56 | { EXT4_MAP_FROM_CLUSTER, "C" }) | ||
57 | |||
58 | #define show_free_flags(flags) __print_flags(flags, "|", \ | ||
59 | { EXT4_FREE_BLOCKS_METADATA, "METADATA" }, \ | ||
60 | { EXT4_FREE_BLOCKS_FORGET, "FORGET" }, \ | ||
61 | { EXT4_FREE_BLOCKS_VALIDATED, "VALIDATED" }, \ | ||
62 | { EXT4_FREE_BLOCKS_NO_QUOT_UPDATE, "NO_QUOTA" }, \ | ||
63 | { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\ | ||
64 | { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" }) | ||
65 | |||
66 | #define show_extent_status(status) __print_flags(status, "", \ | ||
67 | { (1 << 3), "W" }, \ | ||
68 | { (1 << 2), "U" }, \ | ||
69 | { (1 << 1), "D" }, \ | ||
70 | { (1 << 0), "H" }) | ||
71 | |||
72 | |||
22 | TRACE_EVENT(ext4_free_inode, | 73 | TRACE_EVENT(ext4_free_inode, |
23 | TP_PROTO(struct inode *inode), | 74 | TP_PROTO(struct inode *inode), |
24 | 75 | ||
@@ -281,7 +332,7 @@ DEFINE_EVENT(ext4__write_end, ext4_da_write_end, | |||
281 | TP_ARGS(inode, pos, len, copied) | 332 | TP_ARGS(inode, pos, len, copied) |
282 | ); | 333 | ); |
283 | 334 | ||
284 | TRACE_EVENT(ext4_da_writepages, | 335 | TRACE_EVENT(ext4_writepages, |
285 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), | 336 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), |
286 | 337 | ||
287 | TP_ARGS(inode, wbc), | 338 | TP_ARGS(inode, wbc), |
@@ -324,46 +375,62 @@ TRACE_EVENT(ext4_da_writepages, | |||
324 | ); | 375 | ); |
325 | 376 | ||
326 | TRACE_EVENT(ext4_da_write_pages, | 377 | TRACE_EVENT(ext4_da_write_pages, |
327 | TP_PROTO(struct inode *inode, struct mpage_da_data *mpd), | 378 | TP_PROTO(struct inode *inode, pgoff_t first_page, |
379 | struct writeback_control *wbc), | ||
328 | 380 | ||
329 | TP_ARGS(inode, mpd), | 381 | TP_ARGS(inode, first_page, wbc), |
330 | 382 | ||
331 | TP_STRUCT__entry( | 383 | TP_STRUCT__entry( |
332 | __field( dev_t, dev ) | 384 | __field( dev_t, dev ) |
333 | __field( ino_t, ino ) | 385 | __field( ino_t, ino ) |
334 | __field( __u64, b_blocknr ) | 386 | __field( pgoff_t, first_page ) |
335 | __field( __u32, b_size ) | 387 | __field( long, nr_to_write ) |
336 | __field( __u32, b_state ) | 388 | __field( int, sync_mode ) |
337 | __field( unsigned long, first_page ) | ||
338 | __field( int, io_done ) | ||
339 | __field( int, pages_written ) | ||
340 | __field( int, sync_mode ) | ||
341 | ), | 389 | ), |
342 | 390 | ||
343 | TP_fast_assign( | 391 | TP_fast_assign( |
344 | __entry->dev = inode->i_sb->s_dev; | 392 | __entry->dev = inode->i_sb->s_dev; |
345 | __entry->ino = inode->i_ino; | 393 | __entry->ino = inode->i_ino; |
346 | __entry->b_blocknr = mpd->b_blocknr; | 394 | __entry->first_page = first_page; |
347 | __entry->b_size = mpd->b_size; | 395 | __entry->nr_to_write = wbc->nr_to_write; |
348 | __entry->b_state = mpd->b_state; | 396 | __entry->sync_mode = wbc->sync_mode; |
349 | __entry->first_page = mpd->first_page; | ||
350 | __entry->io_done = mpd->io_done; | ||
351 | __entry->pages_written = mpd->pages_written; | ||
352 | __entry->sync_mode = mpd->wbc->sync_mode; | ||
353 | ), | 397 | ), |
354 | 398 | ||
355 | TP_printk("dev %d,%d ino %lu b_blocknr %llu b_size %u b_state 0x%04x " | 399 | TP_printk("dev %d,%d ino %lu first_page %lu nr_to_write %ld " |
356 | "first_page %lu io_done %d pages_written %d sync_mode %d", | 400 | "sync_mode %d", |
357 | MAJOR(__entry->dev), MINOR(__entry->dev), | 401 | MAJOR(__entry->dev), MINOR(__entry->dev), |
358 | (unsigned long) __entry->ino, | 402 | (unsigned long) __entry->ino, __entry->first_page, |
359 | __entry->b_blocknr, __entry->b_size, | 403 | __entry->nr_to_write, __entry->sync_mode) |
360 | __entry->b_state, __entry->first_page, | ||
361 | __entry->io_done, __entry->pages_written, | ||
362 | __entry->sync_mode | ||
363 | ) | ||
364 | ); | 404 | ); |
365 | 405 | ||
366 | TRACE_EVENT(ext4_da_writepages_result, | 406 | TRACE_EVENT(ext4_da_write_pages_extent, |
407 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map), | ||
408 | |||
409 | TP_ARGS(inode, map), | ||
410 | |||
411 | TP_STRUCT__entry( | ||
412 | __field( dev_t, dev ) | ||
413 | __field( ino_t, ino ) | ||
414 | __field( __u64, lblk ) | ||
415 | __field( __u32, len ) | ||
416 | __field( __u32, flags ) | ||
417 | ), | ||
418 | |||
419 | TP_fast_assign( | ||
420 | __entry->dev = inode->i_sb->s_dev; | ||
421 | __entry->ino = inode->i_ino; | ||
422 | __entry->lblk = map->m_lblk; | ||
423 | __entry->len = map->m_len; | ||
424 | __entry->flags = map->m_flags; | ||
425 | ), | ||
426 | |||
427 | TP_printk("dev %d,%d ino %lu lblk %llu len %u flags %s", | ||
428 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
429 | (unsigned long) __entry->ino, __entry->lblk, __entry->len, | ||
430 | show_mflags(__entry->flags)) | ||
431 | ); | ||
432 | |||
433 | TRACE_EVENT(ext4_writepages_result, | ||
367 | TP_PROTO(struct inode *inode, struct writeback_control *wbc, | 434 | TP_PROTO(struct inode *inode, struct writeback_control *wbc, |
368 | int ret, int pages_written), | 435 | int ret, int pages_written), |
369 | 436 | ||
@@ -444,16 +511,16 @@ DEFINE_EVENT(ext4__page_op, ext4_releasepage, | |||
444 | ); | 511 | ); |
445 | 512 | ||
446 | DECLARE_EVENT_CLASS(ext4_invalidatepage_op, | 513 | DECLARE_EVENT_CLASS(ext4_invalidatepage_op, |
447 | TP_PROTO(struct page *page, unsigned long offset), | 514 | TP_PROTO(struct page *page, unsigned int offset, unsigned int length), |
448 | 515 | ||
449 | TP_ARGS(page, offset), | 516 | TP_ARGS(page, offset, length), |
450 | 517 | ||
451 | TP_STRUCT__entry( | 518 | TP_STRUCT__entry( |
452 | __field( dev_t, dev ) | 519 | __field( dev_t, dev ) |
453 | __field( ino_t, ino ) | 520 | __field( ino_t, ino ) |
454 | __field( pgoff_t, index ) | 521 | __field( pgoff_t, index ) |
455 | __field( unsigned long, offset ) | 522 | __field( unsigned int, offset ) |
456 | 523 | __field( unsigned int, length ) | |
457 | ), | 524 | ), |
458 | 525 | ||
459 | TP_fast_assign( | 526 | TP_fast_assign( |
@@ -461,24 +528,26 @@ DECLARE_EVENT_CLASS(ext4_invalidatepage_op, | |||
461 | __entry->ino = page->mapping->host->i_ino; | 528 | __entry->ino = page->mapping->host->i_ino; |
462 | __entry->index = page->index; | 529 | __entry->index = page->index; |
463 | __entry->offset = offset; | 530 | __entry->offset = offset; |
531 | __entry->length = length; | ||
464 | ), | 532 | ), |
465 | 533 | ||
466 | TP_printk("dev %d,%d ino %lu page_index %lu offset %lu", | 534 | TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u", |
467 | MAJOR(__entry->dev), MINOR(__entry->dev), | 535 | MAJOR(__entry->dev), MINOR(__entry->dev), |
468 | (unsigned long) __entry->ino, | 536 | (unsigned long) __entry->ino, |
469 | (unsigned long) __entry->index, __entry->offset) | 537 | (unsigned long) __entry->index, |
538 | __entry->offset, __entry->length) | ||
470 | ); | 539 | ); |
471 | 540 | ||
472 | DEFINE_EVENT(ext4_invalidatepage_op, ext4_invalidatepage, | 541 | DEFINE_EVENT(ext4_invalidatepage_op, ext4_invalidatepage, |
473 | TP_PROTO(struct page *page, unsigned long offset), | 542 | TP_PROTO(struct page *page, unsigned int offset, unsigned int length), |
474 | 543 | ||
475 | TP_ARGS(page, offset) | 544 | TP_ARGS(page, offset, length) |
476 | ); | 545 | ); |
477 | 546 | ||
478 | DEFINE_EVENT(ext4_invalidatepage_op, ext4_journalled_invalidatepage, | 547 | DEFINE_EVENT(ext4_invalidatepage_op, ext4_journalled_invalidatepage, |
479 | TP_PROTO(struct page *page, unsigned long offset), | 548 | TP_PROTO(struct page *page, unsigned int offset, unsigned int length), |
480 | 549 | ||
481 | TP_ARGS(page, offset) | 550 | TP_ARGS(page, offset, length) |
482 | ); | 551 | ); |
483 | 552 | ||
484 | TRACE_EVENT(ext4_discard_blocks, | 553 | TRACE_EVENT(ext4_discard_blocks, |
@@ -673,10 +742,10 @@ TRACE_EVENT(ext4_request_blocks, | |||
673 | __entry->flags = ar->flags; | 742 | __entry->flags = ar->flags; |
674 | ), | 743 | ), |
675 | 744 | ||
676 | TP_printk("dev %d,%d ino %lu flags %u len %u lblk %u goal %llu " | 745 | TP_printk("dev %d,%d ino %lu flags %s len %u lblk %u goal %llu " |
677 | "lleft %u lright %u pleft %llu pright %llu ", | 746 | "lleft %u lright %u pleft %llu pright %llu ", |
678 | MAJOR(__entry->dev), MINOR(__entry->dev), | 747 | MAJOR(__entry->dev), MINOR(__entry->dev), |
679 | (unsigned long) __entry->ino, __entry->flags, | 748 | (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags), |
680 | __entry->len, __entry->logical, __entry->goal, | 749 | __entry->len, __entry->logical, __entry->goal, |
681 | __entry->lleft, __entry->lright, __entry->pleft, | 750 | __entry->lleft, __entry->lright, __entry->pleft, |
682 | __entry->pright) | 751 | __entry->pright) |
@@ -715,10 +784,10 @@ TRACE_EVENT(ext4_allocate_blocks, | |||
715 | __entry->flags = ar->flags; | 784 | __entry->flags = ar->flags; |
716 | ), | 785 | ), |
717 | 786 | ||
718 | TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %u " | 787 | TP_printk("dev %d,%d ino %lu flags %s len %u block %llu lblk %u " |
719 | "goal %llu lleft %u lright %u pleft %llu pright %llu", | 788 | "goal %llu lleft %u lright %u pleft %llu pright %llu", |
720 | MAJOR(__entry->dev), MINOR(__entry->dev), | 789 | MAJOR(__entry->dev), MINOR(__entry->dev), |
721 | (unsigned long) __entry->ino, __entry->flags, | 790 | (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags), |
722 | __entry->len, __entry->block, __entry->logical, | 791 | __entry->len, __entry->block, __entry->logical, |
723 | __entry->goal, __entry->lleft, __entry->lright, | 792 | __entry->goal, __entry->lleft, __entry->lright, |
724 | __entry->pleft, __entry->pright) | 793 | __entry->pleft, __entry->pright) |
@@ -748,11 +817,11 @@ TRACE_EVENT(ext4_free_blocks, | |||
748 | __entry->mode = inode->i_mode; | 817 | __entry->mode = inode->i_mode; |
749 | ), | 818 | ), |
750 | 819 | ||
751 | TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %d", | 820 | TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %s", |
752 | MAJOR(__entry->dev), MINOR(__entry->dev), | 821 | MAJOR(__entry->dev), MINOR(__entry->dev), |
753 | (unsigned long) __entry->ino, | 822 | (unsigned long) __entry->ino, |
754 | __entry->mode, __entry->block, __entry->count, | 823 | __entry->mode, __entry->block, __entry->count, |
755 | __entry->flags) | 824 | show_free_flags(__entry->flags)) |
756 | ); | 825 | ); |
757 | 826 | ||
758 | TRACE_EVENT(ext4_sync_file_enter, | 827 | TRACE_EVENT(ext4_sync_file_enter, |
@@ -903,7 +972,7 @@ TRACE_EVENT(ext4_mballoc_alloc, | |||
903 | ), | 972 | ), |
904 | 973 | ||
905 | TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u " | 974 | TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u " |
906 | "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x " | 975 | "result %u/%d/%u@%u blks %u grps %u cr %u flags %s " |
907 | "tail %u broken %u", | 976 | "tail %u broken %u", |
908 | MAJOR(__entry->dev), MINOR(__entry->dev), | 977 | MAJOR(__entry->dev), MINOR(__entry->dev), |
909 | (unsigned long) __entry->ino, | 978 | (unsigned long) __entry->ino, |
@@ -914,7 +983,7 @@ TRACE_EVENT(ext4_mballoc_alloc, | |||
914 | __entry->result_group, __entry->result_start, | 983 | __entry->result_group, __entry->result_start, |
915 | __entry->result_len, __entry->result_logical, | 984 | __entry->result_len, __entry->result_logical, |
916 | __entry->found, __entry->groups, __entry->cr, | 985 | __entry->found, __entry->groups, __entry->cr, |
917 | __entry->flags, __entry->tail, | 986 | show_mballoc_flags(__entry->flags), __entry->tail, |
918 | __entry->buddy ? 1 << __entry->buddy : 0) | 987 | __entry->buddy ? 1 << __entry->buddy : 0) |
919 | ); | 988 | ); |
920 | 989 | ||
@@ -1528,10 +1597,10 @@ DECLARE_EVENT_CLASS(ext4__map_blocks_enter, | |||
1528 | __entry->flags = flags; | 1597 | __entry->flags = flags; |
1529 | ), | 1598 | ), |
1530 | 1599 | ||
1531 | TP_printk("dev %d,%d ino %lu lblk %u len %u flags %u", | 1600 | TP_printk("dev %d,%d ino %lu lblk %u len %u flags %s", |
1532 | MAJOR(__entry->dev), MINOR(__entry->dev), | 1601 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1533 | (unsigned long) __entry->ino, | 1602 | (unsigned long) __entry->ino, |
1534 | __entry->lblk, __entry->len, __entry->flags) | 1603 | __entry->lblk, __entry->len, show_map_flags(__entry->flags)) |
1535 | ); | 1604 | ); |
1536 | 1605 | ||
1537 | DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter, | 1606 | DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter, |
@@ -1549,47 +1618,53 @@ DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter, | |||
1549 | ); | 1618 | ); |
1550 | 1619 | ||
1551 | DECLARE_EVENT_CLASS(ext4__map_blocks_exit, | 1620 | DECLARE_EVENT_CLASS(ext4__map_blocks_exit, |
1552 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret), | 1621 | TP_PROTO(struct inode *inode, unsigned flags, struct ext4_map_blocks *map, |
1622 | int ret), | ||
1553 | 1623 | ||
1554 | TP_ARGS(inode, map, ret), | 1624 | TP_ARGS(inode, flags, map, ret), |
1555 | 1625 | ||
1556 | TP_STRUCT__entry( | 1626 | TP_STRUCT__entry( |
1557 | __field( dev_t, dev ) | 1627 | __field( dev_t, dev ) |
1558 | __field( ino_t, ino ) | 1628 | __field( ino_t, ino ) |
1629 | __field( unsigned int, flags ) | ||
1559 | __field( ext4_fsblk_t, pblk ) | 1630 | __field( ext4_fsblk_t, pblk ) |
1560 | __field( ext4_lblk_t, lblk ) | 1631 | __field( ext4_lblk_t, lblk ) |
1561 | __field( unsigned int, len ) | 1632 | __field( unsigned int, len ) |
1562 | __field( unsigned int, flags ) | 1633 | __field( unsigned int, mflags ) |
1563 | __field( int, ret ) | 1634 | __field( int, ret ) |
1564 | ), | 1635 | ), |
1565 | 1636 | ||
1566 | TP_fast_assign( | 1637 | TP_fast_assign( |
1567 | __entry->dev = inode->i_sb->s_dev; | 1638 | __entry->dev = inode->i_sb->s_dev; |
1568 | __entry->ino = inode->i_ino; | 1639 | __entry->ino = inode->i_ino; |
1640 | __entry->flags = flags; | ||
1569 | __entry->pblk = map->m_pblk; | 1641 | __entry->pblk = map->m_pblk; |
1570 | __entry->lblk = map->m_lblk; | 1642 | __entry->lblk = map->m_lblk; |
1571 | __entry->len = map->m_len; | 1643 | __entry->len = map->m_len; |
1572 | __entry->flags = map->m_flags; | 1644 | __entry->mflags = map->m_flags; |
1573 | __entry->ret = ret; | 1645 | __entry->ret = ret; |
1574 | ), | 1646 | ), |
1575 | 1647 | ||
1576 | TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u flags %x ret %d", | 1648 | TP_printk("dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u " |
1649 | "mflags %s ret %d", | ||
1577 | MAJOR(__entry->dev), MINOR(__entry->dev), | 1650 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1578 | (unsigned long) __entry->ino, | 1651 | (unsigned long) __entry->ino, |
1579 | __entry->lblk, __entry->pblk, | 1652 | show_map_flags(__entry->flags), __entry->lblk, __entry->pblk, |
1580 | __entry->len, __entry->flags, __entry->ret) | 1653 | __entry->len, show_mflags(__entry->mflags), __entry->ret) |
1581 | ); | 1654 | ); |
1582 | 1655 | ||
1583 | DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit, | 1656 | DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit, |
1584 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret), | 1657 | TP_PROTO(struct inode *inode, unsigned flags, |
1658 | struct ext4_map_blocks *map, int ret), | ||
1585 | 1659 | ||
1586 | TP_ARGS(inode, map, ret) | 1660 | TP_ARGS(inode, flags, map, ret) |
1587 | ); | 1661 | ); |
1588 | 1662 | ||
1589 | DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit, | 1663 | DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit, |
1590 | TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int ret), | 1664 | TP_PROTO(struct inode *inode, unsigned flags, |
1665 | struct ext4_map_blocks *map, int ret), | ||
1591 | 1666 | ||
1592 | TP_ARGS(inode, map, ret) | 1667 | TP_ARGS(inode, flags, map, ret) |
1593 | ); | 1668 | ); |
1594 | 1669 | ||
1595 | TRACE_EVENT(ext4_ext_load_extent, | 1670 | TRACE_EVENT(ext4_ext_load_extent, |
@@ -1638,25 +1713,50 @@ TRACE_EVENT(ext4_load_inode, | |||
1638 | ); | 1713 | ); |
1639 | 1714 | ||
1640 | TRACE_EVENT(ext4_journal_start, | 1715 | TRACE_EVENT(ext4_journal_start, |
1641 | TP_PROTO(struct super_block *sb, int nblocks, unsigned long IP), | 1716 | TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks, |
1717 | unsigned long IP), | ||
1642 | 1718 | ||
1643 | TP_ARGS(sb, nblocks, IP), | 1719 | TP_ARGS(sb, blocks, rsv_blocks, IP), |
1644 | 1720 | ||
1645 | TP_STRUCT__entry( | 1721 | TP_STRUCT__entry( |
1646 | __field( dev_t, dev ) | 1722 | __field( dev_t, dev ) |
1647 | __field(unsigned long, ip ) | 1723 | __field(unsigned long, ip ) |
1648 | __field( int, nblocks ) | 1724 | __field( int, blocks ) |
1725 | __field( int, rsv_blocks ) | ||
1649 | ), | 1726 | ), |
1650 | 1727 | ||
1651 | TP_fast_assign( | 1728 | TP_fast_assign( |
1652 | __entry->dev = sb->s_dev; | 1729 | __entry->dev = sb->s_dev; |
1653 | __entry->ip = IP; | 1730 | __entry->ip = IP; |
1654 | __entry->nblocks = nblocks; | 1731 | __entry->blocks = blocks; |
1732 | __entry->rsv_blocks = rsv_blocks; | ||
1655 | ), | 1733 | ), |
1656 | 1734 | ||
1657 | TP_printk("dev %d,%d nblocks %d caller %pF", | 1735 | TP_printk("dev %d,%d blocks, %d rsv_blocks, %d caller %pF", |
1658 | MAJOR(__entry->dev), MINOR(__entry->dev), | 1736 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1659 | __entry->nblocks, (void *)__entry->ip) | 1737 | __entry->blocks, __entry->rsv_blocks, (void *)__entry->ip) |
1738 | ); | ||
1739 | |||
1740 | TRACE_EVENT(ext4_journal_start_reserved, | ||
1741 | TP_PROTO(struct super_block *sb, int blocks, unsigned long IP), | ||
1742 | |||
1743 | TP_ARGS(sb, blocks, IP), | ||
1744 | |||
1745 | TP_STRUCT__entry( | ||
1746 | __field( dev_t, dev ) | ||
1747 | __field(unsigned long, ip ) | ||
1748 | __field( int, blocks ) | ||
1749 | ), | ||
1750 | |||
1751 | TP_fast_assign( | ||
1752 | __entry->dev = sb->s_dev; | ||
1753 | __entry->ip = IP; | ||
1754 | __entry->blocks = blocks; | ||
1755 | ), | ||
1756 | |||
1757 | TP_printk("dev %d,%d blocks, %d caller %pF", | ||
1758 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
1759 | __entry->blocks, (void *)__entry->ip) | ||
1660 | ); | 1760 | ); |
1661 | 1761 | ||
1662 | DECLARE_EVENT_CLASS(ext4__trim, | 1762 | DECLARE_EVENT_CLASS(ext4__trim, |
@@ -1736,12 +1836,12 @@ TRACE_EVENT(ext4_ext_handle_uninitialized_extents, | |||
1736 | __entry->newblk = newblock; | 1836 | __entry->newblk = newblock; |
1737 | ), | 1837 | ), |
1738 | 1838 | ||
1739 | TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %x " | 1839 | TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %s " |
1740 | "allocated %d newblock %llu", | 1840 | "allocated %d newblock %llu", |
1741 | MAJOR(__entry->dev), MINOR(__entry->dev), | 1841 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1742 | (unsigned long) __entry->ino, | 1842 | (unsigned long) __entry->ino, |
1743 | (unsigned) __entry->lblk, (unsigned long long) __entry->pblk, | 1843 | (unsigned) __entry->lblk, (unsigned long long) __entry->pblk, |
1744 | __entry->len, __entry->flags, | 1844 | __entry->len, show_map_flags(__entry->flags), |
1745 | (unsigned int) __entry->allocated, | 1845 | (unsigned int) __entry->allocated, |
1746 | (unsigned long long) __entry->newblk) | 1846 | (unsigned long long) __entry->newblk) |
1747 | ); | 1847 | ); |
@@ -1769,10 +1869,10 @@ TRACE_EVENT(ext4_get_implied_cluster_alloc_exit, | |||
1769 | __entry->ret = ret; | 1869 | __entry->ret = ret; |
1770 | ), | 1870 | ), |
1771 | 1871 | ||
1772 | TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %u ret %d", | 1872 | TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %s ret %d", |
1773 | MAJOR(__entry->dev), MINOR(__entry->dev), | 1873 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1774 | __entry->lblk, (unsigned long long) __entry->pblk, | 1874 | __entry->lblk, (unsigned long long) __entry->pblk, |
1775 | __entry->len, __entry->flags, __entry->ret) | 1875 | __entry->len, show_mflags(__entry->flags), __entry->ret) |
1776 | ); | 1876 | ); |
1777 | 1877 | ||
1778 | TRACE_EVENT(ext4_ext_put_in_cache, | 1878 | TRACE_EVENT(ext4_ext_put_in_cache, |
@@ -1926,7 +2026,7 @@ TRACE_EVENT(ext4_ext_show_extent, | |||
1926 | TRACE_EVENT(ext4_remove_blocks, | 2026 | TRACE_EVENT(ext4_remove_blocks, |
1927 | TP_PROTO(struct inode *inode, struct ext4_extent *ex, | 2027 | TP_PROTO(struct inode *inode, struct ext4_extent *ex, |
1928 | ext4_lblk_t from, ext4_fsblk_t to, | 2028 | ext4_lblk_t from, ext4_fsblk_t to, |
1929 | ext4_fsblk_t partial_cluster), | 2029 | long long partial_cluster), |
1930 | 2030 | ||
1931 | TP_ARGS(inode, ex, from, to, partial_cluster), | 2031 | TP_ARGS(inode, ex, from, to, partial_cluster), |
1932 | 2032 | ||
@@ -1935,7 +2035,7 @@ TRACE_EVENT(ext4_remove_blocks, | |||
1935 | __field( ino_t, ino ) | 2035 | __field( ino_t, ino ) |
1936 | __field( ext4_lblk_t, from ) | 2036 | __field( ext4_lblk_t, from ) |
1937 | __field( ext4_lblk_t, to ) | 2037 | __field( ext4_lblk_t, to ) |
1938 | __field( ext4_fsblk_t, partial ) | 2038 | __field( long long, partial ) |
1939 | __field( ext4_fsblk_t, ee_pblk ) | 2039 | __field( ext4_fsblk_t, ee_pblk ) |
1940 | __field( ext4_lblk_t, ee_lblk ) | 2040 | __field( ext4_lblk_t, ee_lblk ) |
1941 | __field( unsigned short, ee_len ) | 2041 | __field( unsigned short, ee_len ) |
@@ -1953,7 +2053,7 @@ TRACE_EVENT(ext4_remove_blocks, | |||
1953 | ), | 2053 | ), |
1954 | 2054 | ||
1955 | TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]" | 2055 | TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]" |
1956 | "from %u to %u partial_cluster %u", | 2056 | "from %u to %u partial_cluster %lld", |
1957 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2057 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1958 | (unsigned long) __entry->ino, | 2058 | (unsigned long) __entry->ino, |
1959 | (unsigned) __entry->ee_lblk, | 2059 | (unsigned) __entry->ee_lblk, |
@@ -1961,19 +2061,20 @@ TRACE_EVENT(ext4_remove_blocks, | |||
1961 | (unsigned short) __entry->ee_len, | 2061 | (unsigned short) __entry->ee_len, |
1962 | (unsigned) __entry->from, | 2062 | (unsigned) __entry->from, |
1963 | (unsigned) __entry->to, | 2063 | (unsigned) __entry->to, |
1964 | (unsigned) __entry->partial) | 2064 | (long long) __entry->partial) |
1965 | ); | 2065 | ); |
1966 | 2066 | ||
1967 | TRACE_EVENT(ext4_ext_rm_leaf, | 2067 | TRACE_EVENT(ext4_ext_rm_leaf, |
1968 | TP_PROTO(struct inode *inode, ext4_lblk_t start, | 2068 | TP_PROTO(struct inode *inode, ext4_lblk_t start, |
1969 | struct ext4_extent *ex, ext4_fsblk_t partial_cluster), | 2069 | struct ext4_extent *ex, |
2070 | long long partial_cluster), | ||
1970 | 2071 | ||
1971 | TP_ARGS(inode, start, ex, partial_cluster), | 2072 | TP_ARGS(inode, start, ex, partial_cluster), |
1972 | 2073 | ||
1973 | TP_STRUCT__entry( | 2074 | TP_STRUCT__entry( |
1974 | __field( dev_t, dev ) | 2075 | __field( dev_t, dev ) |
1975 | __field( ino_t, ino ) | 2076 | __field( ino_t, ino ) |
1976 | __field( ext4_fsblk_t, partial ) | 2077 | __field( long long, partial ) |
1977 | __field( ext4_lblk_t, start ) | 2078 | __field( ext4_lblk_t, start ) |
1978 | __field( ext4_lblk_t, ee_lblk ) | 2079 | __field( ext4_lblk_t, ee_lblk ) |
1979 | __field( ext4_fsblk_t, ee_pblk ) | 2080 | __field( ext4_fsblk_t, ee_pblk ) |
@@ -1991,14 +2092,14 @@ TRACE_EVENT(ext4_ext_rm_leaf, | |||
1991 | ), | 2092 | ), |
1992 | 2093 | ||
1993 | TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]" | 2094 | TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]" |
1994 | "partial_cluster %u", | 2095 | "partial_cluster %lld", |
1995 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2096 | MAJOR(__entry->dev), MINOR(__entry->dev), |
1996 | (unsigned long) __entry->ino, | 2097 | (unsigned long) __entry->ino, |
1997 | (unsigned) __entry->start, | 2098 | (unsigned) __entry->start, |
1998 | (unsigned) __entry->ee_lblk, | 2099 | (unsigned) __entry->ee_lblk, |
1999 | (unsigned long long) __entry->ee_pblk, | 2100 | (unsigned long long) __entry->ee_pblk, |
2000 | (unsigned short) __entry->ee_len, | 2101 | (unsigned short) __entry->ee_len, |
2001 | (unsigned) __entry->partial) | 2102 | (long long) __entry->partial) |
2002 | ); | 2103 | ); |
2003 | 2104 | ||
2004 | TRACE_EVENT(ext4_ext_rm_idx, | 2105 | TRACE_EVENT(ext4_ext_rm_idx, |
@@ -2025,14 +2126,16 @@ TRACE_EVENT(ext4_ext_rm_idx, | |||
2025 | ); | 2126 | ); |
2026 | 2127 | ||
2027 | TRACE_EVENT(ext4_ext_remove_space, | 2128 | TRACE_EVENT(ext4_ext_remove_space, |
2028 | TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth), | 2129 | TP_PROTO(struct inode *inode, ext4_lblk_t start, |
2130 | ext4_lblk_t end, int depth), | ||
2029 | 2131 | ||
2030 | TP_ARGS(inode, start, depth), | 2132 | TP_ARGS(inode, start, end, depth), |
2031 | 2133 | ||
2032 | TP_STRUCT__entry( | 2134 | TP_STRUCT__entry( |
2033 | __field( dev_t, dev ) | 2135 | __field( dev_t, dev ) |
2034 | __field( ino_t, ino ) | 2136 | __field( ino_t, ino ) |
2035 | __field( ext4_lblk_t, start ) | 2137 | __field( ext4_lblk_t, start ) |
2138 | __field( ext4_lblk_t, end ) | ||
2036 | __field( int, depth ) | 2139 | __field( int, depth ) |
2037 | ), | 2140 | ), |
2038 | 2141 | ||
@@ -2040,28 +2143,31 @@ TRACE_EVENT(ext4_ext_remove_space, | |||
2040 | __entry->dev = inode->i_sb->s_dev; | 2143 | __entry->dev = inode->i_sb->s_dev; |
2041 | __entry->ino = inode->i_ino; | 2144 | __entry->ino = inode->i_ino; |
2042 | __entry->start = start; | 2145 | __entry->start = start; |
2146 | __entry->end = end; | ||
2043 | __entry->depth = depth; | 2147 | __entry->depth = depth; |
2044 | ), | 2148 | ), |
2045 | 2149 | ||
2046 | TP_printk("dev %d,%d ino %lu since %u depth %d", | 2150 | TP_printk("dev %d,%d ino %lu since %u end %u depth %d", |
2047 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2151 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2048 | (unsigned long) __entry->ino, | 2152 | (unsigned long) __entry->ino, |
2049 | (unsigned) __entry->start, | 2153 | (unsigned) __entry->start, |
2154 | (unsigned) __entry->end, | ||
2050 | __entry->depth) | 2155 | __entry->depth) |
2051 | ); | 2156 | ); |
2052 | 2157 | ||
2053 | TRACE_EVENT(ext4_ext_remove_space_done, | 2158 | TRACE_EVENT(ext4_ext_remove_space_done, |
2054 | TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth, | 2159 | TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end, |
2055 | ext4_lblk_t partial, __le16 eh_entries), | 2160 | int depth, long long partial, __le16 eh_entries), |
2056 | 2161 | ||
2057 | TP_ARGS(inode, start, depth, partial, eh_entries), | 2162 | TP_ARGS(inode, start, end, depth, partial, eh_entries), |
2058 | 2163 | ||
2059 | TP_STRUCT__entry( | 2164 | TP_STRUCT__entry( |
2060 | __field( dev_t, dev ) | 2165 | __field( dev_t, dev ) |
2061 | __field( ino_t, ino ) | 2166 | __field( ino_t, ino ) |
2062 | __field( ext4_lblk_t, start ) | 2167 | __field( ext4_lblk_t, start ) |
2168 | __field( ext4_lblk_t, end ) | ||
2063 | __field( int, depth ) | 2169 | __field( int, depth ) |
2064 | __field( ext4_lblk_t, partial ) | 2170 | __field( long long, partial ) |
2065 | __field( unsigned short, eh_entries ) | 2171 | __field( unsigned short, eh_entries ) |
2066 | ), | 2172 | ), |
2067 | 2173 | ||
@@ -2069,18 +2175,20 @@ TRACE_EVENT(ext4_ext_remove_space_done, | |||
2069 | __entry->dev = inode->i_sb->s_dev; | 2175 | __entry->dev = inode->i_sb->s_dev; |
2070 | __entry->ino = inode->i_ino; | 2176 | __entry->ino = inode->i_ino; |
2071 | __entry->start = start; | 2177 | __entry->start = start; |
2178 | __entry->end = end; | ||
2072 | __entry->depth = depth; | 2179 | __entry->depth = depth; |
2073 | __entry->partial = partial; | 2180 | __entry->partial = partial; |
2074 | __entry->eh_entries = le16_to_cpu(eh_entries); | 2181 | __entry->eh_entries = le16_to_cpu(eh_entries); |
2075 | ), | 2182 | ), |
2076 | 2183 | ||
2077 | TP_printk("dev %d,%d ino %lu since %u depth %d partial %u " | 2184 | TP_printk("dev %d,%d ino %lu since %u end %u depth %d partial %lld " |
2078 | "remaining_entries %u", | 2185 | "remaining_entries %u", |
2079 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2186 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2080 | (unsigned long) __entry->ino, | 2187 | (unsigned long) __entry->ino, |
2081 | (unsigned) __entry->start, | 2188 | (unsigned) __entry->start, |
2189 | (unsigned) __entry->end, | ||
2082 | __entry->depth, | 2190 | __entry->depth, |
2083 | (unsigned) __entry->partial, | 2191 | (long long) __entry->partial, |
2084 | (unsigned short) __entry->eh_entries) | 2192 | (unsigned short) __entry->eh_entries) |
2085 | ); | 2193 | ); |
2086 | 2194 | ||
@@ -2095,7 +2203,7 @@ TRACE_EVENT(ext4_es_insert_extent, | |||
2095 | __field( ext4_lblk_t, lblk ) | 2203 | __field( ext4_lblk_t, lblk ) |
2096 | __field( ext4_lblk_t, len ) | 2204 | __field( ext4_lblk_t, len ) |
2097 | __field( ext4_fsblk_t, pblk ) | 2205 | __field( ext4_fsblk_t, pblk ) |
2098 | __field( unsigned long long, status ) | 2206 | __field( char, status ) |
2099 | ), | 2207 | ), |
2100 | 2208 | ||
2101 | TP_fast_assign( | 2209 | TP_fast_assign( |
@@ -2104,14 +2212,14 @@ TRACE_EVENT(ext4_es_insert_extent, | |||
2104 | __entry->lblk = es->es_lblk; | 2212 | __entry->lblk = es->es_lblk; |
2105 | __entry->len = es->es_len; | 2213 | __entry->len = es->es_len; |
2106 | __entry->pblk = ext4_es_pblock(es); | 2214 | __entry->pblk = ext4_es_pblock(es); |
2107 | __entry->status = ext4_es_status(es); | 2215 | __entry->status = ext4_es_status(es) >> 60; |
2108 | ), | 2216 | ), |
2109 | 2217 | ||
2110 | TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %llx", | 2218 | TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s", |
2111 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2219 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2112 | (unsigned long) __entry->ino, | 2220 | (unsigned long) __entry->ino, |
2113 | __entry->lblk, __entry->len, | 2221 | __entry->lblk, __entry->len, |
2114 | __entry->pblk, __entry->status) | 2222 | __entry->pblk, show_extent_status(__entry->status)) |
2115 | ); | 2223 | ); |
2116 | 2224 | ||
2117 | TRACE_EVENT(ext4_es_remove_extent, | 2225 | TRACE_EVENT(ext4_es_remove_extent, |
@@ -2172,7 +2280,7 @@ TRACE_EVENT(ext4_es_find_delayed_extent_range_exit, | |||
2172 | __field( ext4_lblk_t, lblk ) | 2280 | __field( ext4_lblk_t, lblk ) |
2173 | __field( ext4_lblk_t, len ) | 2281 | __field( ext4_lblk_t, len ) |
2174 | __field( ext4_fsblk_t, pblk ) | 2282 | __field( ext4_fsblk_t, pblk ) |
2175 | __field( unsigned long long, status ) | 2283 | __field( char, status ) |
2176 | ), | 2284 | ), |
2177 | 2285 | ||
2178 | TP_fast_assign( | 2286 | TP_fast_assign( |
@@ -2181,14 +2289,14 @@ TRACE_EVENT(ext4_es_find_delayed_extent_range_exit, | |||
2181 | __entry->lblk = es->es_lblk; | 2289 | __entry->lblk = es->es_lblk; |
2182 | __entry->len = es->es_len; | 2290 | __entry->len = es->es_len; |
2183 | __entry->pblk = ext4_es_pblock(es); | 2291 | __entry->pblk = ext4_es_pblock(es); |
2184 | __entry->status = ext4_es_status(es); | 2292 | __entry->status = ext4_es_status(es) >> 60; |
2185 | ), | 2293 | ), |
2186 | 2294 | ||
2187 | TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %llx", | 2295 | TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s", |
2188 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2296 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2189 | (unsigned long) __entry->ino, | 2297 | (unsigned long) __entry->ino, |
2190 | __entry->lblk, __entry->len, | 2298 | __entry->lblk, __entry->len, |
2191 | __entry->pblk, __entry->status) | 2299 | __entry->pblk, show_extent_status(__entry->status)) |
2192 | ); | 2300 | ); |
2193 | 2301 | ||
2194 | TRACE_EVENT(ext4_es_lookup_extent_enter, | 2302 | TRACE_EVENT(ext4_es_lookup_extent_enter, |
@@ -2225,7 +2333,7 @@ TRACE_EVENT(ext4_es_lookup_extent_exit, | |||
2225 | __field( ext4_lblk_t, lblk ) | 2333 | __field( ext4_lblk_t, lblk ) |
2226 | __field( ext4_lblk_t, len ) | 2334 | __field( ext4_lblk_t, len ) |
2227 | __field( ext4_fsblk_t, pblk ) | 2335 | __field( ext4_fsblk_t, pblk ) |
2228 | __field( unsigned long long, status ) | 2336 | __field( char, status ) |
2229 | __field( int, found ) | 2337 | __field( int, found ) |
2230 | ), | 2338 | ), |
2231 | 2339 | ||
@@ -2235,16 +2343,16 @@ TRACE_EVENT(ext4_es_lookup_extent_exit, | |||
2235 | __entry->lblk = es->es_lblk; | 2343 | __entry->lblk = es->es_lblk; |
2236 | __entry->len = es->es_len; | 2344 | __entry->len = es->es_len; |
2237 | __entry->pblk = ext4_es_pblock(es); | 2345 | __entry->pblk = ext4_es_pblock(es); |
2238 | __entry->status = ext4_es_status(es); | 2346 | __entry->status = ext4_es_status(es) >> 60; |
2239 | __entry->found = found; | 2347 | __entry->found = found; |
2240 | ), | 2348 | ), |
2241 | 2349 | ||
2242 | TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %llx", | 2350 | TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %s", |
2243 | MAJOR(__entry->dev), MINOR(__entry->dev), | 2351 | MAJOR(__entry->dev), MINOR(__entry->dev), |
2244 | (unsigned long) __entry->ino, __entry->found, | 2352 | (unsigned long) __entry->ino, __entry->found, |
2245 | __entry->lblk, __entry->len, | 2353 | __entry->lblk, __entry->len, |
2246 | __entry->found ? __entry->pblk : 0, | 2354 | __entry->found ? __entry->pblk : 0, |
2247 | __entry->found ? __entry->status : 0) | 2355 | show_extent_status(__entry->found ? __entry->status : 0)) |
2248 | ); | 2356 | ); |
2249 | 2357 | ||
2250 | TRACE_EVENT(ext4_es_shrink_enter, | 2358 | TRACE_EVENT(ext4_es_shrink_enter, |
diff --git a/include/trace/events/nmi.h b/include/trace/events/nmi.h new file mode 100644 index 000000000000..da3ee96b8d03 --- /dev/null +++ b/include/trace/events/nmi.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM nmi | ||
3 | |||
4 | #if !defined(_TRACE_NMI_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_NMI_H | ||
6 | |||
7 | #include <linux/ktime.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | TRACE_EVENT(nmi_handler, | ||
11 | |||
12 | TP_PROTO(void *handler, s64 delta_ns, int handled), | ||
13 | |||
14 | TP_ARGS(handler, delta_ns, handled), | ||
15 | |||
16 | TP_STRUCT__entry( | ||
17 | __field( void *, handler ) | ||
18 | __field( s64, delta_ns) | ||
19 | __field( int, handled ) | ||
20 | ), | ||
21 | |||
22 | TP_fast_assign( | ||
23 | __entry->handler = handler; | ||
24 | __entry->delta_ns = delta_ns; | ||
25 | __entry->handled = handled; | ||
26 | ), | ||
27 | |||
28 | TP_printk("%ps() delta_ns: %lld handled: %d", | ||
29 | __entry->handler, | ||
30 | __entry->delta_ns, | ||
31 | __entry->handled) | ||
32 | ); | ||
33 | |||
34 | #endif /* _TRACE_NMI_H */ | ||
35 | |||
36 | /* This part ust be outside protection */ | ||
37 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 19edd7facaa1..d615f78cc6b6 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -71,6 +71,10 @@ | |||
71 | static struct ftrace_event_call __used \ | 71 | static struct ftrace_event_call __used \ |
72 | __attribute__((__aligned__(4))) event_##name | 72 | __attribute__((__aligned__(4))) event_##name |
73 | 73 | ||
74 | #undef DEFINE_EVENT_FN | ||
75 | #define DEFINE_EVENT_FN(template, name, proto, args, reg, unreg) \ | ||
76 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
77 | |||
74 | #undef DEFINE_EVENT_PRINT | 78 | #undef DEFINE_EVENT_PRINT |
75 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 79 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
76 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | 80 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) |
diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h index a48937d4a5ea..06632beaa6d5 100644 --- a/include/uapi/asm-generic/fcntl.h +++ b/include/uapi/asm-generic/fcntl.h | |||
@@ -84,6 +84,10 @@ | |||
84 | #define O_PATH 010000000 | 84 | #define O_PATH 010000000 |
85 | #endif | 85 | #endif |
86 | 86 | ||
87 | #ifndef O_TMPFILE | ||
88 | #define O_TMPFILE 020000000 | ||
89 | #endif | ||
90 | |||
87 | #ifndef O_NDELAY | 91 | #ifndef O_NDELAY |
88 | #define O_NDELAY O_NONBLOCK | 92 | #define O_NDELAY O_NONBLOCK |
89 | #endif | 93 | #endif |
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 0cc74c4403e4..a20a9b4d3871 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h | |||
@@ -361,7 +361,7 @@ __SYSCALL(__NR_syslog, sys_syslog) | |||
361 | #define __NR_ptrace 117 | 361 | #define __NR_ptrace 117 |
362 | __SYSCALL(__NR_ptrace, sys_ptrace) | 362 | __SYSCALL(__NR_ptrace, sys_ptrace) |
363 | 363 | ||
364 | /* kernel/sched.c */ | 364 | /* kernel/sched/core.c */ |
365 | #define __NR_sched_setparam 118 | 365 | #define __NR_sched_setparam 118 |
366 | __SYSCALL(__NR_sched_setparam, sys_sched_setparam) | 366 | __SYSCALL(__NR_sched_setparam, sys_sched_setparam) |
367 | #define __NR_sched_setscheduler 119 | 367 | #define __NR_sched_setscheduler 119 |
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild index ab5d4992e568..bdc6e87ff3eb 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/linux/Kbuild | |||
@@ -261,6 +261,7 @@ header-y += net_dropmon.h | |||
261 | header-y += net_tstamp.h | 261 | header-y += net_tstamp.h |
262 | header-y += netconf.h | 262 | header-y += netconf.h |
263 | header-y += netdevice.h | 263 | header-y += netdevice.h |
264 | header-y += netlink_diag.h | ||
264 | header-y += netfilter.h | 265 | header-y += netfilter.h |
265 | header-y += netfilter_arp.h | 266 | header-y += netfilter_arp.h |
266 | header-y += netfilter_bridge.h | 267 | header-y += netfilter_bridge.h |
diff --git a/include/uapi/linux/const.h b/include/uapi/linux/const.h index c22c707c455d..c872bfd25e13 100644 --- a/include/uapi/linux/const.h +++ b/include/uapi/linux/const.h | |||
@@ -21,4 +21,7 @@ | |||
21 | #define _AT(T,X) ((T)(X)) | 21 | #define _AT(T,X) ((T)(X)) |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | #define _BITUL(x) (_AC(1,UL) << (x)) | ||
25 | #define _BITULL(x) (_AC(1,ULL) << (x)) | ||
26 | |||
24 | #endif /* !(_LINUX_CONST_H) */ | 27 | #endif /* !(_LINUX_CONST_H) */ |
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index aac27640bec2..acccd08be6c7 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
@@ -785,6 +785,7 @@ struct kvm_dirty_tlb { | |||
785 | #define KVM_REG_ARM 0x4000000000000000ULL | 785 | #define KVM_REG_ARM 0x4000000000000000ULL |
786 | #define KVM_REG_S390 0x5000000000000000ULL | 786 | #define KVM_REG_S390 0x5000000000000000ULL |
787 | #define KVM_REG_ARM64 0x6000000000000000ULL | 787 | #define KVM_REG_ARM64 0x6000000000000000ULL |
788 | #define KVM_REG_MIPS 0x7000000000000000ULL | ||
788 | 789 | ||
789 | #define KVM_REG_SIZE_SHIFT 52 | 790 | #define KVM_REG_SIZE_SHIFT 52 |
790 | #define KVM_REG_SIZE_MASK 0x00f0000000000000ULL | 791 | #define KVM_REG_SIZE_MASK 0x00f0000000000000ULL |
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index fb104e51496e..0b1df41691e8 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h | |||
@@ -157,8 +157,11 @@ enum perf_branch_sample_type { | |||
157 | PERF_SAMPLE_BRANCH_ANY_CALL = 1U << 4, /* any call branch */ | 157 | PERF_SAMPLE_BRANCH_ANY_CALL = 1U << 4, /* any call branch */ |
158 | PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << 5, /* any return branch */ | 158 | PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << 5, /* any return branch */ |
159 | PERF_SAMPLE_BRANCH_IND_CALL = 1U << 6, /* indirect calls */ | 159 | PERF_SAMPLE_BRANCH_IND_CALL = 1U << 6, /* indirect calls */ |
160 | PERF_SAMPLE_BRANCH_ABORT_TX = 1U << 7, /* transaction aborts */ | ||
161 | PERF_SAMPLE_BRANCH_IN_TX = 1U << 8, /* in transaction */ | ||
162 | PERF_SAMPLE_BRANCH_NO_TX = 1U << 9, /* not in transaction */ | ||
160 | 163 | ||
161 | PERF_SAMPLE_BRANCH_MAX = 1U << 7, /* non-ABI */ | 164 | PERF_SAMPLE_BRANCH_MAX = 1U << 10, /* non-ABI */ |
162 | }; | 165 | }; |
163 | 166 | ||
164 | #define PERF_SAMPLE_BRANCH_PLM_ALL \ | 167 | #define PERF_SAMPLE_BRANCH_PLM_ALL \ |
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h index 74c2bf7211f8..9119cc0977bf 100644 --- a/include/uapi/linux/serial_core.h +++ b/include/uapi/linux/serial_core.h | |||
@@ -226,4 +226,10 @@ | |||
226 | /* Rocketport EXPRESS/INFINITY */ | 226 | /* Rocketport EXPRESS/INFINITY */ |
227 | #define PORT_RP2 102 | 227 | #define PORT_RP2 102 |
228 | 228 | ||
229 | /* Freescale lpuart */ | ||
230 | #define PORT_LPUART 103 | ||
231 | |||
232 | /* SH-SCI */ | ||
233 | #define PORT_HSCIF 104 | ||
234 | |||
229 | #endif /* _UAPILINUX_SERIAL_CORE_H */ | 235 | #endif /* _UAPILINUX_SERIAL_CORE_H */ |
diff --git a/include/xen/events.h b/include/xen/events.h index b2b27c6a0f7b..c9ea10ee2273 100644 --- a/include/xen/events.h +++ b/include/xen/events.h | |||
@@ -76,6 +76,9 @@ unsigned irq_from_evtchn(unsigned int evtchn); | |||
76 | 76 | ||
77 | /* Xen HVM evtchn vector callback */ | 77 | /* Xen HVM evtchn vector callback */ |
78 | void xen_hvm_callback_vector(void); | 78 | void xen_hvm_callback_vector(void); |
79 | #ifdef CONFIG_TRACING | ||
80 | #define trace_xen_hvm_callback_vector xen_hvm_callback_vector | ||
81 | #endif | ||
79 | extern int xen_have_vector_callback; | 82 | extern int xen_have_vector_callback; |
80 | int xen_set_callback_via(uint64_t via); | 83 | int xen_set_callback_via(uint64_t via); |
81 | void xen_evtchn_do_upcall(struct pt_regs *regs); | 84 | void xen_evtchn_do_upcall(struct pt_regs *regs); |