drm/radeon: Use kvmalloc for CS chunks
authorChen Li <chenli@uniontech.com>
Tue, 2 Mar 2021 06:42:12 +0000 (14:42 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 2 Mar 2021 19:31:57 +0000 (14:31 -0500)
commit3fcb4f01deedfa290e903e030956b8e1a5cb764f
tree9906880792b416b5cadd289f52e6b3a1532b6fab
parent7c7dd77489540d676c2b72304825c6175621e362
drm/radeon: Use kvmalloc for CS chunks

The number of chunks/chunks_array may be passed in
by userspace and can be large.

It has been observed to cause kcalloc failures from trinity fuzzy test:

 WARNING: CPU: 0 PID: 5487 at mm/page_alloc.c:4385
 __alloc_pages_nodemask+0x2d8/0x14d0

Obviously, the required order in this case is larger than MAX_ORDER.
So, just use kvmalloc instead.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Chen Li <chenli@uniontech.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_cs.c