From d74949e3e68c000ead762d5acf42a5e967d2d976 Mon Sep 17 00:00:00 2001 From: Aseda Aboagye Date: Tue, 14 Jul 2015 15:06:21 -0700 Subject: tasks: Remove most task_start_called() calls. Now that HOOK_INIT hooks are called from a task switching context, most calls to task_start_called() should no longer be needed. This commit removes them. BRANCH=None BUG=chrome-os-partner:27226 TEST=make -j buildall tests TEST=Flash EC image onto samus and verify EC boot, AP boot, keyboard, lid, and tap-for-battery all functional. TEST=Flash EC image onto samus_pd and verify charging still works. TEST=Flash EC image onto ryu(P3) and verify that EC boot. TEST=Added ASSERT(task_start_called()) to the places where I removed task_start_called(). Booted samus, samus_pd, cyan, and ryu with AC inserted and verified that no ASSERT's were hit upon boot. Change-Id: Ic12c61862e85ca3a0a295beedbb4eeee6d5e515b Signed-off-by: Aseda Aboagye Reviewed-on: https://chromium-review.googlesource.com/285635 Tested-by: Aseda Aboagye Reviewed-by: Shawn N Commit-Queue: Aseda Aboagye Trybot-Ready: Aseda Aboagye --- board/lucid/board.c | 3 +-- board/ryu/board.c | 3 +-- board/samus_pd/board.c | 6 ++---- chip/host/uart.c | 5 +---- chip/npcx/flash.c | 4 +--- power/common.c | 3 +-- 6 files changed, 7 insertions(+), 17 deletions(-) diff --git a/board/lucid/board.c b/board/lucid/board.c index c9ae07c65d..3823a1ba05 100644 --- a/board/lucid/board.c +++ b/board/lucid/board.c @@ -57,8 +57,7 @@ void vbus_evt(enum gpio_signal signal) update_vbus_supplier(gpio_get_level(signal)); - if (task_start_called()) - task_wake(TASK_ID_PD); + task_wake(TASK_ID_PD); /* trigger AC present interrupt */ extpower_interrupt(signal); diff --git a/board/ryu/board.c b/board/ryu/board.c index 2bbd4059d8..d92e89d9b2 100644 --- a/board/ryu/board.c +++ b/board/ryu/board.c @@ -86,8 +86,7 @@ void vbus_evt(enum gpio_signal signal) } hook_call_deferred(vbus_log, 0); - if (task_start_called()) - task_wake(TASK_ID_PD); + task_wake(TASK_ID_PD); } void usb_evt(enum gpio_signal signal) diff --git a/board/samus_pd/board.c b/board/samus_pd/board.c index d7c2c8b6e8..dcf40cdd99 100644 --- a/board/samus_pd/board.c +++ b/board/samus_pd/board.c @@ -129,8 +129,7 @@ void vbus0_evt(enum gpio_signal signal) * these unwanted resets. */ hook_call_deferred(pericom_port0_reenable_interrupts, 0); - if (task_start_called()) - task_wake(TASK_ID_PD_C0); + task_wake(TASK_ID_PD_C0); } void vbus1_evt(enum gpio_signal signal) @@ -155,8 +154,7 @@ void vbus1_evt(enum gpio_signal signal) * these unwanted resets. */ hook_call_deferred(pericom_port1_reenable_interrupts, 0); - if (task_start_called()) - task_wake(TASK_ID_PD_C1); + task_wake(TASK_ID_PD_C1); } static void wake_usb_charger_task(int port) diff --git a/chip/host/uart.c b/chip/host/uart.c index 989112be80..73821efe32 100644 --- a/chip/host/uart.c +++ b/chip/host/uart.c @@ -69,10 +69,7 @@ static void trigger_interrupt(void) { if (int_disabled) return; - if (task_start_called()) - task_trigger_test_interrupt(uart_interrupt); - else - uart_interrupt(); + task_trigger_test_interrupt(uart_interrupt); } int uart_init_done(void) diff --git a/chip/npcx/flash.c b/chip/npcx/flash.c index 161f65b6d1..2780e379de 100644 --- a/chip/npcx/flash.c +++ b/chip/npcx/flash.c @@ -88,9 +88,7 @@ void flash_wait_ready(void) if ((NPCX_UMA_DB0 & mask) == 0) break; - /* check task scheduling has started to prevent infinite loop */ - if (task_start_called()) - msleep(1); + msleep(1); }; /* Wait for Busy clear */ /* Chip Select high. */ flash_cs_level(1); diff --git a/power/common.c b/power/common.c index 2520d06010..c1abcc68fb 100644 --- a/power/common.c +++ b/power/common.c @@ -274,8 +274,7 @@ void chipset_exit_hard_off(void) /* Set a flag to leave G3, then wake the task */ want_g3_exit = 1; - if (task_start_called()) - task_wake(TASK_ID_CHIPSET); + task_wake(TASK_ID_CHIPSET); } /*****************************************************************************/ -- cgit v1.2.1