From patchwork Wed Jun 10 03:54:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 6576391 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F1E119F1C1 for ; Wed, 10 Jun 2015 03:54:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0404D205C4 for ; Wed, 10 Jun 2015 03:54:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 6E4A9205C1 for ; Wed, 10 Jun 2015 03:54:37 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 16BE326587B; Wed, 10 Jun 2015 05:54:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id EDCBA265854; Wed, 10 Jun 2015 05:54:27 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3CA31265856; Wed, 10 Jun 2015 05:54:26 +0200 (CEST) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by alsa0.perex.cz (Postfix) with ESMTP id E7617265846 for ; Wed, 10 Jun 2015 05:54:20 +0200 (CEST) Received: by pdbnf5 with SMTP id nf5so28270130pdb.2 for ; Tue, 09 Jun 2015 20:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=ZIuZIiq8UBoZF/EV0Uu21zJV1vIMNR8PskvZGjFrlK8=; b=bUqlZb7maHgWb7O3SijFWEO9WXXWAMAiWEgUyZF11PoubKybRYntptY7ONW8E8Wz7u g9+4cFfNmOD62gl7Xq6r757X3Wa4Wj5TUeN4k9Fy6ZAg7rpXsLcld+0kHDoEb340ZsyI NbXixNKOctfYZOcXqj+SL9gvrQhVRNE18hM7A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZIuZIiq8UBoZF/EV0Uu21zJV1vIMNR8PskvZGjFrlK8=; b=R0uRXBweNncRGWvd4L4PXbnDCMxIZbhe4djmjaZDNhVd5jyFNu4k1GtAxZ0vvxx8Lb /EKc+l2ige5blrW07Z83IQNZ29WOiMQc/E7HdP0WdxQhGIrnkp9Pnmeg70LjyfB3wJv2 Mw56IZjFr4w9MwzrpLwuLA0lKxi83jQL7apLaV7B2bDX/3gNHatVEMx8ei6TyH5vWA0s KTnLJ2QFRLZdkynounE/EQxb1g4fEw6GPNNVtO0mE35Gok51tST7N/7FJKbTYC0GTmYh tgv08QxC4g8ZwwoF9iMjwzAhJP8jU46wxYBVLv2BokypF8GOWVQwrL1bxQfrmBzR/slI dQDw== X-Gm-Message-State: ALoCoQmg74PzqQbh1AH6an4gRbsH1iXogAChK9wDVt5MIBNEsv1ps1PeGj+bOR7am6ecQjfi9t5R X-Received: by 10.66.65.229 with SMTP id a5mr1854967pat.11.1433908459275; Tue, 09 Jun 2015 20:54:19 -0700 (PDT) Received: from drinkcat.tpe.corp.google.com ([172.30.210.53]) by mx.google.com with ESMTPSA id om10sm6975071pbb.58.2015.06.09.20.54.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jun 2015 20:54:18 -0700 (PDT) From: Nicolas Boichat To: Mark Brown Date: Wed, 10 Jun 2015 11:54:13 +0800 Message-Id: <1433908453-9548-1-git-send-email-drinkcat@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c Cc: Oder Chiou , alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood , Bard Liao Subject: [alsa-devel] [PATCH] ASoC: rt5645: Lock mutex in rt5645_enable_push_button_irq X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP rt5645_enable_push_button_irq uses snd_soc_dapm_*_unlocked functions, so it needs to lock the required dapm mutex. Signed-off-by: Nicolas Boichat --- sound/soc/codecs/rt5645.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index d5f0f56..025cf14 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -2761,6 +2761,7 @@ static void rt5645_enable_push_button_irq(struct snd_soc_codec *codec, struct rt5645_priv *rt5645 = snd_soc_codec_get_drvdata(codec); if (enable) { + snd_soc_dapm_mutex_lock(&codec->dapm); snd_soc_dapm_force_enable_pin_unlocked(&codec->dapm, "ADC L power"); snd_soc_dapm_force_enable_pin_unlocked(&codec->dapm, @@ -2770,6 +2771,8 @@ static void rt5645_enable_push_button_irq(struct snd_soc_codec *codec, snd_soc_dapm_force_enable_pin_unlocked(&codec->dapm, "Mic Det Power"); snd_soc_dapm_sync_unlocked(&codec->dapm); + snd_soc_dapm_mutex_unlock(&codec->dapm); + snd_soc_update_bits(codec, RT5645_INT_IRQ_ST, 0x8, 0x8); snd_soc_update_bits(codec, @@ -2780,6 +2783,8 @@ static void rt5645_enable_push_button_irq(struct snd_soc_codec *codec, } else { snd_soc_update_bits(codec, RT5650_4BTN_IL_CMD2, 0x8000, 0x0); snd_soc_update_bits(codec, RT5645_INT_IRQ_ST, 0x8, 0x0); + + snd_soc_dapm_mutex_lock(&codec->dapm); snd_soc_dapm_disable_pin_unlocked(&codec->dapm, "ADC L power"); snd_soc_dapm_disable_pin_unlocked(&codec->dapm, @@ -2790,6 +2795,7 @@ static void rt5645_enable_push_button_irq(struct snd_soc_codec *codec, snd_soc_dapm_disable_pin_unlocked(&codec->dapm, "Mic Det Power"); snd_soc_dapm_sync_unlocked(&codec->dapm); + snd_soc_dapm_mutex_unlock(&codec->dapm); } }