habanalabs: replace GFP_ATOMIC with GFP_KERNEL
authorOfir Bitton <obitton@habana.ai>
Sun, 14 Feb 2021 13:35:56 +0000 (15:35 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Fri, 9 Apr 2021 11:09:23 +0000 (14:09 +0300)
commitd5eb8373b2cee72a6f1f2157130b56e6a88894dc
treec4ef9258d7b7ababc2acfed5caef908f3039ee20
parentf209e5ad1848828474c46a357441505078cca5c0
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>
drivers/misc/habanalabs/common/command_buffer.c
drivers/misc/habanalabs/common/command_submission.c
drivers/misc/habanalabs/common/device.c
drivers/misc/habanalabs/common/memory.c
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/goya/goya.c