diff options
Diffstat (limited to 'kernel/ethosu_inference.c')
-rw-r--r-- | kernel/ethosu_inference.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/ethosu_inference.c b/kernel/ethosu_inference.c index 5fbad58..3238d7e 100644 --- a/kernel/ethosu_inference.c +++ b/kernel/ethosu_inference.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright 2020,2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com> + * SPDX-FileCopyrightText: Copyright 2020,2022-2024 Arm Limited and/or its affiliates <open-source-office@arm.com> * SPDX-License-Identifier: GPL-2.0-only * * This program is free software and is provided to you under the terms of the @@ -437,6 +437,16 @@ void ethosu_inference_rsp(struct ethosu_mailbox *mailbox, inf = container_of(msg, typeof(*inf), msg); + /* + * Don't handle the response if the inference is aborted or + * in the process of being aborted + */ + if (inf->status == ETHOSU_UAPI_STATUS_ABORTED || + inf->status == ETHOSU_UAPI_STATUS_ABORTING) { + inf->status = ETHOSU_UAPI_STATUS_ABORTED; + goto done; + } + if (rsp->status == ETHOSU_CORE_STATUS_OK && inf->ofm_count <= ETHOSU_CORE_BUFFER_MAX) inf->status = ETHOSU_UAPI_STATUS_OK; @@ -469,6 +479,7 @@ void ethosu_inference_rsp(struct ethosu_mailbox *mailbox, inf->pmu_cycle_counter_count); } +done: inf->done = true; wake_up_interruptible(&inf->waitq); ethosu_inference_put(inf); |