[radeon-alex:amd-staging-drm-next 5/6] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:465:44: sparse: incorrect type in argument 1 (different address spaces)
kbuild test robot
lkp at intel.com
Tue Jul 17 01:29:41 UTC 2018
tree: git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head: d0987b4ee380e9d814052071c939b38a74a34ab1
commit: 4771bffd00cf57702e4bea3a1b08fe9a9ea78abd [5/6] drm/amdgpu/pp/smu7: cache smu firmware toc
reproduce:
# apt-get install sparse
git checkout 4771bffd00cf57702e4bea3a1b08fe9a9ea78abd
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__
:::::: branch date: 22 hours ago
:::::: commit date: 22 hours ago
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:65:25: sparse: cast to restricted __be32
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:65:25: sparse: cast to restricted __be32
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:65:25: sparse: cast to restricted __be32
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:65:25: sparse: cast to restricted __be32
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:65:25: sparse: cast to restricted __be32
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:65:25: sparse: cast to restricted __be32
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:74:26: sparse: cast to restricted __be32
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:74:26: sparse: cast to restricted __be32
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:74:26: sparse: cast to restricted __be32
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:74:26: sparse: cast to restricted __be32
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:74:26: sparse: cast to restricted __be32
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:74:26: sparse: cast to restricted __be32
>> drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:465:44: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] <asn:2>*addr @@ got sn:2>*addr @@
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:465:44: expected void volatile [noderef] <asn:2>*addr
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c:465:44: got void *kaddr
git remote add radeon-alex git://people.freedesktop.org/~agd5f/linux.git
git remote update radeon-alex
git checkout 4771bffd00cf57702e4bea3a1b08fe9a9ea78abd
vim +465 drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu7_smumgr.c
1ff55f46 Rex Zhu 2016-08-19 377
d3f8c0ab Rex Zhu 2017-09-20 378 int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)
1ff55f46 Rex Zhu 2016-08-19 379 {
b3b03052 Rex Zhu 2017-09-26 380 struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(hwmgr->smu_backend);
1ff55f46 Rex Zhu 2016-08-19 381 uint32_t fw_to_load;
4771bffd Alex Deucher 2018-07-12 382 int r = 0;
1ff55f46 Rex Zhu 2016-08-19 383
b3b03052 Rex Zhu 2017-09-26 384 if (!hwmgr->reload_fw) {
634a24d8 Huang Rui 2016-12-26 385 pr_info("skip reloading...\n");
1ff55f46 Rex Zhu 2016-08-19 386 return 0;
1ff55f46 Rex Zhu 2016-08-19 387 }
1ff55f46 Rex Zhu 2016-08-19 388
1ff55f46 Rex Zhu 2016-08-19 389 if (smu_data->soft_regs_start)
d3f8c0ab Rex Zhu 2017-09-20 390 cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,
d3f8c0ab Rex Zhu 2017-09-20 391 smu_data->soft_regs_start + smum_get_offsetof(hwmgr,
1ff55f46 Rex Zhu 2016-08-19 392 SMU_SoftRegisters, UcodeLoadStatus),
1ff55f46 Rex Zhu 2016-08-19 393 0x0);
1ff55f46 Rex Zhu 2016-08-19 394
d3f8c0ab Rex Zhu 2017-09-20 395 if (hwmgr->chip_id > CHIP_TOPAZ) { /* add support for Topaz */
8bb575a2 Rex Zhu 2018-03-22 396 if (hwmgr->not_vf) {
d3f8c0ab Rex Zhu 2017-09-20 397 smu7_send_msg_to_smc_with_parameter(hwmgr,
e224e4f1 Xiangliang Yu 2016-12-02 398 PPSMC_MSG_SMU_DRAM_ADDR_HI,
bb03c9c4 Rex Zhu 2018-03-06 399 upper_32_bits(smu_data->smu_buffer.mc_addr));
d3f8c0ab Rex Zhu 2017-09-20 400 smu7_send_msg_to_smc_with_parameter(hwmgr,
e224e4f1 Xiangliang Yu 2016-12-02 401 PPSMC_MSG_SMU_DRAM_ADDR_LO,
bb03c9c4 Rex Zhu 2018-03-06 402 lower_32_bits(smu_data->smu_buffer.mc_addr));
e224e4f1 Xiangliang Yu 2016-12-02 403 }
1ff55f46 Rex Zhu 2016-08-19 404 fw_to_load = UCODE_ID_RLC_G_MASK
1ff55f46 Rex Zhu 2016-08-19 405 + UCODE_ID_SDMA0_MASK
1ff55f46 Rex Zhu 2016-08-19 406 + UCODE_ID_SDMA1_MASK
1ff55f46 Rex Zhu 2016-08-19 407 + UCODE_ID_CP_CE_MASK
1ff55f46 Rex Zhu 2016-08-19 408 + UCODE_ID_CP_ME_MASK
1ff55f46 Rex Zhu 2016-08-19 409 + UCODE_ID_CP_PFP_MASK
1ff55f46 Rex Zhu 2016-08-19 410 + UCODE_ID_CP_MEC_MASK;
1ff55f46 Rex Zhu 2016-08-19 411 } else {
1ff55f46 Rex Zhu 2016-08-19 412 fw_to_load = UCODE_ID_RLC_G_MASK
1ff55f46 Rex Zhu 2016-08-19 413 + UCODE_ID_SDMA0_MASK
1ff55f46 Rex Zhu 2016-08-19 414 + UCODE_ID_SDMA1_MASK
1ff55f46 Rex Zhu 2016-08-19 415 + UCODE_ID_CP_CE_MASK
1ff55f46 Rex Zhu 2016-08-19 416 + UCODE_ID_CP_ME_MASK
1ff55f46 Rex Zhu 2016-08-19 417 + UCODE_ID_CP_PFP_MASK
1ff55f46 Rex Zhu 2016-08-19 418 + UCODE_ID_CP_MEC_MASK
1ff55f46 Rex Zhu 2016-08-19 419 + UCODE_ID_CP_MEC_JT1_MASK
1ff55f46 Rex Zhu 2016-08-19 420 + UCODE_ID_CP_MEC_JT2_MASK;
1ff55f46 Rex Zhu 2016-08-19 421 }
1ff55f46 Rex Zhu 2016-08-19 422
4771bffd Alex Deucher 2018-07-12 423 if (!smu_data->toc) {
4771bffd Alex Deucher 2018-07-12 424 struct SMU_DRAMData_TOC *toc;
4771bffd Alex Deucher 2018-07-12 425
4771bffd Alex Deucher 2018-07-12 426 smu_data->toc = kzalloc(sizeof(struct SMU_DRAMData_TOC), GFP_KERNEL);
4771bffd Alex Deucher 2018-07-12 427 if (!smu_data->toc)
4771bffd Alex Deucher 2018-07-12 428 return -ENOMEM;
4771bffd Alex Deucher 2018-07-12 429 toc = smu_data->toc;
4771bffd Alex Deucher 2018-07-12 430 toc->num_entries = 0;
1ff55f46 Rex Zhu 2016-08-19 431 toc->structure_version = 1;
1ff55f46 Rex Zhu 2016-08-19 432
d3f8c0ab Rex Zhu 2017-09-20 433 PP_ASSERT_WITH_CODE(0 == smu7_populate_single_firmware_entry(hwmgr,
4771bffd Alex Deucher 2018-07-12 434 UCODE_ID_RLC_G, &toc->entry[toc->num_entries++]),
4771bffd Alex Deucher 2018-07-12 435 "Failed to Get Firmware Entry.", r = -EINVAL; goto failed);
d3f8c0ab Rex Zhu 2017-09-20 436 PP_ASSERT_WITH_CODE(0 == smu7_populate_single_firmware_entry(hwmgr,
4771bffd Alex Deucher 2018-07-12 437 UCODE_ID_CP_CE, &toc->entry[toc->num_entries++]),
4771bffd Alex Deucher 2018-07-12 438 "Failed to Get Firmware Entry.", r = -EINVAL; goto failed);
d3f8c0ab Rex Zhu 2017-09-20 439 PP_ASSERT_WITH_CODE(0 == smu7_populate_single_firmware_entry(hwmgr,
4771bffd Alex Deucher 2018-07-12 440 UCODE_ID_CP_PFP, &toc->entry[toc->num_entries++]),
4771bffd Alex Deucher 2018-07-12 441 "Failed to Get Firmware Entry.", r = -EINVAL; goto failed);
d3f8c0ab Rex Zhu 2017-09-20 442 PP_ASSERT_WITH_CODE(0 == smu7_populate_single_firmware_entry(hwmgr,
4771bffd Alex Deucher 2018-07-12 443 UCODE_ID_CP_ME, &toc->entry[toc->num_entries++]),
4771bffd Alex Deucher 2018-07-12 444 "Failed to Get Firmware Entry.", r = -EINVAL; goto failed);
d3f8c0ab Rex Zhu 2017-09-20 445 PP_ASSERT_WITH_CODE(0 == smu7_populate_single_firmware_entry(hwmgr,
4771bffd Alex Deucher 2018-07-12 446 UCODE_ID_CP_MEC, &toc->entry[toc->num_entries++]),
4771bffd Alex Deucher 2018-07-12 447 "Failed to Get Firmware Entry.", r = -EINVAL; goto failed);
d3f8c0ab Rex Zhu 2017-09-20 448 PP_ASSERT_WITH_CODE(0 == smu7_populate_single_firmware_entry(hwmgr,
4771bffd Alex Deucher 2018-07-12 449 UCODE_ID_CP_MEC_JT1, &toc->entry[toc->num_entries++]),
4771bffd Alex Deucher 2018-07-12 450 "Failed to Get Firmware Entry.", r = -EINVAL; goto failed);
d3f8c0ab Rex Zhu 2017-09-20 451 PP_ASSERT_WITH_CODE(0 == smu7_populate_single_firmware_entry(hwmgr,
4771bffd Alex Deucher 2018-07-12 452 UCODE_ID_CP_MEC_JT2, &toc->entry[toc->num_entries++]),
4771bffd Alex Deucher 2018-07-12 453 "Failed to Get Firmware Entry.", r = -EINVAL; goto failed);
d3f8c0ab Rex Zhu 2017-09-20 454 PP_ASSERT_WITH_CODE(0 == smu7_populate_single_firmware_entry(hwmgr,
4771bffd Alex Deucher 2018-07-12 455 UCODE_ID_SDMA0, &toc->entry[toc->num_entries++]),
4771bffd Alex Deucher 2018-07-12 456 "Failed to Get Firmware Entry.", r = -EINVAL; goto failed);
d3f8c0ab Rex Zhu 2017-09-20 457 PP_ASSERT_WITH_CODE(0 == smu7_populate_single_firmware_entry(hwmgr,
4771bffd Alex Deucher 2018-07-12 458 UCODE_ID_SDMA1, &toc->entry[toc->num_entries++]),
4771bffd Alex Deucher 2018-07-12 459 "Failed to Get Firmware Entry.", r = -EINVAL; goto failed);
8bb575a2 Rex Zhu 2018-03-22 460 if (!hwmgr->not_vf)
d3f8c0ab Rex Zhu 2017-09-20 461 PP_ASSERT_WITH_CODE(0 == smu7_populate_single_firmware_entry(hwmgr,
4771bffd Alex Deucher 2018-07-12 462 UCODE_ID_MEC_STORAGE, &toc->entry[toc->num_entries++]),
4771bffd Alex Deucher 2018-07-12 463 "Failed to Get Firmware Entry.", r = -EINVAL; goto failed);
4771bffd Alex Deucher 2018-07-12 464 }
4771bffd Alex Deucher 2018-07-12 @465 memcpy_toio(smu_data->header_buffer.kaddr, smu_data->toc,
4771bffd Alex Deucher 2018-07-12 466 sizeof(struct SMU_DRAMData_TOC));
bb03c9c4 Rex Zhu 2018-03-06 467 smu7_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_DRV_DRAM_ADDR_HI, upper_32_bits(smu_data->header_buffer.mc_addr));
bb03c9c4 Rex Zhu 2018-03-06 468 smu7_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_DRV_DRAM_ADDR_LO, lower_32_bits(smu_data->header_buffer.mc_addr));
1ff55f46 Rex Zhu 2016-08-19 469
d3f8c0ab Rex Zhu 2017-09-20 470 if (smu7_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_LoadUcodes, fw_to_load))
634a24d8 Huang Rui 2016-12-26 471 pr_err("Fail to Request SMU Load uCode");
1ff55f46 Rex Zhu 2016-08-19 472
4771bffd Alex Deucher 2018-07-12 473 return r;
4771bffd Alex Deucher 2018-07-12 474
4771bffd Alex Deucher 2018-07-12 475 failed:
4771bffd Alex Deucher 2018-07-12 476 kfree(smu_data->toc);
4771bffd Alex Deucher 2018-07-12 477 smu_data->toc = NULL;
4771bffd Alex Deucher 2018-07-12 478 return r;
1ff55f46 Rex Zhu 2016-08-19 479 }
1ff55f46 Rex Zhu 2016-08-19 480
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
More information about the dri-devel
mailing list