Skip to content

Commit

Permalink
Include oversubscription in clip history
Browse files Browse the repository at this point in the history
Change-Id: I71262d7b0490926cc2cc2e054f62d8896240fb4d
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66003
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Tested-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
  • Loading branch information
marthabroyles committed Sep 14, 2018
1 parent 0f604d6 commit b1453b6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 48 deletions.
51 changes: 20 additions & 31 deletions src/occ_405/amec/amec_freq.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,12 @@ opal_mem_voting_reason_t G_amec_opal_mem_throt_reason = NO_MEM_THROTTLE;
//
// Name: amec_set_freq_range
//
// Description: Set the frequency range for AMEC
// This function will run on mode changes, cnfg_data changes
// and oversubscription changes
// Description: Set the frequency range for AMEC based on mode only
// NOTE: Any other clipping of frequency should be done in
// amec_slv_proc_voting_box() (called every tick)
// so the CLIP history in poll response will accurately
// show all clipping for the given mode the system is in
// This function will run on mode changes and cnfg_data changes
//
// Thread: RealTime Loop
//
Expand Down Expand Up @@ -156,33 +159,6 @@ errlHndl_t amec_set_freq_range(const OCC_MODE i_mode)
}
}

// if (redundant ps policy is being enforced)
if (G_sysConfigData.system_type.non_redund_ps == false)
{
// check if need to lower max frequency due to being in oversubscription. 0 oversub freq means no freq limitation
if( AMEC_INTF_GET_OVERSUBSCRIPTION() && (G_sysConfigData.sys_mode_freq.table[OCC_MODE_OVERSUB]) &&
(G_sysConfigData.sys_mode_freq.table[OCC_MODE_OVERSUB] < l_freq_max) )
{
// If oversub is lower than system minimum then set to min
if(G_sysConfigData.sys_mode_freq.table[OCC_MODE_OVERSUB] < l_freq_min)
{
TRAC_IMP("amec_set_freq_range: max frequency lowered from %u to system min %u due to oversubscription",
l_freq_max,
l_freq_min);

l_freq_max = l_freq_min;
}
else
{
TRAC_IMP("amec_set_freq_range: max frequency lowered from %u to %u due to Oversubscription",
l_freq_max,
G_sysConfigData.sys_mode_freq.table[OCC_MODE_OVERSUB]);

l_freq_max = G_sysConfigData.sys_mode_freq.table[OCC_MODE_OVERSUB];
}
}
}

if( (l_freq_min == 0) || (l_freq_max == 0) )
{
// Do not update amec vars with a 0 frequency.
Expand Down Expand Up @@ -309,7 +285,20 @@ void amec_slv_proc_voting_box(void)
// This function implements the voting box to decide which input gets the right
// to actuate the system.

// If there is an active VRM fault and a defined VRM N frequency less than max use it
// check for oversubscription if redundant ps policy (oversubscription) is being enforced
if (G_sysConfigData.system_type.non_redund_ps == false)
{
// If in oversubscription and there is a defined (non 0) OVERSUB frequency less than max then use it
if( (AMEC_INTF_GET_OVERSUBSCRIPTION()) &&
(G_sysConfigData.sys_mode_freq.table[OCC_MODE_OVERSUB]) &&
(G_sysConfigData.sys_mode_freq.table[OCC_MODE_OVERSUB] < l_chip_fmax) )
{
l_chip_fmax = G_sysConfigData.sys_mode_freq.table[OCC_MODE_OVERSUB];
l_chip_reason = AMEC_VOTING_REASON_OVERSUB;
}
}

// If there is an active VRM fault and a defined (non 0) VRM N frequency less than max use it
if( (g_amec->sys.vrm_fault_status) &&
(G_sysConfigData.sys_mode_freq.table[OCC_MODE_VRM_N]) &&
(G_sysConfigData.sys_mode_freq.table[OCC_MODE_VRM_N] < l_chip_fmax) )
Expand Down
2 changes: 1 addition & 1 deletion src/occ_405/amec/amec_freq.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ typedef enum
AMEC_VOTING_REASON_CORE_CAP = 0x00000020,
AMEC_VOTING_REASON_PROC_THRM = 0x00000040,
AMEC_VOTING_REASON_GXHB_THRM = 0x00000080,
AMEC_VOTING_REASON_RESERVED = 0x00000100, // was VRHOT, no longer used
AMEC_VOTING_REASON_OVERSUB = 0x00000100,
AMEC_VOTING_REASON_OVER_CURRENT = 0x00000200,
AMEC_VOTING_REASON_OVERRIDE = 0x00000400,
AMEC_VOTING_REASON_CORE_GRP_MIN = 0x00000800,
Expand Down
16 changes: 0 additions & 16 deletions src/occ_405/amec/amec_oversub.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,6 @@ void amec_oversub_check(void)

// Commit Error
commitErrl(&l_errl);

// set max frequency for oversubscription
l_errl = amec_set_freq_range(CURRENT_MODE());
if(l_errl)
{
TRAC_ERR("amec_oversub_check: committing error reported by amec_set_freq_range");
commitErrl( &l_errl);
}
}
}
else
Expand All @@ -194,14 +186,6 @@ void amec_oversub_check(void)
{
L_prev_ovs_state = FALSE;
TRAC_IMP("Oversubscription condition cleared");

// re-set max frequency since no longer in oversubscription
l_errl = amec_set_freq_range(CURRENT_MODE());
if(l_errl)
{
TRAC_ERR("amec_oversub_check: committing error reported by amec_set_freq_range");
commitErrl( &l_errl);
}
}
}

Expand Down

0 comments on commit b1453b6

Please sign in to comment.