aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-10 03:25:29 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-10 03:25:29 -0400
commit8eb95f28f66b1a5461fdbcc9a1ee9068fb2cf2b6 (patch)
treee42d0e004b07f86d38de930fc163f3ca7d121f9c /include
parentd7451fca18e2ec62641ae4bbfe946069f13765a3 (diff)
parent3fa8749e584b55f1180411ab1b51117190bac1e5 (diff)
Merge commit 'v2.6.27' into timers/hpet
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/bug.h10
-rw-r--r--include/asm-mips/cevt-r4k.h46
-rw-r--r--include/asm-mips/irqflags.h26
-rw-r--r--include/asm-mips/mipsregs.h6
-rw-r--r--include/asm-mips/pgtable-32.h2
-rw-r--r--include/asm-mips/smtc.h8
-rw-r--r--include/asm-mips/sn/mapped_kernel.h8
-rw-r--r--include/asm-mips/stackframe.h72
-rw-r--r--include/asm-x86/acpi.h2
-rw-r--r--include/asm-x86/cpufeature.h1
-rw-r--r--include/asm-x86/idle.h2
-rw-r--r--include/asm-x86/kgdb.h24
-rw-r--r--include/asm-x86/uaccess_64.h1
-rw-r--r--include/linux/ata.h2
-rw-r--r--include/linux/blkdev.h2
-rw-r--r--include/linux/cnt32_to_63.h80
-rw-r--r--include/linux/hrtimer.h18
-rw-r--r--include/linux/ide.h4
-rw-r--r--include/linux/ioport.h4
-rw-r--r--include/linux/memstick.h97
-rw-r--r--include/linux/mlx4/device.h4
-rw-r--r--include/linux/mmzone.h12
-rw-r--r--include/linux/pci.h8
-rw-r--r--include/linux/pnp.h7
-rw-r--r--include/linux/ramfs.h1
-rw-r--r--include/linux/smb.h2
-rw-r--r--include/linux/stacktrace.h2
-rw-r--r--include/net/9p/9p.h1
-rw-r--r--include/net/9p/transport.h9
-rw-r--r--include/net/netlink.h2
-rw-r--r--include/net/sctp/sm.h3
-rw-r--r--include/scsi/scsi.h14
32 files changed, 371 insertions, 109 deletions
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index a3f738cffdb6..edc6ba82e090 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -97,6 +97,16 @@ extern void warn_slowpath(const char *file, const int line,
97 unlikely(__ret_warn_once); \ 97 unlikely(__ret_warn_once); \
98}) 98})
99 99
100#define WARN_ONCE(condition, format...) ({ \
101 static int __warned; \
102 int __ret_warn_once = !!(condition); \
103 \
104 if (unlikely(__ret_warn_once)) \
105 if (WARN(!__warned, format)) \
106 __warned = 1; \
107 unlikely(__ret_warn_once); \
108})
109
100#define WARN_ON_RATELIMIT(condition, state) \ 110#define WARN_ON_RATELIMIT(condition, state) \
101 WARN_ON((condition) && __ratelimit(state)) 111 WARN_ON((condition) && __ratelimit(state))
102 112
diff --git a/include/asm-mips/cevt-r4k.h b/include/asm-mips/cevt-r4k.h
new file mode 100644
index 000000000000..fa4328f9124f
--- /dev/null
+++ b/include/asm-mips/cevt-r4k.h
@@ -0,0 +1,46 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2008 Kevin D. Kissell
7 */
8
9/*
10 * Definitions used for common event timer implementation
11 * for MIPS 4K-type processors and their MIPS MT variants.
12 * Avoids unsightly extern declarations in C files.
13 */
14#ifndef __ASM_CEVT_R4K_H
15#define __ASM_CEVT_R4K_H
16
17DECLARE_PER_CPU(struct clock_event_device, mips_clockevent_device);
18
19void mips_event_handler(struct clock_event_device *dev);
20int c0_compare_int_usable(void);
21void mips_set_clock_mode(enum clock_event_mode, struct clock_event_device *);
22irqreturn_t c0_compare_interrupt(int, void *);
23
24extern struct irqaction c0_compare_irqaction;
25extern int cp0_timer_irq_installed;
26
27/*
28 * Possibly handle a performance counter interrupt.
29 * Return true if the timer interrupt should not be checked
30 */
31
32static inline int handle_perf_irq(int r2)
33{
34 /*
35 * The performance counter overflow interrupt may be shared with the
36 * timer interrupt (cp0_perfcount_irq < 0). If it is and a
37 * performance counter has overflowed (perf_irq() == IRQ_HANDLED)
38 * and we can't reliably determine if a counter interrupt has also
39 * happened (!r2) then don't check for a timer interrupt.
40 */
41 return (cp0_perfcount_irq < 0) &&
42 perf_irq() == IRQ_HANDLED &&
43 !r2;
44}
45
46#endif /* __ASM_CEVT_R4K_H */
diff --git a/include/asm-mips/irqflags.h b/include/asm-mips/irqflags.h
index 881e8866501d..701ec0ba8fa9 100644
--- a/include/asm-mips/irqflags.h
+++ b/include/asm-mips/irqflags.h
@@ -38,8 +38,17 @@ __asm__(
38 " .set pop \n" 38 " .set pop \n"
39 " .endm"); 39 " .endm");
40 40
41extern void smtc_ipi_replay(void);
42
41static inline void raw_local_irq_enable(void) 43static inline void raw_local_irq_enable(void)
42{ 44{
45#ifdef CONFIG_MIPS_MT_SMTC
46 /*
47 * SMTC kernel needs to do a software replay of queued
48 * IPIs, at the cost of call overhead on each local_irq_enable()
49 */
50 smtc_ipi_replay();
51#endif
43 __asm__ __volatile__( 52 __asm__ __volatile__(
44 "raw_local_irq_enable" 53 "raw_local_irq_enable"
45 : /* no outputs */ 54 : /* no outputs */
@@ -47,6 +56,7 @@ static inline void raw_local_irq_enable(void)
47 : "memory"); 56 : "memory");
48} 57}
49 58
59
50/* 60/*
51 * For cli() we have to insert nops to make sure that the new value 61 * For cli() we have to insert nops to make sure that the new value
52 * has actually arrived in the status register before the end of this 62 * has actually arrived in the status register before the end of this
@@ -185,15 +195,14 @@ __asm__(
185 " .set pop \n" 195 " .set pop \n"
186 " .endm \n"); 196 " .endm \n");
187 197
188extern void smtc_ipi_replay(void);
189 198
190static inline void raw_local_irq_restore(unsigned long flags) 199static inline void raw_local_irq_restore(unsigned long flags)
191{ 200{
192 unsigned long __tmp1; 201 unsigned long __tmp1;
193 202
194#ifdef CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY 203#ifdef CONFIG_MIPS_MT_SMTC
195 /* 204 /*
196 * CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY does prompt replay of deferred 205 * SMTC kernel needs to do a software replay of queued
197 * IPIs, at the cost of branch and call overhead on each 206 * IPIs, at the cost of branch and call overhead on each
198 * local_irq_restore() 207 * local_irq_restore()
199 */ 208 */
@@ -208,6 +217,17 @@ static inline void raw_local_irq_restore(unsigned long flags)
208 : "memory"); 217 : "memory");
209} 218}
210 219
220static inline void __raw_local_irq_restore(unsigned long flags)
221{
222 unsigned long __tmp1;
223
224 __asm__ __volatile__(
225 "raw_local_irq_restore\t%0"
226 : "=r" (__tmp1)
227 : "0" (flags)
228 : "memory");
229}
230
211static inline int raw_irqs_disabled_flags(unsigned long flags) 231static inline int raw_irqs_disabled_flags(unsigned long flags)
212{ 232{
213#ifdef CONFIG_MIPS_MT_SMTC 233#ifdef CONFIG_MIPS_MT_SMTC
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index a46f8e258e6b..979866000da4 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -1462,7 +1462,7 @@ set_c0_##name(unsigned int set) \
1462{ \ 1462{ \
1463 unsigned int res; \ 1463 unsigned int res; \
1464 unsigned int omt; \ 1464 unsigned int omt; \
1465 unsigned int flags; \ 1465 unsigned long flags; \
1466 \ 1466 \
1467 local_irq_save(flags); \ 1467 local_irq_save(flags); \
1468 omt = __dmt(); \ 1468 omt = __dmt(); \
@@ -1480,7 +1480,7 @@ clear_c0_##name(unsigned int clear) \
1480{ \ 1480{ \
1481 unsigned int res; \ 1481 unsigned int res; \
1482 unsigned int omt; \ 1482 unsigned int omt; \
1483 unsigned int flags; \ 1483 unsigned long flags; \
1484 \ 1484 \
1485 local_irq_save(flags); \ 1485 local_irq_save(flags); \
1486 omt = __dmt(); \ 1486 omt = __dmt(); \
@@ -1498,7 +1498,7 @@ change_c0_##name(unsigned int change, unsigned int new) \
1498{ \ 1498{ \
1499 unsigned int res; \ 1499 unsigned int res; \
1500 unsigned int omt; \ 1500 unsigned int omt; \
1501 unsigned int flags; \ 1501 unsigned long flags; \
1502 \ 1502 \
1503 local_irq_save(flags); \ 1503 local_irq_save(flags); \
1504 \ 1504 \
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
index 4396e9ffd418..55813d6150c7 100644
--- a/include/asm-mips/pgtable-32.h
+++ b/include/asm-mips/pgtable-32.h
@@ -57,7 +57,7 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1,
57#define PMD_ORDER 1 57#define PMD_ORDER 1
58#define PTE_ORDER 0 58#define PTE_ORDER 0
59 59
60#define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) / sizeof(pgd_t)) 60#define PTRS_PER_PGD (USER_PTRS_PER_PGD * 2)
61#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) 61#define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t))
62 62
63#define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE) 63#define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE)
diff --git a/include/asm-mips/smtc.h b/include/asm-mips/smtc.h
index 3639b28f80db..ea60bf08dcb0 100644
--- a/include/asm-mips/smtc.h
+++ b/include/asm-mips/smtc.h
@@ -6,6 +6,7 @@
6 */ 6 */
7 7
8#include <asm/mips_mt.h> 8#include <asm/mips_mt.h>
9#include <asm/smtc_ipi.h>
9 10
10/* 11/*
11 * System-wide SMTC status information 12 * System-wide SMTC status information
@@ -38,14 +39,15 @@ struct mm_struct;
38struct task_struct; 39struct task_struct;
39 40
40void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu); 41void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu);
41 42void self_ipi(struct smtc_ipi *);
42void smtc_flush_tlb_asid(unsigned long asid); 43void smtc_flush_tlb_asid(unsigned long asid);
43extern int mipsmt_build_cpu_map(int startslot); 44extern int smtc_build_cpu_map(int startslot);
44extern void mipsmt_prepare_cpus(void); 45extern void smtc_prepare_cpus(int cpus);
45extern void smtc_smp_finish(void); 46extern void smtc_smp_finish(void);
46extern void smtc_boot_secondary(int cpu, struct task_struct *t); 47extern void smtc_boot_secondary(int cpu, struct task_struct *t);
47extern void smtc_cpus_done(void); 48extern void smtc_cpus_done(void);
48 49
50
49/* 51/*
50 * Sharing the TLB between multiple VPEs means that the 52 * Sharing the TLB between multiple VPEs means that the
51 * "random" index selection function is not allowed to 53 * "random" index selection function is not allowed to
diff --git a/include/asm-mips/sn/mapped_kernel.h b/include/asm-mips/sn/mapped_kernel.h
index c3dd5d0d525f..721496a0bb92 100644
--- a/include/asm-mips/sn/mapped_kernel.h
+++ b/include/asm-mips/sn/mapped_kernel.h
@@ -5,6 +5,8 @@
5#ifndef __ASM_SN_MAPPED_KERNEL_H 5#ifndef __ASM_SN_MAPPED_KERNEL_H
6#define __ASM_SN_MAPPED_KERNEL_H 6#define __ASM_SN_MAPPED_KERNEL_H
7 7
8#include <linux/mmzone.h>
9
8/* 10/*
9 * Note on how mapped kernels work: the text and data section is 11 * Note on how mapped kernels work: the text and data section is
10 * compiled at cksseg segment (LOADADDR = 0xc001c000), and the 12 * compiled at cksseg segment (LOADADDR = 0xc001c000), and the
@@ -29,10 +31,8 @@
29#define MAPPED_ADDR_RO_TO_PHYS(x) (x - REP_BASE) 31#define MAPPED_ADDR_RO_TO_PHYS(x) (x - REP_BASE)
30#define MAPPED_ADDR_RW_TO_PHYS(x) (x - REP_BASE - 16777216) 32#define MAPPED_ADDR_RW_TO_PHYS(x) (x - REP_BASE - 16777216)
31 33
32#define MAPPED_KERN_RO_PHYSBASE(n) \ 34#define MAPPED_KERN_RO_PHYSBASE(n) (hub_data(n)->kern_vars.kv_ro_baseaddr)
33 (PLAT_NODE_DATA(n)->kern_vars.kv_ro_baseaddr) 35#define MAPPED_KERN_RW_PHYSBASE(n) (hub_data(n)->kern_vars.kv_rw_baseaddr)
34#define MAPPED_KERN_RW_PHYSBASE(n) \
35 (PLAT_NODE_DATA(n)->kern_vars.kv_rw_baseaddr)
36 36
37#define MAPPED_KERN_RO_TO_PHYS(x) \ 37#define MAPPED_KERN_RO_TO_PHYS(x) \
38 ((unsigned long)MAPPED_ADDR_RO_TO_PHYS(x) | \ 38 ((unsigned long)MAPPED_ADDR_RO_TO_PHYS(x) | \
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index 051e1af0bb95..4c37c4e5f72e 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -297,14 +297,31 @@
297#ifdef CONFIG_MIPS_MT_SMTC 297#ifdef CONFIG_MIPS_MT_SMTC
298 .set mips32r2 298 .set mips32r2
299 /* 299 /*
300 * This may not really be necessary if ints are already 300 * We need to make sure the read-modify-write
301 * inhibited here. 301 * of Status below isn't perturbed by an interrupt
302 * or cross-TC access, so we need to do at least a DMT,
303 * protected by an interrupt-inhibit. But setting IXMT
304 * also creates a few-cycle window where an IPI could
305 * be queued and not be detected before potentially
306 * returning to a WAIT or user-mode loop. It must be
307 * replayed.
308 *
309 * We're in the middle of a context switch, and
310 * we can't dispatch it directly without trashing
311 * some registers, so we'll try to detect this unlikely
312 * case and program a software interrupt in the VPE,
313 * as would be done for a cross-VPE IPI. To accomodate
314 * the handling of that case, we're doing a DVPE instead
315 * of just a DMT here to protect against other threads.
316 * This is a lot of cruft to cover a tiny window.
317 * If you can find a better design, implement it!
318 *
302 */ 319 */
303 mfc0 v0, CP0_TCSTATUS 320 mfc0 v0, CP0_TCSTATUS
304 ori v0, TCSTATUS_IXMT 321 ori v0, TCSTATUS_IXMT
305 mtc0 v0, CP0_TCSTATUS 322 mtc0 v0, CP0_TCSTATUS
306 _ehb 323 _ehb
307 DMT 5 # dmt a1 324 DVPE 5 # dvpe a1
308 jal mips_ihb 325 jal mips_ihb
309#endif /* CONFIG_MIPS_MT_SMTC */ 326#endif /* CONFIG_MIPS_MT_SMTC */
310 mfc0 a0, CP0_STATUS 327 mfc0 a0, CP0_STATUS
@@ -325,17 +342,50 @@
325 */ 342 */
326 LONG_L v1, PT_TCSTATUS(sp) 343 LONG_L v1, PT_TCSTATUS(sp)
327 _ehb 344 _ehb
328 mfc0 v0, CP0_TCSTATUS 345 mfc0 a0, CP0_TCSTATUS
329 andi v1, TCSTATUS_IXMT 346 andi v1, TCSTATUS_IXMT
330 /* We know that TCStatua.IXMT should be set from above */ 347 bnez v1, 0f
331 xori v0, v0, TCSTATUS_IXMT 348
332 or v0, v0, v1 349/*
333 mtc0 v0, CP0_TCSTATUS 350 * We'd like to detect any IPIs queued in the tiny window
334 _ehb 351 * above and request an software interrupt to service them
335 andi a1, a1, VPECONTROL_TE 352 * when we ERET.
353 *
354 * Computing the offset into the IPIQ array of the executing
355 * TC's IPI queue in-line would be tedious. We use part of
356 * the TCContext register to hold 16 bits of offset that we
357 * can add in-line to find the queue head.
358 */
359 mfc0 v0, CP0_TCCONTEXT
360 la a2, IPIQ
361 srl v0, v0, 16
362 addu a2, a2, v0
363 LONG_L v0, 0(a2)
364 beqz v0, 0f
365/*
366 * If we have a queue, provoke dispatch within the VPE by setting C_SW1
367 */
368 mfc0 v0, CP0_CAUSE
369 ori v0, v0, C_SW1
370 mtc0 v0, CP0_CAUSE
3710:
372 /*
373 * This test should really never branch but
374 * let's be prudent here. Having atomized
375 * the shared register modifications, we can
376 * now EVPE, and must do so before interrupts
377 * are potentially re-enabled.
378 */
379 andi a1, a1, MVPCONTROL_EVP
336 beqz a1, 1f 380 beqz a1, 1f
337 emt 381 evpe
3381: 3821:
383 /* We know that TCStatua.IXMT should be set from above */
384 xori a0, a0, TCSTATUS_IXMT
385 or a0, a0, v1
386 mtc0 a0, CP0_TCSTATUS
387 _ehb
388
339 .set mips0 389 .set mips0
340#endif /* CONFIG_MIPS_MT_SMTC */ 390#endif /* CONFIG_MIPS_MT_SMTC */
341 LONG_L v1, PT_EPC(sp) 391 LONG_L v1, PT_EPC(sp)
diff --git a/include/asm-x86/acpi.h b/include/asm-x86/acpi.h
index 635d764dc13e..35d1743b57ac 100644
--- a/include/asm-x86/acpi.h
+++ b/include/asm-x86/acpi.h
@@ -140,6 +140,8 @@ static inline unsigned int acpi_processor_cstate_check(unsigned int max_cstate)
140 boot_cpu_data.x86_model <= 0x05 && 140 boot_cpu_data.x86_model <= 0x05 &&
141 boot_cpu_data.x86_mask < 0x0A) 141 boot_cpu_data.x86_mask < 0x0A)
142 return 1; 142 return 1;
143 else if (boot_cpu_has(X86_FEATURE_AMDC1E))
144 return 1;
143 else 145 else
144 return max_cstate; 146 return max_cstate;
145} 147}
diff --git a/include/asm-x86/cpufeature.h b/include/asm-x86/cpufeature.h
index 9489283a4bcf..cfcfb0a806ba 100644
--- a/include/asm-x86/cpufeature.h
+++ b/include/asm-x86/cpufeature.h
@@ -81,6 +81,7 @@
81#define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */ 81#define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */
82#define X86_FEATURE_11AP (3*32+19) /* Bad local APIC aka 11AP */ 82#define X86_FEATURE_11AP (3*32+19) /* Bad local APIC aka 11AP */
83#define X86_FEATURE_NOPL (3*32+20) /* The NOPL (0F 1F) instructions */ 83#define X86_FEATURE_NOPL (3*32+20) /* The NOPL (0F 1F) instructions */
84#define X86_FEATURE_AMDC1E (3*32+21) /* AMD C1E detected */
84 85
85/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ 86/* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
86#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ 87#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */
diff --git a/include/asm-x86/idle.h b/include/asm-x86/idle.h
index d240e5b30a45..cbb649123612 100644
--- a/include/asm-x86/idle.h
+++ b/include/asm-x86/idle.h
@@ -10,4 +10,6 @@ void idle_notifier_register(struct notifier_block *n);
10void enter_idle(void); 10void enter_idle(void);
11void exit_idle(void); 11void exit_idle(void);
12 12
13void c1e_remove_cpu(int cpu);
14
13#endif 15#endif
diff --git a/include/asm-x86/kgdb.h b/include/asm-x86/kgdb.h
index 484c47554f3b..94d63db10365 100644
--- a/include/asm-x86/kgdb.h
+++ b/include/asm-x86/kgdb.h
@@ -39,12 +39,13 @@ enum regnames {
39 GDB_FS, /* 14 */ 39 GDB_FS, /* 14 */
40 GDB_GS, /* 15 */ 40 GDB_GS, /* 15 */
41}; 41};
42#define NUMREGBYTES ((GDB_GS+1)*4)
42#else /* ! CONFIG_X86_32 */ 43#else /* ! CONFIG_X86_32 */
43enum regnames { 44enum regnames64 {
44 GDB_AX, /* 0 */ 45 GDB_AX, /* 0 */
45 GDB_DX, /* 1 */ 46 GDB_BX, /* 1 */
46 GDB_CX, /* 2 */ 47 GDB_CX, /* 2 */
47 GDB_BX, /* 3 */ 48 GDB_DX, /* 3 */
48 GDB_SI, /* 4 */ 49 GDB_SI, /* 4 */
49 GDB_DI, /* 5 */ 50 GDB_DI, /* 5 */
50 GDB_BP, /* 6 */ 51 GDB_BP, /* 6 */
@@ -58,18 +59,15 @@ enum regnames {
58 GDB_R14, /* 14 */ 59 GDB_R14, /* 14 */
59 GDB_R15, /* 15 */ 60 GDB_R15, /* 15 */
60 GDB_PC, /* 16 */ 61 GDB_PC, /* 16 */
61 GDB_PS, /* 17 */
62}; 62};
63#endif /* CONFIG_X86_32 */
64 63
65/* 64enum regnames32 {
66 * Number of bytes of registers: 65 GDB_PS = 34,
67 */ 66 GDB_CS,
68#ifdef CONFIG_X86_32 67 GDB_SS,
69# define NUMREGBYTES 64 68};
70#else 69#define NUMREGBYTES ((GDB_SS+1)*4)
71# define NUMREGBYTES ((GDB_PS+1)*8) 70#endif /* CONFIG_X86_32 */
72#endif
73 71
74static inline void arch_kgdb_breakpoint(void) 72static inline void arch_kgdb_breakpoint(void)
75{ 73{
diff --git a/include/asm-x86/uaccess_64.h b/include/asm-x86/uaccess_64.h
index 515d4dce96b5..45806d60bcbe 100644
--- a/include/asm-x86/uaccess_64.h
+++ b/include/asm-x86/uaccess_64.h
@@ -7,6 +7,7 @@
7#include <linux/compiler.h> 7#include <linux/compiler.h>
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <linux/prefetch.h> 9#include <linux/prefetch.h>
10#include <linux/lockdep.h>
10#include <asm/page.h> 11#include <asm/page.h>
11 12
12/* 13/*
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 1ce19c1ef0e9..8a12d718c169 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -745,7 +745,7 @@ static inline int ata_ok(u8 status)
745static inline int lba_28_ok(u64 block, u32 n_block) 745static inline int lba_28_ok(u64 block, u32 n_block)
746{ 746{
747 /* check the ending block number */ 747 /* check the ending block number */
748 return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256); 748 return ((block + n_block) < ((u64)1 << 28)) && (n_block <= 256);
749} 749}
750 750
751static inline int lba_48_ok(u64 block, u32 n_block) 751static inline int lba_48_ok(u64 block, u32 n_block)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 44710d7e7bff..53ea933cf60b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -843,8 +843,6 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *);
843*/ 843*/
844extern int blk_verify_command(struct blk_cmd_filter *filter, 844extern int blk_verify_command(struct blk_cmd_filter *filter,
845 unsigned char *cmd, int has_write_perm); 845 unsigned char *cmd, int has_write_perm);
846extern int blk_register_filter(struct gendisk *disk);
847extern void blk_unregister_filter(struct gendisk *disk);
848extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); 846extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter);
849 847
850#define MAX_PHYS_SEGMENTS 128 848#define MAX_PHYS_SEGMENTS 128
diff --git a/include/linux/cnt32_to_63.h b/include/linux/cnt32_to_63.h
new file mode 100644
index 000000000000..8c0f9505b48c
--- /dev/null
+++ b/include/linux/cnt32_to_63.h
@@ -0,0 +1,80 @@
1/*
2 * Extend a 32-bit counter to 63 bits
3 *
4 * Author: Nicolas Pitre
5 * Created: December 3, 2006
6 * Copyright: MontaVista Software, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation.
11 */
12
13#ifndef __LINUX_CNT32_TO_63_H__
14#define __LINUX_CNT32_TO_63_H__
15
16#include <linux/compiler.h>
17#include <linux/types.h>
18#include <asm/byteorder.h>
19
20/* this is used only to give gcc a clue about good code generation */
21union cnt32_to_63 {
22 struct {
23#if defined(__LITTLE_ENDIAN)
24 u32 lo, hi;
25#elif defined(__BIG_ENDIAN)
26 u32 hi, lo;
27#endif
28 };
29 u64 val;
30};
31
32
33/**
34 * cnt32_to_63 - Expand a 32-bit counter to a 63-bit counter
35 * @cnt_lo: The low part of the counter
36 *
37 * Many hardware clock counters are only 32 bits wide and therefore have
38 * a relatively short period making wrap-arounds rather frequent. This
39 * is a problem when implementing sched_clock() for example, where a 64-bit
40 * non-wrapping monotonic value is expected to be returned.
41 *
42 * To overcome that limitation, let's extend a 32-bit counter to 63 bits
43 * in a completely lock free fashion. Bits 0 to 31 of the clock are provided
44 * by the hardware while bits 32 to 62 are stored in memory. The top bit in
45 * memory is used to synchronize with the hardware clock half-period. When
46 * the top bit of both counters (hardware and in memory) differ then the
47 * memory is updated with a new value, incrementing it when the hardware
48 * counter wraps around.
49 *
50 * Because a word store in memory is atomic then the incremented value will
51 * always be in synch with the top bit indicating to any potential concurrent
52 * reader if the value in memory is up to date or not with regards to the
53 * needed increment. And any race in updating the value in memory is harmless
54 * as the same value would simply be stored more than once.
55 *
56 * The only restriction for the algorithm to work properly is that this
57 * code must be executed at least once per each half period of the 32-bit
58 * counter to properly update the state bit in memory. This is usually not a
59 * problem in practice, but if it is then a kernel timer could be scheduled
60 * to manage for this code to be executed often enough.
61 *
62 * Note that the top bit (bit 63) in the returned value should be considered
63 * as garbage. It is not cleared here because callers are likely to use a
64 * multiplier on the returned value which can get rid of the top bit
65 * implicitly by making the multiplier even, therefore saving on a runtime
66 * clear-bit instruction. Otherwise caller must remember to clear the top
67 * bit explicitly.
68 */
69#define cnt32_to_63(cnt_lo) \
70({ \
71 static volatile u32 __m_cnt_hi; \
72 union cnt32_to_63 __x; \
73 __x.hi = __m_cnt_hi; \
74 __x.lo = (cnt_lo); \
75 if (unlikely((s32)(__x.hi ^ __x.lo) < 0)) \
76 __m_cnt_hi = __x.hi = (__x.hi ^ 0x80000000) + (__x.hi >> 31); \
77 __x.val; \
78})
79
80#endif
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 6d93dce61cbb..2f245fe63bda 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -47,14 +47,22 @@ enum hrtimer_restart {
47 * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context 47 * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context
48 * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and 48 * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and
49 * does not restart the timer 49 * does not restart the timer
50 * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in hardirq context 50 * HRTIMER_CB_IRQSAFE_PERCPU: Callback must run in hardirq context
51 * Special mode for tick emultation 51 * Special mode for tick emulation and
52 * scheduler timer. Such timers are per
53 * cpu and not allowed to be migrated on
54 * cpu unplug.
55 * HRTIMER_CB_IRQSAFE_UNLOCKED: Callback should run in hardirq context
56 * with timer->base lock unlocked
57 * used for timers which call wakeup to
58 * avoid lock order problems with rq->lock
52 */ 59 */
53enum hrtimer_cb_mode { 60enum hrtimer_cb_mode {
54 HRTIMER_CB_SOFTIRQ, 61 HRTIMER_CB_SOFTIRQ,
55 HRTIMER_CB_IRQSAFE, 62 HRTIMER_CB_IRQSAFE,
56 HRTIMER_CB_IRQSAFE_NO_RESTART, 63 HRTIMER_CB_IRQSAFE_NO_RESTART,
57 HRTIMER_CB_IRQSAFE_NO_SOFTIRQ, 64 HRTIMER_CB_IRQSAFE_PERCPU,
65 HRTIMER_CB_IRQSAFE_UNLOCKED,
58}; 66};
59 67
60/* 68/*
@@ -67,9 +75,10 @@ enum hrtimer_cb_mode {
67 * 0x02 callback function running 75 * 0x02 callback function running
68 * 0x04 callback pending (high resolution mode) 76 * 0x04 callback pending (high resolution mode)
69 * 77 *
70 * Special case: 78 * Special cases:
71 * 0x03 callback function running and enqueued 79 * 0x03 callback function running and enqueued
72 * (was requeued on another CPU) 80 * (was requeued on another CPU)
81 * 0x09 timer was migrated on CPU hotunplug
73 * The "callback function running and enqueued" status is only possible on 82 * The "callback function running and enqueued" status is only possible on
74 * SMP. It happens for example when a posix timer expired and the callback 83 * SMP. It happens for example when a posix timer expired and the callback
75 * queued a signal. Between dropping the lock which protects the posix timer 84 * queued a signal. Between dropping the lock which protects the posix timer
@@ -87,6 +96,7 @@ enum hrtimer_cb_mode {
87#define HRTIMER_STATE_ENQUEUED 0x01 96#define HRTIMER_STATE_ENQUEUED 0x01
88#define HRTIMER_STATE_CALLBACK 0x02 97#define HRTIMER_STATE_CALLBACK 0x02
89#define HRTIMER_STATE_PENDING 0x04 98#define HRTIMER_STATE_PENDING 0x04
99#define HRTIMER_STATE_MIGRATE 0x08
90 100
91/** 101/**
92 * struct hrtimer - the basic hrtimer structure 102 * struct hrtimer - the basic hrtimer structure
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 1524829f73f2..6514db8fd2e4 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -366,7 +366,9 @@ enum {
366 /* Currently on a filemark */ 366 /* Currently on a filemark */
367 IDE_AFLAG_FILEMARK = (1 << 25), 367 IDE_AFLAG_FILEMARK = (1 << 25),
368 /* 0 = no tape is loaded, so we don't rewind after ejecting */ 368 /* 0 = no tape is loaded, so we don't rewind after ejecting */
369 IDE_AFLAG_MEDIUM_PRESENT = (1 << 26) 369 IDE_AFLAG_MEDIUM_PRESENT = (1 << 26),
370
371 IDE_AFLAG_NO_AUTOCLOSE = (1 << 27),
370}; 372};
371 373
372struct ide_drive_s { 374struct ide_drive_s {
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 8d3b7a9afd17..350033e8f4e1 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -159,9 +159,9 @@ extern struct resource * __devm_request_region(struct device *dev,
159 struct resource *parent, resource_size_t start, 159 struct resource *parent, resource_size_t start,
160 resource_size_t n, const char *name); 160 resource_size_t n, const char *name);
161 161
162#define devm_release_region(start,n) \ 162#define devm_release_region(dev, start, n) \
163 __devm_release_region(dev, &ioport_resource, (start), (n)) 163 __devm_release_region(dev, &ioport_resource, (start), (n))
164#define devm_release_mem_region(start,n) \ 164#define devm_release_mem_region(dev, start, n) \
165 __devm_release_region(dev, &iomem_resource, (start), (n)) 165 __devm_release_region(dev, &iomem_resource, (start), (n))
166 166
167extern void __devm_release_region(struct device *dev, struct resource *parent, 167extern void __devm_release_region(struct device *dev, struct resource *parent,
diff --git a/include/linux/memstick.h b/include/linux/memstick.h
index a9f998a3f48b..d0c37e682234 100644
--- a/include/linux/memstick.h
+++ b/include/linux/memstick.h
@@ -21,30 +21,30 @@
21struct ms_status_register { 21struct ms_status_register {
22 unsigned char reserved; 22 unsigned char reserved;
23 unsigned char interrupt; 23 unsigned char interrupt;
24#define MEMSTICK_INT_CMDNAK 0x0001 24#define MEMSTICK_INT_CMDNAK 0x01
25#define MEMSTICK_INT_IOREQ 0x0008 25#define MEMSTICK_INT_IOREQ 0x08
26#define MEMSTICK_INT_IOBREQ 0x0010 26#define MEMSTICK_INT_IOBREQ 0x10
27#define MEMSTICK_INT_BREQ 0x0020 27#define MEMSTICK_INT_BREQ 0x20
28#define MEMSTICK_INT_ERR 0x0040 28#define MEMSTICK_INT_ERR 0x40
29#define MEMSTICK_INT_CED 0x0080 29#define MEMSTICK_INT_CED 0x80
30 30
31 unsigned char status0; 31 unsigned char status0;
32#define MEMSTICK_STATUS0_WP 0x0001 32#define MEMSTICK_STATUS0_WP 0x01
33#define MEMSTICK_STATUS0_SL 0x0002 33#define MEMSTICK_STATUS0_SL 0x02
34#define MEMSTICK_STATUS0_BF 0x0010 34#define MEMSTICK_STATUS0_BF 0x10
35#define MEMSTICK_STATUS0_BE 0x0020 35#define MEMSTICK_STATUS0_BE 0x20
36#define MEMSTICK_STATUS0_FB0 0x0040 36#define MEMSTICK_STATUS0_FB0 0x40
37#define MEMSTICK_STATUS0_MB 0x0080 37#define MEMSTICK_STATUS0_MB 0x80
38 38
39 unsigned char status1; 39 unsigned char status1;
40#define MEMSTICK_STATUS1_UCFG 0x0001 40#define MEMSTICK_STATUS1_UCFG 0x01
41#define MEMSTICK_STATUS1_FGER 0x0002 41#define MEMSTICK_STATUS1_FGER 0x02
42#define MEMSTICK_STATUS1_UCEX 0x0004 42#define MEMSTICK_STATUS1_UCEX 0x04
43#define MEMSTICK_STATUS1_EXER 0x0008 43#define MEMSTICK_STATUS1_EXER 0x08
44#define MEMSTICK_STATUS1_UCDT 0x0010 44#define MEMSTICK_STATUS1_UCDT 0x10
45#define MEMSTICK_STATUS1_DTER 0x0020 45#define MEMSTICK_STATUS1_DTER 0x20
46#define MEMSTICK_STATUS1_FBI 0x0040 46#define MEMSTICK_STATUS1_FB1 0x40
47#define MEMSTICK_STATUS1_MB 0x0080 47#define MEMSTICK_STATUS1_MB 0x80
48} __attribute__((packed)); 48} __attribute__((packed));
49 49
50struct ms_id_register { 50struct ms_id_register {
@@ -56,32 +56,32 @@ struct ms_id_register {
56 56
57struct ms_param_register { 57struct ms_param_register {
58 unsigned char system; 58 unsigned char system;
59#define MEMSTICK_SYS_ATEN 0xc0
60#define MEMSTICK_SYS_BAMD 0x80
61#define MEMSTICK_SYS_PAM 0x08 59#define MEMSTICK_SYS_PAM 0x08
60#define MEMSTICK_SYS_BAMD 0x80
62 61
63 unsigned char block_address_msb; 62 unsigned char block_address_msb;
64 unsigned short block_address; 63 unsigned short block_address;
65 unsigned char cp; 64 unsigned char cp;
66#define MEMSTICK_CP_BLOCK 0x0000 65#define MEMSTICK_CP_BLOCK 0x00
67#define MEMSTICK_CP_PAGE 0x0020 66#define MEMSTICK_CP_PAGE 0x20
68#define MEMSTICK_CP_EXTRA 0x0040 67#define MEMSTICK_CP_EXTRA 0x40
69#define MEMSTICK_CP_OVERWRITE 0x0080 68#define MEMSTICK_CP_OVERWRITE 0x80
70 69
71 unsigned char page_address; 70 unsigned char page_address;
72} __attribute__((packed)); 71} __attribute__((packed));
73 72
74struct ms_extra_data_register { 73struct ms_extra_data_register {
75 unsigned char overwrite_flag; 74 unsigned char overwrite_flag;
76#define MEMSTICK_OVERWRITE_UPDATA 0x0010 75#define MEMSTICK_OVERWRITE_UDST 0x10
77#define MEMSTICK_OVERWRITE_PAGE 0x0060 76#define MEMSTICK_OVERWRITE_PGST1 0x20
78#define MEMSTICK_OVERWRITE_BLOCK 0x0080 77#define MEMSTICK_OVERWRITE_PGST0 0x40
78#define MEMSTICK_OVERWRITE_BKST 0x80
79 79
80 unsigned char management_flag; 80 unsigned char management_flag;
81#define MEMSTICK_MANAGEMENT_SYSTEM 0x0004 81#define MEMSTICK_MANAGEMENT_SYSFLG 0x04
82#define MEMSTICK_MANAGEMENT_TRANS_TABLE 0x0008 82#define MEMSTICK_MANAGEMENT_ATFLG 0x08
83#define MEMSTICK_MANAGEMENT_COPY 0x0010 83#define MEMSTICK_MANAGEMENT_SCMS1 0x10
84#define MEMSTICK_MANAGEMENT_ACCESS 0x0020 84#define MEMSTICK_MANAGEMENT_SCMS0 0x20
85 85
86 unsigned short logical_address; 86 unsigned short logical_address;
87} __attribute__((packed)); 87} __attribute__((packed));
@@ -96,9 +96,9 @@ struct ms_register {
96 96
97struct mspro_param_register { 97struct mspro_param_register {
98 unsigned char system; 98 unsigned char system;
99#define MEMSTICK_SYS_SERIAL 0x80
100#define MEMSTICK_SYS_PAR4 0x00 99#define MEMSTICK_SYS_PAR4 0x00
101#define MEMSTICK_SYS_PAR8 0x40 100#define MEMSTICK_SYS_PAR8 0x40
101#define MEMSTICK_SYS_SERIAL 0x80
102 102
103 unsigned short data_count; 103 unsigned short data_count;
104 unsigned int data_address; 104 unsigned int data_address;
@@ -147,7 +147,7 @@ struct ms_register_addr {
147 unsigned char w_length; 147 unsigned char w_length;
148} __attribute__((packed)); 148} __attribute__((packed));
149 149
150enum { 150enum memstick_tpc {
151 MS_TPC_READ_MG_STATUS = 0x01, 151 MS_TPC_READ_MG_STATUS = 0x01,
152 MS_TPC_READ_LONG_DATA = 0x02, 152 MS_TPC_READ_LONG_DATA = 0x02,
153 MS_TPC_READ_SHORT_DATA = 0x03, 153 MS_TPC_READ_SHORT_DATA = 0x03,
@@ -167,7 +167,7 @@ enum {
167 MS_TPC_SET_CMD = 0x0e 167 MS_TPC_SET_CMD = 0x0e
168}; 168};
169 169
170enum { 170enum memstick_command {
171 MS_CMD_BLOCK_END = 0x33, 171 MS_CMD_BLOCK_END = 0x33,
172 MS_CMD_RESET = 0x3c, 172 MS_CMD_RESET = 0x3c,
173 MS_CMD_BLOCK_WRITE = 0x55, 173 MS_CMD_BLOCK_WRITE = 0x55,
@@ -201,8 +201,6 @@ enum {
201 201
202/*** Driver structures and functions ***/ 202/*** Driver structures and functions ***/
203 203
204#define MEMSTICK_PART_SHIFT 3
205
206enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; 204enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE };
207 205
208#define MEMSTICK_POWER_OFF 0 206#define MEMSTICK_POWER_OFF 0
@@ -215,24 +213,27 @@ enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE };
215struct memstick_host; 213struct memstick_host;
216struct memstick_driver; 214struct memstick_driver;
217 215
216struct memstick_device_id {
217 unsigned char match_flags;
218#define MEMSTICK_MATCH_ALL 0x01 218#define MEMSTICK_MATCH_ALL 0x01
219 219
220 unsigned char type;
220#define MEMSTICK_TYPE_LEGACY 0xff 221#define MEMSTICK_TYPE_LEGACY 0xff
221#define MEMSTICK_TYPE_DUO 0x00 222#define MEMSTICK_TYPE_DUO 0x00
222#define MEMSTICK_TYPE_PRO 0x01 223#define MEMSTICK_TYPE_PRO 0x01
223 224
225 unsigned char category;
224#define MEMSTICK_CATEGORY_STORAGE 0xff 226#define MEMSTICK_CATEGORY_STORAGE 0xff
225#define MEMSTICK_CATEGORY_STORAGE_DUO 0x00 227#define MEMSTICK_CATEGORY_STORAGE_DUO 0x00
228#define MEMSTICK_CATEGORY_IO 0x01
229#define MEMSTICK_CATEGORY_IO_PRO 0x10
226 230
227#define MEMSTICK_CLASS_GENERIC 0xff
228#define MEMSTICK_CLASS_GENERIC_DUO 0x00
229
230
231struct memstick_device_id {
232 unsigned char match_flags;
233 unsigned char type;
234 unsigned char category;
235 unsigned char class; 231 unsigned char class;
232#define MEMSTICK_CLASS_FLASH 0xff
233#define MEMSTICK_CLASS_DUO 0x00
234#define MEMSTICK_CLASS_ROM 0x01
235#define MEMSTICK_CLASS_RO 0x02
236#define MEMSTICK_CLASS_WP 0x03
236}; 237};
237 238
238struct memstick_request { 239struct memstick_request {
@@ -319,9 +320,9 @@ void memstick_suspend_host(struct memstick_host *host);
319void memstick_resume_host(struct memstick_host *host); 320void memstick_resume_host(struct memstick_host *host);
320 321
321void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, 322void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc,
322 struct scatterlist *sg); 323 const struct scatterlist *sg);
323void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, 324void memstick_init_req(struct memstick_request *mrq, unsigned char tpc,
324 void *buf, size_t length); 325 const void *buf, size_t length);
325int memstick_next_req(struct memstick_host *host, 326int memstick_next_req(struct memstick_host *host,
326 struct memstick_request **mrq); 327 struct memstick_request **mrq);
327void memstick_new_req(struct memstick_host *host); 328void memstick_new_req(struct memstick_host *host);
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 655ea0d1ee14..b2f944468313 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -141,6 +141,10 @@ enum {
141 MLX4_STAT_RATE_OFFSET = 5 141 MLX4_STAT_RATE_OFFSET = 5
142}; 142};
143 143
144enum {
145 MLX4_MTT_FLAG_PRESENT = 1
146};
147
144static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) 148static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
145{ 149{
146 return (major << 32) | (minor << 16) | subminor; 150 return (major << 32) | (minor << 16) | subminor;
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 443bc7cd8c62..428328a05fa1 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -751,8 +751,9 @@ static inline int zonelist_node_idx(struct zoneref *zoneref)
751 * 751 *
752 * This function returns the next zone at or below a given zone index that is 752 * This function returns the next zone at or below a given zone index that is
753 * within the allowed nodemask using a cursor as the starting point for the 753 * within the allowed nodemask using a cursor as the starting point for the
754 * search. The zoneref returned is a cursor that is used as the next starting 754 * search. The zoneref returned is a cursor that represents the current zone
755 * point for future calls to next_zones_zonelist(). 755 * being examined. It should be advanced by one before calling
756 * next_zones_zonelist again.
756 */ 757 */
757struct zoneref *next_zones_zonelist(struct zoneref *z, 758struct zoneref *next_zones_zonelist(struct zoneref *z,
758 enum zone_type highest_zoneidx, 759 enum zone_type highest_zoneidx,
@@ -768,9 +769,8 @@ struct zoneref *next_zones_zonelist(struct zoneref *z,
768 * 769 *
769 * This function returns the first zone at or below a given zone index that is 770 * This function returns the first zone at or below a given zone index that is
770 * within the allowed nodemask. The zoneref returned is a cursor that can be 771 * within the allowed nodemask. The zoneref returned is a cursor that can be
771 * used to iterate the zonelist with next_zones_zonelist. The cursor should 772 * used to iterate the zonelist with next_zones_zonelist by advancing it by
772 * not be used by the caller as it does not match the value of the zone 773 * one before calling.
773 * returned.
774 */ 774 */
775static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, 775static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist,
776 enum zone_type highest_zoneidx, 776 enum zone_type highest_zoneidx,
@@ -795,7 +795,7 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist,
795#define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ 795#define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \
796 for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ 796 for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \
797 zone; \ 797 zone; \
798 z = next_zones_zonelist(z, highidx, nodemask, &zone)) \ 798 z = next_zones_zonelist(++z, highidx, nodemask, &zone)) \
799 799
800/** 800/**
801 * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index 801 * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c0e14008a3c2..98dc6243a706 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -534,7 +534,7 @@ extern void pci_sort_breadthfirst(void);
534#ifdef CONFIG_PCI_LEGACY 534#ifdef CONFIG_PCI_LEGACY
535struct pci_dev __deprecated *pci_find_device(unsigned int vendor, 535struct pci_dev __deprecated *pci_find_device(unsigned int vendor,
536 unsigned int device, 536 unsigned int device,
537 const struct pci_dev *from); 537 struct pci_dev *from);
538struct pci_dev __deprecated *pci_find_slot(unsigned int bus, 538struct pci_dev __deprecated *pci_find_slot(unsigned int bus,
539 unsigned int devfn); 539 unsigned int devfn);
540#endif /* CONFIG_PCI_LEGACY */ 540#endif /* CONFIG_PCI_LEGACY */
@@ -550,7 +550,7 @@ struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
550 struct pci_dev *from); 550 struct pci_dev *from);
551struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, 551struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
552 unsigned int ss_vendor, unsigned int ss_device, 552 unsigned int ss_vendor, unsigned int ss_device,
553 const struct pci_dev *from); 553 struct pci_dev *from);
554struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); 554struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
555struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); 555struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
556struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); 556struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
@@ -816,7 +816,7 @@ _PCI_NOP_ALL(write,)
816 816
817static inline struct pci_dev *pci_find_device(unsigned int vendor, 817static inline struct pci_dev *pci_find_device(unsigned int vendor,
818 unsigned int device, 818 unsigned int device,
819 const struct pci_dev *from) 819 struct pci_dev *from)
820{ 820{
821 return NULL; 821 return NULL;
822} 822}
@@ -838,7 +838,7 @@ static inline struct pci_dev *pci_get_subsys(unsigned int vendor,
838 unsigned int device, 838 unsigned int device,
839 unsigned int ss_vendor, 839 unsigned int ss_vendor,
840 unsigned int ss_device, 840 unsigned int ss_device,
841 const struct pci_dev *from) 841 struct pci_dev *from)
842{ 842{
843 return NULL; 843 return NULL;
844} 844}
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 1ce54b63085d..be764e514e35 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -21,7 +21,14 @@ struct pnp_dev;
21/* 21/*
22 * Resource Management 22 * Resource Management
23 */ 23 */
24#ifdef CONFIG_PNP
24struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int); 25struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int);
26#else
27static inline struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned int type, unsigned int num)
28{
29 return NULL;
30}
31#endif
25 32
26static inline int pnp_resource_valid(struct resource *res) 33static inline int pnp_resource_valid(struct resource *res)
27{ 34{
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index b160fb18e8d6..37aaf2b39863 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -6,6 +6,7 @@ extern int ramfs_get_sb(struct file_system_type *fs_type,
6 int flags, const char *dev_name, void *data, struct vfsmount *mnt); 6 int flags, const char *dev_name, void *data, struct vfsmount *mnt);
7 7
8#ifndef CONFIG_MMU 8#ifndef CONFIG_MMU
9extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize);
9extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, 10extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
10 unsigned long addr, 11 unsigned long addr,
11 unsigned long len, 12 unsigned long len,
diff --git a/include/linux/smb.h b/include/linux/smb.h
index caa43b2370cb..82fefddc5987 100644
--- a/include/linux/smb.h
+++ b/include/linux/smb.h
@@ -11,7 +11,9 @@
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/magic.h> 13#include <linux/magic.h>
14#ifdef __KERNEL__
14#include <linux/time.h> 15#include <linux/time.h>
16#endif
15 17
16enum smb_protocol { 18enum smb_protocol {
17 SMB_PROTOCOL_NONE, 19 SMB_PROTOCOL_NONE,
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 5da9794b2d78..b106fd8e0d5c 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -1,6 +1,8 @@
1#ifndef __LINUX_STACKTRACE_H 1#ifndef __LINUX_STACKTRACE_H
2#define __LINUX_STACKTRACE_H 2#define __LINUX_STACKTRACE_H
3 3
4struct task_struct;
5
4#ifdef CONFIG_STACKTRACE 6#ifdef CONFIG_STACKTRACE
5struct stack_trace { 7struct stack_trace {
6 unsigned int nr_entries, max_entries; 8 unsigned int nr_entries, max_entries;
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index b3d3e27c6299..c3626c0ba9d3 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -596,4 +596,5 @@ int p9_idpool_check(int id, struct p9_idpool *p);
596int p9_error_init(void); 596int p9_error_init(void);
597int p9_errstr2errno(char *, int); 597int p9_errstr2errno(char *, int);
598int p9_trans_fd_init(void); 598int p9_trans_fd_init(void);
599void p9_trans_fd_exit(void);
599#endif /* NET_9P_H */ 600#endif /* NET_9P_H */
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index 0db3a4038dc0..3ca737120a90 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -26,6 +26,8 @@
26#ifndef NET_9P_TRANSPORT_H 26#ifndef NET_9P_TRANSPORT_H
27#define NET_9P_TRANSPORT_H 27#define NET_9P_TRANSPORT_H
28 28
29#include <linux/module.h>
30
29/** 31/**
30 * enum p9_trans_status - different states of underlying transports 32 * enum p9_trans_status - different states of underlying transports
31 * @Connected: transport is connected and healthy 33 * @Connected: transport is connected and healthy
@@ -91,9 +93,12 @@ struct p9_trans_module {
91 int maxsize; /* max message size of transport */ 93 int maxsize; /* max message size of transport */
92 int def; /* this transport should be default */ 94 int def; /* this transport should be default */
93 struct p9_trans * (*create)(const char *, char *, int, unsigned char); 95 struct p9_trans * (*create)(const char *, char *, int, unsigned char);
96 struct module *owner;
94}; 97};
95 98
96void v9fs_register_trans(struct p9_trans_module *m); 99void v9fs_register_trans(struct p9_trans_module *m);
97struct p9_trans_module *v9fs_match_trans(const substring_t *name); 100void v9fs_unregister_trans(struct p9_trans_module *m);
98struct p9_trans_module *v9fs_default_trans(void); 101struct p9_trans_module *v9fs_get_trans_by_name(const substring_t *name);
102struct p9_trans_module *v9fs_get_default_trans(void);
103void v9fs_put_trans(struct p9_trans_module *m);
99#endif /* NET_9P_TRANSPORT_H */ 104#endif /* NET_9P_TRANSPORT_H */
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 18024b8cecb8..208fe5a38546 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -702,7 +702,7 @@ static inline int nla_len(const struct nlattr *nla)
702 */ 702 */
703static inline int nla_ok(const struct nlattr *nla, int remaining) 703static inline int nla_ok(const struct nlattr *nla, int remaining)
704{ 704{
705 return remaining >= sizeof(*nla) && 705 return remaining >= (int) sizeof(*nla) &&
706 nla->nla_len >= sizeof(*nla) && 706 nla->nla_len >= sizeof(*nla) &&
707 nla->nla_len <= remaining; 707 nla->nla_len <= remaining;
708} 708}
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 24811732bdb2..029a54a02396 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -227,6 +227,9 @@ struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *,
227 const struct sctp_chunk *, 227 const struct sctp_chunk *,
228 const __u8 *, 228 const __u8 *,
229 const size_t ); 229 const size_t );
230struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *,
231 const struct sctp_chunk *,
232 struct sctp_paramhdr *);
230struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, 233struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *,
231 const struct sctp_transport *, 234 const struct sctp_transport *,
232 const void *payload, 235 const void *payload,
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 5c40cc537d4c..192f8716aa9e 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -309,6 +309,20 @@ struct scsi_lun {
309}; 309};
310 310
311/* 311/*
312 * The Well Known LUNS (SAM-3) in our int representation of a LUN
313 */
314#define SCSI_W_LUN_BASE 0xc100
315#define SCSI_W_LUN_REPORT_LUNS (SCSI_W_LUN_BASE + 1)
316#define SCSI_W_LUN_ACCESS_CONTROL (SCSI_W_LUN_BASE + 2)
317#define SCSI_W_LUN_TARGET_LOG_PAGE (SCSI_W_LUN_BASE + 3)
318
319static inline int scsi_is_wlun(unsigned int lun)
320{
321 return (lun & 0xff00) == SCSI_W_LUN_BASE;
322}
323
324
325/*
312 * MESSAGE CODES 326 * MESSAGE CODES
313 */ 327 */
314 328