From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [drm-misc:drm-misc-next 3/7] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:594 kfd_procfs_add_sysfs_stats() warn: Calling kobject_put|get with state->initialized unset from line: 582
Date: Sat, 13 Dec 2025 21:24:46 +0800 [thread overview]
Message-ID: <202512132152.Ftx1yfio-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: dri-devel@lists.freedesktop.org
TO: Philipp Stanner <phasta@kernel.org>
CC: "Christian König" <christian.koenig@amd.com>
CC: Felix Kuehling <felix.kuehling@amd.com>
tree: https://gitlab.freedesktop.org/drm/misc/kernel.git drm-misc-next
head: d8684ae1cdcf848d21e00bc0e0de821d694a207b
commit: 06bc18e0def7d926265480faa555bf0b67a35a90 [3/7] amd/amdkfd: Use dma_fence_check_and_signal()
:::::: branch date: 5 hours ago
:::::: commit date: 9 days ago
config: x86_64-randconfig-161-20251213 (https://download.01.org/0day-ci/archive/20251213/202512132152.Ftx1yfio-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
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/202512132152.Ftx1yfio-lkp@intel.com/
New smatch warnings:
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:594 kfd_procfs_add_sysfs_stats() warn: Calling kobject_put|get with state->initialized unset from line: 582
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:887 kfd_create_process() warn: Calling kobject_put|get with state->initialized unset from line: 877
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:1999 signal_eviction_fence() warn: signedness bug returning '(-22)'
Old smatch warnings:
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:640 kfd_procfs_add_sysfs_counters() warn: Calling kobject_put|get with state->initialized unset from line: 631
vim +594 drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c
32cb59f3136248c Mukul Joshi 2020-05-26 561
75ae84c89b136a5 Philip Yang 2021-06-16 562 static void kfd_procfs_add_sysfs_stats(struct kfd_process *p)
4327bed2ff8e3dd Philip Cox 2020-06-30 563 {
75ae84c89b136a5 Philip Yang 2021-06-16 564 int ret;
6ae2784114c037c Alex Sierra 2020-04-01 565 int i;
4327bed2ff8e3dd Philip Cox 2020-06-30 566 char stats_dir_filename[MAX_SYSFS_FILENAME_LEN];
4327bed2ff8e3dd Philip Cox 2020-06-30 567
75ae84c89b136a5 Philip Yang 2021-06-16 568 if (!p || !p->kobj)
75ae84c89b136a5 Philip Yang 2021-06-16 569 return;
4327bed2ff8e3dd Philip Cox 2020-06-30 570
4327bed2ff8e3dd Philip Cox 2020-06-30 571 /*
4327bed2ff8e3dd Philip Cox 2020-06-30 572 * Create sysfs files for each GPU:
4327bed2ff8e3dd Philip Cox 2020-06-30 573 * - proc/<pid>/stats_<gpuid>/
4327bed2ff8e3dd Philip Cox 2020-06-30 574 * - proc/<pid>/stats_<gpuid>/evicted_ms
f2fa07b39fafb2a Ramesh Errabolu 2020-09-29 575 * - proc/<pid>/stats_<gpuid>/cu_occupancy
4327bed2ff8e3dd Philip Cox 2020-06-30 576 */
6ae2784114c037c Alex Sierra 2020-04-01 577 for (i = 0; i < p->n_pdds; i++) {
6ae2784114c037c Alex Sierra 2020-04-01 578 struct kfd_process_device *pdd = p->pdds[i];
4327bed2ff8e3dd Philip Cox 2020-06-30 579
4327bed2ff8e3dd Philip Cox 2020-06-30 580 snprintf(stats_dir_filename, MAX_SYSFS_FILENAME_LEN,
4327bed2ff8e3dd Philip Cox 2020-06-30 581 "stats_%u", pdd->dev->id);
75ae84c89b136a5 Philip Yang 2021-06-16 582 pdd->kobj_stats = kfd_alloc_struct(pdd->kobj_stats);
75ae84c89b136a5 Philip Yang 2021-06-16 583 if (!pdd->kobj_stats)
75ae84c89b136a5 Philip Yang 2021-06-16 584 return;
4327bed2ff8e3dd Philip Cox 2020-06-30 585
75ae84c89b136a5 Philip Yang 2021-06-16 586 ret = kobject_init_and_add(pdd->kobj_stats,
4327bed2ff8e3dd Philip Cox 2020-06-30 587 &procfs_stats_type,
4327bed2ff8e3dd Philip Cox 2020-06-30 588 p->kobj,
4327bed2ff8e3dd Philip Cox 2020-06-30 589 stats_dir_filename);
4327bed2ff8e3dd Philip Cox 2020-06-30 590
4327bed2ff8e3dd Philip Cox 2020-06-30 591 if (ret) {
4327bed2ff8e3dd Philip Cox 2020-06-30 592 pr_warn("Creating KFD proc/stats_%s folder failed",
4327bed2ff8e3dd Philip Cox 2020-06-30 593 stats_dir_filename);
75ae84c89b136a5 Philip Yang 2021-06-16 @594 kobject_put(pdd->kobj_stats);
75ae84c89b136a5 Philip Yang 2021-06-16 595 pdd->kobj_stats = NULL;
75ae84c89b136a5 Philip Yang 2021-06-16 596 return;
4327bed2ff8e3dd Philip Cox 2020-06-30 597 }
4327bed2ff8e3dd Philip Cox 2020-06-30 598
75ae84c89b136a5 Philip Yang 2021-06-16 599 kfd_sysfs_create_file(pdd->kobj_stats, &pdd->attr_evict,
75ae84c89b136a5 Philip Yang 2021-06-16 600 "evicted_ms");
f2fa07b39fafb2a Ramesh Errabolu 2020-09-29 601 /* Add sysfs file to report compute unit occupancy */
75ae84c89b136a5 Philip Yang 2021-06-16 602 if (pdd->dev->kfd2kgd->get_cu_occupancy)
75ae84c89b136a5 Philip Yang 2021-06-16 603 kfd_sysfs_create_file(pdd->kobj_stats,
75ae84c89b136a5 Philip Yang 2021-06-16 604 &pdd->attr_cu_occupancy,
75ae84c89b136a5 Philip Yang 2021-06-16 605 "cu_occupancy");
f2fa07b39fafb2a Ramesh Errabolu 2020-09-29 606 }
4327bed2ff8e3dd Philip Cox 2020-06-30 607 }
4327bed2ff8e3dd Philip Cox 2020-06-30 608
:::::: The code at line 594 was first introduced by commit
:::::: 75ae84c89b136a5c0193ab7064b03cddfcebba39 drm/amdkfd: add helper function for kfd sysfs create
:::::: TO: Philip Yang <Philip.Yang@amd.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-12-13 13:25 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=202512132152.Ftx1yfio-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.