public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [platforms PATCH 1/1] Marvell/Drivers: Pp2Dxe: Fix cleaning of the BM pools
@ 2018-06-07 12:55 Marcin Wojtas
  2018-06-07 13:03 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Wojtas @ 2018-06-07 12:55 UTC (permalink / raw)
  To: edk2-devel; +Cc: leif.lindholm, ard.biesheuvel, mw, jsd, jinghua, jaz, nadavh

Hitherto mechanism of using static flag indicating
Buffer Manager disabled state was wrong and resulted
in cleaning only one controller's pools. This caused
bad page state when OS booted and attempted to
use the buffers.

This patch implements a fix, ensuring all controllers
will clean the Buffer Manager during ExitBootServices.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c | 7 ++++---
 Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.h | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c b/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c
index b0a38b3..3ed10f6 100644
--- a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c
+++ b/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c
@@ -258,6 +258,8 @@ Pp2DxeBmStart (
     }
   }
 
+  Mvpp2Shared->BmEnabled = TRUE;
+
   return EFI_SUCCESS;
 }
 
@@ -669,15 +671,14 @@ Pp2DxeHalt (
   PP2DXE_CONTEXT *Pp2Context = Context;
   PP2DXE_PORT *Port = &Pp2Context->Port;
   MVPP2_SHARED *Mvpp2Shared = Pp2Context->Port.Priv;
-  STATIC BOOLEAN CommonPartHalted = FALSE;
   INTN Index;
 
-  if (!CommonPartHalted) {
+  if (Mvpp2Shared->BmEnabled) {
     for (Index = 0; Index < MVPP2_MAX_PORT; Index++) {
       Mvpp2BmStop(Mvpp2Shared, Index);
     }
 
-    CommonPartHalted = TRUE;
+    Mvpp2Shared->BmEnabled = FALSE;
   }
 
   Mvpp2TxqDrainSet(Port, 0, TRUE);
diff --git a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.h b/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.h
index 60f40be..b8a5dae 100644
--- a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.h
+++ b/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.h
@@ -290,6 +290,7 @@ typedef struct {
 
   /* BM pools */
   MVPP2_BMS_POOL *BmPools[MVPP2_MAX_PORT];
+  BOOLEAN BmEnabled;
 
   /* PRS shadow table */
   MVPP2_PRS_SHADOW *PrsShadow;
-- 
2.7.4



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

* Re: [platforms PATCH 1/1] Marvell/Drivers: Pp2Dxe: Fix cleaning of the BM pools
  2018-06-07 12:55 [platforms PATCH 1/1] Marvell/Drivers: Pp2Dxe: Fix cleaning of the BM pools Marcin Wojtas
@ 2018-06-07 13:03 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2018-06-07 13:03 UTC (permalink / raw)
  To: Marcin Wojtas
  Cc: edk2-devel@lists.01.org, Leif Lindholm, Jan Dąbroś,
	Hua Jing, Grzegorz Jaszczyk, Nadav Haklai

On 7 June 2018 at 14:55, Marcin Wojtas <mw@semihalf.com> wrote:
> Hitherto mechanism of using static flag indicating
> Buffer Manager disabled state was wrong and resulted
> in cleaning only one controller's pools. This caused
> bad page state when OS booted and attempted to
> use the buffers.
>
> This patch implements a fix, ensuring all controllers
> will clean the Buffer Manager during ExitBootServices.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Pushed as 1e918658459577c6c6a865b835fa9fb460045b6d

> ---
>  Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c | 7 ++++---
>  Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.h | 1 +
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c b/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c
> index b0a38b3..3ed10f6 100644
> --- a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c
> +++ b/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c
> @@ -258,6 +258,8 @@ Pp2DxeBmStart (
>      }
>    }
>
> +  Mvpp2Shared->BmEnabled = TRUE;
> +
>    return EFI_SUCCESS;
>  }
>
> @@ -669,15 +671,14 @@ Pp2DxeHalt (
>    PP2DXE_CONTEXT *Pp2Context = Context;
>    PP2DXE_PORT *Port = &Pp2Context->Port;
>    MVPP2_SHARED *Mvpp2Shared = Pp2Context->Port.Priv;
> -  STATIC BOOLEAN CommonPartHalted = FALSE;
>    INTN Index;
>
> -  if (!CommonPartHalted) {
> +  if (Mvpp2Shared->BmEnabled) {
>      for (Index = 0; Index < MVPP2_MAX_PORT; Index++) {
>        Mvpp2BmStop(Mvpp2Shared, Index);
>      }
>
> -    CommonPartHalted = TRUE;
> +    Mvpp2Shared->BmEnabled = FALSE;
>    }
>
>    Mvpp2TxqDrainSet(Port, 0, TRUE);
> diff --git a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.h b/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.h
> index 60f40be..b8a5dae 100644
> --- a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.h
> +++ b/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.h
> @@ -290,6 +290,7 @@ typedef struct {
>
>    /* BM pools */
>    MVPP2_BMS_POOL *BmPools[MVPP2_MAX_PORT];
> +  BOOLEAN BmEnabled;
>
>    /* PRS shadow table */
>    MVPP2_PRS_SHADOW *PrsShadow;
> --
> 2.7.4
>


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

end of thread, other threads:[~2018-06-07 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-07 12:55 [platforms PATCH 1/1] Marvell/Drivers: Pp2Dxe: Fix cleaning of the BM pools Marcin Wojtas
2018-06-07 13:03 ` Ard Biesheuvel

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