summaryrefslogtreecommitdiff
path: root/drivers/misc/habanalabs/common/device.c
diff options
context:
space:
mode:
authorOfir Bitton <obitton@habana.ai>2021-02-14 16:35:56 +0300
committerOded Gabbay <ogabbay@kernel.org>2021-04-09 14:09:23 +0300
commitd5eb8373b2cee72a6f1f2157130b56e6a88894dc (patch)
treec4ef9258d7b7ababc2acfed5caef908f3039ee20 /drivers/misc/habanalabs/common/device.c
parentf209e5ad1848828474c46a357441505078cca5c0 (diff)
downloadlinux-d5eb8373b2cee72a6f1f2157130b56e6a88894dc.tar.xz
habanalabs: replace GFP_ATOMIC with GFP_KERNEL
As there are incorrect assumptions in which some of the initialization and data path flows cannot sleep, most allocations are being done using GFP_ATOMIC. We modify the code to use GFP_ATOMIC only when realy needed, as sleepable flow should use GFP_KERNEL. In addition add a fallback to allocate memory using GFP_KERNEL, once ATOMIC allocation fails. 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/common/device.c')
-rw-r--r--drivers/misc/habanalabs/common/device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index 96b8f39c2539..c94e8ca6edf1 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -344,7 +344,7 @@ static int device_early_init(struct hl_device *hdev)
if (hdev->asic_prop.completion_queues_count) {
hdev->cq_wq = kcalloc(hdev->asic_prop.completion_queues_count,
sizeof(*hdev->cq_wq),
- GFP_ATOMIC);
+ GFP_KERNEL);
if (!hdev->cq_wq) {
rc = -ENOMEM;
goto asid_fini;