All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage
@ 2018-08-16  6:48 Prabhakar Kushwaha
  2018-08-23 15:11 ` York Sun
  0 siblings, 1 reply; 5+ messages in thread
From: Prabhakar Kushwaha @ 2018-08-16  6:48 UTC (permalink / raw)
  To: u-boot

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;
 }
-- 
2.14.1

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

* [U-Boot] [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage
  2018-08-16  6:48 [U-Boot] [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage Prabhakar Kushwaha
@ 2018-08-23 15:11 ` York Sun
  2018-08-24  3:13   ` Prabhakar Kushwaha
  0 siblings, 1 reply; 5+ messages in thread
From: York Sun @ 2018-08-23 15:11 UTC (permalink / raw)
  To: u-boot

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

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

* [U-Boot] [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage
  2018-08-23 15:11 ` York Sun
@ 2018-08-24  3:13   ` Prabhakar Kushwaha
  2018-08-24 14:53     ` York Sun
  0 siblings, 1 reply; 5+ messages in thread
From: Prabhakar Kushwaha @ 2018-08-24  3:13 UTC (permalink / raw)
  To: u-boot

Hi York

> -----Original Message-----
> From: York Sun
> Sent: Thursday, August 23, 2018 8:41 PM
> To: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>; u-
> boot at lists.denx.de
> Cc: joe.hershberger at ni.com; Ashish Kumar <ashish.kumar@nxp.com>;
> cristian.sovaiala at 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

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

* [U-Boot] [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage
  2018-08-24  3:13   ` Prabhakar Kushwaha
@ 2018-08-24 14:53     ` York Sun
  2018-08-25  0:53       ` Prabhakar Kushwaha
  0 siblings, 1 reply; 5+ messages in thread
From: York Sun @ 2018-08-24 14:53 UTC (permalink / raw)
  To: u-boot

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 at lists.denx.de
>> Cc: joe.hershberger at ni.com; Ashish Kumar <ashish.kumar@nxp.com>;
>> cristian.sovaiala at 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

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

* [U-Boot] [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage
  2018-08-24 14:53     ` York Sun
@ 2018-08-25  0:53       ` Prabhakar Kushwaha
  0 siblings, 0 replies; 5+ messages in thread
From: Prabhakar Kushwaha @ 2018-08-25  0:53 UTC (permalink / raw)
  To: u-boot

Thanks York,

> -----Original Message-----
> From: York Sun
> Sent: Friday, August 24, 2018 8:24 PM
> To: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>; u-
> boot at lists.denx.de
> Cc: joe.hershberger at ni.com; Ashish Kumar <ashish.kumar@nxp.com>;
> cristian.sovaiala at 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 at lists.denx.de
> >> Cc: joe.hershberger at ni.com; Ashish Kumar <ashish.kumar@nxp.com>;
> >> cristian.sovaiala at 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

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

end of thread, other threads:[~2018-08-25  0:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-16  6:48 [U-Boot] [PATCH] driver: net: fsl-mc: Memset MC reserve red memory before usage Prabhakar Kushwaha
2018-08-23 15:11 ` York Sun
2018-08-24  3:13   ` Prabhakar Kushwaha
2018-08-24 14:53     ` York Sun
2018-08-25  0:53       ` Prabhakar Kushwaha

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.