Hi Christian, I love your patch! Perhaps something to improve: [auto build test WARNING on drm-misc/drm-misc-next] [also build test WARNING on drm-intel/for-linux-next drm-intel/for-linux-next-fixes linus/master v6.2-rc3 next-20230111] [cannot apply to drm-tip/drm-tip] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Christian-K-nig/drm-ttm-replace-busy-placement-with-flags/20230111-194408 base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next patch link: https://lore.kernel.org/r/20230111114256.72669-1-christian.koenig%40amd.com patch subject: [Intel-gfx] [PATCH 1/2] drm/ttm: prevent moving of pinned BOs config: ia64-allyesconfig compiler: ia64-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/303ff8f52b95005f1da7386c72a3907441e8de28 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Christian-K-nig/drm-ttm-replace-busy-placement-with-flags/20230111-194408 git checkout 303ff8f52b95005f1da7386c72a3907441e8de28 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/gpu/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/gpu/drm/radeon/radeon_ttm.c: In function 'radeon_bo_move': >> drivers/gpu/drm/radeon/radeon_ttm.c:201:27: warning: variable 'rbo' set but not used [-Wunused-but-set-variable] 201 | struct radeon_bo *rbo; | ^~~ vim +/rbo +201 drivers/gpu/drm/radeon/radeon_ttm.c 771fe6b912fca5 Jerome Glisse 2009-06-05 193 2823f4f019d888 Christian König 2017-04-26 194 static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict, 2823f4f019d888 Christian König 2017-04-26 195 struct ttm_operation_ctx *ctx, ebdf565169af00 Dave Airlie 2020-10-29 196 struct ttm_resource *new_mem, ebdf565169af00 Dave Airlie 2020-10-29 197 struct ttm_place *hop) 771fe6b912fca5 Jerome Glisse 2009-06-05 198 { d3116756a710e3 Christian König 2021-04-12 199 struct ttm_resource *old_mem = bo->resource; 771fe6b912fca5 Jerome Glisse 2009-06-05 200 struct radeon_device *rdev; e1a575ada8d2a3 Michel Dänzer 2016-03-28 @201 struct radeon_bo *rbo; a32ba6bdca21fd Christian König 2021-07-12 202 int r; 771fe6b912fca5 Jerome Glisse 2009-06-05 203 bfe5e585b44fb8 Dave Airlie 2020-10-20 204 if (new_mem->mem_type == TTM_PL_TT) { bfe5e585b44fb8 Dave Airlie 2020-10-20 205 r = radeon_ttm_tt_bind(bo->bdev, bo->ttm, new_mem); bfe5e585b44fb8 Dave Airlie 2020-10-20 206 if (r) bfe5e585b44fb8 Dave Airlie 2020-10-20 207 return r; bfe5e585b44fb8 Dave Airlie 2020-10-20 208 } 6d820003295977 Dave Airlie 2020-10-20 209 0ef1ed813e6b13 Dave Airlie 2020-09-23 210 r = ttm_bo_wait_ctx(bo, ctx); 88932a7be27d89 Christian König 2016-06-06 211 if (r) 9afdda82ee7f69 Christian König 2020-11-25 212 return r; 88932a7be27d89 Christian König 2016-06-06 213 e1a575ada8d2a3 Michel Dänzer 2016-03-28 214 rbo = container_of(bo, struct radeon_bo, tbo); 771fe6b912fca5 Jerome Glisse 2009-06-05 215 rdev = radeon_get_rdev(bo->bdev); 771fe6b912fca5 Jerome Glisse 2009-06-05 216 if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { ecfe6953fa0011 Dave Airlie 2020-09-08 217 ttm_bo_move_null(bo, new_mem); 9afdda82ee7f69 Christian König 2020-11-25 218 goto out; 771fe6b912fca5 Jerome Glisse 2009-06-05 219 } 51e50e54220432 Dave Airlie 2020-09-24 220 if (old_mem->mem_type == TTM_PL_SYSTEM && 51e50e54220432 Dave Airlie 2020-09-24 221 new_mem->mem_type == TTM_PL_TT) { ecfe6953fa0011 Dave Airlie 2020-09-08 222 ttm_bo_move_null(bo, new_mem); 9afdda82ee7f69 Christian König 2020-11-25 223 goto out; 771fe6b912fca5 Jerome Glisse 2009-06-05 224 } 51e50e54220432 Dave Airlie 2020-09-24 225 51e50e54220432 Dave Airlie 2020-09-24 226 if (old_mem->mem_type == TTM_PL_TT && c37d951cb42aa3 Dave Airlie 2020-10-19 227 new_mem->mem_type == TTM_PL_SYSTEM) { 29a1d482e4044a Dave Airlie 2020-10-20 228 radeon_ttm_tt_unbind(bo->bdev, bo->ttm); bfa3357ef9abc9 Christian König 2021-04-15 229 ttm_resource_free(bo, &bo->resource); c37d951cb42aa3 Dave Airlie 2020-10-19 230 ttm_bo_assign_mem(bo, new_mem); 9afdda82ee7f69 Christian König 2020-11-25 231 goto out; c37d951cb42aa3 Dave Airlie 2020-10-19 232 } 9afdda82ee7f69 Christian König 2020-11-25 233 if (rdev->ring[radeon_copy_ring_index(rdev)].ready && 9afdda82ee7f69 Christian König 2020-11-25 234 rdev->asic->copy.copy != NULL) { 9afdda82ee7f69 Christian König 2020-11-25 235 if ((old_mem->mem_type == TTM_PL_SYSTEM && 9afdda82ee7f69 Christian König 2020-11-25 236 new_mem->mem_type == TTM_PL_VRAM) || 9afdda82ee7f69 Christian König 2020-11-25 237 (old_mem->mem_type == TTM_PL_VRAM && 9afdda82ee7f69 Christian König 2020-11-25 238 new_mem->mem_type == TTM_PL_SYSTEM)) { 9afdda82ee7f69 Christian König 2020-11-25 239 hop->fpfn = 0; 9afdda82ee7f69 Christian König 2020-11-25 240 hop->lpfn = 0; 9afdda82ee7f69 Christian König 2020-11-25 241 hop->mem_type = TTM_PL_TT; 9afdda82ee7f69 Christian König 2020-11-25 242 hop->flags = 0; 9afdda82ee7f69 Christian König 2020-11-25 243 return -EMULTIHOP; 771fe6b912fca5 Jerome Glisse 2009-06-05 244 } 771fe6b912fca5 Jerome Glisse 2009-06-05 245 28a68f82826675 Dave Airlie 2020-10-29 246 r = radeon_move_blit(bo, evict, new_mem, old_mem); 9afdda82ee7f69 Christian König 2020-11-25 247 } else { 9afdda82ee7f69 Christian König 2020-11-25 248 r = -ENODEV; 9afdda82ee7f69 Christian König 2020-11-25 249 } 9afdda82ee7f69 Christian König 2020-11-25 250 1ab2e1059916b9 Michel Dänzer 2009-07-28 251 if (r) { 3e98d829ad0a59 Roger He 2017-12-08 252 r = ttm_bo_move_memcpy(bo, ctx, new_mem); 9afdda82ee7f69 Christian König 2020-11-25 253 if (r) 9afdda82ee7f69 Christian König 2020-11-25 254 return r; 67e8e3f970ad74 Marek Olšák 2014-03-02 255 } 67e8e3f970ad74 Marek Olšák 2014-03-02 256 9afdda82ee7f69 Christian König 2020-11-25 257 out: 67e8e3f970ad74 Marek Olšák 2014-03-02 258 /* update statistics */ e11bfb99d6ece2 Christian König 2020-12-09 259 atomic64_add(bo->base.size, &rdev->num_bytes_moved); a32ba6bdca21fd Christian König 2021-07-12 260 radeon_bo_move_notify(bo); 67e8e3f970ad74 Marek Olšák 2014-03-02 261 return 0; 67e8e3f970ad74 Marek Olšák 2014-03-02 262 } 771fe6b912fca5 Jerome Glisse 2009-06-05 263 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests