CC: [email protected]
CC: [email protected]
TO: Zhi Wang <[email protected]>
CC: Zhenyu Wang <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   92477dd1faa650e50bd3bb35a6c0b8d09198cc35
commit: 67f1120381df022a7016f4acc8d4880da9a66c03 drm/i915/gvt: Introduce per 
object locking in GVT scheduler.
date:   7 months ago
:::::: branch date: 6 days ago
:::::: commit date: 7 months ago
config: x86_64-randconfig-m001-20210927 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

New smatch warnings:
drivers/gpu/drm/i915/gvt/scheduler.c:646 prepare_shadow_wa_ctx() warn: 
inconsistent returns 'wa_ctx->indirect_ctx.obj->base.resv'.

Old smatch warnings:
drivers/gpu/drm/i915/gem/i915_gem_object.h:127 __i915_gem_object_lock() error: 
we previously assumed 'ww' could be null (see line 119)

vim +646 drivers/gpu/drm/i915/gvt/scheduler.c

d8235b5e55845d Zhi Wang 2017-09-12  604  
d8235b5e55845d Zhi Wang 2017-09-12  605  static int 
prepare_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
d8235b5e55845d Zhi Wang 2017-09-12  606  {
d8235b5e55845d Zhi Wang 2017-09-12  607         struct i915_vma *vma;
d8235b5e55845d Zhi Wang 2017-09-12  608         unsigned char *per_ctx_va =
d8235b5e55845d Zhi Wang 2017-09-12  609                 (unsigned char 
*)wa_ctx->indirect_ctx.shadow_va +
d8235b5e55845d Zhi Wang 2017-09-12  610                 
wa_ctx->indirect_ctx.size;
67f1120381df02 Zhi Wang 2021-01-10  611         struct i915_gem_ww_ctx ww;
67f1120381df02 Zhi Wang 2021-01-10  612         int ret;
d8235b5e55845d Zhi Wang 2017-09-12  613  
d8235b5e55845d Zhi Wang 2017-09-12  614         if (wa_ctx->indirect_ctx.size 
== 0)
d8235b5e55845d Zhi Wang 2017-09-12  615                 return 0;
d8235b5e55845d Zhi Wang 2017-09-12  616  
67f1120381df02 Zhi Wang 2021-01-10  617         i915_gem_ww_ctx_init(&ww, 
false);
67f1120381df02 Zhi Wang 2021-01-10  618  retry:
67f1120381df02 Zhi Wang 2021-01-10  619         
i915_gem_object_lock(wa_ctx->indirect_ctx.obj, &ww);
67f1120381df02 Zhi Wang 2021-01-10  620  
67f1120381df02 Zhi Wang 2021-01-10  621         vma = 
i915_gem_object_ggtt_pin_ww(wa_ctx->indirect_ctx.obj, &ww, NULL,
d8235b5e55845d Zhi Wang 2017-09-12  622                                         
  0, CACHELINE_BYTES, 0);
67f1120381df02 Zhi Wang 2021-01-10  623         if (IS_ERR(vma)) {
67f1120381df02 Zhi Wang 2021-01-10  624                 ret = PTR_ERR(vma);
67f1120381df02 Zhi Wang 2021-01-10  625                 if (ret == -EDEADLK) {
67f1120381df02 Zhi Wang 2021-01-10  626                         ret = 
i915_gem_ww_ctx_backoff(&ww);
67f1120381df02 Zhi Wang 2021-01-10  627                         if (!ret)
67f1120381df02 Zhi Wang 2021-01-10  628                                 goto 
retry;
67f1120381df02 Zhi Wang 2021-01-10  629                 }
67f1120381df02 Zhi Wang 2021-01-10  630                 return ret;
67f1120381df02 Zhi Wang 2021-01-10  631         }
67f1120381df02 Zhi Wang 2021-01-10  632  
67f1120381df02 Zhi Wang 2021-01-10  633         
i915_gem_object_unlock(wa_ctx->indirect_ctx.obj);
d8235b5e55845d Zhi Wang 2017-09-12  634  
d8235b5e55845d Zhi Wang 2017-09-12  635         /* FIXME: we are not tracking 
our pinned VMA leaving it
d8235b5e55845d Zhi Wang 2017-09-12  636          * up to the core to fix up the 
stray pin_count upon
d8235b5e55845d Zhi Wang 2017-09-12  637          * free.
d8235b5e55845d Zhi Wang 2017-09-12  638          */
d8235b5e55845d Zhi Wang 2017-09-12  639  
d8235b5e55845d Zhi Wang 2017-09-12  640         wa_ctx->indirect_ctx.shadow_gma 
= i915_ggtt_offset(vma);
d8235b5e55845d Zhi Wang 2017-09-12  641  
d8235b5e55845d Zhi Wang 2017-09-12  642         wa_ctx->per_ctx.shadow_gma = 
*((unsigned int *)per_ctx_va + 1);
d8235b5e55845d Zhi Wang 2017-09-12  643         memset(per_ctx_va, 0, 
CACHELINE_BYTES);
d8235b5e55845d Zhi Wang 2017-09-12  644  
d8235b5e55845d Zhi Wang 2017-09-12  645         
update_wa_ctx_2_shadow_ctx(wa_ctx);
d8235b5e55845d Zhi Wang 2017-09-12 @646         return 0;
d8235b5e55845d Zhi Wang 2017-09-12  647  }
d8235b5e55845d Zhi Wang 2017-09-12  648  

:::::: The code at line 646 was first introduced by commit
:::::: d8235b5e55845de19983cec38af245cc200b81e2 drm/i915/gvt: Move common 
workload preparation into prepare_workload()

:::::: TO: Zhi Wang <[email protected]>
:::::: CC: Zhenyu Wang <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to