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 B27EACD37B0 for ; Mon, 18 Sep 2023 16:04:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbjIRQEw (ORCPT ); Mon, 18 Sep 2023 12:04:52 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/