[AMD Public Use]
Hi,
the following patch has fixed the build error. I have submitted to drm-next. Thanks!
347639d drm/amd/amdgpu fix build error for undefined struct member
Thanks for your help!
Jack
-----Original Message-----
From: kernel test robot <lkp(a)intel.com>
Sent: Tuesday, March 16, 2021 11:03 AM
To: Zhang, Jack (Jian) <Jack.Zhang1(a)amd.com>
Cc: kbuild-all(a)lists.01.org; clang-built-linux(a)googlegroups.com; Grodzovsky, Andrey
<Andrey.Grodzovsky(a)amd.com>
Subject: [agd5f:amd-staging-drm-next 2019/2049]
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4677:6: warning: no previous prototype for
function 'amdgpu_device_recheck_guilty_jobs'
tree:
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab....
amd-staging-drm-next
head: b2987e229a0d616d97063b3b695e7c9483933c27
commit: c8a921d49443025e10794342d4433b3f29616409 [2019/2049] drm/amd/amdgpu implement tdr
advanced mode
config: x86_64-randconfig-r015-20210315 (attached as .config)
compiler: clang version 13.0.0
(
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub....
a28facba1ccdc957f386b7753f4958307f1bfde8)
reproduce (this is a W=1 build):
wget
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.git...
-O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git remote add agd5f
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab....
git fetch --no-tags agd5f amd-staging-drm-next
git checkout c8a921d49443025e10794342d4433b3f29616409
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:39:
include/linux/efi.h:1099:34: warning: passing 1-byte aligned argument to 4-byte aligned
parameter 2 of 'get_var' may result in an unaligned pointer access
[-Walign-mismatch]
status = get_var(L"SecureBoot", &EFI_GLOBAL_VARIABLE_GUID, NULL,
&size,
^
include/linux/efi.h:1107:24: warning: passing 1-byte aligned argument to 4-byte aligned
parameter 2 of 'get_var' may result in an unaligned pointer access
[-Walign-mismatch]
get_var(L"SetupMode", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size,
&setupmode);
^
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4731:27: error: no member named
'num_jobs' in 'struct drm_gpu_scheduler'
atomic_dec(&ring->sched.num_jobs);
~~~~~~~~~~~ ^
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4738:25: error: no member named
'node' in 'struct drm_sched_job'
list_del_init(&s_job->node);
~~~~~ ^
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4677:6: warning: no
previous prototype for function 'amdgpu_device_recheck_guilty_jobs'
[-Wmissing-prototypes]
void amdgpu_device_recheck_guilty_jobs(struct
amdgpu_device *adev,
^
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4677:1: note: declare 'static' if
the function is not intended to be used outside of this translation unit
void amdgpu_device_recheck_guilty_jobs(struct amdgpu_device *adev,
^
static
3 warnings and 2 errors generated.
vim +/amdgpu_device_recheck_guilty_jobs +4677 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
4676
4677 void amdgpu_device_recheck_guilty_jobs(struct amdgpu_device
*adev,
4678 struct amdgpu_hive_info *hive,
4679 struct list_head *device_list_handle,
4680 bool *need_full_reset)
4681 {
4682 int i, r = 0;
4683
4684 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
4685 struct amdgpu_ring *ring = adev->rings[i];
4686 int ret = 0;
4687 struct drm_sched_job *s_job;
4688
4689 if (!ring || !ring->sched.thread)
4690 continue;
4691
4692 s_job = list_first_entry_or_null(&ring->sched.pending_list,
4693 struct drm_sched_job, list);
4694 if (s_job == NULL)
4695 continue;
4696
4697 /* clear job's guilty and depend the folowing step to decide the real one */
4698 drm_sched_reset_karma(s_job);
4699 drm_sched_resubmit_jobs_ext(&ring->sched, 1);
4700
4701 ret = dma_fence_wait_timeout(s_job->s_fence->parent, false,
ring->sched.timeout);
4702 if (ret == 0) { /* timeout */
4703 DRM_ERROR("Found the real bad job! ring:%s, job_id:%llx\n",
4704 ring->sched.name, s_job->id);
4705
4706 /* set guilty */
4707 drm_sched_increase_karma(s_job);
4708 retry:
4709 /* do hw reset */
4710 if (amdgpu_sriov_vf(adev)) {
4711 amdgpu_virt_fini_data_exchange(adev);
4712 r = amdgpu_device_reset_sriov(adev, false);
4713 if (r)
4714 adev->asic_reset_res = r;
4715 } else {
4716 r = amdgpu_do_asic_reset(hive, device_list_handle,
4717 need_full_reset, false);
4718 if (r && r == -EAGAIN)
4719 goto retry;
4720 }
4721
4722 /*
4723 * add reset counter so that the following
4724 * resubmitted job could flush vmid
4725 */
4726 atomic_inc(&adev->gpu_reset_counter);
4727 continue;
4728 }
4729
4730 /* got the hw fence, signal finished fence */
4731 atomic_dec(&ring->sched.num_jobs);
4732 dma_fence_get(&s_job->s_fence->finished);
4733 dma_fence_signal(&s_job->s_fence->finished);
4734 dma_fence_put(&s_job->s_fence->finished);
4735
4736 /* remove node from list and free the job */
4737 spin_lock(&ring->sched.job_list_lock);
4738 list_del_init(&s_job->node);
4739 spin_unlock(&ring->sched.job_list_lock);
4740 ring->sched.ops->free_job(s_job);
4741 }
4742 }
4743
---
0-DAY CI Kernel Test Service, Intel Corporation
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.0...