All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [android-common:android12-kiwi-5.10 198/198] drivers/gpu/drm/ttm/ttm_bo.c:854 ttm_mem_evict_first() warn: inconsistent returns 'global &ttm_bo_glob.lru_lock'.
Date: Sun, 25 Jan 2026 10:00:28 +0800	[thread overview]
Message-ID: <202601250905.skPDsShd-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: cros-kernel-buildreports@googlegroups.com

tree:   https://android.googlesource.com/kernel/common android12-kiwi-5.10
head:   23658a471d5af4e7b9df0559075c0b57bbf22a67
commit: 51c9ed876ce194f1f3c6bd778b7bb46a8deb1dd9 [198/198] ANDROID: GKI: Add DRM_TTM config to GKI
:::::: branch date: 13 hours ago
:::::: commit date: 6 years ago
config: i386-randconfig-141-20260125 (https://download.01.org/0day-ci/archive/20260125/202601250905.skPDsShd-lkp@intel.com/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.0
smatch version: v0.5.0-8994-gd50c5a4c

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202601250905.skPDsShd-lkp@intel.com/

New smatch warnings:
drivers/gpu/drm/ttm/ttm_bo.c:854 ttm_mem_evict_first() warn: inconsistent returns 'global &ttm_bo_glob.lru_lock'.
drivers/gpu/drm/ttm/ttm_bo.c:1875 ttm_bo_swapout() warn: inconsistent returns '&glob->lru_lock'.
drivers/gpu/drm/ttm/ttm_bo_util.c:424 ttm_bo_move_memcpy() error: we previously assumed 'ttm' could be null (see line 399)
drivers/gpu/drm/ttm/ttm_page_alloc.c:499 ttm_alloc_new_pages() warn: use 'gfp_flags' here instead of GFP_KERNEL?
drivers/gpu/drm/ttm/ttm_page_alloc.c:1008 ttm_page_alloc_init() warn: Calling kobject_put|get with state->initialized unset from line: 967

Old smatch warnings:
drivers/gpu/drm/ttm/ttm_bo.c:840 ttm_mem_evict_first() warn: iterator used outside loop: 'bo'

vim +854 drivers/gpu/drm/ttm/ttm_bo.c

d367bd2a5e2b12 Christian König   2019-05-22  783  
ca262a9998d461 Jerome Glisse     2009-12-08  784  static int ttm_mem_evict_first(struct ttm_bo_device *bdev,
ba4e7d973dd09b Thomas Hellstrom  2009-06-10  785  			       uint32_t mem_type,
e300180f71037f Michel Dänzer     2014-10-09  786  			       const struct ttm_place *place,
d367bd2a5e2b12 Christian König   2019-05-22  787  			       struct ttm_operation_ctx *ctx,
d367bd2a5e2b12 Christian König   2019-05-22  788  			       struct ww_acquire_ctx *ticket)
ba4e7d973dd09b Thomas Hellstrom  2009-06-10  789  {
d367bd2a5e2b12 Christian König   2019-05-22  790  	struct ttm_buffer_object *bo = NULL, *busy_bo = NULL;
ba4e7d973dd09b Thomas Hellstrom  2009-06-10  791  	struct ttm_mem_type_manager *man = &bdev->man[mem_type];
6ba435812e0d85 Christian König   2017-11-08  792  	bool locked = false;
cf6c467d67d319 Christian König   2017-01-10  793  	unsigned i;
6ba435812e0d85 Christian König   2017-11-08  794  	int ret;
ba4e7d973dd09b Thomas Hellstrom  2009-06-10  795  
97588b5b9a6b33 Christian König   2019-09-25  796  	spin_lock(&ttm_bo_glob.lru_lock);
cf6c467d67d319 Christian König   2017-01-10  797  	for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) {
cf6c467d67d319 Christian König   2017-01-10  798  		list_for_each_entry(bo, &man->lru[i], lru) {
d367bd2a5e2b12 Christian König   2019-05-22  799  			bool busy;
d367bd2a5e2b12 Christian König   2019-05-22  800  
d367bd2a5e2b12 Christian König   2019-05-22  801  			if (!ttm_bo_evict_swapout_allowable(bo, ctx, &locked,
d367bd2a5e2b12 Christian König   2019-05-22  802  							    &busy)) {
0dbd555a011c2d Christian König   2019-07-31  803  				if (busy && !busy_bo && ticket !=
52791eeec1d9f4 Christian König   2019-08-11  804  				    dma_resv_locking_ctx(bo->base.resv))
d367bd2a5e2b12 Christian König   2019-05-22  805  					busy_bo = bo;
6ba435812e0d85 Christian König   2017-11-08  806  				continue;
d367bd2a5e2b12 Christian König   2019-05-22  807  			}
a2ab19fed9d1dc Christian König   2016-08-30  808  
cf6c467d67d319 Christian König   2017-01-10  809  			if (place && !bdev->driver->eviction_valuable(bo,
cf6c467d67d319 Christian König   2017-01-10  810  								      place)) {
6ba435812e0d85 Christian König   2017-11-08  811  				if (locked)
52791eeec1d9f4 Christian König   2019-08-11  812  					dma_resv_unlock(bo->base.resv);
e300180f71037f Michel Dänzer     2014-10-09  813  				continue;
e300180f71037f Michel Dänzer     2014-10-09  814  			}
1ec39923ef24f5 Christian König   2019-11-11  815  			if (!ttm_bo_get_unless_zero(bo)) {
1ec39923ef24f5 Christian König   2019-11-11  816  				if (locked)
1ec39923ef24f5 Christian König   2019-11-11  817  					dma_resv_unlock(bo->base.resv);
1ec39923ef24f5 Christian König   2019-11-11  818  				continue;
1ec39923ef24f5 Christian König   2019-11-11  819  			}
e7ab20197be3ee Maarten Lankhorst 2012-11-28  820  			break;
e7ab20197be3ee Maarten Lankhorst 2012-11-28  821  		}
e7ab20197be3ee Maarten Lankhorst 2012-11-28  822  
6ba435812e0d85 Christian König   2017-11-08  823  		/* If the inner loop terminated early, we have our candidate */
6ba435812e0d85 Christian König   2017-11-08  824  		if (&bo->lru != &man->lru[i])
cf6c467d67d319 Christian König   2017-01-10  825  			break;
6ba435812e0d85 Christian König   2017-11-08  826  
6ba435812e0d85 Christian König   2017-11-08  827  		bo = NULL;
cf6c467d67d319 Christian König   2017-01-10  828  	}
cf6c467d67d319 Christian König   2017-01-10  829  
6ba435812e0d85 Christian König   2017-11-08  830  	if (!bo) {
1ec39923ef24f5 Christian König   2019-11-11  831  		if (busy_bo && !ttm_bo_get_unless_zero(busy_bo))
1ec39923ef24f5 Christian König   2019-11-11  832  			busy_bo = NULL;
97588b5b9a6b33 Christian König   2019-09-25  833  		spin_unlock(&ttm_bo_glob.lru_lock);
d367bd2a5e2b12 Christian König   2019-05-22  834  		ret = ttm_mem_evict_wait_busy(busy_bo, ctx, ticket);
d367bd2a5e2b12 Christian König   2019-05-22  835  		if (busy_bo)
1ec39923ef24f5 Christian König   2019-11-11  836  			ttm_bo_put(busy_bo);
d367bd2a5e2b12 Christian König   2019-05-22  837  		return ret;
9c51ba1db37cab Thomas Hellstrom  2009-12-02  838  	}
9c51ba1db37cab Thomas Hellstrom  2009-12-02  839  
1ec39923ef24f5 Christian König   2019-11-11  840  	if (bo->deleted) {
83876c1bed8c91 Christian König   2017-04-12  841  		ret = ttm_bo_cleanup_refs(bo, ctx->interruptible,
83876c1bed8c91 Christian König   2017-04-12  842  					  ctx->no_wait_gpu, locked);
1ec39923ef24f5 Christian König   2019-11-11  843  		ttm_bo_put(bo);
ba4e7d973dd09b Thomas Hellstrom  2009-06-10  844  		return ret;
9c51ba1db37cab Thomas Hellstrom  2009-12-02  845  	}
9c51ba1db37cab Thomas Hellstrom  2009-12-02  846  
97588b5b9a6b33 Christian König   2019-09-25  847  	spin_unlock(&ttm_bo_glob.lru_lock);
9c51ba1db37cab Thomas Hellstrom  2009-12-02  848  
83876c1bed8c91 Christian König   2017-04-12  849  	ret = ttm_bo_evict(bo, ctx);
9165fb879f62a7 Christian König   2019-09-19  850  	if (locked)
ca262a9998d461 Jerome Glisse     2009-12-08  851  		ttm_bo_unreserve(bo);
9c51ba1db37cab Thomas Hellstrom  2009-12-02  852  
1ec39923ef24f5 Christian König   2019-11-11  853  	ttm_bo_put(bo);
ca262a9998d461 Jerome Glisse     2009-12-08 @854  	return ret;
ca262a9998d461 Jerome Glisse     2009-12-08  855  }
ba4e7d973dd09b Thomas Hellstrom  2009-06-10  856  

:::::: The code at line 854 was first introduced by commit
:::::: ca262a9998d46196750bb19a9dc4bd465b170ff7 drm/ttm: Rework validation & memory space allocation (V3)

:::::: TO: Jerome Glisse <jglisse@redhat.com>
:::::: CC: Dave Airlie <airlied@redhat.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-01-25  2:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202601250905.skPDsShd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.