From: kernel test robot <lkp@intel.com> To: "Christian König" <ckoenig.leichtzumerken@gmail.com>, thomas_os@shipmail.org, dri-devel@lists.freedesktop.org Cc: kbuild-all@lists.01.org Subject: Re: [PATCH] drm/ttm: fix pipelined gutting Date: Tue, 8 Jun 2021 20:03:59 +0800 [thread overview] Message-ID: <202106081927.P717VlRe-lkp@intel.com> (raw) In-Reply-To: <20210608075021.3058-1-christian.koenig@amd.com> [-- Attachment #1: Type: text/plain, Size: 5735 bytes --] Hi "Christian, I love your patch! Yet something to improve: [auto build test ERROR on drm-tip/drm-tip] [cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.13-rc5 next-20210607] [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] url: https://github.com/0day-ci/linux/commits/Christian-K-nig/drm-ttm-fix-pipelined-gutting/20210608-155139 base: git://anongit.freedesktop.org/drm/drm-tip drm-tip config: x86_64-randconfig-s021-20210607 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.3-341-g8af24329-dirty # https://github.com/0day-ci/linux/commit/f7422b929beac0ad1d98db9ede99fa91a73f0360 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Christian-K-nig/drm-ttm-fix-pipelined-gutting/20210608-155139 git checkout f7422b929beac0ad1d98db9ede99fa91a73f0360 # save the attached .config to linux build tree make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_pipeline_gutting': >> drivers/gpu/drm/ttm/ttm_bo_util.c:637:24: error: incompatible type for argument 2 of 'ttm_bo_assign_mem' 637 | ttm_bo_assign_mem(bo, sys_mem); | ^~~~~~~ | | | const struct ttm_place In file included from drivers/gpu/drm/ttm/ttm_bo_util.c:32: include/drm/ttm/ttm_bo_driver.h:190:31: note: expected 'struct ttm_resource *' but argument is of type 'const struct ttm_place' 190 | struct ttm_resource *new_mem) | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~ >> drivers/gpu/drm/ttm/ttm_bo_util.c:644:24: error: passing argument 2 of 'ttm_resource_free' from incompatible pointer type [-Werror=incompatible-pointer-types] 644 | ttm_resource_free(bo, &sys_mem); | ^~~~~~~~ | | | const struct ttm_place * In file included from include/drm/ttm/ttm_device.h:30, from include/drm/ttm/ttm_bo_driver.h:40, from drivers/gpu/drm/ttm/ttm_bo_util.c:32: include/drm/ttm/ttm_resource.h:268:76: note: expected 'struct ttm_resource **' but argument is of type 'const struct ttm_place *' 268 | void ttm_resource_free(struct ttm_buffer_object *bo, struct ttm_resource **res); | ~~~~~~~~~~~~~~~~~~~~~~^~~ cc1: some warnings being treated as errors vim +/ttm_bo_assign_mem +637 drivers/gpu/drm/ttm/ttm_bo_util.c 569 570 /** 571 * ttm_bo_pipeline_gutting - purge the contents of a bo 572 * @bo: The buffer object 573 * 574 * Purge the contents of a bo, async if the bo is not idle. 575 * After a successful call, the bo is left unpopulated in 576 * system placement. The function may wait uninterruptible 577 * for idle on OOM. 578 * 579 * Return: 0 if successful, negative error code on failure. 580 */ 581 int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo) 582 { 583 static const struct ttm_place sys_mem = { .mem_type = TTM_PL_SYSTEM }; 584 struct ttm_buffer_object *ghost; 585 struct ttm_resource *sys_res; 586 struct ttm_tt *ttm; 587 int ret; 588 589 /* If already idle, no need for ghost object dance. */ 590 ret = ttm_bo_wait(bo, false, true); 591 if (ret != -EBUSY) { 592 if (!bo->ttm) { 593 /* See comment below about clearing. */ 594 ret = ttm_tt_create(bo, true); 595 if (ret) 596 return ret; 597 } else { 598 ttm_tt_unpopulate(bo->bdev, bo->ttm); 599 if (bo->type == ttm_bo_type_device) 600 ttm_tt_mark_for_clear(bo->ttm); 601 } 602 ttm_resource_free(bo, &bo->resource); 603 return ttm_resource_alloc(bo, &sys_mem, &bo->resource); 604 } 605 606 607 ret = ttm_resource_alloc(bo, &sys_mem, &sys_res); 608 609 /* 610 * We need an unpopulated ttm_tt after giving our current one, 611 * if any, to the ghost object. And we can't afford to fail 612 * creating one *after* the operation. If the bo subsequently gets 613 * resurrected, make sure it's cleared (if ttm_bo_type_device) 614 * to avoid leaking sensitive information to user-space. 615 */ 616 617 ttm = bo->ttm; 618 bo->ttm = NULL; 619 ret = ttm_tt_create(bo, true); 620 swap(bo->ttm, ttm); 621 if (ret) 622 goto error_free_sys_mem; 623 624 ret = ttm_buffer_object_transfer(bo, &ghost); 625 if (ret) 626 goto error_destroy_tt; 627 628 ret = dma_resv_copy_fences(&ghost->base._resv, bo->base.resv); 629 /* Last resort, wait for the BO to be idle when we are OOM */ 630 if (ret) 631 ttm_bo_wait(bo, false, false); 632 633 dma_resv_unlock(&ghost->base._resv); 634 ttm_bo_put(ghost); 635 bo->ttm = ttm; 636 bo->resource = NULL; > 637 ttm_bo_assign_mem(bo, sys_mem); 638 return 0; 639 640 error_destroy_tt: 641 ttm_tt_destroy(bo->bdev, ttm); 642 643 error_free_sys_mem: > 644 ttm_resource_free(bo, &sys_mem); --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 38975 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com> To: kbuild-all@lists.01.org Subject: Re: [PATCH] drm/ttm: fix pipelined gutting Date: Tue, 08 Jun 2021 20:03:59 +0800 [thread overview] Message-ID: <202106081927.P717VlRe-lkp@intel.com> (raw) In-Reply-To: <20210608075021.3058-1-christian.koenig@amd.com> [-- Attachment #1: Type: text/plain, Size: 5872 bytes --] Hi "Christian, I love your patch! Yet something to improve: [auto build test ERROR on drm-tip/drm-tip] [cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.13-rc5 next-20210607] [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] url: https://github.com/0day-ci/linux/commits/Christian-K-nig/drm-ttm-fix-pipelined-gutting/20210608-155139 base: git://anongit.freedesktop.org/drm/drm-tip drm-tip config: x86_64-randconfig-s021-20210607 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.3-341-g8af24329-dirty # https://github.com/0day-ci/linux/commit/f7422b929beac0ad1d98db9ede99fa91a73f0360 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Christian-K-nig/drm-ttm-fix-pipelined-gutting/20210608-155139 git checkout f7422b929beac0ad1d98db9ede99fa91a73f0360 # save the attached .config to linux build tree make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_pipeline_gutting': >> drivers/gpu/drm/ttm/ttm_bo_util.c:637:24: error: incompatible type for argument 2 of 'ttm_bo_assign_mem' 637 | ttm_bo_assign_mem(bo, sys_mem); | ^~~~~~~ | | | const struct ttm_place In file included from drivers/gpu/drm/ttm/ttm_bo_util.c:32: include/drm/ttm/ttm_bo_driver.h:190:31: note: expected 'struct ttm_resource *' but argument is of type 'const struct ttm_place' 190 | struct ttm_resource *new_mem) | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~ >> drivers/gpu/drm/ttm/ttm_bo_util.c:644:24: error: passing argument 2 of 'ttm_resource_free' from incompatible pointer type [-Werror=incompatible-pointer-types] 644 | ttm_resource_free(bo, &sys_mem); | ^~~~~~~~ | | | const struct ttm_place * In file included from include/drm/ttm/ttm_device.h:30, from include/drm/ttm/ttm_bo_driver.h:40, from drivers/gpu/drm/ttm/ttm_bo_util.c:32: include/drm/ttm/ttm_resource.h:268:76: note: expected 'struct ttm_resource **' but argument is of type 'const struct ttm_place *' 268 | void ttm_resource_free(struct ttm_buffer_object *bo, struct ttm_resource **res); | ~~~~~~~~~~~~~~~~~~~~~~^~~ cc1: some warnings being treated as errors vim +/ttm_bo_assign_mem +637 drivers/gpu/drm/ttm/ttm_bo_util.c 569 570 /** 571 * ttm_bo_pipeline_gutting - purge the contents of a bo 572 * @bo: The buffer object 573 * 574 * Purge the contents of a bo, async if the bo is not idle. 575 * After a successful call, the bo is left unpopulated in 576 * system placement. The function may wait uninterruptible 577 * for idle on OOM. 578 * 579 * Return: 0 if successful, negative error code on failure. 580 */ 581 int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo) 582 { 583 static const struct ttm_place sys_mem = { .mem_type = TTM_PL_SYSTEM }; 584 struct ttm_buffer_object *ghost; 585 struct ttm_resource *sys_res; 586 struct ttm_tt *ttm; 587 int ret; 588 589 /* If already idle, no need for ghost object dance. */ 590 ret = ttm_bo_wait(bo, false, true); 591 if (ret != -EBUSY) { 592 if (!bo->ttm) { 593 /* See comment below about clearing. */ 594 ret = ttm_tt_create(bo, true); 595 if (ret) 596 return ret; 597 } else { 598 ttm_tt_unpopulate(bo->bdev, bo->ttm); 599 if (bo->type == ttm_bo_type_device) 600 ttm_tt_mark_for_clear(bo->ttm); 601 } 602 ttm_resource_free(bo, &bo->resource); 603 return ttm_resource_alloc(bo, &sys_mem, &bo->resource); 604 } 605 606 607 ret = ttm_resource_alloc(bo, &sys_mem, &sys_res); 608 609 /* 610 * We need an unpopulated ttm_tt after giving our current one, 611 * if any, to the ghost object. And we can't afford to fail 612 * creating one *after* the operation. If the bo subsequently gets 613 * resurrected, make sure it's cleared (if ttm_bo_type_device) 614 * to avoid leaking sensitive information to user-space. 615 */ 616 617 ttm = bo->ttm; 618 bo->ttm = NULL; 619 ret = ttm_tt_create(bo, true); 620 swap(bo->ttm, ttm); 621 if (ret) 622 goto error_free_sys_mem; 623 624 ret = ttm_buffer_object_transfer(bo, &ghost); 625 if (ret) 626 goto error_destroy_tt; 627 628 ret = dma_resv_copy_fences(&ghost->base._resv, bo->base.resv); 629 /* Last resort, wait for the BO to be idle when we are OOM */ 630 if (ret) 631 ttm_bo_wait(bo, false, false); 632 633 dma_resv_unlock(&ghost->base._resv); 634 ttm_bo_put(ghost); 635 bo->ttm = ttm; 636 bo->resource = NULL; > 637 ttm_bo_assign_mem(bo, sys_mem); 638 return 0; 639 640 error_destroy_tt: 641 ttm_tt_destroy(bo->bdev, ttm); 642 643 error_free_sys_mem: > 644 ttm_resource_free(bo, &sys_mem); --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org [-- Attachment #2: config.gz --] [-- Type: application/gzip, Size: 38975 bytes --]
next prev parent reply other threads:[~2021-06-08 12:04 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-08 7:50 [PATCH] drm/ttm: fix pipelined gutting Christian König 2021-06-08 8:12 ` Thomas Hellström 2021-06-08 12:03 ` kernel test robot [this message] 2021-06-08 12:03 ` kernel test robot 2021-06-09 1:50 ` kernel test robot 2021-06-09 1:50 ` kernel test robot
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=202106081927.P717VlRe-lkp@intel.com \ --to=lkp@intel.com \ --cc=ckoenig.leichtzumerken@gmail.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=kbuild-all@lists.01.org \ --cc=thomas_os@shipmail.org \ /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: linkBe 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.