drivers/gpu/drm/amd/amdgpu/amdgpu_ip.c:537 amdgpu_device_ip_soft_reset() error: we previously assumed 'ip_block' could be null (see line 536)
kernel test robot
build botBCC: [email protected]
CC: [email protected]
TO: "Timur Kristóf" <[email protected]>
CC: Alexander Deucher <[email protected]>
tree: https://gitlab.freedesktop.org/agd5f/linux.git amd-staging-drm-next head: e3cc8c108f9a91728f9ff6e24cbf3b41c58b8f8b commit: a6319ac34a1322cc70c8aa7a3b06a558dc4f68a5 [3205/3402] drm/amdgpu: Add IP block soft reset as a GPU recovery method
:::::: branch date: 2 days ago
:::::: commit date: 2 weeks ago
config: i386-randconfig-r073-20260702 (https://download.01.org/0day-ci/archive/20260703/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
smatch: v0.5.0-9185-gbcc58b9c
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]> | Reported-by: Dan Carpenter <[email protected]> | Closes: https://lore.kernel.org/r/[email protected]/
smatch warnings:drivers/gpu/drm/amd/amdgpu/amdgpu_ip.c:537 amdgpu_device_ip_soft_reset() error: we previously assumed 'ip_block' could be null (see line 536)
vim +/ip_block +537 drivers/gpu/drm/amd/amdgpu/amdgpu_ip.c
a6319ac34a1322 Timur Kristóf 2026-06-17 505
a6319ac34a1322 Timur Kristóf 2026-06-17 506 /**
a6319ac34a1322 Timur Kristóf 2026-06-17 507 * amdgpu_device_ip_soft_reset() - Perform a graceful soft reset on an IP block.
a6319ac34a1322 Timur Kristóf 2026-06-17 508 *
a6319ac34a1322 Timur Kristóf 2026-06-17 509 * @guilty_ring: The ring which is guilty of causing a reset.
a6319ac34a1322 Timur Kristóf 2026-06-17 510 * @guilty_fence: The fence which didn't signal.
a6319ac34a1322 Timur Kristóf 2026-06-17 511 *
a6319ac34a1322 Timur Kristóf 2026-06-17 512 * IP block soft reset is used when attempting to recover
a6319ac34a1322 Timur Kristóf 2026-06-17 513 * from a GPU hang in a situation where a more fine grained
a6319ac34a1322 Timur Kristóf 2026-06-17 514 * reset type isn't available or didn't work. This effectively
a6319ac34a1322 Timur Kristóf 2026-06-17 515 * resets all rings that belong to the same device IP block
a6319ac34a1322 Timur Kristóf 2026-06-17 516 * and re-initializes the device IP block.
a6319ac34a1322 Timur Kristóf 2026-06-17 517 *
a6319ac34a1322 Timur Kristóf 2026-06-17 518 * The reset is handled gracefully, meaning that we try to
a6319ac34a1322 Timur Kristóf 2026-06-17 519 * minimize collateral damage (ie. avoid rejecting non-guilty jobs)
a6319ac34a1322 Timur Kristóf 2026-06-17 520 * as well as back up and restore the contents of all rings
a6319ac34a1322 Timur Kristóf 2026-06-17 521 * so that the system can move on from the hang.
a6319ac34a1322 Timur Kristóf 2026-06-17 522 */
a6319ac34a1322 Timur Kristóf 2026-06-17 523 int amdgpu_device_ip_soft_reset(struct amdgpu_ring *guilty_ring,
a6319ac34a1322 Timur Kristóf 2026-06-17 524 struct amdgpu_fence *guilty_fence)
a6319ac34a1322 Timur Kristóf 2026-06-17 525 {
a6319ac34a1322 Timur Kristóf 2026-06-17 526 struct amdgpu_device *adev = guilty_ring->adev;
a6319ac34a1322 Timur Kristóf 2026-06-17 527 struct amdgpu_ring *rings[AMDGPU_MAX_RINGS];
a6319ac34a1322 Timur Kristóf 2026-06-17 528 struct amdgpu_ip_block *ip_block;
a6319ac34a1322 Timur Kristóf 2026-06-17 529 enum amd_ip_block_type ip_type;
a6319ac34a1322 Timur Kristóf 2026-06-17 530 u32 num_rings, ring_type_mask;
a6319ac34a1322 Timur Kristóf 2026-06-17 531 int r;
a6319ac34a1322 Timur Kristóf 2026-06-17 532
a6319ac34a1322 Timur Kristóf 2026-06-17 533 ip_type = amdgpu_ip_from_ring(guilty_ring->funcs->type);
a6319ac34a1322 Timur Kristóf 2026-06-17 534 ip_block = amdgpu_device_ip_get_ip_block(adev, ip_type);
a6319ac34a1322 Timur Kristóf 2026-06-17 535 a6319ac34a1322 Timur Kristóf 2026-06-17 @536 if (!ip_block || !ip_block->version->funcs->soft_reset) {a6319ac34a1322 Timur Kristóf 2026-06-17 @537 dev_warn(adev->dev, "IP block soft reset not supported on %s\n",
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki