]> Git Repo - linux.git/commitdiff
Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <[email protected]>
Sun, 8 Jan 2012 21:10:57 +0000 (13:10 -0800)
committerLinus Torvalds <[email protected]>
Sun, 8 Jan 2012 21:10:57 +0000 (13:10 -0800)
* 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (76 commits)
  PM / Hibernate: Implement compat_ioctl for /dev/snapshot
  PM / Freezer: fix return value of freezable_schedule_timeout_killable()
  PM / shmobile: Allow the A4R domain to be turned off at run time
  PM / input / touchscreen: Make st1232 use device PM QoS constraints
  PM / QoS: Introduce dev_pm_qos_add_ancestor_request()
  PM / shmobile: Remove the stay_on flag from SH7372's PM domains
  PM / shmobile: Don't include SH7372's INTCS in syscore suspend/resume
  PM / shmobile: Add support for the sh7372 A4S power domain / sleep mode
  PM: Drop generic_subsys_pm_ops
  PM / Sleep: Remove forward-only callbacks from AMBA bus type
  PM / Sleep: Remove forward-only callbacks from platform bus type
  PM: Run the driver callback directly if the subsystem one is not there
  PM / Sleep: Make pm_op() and pm_noirq_op() return callback pointers
  PM/Devfreq: Add Exynos4-bus device DVFS driver for Exynos4210/4212/4412.
  PM / Sleep: Merge internal functions in generic_ops.c
  PM / Sleep: Simplify generic system suspend callbacks
  PM / Hibernate: Remove deprecated hibernation snapshot ioctls
  PM / Sleep: Fix freezer failures due to racy usermodehelper_is_disabled()
  ARM: S3C64XX: Implement basic power domain support
  PM / shmobile: Use common always on power domain governor
  ...

Fix up trivial conflict in fs/xfs/xfs_buf.c due to removal of unused
XBT_FORCE_SLEEP bit

24 files changed:
1  2 
Documentation/feature-removal-schedule.txt
arch/arm/mach-s3c64xx/mach-crag6410.c
arch/arm/mach-shmobile/include/mach/common.h
arch/arm/plat-samsung/include/plat/pm.h
arch/m68k/include/asm/thread_info.h
arch/x86/include/asm/thread_info.h
drivers/amba/bus.c
drivers/base/firmware_class.c
drivers/base/platform.c
drivers/net/irda/stir4200.c
drivers/platform/x86/thinkpad_acpi.c
drivers/sh/intc/core.c
drivers/sh/intc/internals.h
fs/ext4/super.c
fs/fs-writeback.c
fs/gfs2/log.c
fs/gfs2/quota.c
fs/nfs/inode.c
fs/xfs/xfs_buf.c
include/linux/platform_device.h
include/linux/sched.h
kernel/cpu.c
kernel/exit.c
kernel/fork.c

index 33f7327d0451bec279299124758786116fd36b2c,9f51fc439a81b82bdea306c78c3c193b511fb2d1..a1e7f3eec98f9ac65ffdb373cd121eb2d9726e61
@@@ -85,17 -85,6 +85,6 @@@ Who: Robin Getz <[email protected]
  
  ---------------------------
  
- What: Deprecated snapshot ioctls
- When: 2.6.36
- Why:  The ioctls in kernel/power/user.c were marked as deprecated long time
-       ago. Now they notify users about that so that they need to replace
-       their userspace. After some more time, remove them completely.
- Who:  Jiri Slaby <[email protected]>
- ---------------------------
  What: The ieee80211_regdom module parameter
  When: March 2010 / desktop catchup
  
@@@ -263,7 -252,8 +252,7 @@@ Who:       Ravikiran Thirumalai <kiran@scalex
  
  What: Code that is now under CONFIG_WIRELESS_EXT_SYSFS
        (in net/core/net-sysfs.c)
 -When: After the only user (hal) has seen a release with the patches
 -      for enough time, probably some time in 2010.
 +When: 3.5
  Why:  Over 1K .text/.data size reduction, data is available in other
        ways (ioctls)
  Who:  Johannes Berg <[email protected]>
index f1c848aa4a1e1339697df24688d49209d646f34b,707b9b22f9fd441c2517f0810d343a1e18c7bafe..fb786b6a2eae0e5e05a03f940da5ef8160f0d319
@@@ -37,7 -37,6 +37,7 @@@
  #include <linux/mfd/wm831x/irq.h>
  #include <linux/mfd/wm831x/gpio.h>
  
 +#include <asm/hardware/vic.h>
  #include <asm/mach/arch.h>
  #include <asm/mach-types.h>
  
@@@ -51,6 -50,7 +51,6 @@@
  
  #include <mach/regs-gpio-memport.h>
  
 -#include <plat/s3c6410.h>
  #include <plat/regs-serial.h>
  #include <plat/regs-fb-v4.h>
  #include <plat/fb.h>
@@@ -66,8 -66,6 +66,8 @@@
  #include <plat/iic.h>
  #include <plat/pm.h>
  
 +#include "common.h"
 +
  /* serial port setup */
  
  #define UCON (S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK)
@@@ -706,16 -704,14 +706,16 @@@ static void __init crag6410_machine_ini
  
        regulator_has_full_constraints();
  
-       s3c_pm_init();
+       s3c64xx_pm_init();
  }
  
  MACHINE_START(WLF_CRAGG_6410, "Wolfson Cragganmore 6410")
        /* Maintainer: Mark Brown <[email protected]> */
        .atag_offset    = 0x100,
        .init_irq       = s3c6410_init_irq,
 +      .handle_irq     = vic_handle_irq,
        .map_io         = crag6410_map_io,
        .init_machine   = crag6410_machine_init,
        .timer          = &s3c24xx_timer,
 +      .restart        = s3c64xx_restart,
  MACHINE_END
index 4bf82c156771cc3a15414d338b97da64b04184c8,4807623fb71c0698eb35a8f63271410d70b3d419..be78a2c73db4784a598f180b076cc239e693e0c9
@@@ -7,6 -7,7 +7,6 @@@ extern void shmobile_secondary_vector(v
  struct clk;
  extern int clk_init(void);
  extern void shmobile_handle_irq_intc(struct pt_regs *);
 -extern void shmobile_handle_irq_gic(struct pt_regs *);
  extern struct platform_suspend_ops shmobile_suspend_ops;
  struct cpuidle_driver;
  extern void (*shmobile_cpuidle_modes[])(void);
@@@ -34,8 -35,8 +34,8 @@@ extern void sh7372_add_standard_devices
  extern void sh7372_clock_init(void);
  extern void sh7372_pinmux_init(void);
  extern void sh7372_pm_init(void);
- extern void sh7372_resume_core_standby_a3sm(void);
- extern int sh7372_do_idle_a3sm(unsigned long unused);
+ extern void sh7372_resume_core_standby_sysc(void);
+ extern int sh7372_do_idle_sysc(unsigned long sleep_mode);
  extern struct clk sh7372_extal1_clk;
  extern struct clk sh7372_extal2_clk;
  
index 78014e53eb3cc720744346a4e70d95212991aeda,a6bdee204f2adbf40096543df6eb351f339a93ee..61fc53740fbd8811a8d06659806ecfc6e5cc8c77
  
  #include <linux/irq.h>
  
 -struct sys_device;
 +struct device;
  
  #ifdef CONFIG_PM
  
  extern __init int s3c_pm_init(void);
+ extern __init int s3c64xx_pm_init(void);
  
  #else
  
@@@ -29,6 -30,11 +30,11 @@@ static inline int s3c_pm_init(void
  {
        return 0;
  }
+ static inline int s3c64xx_pm_init(void)
+ {
+       return 0;
+ }
  #endif
  
  /* configuration for the IRQ mask over sleep */
index 29fa6da4f17c4a2024e36da7c1a66401de2348a2,294df1592de51b2a254f8aa76dae35a5ec034e6b..e8665e6f9464d2c7a77c225af1de88140315a543
@@@ -3,7 -3,6 +3,7 @@@
  
  #include <asm/types.h>
  #include <asm/page.h>
 +#include <asm/segment.h>
  
  /*
   * On machines with 4k pages we default to an 8k thread size, though we
@@@ -27,7 -26,6 +27,7 @@@ struct thread_info 
        struct task_struct      *task;          /* main task structure */
        unsigned long           flags;
        struct exec_domain      *exec_domain;   /* execution domain */
 +      mm_segment_t            addr_limit;     /* thread address space */
        int                     preempt_count;  /* 0 => preemptable, <0 => BUG */
        __u32                   cpu;            /* should always be 0 on m68k */
        unsigned long           tp_value;       /* thread pointer */
@@@ -41,7 -39,6 +41,7 @@@
  {                                             \
        .task           = &tsk,                 \
        .exec_domain    = &default_exec_domain, \
 +      .addr_limit     = KERNEL_DS,            \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
        .restart_block = {                      \
                .fn = do_no_restart_syscall,    \
  
  #define init_stack            (init_thread_union.stack)
  
 -#ifdef CONFIG_MMU
 -
 -#ifndef __ASSEMBLY__
 -#include <asm/current.h>
 -#endif
 -
 -#ifdef ASM_OFFSETS_C
 -#define task_thread_info(tsk) ((struct thread_info *) NULL)
 -#else
 -#include <asm/asm-offsets.h>
 -#define task_thread_info(tsk) ((struct thread_info *)((char *)tsk+TASK_TINFO))
 -#endif
 -
 -#define init_thread_info      (init_task.thread.info)
 -#define task_stack_page(tsk)  ((tsk)->stack)
 -#define current_thread_info() task_thread_info(current)
 -
 -#define __HAVE_THREAD_FUNCTIONS
 -
 -#define setup_thread_stack(p, org) ({                 \
 -      *(struct task_struct **)(p)->stack = (p);       \
 -      task_thread_info(p)->task = (p);                \
 -})
 -
 -#define end_of_stack(p)               ((unsigned long *)(p)->stack + 1)
 -
 -#else /* !CONFIG_MMU */
 -
  #ifndef __ASSEMBLY__
  /* how to get the thread information struct from C */
  static inline struct thread_info *current_thread_info(void)
@@@ -67,6 -92,8 +67,6 @@@
  
  #define init_thread_info      (init_thread_union.thread_info)
  
 -#endif /* CONFIG_MMU */
 -
  /* entry.S relies on these definitions!
   * bits 0-7 are tested at every exception exit
   * bits 8-15 are also tested at syscall exit
  #define TIF_DELAYED_TRACE     14      /* single step a syscall */
  #define TIF_SYSCALL_TRACE     15      /* syscall trace active */
  #define TIF_MEMDIE            16      /* is terminating due to OOM killer */
- #define TIF_FREEZE            17      /* thread is freezing for suspend */
  #define TIF_RESTORE_SIGMASK   18      /* restore signal mask in do_signal */
  
  #endif        /* _ASM_M68K_THREAD_INFO_H */
index 185b719ec61a29bcdaeed612e238d998adb66fdd,32125af20d32a8f50c61dfc474d6a2b45a01ad41..74047159d0ab517acc0213d5fd8b7149efa26d57
@@@ -40,8 -40,7 +40,8 @@@ struct thread_info 
                                                */
        __u8                    supervisor_stack[0];
  #endif
 -      int                     uaccess_err;
 +      int                     sig_on_uaccess_error:1;
 +      int                     uaccess_err:1;  /* uaccess failed */
  };
  
  #define INIT_THREAD_INFO(tsk)                 \
@@@ -91,7 -90,6 +91,6 @@@
  #define TIF_MEMDIE            20      /* is terminating due to OOM killer */
  #define TIF_DEBUG             21      /* uses debug registers */
  #define TIF_IO_BITMAP         22      /* uses I/O bitmap */
- #define TIF_FREEZE            23      /* is freezing for suspend */
  #define TIF_FORCED_TF         24      /* true if TF in eflags artificially */
  #define TIF_BLOCKSTEP         25      /* set when we want DEBUGCTLMSR_BTF */
  #define TIF_LAZY_MMU_UPDATES  27      /* task is updating the mmu lazily */
  #define _TIF_FORK             (1 << TIF_FORK)
  #define _TIF_DEBUG            (1 << TIF_DEBUG)
  #define _TIF_IO_BITMAP                (1 << TIF_IO_BITMAP)
- #define _TIF_FREEZE           (1 << TIF_FREEZE)
  #define _TIF_FORCED_TF                (1 << TIF_FORCED_TF)
  #define _TIF_BLOCKSTEP                (1 << TIF_BLOCKSTEP)
  #define _TIF_LAZY_MMU_UPDATES (1 << TIF_LAZY_MMU_UPDATES)
@@@ -232,12 -229,6 +230,12 @@@ static inline struct thread_info *curre
        movq PER_CPU_VAR(kernel_stack),reg ; \
        subq $(THREAD_SIZE-KERNEL_STACK_OFFSET),reg
  
 +/*
 + * Same if PER_CPU_VAR(kernel_stack) is, perhaps with some offset, already in
 + * a certain register (to be used in assembler memory operands).
 + */
 +#define THREAD_INFO(reg, off) KERNEL_STACK_OFFSET+(off)-THREAD_SIZE(reg)
 +
  #endif
  
  #endif /* !X86_32 */
diff --combined drivers/amba/bus.c
index 936c98cb247571fb33427200cc9c95bedf4b21a4,0304b3fdff5a1f3149dfa071e30911cf76c0741f..54eaf96ab217272a53579454dd297bfa60d1e55e
@@@ -52,10 -52,6 +52,10 @@@ static int amba_uevent(struct device *d
        int retval = 0;
  
        retval = add_uevent_var(env, "AMBA_ID=%08x", pcdev->periphid);
 +      if (retval)
 +              return retval;
 +
 +      retval = add_uevent_var(env, "MODALIAS=amba:d%08X", pcdev->periphid);
        return retval;
  }
  #else
@@@ -113,31 -109,7 +113,7 @@@ static int amba_legacy_resume(struct de
        return ret;
  }
  
- static int amba_pm_prepare(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (drv && drv->pm && drv->pm->prepare)
-               ret = drv->pm->prepare(dev);
-       return ret;
- }
- static void amba_pm_complete(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       if (drv && drv->pm && drv->pm->complete)
-               drv->pm->complete(dev);
- }
- #else /* !CONFIG_PM_SLEEP */
- #define amba_pm_prepare               NULL
- #define amba_pm_complete              NULL
- #endif /* !CONFIG_PM_SLEEP */
+ #endif /* CONFIG_PM_SLEEP */
  
  #ifdef CONFIG_SUSPEND
  
@@@ -159,22 -131,6 +135,6 @@@ static int amba_pm_suspend(struct devic
        return ret;
  }
  
- static int amba_pm_suspend_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->suspend_noirq)
-                       ret = drv->pm->suspend_noirq(dev);
-       }
-       return ret;
- }
  static int amba_pm_resume(struct device *dev)
  {
        struct device_driver *drv = dev->driver;
        return ret;
  }
  
- static int amba_pm_resume_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->resume_noirq)
-                       ret = drv->pm->resume_noirq(dev);
-       }
-       return ret;
- }
  #else /* !CONFIG_SUSPEND */
  
  #define amba_pm_suspend               NULL
  #define amba_pm_resume                NULL
- #define amba_pm_suspend_noirq NULL
- #define amba_pm_resume_noirq  NULL
  
  #endif /* !CONFIG_SUSPEND */
  
@@@ -238,22 -176,6 +180,6 @@@ static int amba_pm_freeze(struct devic
        return ret;
  }
  
- static int amba_pm_freeze_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->freeze_noirq)
-                       ret = drv->pm->freeze_noirq(dev);
-       }
-       return ret;
- }
  static int amba_pm_thaw(struct device *dev)
  {
        struct device_driver *drv = dev->driver;
        return ret;
  }
  
- static int amba_pm_thaw_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->thaw_noirq)
-                       ret = drv->pm->thaw_noirq(dev);
-       }
-       return ret;
- }
  static int amba_pm_poweroff(struct device *dev)
  {
        struct device_driver *drv = dev->driver;
        return ret;
  }
  
- static int amba_pm_poweroff_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->poweroff_noirq)
-                       ret = drv->pm->poweroff_noirq(dev);
-       }
-       return ret;
- }
  static int amba_pm_restore(struct device *dev)
  {
        struct device_driver *drv = dev->driver;
        return ret;
  }
  
- static int amba_pm_restore_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->restore_noirq)
-                       ret = drv->pm->restore_noirq(dev);
-       }
-       return ret;
- }
  #else /* !CONFIG_HIBERNATE_CALLBACKS */
  
  #define amba_pm_freeze                NULL
  #define amba_pm_thaw          NULL
  #define amba_pm_poweroff              NULL
  #define amba_pm_restore               NULL
- #define amba_pm_freeze_noirq  NULL
- #define amba_pm_thaw_noirq            NULL
- #define amba_pm_poweroff_noirq        NULL
- #define amba_pm_restore_noirq NULL
  
  #endif /* !CONFIG_HIBERNATE_CALLBACKS */
  
@@@ -406,20 -276,12 +280,12 @@@ static int amba_pm_runtime_resume(struc
  #ifdef CONFIG_PM
  
  static const struct dev_pm_ops amba_pm = {
-       .prepare        = amba_pm_prepare,
-       .complete       = amba_pm_complete,
        .suspend        = amba_pm_suspend,
        .resume         = amba_pm_resume,
        .freeze         = amba_pm_freeze,
        .thaw           = amba_pm_thaw,
        .poweroff       = amba_pm_poweroff,
        .restore        = amba_pm_restore,
-       .suspend_noirq  = amba_pm_suspend_noirq,
-       .resume_noirq   = amba_pm_resume_noirq,
-       .freeze_noirq   = amba_pm_freeze_noirq,
-       .thaw_noirq     = amba_pm_thaw_noirq,
-       .poweroff_noirq = amba_pm_poweroff_noirq,
-       .restore_noirq  = amba_pm_restore_noirq,
        SET_RUNTIME_PM_OPS(
                amba_pm_runtime_suspend,
                amba_pm_runtime_resume,
index 3719c94be19c1016812150ba8127bb04b96806a4,d5585da14c8ac5d70c43344d90bb01941efd1113..26ab358dac62daf5cac1531eeb0cf24546c42efd
@@@ -226,13 -226,13 +226,13 @@@ static ssize_t firmware_loading_store(s
        int loading = simple_strtol(buf, NULL, 10);
        int i;
  
 +      mutex_lock(&fw_lock);
 +
 +      if (!fw_priv->fw)
 +              goto out;
 +
        switch (loading) {
        case 1:
 -              mutex_lock(&fw_lock);
 -              if (!fw_priv->fw) {
 -                      mutex_unlock(&fw_lock);
 -                      break;
 -              }
                firmware_free_data(fw_priv->fw);
                memset(fw_priv->fw, 0, sizeof(struct firmware));
                /* If the pages are not owned by 'struct firmware' */
                fw_priv->page_array_size = 0;
                fw_priv->nr_pages = 0;
                set_bit(FW_STATUS_LOADING, &fw_priv->status);
 -              mutex_unlock(&fw_lock);
                break;
        case 0:
                if (test_bit(FW_STATUS_LOADING, &fw_priv->status)) {
                fw_load_abort(fw_priv);
                break;
        }
 -
 +out:
 +      mutex_unlock(&fw_lock);
        return count;
  }
  
@@@ -534,6 -534,8 +534,8 @@@ static int _request_firmware(const stru
                return 0;
        }
  
+       read_lock_usermodehelper();
        if (WARN_ON(usermodehelper_is_disabled())) {
                dev_err(device, "firmware: %s will not be loaded\n", name);
                retval = -EBUSY;
        fw_destroy_instance(fw_priv);
  
  out:
+       read_unlock_usermodehelper();
        if (retval) {
                release_firmware(firmware);
                *firmware_p = NULL;
diff --combined drivers/base/platform.c
index a7c06374062e61c0f57388df40f332b106ddd628,7d912d5675d864d8e84ced04bb110146e3cd833e..f0c605e99ade2816c7c998efb4e19f1264b9ca81
@@@ -383,7 -383,7 +383,7 @@@ EXPORT_SYMBOL_GPL(platform_device_unreg
   * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
   */
  struct platform_device *platform_device_register_full(
 -              struct platform_device_info *pdevinfo)
 +              const struct platform_device_info *pdevinfo)
  {
        int ret = -ENOMEM;
        struct platform_device *pdev;
@@@ -700,25 -700,6 +700,6 @@@ static int platform_legacy_resume(struc
        return ret;
  }
  
- int platform_pm_prepare(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (drv && drv->pm && drv->pm->prepare)
-               ret = drv->pm->prepare(dev);
-       return ret;
- }
- void platform_pm_complete(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       if (drv && drv->pm && drv->pm->complete)
-               drv->pm->complete(dev);
- }
  #endif /* CONFIG_PM_SLEEP */
  
  #ifdef CONFIG_SUSPEND
@@@ -741,22 -722,6 +722,6 @@@ int platform_pm_suspend(struct device *
        return ret;
  }
  
- int platform_pm_suspend_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->suspend_noirq)
-                       ret = drv->pm->suspend_noirq(dev);
-       }
-       return ret;
- }
  int platform_pm_resume(struct device *dev)
  {
        struct device_driver *drv = dev->driver;
        return ret;
  }
  
- int platform_pm_resume_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->resume_noirq)
-                       ret = drv->pm->resume_noirq(dev);
-       }
-       return ret;
- }
  #endif /* CONFIG_SUSPEND */
  
  #ifdef CONFIG_HIBERNATE_CALLBACKS
@@@ -813,22 -762,6 +762,6 @@@ int platform_pm_freeze(struct device *d
        return ret;
  }
  
- int platform_pm_freeze_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->freeze_noirq)
-                       ret = drv->pm->freeze_noirq(dev);
-       }
-       return ret;
- }
  int platform_pm_thaw(struct device *dev)
  {
        struct device_driver *drv = dev->driver;
        return ret;
  }
  
- int platform_pm_thaw_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->thaw_noirq)
-                       ret = drv->pm->thaw_noirq(dev);
-       }
-       return ret;
- }
  int platform_pm_poweroff(struct device *dev)
  {
        struct device_driver *drv = dev->driver;
        return ret;
  }
  
- int platform_pm_poweroff_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->poweroff_noirq)
-                       ret = drv->pm->poweroff_noirq(dev);
-       }
-       return ret;
- }
  int platform_pm_restore(struct device *dev)
  {
        struct device_driver *drv = dev->driver;
        return ret;
  }
  
- int platform_pm_restore_noirq(struct device *dev)
- {
-       struct device_driver *drv = dev->driver;
-       int ret = 0;
-       if (!drv)
-               return 0;
-       if (drv->pm) {
-               if (drv->pm->restore_noirq)
-                       ret = drv->pm->restore_noirq(dev);
-       }
-       return ret;
- }
  #endif /* CONFIG_HIBERNATE_CALLBACKS */
  
  static const struct dev_pm_ops platform_dev_pm_ops = {
index 212868eb6f5fc2d13e6da878579b956dd08daacf,e880c79d7bd811a68a3c2fa3a8ae3369f77e4bd9..e6e59a078ef43a5443c8d0ed3f8268bdfdadd681
@@@ -750,7 -750,7 +750,7 @@@ static int stir_transmit_thread(void *a
  
                        write_reg(stir, REG_CTRL1, CTRL1_TXPWD|CTRL1_RXPWD);
  
-                       refrigerator();
+                       try_to_freeze();
  
                        if (change_speed(stir, stir->speed))
                                break;
@@@ -1133,4 -1133,21 +1133,4 @@@ static struct usb_driver irda_driver = 
  #endif
  };
  
 -/*
 - * Module insertion
 - */
 -static int __init stir_init(void)
 -{
 -      return usb_register(&irda_driver);
 -}
 -module_init(stir_init);
 -
 -/*
 - * Module removal
 - */
 -static void __exit stir_cleanup(void)
 -{
 -      /* Deregister the driver and remove all pending instances */
 -      usb_deregister(&irda_driver);
 -}
 -module_exit(stir_cleanup);
 +module_usb_driver(irda_driver);
index 455e1522253ea370c58817cde7ab084b3841647d,4b11fc91fa7d3366843b51315ddcbf861c0441a9..62533c105da40369d7d940b0deba4115f5f6bf7c
@@@ -297,7 -297,7 +297,7 @@@ struct ibm_init_struct 
        char param[32];
  
        int (*init) (struct ibm_init_struct *);
 -      mode_t base_procfs_mode;
 +      umode_t base_procfs_mode;
        struct ibm_struct *data;
  };
  
@@@ -2456,8 -2456,9 +2456,9 @@@ static int hotkey_kthread(void *data
        u32 poll_mask, event_mask;
        unsigned int si, so;
        unsigned long t;
-       unsigned int change_detector, must_reset;
+       unsigned int change_detector;
        unsigned int poll_freq;
+       bool was_frozen;
  
        mutex_lock(&hotkey_thread_mutex);
  
                                t = 100;        /* should never happen... */
                }
                t = msleep_interruptible(t);
-               if (unlikely(kthread_should_stop()))
+               if (unlikely(kthread_freezable_should_stop(&was_frozen)))
                        break;
-               must_reset = try_to_freeze();
-               if (t > 0 && !must_reset)
+               if (t > 0 && !was_frozen)
                        continue;
  
                mutex_lock(&hotkey_thread_data_mutex);
-               if (must_reset || hotkey_config_change != change_detector) {
+               if (was_frozen || hotkey_config_change != change_detector) {
                        /* forget old state on thaw or config change */
                        si = so;
                        t = 0;
@@@ -2528,10 -2529,6 +2529,6 @@@ exit
  static void hotkey_poll_stop_sync(void)
  {
        if (tpacpi_hotkey_task) {
-               if (frozen(tpacpi_hotkey_task) ||
-                   freezing(tpacpi_hotkey_task))
-                       thaw_process(tpacpi_hotkey_task);
                kthread_stop(tpacpi_hotkey_task);
                tpacpi_hotkey_task = NULL;
                mutex_lock(&hotkey_thread_mutex);
@@@ -8542,7 -8539,7 +8539,7 @@@ static int __init ibm_init(struct ibm_i
                "%s installed\n", ibm->name);
  
        if (ibm->read) {
 -              mode_t mode = iibm->base_procfs_mode;
 +              umode_t mode = iibm->base_procfs_mode;
  
                if (!mode)
                        mode = S_IRUGO;
diff --combined drivers/sh/intc/core.c
index e85512dd9c72ec4501678081a42fce33144103ad,be5a025eeca3d34706691ea38acaa85d59d6bb80..e53e449b4ecab0b83ab6fe110cb0df4ff8dff963
@@@ -25,7 -25,7 +25,7 @@@
  #include <linux/stat.h>
  #include <linux/interrupt.h>
  #include <linux/sh_intc.h>
 -#include <linux/sysdev.h>
 +#include <linux/device.h>
  #include <linux/syscore_ops.h>
  #include <linux/list.h>
  #include <linux/spinlock.h>
@@@ -354,6 -354,8 +354,8 @@@ int __init register_intc_controller(str
        if (desc->force_enable)
                intc_enable_disable_enum(desc, d, desc->force_enable, 1);
  
+       d->skip_suspend = desc->skip_syscore_suspend;
        nr_intc_controllers++;
  
        return 0;
@@@ -386,6 -388,9 +388,9 @@@ static int intc_suspend(void
        list_for_each_entry(d, &intc_list, list) {
                int irq;
  
+               if (d->skip_suspend)
+                       continue;
                /* enable wakeup irqs belonging to this intc controller */
                for_each_active_irq(irq) {
                        struct irq_data *data;
@@@ -409,6 -414,9 +414,9 @@@ static void intc_resume(void
        list_for_each_entry(d, &intc_list, list) {
                int irq;
  
+               if (d->skip_suspend)
+                       continue;
                for_each_active_irq(irq) {
                        struct irq_data *data;
                        struct irq_chip *chip;
@@@ -434,47 -442,46 +442,47 @@@ struct syscore_ops intc_syscore_ops = 
        .resume         = intc_resume,
  };
  
 -struct sysdev_class intc_sysdev_class = {
 +struct bus_type intc_subsys = {
        .name           = "intc",
 +      .dev_name       = "intc",
  };
  
  static ssize_t
 -show_intc_name(struct sys_device *dev, struct sysdev_attribute *attr, char *buf)
 +show_intc_name(struct device *dev, struct device_attribute *attr, char *buf)
  {
        struct intc_desc_int *d;
  
 -      d = container_of(dev, struct intc_desc_int, sysdev);
 +      d = container_of(dev, struct intc_desc_int, dev);
  
        return sprintf(buf, "%s\n", d->chip.name);
  }
  
 -static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL);
 +static DEVICE_ATTR(name, S_IRUGO, show_intc_name, NULL);
  
 -static int __init register_intc_sysdevs(void)
 +static int __init register_intc_devs(void)
  {
        struct intc_desc_int *d;
        int error;
  
        register_syscore_ops(&intc_syscore_ops);
  
 -      error = sysdev_class_register(&intc_sysdev_class);
 +      error = subsys_system_register(&intc_subsys, NULL);
        if (!error) {
                list_for_each_entry(d, &intc_list, list) {
 -                      d->sysdev.id = d->index;
 -                      d->sysdev.cls = &intc_sysdev_class;
 -                      error = sysdev_register(&d->sysdev);
 +                      d->dev.id = d->index;
 +                      d->dev.bus = &intc_subsys;
 +                      error = device_register(&d->dev);
                        if (error == 0)
 -                              error = sysdev_create_file(&d->sysdev,
 -                                                         &attr_name);
 +                              error = device_create_file(&d->dev,
 +                                                         &dev_attr_name);
                        if (error)
                                break;
                }
        }
  
        if (error)
 -              pr_err("sysdev registration error\n");
 +              pr_err("device registration error\n");
  
        return error;
  }
 -device_initcall(register_intc_sysdevs);
 +device_initcall(register_intc_devs);
index 1c2722e5af3f81076726109b9e8560dddf0c7abc,b3fe1cf25a2805fa7fb2b432ee5b686ae25bac75..b0e9155ff73965bc0da482fb6f86983828ae98c8
@@@ -4,7 -4,7 +4,7 @@@
  #include <linux/kernel.h>
  #include <linux/types.h>
  #include <linux/radix-tree.h>
 -#include <linux/sysdev.h>
 +#include <linux/device.h>
  
  #define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \
        ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \
@@@ -51,7 -51,7 +51,7 @@@ struct intc_subgroup_entry 
  
  struct intc_desc_int {
        struct list_head list;
 -      struct sys_device sysdev;
 +      struct device dev;
        struct radix_tree_root tree;
        raw_spinlock_t lock;
        unsigned int index;
@@@ -67,6 -67,7 +67,7 @@@
        struct intc_window *window;
        unsigned int nr_windows;
        struct irq_chip chip;
+       bool skip_suspend;
  };
  
  
@@@ -157,7 -158,7 +158,7 @@@ void _intc_enable(struct irq_data *data
  extern struct list_head intc_list;
  extern raw_spinlock_t intc_big_lock;
  extern unsigned int nr_intc_controllers;
 -extern struct sysdev_class intc_sysdev_class;
 +extern struct bus_type intc_subsys;
  
  unsigned int intc_get_dfl_prio_level(void);
  unsigned int intc_get_prio_level(unsigned int irq);
diff --combined fs/ext4/super.c
index 6733b3736b3b7a7df7bcbd1c18a7871ca71b19f2,d0666c8d15f27a9df24830e675a9205d3de695fe..64e2529ae9bbd861aca945a609fa7c7fc251d919
@@@ -930,6 -930,7 +930,6 @@@ static int ext4_drop_inode(struct inod
  static void ext4_i_callback(struct rcu_head *head)
  {
        struct inode *inode = container_of(head, struct inode, i_rcu);
 -      INIT_LIST_HEAD(&inode->i_dentry);
        kmem_cache_free(ext4_inode_cachep, EXT4_I(inode));
  }
  
@@@ -1032,11 -1033,11 +1032,11 @@@ static inline void ext4_show_quota_opti
   *  - it's set to a non-default value OR
   *  - if the per-sb default is different from the global default
   */
 -static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
 +static int ext4_show_options(struct seq_file *seq, struct dentry *root)
  {
        int def_errors;
        unsigned long def_mount_opts;
 -      struct super_block *sb = vfs->mnt_sb;
 +      struct super_block *sb = root->d_sb;
        struct ext4_sb_info *sbi = EXT4_SB(sb);
        struct ext4_super_block *es = sbi->s_es;
  
@@@ -2882,8 -2883,7 +2882,7 @@@ cont_thread
                }
                mutex_unlock(&eli->li_list_mtx);
  
-               if (freezing(current))
-                       refrigerator();
+               try_to_freeze();
  
                cur = jiffies;
                if ((time_after_eq(cur, next_wakeup)) ||
@@@ -4781,7 -4781,7 +4780,7 @@@ static int ext4_quota_on(struct super_b
                return -EINVAL;
  
        /* Quotafile not on the same filesystem? */
 -      if (path->mnt->mnt_sb != sb)
 +      if (path->dentry->d_sb != sb)
                return -EXDEV;
        /* Journaling quota? */
        if (EXT4_SB(sb)->s_qf_names[type]) {
diff --combined fs/fs-writeback.c
index 80a4574028f106f76db786033f95972f33e39bab,30f78bb16afb2053134d2b155717ddda3459ce88..e2951506434de6dbeb6bd9e0288b50d0d4977ac9
@@@ -25,6 -25,7 +25,6 @@@
  #include <linux/writeback.h>
  #include <linux/blkdev.h>
  #include <linux/backing-dev.h>
 -#include <linux/buffer_head.h>
  #include <linux/tracepoint.h>
  #include "internal.h"
  
@@@ -936,7 -937,7 +936,7 @@@ int bdi_writeback_thread(void *data
  
        trace_writeback_thread_start(bdi);
  
-       while (!kthread_should_stop()) {
+       while (!kthread_freezable_should_stop(NULL)) {
                /*
                 * Remove own delayed wake-up timer, since we are already awake
                 * and we'll take care of the preriodic write-back.
                         */
                        schedule();
                }
-               try_to_freeze();
        }
  
        /* Flush any work that raced with us exiting */
diff --combined fs/gfs2/log.c
index 2731e657cf7fea043ffedf22b12afee2365da0e8,8154d42e4647b434b584f08abd7a4a159e1b806e..756fae9eaf8f1c724c288daf394458c05ec9cfad
@@@ -626,7 -626,7 +626,7 @@@ static void log_write_header(struct gfs
        if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags))
                submit_bh(WRITE_SYNC | REQ_META | REQ_PRIO, bh);
        else
 -              submit_bh(WRITE_FLUSH_FUA | REQ_META | REQ_PRIO, bh);
 +              submit_bh(WRITE_FLUSH_FUA | REQ_META, bh);
        wait_on_buffer(bh);
  
        if (!buffer_uptodate(bh))
@@@ -951,8 -951,8 +951,8 @@@ int gfs2_logd(void *data
                        wake_up(&sdp->sd_log_waitq);
  
                t = gfs2_tune_get(sdp, gt_logd_secs) * HZ;
-               if (freezing(current))
-                       refrigerator();
+               try_to_freeze();
  
                do {
                        prepare_to_wait(&sdp->sd_logd_waitq, &wait,
diff --combined fs/gfs2/quota.c
index 98a01db1f6dc2d8bb7c3078510b0d591cba707e9,d49669e92652191422a319a9842812f75c19c0ca..a45b21b039157f822d08ba3579f5606e60198977
@@@ -494,11 -494,11 +494,11 @@@ static void qdsb_put(struct gfs2_quota_
  int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid)
  {
        struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
 -      struct gfs2_alloc *al = ip->i_alloc;
 -      struct gfs2_quota_data **qd = al->al_qd;
 +      struct gfs2_qadata *qa = ip->i_qadata;
 +      struct gfs2_quota_data **qd = qa->qa_qd;
        int error;
  
 -      if (gfs2_assert_warn(sdp, !al->al_qd_num) ||
 +      if (gfs2_assert_warn(sdp, !qa->qa_qd_num) ||
            gfs2_assert_warn(sdp, !test_bit(GIF_QD_LOCKED, &ip->i_flags)))
                return -EIO;
  
        error = qdsb_get(sdp, QUOTA_USER, ip->i_inode.i_uid, qd);
        if (error)
                goto out;
 -      al->al_qd_num++;
 +      qa->qa_qd_num++;
        qd++;
  
        error = qdsb_get(sdp, QUOTA_GROUP, ip->i_inode.i_gid, qd);
        if (error)
                goto out;
 -      al->al_qd_num++;
 +      qa->qa_qd_num++;
        qd++;
  
        if (uid != NO_QUOTA_CHANGE && uid != ip->i_inode.i_uid) {
                error = qdsb_get(sdp, QUOTA_USER, uid, qd);
                if (error)
                        goto out;
 -              al->al_qd_num++;
 +              qa->qa_qd_num++;
                qd++;
        }
  
                error = qdsb_get(sdp, QUOTA_GROUP, gid, qd);
                if (error)
                        goto out;
 -              al->al_qd_num++;
 +              qa->qa_qd_num++;
                qd++;
        }
  
@@@ -542,16 -542,16 +542,16 @@@ out
  void gfs2_quota_unhold(struct gfs2_inode *ip)
  {
        struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
 -      struct gfs2_alloc *al = ip->i_alloc;
 +      struct gfs2_qadata *qa = ip->i_qadata;
        unsigned int x;
  
        gfs2_assert_warn(sdp, !test_bit(GIF_QD_LOCKED, &ip->i_flags));
  
 -      for (x = 0; x < al->al_qd_num; x++) {
 -              qdsb_put(al->al_qd[x]);
 -              al->al_qd[x] = NULL;
 +      for (x = 0; x < qa->qa_qd_num; x++) {
 +              qdsb_put(qa->qa_qd[x]);
 +              qa->qa_qd[x] = NULL;
        }
 -      al->al_qd_num = 0;
 +      qa->qa_qd_num = 0;
  }
  
  static int sort_qd(const void *a, const void *b)
@@@ -712,7 -712,7 +712,7 @@@ get_a_page
                set_buffer_uptodate(bh);
  
        if (!buffer_uptodate(bh)) {
 -              ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &bh);
 +              ll_rw_block(READ | REQ_META, 1, &bh);
                wait_on_buffer(bh);
                if (!buffer_uptodate(bh))
                        goto unlock_out;
@@@ -762,6 -762,7 +762,6 @@@ static int do_sync(unsigned int num_qd
        struct gfs2_quota_data *qd;
        loff_t offset;
        unsigned int nalloc = 0, blocks;
 -      struct gfs2_alloc *al = NULL;
        int error;
  
        gfs2_write_calc_reserv(ip, sizeof(struct gfs2_quota),
                        nalloc++;
        }
  
 -      al = gfs2_alloc_get(ip);
 -      if (!al) {
 -              error = -ENOMEM;
 -              goto out_gunlock;
 -      }
        /* 
         * 1 blk for unstuffing inode if stuffed. We add this extra
         * block to the reservation unconditionally. If the inode
         * doesn't need unstuffing, the block will be released to the 
         * rgrp since it won't be allocated during the transaction
         */
 -      al->al_requested = 1;
        /* +3 in the end for unstuffing block, inode size update block
         * and another block in case quota straddles page boundary and 
         * two blocks need to be updated instead of 1 */
        blocks = num_qd * data_blocks + RES_DINODE + num_qd + 3;
  
 -      if (nalloc)
 -              al->al_requested += nalloc * (data_blocks + ind_blocks);                
 -      error = gfs2_inplace_reserve(ip);
 +      error = gfs2_inplace_reserve(ip, 1 +
 +                                   (nalloc * (data_blocks + ind_blocks)));
        if (error)
                goto out_alloc;
  
@@@ -832,6 -840,8 +832,6 @@@ out_end_trans
  out_ipres:
        gfs2_inplace_release(ip);
  out_alloc:
 -      gfs2_alloc_put(ip);
 -out_gunlock:
        gfs2_glock_dq_uninit(&i_gh);
  out:
        while (qx--)
@@@ -915,7 -925,7 +915,7 @@@ fail
  int gfs2_quota_lock(struct gfs2_inode *ip, u32 uid, u32 gid)
  {
        struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
 -      struct gfs2_alloc *al = ip->i_alloc;
 +      struct gfs2_qadata *qa = ip->i_qadata;
        struct gfs2_quota_data *qd;
        unsigned int x;
        int error = 0;
            sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
                return 0;
  
 -      sort(al->al_qd, al->al_qd_num, sizeof(struct gfs2_quota_data *),
 +      sort(qa->qa_qd, qa->qa_qd_num, sizeof(struct gfs2_quota_data *),
             sort_qd, NULL);
  
 -      for (x = 0; x < al->al_qd_num; x++) {
 +      for (x = 0; x < qa->qa_qd_num; x++) {
                int force = NO_FORCE;
 -              qd = al->al_qd[x];
 +              qd = qa->qa_qd[x];
                if (test_and_clear_bit(QDF_REFRESH, &qd->qd_flags))
                        force = FORCE;
 -              error = do_glock(qd, force, &al->al_qd_ghs[x]);
 +              error = do_glock(qd, force, &qa->qa_qd_ghs[x]);
                if (error)
                        break;
        }
                set_bit(GIF_QD_LOCKED, &ip->i_flags);
        else {
                while (x--)
 -                      gfs2_glock_dq_uninit(&al->al_qd_ghs[x]);
 +                      gfs2_glock_dq_uninit(&qa->qa_qd_ghs[x]);
                gfs2_quota_unhold(ip);
        }
  
@@@ -990,7 -1000,7 +990,7 @@@ static int need_sync(struct gfs2_quota_
  
  void gfs2_quota_unlock(struct gfs2_inode *ip)
  {
 -      struct gfs2_alloc *al = ip->i_alloc;
 +      struct gfs2_qadata *qa = ip->i_qadata;
        struct gfs2_quota_data *qda[4];
        unsigned int count = 0;
        unsigned int x;
        if (!test_and_clear_bit(GIF_QD_LOCKED, &ip->i_flags))
                goto out;
  
 -      for (x = 0; x < al->al_qd_num; x++) {
 +      for (x = 0; x < qa->qa_qd_num; x++) {
                struct gfs2_quota_data *qd;
                int sync;
  
 -              qd = al->al_qd[x];
 +              qd = qa->qa_qd[x];
                sync = need_sync(qd);
  
 -              gfs2_glock_dq_uninit(&al->al_qd_ghs[x]);
 +              gfs2_glock_dq_uninit(&qa->qa_qd_ghs[x]);
  
                if (sync && qd_trylock(qd))
                        qda[count++] = qd;
@@@ -1038,7 -1048,7 +1038,7 @@@ static int print_message(struct gfs2_qu
  int gfs2_quota_check(struct gfs2_inode *ip, u32 uid, u32 gid)
  {
        struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
 -      struct gfs2_alloc *al = ip->i_alloc;
 +      struct gfs2_qadata *qa = ip->i_qadata;
        struct gfs2_quota_data *qd;
        s64 value;
        unsigned int x;
          if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
                  return 0;
  
 -      for (x = 0; x < al->al_qd_num; x++) {
 -              qd = al->al_qd[x];
 +      for (x = 0; x < qa->qa_qd_num; x++) {
 +              qd = qa->qa_qd[x];
  
                if (!((qd->qd_id == uid && test_bit(QDF_USER, &qd->qd_flags)) ||
                      (qd->qd_id == gid && !test_bit(QDF_USER, &qd->qd_flags))))
  void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
                       u32 uid, u32 gid)
  {
 -      struct gfs2_alloc *al = ip->i_alloc;
 +      struct gfs2_qadata *qa = ip->i_qadata;
        struct gfs2_quota_data *qd;
        unsigned int x;
  
        if (ip->i_diskflags & GFS2_DIF_SYSTEM)
                return;
  
 -      for (x = 0; x < al->al_qd_num; x++) {
 -              qd = al->al_qd[x];
 +      for (x = 0; x < qa->qa_qd_num; x++) {
 +              qd = qa->qa_qd[x];
  
                if ((qd->qd_id == uid && test_bit(QDF_USER, &qd->qd_flags)) ||
                    (qd->qd_id == gid && !test_bit(QDF_USER, &qd->qd_flags))) {
@@@ -1417,8 -1427,8 +1417,8 @@@ int gfs2_quotad(void *data
                /* Check for & recover partially truncated inodes */
                quotad_check_trunc_list(sdp);
  
-               if (freezing(current))
-                       refrigerator();
+               try_to_freeze();
                t = min(quotad_timeo, statfs_timeo);
  
                prepare_to_wait(&sdp->sd_quota_wait, &wait, TASK_INTERRUPTIBLE);
@@@ -1519,6 -1529,7 +1519,6 @@@ static int gfs2_set_dqblk(struct super_
        unsigned int data_blocks, ind_blocks;
        unsigned int blocks = 0;
        int alloc_required;
 -      struct gfs2_alloc *al;
        loff_t offset;
        int error;
  
        if (gfs2_is_stuffed(ip))
                alloc_required = 1;
        if (alloc_required) {
 -              al = gfs2_alloc_get(ip);
 -              if (al == NULL)
 -                      goto out_i;
                gfs2_write_calc_reserv(ip, sizeof(struct gfs2_quota),
                                       &data_blocks, &ind_blocks);
 -              blocks = al->al_requested = 1 + data_blocks + ind_blocks;
 -              error = gfs2_inplace_reserve(ip);
 +              blocks = 1 + data_blocks + ind_blocks;
 +              error = gfs2_inplace_reserve(ip, blocks);
                if (error)
 -                      goto out_alloc;
 +                      goto out_i;
                blocks += gfs2_rg_blocks(ip);
        }
  
  
        gfs2_trans_end(sdp);
  out_release:
 -      if (alloc_required) {
 +      if (alloc_required)
                gfs2_inplace_release(ip);
 -out_alloc:
 -              gfs2_alloc_put(ip);
 -      }
  out_i:
        gfs2_glock_dq_uninit(&i_gh);
  out_q:
diff --combined fs/nfs/inode.c
index 6f00086e340fab0005e154ec107d4786e05894f5,bf3a57bbbfcf8d493297448cbf13d7d53bfb5ea4..81db25e92e108133ed7995510a9ffe1e48e14137
@@@ -38,6 -38,7 +38,7 @@@
  #include <linux/nfs_xdr.h>
  #include <linux/slab.h>
  #include <linux/compat.h>
+ #include <linux/freezer.h>
  
  #include <asm/system.h>
  #include <asm/uaccess.h>
@@@ -77,7 -78,7 +78,7 @@@ int nfs_wait_bit_killable(void *word
  {
        if (fatal_signal_pending(current))
                return -ERESTARTSYS;
-       schedule();
+       freezable_schedule();
        return 0;
  }
  
@@@ -629,28 -630,23 +630,28 @@@ void nfs_close_context(struct nfs_open_
        nfs_revalidate_inode(server, inode);
  }
  
 -struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred, fmode_t f_mode)
 +struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode)
  {
        struct nfs_open_context *ctx;
 +      struct rpc_cred *cred = rpc_lookup_cred();
 +      if (IS_ERR(cred))
 +              return ERR_CAST(cred);
  
        ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
 -      if (ctx != NULL) {
 -              nfs_sb_active(dentry->d_sb);
 -              ctx->dentry = dget(dentry);
 -              ctx->cred = get_rpccred(cred);
 -              ctx->state = NULL;
 -              ctx->mode = f_mode;
 -              ctx->flags = 0;
 -              ctx->error = 0;
 -              nfs_init_lock_context(&ctx->lock_context);
 -              ctx->lock_context.open_context = ctx;
 -              INIT_LIST_HEAD(&ctx->list);
 +      if (!ctx) {
 +              put_rpccred(cred);
 +              return ERR_PTR(-ENOMEM);
        }
 +      nfs_sb_active(dentry->d_sb);
 +      ctx->dentry = dget(dentry);
 +      ctx->cred = cred;
 +      ctx->state = NULL;
 +      ctx->mode = f_mode;
 +      ctx->flags = 0;
 +      ctx->error = 0;
 +      nfs_init_lock_context(&ctx->lock_context);
 +      ctx->lock_context.open_context = ctx;
 +      INIT_LIST_HEAD(&ctx->list);
        return ctx;
  }
  
@@@ -743,10 -739,15 +744,10 @@@ static void nfs_file_clear_open_context
  int nfs_open(struct inode *inode, struct file *filp)
  {
        struct nfs_open_context *ctx;
 -      struct rpc_cred *cred;
  
 -      cred = rpc_lookup_cred();
 -      if (IS_ERR(cred))
 -              return PTR_ERR(cred);
 -      ctx = alloc_nfs_open_context(filp->f_path.dentry, cred, filp->f_mode);
 -      put_rpccred(cred);
 -      if (ctx == NULL)
 -              return -ENOMEM;
 +      ctx = alloc_nfs_open_context(filp->f_path.dentry, filp->f_mode);
 +      if (IS_ERR(ctx))
 +              return PTR_ERR(ctx);
        nfs_file_set_open_context(filp, ctx);
        put_nfs_open_context(ctx);
        nfs_fscache_set_inode_cookie(inode, filp);
@@@ -1464,6 -1465,7 +1465,6 @@@ struct inode *nfs_alloc_inode(struct su
  static void nfs_i_callback(struct rcu_head *head)
  {
        struct inode *inode = container_of(head, struct inode, i_rcu);
 -      INIT_LIST_HEAD(&inode->i_dentry);
        kmem_cache_free(nfs_inode_cachep, NFS_I(inode));
  }
  
diff --combined fs/xfs/xfs_buf.c
index 2277bcae395f32dd11d5354cdab87c56d9965de7,018829936d6d6a26eea54d0b2bc900b2c70609ca..ce6249dae90c4b218bf98932b69f8122e10c06d5
@@@ -1701,8 -1701,12 +1701,8 @@@ xfsbufd
                struct list_head tmp;
                struct blk_plug plug;
  
 -              if (unlikely(freezing(current))) {
 -                      set_bit(XBT_FORCE_SLEEP, &target->bt_flags);
 +              if (unlikely(freezing(current)))
-                       refrigerator();
+                       try_to_freeze();
 -              } else {
 -                      clear_bit(XBT_FORCE_SLEEP, &target->bt_flags);
 -              }
  
                /* sleep for a long time if there is nothing to do. */
                if (list_empty(&target->bt_delwri_queue))
index 5622fa24e97ba21a44d6bbb5c65fd435a63f3333,b5267c9511610b60dfd83e35f212bde5007f3c85..60e9994ef4053ef120ff65def32de3c2940a2d9f
@@@ -63,7 -63,7 +63,7 @@@ struct platform_device_info 
                u64 dma_mask;
  };
  extern struct platform_device *platform_device_register_full(
 -              struct platform_device_info *pdevinfo);
 +              const struct platform_device_info *pdevinfo);
  
  /**
   * platform_device_register_resndata - add a platform-level device with
@@@ -196,8 -196,16 +196,8 @@@ static inline void platform_set_drvdata
   * calling it replaces module_init() and module_exit()
   */
  #define module_platform_driver(__platform_driver) \
 -static int __init __platform_driver##_init(void) \
 -{ \
 -      return platform_driver_register(&(__platform_driver)); \
 -} \
 -module_init(__platform_driver##_init); \
 -static void __exit __platform_driver##_exit(void) \
 -{ \
 -      platform_driver_unregister(&(__platform_driver)); \
 -} \
 -module_exit(__platform_driver##_exit);
 +      module_driver(__platform_driver, platform_driver_register, \
 +                      platform_driver_unregister)
  
  extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
                                        int (*probe)(struct platform_device *),
@@@ -256,62 -264,34 +256,34 @@@ static inline char *early_platform_driv
  }
  #endif /* MODULE */
  
- #ifdef CONFIG_PM_SLEEP
- extern int platform_pm_prepare(struct device *dev);
- extern void platform_pm_complete(struct device *dev);
- #else
- #define platform_pm_prepare   NULL
- #define platform_pm_complete  NULL
- #endif
  #ifdef CONFIG_SUSPEND
  extern int platform_pm_suspend(struct device *dev);
- extern int platform_pm_suspend_noirq(struct device *dev);
  extern int platform_pm_resume(struct device *dev);
- extern int platform_pm_resume_noirq(struct device *dev);
  #else
  #define platform_pm_suspend           NULL
  #define platform_pm_resume            NULL
- #define platform_pm_suspend_noirq     NULL
- #define platform_pm_resume_noirq      NULL
  #endif
  
  #ifdef CONFIG_HIBERNATE_CALLBACKS
  extern int platform_pm_freeze(struct device *dev);
- extern int platform_pm_freeze_noirq(struct device *dev);
  extern int platform_pm_thaw(struct device *dev);
- extern int platform_pm_thaw_noirq(struct device *dev);
  extern int platform_pm_poweroff(struct device *dev);
- extern int platform_pm_poweroff_noirq(struct device *dev);
  extern int platform_pm_restore(struct device *dev);
- extern int platform_pm_restore_noirq(struct device *dev);
  #else
  #define platform_pm_freeze            NULL
  #define platform_pm_thaw              NULL
  #define platform_pm_poweroff          NULL
  #define platform_pm_restore           NULL
- #define platform_pm_freeze_noirq      NULL
- #define platform_pm_thaw_noirq                NULL
- #define platform_pm_poweroff_noirq    NULL
- #define platform_pm_restore_noirq     NULL
  #endif
  
  #ifdef CONFIG_PM_SLEEP
  #define USE_PLATFORM_PM_SLEEP_OPS \
-       .prepare = platform_pm_prepare, \
-       .complete = platform_pm_complete, \
        .suspend = platform_pm_suspend, \
        .resume = platform_pm_resume, \
        .freeze = platform_pm_freeze, \
        .thaw = platform_pm_thaw, \
        .poweroff = platform_pm_poweroff, \
-       .restore = platform_pm_restore, \
-       .suspend_noirq = platform_pm_suspend_noirq, \
-       .resume_noirq = platform_pm_resume_noirq, \
-       .freeze_noirq = platform_pm_freeze_noirq, \
-       .thaw_noirq = platform_pm_thaw_noirq, \
-       .poweroff_noirq = platform_pm_poweroff_noirq, \
-       .restore_noirq = platform_pm_restore_noirq,
+       .restore = platform_pm_restore,
  #else
  #define USE_PLATFORM_PM_SLEEP_OPS
  #endif
diff --combined include/linux/sched.h
index cf0eb342bcbad5f2fd9870140591e1a01363c112,d81cce933869641913050bef05ba017ac3d2bf77..ad93e1ec8c656a38d8b1a1e8159896b387b3c3cb
@@@ -220,7 -220,7 +220,7 @@@ extern char ___assert_task_state[1 - 2*
                        ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0)
  #define task_contributes_to_load(task)        \
                                ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \
-                                (task->flags & PF_FREEZING) == 0)
+                                (task->flags & PF_FROZEN) == 0)
  
  #define __set_task_state(tsk, state_value)            \
        do { (tsk)->state = (state_value); } while (0)
@@@ -273,11 -273,9 +273,11 @@@ extern int runqueue_is_locked(int cpu)
  
  #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
  extern void select_nohz_load_balancer(int stop_tick);
 +extern void set_cpu_sd_state_idle(void);
  extern int get_nohz_timer_target(void);
  #else
  static inline void select_nohz_load_balancer(int stop_tick) { }
 +static inline void set_cpu_sd_state_idle(void) { }
  #endif
  
  /*
@@@ -485,8 -483,8 +485,8 @@@ struct task_cputime 
  
  #define INIT_CPUTIME  \
        (struct task_cputime) {                                 \
 -              .utime = cputime_zero,                          \
 -              .stime = cputime_zero,                          \
 +              .utime = 0,                                     \
 +              .stime = 0,                                     \
                .sum_exec_runtime = 0,                          \
        }
  
@@@ -903,10 -901,6 +903,10 @@@ struct sched_group_power 
         * single CPU.
         */
        unsigned int power, power_orig;
 +      /*
 +       * Number of busy cpus in this group.
 +       */
 +      atomic_t nr_busy_cpus;
  };
  
  struct sched_group {
@@@ -931,15 -925,6 +931,15 @@@ static inline struct cpumask *sched_gro
        return to_cpumask(sg->cpumask);
  }
  
 +/**
 + * group_first_cpu - Returns the first cpu in the cpumask of a sched_group.
 + * @group: The group whose first cpu is to be returned.
 + */
 +static inline unsigned int group_first_cpu(struct sched_group *group)
 +{
 +      return cpumask_first(sched_group_cpus(group));
 +}
 +
  struct sched_domain_attr {
        int relax_domain_level;
  };
@@@ -1330,8 -1315,8 +1330,8 @@@ struct task_struct 
         * older sibling, respectively.  (p->father can be replaced with 
         * p->real_parent->pid)
         */
 -      struct task_struct *real_parent; /* real parent process */
 -      struct task_struct *parent; /* recipient of SIGCHLD, wait4() reports */
 +      struct task_struct __rcu *real_parent; /* real parent process */
 +      struct task_struct __rcu *parent; /* recipient of SIGCHLD, wait4() reports */
        /*
         * children/sibling forms the list of my natural children
         */
@@@ -1787,7 -1772,6 +1787,6 @@@ extern void thread_group_times(struct t
  #define PF_MEMALLOC   0x00000800      /* Allocating memory */
  #define PF_NPROC_EXCEEDED 0x00001000  /* set_user noticed that RLIMIT_NPROC was exceeded */
  #define PF_USED_MATH  0x00002000      /* if unset the fpu must be initialized before use */
- #define PF_FREEZING   0x00004000      /* freeze in progress. do not account to load */
  #define PF_NOFREEZE   0x00008000      /* this thread should not be frozen */
  #define PF_FROZEN     0x00010000      /* frozen for system suspend */
  #define PF_FSTRANS    0x00020000      /* inside a filesystem transaction */
  #define PF_MEMPOLICY  0x10000000      /* Non-default NUMA mempolicy */
  #define PF_MUTEX_TESTER       0x20000000      /* Thread belongs to the rt mutex tester */
  #define PF_FREEZER_SKIP       0x40000000      /* Freezer should not count it as freezable */
- #define PF_FREEZER_NOSIG 0x80000000   /* Freezer won't send signals to it */
  
  /*
   * Only the _current_ task can read/write to tsk->flags, but other
@@@ -2085,14 -2068,6 +2083,14 @@@ extern int sched_setscheduler(struct ta
  extern int sched_setscheduler_nocheck(struct task_struct *, int,
                                      const struct sched_param *);
  extern struct task_struct *idle_task(int cpu);
 +/**
 + * is_idle_task - is the specified task an idle task?
 + * @tsk: the task in question.
 + */
 +static inline bool is_idle_task(struct task_struct *p)
 +{
 +      return p->pid == 0;
 +}
  extern struct task_struct *curr_task(int cpu);
  extern void set_curr_task(int cpu, struct task_struct *p);
  
diff --combined kernel/cpu.c
index 5ca38d5d238a1a376f1799e892f069afe0115369,cf915b86a5fbc2c3fcffba1f125fe3e1afd56855..2060c6e570276e0cd8b5972b9387b9153cf8d195
@@@ -178,7 -178,8 +178,7 @@@ static inline void check_for_tasks(int 
        write_lock_irq(&tasklist_lock);
        for_each_process(p) {
                if (task_cpu(p) == cpu && p->state == TASK_RUNNING &&
 -                  (!cputime_eq(p->utime, cputime_zero) ||
 -                   !cputime_eq(p->stime, cputime_zero)))
 +                  (p->utime || p->stime))
                        printk(KERN_WARNING "Task %s (pid = %d) is on cpu %d "
                                "(state = %ld, flags = %x)\n",
                                p->comm, task_pid_nr(p), cpu,
@@@ -379,7 -380,6 +379,7 @@@ out
        cpu_maps_update_done();
        return err;
  }
 +EXPORT_SYMBOL_GPL(cpu_up);
  
  #ifdef CONFIG_PM_SLEEP_SMP
  static cpumask_var_t frozen_cpus;
@@@ -470,7 -470,7 +470,7 @@@ out
        cpu_maps_update_done();
  }
  
- static int alloc_frozen_cpus(void)
+ static int __init alloc_frozen_cpus(void)
  {
        if (!alloc_cpumask_var(&frozen_cpus, GFP_KERNEL|__GFP_ZERO))
                return -ENOMEM;
@@@ -543,7 -543,7 +543,7 @@@ cpu_hotplug_pm_callback(struct notifier
  }
  
  
int cpu_hotplug_pm_sync_init(void)
static int __init cpu_hotplug_pm_sync_init(void)
  {
        pm_notifier(cpu_hotplug_pm_callback, 0);
        return 0;
diff --combined kernel/exit.c
index d579a459309dbdbd056a31241e01503ddf8cb6d8,95a4141d07e7ba4c87e478a77e5555d69c8e0253..d9eab2e4b430a08a33a13e93f31a6d37a5d15794
@@@ -121,9 -121,9 +121,9 @@@ static void __exit_signal(struct task_s
                 * We won't ever get here for the group leader, since it
                 * will have been the last reference on the signal_struct.
                 */
 -              sig->utime = cputime_add(sig->utime, tsk->utime);
 -              sig->stime = cputime_add(sig->stime, tsk->stime);
 -              sig->gtime = cputime_add(sig->gtime, tsk->gtime);
 +              sig->utime += tsk->utime;
 +              sig->stime += tsk->stime;
 +              sig->gtime += tsk->gtime;
                sig->min_flt += tsk->min_flt;
                sig->maj_flt += tsk->maj_flt;
                sig->nvcsw += tsk->nvcsw;
@@@ -679,8 -679,6 +679,6 @@@ static void exit_mm(struct task_struct 
        tsk->mm = NULL;
        up_read(&mm->mmap_sem);
        enter_lazy_tlb(mm, current);
-       /* We don't want this task to be frozen prematurely */
-       clear_freeze_flag(tsk);
        task_unlock(tsk);
        mm_update_next_owner(mm);
        mmput(mm);
@@@ -1040,6 -1038,7 +1038,7 @@@ NORET_TYPE void do_exit(long code
        exit_rcu();
        /* causes final put_task_struct in finish_task_switch(). */
        tsk->state = TASK_DEAD;
+       tsk->flags |= PF_NOFREEZE;      /* tell freezer to ignore us */
        schedule();
        BUG();
        /* Avoid "noreturn function does return".  */
@@@ -1255,9 -1254,19 +1254,9 @@@ static int wait_task_zombie(struct wait
                spin_lock_irq(&p->real_parent->sighand->siglock);
                psig = p->real_parent->signal;
                sig = p->signal;
 -              psig->cutime =
 -                      cputime_add(psig->cutime,
 -                      cputime_add(tgutime,
 -                                  sig->cutime));
 -              psig->cstime =
 -                      cputime_add(psig->cstime,
 -                      cputime_add(tgstime,
 -                                  sig->cstime));
 -              psig->cgtime =
 -                      cputime_add(psig->cgtime,
 -                      cputime_add(p->gtime,
 -                      cputime_add(sig->gtime,
 -                                  sig->cgtime)));
 +              psig->cutime += tgutime + sig->cutime;
 +              psig->cstime += tgstime + sig->cstime;
 +              psig->cgtime += p->gtime + sig->gtime + sig->cgtime;
                psig->cmin_flt +=
                        p->min_flt + sig->min_flt + sig->cmin_flt;
                psig->cmaj_flt +=
@@@ -1530,15 -1539,8 +1529,15 @@@ static int wait_consider_task(struct wa
        }
  
        /* dead body doesn't have much to contribute */
 -      if (p->exit_state == EXIT_DEAD)
 +      if (unlikely(p->exit_state == EXIT_DEAD)) {
 +              /*
 +               * But do not ignore this task until the tracer does
 +               * wait_task_zombie()->do_notify_parent().
 +               */
 +              if (likely(!ptrace) && unlikely(ptrace_reparented(p)))
 +                      wo->notask_error = 0;
                return 0;
 +      }
  
        /* slay zombie? */
        if (p->exit_state == EXIT_ZOMBIE) {
diff --combined kernel/fork.c
index b058c5820ecd9f0dacaa66db83150e5f2510083f,827808613847dc7263199d85cdf4f2b1f14520a3..f34f894c4b980e60f3acbadca701e6cca017e5f8
@@@ -992,7 -992,6 +992,6 @@@ static void copy_flags(unsigned long cl
        new_flags |= PF_FORKNOEXEC;
        new_flags |= PF_STARTING;
        p->flags = new_flags;
-       clear_freeze_flag(p);
  }
  
  SYSCALL_DEFINE1(set_tid_address, int __user *, tidptr)
@@@ -1023,8 -1022,8 +1022,8 @@@ void mm_init_owner(struct mm_struct *mm
   */
  static void posix_cpu_timers_init(struct task_struct *tsk)
  {
 -      tsk->cputime_expires.prof_exp = cputime_zero;
 -      tsk->cputime_expires.virt_exp = cputime_zero;
 +      tsk->cputime_expires.prof_exp = 0;
 +      tsk->cputime_expires.virt_exp = 0;
        tsk->cputime_expires.sched_exp = 0;
        INIT_LIST_HEAD(&tsk->cpu_timers[0]);
        INIT_LIST_HEAD(&tsk->cpu_timers[1]);
@@@ -1132,10 -1131,14 +1131,10 @@@ static struct task_struct *copy_process
  
        init_sigpending(&p->pending);
  
 -      p->utime = cputime_zero;
 -      p->stime = cputime_zero;
 -      p->gtime = cputime_zero;
 -      p->utimescaled = cputime_zero;
 -      p->stimescaled = cputime_zero;
 +      p->utime = p->stime = p->gtime = 0;
 +      p->utimescaled = p->stimescaled = 0;
  #ifndef CONFIG_VIRT_CPU_ACCOUNTING
 -      p->prev_utime = cputime_zero;
 -      p->prev_stime = cputime_zero;
 +      p->prev_utime = p->prev_stime = 0;
  #endif
  #if defined(SPLIT_RSS_COUNTING)
        memset(&p->rss_stat, 0, sizeof(p->rss_stat));
This page took 0.290385 seconds and 4 git commands to generate.