From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/gpu/drm/nouveau/nouveau_bo5039.c:39 nv50_bo_move_m2mf() warn: should 'new_reg->num_pages << (12)' be a 64 bit
Date: Sat, 12 Sep 2020 14:52:49 +0800 [thread overview]
Message-ID: <202009121446.UBugG4kd%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6540 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Ben Skeggs <bskeggs@redhat.com>
CC: Lyude Paul <lyude@redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 729e3d091984487f7aa1ebfabfe594e5b317ed0f
commit: 8b9d5d63a7193156b6b397c4f5078efbc200695f drm/nouveau/bo: split buffer move functions into their own source files
date: 7 weeks ago
:::::: branch date: 10 hours ago
:::::: commit date: 7 weeks ago
config: riscv-randconfig-m031-20200911 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/gpu/drm/nouveau/nouveau_bo5039.c:39 nv50_bo_move_m2mf() warn: should 'new_reg->num_pages << (12)' be a 64 bit type?
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8b9d5d63a7193156b6b397c4f5078efbc200695f
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 8b9d5d63a7193156b6b397c4f5078efbc200695f
vim +39 drivers/gpu/drm/nouveau/nouveau_bo5039.c
8b9d5d63a71931 Ben Skeggs 2020-06-22 33
8b9d5d63a71931 Ben Skeggs 2020-06-22 34 int
8b9d5d63a71931 Ben Skeggs 2020-06-22 35 nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
8b9d5d63a71931 Ben Skeggs 2020-06-22 36 struct ttm_mem_reg *old_reg, struct ttm_mem_reg *new_reg)
8b9d5d63a71931 Ben Skeggs 2020-06-22 37 {
8b9d5d63a71931 Ben Skeggs 2020-06-22 38 struct nouveau_mem *mem = nouveau_mem(old_reg);
8b9d5d63a71931 Ben Skeggs 2020-06-22 @39 u64 length = (new_reg->num_pages << PAGE_SHIFT);
8b9d5d63a71931 Ben Skeggs 2020-06-22 40 u64 src_offset = mem->vma[0].addr;
8b9d5d63a71931 Ben Skeggs 2020-06-22 41 u64 dst_offset = mem->vma[1].addr;
8b9d5d63a71931 Ben Skeggs 2020-06-22 42 int src_tiled = !!mem->kind;
8b9d5d63a71931 Ben Skeggs 2020-06-22 43 int dst_tiled = !!nouveau_mem(new_reg)->kind;
8b9d5d63a71931 Ben Skeggs 2020-06-22 44 int ret;
8b9d5d63a71931 Ben Skeggs 2020-06-22 45
8b9d5d63a71931 Ben Skeggs 2020-06-22 46 while (length) {
8b9d5d63a71931 Ben Skeggs 2020-06-22 47 u32 amount, stride, height;
8b9d5d63a71931 Ben Skeggs 2020-06-22 48
8b9d5d63a71931 Ben Skeggs 2020-06-22 49 ret = RING_SPACE(chan, 18 + 6 * (src_tiled + dst_tiled));
8b9d5d63a71931 Ben Skeggs 2020-06-22 50 if (ret)
8b9d5d63a71931 Ben Skeggs 2020-06-22 51 return ret;
8b9d5d63a71931 Ben Skeggs 2020-06-22 52
8b9d5d63a71931 Ben Skeggs 2020-06-22 53 amount = min(length, (u64)(4 * 1024 * 1024));
8b9d5d63a71931 Ben Skeggs 2020-06-22 54 stride = 16 * 4;
8b9d5d63a71931 Ben Skeggs 2020-06-22 55 height = amount / stride;
8b9d5d63a71931 Ben Skeggs 2020-06-22 56
8b9d5d63a71931 Ben Skeggs 2020-06-22 57 if (src_tiled) {
8b9d5d63a71931 Ben Skeggs 2020-06-22 58 BEGIN_NV04(chan, NvSubCopy, 0x0200, 7);
8b9d5d63a71931 Ben Skeggs 2020-06-22 59 OUT_RING (chan, 0);
8b9d5d63a71931 Ben Skeggs 2020-06-22 60 OUT_RING (chan, 0);
8b9d5d63a71931 Ben Skeggs 2020-06-22 61 OUT_RING (chan, stride);
8b9d5d63a71931 Ben Skeggs 2020-06-22 62 OUT_RING (chan, height);
8b9d5d63a71931 Ben Skeggs 2020-06-22 63 OUT_RING (chan, 1);
8b9d5d63a71931 Ben Skeggs 2020-06-22 64 OUT_RING (chan, 0);
8b9d5d63a71931 Ben Skeggs 2020-06-22 65 OUT_RING (chan, 0);
8b9d5d63a71931 Ben Skeggs 2020-06-22 66 } else {
8b9d5d63a71931 Ben Skeggs 2020-06-22 67 BEGIN_NV04(chan, NvSubCopy, 0x0200, 1);
8b9d5d63a71931 Ben Skeggs 2020-06-22 68 OUT_RING (chan, 1);
8b9d5d63a71931 Ben Skeggs 2020-06-22 69 }
8b9d5d63a71931 Ben Skeggs 2020-06-22 70 if (dst_tiled) {
8b9d5d63a71931 Ben Skeggs 2020-06-22 71 BEGIN_NV04(chan, NvSubCopy, 0x021c, 7);
8b9d5d63a71931 Ben Skeggs 2020-06-22 72 OUT_RING (chan, 0);
8b9d5d63a71931 Ben Skeggs 2020-06-22 73 OUT_RING (chan, 0);
8b9d5d63a71931 Ben Skeggs 2020-06-22 74 OUT_RING (chan, stride);
8b9d5d63a71931 Ben Skeggs 2020-06-22 75 OUT_RING (chan, height);
8b9d5d63a71931 Ben Skeggs 2020-06-22 76 OUT_RING (chan, 1);
8b9d5d63a71931 Ben Skeggs 2020-06-22 77 OUT_RING (chan, 0);
8b9d5d63a71931 Ben Skeggs 2020-06-22 78 OUT_RING (chan, 0);
8b9d5d63a71931 Ben Skeggs 2020-06-22 79 } else {
8b9d5d63a71931 Ben Skeggs 2020-06-22 80 BEGIN_NV04(chan, NvSubCopy, 0x021c, 1);
8b9d5d63a71931 Ben Skeggs 2020-06-22 81 OUT_RING (chan, 1);
8b9d5d63a71931 Ben Skeggs 2020-06-22 82 }
8b9d5d63a71931 Ben Skeggs 2020-06-22 83
8b9d5d63a71931 Ben Skeggs 2020-06-22 84 BEGIN_NV04(chan, NvSubCopy, 0x0238, 2);
8b9d5d63a71931 Ben Skeggs 2020-06-22 85 OUT_RING (chan, upper_32_bits(src_offset));
8b9d5d63a71931 Ben Skeggs 2020-06-22 86 OUT_RING (chan, upper_32_bits(dst_offset));
8b9d5d63a71931 Ben Skeggs 2020-06-22 87 BEGIN_NV04(chan, NvSubCopy, 0x030c, 8);
8b9d5d63a71931 Ben Skeggs 2020-06-22 88 OUT_RING (chan, lower_32_bits(src_offset));
8b9d5d63a71931 Ben Skeggs 2020-06-22 89 OUT_RING (chan, lower_32_bits(dst_offset));
8b9d5d63a71931 Ben Skeggs 2020-06-22 90 OUT_RING (chan, stride);
8b9d5d63a71931 Ben Skeggs 2020-06-22 91 OUT_RING (chan, stride);
8b9d5d63a71931 Ben Skeggs 2020-06-22 92 OUT_RING (chan, stride);
8b9d5d63a71931 Ben Skeggs 2020-06-22 93 OUT_RING (chan, height);
8b9d5d63a71931 Ben Skeggs 2020-06-22 94 OUT_RING (chan, 0x00000101);
8b9d5d63a71931 Ben Skeggs 2020-06-22 95 OUT_RING (chan, 0x00000000);
8b9d5d63a71931 Ben Skeggs 2020-06-22 96 BEGIN_NV04(chan, NvSubCopy, NV_MEMORY_TO_MEMORY_FORMAT_NOP, 1);
8b9d5d63a71931 Ben Skeggs 2020-06-22 97 OUT_RING (chan, 0);
8b9d5d63a71931 Ben Skeggs 2020-06-22 98
8b9d5d63a71931 Ben Skeggs 2020-06-22 99 length -= amount;
8b9d5d63a71931 Ben Skeggs 2020-06-22 100 src_offset += amount;
8b9d5d63a71931 Ben Skeggs 2020-06-22 101 dst_offset += amount;
8b9d5d63a71931 Ben Skeggs 2020-06-22 102 }
8b9d5d63a71931 Ben Skeggs 2020-06-22 103
8b9d5d63a71931 Ben Skeggs 2020-06-22 104 return 0;
8b9d5d63a71931 Ben Skeggs 2020-06-22 105 }
8b9d5d63a71931 Ben Skeggs 2020-06-22 106
---
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: 26271 bytes --]
next reply other threads:[~2020-09-12 6:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-12 6:52 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-01-26 6:32 drivers/gpu/drm/nouveau/nouveau_bo5039.c:39 nv50_bo_move_m2mf() warn: should 'new_reg->num_pages << (12)' be a 64 bit kernel test robot
2020-08-07 17:43 drivers/gpu/drm/nouveau/nouveau_bo5039.c:39 nv50_bo_move_m2mf() warn: should 'new_reg->num_pages << 12' " kernel test robot
2020-08-07 17:43 ` 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=202009121446.UBugG4kd%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.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: 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.