Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5443779ioo; Wed, 1 Jun 2022 05:48:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznpMM+6ltWak0bxEDMrPAryuslaPtTYbT2O0HhX7OKTQLMjXz+RctsviE5Wo6+Z1mx4FAG X-Received: by 2002:a17:90b:1b48:b0:1e0:ab0:df00 with SMTP id nv8-20020a17090b1b4800b001e00ab0df00mr34003009pjb.52.1654087738630; Wed, 01 Jun 2022 05:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654087738; cv=none; d=google.com; s=arc-20160816; b=c08XWEWpgkyz7khDkc5HG3TQgfQx+JS7KDTOk4TmjM9QE3vUfBpqFerPSo+y9cQ8Hr D+be5t8dUDc0gkfU5YUES3lJcg7IvzirfuFOwLnS3CFVRu1xyQ4Bp+HIyneC5bDBEDyE ZjJo5hc9xYltIDDvrLpdUuoRcJDT3dNA3Ktk/KVgCm3itHEkLb6VtJ+qPuKr7gQIzzdV jSthNDzF2irjqMRQnSenXxG8cF4WuzmDfOcEpIoLash5zU2K5ih7+UH5rVViaMZ8EKm8 Kq/xTkazoOX4bQIa9JDkcyIGx2CiLcDxYvZbAp8bIbdEMZEX8fdXg5UtdamJWpoc3ATJ SuOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=p0MKv9MLeereOpdqp4/ju4WfXJfIR9HPdAiJse/OPeU=; b=j8Lq2mttAokh9hM/IQB2v17XQVXqzKACteaBcOo9KGe9F/8GNvliug9DQvmYJc2LQQ ty6rvHsmYmhUJpYCaFC4HFRfk9+koyuru2IH7SkZltMfilRYe9aLCXL4hC6O/3ttwcfU xvpBFHtmcWeuxYcnHaOTVSecC8SL2IIgAnl+nLaUl1BvAprHiy8OgXznYHyqZNl8aSvP muu1Oxs0yLb+oEgKMcFjYuZAMBHcyWh8nW9/DO2qqINhvsUvt5/TWFo7+TMj/AHqZ9ig mffTMR13HB77JaNbJPBnhipdl6P2zo4GfzuyFNR5tYzBkOPCHDDD9zUF4Tja4Wjd6N8N eFpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=pJjRJdr0; dkim=neutral (no key) header.i=@suse.de; 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=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 184-20020a6301c1000000b003faf1d213dcsi2185137pgb.687.2022.06.01.05.48.46; Wed, 01 Jun 2022 05:48:58 -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=@suse.de header.s=susede2_rsa header.b=pJjRJdr0; dkim=neutral (no key) header.i=@suse.de; 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=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235590AbiE3LIB (ORCPT + 99 others); Mon, 30 May 2022 07:08:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235466AbiE3LH6 (ORCPT ); Mon, 30 May 2022 07:07:58 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 713016D194 for ; Mon, 30 May 2022 04:07:57 -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 311FE21B3A; Mon, 30 May 2022 11:07:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1653908876; 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=p0MKv9MLeereOpdqp4/ju4WfXJfIR9HPdAiJse/OPeU=; b=pJjRJdr08h1S9f955jW068pEFv3RTUqlwfYZLqDC3hACmeWr3MliwdbgAGxZsBJMQfRSJh 2qo/Lxd4xZsUwg24ZSi8cGGciBTgeBAmhn36sxeTVrfwFaTKjaeBQjbeZ3VLo0vLoUK+VJ JioQlDEC2JXfXYMhLzZDgmRCwB+hJhg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1653908876; 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=p0MKv9MLeereOpdqp4/ju4WfXJfIR9HPdAiJse/OPeU=; b=xV2Nux3WDIJaiuvAgWNYozyQyEOPOFxaVsOFqn0WS4uS99hWx1Ra48XUlmETIPqn7RQg+R zAs1v3wTUHo1q6DQ== 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 F349413AFD; Mon, 30 May 2022 11:07:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +k16OoullGIyZwAAMHmgww (envelope-from ); Mon, 30 May 2022 11:07:55 +0000 Date: Mon, 30 May 2022 13:07:55 +0200 Message-ID: <87wne3wa5w.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: <20220530105329.GV38351@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> <871qwbxpsb.wl-tiwai@suse.de> <20220530105329.GV38351@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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Mon, 30 May 2022 12:53:29 +0200, Charles Keepax wrote: > > On Mon, May 30, 2022 at 12:45:08PM +0200, Takashi Iwai wrote: > > On Mon, 30 May 2022 12:34:15 +0200, > > Charles Keepax wrote: > > 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. > > > > I am afraid we do, basically all the Wolfson/Cirrus audio devices > allow you to select the firmware through a kctl. The patterns of > controls are specific to the firmwares, so we can't really create > them ahead of time. One could maybe look at changing when the > firmwares are loaded, such as attempting to load all possible > firmwares on boot or something but its a fairly sizable change > that isn't without some side effects. The call of request_firmawre() itself can be pretty lengthy (e.g. it may hold until user-space process uploads the firmware if the fallback mode is enabled), and it implies that the request_firmware() call doesn't fit well as the operation to be done in a kctl put callback. So, even if we accept the firmware loading behavior via kctl as-is, the whole procedure should be async in work instead; namely, not only kctl creation/deletion but both request_firmware() + post-process should be done in the work. And yet moreover, we'll need to consider some way for protecting against DoS-like behavior by frequent kctl changes. thanks, Takashi