lkml.org 
[lkml]   [2020]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdrivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:999:32: sparse: sparse: cast to restricted __le32
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1b5044021070efa3259f3e9548dc35d1eb6aa844
commit: 6698a3d05fda57f37add68c55a0696bfa7100413 drm/amdgpu: add mcbp unit test in debugfs (v3)
date: 12 months ago
config: riscv-randconfig-s032-20200618 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-rc1-10-gc17b1b06-dirty
git checkout 6698a3d05fda57f37add68c55a0696bfa7100413
# save the attached .config to linux build tree
make W=1 C=1 ARCH=riscv CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:163:29: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:163:29: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:163:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int [noderef] <asn:1> *__p @@ got unsigned int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:163:29: sparse: expected unsigned int [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:163:29: sparse: got unsigned int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:165:29: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:165:29: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:165:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const [noderef] <asn:1> *__p @@ got unsigned int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:165:29: sparse: expected unsigned int const [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:165:29: sparse: got unsigned int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:240:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:240:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:240:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int [noderef] <asn:1> *__p @@ got unsigned int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:240:21: sparse: expected unsigned int [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:240:21: sparse: got unsigned int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:278:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:278:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:278:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const [noderef] <asn:1> *__p @@ got unsigned int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:278:21: sparse: expected unsigned int const [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:278:21: sparse: got unsigned int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:319:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:319:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:319:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int [noderef] <asn:1> *__p @@ got unsigned int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:319:21: sparse: expected unsigned int [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:319:21: sparse: got unsigned int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:357:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:357:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:357:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const [noderef] <asn:1> *__p @@ got unsigned int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:357:21: sparse: expected unsigned int const [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:357:21: sparse: got unsigned int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:398:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:398:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:398:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int [noderef] <asn:1> *__p @@ got unsigned int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:398:21: sparse: expected unsigned int [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:398:21: sparse: got unsigned int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:436:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:436:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:436:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const [noderef] <asn:1> *__p @@ got unsigned int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:436:21: sparse: expected unsigned int const [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:436:21: sparse: got unsigned int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:525:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:525:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:525:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int [noderef] <asn:1> *__p @@ got unsigned int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:525:21: sparse: expected unsigned int [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:525:21: sparse: got unsigned int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:582:29: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:582:29: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:582:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected signed int [noderef] <asn:1> *__p @@ got signed int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:582:29: sparse: expected signed int [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:582:29: sparse: got signed int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int [noderef] <asn:1> *__p @@ got unsigned int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse: expected unsigned int [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse: got unsigned int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:729:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:729:21: sparse: sparse: cast removes address space '<asn:1>' of expression
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:729:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int [noderef] <asn:1> *__p @@ got unsigned int [usertype] * @@
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:729:21: sparse: expected unsigned int [noderef] <asn:1> *__p
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:729:21: sparse: got unsigned int [usertype] *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:942:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:942:25: sparse: struct dma_fence [noderef] <asn:4> *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:942:25: sparse: struct dma_fence *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:943:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:943:17: sparse: struct dma_fence [noderef] <asn:4> *
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:943:17: sparse: struct dma_fence *
>> drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:999:32: sparse: sparse: cast to restricted __le32

vim +999 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c

980
981 static int amdgpu_debugfs_ib_preempt(void *data, u64 val)
982 {
983 int r, resched, length;
984 struct amdgpu_ring *ring;
985 struct drm_sched_job *s_job;
986 struct amdgpu_job *job;
987 struct dma_fence **fences = NULL;
988 struct amdgpu_device *adev = (struct amdgpu_device *)data;
989
990 if (val >= AMDGPU_MAX_RINGS)
991 return -EINVAL;
992
993 ring = adev->rings[val];
994
995 if (!ring || !ring->funcs->preempt_ib || !ring->sched.thread)
996 return -EINVAL;
997
998 /* the last preemption failed */
> 999 if (ring->trail_seq != le32_to_cpu(*ring->trail_fence_cpu_addr))
1000 return -EBUSY;
1001
1002 length = ring->fence_drv.num_fences_mask + 1;
1003 fences = kcalloc(length, sizeof(void *), GFP_KERNEL);
1004 if (!fences)
1005 return -ENOMEM;
1006
1007 /* stop the scheduler */
1008 kthread_park(ring->sched.thread);
1009
1010 resched = ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
1011
1012 /* preempt the IB */
1013 r = amdgpu_ring_preempt_ib(ring);
1014 if (r) {
1015 DRM_WARN("failed to preempt ring %d\n", ring->idx);
1016 goto failure;
1017 }
1018
1019 amdgpu_fence_process(ring);
1020
1021 if (atomic_read(&ring->fence_drv.last_seq) !=
1022 ring->fence_drv.sync_seq) {
1023 DRM_INFO("ring %d was preempted\n", ring->idx);
1024
1025 /* swap out the old fences */
1026 amdgpu_ib_preempt_fences_swap(ring, fences);
1027
1028 amdgpu_fence_driver_force_completion(ring);
1029
1030 s_job = list_first_entry_or_null(
1031 &ring->sched.ring_mirror_list,
1032 struct drm_sched_job, node);
1033 if (s_job) {
1034 job = to_amdgpu_job(s_job);
1035 /* mark the job as preempted */
1036 /* job->preemption_status |=
1037 AMDGPU_IB_PREEMPTED; */
1038 }
1039
1040 /* resubmit unfinished jobs */
1041 amdgpu_ib_preempt_job_recovery(&ring->sched);
1042
1043 /* wait for jobs finished */
1044 amdgpu_fence_wait_empty(ring);
1045
1046 /* signal the old fences */
1047 amdgpu_ib_preempt_signal_fences(fences, length);
1048 }
1049
1050 failure:
1051 /* restart the scheduler */
1052 kthread_unpark(ring->sched.thread);
1053
1054 ttm_bo_unlock_delayed_workqueue(&adev->mman.bdev, resched);
1055
1056 if (fences)
1057 kfree(fences);
1058
1059 return 0;
1060 }
1061

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2020-06-18 17:55    [W:0.361 / U:1.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site