Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
Linus Torvalds [Thu, 20 May 2010 16:03:55 +0000 (09:03 -0700)]
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
  PM: PM QOS update fix
  Freezer / cgroup freezer: Update stale locking comments
  PM / platform_bus: Allow runtime PM by default
  i2c: Fix bus-level power management callbacks
  PM QOS update
  PM / Hibernate: Fix block_io.c printk warning
  PM / Hibernate: Group swap ops
  PM / Hibernate: Move the first_sector out of swsusp_write
  PM / Hibernate: Separate block_io
  PM / Hibernate: Snapshot cleanup
  FS / libfs: Implement simple_write_to_buffer
  PM / Hibernate: document open(/dev/snapshot) side effects
  PM / Runtime: Add sysfs debug files
  PM: Improve device power management document
  PM: Update device power management document
  PM: Allow runtime_suspend methods to call pm_schedule_suspend()
  PM: pm_wakeup - switch to using bool

1  2 
drivers/base/platform.c
net/mac80211/mlme.c
sound/core/pcm_native.c

diff --combined drivers/base/platform.c
@@@ -187,7 -187,7 +187,7 @@@ EXPORT_SYMBOL_GPL(platform_device_alloc
   * released.
   */
  int platform_device_add_resources(struct platform_device *pdev,
 -                                struct resource *res, unsigned int num)
 +                                const struct resource *res, unsigned int num)
  {
        struct resource *r;
  
@@@ -367,7 -367,7 +367,7 @@@ EXPORT_SYMBOL_GPL(platform_device_unreg
   */
  struct platform_device *platform_device_register_simple(const char *name,
                                                        int id,
 -                                                      struct resource *res,
 +                                                      const struct resource *res,
                                                        unsigned int num)
  {
        struct platform_device *pdev;
@@@ -967,17 -967,17 +967,17 @@@ static int platform_pm_restore_noirq(st
  
  int __weak platform_pm_runtime_suspend(struct device *dev)
  {
-       return -ENOSYS;
+       return pm_generic_runtime_suspend(dev);
  };
  
  int __weak platform_pm_runtime_resume(struct device *dev)
  {
-       return -ENOSYS;
+       return pm_generic_runtime_resume(dev);
  };
  
  int __weak platform_pm_runtime_idle(struct device *dev)
  {
-       return -ENOSYS;
+       return pm_generic_runtime_idle(dev);
  };
  
  #else /* !CONFIG_PM_RUNTIME */
@@@ -1254,26 -1254,6 +1254,26 @@@ static int __init early_platform_driver
                }
  
                if (match) {
 +                      /*
 +                       * Set up a sensible init_name to enable
 +                       * dev_name() and others to be used before the
 +                       * rest of the driver core is initialized.
 +                       */
 +                      if (!match->dev.init_name && slab_is_available()) {
 +                              if (match->id != -1)
 +                                      match->dev.init_name =
 +                                              kasprintf(GFP_KERNEL, "%s.%d",
 +                                                        match->name,
 +                                                        match->id);
 +                              else
 +                                      match->dev.init_name =
 +                                              kasprintf(GFP_KERNEL, "%s",
 +                                                        match->name);
 +
 +                              if (!match->dev.init_name)
 +                                      return -ENOMEM;
 +                      }
 +
                        if (epdrv->pdrv->probe(match))
                                pr_warning("%s: unable to probe %s early.\n",
                                           class_str, match->name);
diff --combined net/mac80211/mlme.c
@@@ -495,7 -495,7 +495,7 @@@ void ieee80211_recalc_ps(struct ieee802
                s32 beaconint_us;
  
                if (latency < 0)
-                       latency = pm_qos_requirement(PM_QOS_NETWORK_LATENCY);
+                       latency = pm_qos_request(PM_QOS_NETWORK_LATENCY);
  
                beaconint_us = ieee80211_tu_to_usec(
                                        found->vif.bss_conf.beacon_int);
@@@ -2030,8 -2030,7 +2030,8 @@@ int ieee80211_mgd_deauth(struct ieee802
                                continue;
  
                        if (wk->type != IEEE80211_WORK_DIRECT_PROBE &&
 -                          wk->type != IEEE80211_WORK_AUTH)
 +                          wk->type != IEEE80211_WORK_AUTH &&
 +                          wk->type != IEEE80211_WORK_ASSOC)
                                continue;
  
                        if (memcmp(req->bss->bssid, wk->filter_ta, ETH_ALEN))
diff --combined sound/core/pcm_native.c
@@@ -36,9 -36,6 +36,9 @@@
  #include <sound/timer.h>
  #include <sound/minors.h>
  #include <asm/io.h>
 +#if defined(CONFIG_MIPS) && defined(CONFIG_DMA_NONCOHERENT)
 +#include <dma-coherence.h>
 +#endif
  
  /*
   *  Compatibility
@@@ -484,11 -481,13 +484,13 @@@ static int snd_pcm_hw_params(struct snd
        snd_pcm_timer_resolution_change(substream);
        runtime->status->state = SNDRV_PCM_STATE_SETUP;
  
-       pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY,
-                               substream->latency_id);
+       if (substream->latency_pm_qos_req) {
+               pm_qos_remove_request(substream->latency_pm_qos_req);
+               substream->latency_pm_qos_req = NULL;
+       }
        if ((usecs = period_to_usecs(runtime)) >= 0)
-               pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY,
-                                       substream->latency_id, usecs);
+               substream->latency_pm_qos_req = pm_qos_add_request(
+                                       PM_QOS_CPU_DMA_LATENCY, usecs);
        return 0;
   _error:
        /* hardware might be unuseable from this time,
@@@ -543,8 -542,8 +545,8 @@@ static int snd_pcm_hw_free(struct snd_p
        if (substream->ops->hw_free)
                result = substream->ops->hw_free(substream);
        runtime->status->state = SNDRV_PCM_STATE_OPEN;
-       pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY,
-               substream->latency_id);
+       pm_qos_remove_request(substream->latency_pm_qos_req);
+       substream->latency_pm_qos_req = NULL;
        return result;
  }
  
@@@ -3187,10 -3186,6 +3189,10 @@@ static int snd_pcm_default_mmap(struct 
                                         substream->runtime->dma_area,
                                         substream->runtime->dma_addr,
                                         area->vm_end - area->vm_start);
 +#elif defined(CONFIG_MIPS) && defined(CONFIG_DMA_NONCOHERENT)
 +      if (substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV &&
 +          !plat_device_is_coherent(substream->dma_buffer.dev.dev))
 +              area->vm_page_prot = pgprot_noncached(area->vm_page_prot);
  #endif /* ARCH_HAS_DMA_MMAP_COHERENT */
        /* mmap with fault handler */
        area->vm_ops = &snd_pcm_vm_ops_data_fault;