Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Laguna, Lukasz" <lukasz.laguna@intel.com>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: <michal.wajdeczko@intel.com>
Subject: Re: [PATCH 3/3] drm/xe/vf: Set submission version in xe_uc_fw struct
Date: Fri, 28 Feb 2025 10:25:23 +0100	[thread overview]
Message-ID: <62e7b237-e6c9-4022-a83e-4d77584f54b0@intel.com> (raw)
In-Reply-To: <058ab253-3ed9-4a1a-a23e-c75282ec1069@intel.com>


On 2/27/2025 20:43, Daniele Ceraolo Spurio wrote:
>
>
> On 2/27/2025 3:22 AM, Laguna, Lukasz wrote:
>>
>> On 2/25/2025 23:30, Daniele Ceraolo Spurio wrote:
>>>
>>>
>>> On 2/25/2025 5:23 AM, Lukasz Laguna wrote:
>>>> The VF driver has already negotiated the ABI version with GuC. What
>>>> remains is to populate the generic xe_uc_fw struct with the version
>>>> before initializing submission.
>>>>
>>>> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
>>>> ---
>>>>   drivers/gpu/drm/xe/xe_guc.c | 9 ++++++++-
>>>>   1 file changed, 8 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
>>>> index bc1ff0a4e1e7..7b38447d902c 100644
>>>> --- a/drivers/gpu/drm/xe/xe_guc.c
>>>> +++ b/drivers/gpu/drm/xe/xe_guc.c
>>>> @@ -703,9 +703,16 @@ int xe_guc_init(struct xe_guc *guc)
>>>>     static int vf_guc_init_post_hwconfig(struct xe_guc *guc)
>>>>   {
>>>> +    struct xe_gt *gt = guc_to_gt(guc);
>>>> +    struct xe_uc_fw_version ver;
>>>>       int err;
>>>>   -    err = xe_guc_submit_init(guc, 
>>>> xe_gt_sriov_vf_guc_ids(guc_to_gt(guc)));
>>>> +    err = xe_gt_sriov_vf_get_guc_ver(gt, &ver);
>>>> +    xe_gt_assert(gt, !err);
>>>> +
>>>> +    xe_uc_fw_set_compatibility_ver(&guc->fw, &ver);
>>>
>>> Why not just pass &gt->sriov.vf.guc_version here, instead of copying 
>>> it into another variable first?
>>
>> By using xe_gt_sriov_vf_get_guc_ver(), we additionally verify whether 
>> the handshake completed successfully (major > 0). Only in that case 
>> we set the version in xe_uc_fw.
>
> But it's impossible to get here with a wrong major value, because 
> xe_gt_sriov_vf_bootstrap() would fail. If you really want to have an 
> emergency check then IMO it'd be better to just have:
>
> xe_assert(xe, gt->sriov.vf.guc_version.major);
>
> which you can have in this function without the need for an helper 
> (the same assert exists in other SRIOV functions like 
> xe_gt_sriov_vf_lmem).
>

Next thing is that gt->sriov.vf.guc_version is a different struct 
(struct xe_gt_sriov_vf_guc_version). xe_gt_sriov_vf_get_guc_ver() sets 
version in generic xe_uc_fw_version structure format.

Lukasz

> Daniele
>
>>
>> Lukasz
>>
>>>
>>> Daniele
>>>
>>>> +
>>>> +    err = xe_guc_submit_init(guc, xe_gt_sriov_vf_guc_ids(gt));
>>>>       if (err)
>>>>           return err;
>>>
>

  reply	other threads:[~2025-02-28  9:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 13:23 [PATCH 0/3] VF: Set submission version in xe_uc_fw struct Lukasz Laguna
2025-02-25 13:23 ` [PATCH 1/3] drm/xe/uc: Add helpers to set firmware version Lukasz Laguna
2025-02-25 13:23 ` [PATCH 2/3] drm/xe/vf: Add helper to get negotiated GuC ABI version Lukasz Laguna
2025-02-25 13:23 ` [PATCH 3/3] drm/xe/vf: Set submission version in xe_uc_fw struct Lukasz Laguna
2025-02-25 22:30   ` Daniele Ceraolo Spurio
2025-02-27 11:22     ` Laguna, Lukasz
2025-02-27 19:43       ` Daniele Ceraolo Spurio
2025-02-28  9:25         ` Laguna, Lukasz [this message]
2025-02-28 16:29           ` Daniele Ceraolo Spurio
2025-02-28 20:07             ` Daniele Ceraolo Spurio
2025-02-25 14:35 ` ✓ CI.Patch_applied: success for VF: " Patchwork
2025-02-25 14:35 ` ✓ CI.checkpatch: " Patchwork
2025-02-25 14:36 ` ✓ CI.KUnit: " Patchwork
2025-02-25 14:53 ` ✓ CI.Build: " Patchwork
2025-02-25 14:57 ` ✓ CI.Hooks: " Patchwork
2025-02-25 15:00 ` ✓ CI.checksparse: " Patchwork
2025-02-25 15:20 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-25 21:18 ` ✗ Xe.CI.Full: failure " Patchwork

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=62e7b237-e6c9-4022-a83e-4d77584f54b0@intel.com \
    --to=lukasz.laguna@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=michal.wajdeczko@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox