mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] firmware: stratix10-svc: stop kernel thread once service is completed
       [not found] <cover.1765508283.git.khairul.anuar.romli@altera.com>
@ 2025-12-12  3:02 ` Khairul Anuar Romli
  2025-12-16  3:50   ` Dinh Nguyen
  0 siblings, 1 reply; 4+ messages in thread
From: Khairul Anuar Romli @ 2025-12-12  3:02 UTC (permalink / raw)
  To: Dinh Nguyen, linux-kernel, Richard Gong, Khairul Anuar Romli

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 <richard.gong@intel.com>
Signed-off-by: Khairul Anuar Romli <khairul.anuar.romli@altera.com>
---
 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;
-- 
2.43.7


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] firmware: stratix10-svc: stop kernel thread once service is completed
  2025-12-12  3:02 ` [PATCH 1/1] firmware: stratix10-svc: stop kernel thread once service is completed Khairul Anuar Romli
@ 2025-12-16  3:50   ` Dinh Nguyen
  2025-12-16  5:01     ` Romli, Khairul Anuar
  0 siblings, 1 reply; 4+ messages in thread
From: Dinh Nguyen @ 2025-12-16  3:50 UTC (permalink / raw)
  To: Khairul Anuar Romli, linux-kernel, Richard Gong



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 <richard.gong@intel.com>
> Signed-off-by: Khairul Anuar Romli <khairul.anuar.romli@altera.com>
> ---
>   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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] firmware: stratix10-svc: stop kernel thread once service is completed
  2025-12-16  3:50   ` Dinh Nguyen
@ 2025-12-16  5:01     ` Romli, Khairul Anuar
  0 siblings, 0 replies; 4+ messages in thread
From: Romli, Khairul Anuar @ 2025-12-16  5:01 UTC (permalink / raw)
  To: Dinh Nguyen, linux-kernel

On 16/12/2025 11:50 am, Dinh Nguyen wrote:
> 
> 
> 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 <richard.gong@intel.com>
>> Signed-off-by: Khairul Anuar Romli <khairul.anuar.romli@altera.com>
>> ---
>>   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
> 

Cool. Thanks Dinh.

Best Regards,
Khairul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] firmware: stratix10-svc: stop kernel thread once service is completed
       [not found] <cover.1762416980.git.khairul.anuar.romli@altera.com>
@ 2025-11-06  8:37 ` Khairul Anuar Romli
  0 siblings, 0 replies; 4+ messages in thread
From: Khairul Anuar Romli @ 2025-11-06  8:37 UTC (permalink / raw)
  To: Dinh Nguyen, linux-kernel, Richard Gong, Khairul Anuar Romli

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 <richard.gong@intel.com>
Signed-off-by: Khairul Anuar Romli <khairul.anuar.romli@altera.com>
---
 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;
-- 
2.43.7


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-16  5:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1765508283.git.khairul.anuar.romli@altera.com>
2025-12-12  3:02 ` [PATCH 1/1] firmware: stratix10-svc: stop kernel thread once service is completed Khairul Anuar Romli
2025-12-16  3:50   ` Dinh Nguyen
2025-12-16  5:01     ` Romli, Khairul Anuar
     [not found] <cover.1762416980.git.khairul.anuar.romli@altera.com>
2025-11-06  8:37 ` Khairul Anuar Romli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®