Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1035802lqm; Thu, 2 May 2024 03:25:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXd+FlInnhQ4GyrIsQArq5Hyl0avcBzNlmh6QhDelxKg1FSNmErpsamgnjnNkchsyVww5uORsAN4yVOTyLOqiFtJYj0HRqbyb3Q9kwcbQ== X-Google-Smtp-Source: AGHT+IFNC6OwP5F0k2woQW2poG7VWZDZuGsq3mhz280shAiZ1OVxp12ZbMvYK+QDErcAKQae5xDz X-Received: by 2002:a17:906:a0c2:b0:a58:7832:c278 with SMTP id bh2-20020a170906a0c200b00a587832c278mr3433531ejb.63.1714645551630; Thu, 02 May 2024 03:25:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714645551; cv=pass; d=google.com; s=arc-20160816; b=inOKkOrCViUYEG91D2kR1OAfD1Yr9c3S7CSAYhTKb2QRAUPlnumm7PghLarCThVrwv CJk97uIFXwp5RdtV79B4DPGVoW2v4ggsplEqQrBTgZOkhe7onjrnjBVKlW8BFMgV5FFT Xh1hwz7zUqJPvIFVA/hg3VSJzqw19CVpJmgix1Ew6728DV4M2SceUd73ZVLAHiSlkPHs e2w5BrWuIwMHtWEf9udMiIh6SL9l3HVA7eezODkIa++oRAOPqBsfpaXgc2OC4kvgkEPa gQgGEAz1awujZz1qDx/CWL++tELnAnKFCKcF6ZUL96gch4yaiNAG3u2/cnkmQu/Qj4KH aoUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date:dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=nRNsEWuTL5AgiSXgw65Rfs9x849N3wWjfMiLj4+bsbA=; fh=Jx1bcBY3p6Xe1YjXLgePC+3vwiKTxOskaBRxG2LKpgw=; b=p+xqBG1Z/DY4cJunGXvM6kPTZ6bpBaPufADCeibgfVssqId7lUnoKC1BURbCtC2Nj6 nv9uObX24OBGC4/F/L8xY/l3ZgvfK9kmYF9HZ7u2x8pj7yZ0n2Wn0lstGHYsdeji/mWX +hArRDS0CdNaQLR/3MTf2VS82G9bAXvB8JVyw+to/O1cpUlQrwkorzmSUiGzr8zzymwJ scdxd3WlJAfRIpQHPOAFLAHnDTZ9xxF6u7uK9uZXFDDezsU/v52GW3wERhjp1zWejg83 uK+hc90c8yu8Lw5J9+LYxzTma1uHY6ur+8nx5ezuNh4Lucj9u4ywXQBPGxbq0NtZG0S9 zDSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=wtklsYGQ; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=wtklsYGQ; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-166299-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166299-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r6-20020a170906c28600b00a55484a1a00si368239ejz.321.2024.05.02.03.25.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 03:25:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166299-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=wtklsYGQ; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=wtklsYGQ; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-166299-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166299-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 39E2E1F23BAD for ; Thu, 2 May 2024 10:25:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 406E858AA1; Thu, 2 May 2024 10:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="wtklsYGQ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="8PRz+hei"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="wtklsYGQ"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="8PRz+hei" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D00953373; Thu, 2 May 2024 10:25:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714645542; cv=none; b=EZPLJEblAa4gt42UHWXGhccx7cp4xNjqfxdfC5ySX+j4gH1+9j70UB+NeFbXCnBu9b/OSVTNHu2wmoYEGOww5yIDWef9dkDorbgfAzIkuuN47JGOWfjevYRjvXhmfsurxYlZegGopiFm9mPeOZRKue3q8QagHW5H4O67DmcPkIU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714645542; c=relaxed/simple; bh=9TkTZ57YAAxNkPWthAJ9DpDRSGTHMSlyYmnHgN70MRQ=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=tJqfetCmssahrIofnKYQm/V/rQUd7iLba4caWyNEebH7TYjEoGXgggYV8W92JvnB61NNSnaxmaew2A0tQ06pF/Vfns4VF2ORHhDjvcNsAoGq1qKZ10W41PVHyZjcto+QrKLHHIfp4LZHC1SYICSO1S8+7DGFBBvuLLe3HOCI+oM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=wtklsYGQ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=8PRz+hei; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=wtklsYGQ; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=8PRz+hei; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (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 smtp-out1.suse.de (Postfix) with ESMTPS id B4BA3351D9; Thu, 2 May 2024 10:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1714645538; 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=nRNsEWuTL5AgiSXgw65Rfs9x849N3wWjfMiLj4+bsbA=; b=wtklsYGQzF6Cm63lDgSKIu0L0JY8LoTvP/AoFzxBCbF7xkEdqOu8IoVjaVNhcRDeNdrioN bJJwrfzuegzGjd6bTgMHDhQxVEuMAadiuII9QGkOkzPzgTTF3C8/QIxw6uIcFTG1O18LZQ NbJy+b+lmDtrQE9wqfFV9McxLM7uqm0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1714645538; 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=nRNsEWuTL5AgiSXgw65Rfs9x849N3wWjfMiLj4+bsbA=; b=8PRz+heicRrv7NM8CC8qiY3ggk0EhJQwXI5W/UqEXFvRTSNhVMPZlK9eW2jHn+gOV+C63V /UhLosmJ02y38vBw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1714645538; 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=nRNsEWuTL5AgiSXgw65Rfs9x849N3wWjfMiLj4+bsbA=; b=wtklsYGQzF6Cm63lDgSKIu0L0JY8LoTvP/AoFzxBCbF7xkEdqOu8IoVjaVNhcRDeNdrioN bJJwrfzuegzGjd6bTgMHDhQxVEuMAadiuII9QGkOkzPzgTTF3C8/QIxw6uIcFTG1O18LZQ NbJy+b+lmDtrQE9wqfFV9McxLM7uqm0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1714645538; 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=nRNsEWuTL5AgiSXgw65Rfs9x849N3wWjfMiLj4+bsbA=; b=8PRz+heicRrv7NM8CC8qiY3ggk0EhJQwXI5W/UqEXFvRTSNhVMPZlK9eW2jHn+gOV+C63V /UhLosmJ02y38vBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7080B1386E; Thu, 2 May 2024 10:25:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id xj3uGSJqM2bfDgAAD6G6ig (envelope-from ); Thu, 02 May 2024 10:25:38 +0000 Date: Thu, 02 May 2024 12:25:51 +0200 Message-ID: <87edakjys0.wl-tiwai@suse.de> From: Takashi Iwai To: Simon Trimmer Cc: 'Richard Fitzgerald' , , , , , Subject: Re: [PATCH] ALSA: hda: cs35l56: Perform firmware download in the background In-Reply-To: <001401da9c79$fb9f2de0$f2dd89a0$@opensource.cirrus.com> References: <20240501111755.21231-1-simont@opensource.cirrus.com> <87ttjgk6ph.wl-tiwai@suse.de> <87h6fgk0ba.wl-tiwai@suse.de> <001401da9c79$fb9f2de0$f2dd89a0$@opensource.cirrus.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Level: X-Spamd-Result: default: False [-3.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_TLS_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email,cirrus.com:email,alsa-project.org:email] X-Spam-Score: -3.30 X-Spam-Flag: NO On Thu, 02 May 2024 12:17:48 +0200, Simon Trimmer wrote: > > > -----Original Message----- > > From: Takashi Iwai > > Sent: Thursday, May 2, 2024 10:53 AM > > To: Richard Fitzgerald > > Cc: Simon Trimmer ; tiwai@suse.com; linux- > > sound@vger.kernel.org; alsa-devel@alsa-project.org; linux- > > kernel@vger.kernel.org; patches@opensource.cirrus.com > > Subject: Re: [PATCH] ALSA: hda: cs35l56: Perform firmware download in the > > background > > > > On Thu, 02 May 2024 11:21:36 +0200, > > Richard Fitzgerald wrote: > > > > > > On 02/05/2024 08:34, Takashi Iwai wrote: > > > > On Wed, 01 May 2024 13:17:55 +0200, > > > > Simon Trimmer wrote: > > > >> @@ -964,6 +1011,14 @@ int cs35l56_hda_common_probe(struct > > cs35l56_hda *cs35l56, int hid, int id) > > > >> mutex_init(&cs35l56->base.irq_lock); > > > >> dev_set_drvdata(cs35l56->base.dev, cs35l56); > > > >> + cs35l56->dsp_wq = > > > >> create_singlethread_workqueue("cs35l56-dsp"); > > > >> + if (!cs35l56->dsp_wq) { > > > >> + ret = -ENOMEM; > > > >> + goto err; > > > >> + } > > > > > > > > Do we really need a dedicated workqueue? In most usages, simple > > > > schedule_work*() works fine and is recommended. > > > > > > > > > > On a slow I2C bus with 4 amps this work could take over 2 seconds. > > > That seems too long to be blocking a global system queue. We use a > > > dedicated queue in the ASoC driver. > > > > > > Also if we queue work on an ordered (single-threaded) system queue the > > > firmware won't be downloaded to multiple amps in parallel, so we don't > > > get the best use of the available bus bandwidth. > > > > OK, that sounds like a sensible argument. > > > > But the patch has no call of a queue destructor. Won't it leak > > resources? > > Oops that's a good spot - I missed that and will send a v2 If you submit a newer version, it'd be appreciated to explain about the workqueue usage in the patch description, too. thanks, Takashi