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 67257CD37B0 for ; Mon, 18 Sep 2023 15:55:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D2EC0950; Mon, 18 Sep 2023 17:54:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D2EC0950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1695052500; bh=X3rA4Ffzqh41AVhajIFnC2lGHCxkI4fRndJYNXyebW0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=L69V0eHUukdNdjBWECriSeZ6aMtbMUmTi4hUwutIKWMDYezIY/tmm2bPdzLcQ9DHf r3HsaiAXDEP/DEzzCsHI4ir6VIWh+e2jQqTjr7IpgweugnvEkZq5Jx+BZNhXS5Y6wV bSgJnJMdBLsHEWOt5ik/D3sGj9TrjOYDNqIJ638s= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9204FF80558; Mon, 18 Sep 2023 17:53:42 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3A4C7F8025A; Mon, 18 Sep 2023 17:53:42 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 75E0CF8025A; Mon, 18 Sep 2023 17:53:38 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4868BF80124 for ; Mon, 18 Sep 2023 17:53:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4868BF80124 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Gn/qofhd; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=iJNHd02t 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 Message-ID-Hash: MKTOBNXJNQESUIJJHHQBABMOAJ7TFR6Y X-Message-ID-Hash: MKTOBNXJNQESUIJJHHQBABMOAJ7TFR6Y X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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/