diff options
author | Yilun Lin <yllin@google.com> | 2019-06-21 11:31:17 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-23 17:01:01 +0000 |
commit | b372cac87efd705e1232267e490680a9f2a06676 (patch) | |
tree | d7bbcde7ba3036df91940e92a5a49a8dfa1b355e /chip/mt_scp | |
parent | 260230523897331d9a36e48a6ff993a192f9af86 (diff) | |
download | chrome-ec-b372cac87efd705e1232267e490680a9f2a06676.tar.gz |
mt_scp/ipi: Do not support ipi_send in ISR context
No one uses ipi_send in ISR, and removing this can simplify
the ipi_send logic.
TEST=runs SCP, and see it doesn't print it sends IPI in ISR.
BUG=b:117917141
BRANCH=none
Change-Id: I96115ffc4124331d864daff2d375021c76a74b0c
Signed-off-by: Yilun Lin <yllin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1670649
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Commit-Queue: Yilun Lin <yllin@chromium.org>
Tested-by: Yilun Lin <yllin@chromium.org>
Auto-Submit: Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'chip/mt_scp')
-rw-r--r-- | chip/mt_scp/ipi.c | 10 | ||||
-rw-r--r-- | chip/mt_scp/ipi_chip.h | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/chip/mt_scp/ipi.c b/chip/mt_scp/ipi.c index 7b42da2423..f8fca269b7 100644 --- a/chip/mt_scp/ipi.c +++ b/chip/mt_scp/ipi.c @@ -86,13 +86,11 @@ int ipi_send(int32_t id, const void *buf, uint32_t len, int wait) if (!ipi_ready) return EC_ERROR_BUSY; - /* - * TODO(b:117917141): Evaluate if we can remove this once we have the - * video/camera feature code base. - */ - if (wait && in_interrupt_context()) - /* Prevent from infinity wait when be in ISR context. */ + /* TODO(b:117917141): Remove this check completely. */ + if (in_interrupt_context()) { + CPRINTS("Err: invoke %s() in ISR CTX", __func__); return EC_ERROR_BUSY; + } if (len > sizeof(scp_send_obj->buffer)) return EC_ERROR_INVAL; diff --git a/chip/mt_scp/ipi_chip.h b/chip/mt_scp/ipi_chip.h index 085c1415af..ea05424804 100644 --- a/chip/mt_scp/ipi_chip.h +++ b/chip/mt_scp/ipi_chip.h @@ -46,7 +46,7 @@ struct ipc_shared_obj { uint8_t buffer[CONFIG_IPC_SHARED_OBJ_BUF_SIZE]; }; -/* Send a IPI contents to AP. */ +/* Send a IPI contents to AP. This shouldn't be used in ISR context. */ int ipi_send(int32_t id, const void *buf, uint32_t len, int wait); /* Size of the rpmsg device name, should sync across kernel and EC. */ |