From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7A856298CDC for ; Tue, 16 Dec 2025 03:50:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765857035; cv=none; b=KCeWLjIWrrP97I5sE/LgPcA3JK9mRz4U8UXeMFmQWxV2P8IE9KYw99e9TWIKRRXSsTbs3ZkCYj6+R9Sz5YTb2Le93ShIAkckfTEXxBWg1Qguiu1HEQAsAOGCZ2/T1vtoxegKTc6qkoAfX6YdokW5q3qZG49THLveGCStWBxJ6lE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765857035; c=relaxed/simple; bh=zD6FlwKJaVoNtWCZfjaDSR6qQQGTKyr+iBMjXjPhAY8=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=tgcCksxCX63Fk3imts++8Jxaa1rGXX39EQOOHL9bCCw1+EN6wok+TyGB4/be0OIdAaMlZMXjeSoL6/S7QlzRsaTkl0xMXnUFcgBkBwlFrwAcbBjxHg/vQldibYYkbxD8202OA7JFXvPv7AGpo/f+ZYRzROlGAmw0+5SpZkKGM7o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bM016Wgj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bM016Wgj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D25A7C4CEF1; Tue, 16 Dec 2025 03:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765857035; bh=zD6FlwKJaVoNtWCZfjaDSR6qQQGTKyr+iBMjXjPhAY8=; h=Date:Subject:To:References:From:In-Reply-To:From; b=bM016Wgj10h6pa34x4Rp1dAksc3lB9PpbbwYctSsIPsZMy4vo2m4b5a0BJWF8STgK r8CFsDHTlDVlfiVl1qn49KufXCPBXpFgxk5QxTI0NXDUIpmkPFlpqNNA7APdOGezAr Qm/8YedEX0KuN6d2AVwB1IU6TfxvitoEWOCWceVfC/izx7YYhjoGDDELp6ApQoOJyL Mmw1SHWhrh7w/aVISblZ5wuRVgYukrZsMXwTt9CG+4d8EQ37NPPrbvkr6LCMwa2fQC 6rD+xt10WHTwxSdLiTU13pHbDQHAfu4I1P6bW70aucCqW7CGoSA/Wdge9cP6q1ci1n Qfn7A3a8llAxQ== Message-ID: <08b8f446-7a60-4a33-9c01-4f6699ff81b6@kernel.org> Date: Mon, 15 Dec 2025 21:50:33 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] firmware: stratix10-svc: stop kernel thread once service is completed To: Khairul Anuar Romli , linux-kernel@vger.kernel.org, Richard Gong References: <0a9a763cca36775679f559d5682bf98a21d3d053.1765508283.git.khairul.anuar.romli@altera.com> Content-Language: en-US From: Dinh Nguyen In-Reply-To: <0a9a763cca36775679f559d5682bf98a21d3d053.1765508283.git.khairul.anuar.romli@altera.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/11/25 21:02, Khairul Anuar Romli wrote: > This patch resolves a customer-reported issue where the Stratix10 SVC > service layer caused maximum CPU utilization. The original logic only > stopped the thread if it was running and there was one or fewer active > clients. This overly restrictive condition prevented the thread from > stopping even when the application was active, leading to unnecessary CPU > consumption. > > The updated logic now stops the thread whenever it is running, regardless > of the number of active clients, ensuring better resource management and > resolving the performance issue. > > Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver") > Cc: stable@vger.kernel.org # 5.4+ > Signed-off-by: Richard Gong > Signed-off-by: Khairul Anuar Romli > --- > drivers/firmware/stratix10-svc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c > index e3f990d888d7..ec39522711ea 100644 > --- a/drivers/firmware/stratix10-svc.c > +++ b/drivers/firmware/stratix10-svc.c > @@ -1040,8 +1040,8 @@ EXPORT_SYMBOL_GPL(stratix10_svc_send); > */ > void stratix10_svc_done(struct stratix10_svc_chan *chan) > { > - /* stop thread when thread is running AND only one active client */ > - if (chan->ctrl->task && chan->ctrl->num_active_client <= 1) { > + /* stop thread when thread is running */ > + if (chan->ctrl->task) { > pr_debug("svc_smc_hvc_shm_thread is stopped\n"); > kthread_stop(chan->ctrl->task); > chan->ctrl->task = NULL; Applied! Thanks, Dinh