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 4AF2AC433EF for ; Mon, 30 May 2022 10:46:06 +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 252801AA9; Mon, 30 May 2022 12:45:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 252801AA9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1653907565; bh=UMEk+mnjJRjEyS+FjKihUSpKDzCVQNQ7/lTjvKuJHqo=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GYLZ/ggkVUOKsOmByf6wt4+lJyAAUqFWYnK0vjO/06GGuZFtwA8umZg1h/kDebONw oCS3M022ekZoWoIUNxY0NuW4wjfraejXgejPf7isnLVwtq7ATGevoNTeLAOd13l2vy pT0FEnw6w8CkFW/L/Pth4cVqWWP45DFN9MBQIi20= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BAC49F8012F; Mon, 30 May 2022 12:45:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AD9C0F8019D; Mon, 30 May 2022 12:45:13 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (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 6F9F9F800E5 for ; Mon, 30 May 2022 12:45:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6F9F9F800E5 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="SaslVQ8q"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/wSTltsA" 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 537F221B50; Mon, 30 May 2022 10:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1653907509; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BE55qxSMS0UTxraTXVwJDW4YqxLCR/urdAJrBe0gCjw=; b=SaslVQ8qqTXREhp2ONr5sZIADkyLY7VBzO/FdeerZHCfkYsNKTiqRQVeM+bYuLXRvUnvA/ bDuFdy25BMZnb5I5Ifls1U9/2hd2ZbfsA7WGkVMHR/JOi7pRFbJ7h0Z1ocv8yYD+Fq8p4z y7c+xLY2VDfOod3G4oWWQuqUqhBTS0I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1653907509; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BE55qxSMS0UTxraTXVwJDW4YqxLCR/urdAJrBe0gCjw=; b=/wSTltsAeifd2pgyDzeqdXh8CFgtineg0dz9gyhR7VoUAXN1GkeblyC9SCmj093gg4gzK5 5yE5Wj516Wyv+hBw== 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 27EF013AFD; Mon, 30 May 2022 10:45:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id G+3rCDWglGKvWgAAMHmgww (envelope-from ); Mon, 30 May 2022 10:45:09 +0000 Date: Mon, 30 May 2022 12:45:08 +0200 Message-ID: <871qwbxpsb.wl-tiwai@suse.de> From: Takashi Iwai To: Charles Keepax Subject: Re: [PATCH v4 00/17] ALSA: hda: cirrus: Add initial DSP support and firmware loading In-Reply-To: <20220530103415.GU38351@ediswmail.ad.cirrus.com> References: <20220525131638.5512-1-vitalyr@opensource.cirrus.com> <871qwf0x8t.wl-tiwai@suse.de> <20220530090846.GS38351@ediswmail.ad.cirrus.com> <87czfvxtsc.wl-tiwai@suse.de> <20220530093639.GT38351@ediswmail.ad.cirrus.com> <87a6azxr7h.wl-tiwai@suse.de> <20220530103415.GU38351@ediswmail.ad.cirrus.com> 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=US-ASCII Cc: alsa-devel@alsa-project.org, Vitaly Rodionov , patches@opensource.cirrus.com, Takashi Iwai , Mark Brown , linux-kernel@vger.kernel.org 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" On Mon, 30 May 2022 12:34:15 +0200, Charles Keepax wrote: > > On Mon, May 30, 2022 at 12:14:26PM +0200, Takashi Iwai wrote: > > On Mon, 30 May 2022 11:36:39 +0200, > > Charles Keepax wrote: > > > On Mon, May 30, 2022 at 11:18:43AM +0200, Takashi Iwai wrote: > > > > On Mon, 30 May 2022 11:08:46 +0200, > > > > Charles Keepax wrote: > > > > > On Fri, May 27, 2022 at 06:13:38PM +0200, Takashi Iwai wrote: > > > > > > On Wed, 25 May 2022 15:16:21 +0200, > > > > > > Vitaly Rodionov wrote: > > > Yeah that should be what is happening here. Although it looks > > > like this code might be removing all the controls if the firmware > > > is unloaded. I will discuss that with the guys, we normal just > > > disable the controls on the wm_adsp stuff. > > > > OK, that sounds good. Basically my concern came up from the code > > snippet doing asynchronous addition/removal via work. This showed > > some yellow signal, as such a pattern doesn't appear in the normal > > implementation. If this is (still) really necessary, it has to be > > clarified as an exception. > > > > Hm... ok we will think about that. I think that part will > probably still be necessary. Because there is an ALSA control > that selects the firmware, then it is necesarry to defer creating > the controls to some work, since you are already holding the > lock. Well, if an ALSA control can trigger the firmware loading, that's already fragile. A firmware loading is a heavy task, which should happen only at probing and/or resuming in general. Do we have other drivers doing the f/w loading triggered by a kctl...? > I guess we could look at adding locked versions of the add > control functions as well if that might be preferred? If the patterns of additional kctls (specific for firmware?) are fixed, we may create all such kctls beforehand and let them inactive unless the corresponding firmware is really loaded, too. thanks, Takashi 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 7C900C433F5 for ; Mon, 30 May 2022 10:47:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235532AbiE3KrM (ORCPT ); Mon, 30 May 2022 06:47:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235561AbiE3KpN (ORCPT ); Mon, 30 May 2022 06:45:13 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCC0E7CB1E for ; Mon, 30 May 2022 03:45:10 -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 537F221B50; Mon, 30 May 2022 10:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1653907509; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BE55qxSMS0UTxraTXVwJDW4YqxLCR/urdAJrBe0gCjw=; b=SaslVQ8qqTXREhp2ONr5sZIADkyLY7VBzO/FdeerZHCfkYsNKTiqRQVeM+bYuLXRvUnvA/ bDuFdy25BMZnb5I5Ifls1U9/2hd2ZbfsA7WGkVMHR/JOi7pRFbJ7h0Z1ocv8yYD+Fq8p4z y7c+xLY2VDfOod3G4oWWQuqUqhBTS0I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1653907509; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BE55qxSMS0UTxraTXVwJDW4YqxLCR/urdAJrBe0gCjw=; b=/wSTltsAeifd2pgyDzeqdXh8CFgtineg0dz9gyhR7VoUAXN1GkeblyC9SCmj093gg4gzK5 5yE5Wj516Wyv+hBw== 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 27EF013AFD; Mon, 30 May 2022 10:45:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id G+3rCDWglGKvWgAAMHmgww (envelope-from ); Mon, 30 May 2022 10:45:09 +0000 Date: Mon, 30 May 2022 12:45:08 +0200 Message-ID: <871qwbxpsb.wl-tiwai@suse.de> From: Takashi Iwai To: Charles Keepax Cc: Vitaly Rodionov , Jaroslav Kysela , Takashi Iwai , Mark Brown , , , Subject: Re: [PATCH v4 00/17] ALSA: hda: cirrus: Add initial DSP support and firmware loading In-Reply-To: <20220530103415.GU38351@ediswmail.ad.cirrus.com> References: <20220525131638.5512-1-vitalyr@opensource.cirrus.com> <871qwf0x8t.wl-tiwai@suse.de> <20220530090846.GS38351@ediswmail.ad.cirrus.com> <87czfvxtsc.wl-tiwai@suse.de> <20220530093639.GT38351@ediswmail.ad.cirrus.com> <87a6azxr7h.wl-tiwai@suse.de> <20220530103415.GU38351@ediswmail.ad.cirrus.com> 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=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 May 2022 12:34:15 +0200, Charles Keepax wrote: > > On Mon, May 30, 2022 at 12:14:26PM +0200, Takashi Iwai wrote: > > On Mon, 30 May 2022 11:36:39 +0200, > > Charles Keepax wrote: > > > On Mon, May 30, 2022 at 11:18:43AM +0200, Takashi Iwai wrote: > > > > On Mon, 30 May 2022 11:08:46 +0200, > > > > Charles Keepax wrote: > > > > > On Fri, May 27, 2022 at 06:13:38PM +0200, Takashi Iwai wrote: > > > > > > On Wed, 25 May 2022 15:16:21 +0200, > > > > > > Vitaly Rodionov wrote: > > > Yeah that should be what is happening here. Although it looks > > > like this code might be removing all the controls if the firmware > > > is unloaded. I will discuss that with the guys, we normal just > > > disable the controls on the wm_adsp stuff. > > > > OK, that sounds good. Basically my concern came up from the code > > snippet doing asynchronous addition/removal via work. This showed > > some yellow signal, as such a pattern doesn't appear in the normal > > implementation. If this is (still) really necessary, it has to be > > clarified as an exception. > > > > Hm... ok we will think about that. I think that part will > probably still be necessary. Because there is an ALSA control > that selects the firmware, then it is necesarry to defer creating > the controls to some work, since you are already holding the > lock. Well, if an ALSA control can trigger the firmware loading, that's already fragile. A firmware loading is a heavy task, which should happen only at probing and/or resuming in general. Do we have other drivers doing the f/w loading triggered by a kctl...? > I guess we could look at adding locked versions of the add > control functions as well if that might be preferred? If the patterns of additional kctls (specific for firmware?) are fixed, we may create all such kctls beforehand and let them inactive unless the corresponding firmware is really loaded, too. thanks, Takashi