diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-12-12 05:50:12 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-12-12 08:22:13 -0500 |
commit | 6eb827d23577a4efec2b10a9c4cc9ded268a1d1c (patch) | |
tree | 15da2e13f08a9f56215397ebea3cd60b7c1dfd6c /sound | |
parent | 63a077e27648b4043b1ca1b4e29f0c42d99616b6 (diff) |
ALSA: hda - Move runtime PM check to runtime_idle callback
The runtime_idle callback is the right place to check the suspend
capability, but currently we do it wrongly in the runtime_suspend
callback. This leads to a kernel error message like:
pci_pm_runtime_suspend(): azx_runtime_suspend+0x0/0x50 [snd_hda_intel] returns -11
and the runtime PM core would even repeat the attempts.
Reported-and-tested-by: Borislav Petkov <bp@alien8.de>
Cc: <stable@vger.kernel.org> [v3.7]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_intel.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 1da8a5c9b9e1..0f3d3db0df71 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -2691,10 +2691,6 @@ static int azx_runtime_suspend(struct device *dev) | |||
2691 | struct snd_card *card = dev_get_drvdata(dev); | 2691 | struct snd_card *card = dev_get_drvdata(dev); |
2692 | struct azx *chip = card->private_data; | 2692 | struct azx *chip = card->private_data; |
2693 | 2693 | ||
2694 | if (!power_save_controller || | ||
2695 | !(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) | ||
2696 | return -EAGAIN; | ||
2697 | |||
2698 | azx_stop_chip(chip); | 2694 | azx_stop_chip(chip); |
2699 | azx_clear_irq_pending(chip); | 2695 | azx_clear_irq_pending(chip); |
2700 | return 0; | 2696 | return 0; |
@@ -2709,12 +2705,25 @@ static int azx_runtime_resume(struct device *dev) | |||
2709 | azx_init_chip(chip, 1); | 2705 | azx_init_chip(chip, 1); |
2710 | return 0; | 2706 | return 0; |
2711 | } | 2707 | } |
2708 | |||
2709 | static int azx_runtime_idle(struct device *dev) | ||
2710 | { | ||
2711 | struct snd_card *card = dev_get_drvdata(dev); | ||
2712 | struct azx *chip = card->private_data; | ||
2713 | |||
2714 | if (!power_save_controller || | ||
2715 | !(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) | ||
2716 | return -EBUSY; | ||
2717 | |||
2718 | return 0; | ||
2719 | } | ||
2720 | |||
2712 | #endif /* CONFIG_PM_RUNTIME */ | 2721 | #endif /* CONFIG_PM_RUNTIME */ |
2713 | 2722 | ||
2714 | #ifdef CONFIG_PM | 2723 | #ifdef CONFIG_PM |
2715 | static const struct dev_pm_ops azx_pm = { | 2724 | static const struct dev_pm_ops azx_pm = { |
2716 | SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume) | 2725 | SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume) |
2717 | SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, NULL) | 2726 | SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle) |
2718 | }; | 2727 | }; |
2719 | 2728 | ||
2720 | #define AZX_PM_OPS &azx_pm | 2729 | #define AZX_PM_OPS &azx_pm |