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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1076AC43334 for ; Fri, 17 Jun 2022 11:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382319AbiFQLL5 (ORCPT ); Fri, 17 Jun 2022 07:11:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381289AbiFQLL4 (ORCPT ); Fri, 17 Jun 2022 07:11:56 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33E9F6CA88 for ; Fri, 17 Jun 2022 04:11:56 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id 73-20020a17090a0fcf00b001eaee69f600so3867697pjz.1 for ; Fri, 17 Jun 2022 04:11:56 -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:mime-version :content-transfer-encoding; bh=oQLjYSyO5bnT1k2cMo+qtFEL9roIKTpXUxzFJ5E7YeU=; b=WEXQJ2c0zXPPo70AqX4ePE2lo2jfTA7rpG+C5RBXENB1K0P1BBjGTUBKWrVNIRgYMx HldHvQtAl/hTE2t7F2GKPeB/yiddMus1F8uOtTiwN9+rR9c0CSzHVt8S5NTgrhhhnsSe xRiJJZNKdeC7o73Bc1I3uTPEccX3CTIDbP26E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oQLjYSyO5bnT1k2cMo+qtFEL9roIKTpXUxzFJ5E7YeU=; b=PSn+Ux7E3xV7Kn5b3l8mrmPYfthZrVWLWalPkbJ+wWsAQ+7xkycafIjXiEzedFanv9 90uTZP8hBz8xcz039B0friRLtItAhYazEvn4e62IpKkIXK/mR0YlHNCkGU62NNCMecNe oDY/wERO/N8dwST8TCioTv6re/xuxBgSrAsE31E3t1hi1vi9LdcfzN747cM4axHpal67 i10rAcb0G8cmU0woRGaxG76D11Quw3BQ+UDiYm2dAhhzD1v7XTzPe2C9HI7/6LnaIKS0 7xZyIzsZPsjkoIIfRv+F+gfjSyv4v/Gq9jGMMHkTBWE2t3IljTPmdg0JyURdBPx7fKw2 J4lg== X-Gm-Message-State: AJIora+QcH3OCgsHYTxLSEu9hMDvNoV7zTCM2/ojvn99oUZT/JNbk+Mv IF3qF4XC5IkiToVeIrB0lv/leQ== X-Google-Smtp-Source: AGRyM1tf2bQGeUv5328p9BV+crG8b7G31H6qrJWwNOzsEDjIHBFrwQCM7E2x9VN5sMfX6/KCSapUnw== X-Received: by 2002:a17:903:32c4:b0:167:6e6f:204b with SMTP id i4-20020a17090332c400b001676e6f204bmr9221820plr.117.1655464315709; Fri, 17 Jun 2022 04:11:55 -0700 (PDT) Received: from fshao-glinux.tpe.corp.google.com ([2401:fa00:1:10:e616:b34a:9b5b:24ef]) by smtp.gmail.com with ESMTPSA id 9-20020a170902c20900b00163f7935772sm3296754pll.46.2022.06.17.04.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 04:11:55 -0700 (PDT) From: Fei Shao To: Mark Brown , Jiaxin Yu Cc: Fei Shao , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2] ASoC: mediatek: mt8186: Fix mutex double unlock in GPIO request Date: Fri, 17 Jun 2022 19:10:04 +0800 Message-Id: <20220617111003.2014395-1-fshao@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The lockdep mechanism revealed an unbalanced unlocking on MT8186: [ 2.993966] WARNING: bad unlock balance detected! [ 2.993978] ------------------------------------- [ 2.993983] kworker/u16:1/10 is trying to release lock (gpio_request_mutex) at: [ 2.993994] [] mt8186_afe_gpio_request+0xf8/0x210 [ 2.994012] but there are no more locks to release! The cause is that the mutex will be double unlocked if dai is unknown during GPIO selection, and this patch fixes it. Fixes: cfa9a966f12a ("ASoC: mediatek: mt8186: support gpio control in platform driver") Signed-off-by: Fei Shao --- Changes in v2: - Trimmed the commit message sound/soc/mediatek/mt8186/mt8186-afe-gpio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c b/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c index 255ffba637d3..274c0c8ec2f2 100644 --- a/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c +++ b/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c @@ -230,7 +230,6 @@ int mt8186_afe_gpio_request(struct device *dev, bool enable, sel = enable ? MT8186_AFE_GPIO_PCM_ON : MT8186_AFE_GPIO_PCM_OFF; break; default: - mutex_unlock(&gpio_request_mutex); dev_err(dev, "%s(), invalid dai %d\n", __func__, dai); goto unlock; } -- 2.36.1.476.g0c4daa206d-goog 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48405C433EF for ; Fri, 17 Jun 2022 11:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=oQLjYSyO5bnT1k2cMo+qtFEL9roIKTpXUxzFJ5E7YeU=; b=n6w7PiXBxKXvgk AaQ86Q+0nNqsHmdT9S6MNZZpfG1GA7AYzNwRQ1f8UQ1VOcfkeyTAYs4Gklmw/3ZCNC0pejYOTPy9N ltnj4o3ADLrTc1sX85qb1tCfiQyymQVx/DFYDqIrWYFBxT/P5hd+MuKQG6rjeyQFDXlrjv5zDlUf4 s3Symrh4SdV2XH9SzmsgaS8ibkqTVlyB13D2Mpm8cXckiNOq7k0a+UKtnlRO1LukqZbwdbnwK5wIp LbHQm9zpmbg2/3TLLARUTcmkVBhv1/s0MZJeT+WlIj8U9sUhQtYuQf7nX4BQ1I8PnVYDfhSD7DTPx hlZq+czKU1AmJLMXvCYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o29wy-007FuZ-Jo; Fri, 17 Jun 2022 11:15:40 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o29tT-007EQ4-BY for linux-mediatek@lists.infradead.org; Fri, 17 Jun 2022 11:12:07 +0000 Received: by mail-pj1-x102a.google.com with SMTP id k5-20020a17090a404500b001e8875e6242so3849344pjg.5 for ; Fri, 17 Jun 2022 04:11:56 -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:mime-version :content-transfer-encoding; bh=oQLjYSyO5bnT1k2cMo+qtFEL9roIKTpXUxzFJ5E7YeU=; b=WEXQJ2c0zXPPo70AqX4ePE2lo2jfTA7rpG+C5RBXENB1K0P1BBjGTUBKWrVNIRgYMx HldHvQtAl/hTE2t7F2GKPeB/yiddMus1F8uOtTiwN9+rR9c0CSzHVt8S5NTgrhhhnsSe xRiJJZNKdeC7o73Bc1I3uTPEccX3CTIDbP26E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oQLjYSyO5bnT1k2cMo+qtFEL9roIKTpXUxzFJ5E7YeU=; b=eU11V0XTnxRbfE6nozw3O9vJALXXc5U5V0bJdYlDA0EXB33z2PK6WD3Ra57GgWQjQK yMGVcpKu/zEy3An8CJNaJSzaClireUrnvUUKe2E9ZWF4iuPFrilrbbexkW44F+TS2Rp6 XM2dawrtsnu1j7gXnvXNitHDjjOJK/2XdMwfuOK5Jj25aj4qBI5VKyrbJBSYeQi/RrVv Qxds+S1eNfctZl8a5kiLOKyH48S9mqAW6zpHWRksFkY38dEmgEtg1bMfh+pHPszDvjYX TOlkhnJG47cYPHKa5P6zuNhEte7+mh48tMR8U1riPd+tuyhaFle3ELQNRbgGLA297ptD c0+g== X-Gm-Message-State: AJIora+1l5Oe0Ze4P0u5C9yjbQyg7CRJRgvTMlIqchtgd4AtKxosSnWV XBdTc2L1G0XDpOGRpLV4R/ahcQ== X-Google-Smtp-Source: AGRyM1tf2bQGeUv5328p9BV+crG8b7G31H6qrJWwNOzsEDjIHBFrwQCM7E2x9VN5sMfX6/KCSapUnw== X-Received: by 2002:a17:903:32c4:b0:167:6e6f:204b with SMTP id i4-20020a17090332c400b001676e6f204bmr9221820plr.117.1655464315709; Fri, 17 Jun 2022 04:11:55 -0700 (PDT) Received: from fshao-glinux.tpe.corp.google.com ([2401:fa00:1:10:e616:b34a:9b5b:24ef]) by smtp.gmail.com with ESMTPSA id 9-20020a170902c20900b00163f7935772sm3296754pll.46.2022.06.17.04.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 04:11:55 -0700 (PDT) From: Fei Shao To: Mark Brown , Jiaxin Yu Subject: [PATCH v2] ASoC: mediatek: mt8186: Fix mutex double unlock in GPIO request Date: Fri, 17 Jun 2022 19:10:04 +0800 Message-Id: <20220617111003.2014395-1-fshao@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_041203_490469_9882FDCC X-CRM114-Status: UNSURE ( 8.48 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The lockdep mechanism revealed an unbalanced unlocking on MT8186: [ 2.993966] WARNING: bad unlock balance detected! [ 2.993978] ------------------------------------- [ 2.993983] kworker/u16:1/10 is trying to release lock (gpio_request_mutex) at: [ 2.993994] [] mt8186_afe_gpio_request+0xf8/0x210 [ 2.994012] but there are no more locks to release! The cause is that the mutex will be double unlocked if dai is unknown during GPIO selection, and this patch fixes it. Fixes: cfa9a966f12a ("ASoC: mediatek: mt8186: support gpio control in platform driver") Signed-off-by: Fei Shao --- Changes in v2: - Trimmed the commit message sound/soc/mediatek/mt8186/mt8186-afe-gpio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c b/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c index 255ffba637d3..274c0c8ec2f2 100644 --- a/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c +++ b/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c @@ -230,7 +230,6 @@ int mt8186_afe_gpio_request(struct device *dev, bool enable, sel = enable ? MT8186_AFE_GPIO_PCM_ON : MT8186_AFE_GPIO_PCM_OFF; break; default: - mutex_unlock(&gpio_request_mutex); dev_err(dev, "%s(), invalid dai %d\n", __func__, dai); goto unlock; } -- 2.36.1.476.g0c4daa206d-goog 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE826C43334 for ; Fri, 17 Jun 2022 11:15:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KMicn0r2jo3oC7sr4QhiGm+nhfadnLeaBuDgp7X4VHA=; b=dXbTtpp23xeGTl EFXJEgJiS4tB64CvdYnrirT+OT7FhvGAr3mG37wYRLPLaH5B7ehejDFUqAwgLRYsmURlHsFeOfINW CVP1D9C6iL1MgHJNk29UWhTLVinJtpgItK0oKrkHH1VWzEpKlZod2fqh2u3FeuAnFIXAYL263a0/I XtlscJicvmzNPdcYPTYDFPhatzB/PCmZ9vUxthAWOmh4P0KBIcHP/ORp9ZDtEM+KwnxEiVgem9ntd u1rjALc+ozdyNJfOBc1mWFscBYMLxRcfZFI37mf44WJ7gR4kt3KDcSfRfhhzVQZEGGEChlmpSV8aN XF3jcjpVeI6wtanLUAxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o29vu-007FSU-0W; Fri, 17 Jun 2022 11:14:35 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o29tT-007EQ5-Bd for linux-arm-kernel@lists.infradead.org; Fri, 17 Jun 2022 11:12:07 +0000 Received: by mail-pl1-x630.google.com with SMTP id m14so3608484plg.5 for ; Fri, 17 Jun 2022 04:11:56 -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:mime-version :content-transfer-encoding; bh=oQLjYSyO5bnT1k2cMo+qtFEL9roIKTpXUxzFJ5E7YeU=; b=WEXQJ2c0zXPPo70AqX4ePE2lo2jfTA7rpG+C5RBXENB1K0P1BBjGTUBKWrVNIRgYMx HldHvQtAl/hTE2t7F2GKPeB/yiddMus1F8uOtTiwN9+rR9c0CSzHVt8S5NTgrhhhnsSe xRiJJZNKdeC7o73Bc1I3uTPEccX3CTIDbP26E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oQLjYSyO5bnT1k2cMo+qtFEL9roIKTpXUxzFJ5E7YeU=; b=VOfl02o4YdKDd+OMUV7SuccdkWsw0G3ITxoqcaQZmqZD/fWUV40rVRAMWhcTLg3cCD pJ+Vv9QFwNX3kRyG9zf4FT8sqXXNfZAW9rsW/2NyuldE5NVS4n78kQjfrvreclP/KYjd fjDmmXpJ8M8kUdG9/BRmKeRogTwmCdniaWws+PLh26rKhDPwW5SflDAU3QCH6nUVRicY UWid8s+pkAgfnopHEQs12ZLcFcS0aOnIOol8+TnhKghadTa6lD2GDVdFXl/pP8CvOOm+ OM3g/x/y0ELVPqXdYNhWTGlOGZm/3z5+HwHyu5OO1EMCfX9cTNwE76mypaZXk0o/t+Uy sMiw== X-Gm-Message-State: AJIora+joBzHtvDusoPwpTp15Aihd+YC32laZszYVK9z5p1Zz7H1H5wR op8F8K73S2FmQy9TRaYxv/k5Jg== X-Google-Smtp-Source: AGRyM1tf2bQGeUv5328p9BV+crG8b7G31H6qrJWwNOzsEDjIHBFrwQCM7E2x9VN5sMfX6/KCSapUnw== X-Received: by 2002:a17:903:32c4:b0:167:6e6f:204b with SMTP id i4-20020a17090332c400b001676e6f204bmr9221820plr.117.1655464315709; Fri, 17 Jun 2022 04:11:55 -0700 (PDT) Received: from fshao-glinux.tpe.corp.google.com ([2401:fa00:1:10:e616:b34a:9b5b:24ef]) by smtp.gmail.com with ESMTPSA id 9-20020a170902c20900b00163f7935772sm3296754pll.46.2022.06.17.04.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 04:11:55 -0700 (PDT) From: Fei Shao To: Mark Brown , Jiaxin Yu Cc: Fei Shao , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v2] ASoC: mediatek: mt8186: Fix mutex double unlock in GPIO request Date: Fri, 17 Jun 2022 19:10:04 +0800 Message-Id: <20220617111003.2014395-1-fshao@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220617_041203_561777_E32DAACD X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The lockdep mechanism revealed an unbalanced unlocking on MT8186: [ 2.993966] WARNING: bad unlock balance detected! [ 2.993978] ------------------------------------- [ 2.993983] kworker/u16:1/10 is trying to release lock (gpio_request_mutex) at: [ 2.993994] [] mt8186_afe_gpio_request+0xf8/0x210 [ 2.994012] but there are no more locks to release! The cause is that the mutex will be double unlocked if dai is unknown during GPIO selection, and this patch fixes it. Fixes: cfa9a966f12a ("ASoC: mediatek: mt8186: support gpio control in platform driver") Signed-off-by: Fei Shao --- Changes in v2: - Trimmed the commit message sound/soc/mediatek/mt8186/mt8186-afe-gpio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c b/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c index 255ffba637d3..274c0c8ec2f2 100644 --- a/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c +++ b/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c @@ -230,7 +230,6 @@ int mt8186_afe_gpio_request(struct device *dev, bool enable, sel = enable ? MT8186_AFE_GPIO_PCM_ON : MT8186_AFE_GPIO_PCM_OFF; break; default: - mutex_unlock(&gpio_request_mutex); dev_err(dev, "%s(), invalid dai %d\n", __func__, dai); goto unlock; } -- 2.36.1.476.g0c4daa206d-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0E81ACCA479 for ; Mon, 20 Jun 2022 15:08:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4669A1848; Mon, 20 Jun 2022 17:07:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4669A1848 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655737710; bh=pI4UBinB39INTVyE7x8PXU0bGWSK9OTM7FkVvtmcuzw=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=U8pu8Rj1CZgKEyolOrXWAfqwH44RMBhtFIyAlcPbDljBD39E1mvIBPh90w7WYhiuS cY8YSWVf+Qb5M2vJ2yIRzMlnNeVB2hfsyS01HJPK8NwoUDhoHcwkCAS7wskhYmFRC0 jdPLpMukTZXIbXjEfcQhoR4J+d2rcuDcbT66L4Qc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 63BE3F80534; Mon, 20 Jun 2022 17:06:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 90B49F80527; Fri, 17 Jun 2022 13:12:08 +0200 (CEST) Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4258EF800B0 for ; Fri, 17 Jun 2022 13:11:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4258EF800B0 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="WEXQJ2c0" Received: by mail-pj1-x1030.google.com with SMTP id h34-20020a17090a29a500b001eb01527d9eso3008267pjd.3 for ; Fri, 17 Jun 2022 04:11:57 -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:mime-version :content-transfer-encoding; bh=oQLjYSyO5bnT1k2cMo+qtFEL9roIKTpXUxzFJ5E7YeU=; b=WEXQJ2c0zXPPo70AqX4ePE2lo2jfTA7rpG+C5RBXENB1K0P1BBjGTUBKWrVNIRgYMx HldHvQtAl/hTE2t7F2GKPeB/yiddMus1F8uOtTiwN9+rR9c0CSzHVt8S5NTgrhhhnsSe xRiJJZNKdeC7o73Bc1I3uTPEccX3CTIDbP26E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oQLjYSyO5bnT1k2cMo+qtFEL9roIKTpXUxzFJ5E7YeU=; b=hIJZeS2lE2moACNefTNQkQ0OtZi4eOMRkxaPs4XXh7CrUO8MqBgmLBCCSmgdhTeX+g mfBWOgdsfZtHSJi+sKqprYTAh1AoL+aXgMeiJ5NCgLqkBOlHcXliWP8WEtmeOHQjYwJ3 KlSnl/9lLMMSrldjLKRylPv7jj1LGAdfeYDAykYSwpDvEgxxKsvK6XpaxXj9ffb8Fjc1 fH7hEtFw3nUUgXGVGc/XaiX8RhZR8fsOvMAYGjcruMNXBn0V4DVlkRmPmII8OKlYGuaX uTGdg4utUxKuAw4DoM315tCjPJWRh94qYwpriREhlvspCVmU2hQiknhcTKV9vDFsWa3Q EUzg== X-Gm-Message-State: AJIora9zNAwmPWvuFgznBJAKX+iMjuY/lW0XRz9k1DBUXs+PN1kTSrqF Ae1PoWPKa6G5HrJTfhHmsHnsFw== X-Google-Smtp-Source: AGRyM1tf2bQGeUv5328p9BV+crG8b7G31H6qrJWwNOzsEDjIHBFrwQCM7E2x9VN5sMfX6/KCSapUnw== X-Received: by 2002:a17:903:32c4:b0:167:6e6f:204b with SMTP id i4-20020a17090332c400b001676e6f204bmr9221820plr.117.1655464315709; Fri, 17 Jun 2022 04:11:55 -0700 (PDT) Received: from fshao-glinux.tpe.corp.google.com ([2401:fa00:1:10:e616:b34a:9b5b:24ef]) by smtp.gmail.com with ESMTPSA id 9-20020a170902c20900b00163f7935772sm3296754pll.46.2022.06.17.04.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jun 2022 04:11:55 -0700 (PDT) From: Fei Shao To: Mark Brown , Jiaxin Yu Subject: [PATCH v2] ASoC: mediatek: mt8186: Fix mutex double unlock in GPIO request Date: Fri, 17 Jun 2022 19:10:04 +0800 Message-Id: <20220617111003.2014395-1-fshao@chromium.org> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 20 Jun 2022 17:06:44 +0200 Cc: alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Fei Shao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The lockdep mechanism revealed an unbalanced unlocking on MT8186: [ 2.993966] WARNING: bad unlock balance detected! [ 2.993978] ------------------------------------- [ 2.993983] kworker/u16:1/10 is trying to release lock (gpio_request_mutex) at: [ 2.993994] [] mt8186_afe_gpio_request+0xf8/0x210 [ 2.994012] but there are no more locks to release! The cause is that the mutex will be double unlocked if dai is unknown during GPIO selection, and this patch fixes it. Fixes: cfa9a966f12a ("ASoC: mediatek: mt8186: support gpio control in platform driver") Signed-off-by: Fei Shao --- Changes in v2: - Trimmed the commit message sound/soc/mediatek/mt8186/mt8186-afe-gpio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c b/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c index 255ffba637d3..274c0c8ec2f2 100644 --- a/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c +++ b/sound/soc/mediatek/mt8186/mt8186-afe-gpio.c @@ -230,7 +230,6 @@ int mt8186_afe_gpio_request(struct device *dev, bool enable, sel = enable ? MT8186_AFE_GPIO_PCM_ON : MT8186_AFE_GPIO_PCM_OFF; break; default: - mutex_unlock(&gpio_request_mutex); dev_err(dev, "%s(), invalid dai %d\n", __func__, dai); goto unlock; } -- 2.36.1.476.g0c4daa206d-goog