* drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:763 amdgpu_ttm_io_mem_reserve() warn: should 'mem->start << 14' be a 64 bit
@ 2021-01-14 6:28 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-01-14 6:28 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 4815 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Christian König" <christian.koenig@amd.com>
CC: Dave Airlie <airlied@redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 65f0d2414b7079556fbbcc070b3d1c9f9587606d
commit: 54d04ea8cdbd143496e4f5cc9c0a9f86c0e55a2e drm/ttm: merge offset and base in ttm_bus_placement
date: 4 months ago
:::::: branch date: 11 hours ago
:::::: commit date: 4 months ago
config: powerpc-randconfig-m031-20210114 (attached as .config)
compiler: powerpc-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>
New smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:763 amdgpu_ttm_io_mem_reserve() warn: should 'mem->start << 14' be a 64 bit type?
Old smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:494 amdgpu_move_blit() warn: should 'new_mem->num_pages << 14' be a 64 bit type?
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:789 amdgpu_ttm_io_mem_pfn() warn: should 'page_offset << 14' be a 64 bit type?
vim +763 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
d38ceaf99ed015f2 Alex Deucher 2015-04-20 744
50da51744f005f4a Tom St Denis 2018-05-09 745 /**
50da51744f005f4a Tom St Denis 2018-05-09 746 * amdgpu_ttm_io_mem_reserve - Reserve a block of memory during a fault
50da51744f005f4a Tom St Denis 2018-05-09 747 *
50da51744f005f4a Tom St Denis 2018-05-09 748 * Called by ttm_mem_io_reserve() ultimately via ttm_bo_vm_fault()
50da51744f005f4a Tom St Denis 2018-05-09 749 */
2966141ad2dda23d Dave Airlie 2020-08-04 750 static int amdgpu_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_resource *mem)
d38ceaf99ed015f2 Alex Deucher 2015-04-20 751 {
a7d64de659946e85 Christian König 2016-09-15 752 struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
f8f4b9a679e52298 Amber Lin 2018-02-27 753 struct drm_mm_node *mm_node = mem->mm_node;
ebb21aa1882f418b Dave Airlie 2020-08-11 754 size_t bus_size = (size_t)mem->num_pages << PAGE_SHIFT;
d38ceaf99ed015f2 Alex Deucher 2015-04-20 755
d38ceaf99ed015f2 Alex Deucher 2015-04-20 756 switch (mem->mem_type) {
d38ceaf99ed015f2 Alex Deucher 2015-04-20 757 case TTM_PL_SYSTEM:
d38ceaf99ed015f2 Alex Deucher 2015-04-20 758 /* system memory */
d38ceaf99ed015f2 Alex Deucher 2015-04-20 759 return 0;
d38ceaf99ed015f2 Alex Deucher 2015-04-20 760 case TTM_PL_TT:
d38ceaf99ed015f2 Alex Deucher 2015-04-20 761 break;
d38ceaf99ed015f2 Alex Deucher 2015-04-20 762 case TTM_PL_VRAM:
d38ceaf99ed015f2 Alex Deucher 2015-04-20 @763 mem->bus.offset = mem->start << PAGE_SHIFT;
d38ceaf99ed015f2 Alex Deucher 2015-04-20 764 /* check if it's visible */
ebb21aa1882f418b Dave Airlie 2020-08-11 765 if ((mem->bus.offset + bus_size) > adev->gmc.visible_vram_size)
d38ceaf99ed015f2 Alex Deucher 2015-04-20 766 return -EINVAL;
f8f4b9a679e52298 Amber Lin 2018-02-27 767 /* Only physically contiguous buffers apply. In a contiguous
f8f4b9a679e52298 Amber Lin 2018-02-27 768 * buffer, size of the first mm_node would match the number of
2966141ad2dda23d Dave Airlie 2020-08-04 769 * pages in ttm_resource.
f8f4b9a679e52298 Amber Lin 2018-02-27 770 */
f8f4b9a679e52298 Amber Lin 2018-02-27 771 if (adev->mman.aper_base_kaddr &&
f8f4b9a679e52298 Amber Lin 2018-02-27 772 (mm_node->size == mem->num_pages))
f8f4b9a679e52298 Amber Lin 2018-02-27 773 mem->bus.addr = (u8 *)adev->mman.aper_base_kaddr +
f8f4b9a679e52298 Amber Lin 2018-02-27 774 mem->bus.offset;
f8f4b9a679e52298 Amber Lin 2018-02-27 775
54d04ea8cdbd1434 Christian König 2020-09-07 776 mem->bus.offset += adev->gmc.aper_base;
d38ceaf99ed015f2 Alex Deucher 2015-04-20 777 mem->bus.is_iomem = true;
d38ceaf99ed015f2 Alex Deucher 2015-04-20 778 break;
d38ceaf99ed015f2 Alex Deucher 2015-04-20 779 default:
d38ceaf99ed015f2 Alex Deucher 2015-04-20 780 return -EINVAL;
d38ceaf99ed015f2 Alex Deucher 2015-04-20 781 }
d38ceaf99ed015f2 Alex Deucher 2015-04-20 782 return 0;
d38ceaf99ed015f2 Alex Deucher 2015-04-20 783 }
d38ceaf99ed015f2 Alex Deucher 2015-04-20 784
:::::: The code at line 763 was first introduced by commit
:::::: d38ceaf99ed015f2a0b9af3499791bd3a3daae21 drm/amdgpu: add core driver (v4)
:::::: TO: Alex Deucher <alexander.deucher@amd.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>
---
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: 26098 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-14 6:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 6:28 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:763 amdgpu_ttm_io_mem_reserve() warn: should 'mem->start << 14' be a 64 bit kernel test robot
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.