From a09a753ff329d1a715ae00a68f1a5cd75333cb7a Mon Sep 17 00:00:00 2001 From: Doug Gilbert Date: Fri, 10 Mar 2017 17:06:58 -0600 Subject: PK DEC timer interrupts too close together Change-Id: If62e99e8977fda7211df4e56b78f0d64d2d13217 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37820 Tested-by: Jenkins Server Tested-by: PPE CI Reviewed-by: RAHUL BATRA Reviewed-by: YUE DU Reviewed-by: Gregory S. Still Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37822 Reviewed-by: Hostboot Team Tested-by: FSP CI Jenkins Reviewed-by: Sachin Gupta --- .../chips/p9/procedures/ppe/pk/kernel/pk_api.h | 9 ++++++++- .../chips/p9/procedures/ppe/pk/ppe42/ppe42_core.c | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h b/src/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h index fb0ff6a7..4680f612 100644 --- a/src/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h +++ b/src/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h @@ -234,6 +234,10 @@ #define PK_TIMEBASE_MAX ((PkTimebase)-1) +/// The minimum count the DEC counter can have so as to not overrun PK +/// with DEC interrupts. +#define PK_DEC_MIN 32 + /// A special value that specifies that the timebase will not be reset during /// pk_init(). @@ -955,7 +959,10 @@ extern PkDeque _pk_bh_queue; static inline void pk_bh_schedule(PkBottomHalf* bottom_half) { - pk_deque_push_back(&_pk_bh_queue, (PkDeque*)bottom_half); + if(!pk_deque_is_queued((PkDeque*)bottom_half)) + { + pk_deque_push_back(&_pk_bh_queue, (PkDeque*)bottom_half); + } } #define PK_BH_INIT(_handler, _arg) \ diff --git a/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_core.c b/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_core.c index 7b6604b1..68336731 100644 --- a/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_core.c +++ b/src/import/chips/p9/procedures/ppe/pk/ppe42/ppe42_core.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER sbe Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -114,17 +114,15 @@ __pk_schedule_hardware_timeout(PkTimebase timeout) PkTimebase diff; uint32_t new_dec; + now = pk_timebase_get(); + //update the 64bit accumulator with the current + ppe42_64bit_timebase = now; + if (timeout != PK_TIMEBASE_MAX) { - - now = pk_timebase_get(); - - //update our 64bit accumulator with the current snapshot - ppe42_64bit_timebase = now; - if (timeout <= now) { - new_dec = 1; + new_dec = PK_DEC_MIN; } else { @@ -137,11 +135,15 @@ __pk_schedule_hardware_timeout(PkTimebase timeout) else { new_dec = diff; + + if(new_dec < PK_DEC_MIN) + { + new_dec = PK_DEC_MIN; + } } } mtspr(SPRN_DEC, new_dec); - } } -- cgit v1.2.1