Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 9 May 2007 19:56:01 +0000 (12:56 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 9 May 2007 19:56:01 +0000 (12:56 -0700)
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
  [POWERPC] Further fixes for the removal of 4level-fixup hack from ppc32
  [POWERPC] EEH: log all PCI-X and PCI-E AER registers
  [POWERPC] EEH: capture and log pci state on error
  [POWERPC] EEH: Split up long error msg
  [POWERPC] EEH: log error only after driver notification.
  [POWERPC] fsl_soc: Make mac_addr const in fs_enet_of_init().
  [POWERPC] Don't use SLAB/SLUB for PTE pages
  [POWERPC] Spufs support for 64K LS mappings on 4K kernels
  [POWERPC] Add ability to 4K kernel to hash in 64K pages
  [POWERPC] Introduce address space "slices"
  [POWERPC] Small fixes & cleanups in segment page size demotion
  [POWERPC] iSeries: Make HVC_ISERIES the default
  [POWERPC] iSeries: suppress build warning in lparmap.c
  [POWERPC] Mark pages that don't exist as nosave
  [POWERPC] swsusp: Introduce register_nosave_region_late

1  2 
arch/powerpc/kernel/asm-offsets.c
include/linux/suspend.h
kernel/power/snapshot.c

@@@ -58,7 -58,7 +58,7 @@@ int main(void
  #ifdef CONFIG_PPC64
        DEFINE(AUDITCONTEXT, offsetof(struct task_struct, audit_context));
  #else
 -      DEFINE(THREAD_INFO, offsetof(struct task_struct, thread_info));
 +      DEFINE(THREAD_INFO, offsetof(struct task_struct, stack));
        DEFINE(PTRACE, offsetof(struct task_struct, ptrace));
  #endif /* CONFIG_PPC64 */
  
        DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
        DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
        DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
-       DEFINE(PACACONTEXTSLLP, offsetof(struct paca_struct, context.sllp));
        DEFINE(PACAVMALLOCSLLP, offsetof(struct paca_struct, vmalloc_sllp));
- #ifdef CONFIG_HUGETLB_PAGE
-       DEFINE(PACALOWHTLBAREAS, offsetof(struct paca_struct, context.low_htlb_areas));
-       DEFINE(PACAHIGHHTLBAREAS, offsetof(struct paca_struct, context.high_htlb_areas));
- #endif /* CONFIG_HUGETLB_PAGE */
+ #ifdef CONFIG_PPC_MM_SLICES
+       DEFINE(PACALOWSLICESPSIZE, offsetof(struct paca_struct,
+                                           context.low_slices_psize));
+       DEFINE(PACAHIGHSLICEPSIZE, offsetof(struct paca_struct,
+                                           context.high_slices_psize));
+       DEFINE(MMUPSIZEDEFSIZE, sizeof(struct mmu_psize_def));
+       DEFINE(MMUPSIZESLLP, offsetof(struct mmu_psize_def, sllp));
+ #else
+       DEFINE(PACACONTEXTSLLP, offsetof(struct paca_struct, context.sllp));
+ #endif /* CONFIG_PPC_MM_SLICES */
        DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen));
        DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc));
        DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb));
diff --combined include/linux/suspend.h
@@@ -32,42 -32,27 +32,51 @@@ static inline int pm_prepare_console(vo
  static inline void pm_restore_console(void) {}
  #endif
  
 +/**
 + * struct hibernation_ops - hibernation platform support
 + *
 + * The methods in this structure allow a platform to override the default
 + * mechanism of shutting down the machine during a hibernation transition.
 + *
 + * All three methods must be assigned.
 + *
 + * @prepare: prepare system for hibernation
 + * @enter: shut down system after state has been saved to disk
 + * @finish: finish/clean up after state has been reloaded
 + */
 +struct hibernation_ops {
 +      int (*prepare)(void);
 +      int (*enter)(void);
 +      void (*finish)(void);
 +};
 +
  #if defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND)
  /* kernel/power/snapshot.c */
- extern void __init register_nosave_region(unsigned long, unsigned long);
+ extern void __register_nosave_region(unsigned long b, unsigned long e, int km);
+ static inline void register_nosave_region(unsigned long b, unsigned long e)
+ {
+       __register_nosave_region(b, e, 0);
+ }
+ static inline void register_nosave_region_late(unsigned long b, unsigned long e)
+ {
+       __register_nosave_region(b, e, 1);
+ }
  extern int swsusp_page_is_forbidden(struct page *);
  extern void swsusp_set_page_free(struct page *);
  extern void swsusp_unset_page_free(struct page *);
  extern unsigned long get_safe_page(gfp_t gfp_mask);
 +
 +extern void hibernation_set_ops(struct hibernation_ops *ops);
 +extern int hibernate(void);
  #else
  static inline void register_nosave_region(unsigned long b, unsigned long e) {}
+ static inline void register_nosave_region_late(unsigned long b, unsigned long e) {}
  static inline int swsusp_page_is_forbidden(struct page *p) { return 0; }
  static inline void swsusp_set_page_free(struct page *p) {}
  static inline void swsusp_unset_page_free(struct page *p) {}
 +
 +static inline void hibernation_set_ops(struct hibernation_ops *ops) {}
 +static inline int hibernate(void) { return -ENOSYS; }
  #endif /* defined(CONFIG_PM) && defined(CONFIG_SOFTWARE_SUSPEND) */
  
  void save_processor_state(void);
diff --combined kernel/power/snapshot.c
@@@ -607,7 -607,8 +607,8 @@@ static LIST_HEAD(nosave_regions)
   */
  
  void __init
- register_nosave_region(unsigned long start_pfn, unsigned long end_pfn)
+ __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn,
+                        int use_kmalloc)
  {
        struct nosave_region *region;
  
                        goto Report;
                }
        }
-       /* This allocation cannot fail */
-       region = alloc_bootmem_low(sizeof(struct nosave_region));
+       if (use_kmalloc) {
+               /* during init, this shouldn't fail */
+               region = kmalloc(sizeof(struct nosave_region), GFP_KERNEL);
+               BUG_ON(!region);
+       } else
+               /* This allocation cannot fail */
+               region = alloc_bootmem_low(sizeof(struct nosave_region));
        region->start_pfn = start_pfn;
        region->end_pfn = end_pfn;
        list_add_tail(&region->list, &nosave_regions);
@@@ -1227,7 -1233,7 +1233,7 @@@ asmlinkage int swsusp_save(void
        nr_copy_pages = nr_pages;
        nr_meta_pages = DIV_ROUND_UP(nr_pages * sizeof(long), PAGE_SIZE);
  
 -      printk("swsusp: critical section/: done (%d pages copied)\n", nr_pages);
 +      printk("swsusp: critical section: done (%d pages copied)\n", nr_pages);
  
        return 0;
  }