AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] drm/amdgpu: allow sparse UALink accelerator IDs in pPod validation
@ 2026-11-30 17:18 Mukul Joshi
  2026-11-30 17:18 ` [PATCH] drm/amdgpu: reject errored peers in UALink local vPod integrity check Mukul Joshi
  0 siblings, 1 reply; 3+ messages in thread
From: Mukul Joshi @ 2026-11-30 17:18 UTC (permalink / raw)
  To: amd-gfx; +Cc: Felix.Kuehling, Harish.Kasiviswanathan, philip.yang, Mukul Joshi

The pPod size reported by PSP is the number of GPUs in the physical
pod, not an upper bound on accelerator IDs. Accelerator IDs can be
sparse, e.g. a 1-plane/2-GPU-per-node AFM config reports a pPod size
of 4 for accelerator IDs 0, 1, 4 and 5.

Both __check_ppod_info() and check_ppod_state() rejected any
accelerator ID >= pPod size, leaving accelerators 4 and 5 stuck in
the unconfigured state. Bound the accelerator ID by
AMDGPU_UALINK_ACCEL_MAX instead, which matches the size of the
per-accelerator bitmaps.

Fixes: af9a280325b5 ("drm/amdgpu: Add sysfs API for UALink physical pod setup")
Fixes: 448a35158bee ("drm/amdgpu: Assign accel state based on ASP config")
Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
index 2d4a17e11a1f..0982d8455b0c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
@@ -112,10 +112,11 @@ static bool __check_ppod_info(struct amdgpu_device *adev,
 			ppod->size, AMDGPU_UALINK_ACCEL_MAX);
 		return false;
 	}
-	if (ppod->accel_id >= ppod->size) {
+	/* pPod size is a GPU count; accelerator IDs may be sparse. */
+	if (ppod->accel_id >= AMDGPU_UALINK_ACCEL_MAX) {
 		dev_dbg(adev->dev,
-			"Accelerator ID %u greater or equal pPod size %u\n",
-			ppod->accel_id, ppod->size);
+			"Accelerator ID %u out of range [0..%u)\n",
+			ppod->accel_id, AMDGPU_UALINK_ACCEL_MAX);
 		return false;
 	}
 
@@ -928,9 +929,9 @@ check_ppod_state(struct amdgpu_device *adev,
 			setup->ppod.size, AMDGPU_UALINK_ACCEL_MAX);
 		return AMDGPU_UALINK_ACCEL_STATE_UNCONFIGURED;
 	}
-	if (setup->ppod.accel_id >= setup->ppod.size) {
-		dev_dbg(adev->dev, "Accelerator ID %u greater or equal pPod size %u\n",
-			setup->ppod.accel_id, setup->ppod.size);
+	if (setup->ppod.accel_id >= AMDGPU_UALINK_ACCEL_MAX) {
+		dev_dbg(adev->dev, "Accelerator ID %u out of range [0..%u)\n",
+			setup->ppod.accel_id, AMDGPU_UALINK_ACCEL_MAX);
 		return AMDGPU_UALINK_ACCEL_STATE_UNCONFIGURED;
 	}
 	return AMDGPU_UALINK_ACCEL_STATE_PPOD_CONFIGURED;
-- 
2.56.0


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

end of thread, other threads:[~2026-11-30 17:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 17:18 [PATCHv2] drm/amdgpu: allow sparse UALink accelerator IDs in pPod validation Mukul Joshi
2026-11-30 17:18 ` [PATCH] drm/amdgpu: reject errored peers in UALink local vPod integrity check Mukul Joshi
2026-11-30 17:33   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox