Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 15 Jul 2008 05:44:51 +0000 (15:44 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 15 Jul 2008 05:44:51 +0000 (15:44 +1000)
Manual fixup of:

arch/powerpc/Kconfig

18 files changed:
1  2 
MAINTAINERS
Makefile
arch/powerpc/Kconfig
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/ppc_ksyms.c
arch/powerpc/kernel/setup_32.c
arch/powerpc/kernel/vmlinux.lds.S
drivers/char/Makefile
drivers/char/viotape.c
drivers/macintosh/adb.c
drivers/macintosh/smu.c
drivers/net/Kconfig
drivers/pcmcia/m8xx_pcmcia.c
include/linux/mm.h
mm/mprotect.c

diff --combined MAINTAINERS
index 8619861dd34567245f137de62226eda2e6fdcb04,1528e58b540829a110eba85ad8bd0e5bea4a4c41..e4d74669289bf7130869c49a65c72f38768befd2
@@@ -376,6 -376,12 +376,12 @@@ L:       linux-geode@lists.infradead.org (mod
  W:    http://www.amd.com/us-en/ConnectivitySolutions/TechnicalResources/0,,50_2334_2452_11363,00.html
  S:    Supported
  
+ AMD IOMMU (AMD-VI)
+ P:    Joerg Roedel
+ M:    joerg.roedel@amd.com
+ L:    iommu@lists.linux-foundation.org
+ S:    Supported
  AMS (Apple Motion Sensor) DRIVER
  P:    Stelian Pop
  M:    stelian@popies.net
@@@ -2503,11 -2509,13 +2509,11 @@@ W:   http://www.penguinppc.org
  L:    linuxppc-dev@ozlabs.org
  S:    Maintained
  
 -LINUX FOR POWERPC EMBEDDED MPC52XX
 +LINUX FOR POWERPC EMBEDDED MPC5XXX
  P:    Sylvain Munaut
  M:    tnt@246tNt.com
  P:    Grant Likely
  M:    grant.likely@secretlab.ca
 -W:    http://www.246tNt.com/mpc52xx/
 -W:    http://www.penguinppc.org/
  L:    linuxppc-dev@ozlabs.org
  S:    Maintained
  
diff --combined Makefile
index 7c917e930835e1868f1deb87e2092b17d563586b,4ac1d2f71ac3598df817199fc87d573831e848a2..618911026ac3e30ae5cfe522fa422f5c7a974f25
+++ b/Makefile
@@@ -1,4 -1,3 +1,4 @@@
 +FRED=42
  VERSION = 2
  PATCHLEVEL = 6
  SUBLEVEL = 26
@@@ -529,6 -528,10 +529,10 @@@ KBUILD_CFLAGS    += -
  KBUILD_AFLAGS += -gdwarf-2
  endif
  
+ ifdef CONFIG_FTRACE
+ KBUILD_CFLAGS += -pg
+ endif
  # We trigger additional mismatches with less inlining
  ifdef CONFIG_DEBUG_SECTION_MISMATCH
  KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
diff --combined arch/powerpc/Kconfig
index 06b72771ae22991507d727663343fd0e8b406d86,a5e9912e2d3773fdab23a4bc52ec5e147f47e1cf..1530a41fc56d5daa886be007931d854e3564709c
@@@ -53,9 -53,6 +53,9 @@@ config STACKTRACE_SUPPOR
        bool
        default y
  
 +config HAVE_LATENCYTOP_SUPPORT
 +      def_bool y
 +
  config TRACE_IRQFLAGS_SUPPORT
        bool
        depends on PPC64
@@@ -108,12 -105,13 +108,14 @@@ config ARCH_NO_VIRT_TO_BU
  config PPC
        bool
        default y
+       select HAVE_DYNAMIC_FTRACE
+       select HAVE_FTRACE
        select HAVE_IDE
-       select HAVE_OPROFILE
        select HAVE_KPROBES
        select HAVE_KRETPROBES
        select HAVE_LMB
 +      select HAVE_DMA_ATTRS if PPC64
+       select HAVE_OPROFILE
  
  config EARLY_PRINTK
        bool
@@@ -312,8 -310,8 +314,8 @@@ config KEXE
          strongly in flux, so no good recommendation can be made.
  
  config CRASH_DUMP
 -      bool "Build a kdump crash kernel (EXPERIMENTAL)"
 -      depends on PPC_MULTIPLATFORM && PPC64 && EXPERIMENTAL
 +      bool "Build a kdump crash kernel"
 +      depends on PPC_MULTIPLATFORM && PPC64
        help
          Build a kernel suitable for use as a kdump capture kernel.
          The kernel will be linked at a different address than normal, and
@@@ -462,19 -460,6 +464,19 @@@ config CMDLIN
          some command-line options at build time by entering them here.  In
          most cases you will need to specify the root device here.
  
 +config EXTRA_TARGETS
 +      string "Additional default image types"
 +      help
 +        List additional targets to be built by the bootwrapper here (separated
 +        by spaces).  This is useful for targets that depend of device tree
 +        files in the .dts directory.
 +
 +        Targets in this list will be build as part of the default build
 +        target, or when the user does a 'make zImage' or a
 +        'make zImage.initrd'.
 +
 +        If unsure, leave blank
 +
  if !44x || BROKEN
  config ARCH_WANTS_FREEZER_CONTROL
        def_bool y
@@@ -555,12 -540,6 +557,12 @@@ config FSL_LB
        help
          Freescale Localbus support
  
 +config FSL_GTM
 +      bool
 +      depends on PPC_83xx || QUICC_ENGINE || CPM2
 +      help
 +        Freescale General-purpose Timers support
 +
  # Yes MCA RS/6000s exist but Linux-PPC does not currently support any
  config MCA
        bool
index 9ebeb2406b5bc6a6ad3987370cff49e74da1904b,f3f5e26414322af110730cd9ca14b190509c2574..bf0b1fd0ec3470080de306d9b47c56db9a034650
@@@ -12,6 -12,18 +12,18 @@@ CFLAGS_prom_init.o      += -fPI
  CFLAGS_btext.o                += -fPIC
  endif
  
+ ifdef CONFIG_FTRACE
+ # Do not trace early boot code
+ CFLAGS_REMOVE_cputable.o = -pg
+ CFLAGS_REMOVE_prom_init.o = -pg
+ ifdef CONFIG_DYNAMIC_FTRACE
+ # dynamic ftrace setup.
+ CFLAGS_REMOVE_ftrace.o = -pg
+ endif
+ endif
  obj-y                         := cputable.o ptrace.o syscalls.o \
                                   irq.o align.o signal_32.o pmc.o vdso.o \
                                   init_task.o process.o systbl.o idle.o \
@@@ -38,13 -50,12 +50,13 @@@ obj-$(CONFIG_IBMVIO)               += vio.
  obj-$(CONFIG_IBMEBUS)           += ibmebus.o
  obj-$(CONFIG_GENERIC_TBSYNC)  += smp-tbsync.o
  obj-$(CONFIG_CRASH_DUMP)      += crash_dump.o
 +obj-$(CONFIG_E500)            += idle_e500.o
  obj-$(CONFIG_6xx)             += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
  obj-$(CONFIG_TAU)             += tau_6xx.o
  obj-$(CONFIG_HIBERNATION)     += swsusp.o suspend.o \
                                   swsusp_$(CONFIG_WORD_SIZE).o
  obj64-$(CONFIG_HIBERNATION)   += swsusp_asm64.o
 -obj-$(CONFIG_MODULES)         += module_$(CONFIG_WORD_SIZE).o
 +obj-$(CONFIG_MODULES)         += module.o module_$(CONFIG_WORD_SIZE).o
  obj-$(CONFIG_44x)             += cpu_setup_44x.o
  
  ifeq ($(CONFIG_PPC_MERGE),y)
@@@ -79,6 -90,8 +91,8 @@@ obj-$(CONFIG_KEXEC)           += machine_kexec.
  obj-$(CONFIG_AUDIT)           += audit.o
  obj64-$(CONFIG_AUDIT)         += compat_audit.o
  
+ obj-$(CONFIG_DYNAMIC_FTRACE)  += ftrace.o
  obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o
  
  ifneq ($(CONFIG_PPC_INDIRECT_IO),y)
index ab2d62f70b14a0d3c688754436aae5163c083bcd,7231a708af0d6ceacde2b0e04b1c2f7110c3aa6e..da52269aec1e86fc05a2e1fb79d46dcc0b846a88
@@@ -30,6 -30,7 +30,7 @@@
  #include <asm/ppc_asm.h>
  #include <asm/asm-offsets.h>
  #include <asm/unistd.h>
+ #include <asm/ftrace.h>
  
  #undef SHOW_SYSCALLS
  #undef SHOW_SYSCALLS_TASK
  #endif
  
  #ifdef CONFIG_BOOKE
 -#include "head_booke.h"
 -#define TRANSFER_TO_HANDLER_EXC_LEVEL(exc_level)      \
 -      mtspr   exc_level##_SPRG,r8;                    \
 -      BOOKE_LOAD_EXC_LEVEL_STACK(exc_level);          \
 -      lwz     r0,GPR10-INT_FRAME_SIZE(r8);            \
 -      stw     r0,GPR10(r11);                          \
 -      lwz     r0,GPR11-INT_FRAME_SIZE(r8);            \
 -      stw     r0,GPR11(r11);                          \
 -      mfspr   r8,exc_level##_SPRG
 -
        .globl  mcheck_transfer_to_handler
  mcheck_transfer_to_handler:
 -      TRANSFER_TO_HANDLER_EXC_LEVEL(MCHECK)
 -      b       transfer_to_handler_full
 +      mfspr   r0,SPRN_DSRR0
 +      stw     r0,_DSRR0(r11)
 +      mfspr   r0,SPRN_DSRR1
 +      stw     r0,_DSRR1(r11)
 +      /* fall through */
  
        .globl  debug_transfer_to_handler
  debug_transfer_to_handler:
 -      TRANSFER_TO_HANDLER_EXC_LEVEL(DEBUG)
 -      b       transfer_to_handler_full
 +      mfspr   r0,SPRN_CSRR0
 +      stw     r0,_CSRR0(r11)
 +      mfspr   r0,SPRN_CSRR1
 +      stw     r0,_CSRR1(r11)
 +      /* fall through */
  
        .globl  crit_transfer_to_handler
  crit_transfer_to_handler:
 -      TRANSFER_TO_HANDLER_EXC_LEVEL(CRIT)
 +#ifdef CONFIG_FSL_BOOKE
 +      mfspr   r0,SPRN_MAS0
 +      stw     r0,MAS0(r11)
 +      mfspr   r0,SPRN_MAS1
 +      stw     r0,MAS1(r11)
 +      mfspr   r0,SPRN_MAS2
 +      stw     r0,MAS2(r11)
 +      mfspr   r0,SPRN_MAS3
 +      stw     r0,MAS3(r11)
 +      mfspr   r0,SPRN_MAS6
 +      stw     r0,MAS6(r11)
 +#ifdef CONFIG_PHYS_64BIT
 +      mfspr   r0,SPRN_MAS7
 +      stw     r0,MAS7(r11)
 +#endif /* CONFIG_PHYS_64BIT */
 +#endif /* CONFIG_FSL_BOOKE */
 +#ifdef CONFIG_44x
 +      mfspr   r0,SPRN_MMUCR
 +      stw     r0,MMUCR(r11)
 +#endif
 +      mfspr   r0,SPRN_SRR0
 +      stw     r0,_SRR0(r11)
 +      mfspr   r0,SPRN_SRR1
 +      stw     r0,_SRR1(r11)
 +
 +      mfspr   r8,SPRN_SPRG3
 +      lwz     r0,KSP_LIMIT(r8)
 +      stw     r0,SAVED_KSP_LIMIT(r11)
 +      rlwimi  r0,r1,0,0,(31-THREAD_SHIFT)
 +      stw     r0,KSP_LIMIT(r8)
        /* fall through */
  #endif
  
@@@ -102,16 -78,6 +103,16 @@@ crit_transfer_to_handler
        stw     r0,GPR10(r11)
        lwz     r0,crit_r11@l(0)
        stw     r0,GPR11(r11)
 +      mfspr   r0,SPRN_SRR0
 +      stw     r0,crit_srr0@l(0)
 +      mfspr   r0,SPRN_SRR1
 +      stw     r0,crit_srr1@l(0)
 +
 +      mfspr   r8,SPRN_SPRG3
 +      lwz     r0,KSP_LIMIT(r8)
 +      stw     r0,saved_ksp_limit@l(0)
 +      rlwimi  r0,r1,0,0,(31-THREAD_SHIFT)
 +      stw     r0,KSP_LIMIT(r8)
        /* fall through */
  #endif
  
@@@ -176,14 -142,13 +177,14 @@@ transfer_to_handler
        cmplw   r1,r9                   /* if r1 <= ksp_limit */
        ble-    stack_ovf               /* then the kernel stack overflowed */
  5:
 -#ifdef CONFIG_6xx
 +#if defined(CONFIG_6xx) || defined(CONFIG_E500)
        rlwinm  r9,r1,0,0,31-THREAD_SHIFT
        tophys(r9,r9)                   /* check local flags */
        lwz     r12,TI_LOCAL_FLAGS(r9)
        mtcrf   0x01,r12
        bt-     31-TLF_NAPPING,4f
 -#endif /* CONFIG_6xx */
 +      bt-     31-TLF_SLEEPING,7f
 +#endif /* CONFIG_6xx || CONFIG_E500 */
        .globl transfer_to_handler_cont
  transfer_to_handler_cont:
  3:
        SYNC
        RFI                             /* jump to handler, enable MMU */
  
 -#ifdef CONFIG_6xx
 +#if defined (CONFIG_6xx) || defined(CONFIG_E500)
  4:    rlwinm  r12,r12,0,~_TLF_NAPPING
        stw     r12,TI_LOCAL_FLAGS(r9)
 -      b       power_save_6xx_restore
 +      b       power_save_ppc32_restore
 +
 +7:    rlwinm  r12,r12,0,~_TLF_SLEEPING
 +      stw     r12,TI_LOCAL_FLAGS(r9)
 +      lwz     r9,_MSR(r11)            /* if sleeping, clear MSR.EE */
 +      rlwinm  r9,r9,0,~MSR_EE
 +      lwz     r12,_LINK(r11)          /* and return to address in LR */
 +      b       fast_exception_return
  #endif
  
  /*
@@@ -711,7 -669,7 +712,7 @@@ user_exc_return:           /* r10 contains MSR_K
        /* Check current_thread_info()->flags */
        rlwinm  r9,r1,0,0,(31-THREAD_SHIFT)
        lwz     r9,TI_FLAGS(r9)
 -      andi.   r0,r9,(_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NEED_RESCHED)
 +      andi.   r0,r9,_TIF_USER_WORK_MASK
        bne     do_work
  
  restore_user:
@@@ -902,90 -860,17 +903,90 @@@ exc_exit_restart_end
        exc_lvl_rfi;                                                    \
        b       .;              /* prevent prefetch past exc_lvl_rfi */
  
 +#define       RESTORE_xSRR(exc_lvl_srr0, exc_lvl_srr1)                        \
 +      lwz     r9,_##exc_lvl_srr0(r1);                                 \
 +      lwz     r10,_##exc_lvl_srr1(r1);                                \
 +      mtspr   SPRN_##exc_lvl_srr0,r9;                                 \
 +      mtspr   SPRN_##exc_lvl_srr1,r10;
 +
 +#if defined(CONFIG_FSL_BOOKE)
 +#ifdef CONFIG_PHYS_64BIT
 +#define       RESTORE_MAS7                                                    \
 +      lwz     r11,MAS7(r1);                                           \
 +      mtspr   SPRN_MAS7,r11;
 +#else
 +#define       RESTORE_MAS7
 +#endif /* CONFIG_PHYS_64BIT */
 +#define RESTORE_MMU_REGS                                              \
 +      lwz     r9,MAS0(r1);                                            \
 +      lwz     r10,MAS1(r1);                                           \
 +      lwz     r11,MAS2(r1);                                           \
 +      mtspr   SPRN_MAS0,r9;                                           \
 +      lwz     r9,MAS3(r1);                                            \
 +      mtspr   SPRN_MAS1,r10;                                          \
 +      lwz     r10,MAS6(r1);                                           \
 +      mtspr   SPRN_MAS2,r11;                                          \
 +      mtspr   SPRN_MAS3,r9;                                           \
 +      mtspr   SPRN_MAS6,r10;                                          \
 +      RESTORE_MAS7;
 +#elif defined(CONFIG_44x)
 +#define RESTORE_MMU_REGS                                              \
 +      lwz     r9,MMUCR(r1);                                           \
 +      mtspr   SPRN_MMUCR,r9;
 +#else
 +#define RESTORE_MMU_REGS
 +#endif
 +
 +#ifdef CONFIG_40x
        .globl  ret_from_crit_exc
  ret_from_crit_exc:
 +      mfspr   r9,SPRN_SPRG3
 +      lis     r10,saved_ksp_limit@ha;
 +      lwz     r10,saved_ksp_limit@l(r10);
 +      tovirt(r9,r9);
 +      stw     r10,KSP_LIMIT(r9)
 +      lis     r9,crit_srr0@ha;
 +      lwz     r9,crit_srr0@l(r9);
 +      lis     r10,crit_srr1@ha;
 +      lwz     r10,crit_srr1@l(r10);
 +      mtspr   SPRN_SRR0,r9;
 +      mtspr   SPRN_SRR1,r10;
        RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, RFCI)
 +#endif /* CONFIG_40x */
  
  #ifdef CONFIG_BOOKE
 +      .globl  ret_from_crit_exc
 +ret_from_crit_exc:
 +      mfspr   r9,SPRN_SPRG3
 +      lwz     r10,SAVED_KSP_LIMIT(r1)
 +      stw     r10,KSP_LIMIT(r9)
 +      RESTORE_xSRR(SRR0,SRR1);
 +      RESTORE_MMU_REGS;
 +      RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, RFCI)
 +
        .globl  ret_from_debug_exc
  ret_from_debug_exc:
 +      mfspr   r9,SPRN_SPRG3
 +      lwz     r10,SAVED_KSP_LIMIT(r1)
 +      stw     r10,KSP_LIMIT(r9)
 +      lwz     r9,THREAD_INFO-THREAD(r9)
 +      rlwinm  r10,r1,0,0,(31-THREAD_SHIFT)
 +      lwz     r10,TI_PREEMPT(r10)
 +      stw     r10,TI_PREEMPT(r9)
 +      RESTORE_xSRR(SRR0,SRR1);
 +      RESTORE_xSRR(CSRR0,CSRR1);
 +      RESTORE_MMU_REGS;
        RET_FROM_EXC_LEVEL(SPRN_DSRR0, SPRN_DSRR1, RFDI)
  
        .globl  ret_from_mcheck_exc
  ret_from_mcheck_exc:
 +      mfspr   r9,SPRN_SPRG3
 +      lwz     r10,SAVED_KSP_LIMIT(r1)
 +      stw     r10,KSP_LIMIT(r9)
 +      RESTORE_xSRR(SRR0,SRR1);
 +      RESTORE_xSRR(CSRR0,CSRR1);
 +      RESTORE_xSRR(DSRR0,DSRR1);
 +      RESTORE_MMU_REGS;
        RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, RFMCI)
  #endif /* CONFIG_BOOKE */
  
@@@ -1041,7 -926,7 +1042,7 @@@ recheck
        lwz     r9,TI_FLAGS(r9)
        andi.   r0,r9,_TIF_NEED_RESCHED
        bne-    do_resched
 -      andi.   r0,r9,_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK
 +      andi.   r0,r9,_TIF_USER_WORK_MASK
        beq     restore_user
  do_user_signal:                       /* r10 contains MSR_KERNEL here */
        ori     r10,r10,MSR_EE
@@@ -1151,3 -1036,129 +1152,129 @@@ machine_check_in_rtas
        /* XXX load up BATs and panic */
  
  #endif /* CONFIG_PPC_RTAS */
+ #ifdef CONFIG_FTRACE
+ #ifdef CONFIG_DYNAMIC_FTRACE
+ _GLOBAL(mcount)
+ _GLOBAL(_mcount)
+       stwu    r1,-48(r1)
+       stw     r3, 12(r1)
+       stw     r4, 16(r1)
+       stw     r5, 20(r1)
+       stw     r6, 24(r1)
+       mflr    r3
+       stw     r7, 28(r1)
+       mfcr    r5
+       stw     r8, 32(r1)
+       stw     r9, 36(r1)
+       stw     r10,40(r1)
+       stw     r3, 44(r1)
+       stw     r5, 8(r1)
+       subi    r3, r3, MCOUNT_INSN_SIZE
+       .globl mcount_call
+ mcount_call:
+       bl      ftrace_stub
+       nop
+       lwz     r6, 8(r1)
+       lwz     r0, 44(r1)
+       lwz     r3, 12(r1)
+       mtctr   r0
+       lwz     r4, 16(r1)
+       mtcr    r6
+       lwz     r5, 20(r1)
+       lwz     r6, 24(r1)
+       lwz     r0, 52(r1)
+       lwz     r7, 28(r1)
+       lwz     r8, 32(r1)
+       mtlr    r0
+       lwz     r9, 36(r1)
+       lwz     r10,40(r1)
+       addi    r1, r1, 48
+       bctr
+ _GLOBAL(ftrace_caller)
+       /* Based off of objdump optput from glibc */
+       stwu    r1,-48(r1)
+       stw     r3, 12(r1)
+       stw     r4, 16(r1)
+       stw     r5, 20(r1)
+       stw     r6, 24(r1)
+       mflr    r3
+       lwz     r4, 52(r1)
+       mfcr    r5
+       stw     r7, 28(r1)
+       stw     r8, 32(r1)
+       stw     r9, 36(r1)
+       stw     r10,40(r1)
+       stw     r3, 44(r1)
+       stw     r5, 8(r1)
+       subi    r3, r3, MCOUNT_INSN_SIZE
+ .globl ftrace_call
+ ftrace_call:
+       bl      ftrace_stub
+       nop
+       lwz     r6, 8(r1)
+       lwz     r0, 44(r1)
+       lwz     r3, 12(r1)
+       mtctr   r0
+       lwz     r4, 16(r1)
+       mtcr    r6
+       lwz     r5, 20(r1)
+       lwz     r6, 24(r1)
+       lwz     r0, 52(r1)
+       lwz     r7, 28(r1)
+       lwz     r8, 32(r1)
+       mtlr    r0
+       lwz     r9, 36(r1)
+       lwz     r10,40(r1)
+       addi    r1, r1, 48
+       bctr
+ #else
+ _GLOBAL(mcount)
+ _GLOBAL(_mcount)
+       stwu    r1,-48(r1)
+       stw     r3, 12(r1)
+       stw     r4, 16(r1)
+       stw     r5, 20(r1)
+       stw     r6, 24(r1)
+       mflr    r3
+       lwz     r4, 52(r1)
+       mfcr    r5
+       stw     r7, 28(r1)
+       stw     r8, 32(r1)
+       stw     r9, 36(r1)
+       stw     r10,40(r1)
+       stw     r3, 44(r1)
+       stw     r5, 8(r1)
+       subi    r3, r3, MCOUNT_INSN_SIZE
+       LOAD_REG_ADDR(r5, ftrace_trace_function)
+       lwz     r5,0(r5)
+       mtctr   r5
+       bctrl
+       nop
+       lwz     r6, 8(r1)
+       lwz     r0, 44(r1)
+       lwz     r3, 12(r1)
+       mtctr   r0
+       lwz     r4, 16(r1)
+       mtcr    r6
+       lwz     r5, 20(r1)
+       lwz     r6, 24(r1)
+       lwz     r0, 52(r1)
+       lwz     r7, 28(r1)
+       lwz     r8, 32(r1)
+       mtlr    r0
+       lwz     r9, 36(r1)
+       lwz     r10,40(r1)
+       addi    r1, r1, 48
+       bctr
+ #endif
+ _GLOBAL(ftrace_stub)
+       blr
+ #endif /* CONFIG_MCOUNT */
index 12eb95a80ce98c902eb60bae75f0cbae958d5655,2f511a969d2cfb9e9db66f12aa41a293ce32e026..d7369243ae44ab3aa0e12fcec3db30ae717677c2
@@@ -31,6 -31,7 +31,7 @@@
  #include <asm/bug.h>
  #include <asm/ptrace.h>
  #include <asm/irqflags.h>
+ #include <asm/ftrace.h>
  
  /*
   * System calls.
@@@ -353,11 -354,6 +354,11 @@@ _GLOBAL(_switch
        mflr    r20             /* Return to switch caller */
        mfmsr   r22
        li      r0, MSR_FP
 +#ifdef CONFIG_VSX
 +BEGIN_FTR_SECTION
 +      oris    r0,r0,MSR_VSX@h /* Disable VSX */
 +END_FTR_SECTION_IFSET(CPU_FTR_VSX)
 +#endif /* CONFIG_VSX */
  #ifdef CONFIG_ALTIVEC
  BEGIN_FTR_SECTION
        oris    r0,r0,MSR_VEC@h /* Disable altivec */
@@@ -388,16 -384,16 +389,16 @@@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC
  
        ld      r8,KSP(r4)      /* new stack pointer */
  BEGIN_FTR_SECTION
 -      b       2f
 -END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
 -BEGIN_FTR_SECTION
 +  BEGIN_FTR_SECTION_NESTED(95)
        clrrdi  r6,r8,28        /* get its ESID */
        clrrdi  r9,r1,28        /* get current sp ESID */
 -END_FTR_SECTION_IFCLR(CPU_FTR_1T_SEGMENT)
 -BEGIN_FTR_SECTION
 +  FTR_SECTION_ELSE_NESTED(95)
        clrrdi  r6,r8,40        /* get its 1T ESID */
        clrrdi  r9,r1,40        /* get current sp 1T ESID */
 -END_FTR_SECTION_IFSET(CPU_FTR_1T_SEGMENT)
 +  ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_1T_SEGMENT, 95)
 +FTR_SECTION_ELSE
 +      b       2f
 +ALT_FTR_SECTION_END_IFSET(CPU_FTR_SLB)
        clrldi. r0,r6,2         /* is new ESID c00000000? */
        cmpd    cr1,r6,r9       /* or is new ESID the same as current ESID? */
        cror    eq,4*cr1+eq,eq
@@@ -875,3 -871,67 +876,67 @@@ _GLOBAL(enter_prom
        ld      r0,16(r1)
        mtlr    r0
          blr
+ #ifdef CONFIG_FTRACE
+ #ifdef CONFIG_DYNAMIC_FTRACE
+ _GLOBAL(mcount)
+ _GLOBAL(_mcount)
+       /* Taken from output of objdump from lib64/glibc */
+       mflr    r3
+       stdu    r1, -112(r1)
+       std     r3, 128(r1)
+       subi    r3, r3, MCOUNT_INSN_SIZE
+       .globl mcount_call
+ mcount_call:
+       bl      ftrace_stub
+       nop
+       ld      r0, 128(r1)
+       mtlr    r0
+       addi    r1, r1, 112
+       blr
+ _GLOBAL(ftrace_caller)
+       /* Taken from output of objdump from lib64/glibc */
+       mflr    r3
+       ld      r11, 0(r1)
+       stdu    r1, -112(r1)
+       std     r3, 128(r1)
+       ld      r4, 16(r11)
+       subi    r3, r3, MCOUNT_INSN_SIZE
+ .globl ftrace_call
+ ftrace_call:
+       bl      ftrace_stub
+       nop
+       ld      r0, 128(r1)
+       mtlr    r0
+       addi    r1, r1, 112
+ _GLOBAL(ftrace_stub)
+       blr
+ #else
+ _GLOBAL(mcount)
+       blr
+ _GLOBAL(_mcount)
+       /* Taken from output of objdump from lib64/glibc */
+       mflr    r3
+       ld      r11, 0(r1)
+       stdu    r1, -112(r1)
+       std     r3, 128(r1)
+       ld      r4, 16(r11)
+       subi    r3, r3, MCOUNT_INSN_SIZE
+       LOAD_REG_ADDR(r5,ftrace_trace_function)
+       ld      r5,0(r5)
+       ld      r5,0(r5)
+       mtctr   r5
+       bctrl
+       nop
+       ld      r0, 128(r1)
+       mtlr    r0
+       addi    r1, r1, 112
+ _GLOBAL(ftrace_stub)
+       blr
+ #endif
+ #endif
index d6df018bb58471c3fa97f6d2274d22d820a59e27,dcc946e670991c7f972141ee162b814789fd4435..6ac8612da3c32a61f0fae070fd158be9f6d706f6
@@@ -98,7 -98,7 +98,7 @@@ EXPORT_SYMBOL(irq_desc)
  
  int distribute_irqs = 1;
  
- static inline unsigned long get_hard_enabled(void)
+ static inline notrace unsigned long get_hard_enabled(void)
  {
        unsigned long enabled;
  
        return enabled;
  }
  
- static inline void set_soft_enabled(unsigned long enable)
+ static inline notrace void set_soft_enabled(unsigned long enable)
  {
        __asm__ __volatile__("stb %0,%1(13)"
        : : "r" (enable), "i" (offsetof(struct paca_struct, soft_enabled)));
  }
  
- void raw_local_irq_restore(unsigned long en)
notrace void raw_local_irq_restore(unsigned long en)
  {
        /*
         * get_paca()->soft_enabled = en;
@@@ -356,42 -356,9 +356,42 @@@ void __init init_IRQ(void
  {
        if (ppc_md.init_IRQ)
                ppc_md.init_IRQ();
 +
 +      exc_lvl_ctx_init();
 +
        irq_ctx_init();
  }
  
 +#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
 +struct thread_info   *critirq_ctx[NR_CPUS] __read_mostly;
 +struct thread_info    *dbgirq_ctx[NR_CPUS] __read_mostly;
 +struct thread_info *mcheckirq_ctx[NR_CPUS] __read_mostly;
 +
 +void exc_lvl_ctx_init(void)
 +{
 +      struct thread_info *tp;
 +      int i;
 +
 +      for_each_possible_cpu(i) {
 +              memset((void *)critirq_ctx[i], 0, THREAD_SIZE);
 +              tp = critirq_ctx[i];
 +              tp->cpu = i;
 +              tp->preempt_count = 0;
 +
 +#ifdef CONFIG_BOOKE
 +              memset((void *)dbgirq_ctx[i], 0, THREAD_SIZE);
 +              tp = dbgirq_ctx[i];
 +              tp->cpu = i;
 +              tp->preempt_count = 0;
 +
 +              memset((void *)mcheckirq_ctx[i], 0, THREAD_SIZE);
 +              tp = mcheckirq_ctx[i];
 +              tp->cpu = i;
 +              tp->preempt_count = HARDIRQ_OFFSET;
 +#endif
 +      }
 +}
 +#endif
  
  #ifdef CONFIG_IRQSTACKS
  struct thread_info *softirq_ctx[NR_CPUS] __read_mostly;
@@@ -498,7 -465,7 +498,7 @@@ struct irq_host *irq_alloc_host(struct 
        host->revmap_type = revmap_type;
        host->inval_irq = inval_irq;
        host->ops = ops;
 -      host->of_node = of_node;
 +      host->of_node = of_node_get(of_node);
  
        if (host->ops->match == NULL)
                host->ops->match = default_irq_host_match;
index 958ecb9ae7dca9e5705000debc3d19f0a48428f1,a8d02506468aeb5762827cdd080f70d17032f9d5..e1ea4fe5cfbde0a6c436978f5864f650b10928d2
@@@ -42,6 -42,7 +42,7 @@@
  #include <asm/div64.h>
  #include <asm/signal.h>
  #include <asm/dcr.h>
+ #include <asm/ftrace.h>
  
  #ifdef CONFIG_PPC32
  extern void transfer_to_handler(void);
@@@ -67,6 -68,10 +68,10 @@@ EXPORT_SYMBOL(single_step_exception)
  EXPORT_SYMBOL(sys_sigreturn);
  #endif
  
+ #ifdef CONFIG_FTRACE
+ EXPORT_SYMBOL(_mcount);
+ #endif
  EXPORT_SYMBOL(strcpy);
  EXPORT_SYMBOL(strncpy);
  EXPORT_SYMBOL(strcat);
@@@ -102,9 -107,6 +107,9 @@@ EXPORT_SYMBOL(giveup_fpu)
  #ifdef CONFIG_ALTIVEC
  EXPORT_SYMBOL(giveup_altivec);
  #endif /* CONFIG_ALTIVEC */
 +#ifdef CONFIG_VSX
 +EXPORT_SYMBOL(giveup_vsx);
 +#endif /* CONFIG_VSX */
  #ifdef CONFIG_SPE
  EXPORT_SYMBOL(giveup_spe);
  #endif /* CONFIG_SPE */
index 0109e7f0ccf9ce5c253bcb1d297a1ae3fe81e1d3,19e8fcb9cea890ae8bd937200acea9e9284c4770..4efebe88e64a9607c98281a3f8489430e35495df
@@@ -81,7 -81,7 +81,7 @@@ int ucache_bsize
   * from the address that it was linked at, so we must use RELOC/PTRRELOC
   * to access static data (including strings).  -- paulus
   */
- unsigned long __init early_init(unsigned long dt_ptr)
notrace unsigned long __init early_init(unsigned long dt_ptr)
  {
        unsigned long offset = reloc_offset();
        struct cpu_spec *spec;
                          PTRRELOC(&__start___ftr_fixup),
                          PTRRELOC(&__stop___ftr_fixup));
  
 +      do_lwsync_fixups(spec->cpu_features,
 +                       PTRRELOC(&__start___lwsync_fixup),
 +                       PTRRELOC(&__stop___lwsync_fixup));
 +
        return KERNELBASE + offset;
  }
  
   * This is called very early on the boot process, after a minimal
   * MMU environment has been set up but before MMU_init is called.
   */
- void __init machine_init(unsigned long dt_ptr, unsigned long phys)
notrace void __init machine_init(unsigned long dt_ptr, unsigned long phys)
  {
        /* Enable early debugging if any specified (see udbg.h) */
        udbg_early_init();
                ppc_md.power_save = ppc6xx_idle;
  #endif
  
 +#ifdef CONFIG_E500
 +      if (cpu_has_feature(CPU_FTR_CAN_DOZE) ||
 +          cpu_has_feature(CPU_FTR_CAN_NAP))
 +              ppc_md.power_save = e500_idle;
 +#endif
        if (ppc_md.progress)
                ppc_md.progress("id mach(): done", 0x200);
  }
  
  #ifdef CONFIG_BOOKE_WDT
  /* Checks wdt=x and wdt_period=xx command-line option */
- int __init early_parse_wdt(char *p)
notrace int __init early_parse_wdt(char *p)
  {
        if (p && strncmp(p, "0", 1) != 0)
               booke_wdt_enabled = 1;
@@@ -257,28 -248,6 +257,28 @@@ static void __init irqstack_early_init(
  #define irqstack_early_init()
  #endif
  
 +#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
 +static void __init exc_lvl_early_init(void)
 +{
 +      unsigned int i;
 +
 +      /* interrupt stacks must be in lowmem, we get that for free on ppc32
 +       * as the lmb is limited to lowmem by LMB_REAL_LIMIT */
 +      for_each_possible_cpu(i) {
 +              critirq_ctx[i] = (struct thread_info *)
 +                      __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
 +#ifdef CONFIG_BOOKE
 +              dbgirq_ctx[i] = (struct thread_info *)
 +                      __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
 +              mcheckirq_ctx[i] = (struct thread_info *)
 +                      __va(lmb_alloc(THREAD_SIZE, THREAD_SIZE));
 +#endif
 +      }
 +}
 +#else
 +#define exc_lvl_early_init()
 +#endif
 +
  /* Warning, IO base is not yet inited */
  void __init setup_arch(char **cmdline_p)
  {
        init_mm.end_data = (unsigned long) _edata;
        init_mm.brk = klimit;
  
 +      exc_lvl_early_init();
 +
        irqstack_early_init();
  
        /* set up the bootmem stuff with available memory */
index 6856f6c157275db08d6ae577bf87b0082bdc4e31,53d57d17a894669baff94b7e0e30ece9a1acf6c4..87a72c66ce27759d3cd087e0cf2abd378f144531
@@@ -35,7 -35,7 +35,7 @@@ SECTION
                ALIGN_FUNCTION();
                *(.text.head)
                _text = .;
 -              *(.text .fixup .text.init.refok .exit.text.refok)
 +              *(.text .fixup .text.init.refok .exit.text.refok __ftr_alt_*)
                SCHED_TEXT
                LOCK_TEXT
                KPROBES_TEXT
@@@ -64,8 -64,6 +64,6 @@@
  
        NOTES
  
-       BUG_TABLE
  /*
   * Init sections discarded at runtime
   */
                *(__ftr_fixup)
                __stop___ftr_fixup = .;
        }
 +      . = ALIGN(8);
 +      __lwsync_fixup : AT(ADDR(__lwsync_fixup) - LOAD_OFFSET) {
 +              __start___lwsync_fixup = .;
 +              *(__lwsync_fixup)
 +              __stop___lwsync_fixup = .;
 +      }
  #ifdef CONFIG_PPC64
        . = ALIGN(8);
        __fw_ftr_fixup : AT(ADDR(__fw_ftr_fixup) - LOAD_OFFSET) {
diff --combined drivers/char/Makefile
index d38ac5030763bbc46b2d7aa111acae946432e67a,81630a68475cd7ad8859c650c20a6431fae60539..0e0d12a064622c3d3167e2db6cff59336dbe20d5
@@@ -57,7 -57,6 +57,7 @@@ obj-$(CONFIG_MMTIMER)         += mmtimer.
  obj-$(CONFIG_VIOCONS)         += viocons.o
  obj-$(CONFIG_VIOTAPE)         += viotape.o
  obj-$(CONFIG_HVCS)            += hvcs.o
 +obj-$(CONFIG_IBM_BSR)         += bsr.o
  obj-$(CONFIG_SGI_MBCS)                += mbcs.o
  obj-$(CONFIG_BRIQ_PANEL)      += briq_panel.o
  obj-$(CONFIG_BFIN_OTP)                += bfin-otp.o
@@@ -102,7 -101,6 +102,6 @@@ obj-$(CONFIG_TELCLOCK)             += tlclk.
  
  obj-$(CONFIG_MWAVE)           += mwave/
  obj-$(CONFIG_AGP)             += agp/
- obj-$(CONFIG_DRM)             += drm/
  obj-$(CONFIG_PCMCIA)          += pcmcia/
  obj-$(CONFIG_IPMI_HANDLER)    += ipmi/
  
diff --combined drivers/char/viotape.c
index d4db42ca71e65fc54027590374ae2997f4d8412d,977f7d35e76916cc774ff4bf72c9f67e3ecd3eca..e5da98d8f9cd70f493ecb8c9d7521639f937e779
@@@ -678,17 -678,6 +678,17 @@@ free_op
        return ret;
  }
  
 +static long viotap_unlocked_ioctl(struct file *file,
 +              unsigned int cmd, unsigned long arg)
 +{
 +      long rc;
 +
 +      lock_kernel();
 +      rc = viotap_ioctl(file->f_path.dentry->d_inode, file, cmd, arg);
 +      unlock_kernel();
 +      return rc;
 +}
 +
  static int viotap_open(struct inode *inode, struct file *file)
  {
        HvLpEvent_Rc hvrc;
        if (op == NULL)
                return -ENOMEM;
  
+       lock_kernel();
        get_dev_info(file->f_path.dentry->d_inode, &devi);
  
        /* Note: We currently only support one mode! */
  
  free_op:
        free_op_struct(op);
+       unlock_kernel();
        return ret;
  }
  
@@@ -795,12 -786,12 +797,12 @@@ free_op
  }
  
  const struct file_operations viotap_fops = {
 -      .owner =        THIS_MODULE,
 -      .read =         viotap_read,
 -      .write =        viotap_write,
 -      .ioctl =        viotap_ioctl,
 -      .open =         viotap_open,
 -      .release =      viotap_release,
 +      .owner =                THIS_MODULE,
 +      .read =                 viotap_read,
 +      .write =                viotap_write,
 +      .unlocked_ioctl =       viotap_unlocked_ioctl,
 +      .open =                 viotap_open,
 +      .release =              viotap_release,
  };
  
  /* Handle interrupt events for tape */
diff --combined drivers/macintosh/adb.c
index 61b62a6f681b7fce7fa32178df6acdb9fcc2b0bd,40c70ba62bf0eff36362cf7cb5c4129afb2436d0..e5d446804d323e74880db5ff14130440a120f033
@@@ -46,6 -46,7 +46,6 @@@
  #endif
  
  
 -EXPORT_SYMBOL(adb_controller);
  EXPORT_SYMBOL(adb_client_list);
  
  extern struct adb_driver via_macii_driver;
@@@ -79,7 -80,7 +79,7 @@@ static struct adb_driver *adb_driver_li
  
  static struct class *adb_dev_class;
  
 -struct adb_driver *adb_controller;
 +static struct adb_driver *adb_controller;
  BLOCKING_NOTIFIER_HEAD(adb_client_list);
  static int adb_got_sleep;
  static int adb_inited;
@@@ -289,7 -290,7 +289,7 @@@ static int adb_resume(struct platform_d
  }
  #endif /* CONFIG_PM */
  
 -int __init adb_init(void)
 +static int __init adb_init(void)
  {
        struct adb_driver *driver;
        int i;
@@@ -643,12 -644,18 +643,18 @@@ do_adb_query(struct adb_request *req
  static int adb_open(struct inode *inode, struct file *file)
  {
        struct adbdev_state *state;
+       int ret = 0;
  
-       if (iminor(inode) > 0 || adb_controller == NULL)
-               return -ENXIO;
+       lock_kernel();
+       if (iminor(inode) > 0 || adb_controller == NULL) {
+               ret = -ENXIO;
+               goto out;
+       }
        state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL);
-       if (state == 0)
-               return -ENOMEM;
+       if (state == 0) {
+               ret = -ENOMEM;
+               goto out;
+       }
        file->private_data = state;
        spin_lock_init(&state->lock);
        atomic_set(&state->n_pending, 0);
        init_waitqueue_head(&state->wait_queue);
        state->inuse = 1;
  
-       return 0;
+ out:
+       unlock_kernel();
+       return ret;
  }
  
  static int adb_release(struct inode *inode, struct file *file)
diff --combined drivers/macintosh/smu.c
index 76dbf25cb70ffe2cde80414cb63687ea7d7adf26,32cb0298f88e8b2b3f1def71e83f0e801fd1a159..96faa799b82a84784d515f4d0aa77d527ca9ee28
@@@ -19,6 -19,7 +19,7 @@@
   *    the userland interface
   */
  
+ #include <linux/smp_lock.h>
  #include <linux/types.h>
  #include <linux/kernel.h>
  #include <linux/device.h>
@@@ -35,8 -36,6 +36,8 @@@
  #include <linux/sysdev.h>
  #include <linux/poll.h>
  #include <linux/mutex.h>
 +#include <linux/of_device.h>
 +#include <linux/of_platform.h>
  
  #include <asm/byteorder.h>
  #include <asm/io.h>
@@@ -47,6 -46,8 +48,6 @@@
  #include <asm/sections.h>
  #include <asm/abs_addr.h>
  #include <asm/uaccess.h>
 -#include <asm/of_device.h>
 -#include <asm/of_platform.h>
  
  #define VERSION "0.7"
  #define AUTHOR  "(c) 2005 Benjamin Herrenschmidt, IBM Corp."
@@@ -474,7 -475,6 +475,7 @@@ int __init smu_init (void
  {
        struct device_node *np;
        const u32 *data;
 +      int ret = 0;
  
          np = of_find_node_by_type(NULL, "smu");
          if (np == NULL)
  
        if (smu_cmdbuf_abs == 0) {
                printk(KERN_ERR "SMU: Command buffer not allocated !\n");
 -              of_node_put(np);
 -              return -EINVAL;
 +              ret = -EINVAL;
 +              goto fail_np;
        }
  
        smu = alloc_bootmem(sizeof(struct smu_device));
 -      if (smu == NULL) {
 -              of_node_put(np);
 -              return -ENOMEM;
 -      }
 -      memset(smu, 0, sizeof(*smu));
  
        spin_lock_init(&smu->lock);
        INIT_LIST_HEAD(&smu->cmd_list);
        smu->db_node = of_find_node_by_name(NULL, "smu-doorbell");
        if (smu->db_node == NULL) {
                printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n");
 -              goto fail;
 +              ret = -ENXIO;
 +              goto fail_bootmem;
        }
        data = of_get_property(smu->db_node, "reg", NULL);
        if (data == NULL) {
 -              of_node_put(smu->db_node);
 -              smu->db_node = NULL;
                printk(KERN_ERR "SMU: Can't find doorbell GPIO address !\n");
 -              goto fail;
 +              ret = -ENXIO;
 +              goto fail_db_node;
        }
  
        /* Current setup has one doorbell GPIO that does both doorbell
        smu->db_buf = ioremap(0x8000860c, 0x1000);
        if (smu->db_buf == NULL) {
                printk(KERN_ERR "SMU: Can't map doorbell buffer pointer !\n");
 -              goto fail;
 +              ret = -ENXIO;
 +              goto fail_msg_node;
        }
  
        /* U3 has an issue with NAP mode when issuing SMU commands */
        sys_ctrler = SYS_CTRLER_SMU;
        return 0;
  
 - fail:
 +fail_msg_node:
 +      if (smu->msg_node)
 +              of_node_put(smu->msg_node);
 +fail_db_node:
 +      of_node_put(smu->db_node);
 +fail_bootmem:
 +      free_bootmem((unsigned long)smu, sizeof(struct smu_device));
        smu = NULL;
 -      return -ENXIO;
 -
 +fail_np:
 +      of_node_put(np);
 +      return ret;
  }
  
  
@@@ -1090,10 -1087,12 +1091,12 @@@ static int smu_open(struct inode *inode
        pp->mode = smu_file_commands;
        init_waitqueue_head(&pp->wait);
  
+       lock_kernel();
        spin_lock_irqsave(&smu_clist_lock, flags);
        list_add(&pp->list, &smu_clist);
        spin_unlock_irqrestore(&smu_clist_lock, flags);
        file->private_data = pp;
+       unlock_kernel();
  
        return 0;
  }
diff --combined drivers/net/Kconfig
index 8e3e968b2957dd3d9f5f02772583b9714c4ad34a,45a41b597da91edabc42150bd826ae22cb5f6ee5..2683ee32fc11358294ccc34fb66019c0f6fe258f
@@@ -217,7 -217,7 +217,7 @@@ config MI
  
  config MACB
        tristate "Atmel MACB support"
-       depends on AVR32 || ARCH_AT91SAM9260 || ARCH_AT91SAM9263 || ARCH_AT91CAP9
+       depends on AVR32 || ARCH_AT91SAM9260 || ARCH_AT91SAM9263 || ARCH_AT91SAM9G20 || ARCH_AT91CAP9
        select PHYLIB
        help
          The Atmel MACB ethernet interface is found on many AT32 and AT91
@@@ -1884,6 -1884,7 +1884,6 @@@ config NE_H830
          Say Y here if you want to use the NE2000 compatible
          controller on the Renesas H8/300 processor.
  
 -source "drivers/net/fec_8xx/Kconfig"
  source "drivers/net/fs_enet/Kconfig"
  
  endif # NET_ETHERNET
index 9c5be9a2f3fd5796b0e9f6c2b341cfbdc8edd706,13a5fbd50a078fe3d45c2c1028066e679fe7c581..ff66604e90d4d7620fe58af4c28dec12ae874be2
@@@ -1,7 -1,7 +1,7 @@@
  /*
   * m8xx_pcmcia.c - Linux PCMCIA socket driver for the mpc8xx series.
   *
-  * (C) 1999-2000 Magnus Damm <damm@bitsmart.com>
+  * (C) 1999-2000 Magnus Damm <damm@opensource.se>
   * (C) 2001-2002 Montavista Software, Inc.
   *     <mlocke@mvista.com>
   *
@@@ -49,8 -49,6 +49,8 @@@
  #include <linux/interrupt.h>
  #include <linux/fsl_devices.h>
  #include <linux/bitops.h>
 +#include <linux/of_device.h>
 +#include <linux/of_platform.h>
  
  #include <asm/io.h>
  #include <asm/system.h>
@@@ -59,8 -57,9 +59,7 @@@
  #include <asm/8xx_immap.h>
  #include <asm/irq.h>
  #include <asm/fs_pd.h>
 -#include <asm/of_device.h>
 -#include <asm/of_platform.h>
  
- #include <pcmcia/version.h>
  #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/ss.h>
diff --combined include/linux/mm.h
index 689184446fc66ff8fd66126d0e0fa24e8d0203bc,cf1cd3a2ed7870c6faa00a3452ab7ef1339d33ee..2128ef7780c6f475a8b3574fdd1a2ad99ad36a4a
@@@ -108,7 -108,6 +108,7 @@@ extern unsigned int kobjsize(const voi
  
  #define VM_CAN_NONLINEAR 0x08000000   /* Has ->fault & does nonlinear pages */
  #define VM_MIXEDMAP   0x10000000      /* Can contain "struct page" and pure PFN pages */
 +#define VM_SAO                0x20000000      /* Strong Access Ordering (powerpc) */
  
  #ifndef VM_STACK_DEFAULT_FLAGS                /* arch can override this */
  #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
@@@ -999,8 -998,8 +999,8 @@@ extern void free_area_init_node(int nid
  extern void free_area_init_nodes(unsigned long *max_zone_pfn);
  extern void add_active_range(unsigned int nid, unsigned long start_pfn,
                                        unsigned long end_pfn);
- extern void shrink_active_range(unsigned int nid, unsigned long old_end_pfn,
-                                               unsigned long new_end_pfn);
+ extern void remove_active_range(unsigned int nid, unsigned long start_pfn,
+                                       unsigned long end_pfn);
  extern void push_node_boundaries(unsigned int nid, unsigned long start_pfn,
                                        unsigned long end_pfn);
  extern void remove_all_active_ranges(void);
@@@ -1012,6 -1011,8 +1012,8 @@@ extern unsigned long find_min_pfn_with_
  extern unsigned long find_max_pfn_with_active_regions(void);
  extern void free_bootmem_with_active_regions(int nid,
                                                unsigned long max_low_pfn);
+ typedef int (*work_fn_t)(unsigned long, unsigned long, void *);
+ extern void work_with_active_regions(int nid, work_fn_t work_fn, void *data);
  extern void sparse_memory_present_with_active_regions(int nid);
  #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
  extern int early_pfn_to_nid(unsigned long pfn);
@@@ -1025,6 -1026,7 +1027,7 @@@ extern void mem_init(void)
  extern void show_mem(void);
  extern void si_meminfo(struct sysinfo * val);
  extern void si_meminfo_node(struct sysinfo *val, int nid);
+ extern int after_bootmem;
  
  #ifdef CONFIG_NUMA
  extern void setup_per_cpu_pageset(void);
diff --combined mm/mprotect.c
index ecfaa5844b5f4610dac3e62ee0f774ac1bf67863,acfe7c8d72fcff59dec990869a5fce9d63b56e55..360d9cc8b38c061185d562fc40b7f032ae34d21d
@@@ -47,19 -47,17 +47,17 @@@ static void change_pte_range(struct mm_
                if (pte_present(oldpte)) {
                        pte_t ptent;
  
-                       /* Avoid an SMP race with hardware updated dirty/clean
-                        * bits by wiping the pte and then setting the new pte
-                        * into place.
-                        */
-                       ptent = ptep_get_and_clear(mm, addr, pte);
+                       ptent = ptep_modify_prot_start(mm, addr, pte);
                        ptent = pte_modify(ptent, newprot);
                        /*
                         * Avoid taking write faults for pages we know to be
                         * dirty.
                         */
                        if (dirty_accountable && pte_dirty(ptent))
                                ptent = pte_mkwrite(ptent);
-                       set_pte_at(mm, addr, pte, ptent);
+                       ptep_modify_prot_commit(mm, addr, pte, ptent);
  #ifdef CONFIG_MIGRATION
                } else if (!pte_file(oldpte)) {
                        swp_entry_t entry = pte_to_swp_entry(oldpte);
@@@ -239,7 -237,7 +237,7 @@@ sys_mprotect(unsigned long start, size_
        end = start + len;
        if (end <= start)
                return -ENOMEM;
 -      if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC | PROT_SEM))
 +      if (!arch_validate_prot(prot))
                return -EINVAL;
  
        reqprot = prot;