msm: kgsl: use kvcalloc for ringbuffer submission

kcalloc returns out of memory in low memory conditions even if memory
is available in non-contiguous manner. This results in failure to
submit commands to ringbuffer. Use kvcalloc in place of kcalloc so
that when kcalloc fails in low memory conditions, commands can be
submitted if kvcalloc can provide enough memory.

Change-Id: If6a20e35983982b5c0888e5f7dabecfa8c026bcb
Signed-off-by: Pranav Patel <quic_pranavp@quicinc.com>
This commit is contained in:
Pranav Patel
2022-05-17 20:05:53 +05:30
parent 227ed6d234
commit 3d7bc844b2

View File

@@ -1073,7 +1073,7 @@ int adreno_ringbuffer_submitcmd(struct adreno_device *adreno_dev,
if (gpudev->ccu_invalidate)
dwords += 4;
link = kcalloc(dwords, sizeof(unsigned int), GFP_KERNEL);
link = kvcalloc(dwords, sizeof(unsigned int), GFP_KERNEL);
if (!link) {
ret = -ENOMEM;
goto done;
@@ -1206,7 +1206,7 @@ int adreno_ringbuffer_submitcmd(struct adreno_device *adreno_dev,
trace_kgsl_issueibcmds(device, context->id, numibs, drawobj->timestamp,
drawobj->flags, ret, drawctxt->type);
kfree(link);
kvfree(link);
return ret;
}