]> asedeno.scripts.mit.edu Git - linux.git/commit
habanalabs: add context and ASID modules
authorOded Gabbay <oded.gabbay@gmail.com>
Fri, 15 Feb 2019 22:39:14 +0000 (00:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Feb 2019 08:46:44 +0000 (09:46 +0100)
commit0861e41de53044694bfdf2e8f246a0d8fb077e5d
tree45ff382ab65bbfd6bf719841e1e551aec0071fb5
parent99b9d7b4970cf131fd17a8f4ad4870049bd7a365
habanalabs: add context and ASID modules

This patch adds two modules - ASID and context.

Each user process that opens a device's file must have at least one
context before it is able to "work" with the device. Each context has its
own device address-space and contains information about its runtime state
(its active command submissions).

To have address-space separation between contexts, each context is assigned
a unique ASID, which stands for "address-space id". Goya supports up to
1024 ASIDs.

Currently, the driver doesn't support multiple contexts. Therefore, the
user doesn't need to actively create a context. A "primary context" is
created automatically when the user opens the device's file.

Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/habanalabs/Makefile
drivers/misc/habanalabs/asid.c [new file with mode: 0644]
drivers/misc/habanalabs/context.c [new file with mode: 0644]
drivers/misc/habanalabs/device.c
drivers/misc/habanalabs/habanalabs.h
drivers/misc/habanalabs/habanalabs_drv.c