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] [day] [month] [year] [list]
Message-ID: <s5hlezvjz1u.wl-tiwai@suse.de>
Date:   Tue, 04 Jan 2022 16:33:33 +0100
From:   Takashi Iwai <tiwai@...e.de>
To:     "Christian A. Ehrhardt" <cae@...ilie-ehrhardt.de>
Cc:     alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
        Lucas Tanure <tanureal@...nsource.cirrus.com>,
        Stefan Binding <sbinding@...nsource.cirrus.com>,
        Vitaly Rodionov <vitalyr@...nsource.cirrus.com>,
        Takashi Iwai <tiwai@...e.com>, Jaroslav Kysela <perex@...ex.cz>
Subject: Re: hda/cs8904: Fix jack detection after resume

On Fri, 31 Dec 2021 14:44:32 +0100,
Christian A. Ehrhardt wrote:
> 
> 
> Hi,
> 
> while debugging something different, I found the following
> jack detection related bug in the cs8904 driver on my DELL
> Inspirion 3501:
> - Plug in a headset, play some sound to make sure that
>   the headset is detected.
> - Stop the sound, wait for the codec to go into suspend (30s
>   should be plenty enough time)
> - Unplug the headset while the codec is in suspend.
> - Try to play sound on the internal speakers. Notice that
>   the the driver still thinks the headset is connected. As a result
>   there is no sound on the internal speakers.
> 
> AFAICS the bug was introduced by the following commit:
> | commit 424e531b47f83da87490464c5bf633dfb624fe6a
> | Author: Stefan Binding <sbinding@...nsource.cirrus.com>
> | Date:   Fri Aug 27 12:02:51 2021 +0100
> | 
> |     ALSA: hda/cs8409: Ensure Type Detection is only run on startup when
> |     necessary
> 
> The bug is with the hp_jack_in and mic_jack_in flags that are used
> to determine if jack detection should be run etc. These flags
> are cleared in the suspend path. This prevents a status change from
> being detected after resume as hp_jack_in is cleared by suspend and
> there is no jack due to the unplug of the headset.
> 
> This status change was never reported to the HDA core, though.
> On suspend this is not done, only hd_jack_in is cleared and on
> resume the driver thinks that there is no change the needs reporting.
> 
> Proposed fix below, please consider inclusion.
> 
>      regards   Christian
> 
> >From 1dcf34c1d1c6c4852a86ec3ae189afa5d90ea09c Mon Sep 17 00:00:00 2001
> From: "Christian A. Ehrhardt" <lk@...e.de>
> Date: Fri, 31 Dec 2021 12:13:48 +0100
> Subject: [PATCH 2/2] ALSA: hda/cs8409: Fix Jack detection after resume
> 
> The suspend code unconditionally sets ->hp_jack_in and ->mic_jack_in
> to zero but without reporting this status change to the HDA core.
> To compensate for this, always assume a status change on the
> first unsol event after boot or resume.
> 
> Fixes:	424e531b47f8 ("ALSA: hda/cs8409: Ensure Type Detection is only run on startup when necessary")
> Signed-off-by: Christian A. Ehrhardt <lk@...e.de>

Thanks, applied now.


Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ