[U-Boot] [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage

It is not necessary for MC memory to be always clean. It may have garbage value causing indeterministic behavior during MC initialization and run.
So memset memory reserved for MC before any usage.
Signed-off-by: Prabhakar Kushwaha prabhakar.kushwaha@nxp.com --- drivers/net/fsl-mc/mc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index 940025a467..38afcf9222 100644 --- a/drivers/net/fsl-mc/mc.c +++ b/drivers/net/fsl-mc/mc.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2014 Freescale Semiconductor, Inc. - * Copyright 2017 NXP + * Copyright 2017-2018 NXP */ #include <common.h> #include <errno.h> @@ -810,6 +810,8 @@ u64 mc_get_dram_addr(void) { size_t mc_ram_size = mc_get_dram_block_size();
+ memset((void *)gd->arch.resv_ram, 0, mc_ram_size); + return (gd->arch.resv_ram + mc_ram_size - 1) & MC_RAM_BASE_ADDR_ALIGNMENT_MASK; }

On 08/15/2018 11:49 PM, Prabhakar Kushwaha wrote:
It is not necessary for MC memory to be always clean. It may have garbage value causing indeterministic behavior during MC initialization and run.
So memset memory reserved for MC before any usage.
Your commit message seems wrong. If it is not necessary to be clean, why it causes problems? I guess you mean the memory needs to be clean.
York

Hi York
-----Original Message----- From: York Sun Sent: Thursday, August 23, 2018 8:41 PM To: Prabhakar Kushwaha prabhakar.kushwaha@nxp.com; u- boot@lists.denx.de Cc: joe.hershberger@ni.com; Ashish Kumar ashish.kumar@nxp.com; cristian.sovaiala@nxp.co Subject: Re: [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage
On 08/15/2018 11:49 PM, Prabhakar Kushwaha wrote:
It is not necessary for MC memory to be always clean. It may have garbage value causing indeterministic behavior during MC initialization and run.
So memset memory reserved for MC before any usage.
Your commit message seems wrong. If it is not necessary to be clean, why it causes problems? I guess you mean the memory needs to be clean.
Yes. You are right. Commit message should be memory needs to be clean before passing to management complex.
May I send v2 version for the same.
--pk

On 08/23/2018 08:13 PM, Prabhakar Kushwaha wrote:
Hi York
-----Original Message----- From: York Sun Sent: Thursday, August 23, 2018 8:41 PM To: Prabhakar Kushwaha prabhakar.kushwaha@nxp.com; u- boot@lists.denx.de Cc: joe.hershberger@ni.com; Ashish Kumar ashish.kumar@nxp.com; cristian.sovaiala@nxp.co Subject: Re: [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage
On 08/15/2018 11:49 PM, Prabhakar Kushwaha wrote:
It is not necessary for MC memory to be always clean. It may have garbage value causing indeterministic behavior during MC initialization and run.
So memset memory reserved for MC before any usage.
Your commit message seems wrong. If it is not necessary to be clean, why it causes problems? I guess you mean the memory needs to be clean.
Yes. You are right. Commit message should be memory needs to be clean before passing to management complex.
May I send v2 version for the same.
You can either send v2 patch. Or if you don't have other update, I can fix the commit message when merging.
York

Thanks York,
-----Original Message----- From: York Sun Sent: Friday, August 24, 2018 8:24 PM To: Prabhakar Kushwaha prabhakar.kushwaha@nxp.com; u- boot@lists.denx.de Cc: joe.hershberger@ni.com; Ashish Kumar ashish.kumar@nxp.com; cristian.sovaiala@nxp.co Subject: Re: [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage
On 08/23/2018 08:13 PM, Prabhakar Kushwaha wrote:
Hi York
-----Original Message----- From: York Sun Sent: Thursday, August 23, 2018 8:41 PM To: Prabhakar Kushwaha prabhakar.kushwaha@nxp.com; u- boot@lists.denx.de Cc: joe.hershberger@ni.com; Ashish Kumar ashish.kumar@nxp.com; cristian.sovaiala@nxp.co Subject: Re: [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage
On 08/15/2018 11:49 PM, Prabhakar Kushwaha wrote:
It is not necessary for MC memory to be always clean. It may have garbage value causing indeterministic behavior during MC initialization and run.
So memset memory reserved for MC before any usage.
Your commit message seems wrong. If it is not necessary to be clean, why it causes problems? I guess you mean the memory needs to be clean.
Yes. You are right. Commit message should be memory needs to be clean before passing to
management complex.
May I send v2 version for the same.
You can either send v2 patch. Or if you don't have other update, I can fix the commit message when merging.
I will send v2 of this patch as I recently found one issue after applying this patch.
--pk
participants (2)
-
Prabhakar Kushwaha
-
York Sun