Commit b8b90c1
ALSA: hda: update the power_state during the direct-complete
The patch_realtek.c needs to check if the power_state.event equals
PM_EVENT_SUSPEND, after using the direct-complete, the suspend() and
resume() will be skipped if the codec is already rt_suspended, in this
case, the patch_realtek.c will always get PM_EVENT_ON even the system
is really resumed from S3.
We could set power_state to PMSG_SUSPEND in the prepare(), if other
PM functions are called before complete(), those functions will
override power_state; if no other PM functions are called before
complete(), we could know the suspend() and resume() are skipped since
only S3 pm functions could be skipped by direct-complete, in this case
set power_state to PMSG_RESUME in the complete(). This could guarantee
the first time of calling hda_codec_runtime_resume() after complete()
has the correct power_state.
Fixes: 215a22e ("ALSA: hda: Refactor codec PM to use direct-complete optimization")
Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Link: https://lore.kernel.org/r/20210602145424.3132-1-hui.wang@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>1 parent 9c1fe96 commit b8b90c1
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2917 | 2917 | | |
2918 | 2918 | | |
2919 | 2919 | | |
| 2920 | + | |
2920 | 2921 | | |
2921 | 2922 | | |
2922 | 2923 | | |
2923 | 2924 | | |
2924 | 2925 | | |
2925 | 2926 | | |
2926 | 2927 | | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
2927 | 2932 | | |
2928 | 2933 | | |
2929 | 2934 | | |
| |||
0 commit comments