All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type?
@ 2022-05-27 10:45 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2022-05-27 10:28 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3821 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Alex Deucher <alexander.deucher@amd.com>
CC: "Christian König" <christian.koenig@amd.com>

Hi Alex,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7e284070abe53d448517b80493863595af4ab5f0
commit: 98bae89647603309ca2a5f172299ecc31c5d2db0 drm/amdgpu/gfx11: remove some register fields that no longer exist
date:   3 weeks ago
:::::: branch date: 6 hours ago
:::::: commit date: 3 weeks ago
config: arc-randconfig-m031-20220524 (https://download.01.org/0day-ci/archive/20220527/202205271813.mDvYkTtW-lkp(a)intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type?

vim +1292 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

3d879e81f0f9ed Hawking Zhang 2022-04-13  1263  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1264  static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *adev,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1265  					      SOC21_FIRMWARE_ID id,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1266  			    		      const void *fw_data,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1267  					      uint32_t fw_size,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1268  					      uint32_t *fw_autoload_mask)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1269  {
3d879e81f0f9ed Hawking Zhang 2022-04-13  1270  	uint32_t toc_offset;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1271  	uint32_t toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1272  	char *ptr = adev->gfx.rlc.rlc_autoload_ptr;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1273  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1274  	if (id <= SOC21_FIRMWARE_ID_INVALID || id >= SOC21_FIRMWARE_ID_MAX)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1275  		return;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1276  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1277  	toc_offset = rlc_autoload_info[id].offset;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1278  	toc_fw_size = rlc_autoload_info[id].size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1279  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1280  	if (fw_size == 0)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1281  		fw_size = toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1282  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1283  	if (fw_size > toc_fw_size)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1284  		fw_size = toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1285  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1286  	memcpy(ptr + toc_offset, fw_data, fw_size);
3d879e81f0f9ed Hawking Zhang 2022-04-13  1287  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1288  	if (fw_size < toc_fw_size)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1289  		memset(ptr + toc_offset + fw_size, 0, toc_fw_size - fw_size);
3d879e81f0f9ed Hawking Zhang 2022-04-13  1290  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1291  	if ((id != SOC21_FIRMWARE_ID_RS64_PFP) && (id != SOC21_FIRMWARE_ID_RS64_ME))
3d879e81f0f9ed Hawking Zhang 2022-04-13 @1292  		*(uint64_t *)fw_autoload_mask |= 1 << id;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1293  }
3d879e81f0f9ed Hawking Zhang 2022-04-13  1294  

:::::: The code@line 1292 was first introduced by commit
:::::: 3d879e81f0f9ed5d33b5eda0fe5226c884bb8073 drm/amdgpu: add init support for GFX11 (v2)

:::::: TO: Hawking Zhang <Hawking.Zhang@amd.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [kbuild] drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type?
@ 2022-05-27 10:45 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2022-05-27 10:45 UTC (permalink / raw)
  To: kbuild, Alex Deucher
  Cc: lkp, kbuild-all, linux-kernel, Christian König, amd-gfx

[ I sent this mail on May 9 but didn't hear back.  I'm not sure why
  kbuild is sending duplicates but it's probably a good thing.  -dan ]

Hi Alex,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master
head:   7e284070abe53d448517b80493863595af4ab5f0
commit: 98bae89647603309ca2a5f172299ecc31c5d2db0 drm/amdgpu/gfx11: remove some register fields that no longer exist
config: arc-randconfig-m031-20220524 (https://download.01.org/0day-ci/archive/20220527/202205271813.mDvYkTtW-lkp@intel.com/config )
compiler: arceb-elf-gcc (GCC) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type?

vim +1292 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

3d879e81f0f9ed Hawking Zhang 2022-04-13  1264  static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *adev,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1265  					      SOC21_FIRMWARE_ID id,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1266  			    		      const void *fw_data,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1267  					      uint32_t fw_size,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1268  					      uint32_t *fw_autoload_mask)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1269  {
3d879e81f0f9ed Hawking Zhang 2022-04-13  1270  	uint32_t toc_offset;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1271  	uint32_t toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1272  	char *ptr = adev->gfx.rlc.rlc_autoload_ptr;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1273  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1274  	if (id <= SOC21_FIRMWARE_ID_INVALID || id >= SOC21_FIRMWARE_ID_MAX)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1275  		return;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1276  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1277  	toc_offset = rlc_autoload_info[id].offset;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1278  	toc_fw_size = rlc_autoload_info[id].size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1279  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1280  	if (fw_size == 0)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1281  		fw_size = toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1282  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1283  	if (fw_size > toc_fw_size)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1284  		fw_size = toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1285  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1286  	memcpy(ptr + toc_offset, fw_data, fw_size);
3d879e81f0f9ed Hawking Zhang 2022-04-13  1287  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1288  	if (fw_size < toc_fw_size)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1289  		memset(ptr + toc_offset + fw_size, 0, toc_fw_size - fw_size);
3d879e81f0f9ed Hawking Zhang 2022-04-13  1290  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1291  	if ((id != SOC21_FIRMWARE_ID_RS64_PFP) && (id != SOC21_FIRMWARE_ID_RS64_ME))
3d879e81f0f9ed Hawking Zhang 2022-04-13 @1292  		*(uint64_t *)fw_autoload_mask |= 1 << id;
                                                                                         ^^^^^^^
"id" can be more than 31 so it needs to BIT_ULL(id) or 1ULL << id.

3d879e81f0f9ed Hawking Zhang 2022-04-13  1293  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp 
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [kbuild] drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type?
@ 2022-05-27 10:45 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2022-05-27 10:45 UTC (permalink / raw)
  To: kbuild, Alex Deucher
  Cc: Christian König, kbuild-all, lkp, amd-gfx, linux-kernel

[ I sent this mail on May 9 but didn't hear back.  I'm not sure why
  kbuild is sending duplicates but it's probably a good thing.  -dan ]

Hi Alex,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master
head:   7e284070abe53d448517b80493863595af4ab5f0
commit: 98bae89647603309ca2a5f172299ecc31c5d2db0 drm/amdgpu/gfx11: remove some register fields that no longer exist
config: arc-randconfig-m031-20220524 (https://download.01.org/0day-ci/archive/20220527/202205271813.mDvYkTtW-lkp@intel.com/config )
compiler: arceb-elf-gcc (GCC) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type?

vim +1292 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

3d879e81f0f9ed Hawking Zhang 2022-04-13  1264  static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *adev,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1265  					      SOC21_FIRMWARE_ID id,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1266  			    		      const void *fw_data,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1267  					      uint32_t fw_size,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1268  					      uint32_t *fw_autoload_mask)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1269  {
3d879e81f0f9ed Hawking Zhang 2022-04-13  1270  	uint32_t toc_offset;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1271  	uint32_t toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1272  	char *ptr = adev->gfx.rlc.rlc_autoload_ptr;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1273  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1274  	if (id <= SOC21_FIRMWARE_ID_INVALID || id >= SOC21_FIRMWARE_ID_MAX)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1275  		return;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1276  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1277  	toc_offset = rlc_autoload_info[id].offset;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1278  	toc_fw_size = rlc_autoload_info[id].size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1279  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1280  	if (fw_size == 0)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1281  		fw_size = toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1282  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1283  	if (fw_size > toc_fw_size)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1284  		fw_size = toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1285  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1286  	memcpy(ptr + toc_offset, fw_data, fw_size);
3d879e81f0f9ed Hawking Zhang 2022-04-13  1287  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1288  	if (fw_size < toc_fw_size)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1289  		memset(ptr + toc_offset + fw_size, 0, toc_fw_size - fw_size);
3d879e81f0f9ed Hawking Zhang 2022-04-13  1290  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1291  	if ((id != SOC21_FIRMWARE_ID_RS64_PFP) && (id != SOC21_FIRMWARE_ID_RS64_ME))
3d879e81f0f9ed Hawking Zhang 2022-04-13 @1292  		*(uint64_t *)fw_autoload_mask |= 1 << id;
                                                                                         ^^^^^^^
"id" can be more than 31 so it needs to BIT_ULL(id) or 1ULL << id.

3d879e81f0f9ed Hawking Zhang 2022-04-13  1293  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp 
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [kbuild] drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type?
@ 2022-05-27 10:45 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2022-05-27 10:45 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 3660 bytes --]

[ I sent this mail on May 9 but didn't hear back.  I'm not sure why
  kbuild is sending duplicates but it's probably a good thing.  -dan ]

Hi Alex,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master
head:   7e284070abe53d448517b80493863595af4ab5f0
commit: 98bae89647603309ca2a5f172299ecc31c5d2db0 drm/amdgpu/gfx11: remove some register fields that no longer exist
config: arc-randconfig-m031-20220524 (https://download.01.org/0day-ci/archive/20220527/202205271813.mDvYkTtW-lkp(a)intel.com/config )
compiler: arceb-elf-gcc (GCC) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type?

vim +1292 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

3d879e81f0f9ed Hawking Zhang 2022-04-13  1264  static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *adev,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1265  					      SOC21_FIRMWARE_ID id,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1266  			    		      const void *fw_data,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1267  					      uint32_t fw_size,
3d879e81f0f9ed Hawking Zhang 2022-04-13  1268  					      uint32_t *fw_autoload_mask)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1269  {
3d879e81f0f9ed Hawking Zhang 2022-04-13  1270  	uint32_t toc_offset;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1271  	uint32_t toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1272  	char *ptr = adev->gfx.rlc.rlc_autoload_ptr;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1273  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1274  	if (id <= SOC21_FIRMWARE_ID_INVALID || id >= SOC21_FIRMWARE_ID_MAX)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1275  		return;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1276  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1277  	toc_offset = rlc_autoload_info[id].offset;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1278  	toc_fw_size = rlc_autoload_info[id].size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1279  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1280  	if (fw_size == 0)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1281  		fw_size = toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1282  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1283  	if (fw_size > toc_fw_size)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1284  		fw_size = toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13  1285  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1286  	memcpy(ptr + toc_offset, fw_data, fw_size);
3d879e81f0f9ed Hawking Zhang 2022-04-13  1287  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1288  	if (fw_size < toc_fw_size)
3d879e81f0f9ed Hawking Zhang 2022-04-13  1289  		memset(ptr + toc_offset + fw_size, 0, toc_fw_size - fw_size);
3d879e81f0f9ed Hawking Zhang 2022-04-13  1290  
3d879e81f0f9ed Hawking Zhang 2022-04-13  1291  	if ((id != SOC21_FIRMWARE_ID_RS64_PFP) && (id != SOC21_FIRMWARE_ID_RS64_ME))
3d879e81f0f9ed Hawking Zhang 2022-04-13 @1292  		*(uint64_t *)fw_autoload_mask |= 1 << id;
                                                                                         ^^^^^^^
"id" can be more than 31 so it needs to BIT_ULL(id) or 1ULL << id.

3d879e81f0f9ed Hawking Zhang 2022-04-13  1293  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp 
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-27 10:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27 10:28 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type? kernel test robot
2022-05-27 10:45 ` [kbuild] " Dan Carpenter
2022-05-27 10:45 ` Dan Carpenter
2022-05-27 10:45 ` Dan Carpenter

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.