All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: "Joshi, Mukul" <Mukul.Joshi@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Kuehling, Felix" <Felix.Kuehling@amd.com>,
	"Kasiviswanathan, Harish" <Harish.Kasiviswanathan@amd.com>,
	"Yang, Philip" <Philip.Yang@amd.com>,
	Sashiko-bot <sashiko-bot@kernel.org>
Subject: Re: [PATCHv3] drm/amdgpu: reject errored peers in UALink local vPod integrity check
Date: Tue, 1 Dec 2026 20:49:42 +0530	[thread overview]
Message-ID: <1869e2d6-2af2-45dc-b67d-6994604587f1@amd.com> (raw)
In-Reply-To: <PHXPR12MB9992563F038D52B99A4B0FC13CEE4D2@PHXPR12MB999256.namprd12.prod.outlook.com>



On 01-Dec-26 8:40 PM, Joshi, Mukul wrote:
> AMD General
> 
>> -----Original Message-----
>> From: Lazar, Lijo <Lijo.Lazar@amd.com>
>> Sent: Monday, November 30, 2026 10:23 PM
>> To: Joshi, Mukul <Mukul.Joshi@amd.com>; amd-gfx@lists.freedesktop.org
>> Cc: Kuehling, Felix <Felix.Kuehling@amd.com>; Kasiviswanathan, Harish
>> <Harish.Kasiviswanathan@amd.com>; Yang, Philip <Philip.Yang@amd.com>;
>> Sashiko-bot <sashiko-bot@kernel.org>
>> Subject: Re: [PATCHv3] drm/amdgpu: reject errored peers in UALink local vPod
>> integrity check
>>
>>
>>
>> On 01-Dec-26 2:13 AM, Mukul Joshi wrote:
>>> AMDGPU_UALINK_ACCEL_STATE_ERROR sorts above every configured state,
>> so
>>> a local peer in the error state passes both the "pPod configured" and
>>> "vPod configured" checks in __check_local_vpod_integrity() and is
>>> treated as a healthy vPod member. The local vPod is then activated
>>> around an accelerator that cannot participate.
>>>
>>> The error state is also entered when __check_ppod_info() fails on a
>>> configuration that already includes vPod information. Such a peer
>>> never reaches PPOD_CONFIGURED, and its accel_id is unvalidated
>>> firmware data that is used to index vpod.active_accel_bits without a
>>> bounds check.
>>>
>>> Check for the error state first, before any other state check. Fail
>>> the integrity check if the errored peer is a member of this vPod, and
>>> skip it otherwise. If its accel_id is out of range, its membership
>>> cannot be determined, so treat it as a member and fail the check
>>> rather than risk activating the vPod without it.
>>>
>>> Fixes: 448a35158bee ("drm/amdgpu: Assign accel state based on ASP
>>> config")
>>> Reported-by: Sashiko-bot <sashiko-bot@kernel.org>
>>> Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
>>> ---
>>> v1->v2:
>>> - Ensure invalid accel_id peer fail VPOD activation.
>>>
>>> v2->v3:
>>> - Check error state before PPOD_CONFIGURED check.
>>>
>>>    drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 19
>> ++++++++++++++++---
>>>    1 file changed, 16 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
>>> index 0982d8455b0c..6d675c318952 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
>>> @@ -1169,17 +1169,30 @@ static int __check_local_vpod_integrity(struct
>> amdgpu_device *adev)
>>>                      continue;
>>>
>>>              peer_info = peer_adev->ualink.info;
>>> +           accel_id = peer_info->ppod.accel_id;
>>> +           /* An errored peer's accel_id may have failed validation, in
>>> +            * which case its vPod membership is unknown: treat it as a
>>> +            * member.
>>> +            */
>>> +           if (peer_info->accel_state ==
>> AMDGPU_UALINK_ACCEL_STATE_ERROR) {
>>
>> I don't think anything can be inferred from an accel id in error state.
>> It could be part of a different vpod altogether. It's better to just skip it.
>>
> I would prefer to let the administrators know that there is something wrong in your config rather than silently ignore/skip that
> Accelerator.
> Unfortunately, failing the VPOD config with an errored accelerator is the cleanest way to let administrator know that
> something is wrong in the configuration.
> 
> I agree that if accel_id > = 256 would fail the VPOD config for another VPOD but I don't see how to avoid that.
> 

The notification is already there when an accelerator is put to error state.

Thanks,
Lijo


> Regards,
> Mukul
> 
> 
>> Thanks,
>> Lijo
>>
>>> +                   if (accel_id >= AMDGPU_UALINK_ACCEL_MAX ||
>>> +                       test_bit(accel_id, info->vpod.active_accel_bits)) {
>>> +                           dev_warn(adev->dev,
>>> +                                    "UALINK: integrity fail: errored peer
>> accel_id=%u is or may be a vpod member\n",
>>> +                                    accel_id);
>>> +                           return -EINVAL;
>>> +                   }
>>> +                   continue;
>>> +           }
>>>              /* peer device ppod not configured */
>>>              if (peer_info->accel_state <
>>>                  AMDGPU_UALINK_ACCEL_STATE_PPOD_CONFIGURED) {
>>>                      dev_info(adev->dev,
>>>                               "UALINK: integrity EAGAIN: peer accel_id=%u
>> not ppod-configured (accel_state=%d)\n",
>>> -                            peer_info->ppod.accel_id,
>>> -                            peer_info->accel_state);
>>> +                            accel_id, peer_info->accel_state);
>>>                      return -EAGAIN;
>>>              }
>>>
>>> -           accel_id = peer_info->ppod.accel_id;
>>>              if (!test_bit(accel_id, info->vpod.active_accel_bits))
>>>                      continue;
>>>              /* peer device vpod not configured */
> 


  reply	other threads:[~2026-12-01 15:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 20:43 [PATCHv3] drm/amdgpu: reject errored peers in UALink local vPod integrity check Mukul Joshi
2026-11-30 21:06 ` sashiko-bot
2026-12-01  3:22 ` Lazar, Lijo
2026-12-01 15:10   ` Joshi, Mukul
2026-12-01 15:19     ` Lazar, Lijo [this message]
2026-12-01 15:41       ` Joshi, Mukul
2026-12-01 16:00   ` Kuehling, Felix
2026-12-01 16:38     ` Lazar, Lijo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1869e2d6-2af2-45dc-b67d-6994604587f1@amd.com \
    --to=lijo.lazar@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=Harish.Kasiviswanathan@amd.com \
    --cc=Mukul.Joshi@amd.com \
    --cc=Philip.Yang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=sashiko-bot@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.