diff options
author | Edward Hill <ecgh@chromium.org> | 2020-06-18 15:08:16 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-19 06:09:42 +0000 |
commit | aae3aa1f17dac67bebd20d6f873e88dc6edd1526 (patch) | |
tree | 08aa5658aeda9dee51e863aa5f6378b81e31e899 | |
parent | 9958590d1293228e3cc0f28a57864297f9bd56c4 (diff) | |
download | chrome-ec-aae3aa1f17dac67bebd20d6f873e88dc6edd1526.tar.gz |
npcx: Fix taskinfo runtime profiling
Add missing call to task_start_irq_handler() for watchdog timer
interrupt ITIM16_INT(ITIM_WDG_NO). This was missing because the watchdog
does its own custom IRQ_HANDLER() instead of using DECLARE_IRQ() like
everyone else.
When task_start_irq_handler wasn't called, exc_start_time wasn't
updated, which causes trouble because svc_handler() assumes
exc_start_time has been updated to be greater than exc_end_time:
/*
* Bill the current task for time between the end of the last interrupt
* and the start of this one.
*/
current->runtime += (exc_start_time - exc_end_time);
BUG=chromium:1096716
BRANCH=none
TEST=taskinfo command shows reasonable task runtimes
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: I35794644054f01feac2e7823b7dc0da9ed6bf7d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2253064
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r-- | chip/npcx/watchdog.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chip/npcx/watchdog.c b/chip/npcx/watchdog.c index 233c875643..50d9ef7464 100644 --- a/chip/npcx/watchdog.c +++ b/chip/npcx/watchdog.c @@ -83,6 +83,14 @@ void __keep watchdog_check(uint32_t excep_lr, uint32_t excep_sp) { int wd_cnt; +#ifdef CONFIG_TASK_PROFILING + /* + * Perform IRQ profiling accounting. This is normally done by + * DECLARE_IRQ(), but we are not using that for ITIM_WDG_NO. + */ + task_start_irq_handler((void *)excep_lr); +#endif + /* Clear timeout status for event */ SET_BIT(NPCX_ITCTS(ITIM_WDG_NO), NPCX_ITCTS_TO_STS); |