lkml.org 
[lkml]   [2020]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/4] ALSA: hda: Separate runtime and system suspend
On Tue, 27 Oct 2020 06:40:00 +0100,
Kai-Heng Feng wrote:
> @@ -1002,7 +1001,8 @@ static void __azx_runtime_resume(struct azx *chip, bool from_rt)
> azx_init_pci(chip);
> hda_intel_init_chip(chip, true);
>
> - if (from_rt) {
> + /* Avoid codec resume if runtime resume is for system suspend */
> + if (from_rt && !chip->prepared) {

The check of chip->prepared is superfluous here. Its check should be
applied rather at setting WAKEEN, namely...

> @@ -1103,10 +1115,8 @@ static int azx_runtime_suspend(struct device *dev)
> chip = card->private_data;
>
> /* enable controller wake up event */
> - if (snd_power_get_state(card) == SNDRV_CTL_POWER_D0) {
> - azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) |
> - STATESTS_INT_MASK);
> - }
> + azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) |
> + STATESTS_INT_MASK);

... here we should have the check of chip->prepared, and set WAKEEN
only when it's false. Otherwise WAKEEN is set up for the system
suspend, and it might lead to spurious wakeups. (IOW, checking the
flag at resume doesn't help for preventing the spurious wakeup :)


thanks,

Takashi

\
 
 \ /
  Last update: 2020-10-27 08:47    [W:0.549 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site