From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [linux-next:master 540/3918] drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:541 amdgpu_debugfs_mqd_read() warn: ignoring unreachable code.
Date: Tue, 23 May 2023 01:38:25 +0800 [thread overview]
Message-ID: <202305230149.9cPLihRI-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Alex Deucher <alexander.deucher@amd.com>
CC: "Christian König" <christian.koenig@amd.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 9f258af06b6268be8e960f63c3f66e88bdbbbdb0
commit: 445d85e3c1dfd8c45b24be6f1527f1e117256d0e [540/3918] drm/amdgpu: add debugfs interface for reading MQDs
:::::: branch date: 14 hours ago
:::::: commit date: 4 weeks ago
config: s390-randconfig-m031-20230522 (https://download.01.org/0day-ci/archive/20230523/202305230149.9cPLihRI-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202305230149.9cPLihRI-lkp@intel.com/
New smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:541 amdgpu_debugfs_mqd_read() warn: ignoring unreachable code.
Old smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:480 amdgpu_debugfs_ring_read() warn: ignoring unreachable code.
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:495 amdgpu_debugfs_ring_read() warn: ignoring unreachable code.
vim +541 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
d38ceaf99ed015 Alex Deucher 2015-04-20 511
445d85e3c1dfd8 Alex Deucher 2023-03-21 512 static ssize_t amdgpu_debugfs_mqd_read(struct file *f, char __user *buf,
445d85e3c1dfd8 Alex Deucher 2023-03-21 513 size_t size, loff_t *pos)
445d85e3c1dfd8 Alex Deucher 2023-03-21 514 {
445d85e3c1dfd8 Alex Deucher 2023-03-21 515 struct amdgpu_ring *ring = file_inode(f)->i_private;
445d85e3c1dfd8 Alex Deucher 2023-03-21 516 volatile u32 *mqd;
445d85e3c1dfd8 Alex Deucher 2023-03-21 517 int r;
445d85e3c1dfd8 Alex Deucher 2023-03-21 518 uint32_t value, result;
445d85e3c1dfd8 Alex Deucher 2023-03-21 519
445d85e3c1dfd8 Alex Deucher 2023-03-21 520 if (*pos & 3 || size & 3)
445d85e3c1dfd8 Alex Deucher 2023-03-21 521 return -EINVAL;
445d85e3c1dfd8 Alex Deucher 2023-03-21 522
445d85e3c1dfd8 Alex Deucher 2023-03-21 523 result = 0;
445d85e3c1dfd8 Alex Deucher 2023-03-21 524
445d85e3c1dfd8 Alex Deucher 2023-03-21 525 r = amdgpu_bo_reserve(ring->mqd_obj, false);
445d85e3c1dfd8 Alex Deucher 2023-03-21 526 if (unlikely(r != 0))
445d85e3c1dfd8 Alex Deucher 2023-03-21 527 return r;
445d85e3c1dfd8 Alex Deucher 2023-03-21 528
445d85e3c1dfd8 Alex Deucher 2023-03-21 529 r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&mqd);
445d85e3c1dfd8 Alex Deucher 2023-03-21 530 if (r) {
445d85e3c1dfd8 Alex Deucher 2023-03-21 531 amdgpu_bo_unreserve(ring->mqd_obj);
445d85e3c1dfd8 Alex Deucher 2023-03-21 532 return r;
445d85e3c1dfd8 Alex Deucher 2023-03-21 533 }
445d85e3c1dfd8 Alex Deucher 2023-03-21 534
445d85e3c1dfd8 Alex Deucher 2023-03-21 535 while (size) {
445d85e3c1dfd8 Alex Deucher 2023-03-21 536 if (*pos >= ring->mqd_size)
445d85e3c1dfd8 Alex Deucher 2023-03-21 537 goto done;
445d85e3c1dfd8 Alex Deucher 2023-03-21 538
445d85e3c1dfd8 Alex Deucher 2023-03-21 539 value = mqd[*pos/4];
445d85e3c1dfd8 Alex Deucher 2023-03-21 540 r = put_user(value, (uint32_t *)buf);
445d85e3c1dfd8 Alex Deucher 2023-03-21 @541 if (r)
445d85e3c1dfd8 Alex Deucher 2023-03-21 542 goto done;
445d85e3c1dfd8 Alex Deucher 2023-03-21 543 buf += 4;
445d85e3c1dfd8 Alex Deucher 2023-03-21 544 result += 4;
445d85e3c1dfd8 Alex Deucher 2023-03-21 545 size -= 4;
445d85e3c1dfd8 Alex Deucher 2023-03-21 546 *pos += 4;
445d85e3c1dfd8 Alex Deucher 2023-03-21 547 }
445d85e3c1dfd8 Alex Deucher 2023-03-21 548
445d85e3c1dfd8 Alex Deucher 2023-03-21 549 done:
445d85e3c1dfd8 Alex Deucher 2023-03-21 550 amdgpu_bo_kunmap(ring->mqd_obj);
445d85e3c1dfd8 Alex Deucher 2023-03-21 551 mqd = NULL;
445d85e3c1dfd8 Alex Deucher 2023-03-21 552 amdgpu_bo_unreserve(ring->mqd_obj);
445d85e3c1dfd8 Alex Deucher 2023-03-21 553 if (r)
445d85e3c1dfd8 Alex Deucher 2023-03-21 554 return r;
445d85e3c1dfd8 Alex Deucher 2023-03-21 555
445d85e3c1dfd8 Alex Deucher 2023-03-21 556 return result;
445d85e3c1dfd8 Alex Deucher 2023-03-21 557 }
445d85e3c1dfd8 Alex Deucher 2023-03-21 558
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-05-22 17:38 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=202305230149.9cPLihRI-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.