From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C1FBC433E0 for ; Wed, 1 Jul 2020 06:46:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E87C320773 for ; Wed, 1 Jul 2020 06:46:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728013AbgGAGq2 (ORCPT ); Wed, 1 Jul 2020 02:46:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:34336 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727944AbgGAGq2 (ORCPT ); Wed, 1 Jul 2020 02:46:28 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 07FD3AE17; Wed, 1 Jul 2020 06:46:27 +0000 (UTC) Date: Wed, 01 Jul 2020 08:46:26 +0200 Message-ID: From: Takashi Iwai To: Kai-Heng Feng Cc: tiwai@suse.com, anthony.won@canonical.com, Jaroslav Kysela , Libin Yang , Kai Vehmanen , "Gustavo A. R. Silva" , Ranjani Sridharan , Pierre-Louis Bossart , Kailang Yang , Hui Wang , Jian-Hong Pan , Tomas Espeleta , Thomas Hebb , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , alsa-devel@alsa-project.org (moderated list:SOUND), linux-kernel@vger.kernel.org (open list) Subject: Re: [PATCH] ALSA: hda/realtek: Serialize setting GPIO LED In-Reply-To: <20200701052138.6378-1-kai.heng.feng@canonical.com> References: <20200701052138.6378-1-kai.heng.feng@canonical.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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? thanks, Takashi