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]
Date:   Wed, 1 Jul 2020 16:00:09 +0800
From:   Kai-Heng Feng <kai.heng.feng@...onical.com>
To:     Takashi Iwai <tiwai@...e.de>
Cc:     tiwai@...e.com, anthony.won@...onical.com,
        Jaroslav Kysela <perex@...ex.cz>,
        Libin Yang <libin.yang@...el.com>,
        Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
        "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
        Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>,
        Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
        Kailang Yang <kailang@...ltek.com>,
        Hui Wang <hui.wang@...onical.com>,
        Jian-Hong Pan <jian-hong@...lessm.com>,
        Tomas Espeleta <tomas.espeleta@...il.com>,
        Thomas Hebb <tommyhebb@...il.com>,
        Michał Mirosław <mirq-linux@...e.qmqm.pl>,
        "moderated list:SOUND" <alsa-devel@...a-project.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ALSA: hda/realtek: Serialize setting GPIO LED



> On Jul 1, 2020, at 14:46, Takashi Iwai <tiwai@...e.de> wrote:
> 
> On Wed, 01 Jul 2020 07:21:35 +0200,
> Kai-Heng Feng wrote:
>> 
>> If a system has two GPIO controlled LED, one for mute and another one
>> for micmute, and both of them are on before system suspend, sometimes
>> one of them won't be turned off by system suspend.
>> 
>> The codec doesn't seem to be able to control multiple GPIO LEDs at the
>> same time, so introduce a new mutex to serialize setting the LED, to
>> prevent the issue from happening.
>> 
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
>> ---
>> include/sound/hda_codec.h     | 1 +
>> sound/pci/hda/hda_codec.c     | 1 +
>> sound/pci/hda/patch_realtek.c | 3 +++
>> 3 files changed, 5 insertions(+)
>> 
>> diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h
>> index d16a4229209b..3a1792bbb7ac 100644
>> --- a/include/sound/hda_codec.h
>> +++ b/include/sound/hda_codec.h
>> @@ -206,6 +206,7 @@ struct hda_codec {
>> 
>> 	struct mutex spdif_mutex;
>> 	struct mutex control_mutex;
>> +	struct mutex led_mutex;
> 
> Since it's only for Realtek codec, can it be better in alc_spec
> instead?

Ok, I found that the mutex just papers over the real issue.

The root cause is that led_set_brightness_nopm() use schedule_work() but the work queue doesn't gets flushed.
I'll fix it there properly.

Kai-Heng

> 
> 
> thanks,
> 
> Takashi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ