ALSA: HDA: Fix HDA resume
Sumit Bhattacharya [Tue, 25 Jun 2013 12:47:52 +0000 (17:47 +0530)]
Remove deprecated CONFIG_SND_HDA_POWER_SAVE. Also increment pm
runtime sync reference count from azx_resume to ensure runtime
suspend is called only when pm_notify gets called.

Without this change HDA runtime suspend gets called just after
HDA resume and HDA controller is powered down and when power
worker queue tries to power down HDA after some time HDA driver
hangs.

Bug 1312405

Change-Id: I55580f8a9c6f9ff18b41ab0195c21e841f2228b2
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/241936
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

sound/pci/hda/hda_intel.c

index b1ac192..05e0295 100644 (file)
@@ -3104,8 +3104,7 @@ static int azx_suspend(struct device *dev)
        if (chip->disabled)
                return 0;
 
-#if defined(CONFIG_SND_HDA_PLATFORM_DRIVER) && \
-       defined(CONFIG_SND_HDA_POWER_SAVE)
+#if defined(CONFIG_SND_HDA_PLATFORM_DRIVER)
        if (chip->pdev)
                azx_platform_enable_clocks(chip);
 #endif
@@ -3170,6 +3169,7 @@ static int azx_resume(struct device *dev)
        } else if (chip->pdev) {
                pm_runtime_disable(chip->dev);
                pm_runtime_set_active(chip->dev);
+               pm_runtime_get_noresume(chip->dev);
                pm_runtime_enable(chip->dev);
        }
 
@@ -3189,12 +3189,6 @@ static int azx_resume(struct device *dev)
        snd_hda_resume(chip->bus);
        snd_power_change_state(card, SNDRV_CTL_POWER_D0);
 
-#if defined(CONFIG_SND_HDA_PLATFORM_DRIVER) && \
-       defined(CONFIG_SND_HDA_POWER_SAVE)
-       if (chip->pdev)
-               azx_platform_disable_clocks(chip);
-#endif
-
        return 0;
 }
 #endif /* CONFIG_PM_SLEEP || SUPPORT_VGA_SWITCHEROO */
@@ -3259,8 +3253,7 @@ static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf)
 {
        struct azx *chip = container_of(nb, struct azx, reboot_notifier);
 
-#if defined(CONFIG_SND_HDA_PLATFORM_DRIVER) && \
-       defined(CONFIG_SND_HDA_POWER_SAVE)
+#if defined(CONFIG_SND_HDA_PLATFORM_DRIVER)
        if (chip->pdev)
                azx_platform_enable_clocks(chip);
 #endif
@@ -3268,8 +3261,7 @@ static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf)
        snd_hda_bus_reboot_notify(chip->bus);
        azx_stop_chip(chip);
 
-#if defined(CONFIG_SND_HDA_PLATFORM_DRIVER) && \
-       defined(CONFIG_SND_HDA_POWER_SAVE)
+#if defined(CONFIG_SND_HDA_PLATFORM_DRIVER)
        if (chip->pdev)
                azx_platform_disable_clocks(chip);
 #endif