lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ead8789-381d-2358-0c11-95b3350ca63e@kernel.org>
Date:   Fri, 12 Nov 2021 13:35:13 -0600
From:   Dinh Nguyen <dinguyen@...nel.org>
To:     Meng Li <Meng.Li@...driver.com>, gregkh@...uxfoundation.org
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] driver: firmware: stratix10-svc: schedule thread out when
 there is no data reveived



On 11/9/21 1:46 AM, Meng Li wrote:
> From: Meng Li <meng.li@...driver.com>
> 
> In thread svc_normal_to_secure_thread(), function kfifo_out_spinlocked()
> always return, so this thread can't release cpu even if there is no data
> received, and cause cpu is under heave load status. System performance

do you mean "heavy"?

> is poor.
> 
> This issue is introduced by commit 7ca5ce896524("firmware: add Intel
> Stratix10 service layer driver")
> 
> Therefore, schedule this thread out when there is no data reveived, and

s/reveived/received

> wake it up after sending data to it.
> 
> Fixes: 7ca5ce896524 ("firmware: add Intel Stratix10 service layer driver")
> Cc: stable@...r.kernel.org
> Signed-off-by: Meng Li <Meng.Li@...driver.com>
> ---
>   drivers/firmware/stratix10-svc.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/stratix10-svc.c b/drivers/firmware/stratix10-svc.c
> index 2a7687911c09..ddb86d441726 100644
> --- a/drivers/firmware/stratix10-svc.c
> +++ b/drivers/firmware/stratix10-svc.c
> @@ -365,8 +365,10 @@ static int svc_normal_to_secure_thread(void *data)
>   						pdata, sizeof(*pdata),
>   						&ctrl->svc_fifo_lock);
>   
> -		if (!ret_fifo)
> +		if (!ret_fifo) {
> +			schedule_timeout_interruptible(MAX_SCHEDULE_TIMEOUT);
>   			continue;
> +		}
>   
>   		pr_debug("get from FIFO pa=0x%016x, command=%u, size=%u\n",
>   			 (unsigned int)pdata->paddr, pdata->command,
> @@ -861,6 +863,7 @@ int stratix10_svc_send(struct stratix10_svc_chan *chan, void *msg)
>   	ret = kfifo_in_spinlocked(&chan->ctrl->svc_fifo, p_data,
>   				  sizeof(*p_data),
>   				  &chan->ctrl->svc_fifo_lock);
> +	wake_up_process(chan->ctrl->task);
>   
>   	kfree(p_data);
>   
> 

I've made above spelling fixes and have applied it.

Thanks,
Dinh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ