summaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorSumit Bhattacharya <sumitb@nvidia.com>2011-12-15 18:33:06 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2012-03-23 16:00:47 -0700
commit8d2d40a27e575f35498a8d4a6d027c838e0a52e1 (patch)
tree090eca898c336b80396236c1ef913f9081a85294 /sound/pci
parent3d96e9f2ca7bb82ba18cdcbb224ac41e21e592be (diff)
ALSA: HDA: Disable all references of clocks at end of suspend
HDA driver used to enable clocks during suspend only if there is no active clock. But this logic causes a race condition when hda codec power work thread disables the active instance of hda clocks in middle of suspend. To avoid this race condition always enable HDA clocks at start of suspend operation and disable all active references of HDA clocks at end of suspend. Since HDA driver suspend also suspends all active codecs there is no chance of getting HDA clock disable call after completion of suspend. Bug 915436 Change-Id: I4956ba28488d6d445ea2d53fb2592897a2ad83bb Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-on: http://git-master/r/70315 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Scott Peterson <speterson@nvidia.com> Rebase-Id: Rd18fd4b147208bd88343fe117381cb6045f194bc
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_intel.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 146461627187..c5a64582a30e 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2539,7 +2539,7 @@ static int azx_suspend(struct azx *chip, pm_message_t state)
#if defined(CONFIG_SND_HDA_PLATFORM_DRIVER) && \
defined(CONFIG_SND_HDA_POWER_SAVE)
- if (!chip->platform_clk_enable)
+ if (chip->pdev)
azx_platform_enable_clocks(chip);
#endif
@@ -2565,8 +2565,11 @@ static int azx_suspend(struct azx *chip, pm_message_t state)
}
#ifdef CONFIG_SND_HDA_PLATFORM_DRIVER
- if (chip->pdev)
- azx_platform_disable_clocks(chip);
+ if (chip->pdev) {
+ /* Disable all clk references */
+ while (chip->platform_clk_enable)
+ azx_platform_disable_clocks(chip);
+ }
#endif
return 0;