Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1036803lqm; Thu, 2 May 2024 03:28:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTChGE0ucfSg1pEHMg3waAmuLGnJ3XrA3ayar8Z/ijlgd4vLdwv/h0bsjXk4RKXlzB5Ve/vXluApgw+iZpTnPZUcR33qoQKggDZiz0dQ== X-Google-Smtp-Source: AGHT+IGiWLan4P4XpGqPJXFr4wg4hfJOaIS54aH7mR9QtSOH4EefnlNFuUCJkN4uJ6BAk9vEtCBr X-Received: by 2002:a05:6a21:2d86:b0:1af:66e6:bfdf with SMTP id ty6-20020a056a212d8600b001af66e6bfdfmr6677128pzb.15.1714645705984; Thu, 02 May 2024 03:28:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714645705; cv=pass; d=google.com; s=arc-20160816; b=UQMpgKLBNF4C2rDkYCTD5M+Yf9GvY6TJjeBlmWGEMQc3Au36uMPMHW3O5yyyh9ZSCj zTzwNSBh1XVi163kkynZQV67iNIvHmNaFGp5ZT9IrOEzpHzzO2ZL3aNd7v03aMpuWqdP WYYnBoFJOcG2DYsdBXEoHaf3qNML9usyWD8sQ2djVE65p+wgXWBxLZgebr2ByqFUxcLS YiEUzC+tW0l1IECyThEqaqsAKeWiF8uMY6CU7YUZH39hLGYHi2BtfNSICEUCMovLba/B piOdCIEX2WgMWNDf3e25ruyEmqGRBR2RwP6f1I9PRS7Y2U/20T84gxHppEjTFQ1kMgry oB/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=thread-index:content-language:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:in-reply-to:references:cc:to:from :dkim-signature; bh=JdCKGuzvpPEqIMdCQbeQSVDZQ5P0ciLsz3huW76jYp8=; fh=7DPYhrUX24xPo1n6lvdiGTE3WqU/GkSJzI+/DAYez+o=; b=zf+9N6eT9X8DotG0Z7fXGVYeSB0SviJRRofxkiyWFUl2x4oG5fNgfNCY6vbxCnDUsg PvaK2o5KxGWcApPJ9srB5iOeJ4GjbteyjrPt2K+5v6lJ5omoPkzl6x4Il6BU9a9IkcO+ m7kznH7F0r4oknrzLiL1leIqs09+rGnKMYPQ9H90eMZZRn8hxKeRrpvkY9ybTxEf6/Y7 CNOBlRu+h6JrTrajnHbv0L/1ttJ68+JO47yJtnGJU5SJlgZsd1F3P+nJ/UQEvONQYggl VeGfn2PGy7u26MzEssB3iins/KieDKkosTcgLswQvjXDCrspJu9Tuc1mj5sCKF9BhxZs 6YYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=EE2eePhF; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-166293-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166293-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h8-20020a170902f54800b001e197cea248si725597plf.607.2024.05.02.03.28.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 03:28:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166293-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=EE2eePhF; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-166293-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166293-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 25024B24A8C for ; Thu, 2 May 2024 10:18:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 665DC5812B; Thu, 2 May 2024 10:18:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="EE2eePhF" Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A549856440; Thu, 2 May 2024 10:17:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.152.168 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714645080; cv=none; b=WlCe91D3tsdqbt7FYkfmCQ5r6htq9gxPVeDu1eSRdjNC7j4yF8lNHV9zdupfOVP6Mc9JAJ6hiRwHho8x+sCGbQJCDf11F+xz3VZy+Acqq6d2y1USJsrDeS4ijcnkorkDs7XPzXRno+qtRN3RyYc9mLqux6f1D6jakKgElUa3mQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714645080; c=relaxed/simple; bh=sbIV7C29RJ+T1lX+E8sZCLiaBYd2zk0Nq7Q0l2njHYc=; h=From:To:CC:References:In-Reply-To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=P7+ijyb8BYB3e8CjW6lI2dDDs9uxJthPPkgckde4N5qhP8RlaWIv1fBw/1PcS2R/yamwZofUPIydUfliZQaitAu0TeN36cYqvKObniObfOFu1dfm5xGg8JIXadLVrVlo7n9MqgpbmhMegJcxJhvXNeBCqQuq0VXoTFhDmkCoSpo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=EE2eePhF; arc=none smtp.client-ip=67.231.152.168 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4426QJF9029883; Thu, 2 May 2024 05:17:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-type:content-transfer-encoding; s= PODMain02222019; bh=JdCKGuzvpPEqIMdCQbeQSVDZQ5P0ciLsz3huW76jYp8=; b= EE2eePhFPzsI7/YYwR5McN4859a9PNTQSg9lbQsFwtzusPmyb/B93xdyjYka+m9D Rh4rZpxJW6mwC+QACdnwDHdSjIqKeTGLsh0+zjlAi6q5eGhyi1dWBLN6lbDZ8aD1 3U6Blx67/CVKVc0YOP/2W4oJU0+VPqAAAWn7P7EdMSTaJM4QlvIl8lf49H0TEf85 4ZtwdNOKYcPK8UvtNyKE62Rz1rREPEI3vLs5EzqhBy5xB26FqKr4K5hR69tL46p+ F8RF6tAP2qLpjo8cfNnTLcuhA4z/KPWJSBxxWVSbnGg1y2RaKO6vOuMkEvcSq1kq BmkiNk50xLSJmCnpYakrwQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3xv0e8gaw7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 May 2024 05:17:50 -0500 (CDT) Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 2 May 2024 11:17:48 +0100 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9 via Frontend Transport; Thu, 2 May 2024 11:17:48 +0100 Received: from EDIN6ZZ2FY3 (EDIN6ZZ2FY3.ad.cirrus.com [198.61.64.231]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id 5FC71820244; Thu, 2 May 2024 10:17:48 +0000 (UTC) From: Simon Trimmer To: 'Takashi Iwai' , 'Richard Fitzgerald' CC: , , , , References: <20240501111755.21231-1-simont@opensource.cirrus.com> <87ttjgk6ph.wl-tiwai@suse.de> <87h6fgk0ba.wl-tiwai@suse.de> In-Reply-To: <87h6fgk0ba.wl-tiwai@suse.de> Subject: RE: [PATCH] ALSA: hda: cs35l56: Perform firmware download in the background Date: Thu, 2 May 2024 11:17:48 +0100 Message-ID: <001401da9c79$fb9f2de0$f2dd89a0$@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: en-gb Thread-Index: AQBvb2ocE+GAzujRRIysQCID0b/eEwD72286AkBBwPkCXIFon7QtT9tg X-Proofpoint-ORIG-GUID: 5tfCnV5rEW5f9pYu0v8QANcb2UyW5qKv X-Proofpoint-GUID: 5tfCnV5rEW5f9pYu0v8QANcb2UyW5qKv X-Proofpoint-Spam-Reason: safe > -----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 Cheers, -Simon