diff options
author | Ofir Bitton <obitton@habana.ai> | 2021-09-02 09:47:53 +0300 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2021-09-14 15:00:04 +0300 |
commit | d09ff62c820b5950ab9958e77620a8498efe9386 (patch) | |
tree | 4cf76f9810ea3b17d3612cee7a809ee73ab1e6ce /drivers/misc/habanalabs | |
parent | 3e08f157c2587fc7ada93abed41aae19bcbf8a6b (diff) | |
download | linux-d09ff62c820b5950ab9958e77620a8498efe9386.tar.xz |
habanalabs: fail collective wait when not supported
As collective wait operation is required only when NIC ports are
available, we disable the option to submit a CS in case all the ports
are disabled, which is the current situation in the upstream driver.
Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs')
-rw-r--r-- | drivers/misc/habanalabs/common/command_submission.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/command_submission.c b/drivers/misc/habanalabs/common/command_submission.c index deb080830ecb..5b7de857fbc1 100644 --- a/drivers/misc/habanalabs/common/command_submission.c +++ b/drivers/misc/habanalabs/common/command_submission.c @@ -1995,6 +1995,15 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type, goto free_cs_chunk_array; } + if (!hdev->nic_ports_mask) { + atomic64_inc(&ctx->cs_counters.validation_drop_cnt); + atomic64_inc(&cntr->validation_drop_cnt); + dev_err(hdev->dev, + "Collective operations not supported when NIC ports are disabled"); + rc = -EINVAL; + goto free_cs_chunk_array; + } + collective_engine_id = chunk->collective_engine_id; } |