[drm-tip:drm-tip 2191/2285] include/drm/ttm/ttm_bo_driver.h:644 ttm_bo_reserve() warn: inconsistent returns

kernel test robot lkp at intel.com
Mon Aug 10 05:33:30 UTC 2020


tree:   git://anongit.freedesktop.org/drm/drm-tip drm-tip
head:   147f0d3f7239756494adef31518f87e60a970878
commit: 46bca88bbdd3046db31b8b7e053a909ae79e285b [2191/2285] drm/ttm/amdgpu: consolidate ttm reserve paths
config: i386-randconfig-m021-20200809 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

New smatch warnings:
include/drm/ttm/ttm_bo_driver.h:644 ttm_bo_reserve() warn: inconsistent returns '*bo->base.resv'.
include/drm/ttm/ttm_bo_driver.h:644 ttm_bo_reserve() warn: inconsistent returns '*bo->base.resv'.
include/drm/ttm/ttm_bo_driver.h:644 ttm_bo_reserve() warn: inconsistent returns '*bo->base.resv'.
include/drm/ttm/ttm_bo_driver.h:644 ttm_bo_reserve() warn: inconsistent returns '*bo->base.resv'.
include/drm/ttm/ttm_bo_driver.h:644 ttm_bo_reserve() warn: inconsistent returns '*bo->base.resv'.
include/drm/ttm/ttm_bo_driver.h:644 ttm_bo_reserve() warn: inconsistent returns '*bo->base.resv'.
include/drm/ttm/ttm_bo_driver.h:644 ttm_bo_reserve() warn: inconsistent returns '*bo->base.resv'.
include/drm/ttm/ttm_bo_driver.h:644 ttm_bo_reserve() warn: inconsistent returns '*bo->base.resv'.
include/drm/ttm/ttm_bo_driver.h:644 ttm_bo_reserve() warn: inconsistent returns '*bo->base.resv'.
include/drm/ttm/ttm_bo_driver.h:644 ttm_bo_reserve() warn: inconsistent returns '*bo->base.resv'.

Old smatch warnings:
drivers/gpu/drm/ttm/ttm_bo_vm.c:227 ttm_bo_vm_insert_huge() warn: was '== 2048' instead of '='
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:737 amdgpu_gem_op_ioctl() warn: should 'robj->tbo.mem.page_alignment << 12' be a 64 bit type?
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c:546 amdgpu_dma_buf_move_notify() error: double unlocked '*resv' (orig line 525)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:166 amdgpu_gfx_parse_disable_cu() warn: potential spectre issue 'mask' [w]
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:5062 gfx_v8_0_pre_soft_reset() warn: inconsistent indenting
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1013 amdgpu_dm_fini() error: we previously assumed 'adev->dm.dc' could be null (see line 1010)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1024 amdgpu_dm_fini() warn: variable dereferenced before check 'adev->dm.dc' (see line 1013)
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:4545 create_stream_for_sink() error: we previously assumed 'aconnector->dc_sink' could be null (see line 4436)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:266 amdgpu_bo_create_reserved() error: we previously assumed '*bo_ptr' could be null (see line 256)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:645 amdgpu_bo_create_shadow() error: we previously assumed 'bo->shadow' could be null (see line 632)
drivers/gpu/drm/nouveau/nouveau_bo.c:430 nouveau_bo_pin() warn: should '1 << bo->mem.mem_type' be a 64 bit type?
drivers/gpu/drm/nouveau/nouveau_bo.c:884 nv50_bo_move_m2mf() warn: should 'new_reg->num_pages << 12' be a 64 bit type?
drivers/gpu/drm/nouveau/nouveau_bo.c:1260 nouveau_bo_move_ntfy() warn: should 'new_reg->start << 12' be a 64 bit type?
drivers/gpu/drm/nouveau/nouveau_bo.c:1274 nouveau_bo_vm_bind() warn: should 'new_reg->start << 12' be a 64 bit type?
drivers/gpu/drm/nouveau/nouveau_gem.c:246 nouveau_gem_info() warn: should 'nvbo->bo.mem.num_pages << 12' be a 64 bit type?

vim +644 include/drm/ttm/ttm_bo_driver.h

eba67093f53532 Thomas Hellstrom  2010-11-11  600  
3482032457f50c Maarten Lankhorst 2013-06-27  601  /**
46bca88bbdd304 Dave Airlie       2020-08-04  602   * ttm_bo_reserve:
3482032457f50c Maarten Lankhorst 2013-06-27  603   *
3482032457f50c Maarten Lankhorst 2013-06-27  604   * @bo: A pointer to a struct ttm_buffer_object.
3482032457f50c Maarten Lankhorst 2013-06-27  605   * @interruptible: Sleep interruptible if waiting.
3482032457f50c Maarten Lankhorst 2013-06-27  606   * @no_wait: Don't sleep while trying to reserve, rather return -EBUSY.
dfd5e50ea43ca4 Christian König   2016-04-06  607   * @ticket: ticket used to acquire the ww_mutex.
3482032457f50c Maarten Lankhorst 2013-06-27  608   *
46bca88bbdd304 Dave Airlie       2020-08-04  609   * Locks a buffer object for validation. (Or prevents other processes from
46bca88bbdd304 Dave Airlie       2020-08-04  610   * locking it for validation), while taking a number of measures to prevent
46bca88bbdd304 Dave Airlie       2020-08-04  611   * deadlocks.
3482032457f50c Maarten Lankhorst 2013-06-27  612   *
3482032457f50c Maarten Lankhorst 2013-06-27  613   * Returns:
3482032457f50c Maarten Lankhorst 2013-06-27  614   * -EDEADLK: The reservation may cause a deadlock.
3482032457f50c Maarten Lankhorst 2013-06-27  615   * Release all buffer reservations, wait for @bo to become unreserved and
46bca88bbdd304 Dave Airlie       2020-08-04  616   * try again.
3482032457f50c Maarten Lankhorst 2013-06-27  617   * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
3482032457f50c Maarten Lankhorst 2013-06-27  618   * a signal. Release all buffer reservations and return to user-space.
3482032457f50c Maarten Lankhorst 2013-06-27  619   * -EBUSY: The function needed to sleep, but @no_wait was true
3482032457f50c Maarten Lankhorst 2013-06-27  620   * -EALREADY: Bo already reserved using @ticket. This error code will only
3482032457f50c Maarten Lankhorst 2013-06-27  621   * be returned if @use_ticket is set to true.
3482032457f50c Maarten Lankhorst 2013-06-27  622   */
46bca88bbdd304 Dave Airlie       2020-08-04  623  static inline int ttm_bo_reserve(struct ttm_buffer_object *bo,
dfd5e50ea43ca4 Christian König   2016-04-06  624  				 bool interruptible, bool no_wait,
3482032457f50c Maarten Lankhorst 2013-06-27  625  				 struct ww_acquire_ctx *ticket)
3482032457f50c Maarten Lankhorst 2013-06-27  626  {
3482032457f50c Maarten Lankhorst 2013-06-27  627  	int ret = 0;
3482032457f50c Maarten Lankhorst 2013-06-27  628  
3482032457f50c Maarten Lankhorst 2013-06-27  629  	if (no_wait) {
3482032457f50c Maarten Lankhorst 2013-06-27  630  		bool success;
3482032457f50c Maarten Lankhorst 2013-06-27  631  		if (WARN_ON(ticket))
3482032457f50c Maarten Lankhorst 2013-06-27  632  			return -EBUSY;
3482032457f50c Maarten Lankhorst 2013-06-27  633  
52791eeec1d9f4 Christian König   2019-08-11  634  		success = dma_resv_trylock(bo->base.resv);
3482032457f50c Maarten Lankhorst 2013-06-27  635  		return success ? 0 : -EBUSY;
3482032457f50c Maarten Lankhorst 2013-06-27  636  	}
3482032457f50c Maarten Lankhorst 2013-06-27  637  
3482032457f50c Maarten Lankhorst 2013-06-27  638  	if (interruptible)
52791eeec1d9f4 Christian König   2019-08-11  639  		ret = dma_resv_lock_interruptible(bo->base.resv, ticket);
3482032457f50c Maarten Lankhorst 2013-06-27  640  	else
52791eeec1d9f4 Christian König   2019-08-11  641  		ret = dma_resv_lock(bo->base.resv, ticket);
3482032457f50c Maarten Lankhorst 2013-06-27  642  	if (ret == -EINTR)
3482032457f50c Maarten Lankhorst 2013-06-27  643  		return -ERESTARTSYS;
3482032457f50c Maarten Lankhorst 2013-06-27 @644  	return ret;
3482032457f50c Maarten Lankhorst 2013-06-27  645  }
eba67093f53532 Thomas Hellstrom  2010-11-11  646  

:::::: The code at line 644 was first introduced by commit
:::::: 3482032457f50cae196f6397ebec7f5f2ad3cf7d drm/ttm: inline ttm_bo_reserve and related calls

:::::: TO: Maarten Lankhorst <m.b.lankhorst at gmail.com>
:::::: CC: Dave Airlie <airlied at redhat.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 42055 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20200810/f75a5a4f/attachment-0001.gz>


More information about the dri-devel mailing list