Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1279699rwd; Thu, 15 Jun 2023 08:29:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4dWAifR5qdgXCY/pjo3pKTGqMh7F/h+jCdxIodb8wKXdYSyf+OONH2WBmkq8b2ot7LAvz4 X-Received: by 2002:a05:6a00:1890:b0:643:b653:3aa with SMTP id x16-20020a056a00189000b00643b65303aamr5591524pfh.32.1686842997207; Thu, 15 Jun 2023 08:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686842997; cv=none; d=google.com; s=arc-20160816; b=jc3EOPDnF/gEyPxzXIGz7ZJc6i4IFPUMW0lZHoEcBRwi4sO8+ngFzM69q4mFkHh+/n WSM5wJg9r3mMHbMZ8N4cVTJTu3bdDaAAH+wAqAIHmMPM4kkGP0ZqvYH7cqwsFjmNZ+rn bGA+j0KBKuae9kZmsUlHcaACUEkQzH1qzdvzylBrwITgt0hc/oRS8liBYo4DwPQhjWWJ ZLg+T95aUhnCLNuc4DNMlZaSRqtvbwMBBO6dI00dkFLm2Gam5GrrUigVkjWBHKDALxcg HZ46Q98AIM7wKb/7QO8DzlYJ0PX8/b/6yGxmKdFTioHELKXlxi689QumUAR0dC2gzzBC tAoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UTxeaxXFn5GNkcVsWJTf9D5g3nTYEaM86Nc45vNWBR4=; b=rltFpEJMKes5Zy3vrX8FXsoL6Y3CEBk1b54q3Kc0sbfRdIZd3LaCKHErkRlFo4/YiR 8J+F3WP+n0LUpiF/O2vFBxtRVmyUinCm7wDhCrY7qzAgjnv9+HMztyNv0F56YW1gn9W9 lQ9H1Zdy/xbrpn23JU0Cyk2VXKD16+98JBCO7T/SNxwTNO/6xN4xqftI4tuJ78OwDtrX Ba0v8bmkngmDCARk3RA9Np8UQppkVsN5XNbngR34LhmdAlM4t6EKbbIUwJ/SHXys0mP5 O7UJw/MDU6QCwRGPVsLBqBC9tanPNhRkoxVpvoeV9FF3zfuuPyuZNa2MYLC5dSqr2ESw 89/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="U+3bso/V"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 24-20020a631258000000b0053ee9b21820si12453245pgs.72.2023.06.15.08.29.40; Thu, 15 Jun 2023 08:29:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="U+3bso/V"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343977AbjFOP0o (ORCPT + 99 others); Thu, 15 Jun 2023 11:26:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343955AbjFOP0O (ORCPT ); Thu, 15 Jun 2023 11:26:14 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEB66212B for ; Thu, 15 Jun 2023 08:26:12 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1b517ee9157so5616355ad.3 for ; Thu, 15 Jun 2023 08:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686842772; x=1689434772; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UTxeaxXFn5GNkcVsWJTf9D5g3nTYEaM86Nc45vNWBR4=; b=U+3bso/Vm9pUh7xz0npUzHyVDR5CzodEcM7fFoco4BuXpWwCjquik+lxENBhrMcsOj 47Ax7BphyLNVPJtOvGwxU7iIoUcYpizzcBRj5urmQYZCCcoQdeIrsNIWpI+/klxOwyJ8 rSeQ35lLDEKNLBw1GKnC3v2STOrd17u5fZiRJmCbaoONzjRkpjdgTVGYNcEJOvKMZ0Zq znHO1uxq1JyIbH93OcfJe2V8LiSfeihsjC9/Q4TBmmP7236UKtmm9AqXxTiS//zyfkA2 QLuFK1SD8fY8z7zaxBTIbR0OOXmJugf9fyhb/8t49LxdyOhrxB8io/WGjavrSVdxUflL cewQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686842772; x=1689434772; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UTxeaxXFn5GNkcVsWJTf9D5g3nTYEaM86Nc45vNWBR4=; b=D4r1xeIhcG5CeFWTmQhclCpDFmw56gAGskwBPjuJn/Jir4cAaT1U49Sw5ylkPFPX55 tM2/ihXag2cuLZL6Fulku2RzhBaqkNggLwm6RRqwe5pSNly46LIU/9n8/rvj47ZjDMoo 3qQ/7eaVUDYsXM2Q+i2jEty1XO4pBO60zf91pLZr4+6cdBbOtHzfUc9Gf6AD8VpwlldG /YuCOcAyjIv+InzYvoXA/pARTNWD13fXm+FBIwbNdl/7ndPHjUvw8sb40XDlsjPQ7fQC IPtSw+XCwg4v8mqXp6p5AOCgZNNbRupjWPXC3ps0konMKZXPDJiG9FCggDtlLwvoPwuA Qjjg== X-Gm-Message-State: AC+VfDydKf7H8LZ9/QNrz6/yIAGa/XwrJoEpxBcBJhBzRq+3awnp+XIk RqRyODPdw+lzyAlAHyF2n7qBIw== X-Received: by 2002:a17:902:c94f:b0:1b0:7c3c:31f7 with SMTP id i15-20020a170902c94f00b001b07c3c31f7mr17437450pla.28.1686842772232; Thu, 15 Jun 2023 08:26:12 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id j11-20020a170902690b00b001b02bd00c61sm14181120plk.237.2023.06.15.08.26.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 08:26:11 -0700 (PDT) Date: Thu, 15 Jun 2023 15:26:07 +0000 From: Carlos Llamas To: Mark Brown Cc: yixuanjiang , vkoul@kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] ASoC: soc-compress: Fix deadlock in soc_compr_open_fe Message-ID: References: <20230613062350.271107-1-yixuanjiang@google.com> <92159f51-2e17-4c6b-8fd4-0bde8b1dd38a@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <92159f51-2e17-4c6b-8fd4-0bde8b1dd38a@sirena.org.uk> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,FSL_HELO_FAKE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 15, 2023 at 01:56:35AM +0100, Mark Brown wrote: > On Tue, Jun 13, 2023 at 02:23:50PM +0800, yixuanjiang wrote: > > Modify the error handling flow by release lock. > > The require pcm_mutex will keep holding if open fail. > > > +++ b/sound/soc/soc-compress.c > > @@ -166,6 +166,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream) > > snd_soc_dai_compr_shutdown(cpu_dai, cstream, 1); > > out: > > dpcm_path_put(&list); > > + mutex_unlock(&fe->card->pcm_mutex); > > be_err: > > This is really hard to follow due to the lack of any mutex_lock()s in > the function, I think because this is intended to undo > snd_soc_dpcm_mutex_lock(fe) but if that's the case why is it not using > snd_soc_dpcm_mutex_unlock(fe) like the success path does? Given the use > of classes not doing that looks like it'll create lockdep issues. > > I'd expect the unlock to match the lock. Yes, and judging from the context of the patch I believe this was based off of stable 5.15.y tree. The locking has been refactored since. So Yixuan, please rebase/adjust your patch on top of Linus's mainline tree and resend. Thanks! -- Carlos Llamas