[agd5f:drm-next 585/599] drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3459:17: error: implicit declaration of function 'vfree'; did you mean 'kfree'?

From: kernel test robot
Date: Sat May 07 2022 - 01:02:31 EST


tree: https://gitlab.freedesktop.org/agd5f/linux.git drm-next
head: 3170f5f234272247989fafee4cba4cbbc822631c
commit: 31aad22e2b3cfe89aef45015a9c7e4f7c0646daa [585/599] drm/amdgpu/psp: Add vbflash sysfs interface support
config: alpha-randconfig-r026-20220506 (https://download.01.org/0day-ci/archive/20220507/202205071258.p2FKbi8O-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add agd5f https://gitlab.freedesktop.org/agd5f/linux.git
git fetch --no-tags agd5f drm-next
git checkout 31aad22e2b3cfe89aef45015a9c7e4f7c0646daa
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=alpha SHELL=/bin/bash drivers/gpu/drm/amd/amdgpu/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c: In function 'amdgpu_psp_vbflash_write':
>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3459:17: error: implicit declaration of function 'vfree'; did you mean 'kfree'? [-Werror=implicit-function-declaration]
3459 | vfree(adev->psp.vbflash_tmp_buf);
| ^~~~~
| kfree
>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3467:45: error: implicit declaration of function 'vmalloc'; did you mean 'kvmalloc'? [-Werror=implicit-function-declaration]
3467 | adev->psp.vbflash_tmp_buf = vmalloc(AMD_VBIOS_FILE_MAX_SIZE_B);
| ^~~~~~~
| kvmalloc
>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:3467:43: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
3467 | adev->psp.vbflash_tmp_buf = vmalloc(AMD_VBIOS_FILE_MAX_SIZE_B);
| ^
cc1: some warnings being treated as errors


vim +3459 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

3447
3448 static ssize_t amdgpu_psp_vbflash_write(struct file *filp, struct kobject *kobj,
3449 struct bin_attribute *bin_attr,
3450 char *buffer, loff_t pos, size_t count)
3451 {
3452 struct device *dev = kobj_to_dev(kobj);
3453 struct drm_device *ddev = dev_get_drvdata(dev);
3454 struct amdgpu_device *adev = drm_to_adev(ddev);
3455
3456 /* Safeguard against memory drain */
3457 if (adev->psp.vbflash_image_size > AMD_VBIOS_FILE_MAX_SIZE_B) {
3458 dev_err(adev->dev, "File size cannot exceed %u", AMD_VBIOS_FILE_MAX_SIZE_B);
> 3459 vfree(adev->psp.vbflash_tmp_buf);
3460 adev->psp.vbflash_tmp_buf = NULL;
3461 adev->psp.vbflash_image_size = 0;
3462 return -ENOMEM;
3463 }
3464
3465 /* TODO Just allocate max for now and optimize to realloc later if needed */
3466 if (!adev->psp.vbflash_tmp_buf) {
> 3467 adev->psp.vbflash_tmp_buf = vmalloc(AMD_VBIOS_FILE_MAX_SIZE_B);
3468 if (!adev->psp.vbflash_tmp_buf)
3469 return -ENOMEM;
3470 }
3471
3472 mutex_lock(&adev->psp.mutex);
3473 memcpy(adev->psp.vbflash_tmp_buf + pos, buffer, count);
3474 adev->psp.vbflash_image_size += count;
3475 mutex_unlock(&adev->psp.mutex);
3476
3477 dev_info(adev->dev, "VBIOS flash write PSP done");
3478
3479 return count;
3480 }
3481

--
0-DAY CI Kernel Test Service
https://01.org/lkp