From: "Lis, Tomasz" <tomasz.lis@intel.com>
To: "K V P, Satyanarayana" <satyanarayana.k.v.p@intel.com>,
"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Cc: "Winiarski, Michal" <michal.winiarski@intel.com>,
"Wajdeczko, Michal" <Michal.Wajdeczko@intel.com>,
"Piorkowski, Piotr" <piotr.piorkowski@intel.com>,
"Brost, Matthew" <matthew.brost@intel.com>,
"De Marchi, Lucas" <lucas.demarchi@intel.com>
Subject: Re: [PATCH v3 2/7] drm/xe/vf: Finish RESFIX by reset if CTB not enabled
Date: Tue, 27 May 2025 16:14:48 +0200 [thread overview]
Message-ID: <072ceaa1-22a9-48e1-8133-a033a8c8cbd6@intel.com> (raw)
In-Reply-To: <LV3PR11MB86950BF30DA68B8F5277FB73F964A@LV3PR11MB8695.namprd11.prod.outlook.com>
On 27.05.2025 13:56, K V P, Satyanarayana wrote:
> Hi
>> -----Original Message-----
>> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Tomasz
>> Lis
>> Sent: Tuesday, May 20, 2025 4:49 AM
>> To: intel-xe@lists.freedesktop.org
>> Cc: Winiarski, Michal <michal.winiarski@intel.com>; Wajdeczko, Michal
>> <Michal.Wajdeczko@intel.com>; Piorkowski, Piotr
>> <piotr.piorkowski@intel.com>; Brost, Matthew <matthew.brost@intel.com>;
>> De Marchi, Lucas <lucas.demarchi@intel.com>
>> Subject: [PATCH v3 2/7] drm/xe/vf: Finish RESFIX by reset if CTB not enabled
>>
>> The RESFIX state should be achievable only when CTB communication is
>> enabled. If CTB was disabled and we still got it, then either we're
>> dealing with unclean initial state, or the driver is not currently
>> functional. In these cases, exit the RESFIX state by reset.
>>
>> Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
>> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 10 ++++++++++
>> drivers/gpu/drm/xe/xe_sriov_vf.c | 16 ++++++++++++++++
>> drivers/gpu/drm/xe/xe_sriov_vf.h | 1 +
>> 3 files changed, 27 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
>> b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
>> index 4ff7ae1a5f16..b9af112ca771 100644
>> --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
>> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
>> @@ -23,6 +23,7 @@
>> #include "xe_gt_sriov_vf.h"
>> #include "xe_gt_sriov_vf_types.h"
>> #include "xe_guc.h"
>> +#include "xe_guc_ct.h"
>> #include "xe_guc_hxg_helpers.h"
>> #include "xe_guc_relay.h"
>> #include "xe_mmio.h"
>> @@ -932,6 +933,15 @@ void xe_gt_sriov_vf_migrated_event_handler(struct
>> xe_gt *gt)
>>
>> xe_gt_assert(gt, IS_SRIOV_VF(xe));
>>
>> + if (!xe_guc_ct_enabled(>->uc.guc.ct)) {
>> + /*
>> + * If at driver init, ignore migration which happened
>> + * before the driver was loaded.
>> + */
> nit: Can we rephrase description in simple terms like below?
> "During driver initialization, ignore migration that happened before driver was loaded."
Ok, I don't like the provided replacement comment as it doesn't
emphasize that driver init is just an option (not very likely one), but
will rephrase.
>> + xe_sriov_vf_post_migration_reset_guc_state(xe);
>> + return;
>> + }
>> +
>> set_bit(gt->info.id, &xe->sriov.vf.migration.gt_flags);
>> /*
>> * We need to be certain that if all flags were set, at least one
>> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf.c
>> b/drivers/gpu/drm/xe/xe_sriov_vf.c
>> index 2674fa948fda..099a395fbf59 100644
>> --- a/drivers/gpu/drm/xe/xe_sriov_vf.c
>> +++ b/drivers/gpu/drm/xe/xe_sriov_vf.c
>> @@ -134,6 +134,22 @@ void xe_sriov_vf_init_early(struct xe_device *xe)
>> INIT_WORK(&xe->sriov.vf.migration.worker, migration_worker_func);
>> }
>>
>> +/**
>> + * xe_sriov_vf_post_migration_reset_guc_state - Reset VF state in all GuCs.
>> + * @xe: the &xe_device struct instance
>> + *
>> + * This function sends VF state reset to GuC, as a way of exiting RESFIX
>> + * state if a proper post-migration recovery procedure has failed.
>> + */
> nit: Can we rephrase description in simple terms like below?
> " This function sends a VF state reset to GuC to exit the RESFIX state when the appropriate
> post-migration recovery procedure has failed."
I don't know, "to GuC to exit" doesn't strike me as simpler to understand.
The triple-compound sentences are generally more readable when two parts
are separated by a comma.
GuC can get a VF out of RESFIX state by receiving "RESFIX_DONE", but an
alternative way exists by GuC receiving "RESET". This is what I wanted
to convey by this comment.
I don't really see much place for improvement here, other than dividing
that into more sentences.
> Apart from above nits, LGTM.
> Reviewed-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Thanks
-Tomasz
>
>> +void xe_sriov_vf_post_migration_reset_guc_state(struct xe_device *xe)
>> +{
>> + struct xe_gt *gt;
>> + unsigned int id;
>> +
>> + for_each_gt(gt, xe, id)
>> + xe_gt_reset_async(gt);
>> +}
>> +
>> /**
>> * vf_post_migration_requery_guc - Re-query GuC for current VF provisioning.
>> * @xe: the &xe_device struct instance
>> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf.h
>> b/drivers/gpu/drm/xe/xe_sriov_vf.h
>> index 7b8622cff2b7..ba846af34a13 100644
>> --- a/drivers/gpu/drm/xe/xe_sriov_vf.h
>> +++ b/drivers/gpu/drm/xe/xe_sriov_vf.h
>> @@ -10,5 +10,6 @@ struct xe_device;
>>
>> void xe_sriov_vf_init_early(struct xe_device *xe);
>> void xe_sriov_vf_start_migration_recovery(struct xe_device *xe);
>> +void xe_sriov_vf_post_migration_reset_guc_state(struct xe_device *xe);
>>
>> #endif
>> --
>> 2.25.1
next prev parent reply other threads:[~2025-05-27 14:15 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-19 23:19 [PATCH v3 0/7] drm/xe/vf: Post-migration recovery of queues and jobs Tomasz Lis
2025-05-19 23:19 ` [PATCH v3 1/7] drm/xe/sa: Avoid caching GGTT address within the manager Tomasz Lis
2025-05-19 23:19 ` [PATCH v3 2/7] drm/xe/vf: Finish RESFIX by reset if CTB not enabled Tomasz Lis
2025-05-27 11:56 ` K V P, Satyanarayana
2025-05-27 14:14 ` Lis, Tomasz [this message]
2025-05-19 23:19 ` [PATCH v3 3/7] drm/xe/vf: Pause submissions during RESFIX fixups Tomasz Lis
2025-05-27 13:10 ` K V P, Satyanarayana
2025-05-27 14:28 ` Lis, Tomasz
2025-05-28 20:16 ` Michał Winiarski
2025-05-31 0:05 ` Lis, Tomasz
2025-05-19 23:19 ` [PATCH v3 4/7] drm/xe: Block reset while recovering from VF migration Tomasz Lis
2025-05-28 20:02 ` Michał Winiarski
2025-06-03 20:23 ` Lis, Tomasz
2025-05-19 23:19 ` [PATCH v3 5/7] drm/xe/vf: Rebase HWSP of all contexts after migration Tomasz Lis
2025-05-27 13:45 ` K V P, Satyanarayana
2025-05-28 12:49 ` Michał Winiarski
2025-06-03 20:23 ` Lis, Tomasz
2025-05-19 23:19 ` [PATCH v3 6/7] drm/xe/vf: Rebase MEMIRQ structures for " Tomasz Lis
2025-05-27 14:06 ` K V P, Satyanarayana
2025-05-28 10:44 ` Michał Winiarski
2025-05-29 1:19 ` Lis, Tomasz
2025-05-19 23:19 ` [PATCH v3 7/7] drm/xe/vf: Post migration, repopulate ring area for pending request Tomasz Lis
2025-05-28 10:54 ` Michał Winiarski
2025-05-30 23:03 ` Lis, Tomasz
2025-05-20 0:00 ` ✓ CI.Patch_applied: success for drm/xe/vf: Post-migration recovery of queues and jobs (rev3) Patchwork
2025-05-20 0:00 ` ✗ CI.checkpatch: warning " Patchwork
2025-05-20 0:01 ` ✓ CI.KUnit: success " Patchwork
2025-05-20 0:11 ` ✓ CI.Build: " Patchwork
2025-05-20 0:14 ` ✓ CI.Hooks: " Patchwork
2025-05-20 0:15 ` ✓ CI.checksparse: " Patchwork
2025-05-20 0:39 ` ✓ Xe.CI.BAT: " Patchwork
2025-05-20 12:47 ` ✗ Xe.CI.Full: failure " Patchwork
2025-05-27 5:49 ` ✗ CI.Patch_applied: " 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=072ceaa1-22a9-48e1-8133-a033a8c8cbd6@intel.com \
--to=tomasz.lis@intel.com \
--cc=Michal.Wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=matthew.brost@intel.com \
--cc=michal.winiarski@intel.com \
--cc=piotr.piorkowski@intel.com \
--cc=satyanarayana.k.v.p@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