Skip to content

Commit

Permalink
Fix create goal issue when using -dimm to create goals on a subset of…
Browse files Browse the repository at this point in the history
… DIMMs

When the -dimm target is used in create goal to specify DCPMMs
on different sockets and the total number of DCPMMs specified
is equal to the number of DCPMMs on a socket, the call to the
IsConfigureWholeSocket() function inside of
VerifyCreatingSupportedRegionConfigs() will succeed incorrectly.
Instead of filtering out which specified DCPMMs are on which
sockets, removing the call entirely fixes the issue with minimal
overhead.

Signed-off-by: Chris N. Johnson <[email protected]>
  • Loading branch information
chrisnjohnson authored and StevenPontsler committed Dec 10, 2019
1 parent d919d32 commit 1a06349
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions DcpmPkg/driver/Core/Region.c
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,6 @@ VerifyCreatingSupportedRegionConfigs(
LIST_ENTRY *pDimmNode = NULL;
UINT32 Socket = 0;
UINT32 Index = 0;
BOOLEAN WholeSocket = FALSE;
UINT32 ExistingADNonInterleavedRegions = 0;
UINT32 ExistingVolatileRegions = 0;
UINT32 NumOfDimmsOnSocket = 0;
Expand All @@ -1805,14 +1804,6 @@ VerifyCreatingSupportedRegionConfigs(
NumOfDimmsOnSocket = 0;
ExistingADNonInterleavedRegions = 0;
ExistingVolatileRegions = 0;
WholeSocket = FALSE;

Rc = IsConfigureWholeSocket(DimmsNum, Socket, &WholeSocket);
if (EFI_ERROR(Rc)) {
ResetCmdStatus(pCommandStatus, NVM_ERR_OPERATION_FAILED);
NVDIMM_DBG("Unable to determine if goal request is configuring entire socket or adding unconfigured dimms");
goto Finish;
}

/** Get a number of all configured and unconfigured Dimms on a given socket **/
LIST_FOR_EACH(pDimmNode, &gNvmDimmData->PMEMDev.Dimms) {
Expand All @@ -1829,7 +1820,7 @@ VerifyCreatingSupportedRegionConfigs(
UnconfiguredDimmsNum += 1;
}

if (!WholeSocket && !IsPointerInArray((VOID **)pDimms, DimmsNum, pDimm)) {
if (!IsPointerInArray((VOID **)pDimms, DimmsNum, pDimm)) {
// Calculate the ADx1 regions on the unspecified DIMMs
if (pDimm->VolatileCapacity == 0 &&
pDimm->ISsNfitNum > 0 &&
Expand Down

0 comments on commit 1a06349

Please sign in to comment.