summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuibin Chang <ruibin.chang@ite.com.tw>2020-10-14 14:13:12 +0800
committerCommit Bot <commit-bot@chromium.org>2020-10-22 06:23:27 +0000
commit4fd0b5f12d0e4ab39c06b92f35ea5ddb194c1c8a (patch)
treea3f7ea92c2117aa98da04c9a1808b4b387cb38bc
parentb81af1233e23497ca8317f2669947398d0142e12 (diff)
downloadchrome-ec-4fd0b5f12d0e4ab39c06b92f35ea5ddb194c1c8a.tar.gz
TCPMv2: don't set PD_PROCESS_INTERRUPT event to idle task
On drawcia, port 1 has PD INT task (port 0 doesn't have), so CONFIG_HAS_TASK_PD_INT is defined. When we initial port 0 pd task, we'll set PD_PROCESS_INTERRUPT event to idle task in schedule_deferred_pd_interrupt(), because pd_int_task_id [0] value is 0. So I add condition to check PD INT task id before set the event. BUG=none BRANCH=none TEST=On drawcia, confirm idle task event is 0x0000 by "taskinfo" cmd Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: I821008255723815ab96aa5bf025243051fe2ca1e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2474055 Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Ruibin Chang <Ruibin.Chang@ite.com.tw>
-rw-r--r--common/usbc_intr_task.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/usbc_intr_task.c b/common/usbc_intr_task.c
index ca410363f1..ae9bc1233e 100644
--- a/common/usbc_intr_task.c
+++ b/common/usbc_intr_task.c
@@ -29,7 +29,13 @@ static uint8_t pd_int_task_id[CONFIG_USB_PD_PORT_MAX_COUNT];
void schedule_deferred_pd_interrupt(const int port)
{
- task_set_event(pd_int_task_id[port], PD_PROCESS_INTERRUPT, 0);
+ /*
+ * Don't set event to idle task if task id is 0. This happens when
+ * not all the port have pd int task, the pd_int_task_id of port
+ * that doesn't have pd int task is 0.
+ */
+ if (pd_int_task_id[port] != 0)
+ task_set_event(pd_int_task_id[port], PD_PROCESS_INTERRUPT, 0);
}
/*