From: Marcin Wojtas <mw@semihalf.com>
To: edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, ard.biesheuvel@linaro.org,
mw@semihalf.com, jsd@semihalf.com, jinghua@marvell.com,
jaz@semihalf.com, nadavh@marvell.com
Subject: [platforms PATCH 1/1] Marvell/Drivers: Pp2Dxe: Fix cleaning of the BM pools
Date: Thu, 7 Jun 2018 14:55:18 +0200 [thread overview]
Message-ID: <1528376118-19690-1-git-send-email-mw@semihalf.com> (raw)
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
next reply other threads:[~2018-06-07 12:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-07 12:55 Marcin Wojtas [this message]
2018-06-07 13:03 ` [platforms PATCH 1/1] Marvell/Drivers: Pp2Dxe: Fix cleaning of the BM pools Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1528376118-19690-1-git-send-email-mw@semihalf.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox