lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <585925F6-8262-41BB-A21D-EBCE6EBF9B5D@canonical.com>
Date:   Tue, 27 Oct 2020 16:24:32 +0800
From:   Kai-Heng Feng <kai.heng.feng@...onical.com>
To:     Takashi Iwai <tiwai@...e.de>
Cc:     tiwai@...e.com, perex@...ex.cz, hui.wang@...onical.com,
        kai.vehmanen@...ux.intel.com, alsa-devel@...a-project.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/4] ALSA: hda: Separate runtime and system suspend



> On Oct 27, 2020, at 16:15, Takashi Iwai <tiwai@...e.de> wrote:
> 
> On Tue, 27 Oct 2020 09:12:07 +0100,
> Takashi Iwai wrote:
>> 
>> On Tue, 27 Oct 2020 08:46:05 +0100,
>> Takashi Iwai wrote:
>>>> @@ -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 :)
>> 
>> Scratch my comment above; it's the code path only for the runtime
>> suspend in your new code, then this cleanup makes sense.
> 
> Also, as one more cleanup: from_rt in __azx_runtime_resume() can be
> replaced with !chip->prepared flag, so the extra argument can be
> dropped.

Ok, will send v3 to address it.

Kai-Heng

> 
> 
> Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ