Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp312866rdb; Mon, 18 Sep 2023 16:29:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGR879GjGp+o79VUNqFLekGsGVIpV9NOoSESbLXcSynd9NW/iVhAaraY6kv1+3LMI62NUf X-Received: by 2002:a05:6a00:a08:b0:690:24ff:c80f with SMTP id p8-20020a056a000a0800b0069024ffc80fmr10314328pfh.34.1695079767662; Mon, 18 Sep 2023 16:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695079767; cv=none; d=google.com; s=arc-20160816; b=uqJjZAgwe68kmwWeSeiC2A2Tw9GFQ3t96UoLAJvV5jiv+cAlflBmgMgOkoMviNbxeZ 0GKWlRVF2JsMLw7vpU9wrLataHOyAA2LVVFcEt1xg39/ohpPwdlFT2WoiDMdUv5YZVqP AmfkgwtW4PY6seWoppfLusS8TBdghSeqNFHVQJSc+tx3XHep9taR+UhNSkfcU6qg7KBQ 5xh4c/yttnR/zUghRVPdpxQGoXHD3J6dIgPhEgoi0R2+iEQuytc2StMcbgVvfqTUeBPT Ps4Qr/Rxfq5R+mA2p332FGh22fel0szrtSRojZnhQw5GBmy5cNyjXqvdGM1ZW9N6q4pw iCQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature:dkim-signature; bh=7DK8KR3fPs8whrEH8j0R/iUaebjoMVvA4LCOE3UH58k=; fh=YYZ3uqjLBhSDIpdgSYjTPPNOL/AsZKP4jYPPt/KPeL4=; b=BUA1wZKQlZODzIE/jq6TTLGvygHFYPHXyVutrgzTBfSUlNEUITSuGUkkoUDsko0B6E 0S2roaIBej1YdNbuWFNx8+Rq/c3yXiBc7dLPTpKgqqAGHkN3tDDY/mVfgxrkuTm4/fYQ HZWFJYzIGxJ4ri/iCYplSD2wOrTW9RZOBRY+y7AfrQdWOB+r/kOxwxdUnMH+xydTCr92 4dCucf/idLqeMg5OtGX0NCGBjfux//dXQHPvwu6e51KGDWMgfLWUFP8eOc/0TAMpTVaL 1llRZCt2CRWB7m6YVZ8gUo6Sq4+RbsPH8Fbs3ingIN0Rbvq6L+/WDrZkk+5Ipf7Fz27f Ko0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="Gn/qofhd"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=iJNHd02t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id c185-20020a6335c2000000b005787de7abd4si2808480pga.12.2023.09.18.16.29.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 16:29:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="Gn/qofhd"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=iJNHd02t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id AEF7D82E7B1F; Mon, 18 Sep 2023 09:05:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229919AbjIRQEu (ORCPT + 99 others); Mon, 18 Sep 2023 12:04:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbjIRQEi (ORCPT ); Mon, 18 Sep 2023 12:04:38 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64E2C1BC1 for ; Mon, 18 Sep 2023 08:56:58 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C78BA21E1F; Mon, 18 Sep 2023 15:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1695052414; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7DK8KR3fPs8whrEH8j0R/iUaebjoMVvA4LCOE3UH58k=; b=Gn/qofhdRe9yFSQ9We8JjC0Btj6seP5I5QTH8OCft6OcQKHs9X2c6awtAUboy7FRm+o5gA SjkySP6pWw2/cVv7lUT4JPY5Fofh645YCZp+v7jF/r9fIVeLScJen8RzcxiV6rK9A8ol9f QQRpF3XdQpEBZbBsQeId9XgpcN5/CjU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1695052414; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7DK8KR3fPs8whrEH8j0R/iUaebjoMVvA4LCOE3UH58k=; b=iJNHd02thBKEU43GpxNoLcaBjB9Wr/IDWtzDY2NTcEfG09qokv6QShSMAeZLARN3Dum8Dm YmlWOF31ieo2EKBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 98A6913480; Mon, 18 Sep 2023 15:53:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uSweJH5yCGVmaQAAMHmgww (envelope-from ); Mon, 18 Sep 2023 15:53:34 +0000 Date: Mon, 18 Sep 2023 17:53:34 +0200 Message-ID: <87led3zddt.wl-tiwai@suse.de> From: Takashi Iwai To: YE Chengfeng Cc: "perex@perex.cz" , "tiwai@suse.com" , "yunjunlee@chromium.org" , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" Subject: Re: =?GB2312?B?u9i4tDo=?= [PATCH] ALSA: dummy: Fix &dpcm->lock deadlock issues In-Reply-To: References: <87edlzwgti.wl-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 18 Sep 2023 09:05:02 -0700 (PDT) On Sun, 17 Sep 2023 19:26:13 +0200, YE Chengfeng wrote: > > Hi Takashi, > > Sorry for interrupt you again after such a long time. I just notice there was an old patch posted[1] from you that made pcm pointer() and trigger() callbacks could being able to be executed under non-atomic context, by using mutex instead of spin_lock_irq(). > > I find several similar deadlocks like this one on other places(inside pointer() and trigger() callbacks and being interrupted by hardirq), I am confusing whether they could be real deadlocks, as if these callbacks are executed under non-atomic context then they could be real problem. It can't be a problem. The new code path with mutex() is enabled only when the PCM nonatomic flag is explicitly defined by the driver. And the dummy driver doesn't, i.e. it still uses the traditional atomic PCM ops, hence spin_lock() without the irq-save can be used fine in the atomic ops like pointer or trigger. Takashi > > Thanks much if you are available to reply, > Chengfeng > > [1]?https://patchwork.kernel.org/project/alsa-devel/patch/1409572832-32553-2-git-send-email-tiwai@suse.de/