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: <20230116164301.GA3239767@p14s>
Date:   Mon, 16 Jan 2023 09:43:01 -0700
From:   Mathieu Poirier <mathieu.poirier@...aro.org>
To:     Devarsh Thakkar <devarsht@...com>
Cc:     andersson@...nel.org, devicetree@...r.kernel.org,
        p.zabel@...gutronix.de, linux-remoteproc@...r.kernel.org,
        robh+dt@...nel.org, linux-kernel@...r.kernel.org,
        krzysztof.kozlowski+dt@...aro.org, s-anna@...com, hnagalla@...com,
        praneeth@...com, nm@...com, vigneshr@...com, a-bhatia1@...com,
        j-luthra@...com
Subject: Re: [PATCH v6 1/3] remoteproc: k3-r5: Simplify single core config set

On Mon, Jan 16, 2023 at 08:49:04PM +0530, Devarsh Thakkar wrote:
> The config PROC_BOOT_CFG_FLAG_R5_SINGLE_CORE
> is set only when cluster mode is set to
> CLUSTER_MODE_SINGLECPU and cluster mode
> is already configured before setting this config.
> 
> So directly check for cluster mode instead of checking
> soc_data->single_cpu_mode first and then checking
> cluster mode.
> 
> Signed-off-by: Devarsh Thakkar <devarsht@...com>
> ---
> V6: No change
> ---
>  drivers/remoteproc/ti_k3_r5_remoteproc.c | 17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> index 0481926c6975..036c9dc217f3 100644
> --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
> +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> @@ -875,15 +875,14 @@ static int k3_r5_rproc_configure(struct k3_r5_rproc *kproc)
>  	boot_vec = 0x0;
>  	if (core == core0) {
>  		clr_cfg = PROC_BOOT_CFG_FLAG_R5_TEINIT;
> -		if (cluster->soc_data->single_cpu_mode) {
> -			/*
> -			 * Single-CPU configuration bit can only be configured
> -			 * on Core0 and system firmware will NACK any requests
> -			 * with the bit configured, so program it only on
> -			 * permitted cores
> -			 */
> -			if (cluster->mode == CLUSTER_MODE_SINGLECPU)
> -				set_cfg = PROC_BOOT_CFG_FLAG_R5_SINGLE_CORE;
> +		/*
> +		 * Single-CPU configuration bit can only be configured
> +		 * on Core0 and system firmware will NACK any requests
> +		 * with the bit configured, so program it only on
> +		 * permitted cores
> +		 */
> +		if (cluster->mode == CLUSTER_MODE_SINGLECPU) {
> +			set_cfg = PROC_BOOT_CFG_FLAG_R5_SINGLE_CORE;

This is exactly the kind of buggy situation I want to avoid by asking to use
soc_data->single_cpu_mode only in probe().

>  		} else {
>  			/*
>  			 * LockStep configuration bit is Read-only on Split-mode
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ