public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Piotr Piórkowski" <piotr.piorkowski@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 07/13] drm/xe/pf: Encode scheduling priority KLV if needed
Date: Thu, 2 Apr 2026 15:18:22 +0200	[thread overview]
Message-ID: <20260402131822.rkkqbkxtrt6bfw5f@intel.com> (raw)
In-Reply-To: <20260330204046.567-8-michal.wajdeczko@intel.com>

Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on pon [2026-mar-30 22:40:38 +0200]:
> After a reset we missed to reprovision VFs scheduling priority config.
> But as of today, the GuC firmware allows to change scheduling priority
> using config SCHED_PRIORITY KLV only for the PF and configuration of
> all VFs relies on the previously applied value of the SCHED_IF_IDLE
> policy. Use this policy value to check and decide whether we need to
> encode VF priority KLV while reprovisioning this VF.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 12 +++++++++++
>  drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c | 25 ++++++++++++++++------
>  drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.h |  1 +
>  3 files changed, 31 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> index e1c028176eb8..b05034d3fdf2 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> @@ -285,6 +285,13 @@ static u32 encode_config_ggtt(u32 *cfg, const struct xe_gt_sriov_config *config,
>  	return encode_ggtt(cfg, xe_ggtt_node_addr(node), xe_ggtt_node_size(node), details);
>  }
>  
> +static bool custom_sched_priority(struct xe_gt *gt, u32 priority)
> +{
> +	return xe_gt_sriov_pf_policy_get_sched_if_idle_locked(gt) ?
> +		priority != GUC_SCHED_PRIORITY_NORMAL :
> +		priority != GUC_SCHED_PRIORITY_LOW;
> +}
> +
>  static u32 encode_config_sched(struct xe_gt *gt, u32 *cfg, u32 n,
>  			       const struct xe_gt_sriov_config *config)
>  {
> @@ -313,6 +320,11 @@ static u32 encode_config_sched(struct xe_gt *gt, u32 *cfg, u32 n,
>  		cfg[n++] = config->preempt_timeout[0];
>  	}
>  
> +	if (custom_sched_priority(gt, config->sched_priority)) {
> +		cfg[n++] = PREP_GUC_KLV_TAG(VF_CFG_SCHED_PRIORITY);
> +		cfg[n++] = config->sched_priority;
> +	}
> +
>  	return n;
>  }
>  
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c b/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c
> index 0007ed7e0d38..63e6326d45f8 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.c
> @@ -223,6 +223,22 @@ int xe_gt_sriov_pf_policy_set_sched_if_idle(struct xe_gt *gt, bool enable)
>  	return 0;
>  }
>  
> +/**
> + * xe_gt_sriov_pf_policy_get_sched_if_idle_locked() - Retrieve value of 'sched_if_idle' policy.
> + * @gt: the &xe_gt where to read the policy from
> + *
> + * This function can only be called on PF.
> + *
> + * Return: last value of 'sched_if_idle' policy applied.
> + */
> +bool xe_gt_sriov_pf_policy_get_sched_if_idle_locked(struct xe_gt *gt)
> +{
> +	xe_gt_assert(gt, IS_SRIOV_PF(gt_to_xe(gt)));
> +	lockdep_assert_held(xe_gt_sriov_pf_master_mutex(gt));
> +
> +	return gt->sriov.pf.policy.guc.sched_if_idle;
> +}
> +
>  /**
>   * xe_gt_sriov_pf_policy_get_sched_if_idle - Retrieve value of 'sched_if_idle' policy.
>   * @gt: the &xe_gt where to read the policy from
> @@ -233,15 +249,10 @@ int xe_gt_sriov_pf_policy_set_sched_if_idle(struct xe_gt *gt, bool enable)
>   */
>  bool xe_gt_sriov_pf_policy_get_sched_if_idle(struct xe_gt *gt)
>  {
> -	bool enable;
> -
>  	xe_gt_assert(gt, IS_SRIOV_PF(gt_to_xe(gt)));
> +	guard(mutex)(xe_gt_sriov_pf_master_mutex(gt));
>  
> -	mutex_lock(xe_gt_sriov_pf_master_mutex(gt));
> -	enable = gt->sriov.pf.policy.guc.sched_if_idle;
> -	mutex_unlock(xe_gt_sriov_pf_master_mutex(gt));
> -
> -	return enable;
> +	return xe_gt_sriov_pf_policy_get_sched_if_idle_locked(gt);
>  }
>  
>  static int pf_provision_reset_engine(struct xe_gt *gt, bool enable)
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.h b/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.h
> index c9d4c4aaaf5d..f437dc1f5e90 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.h
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_policy.h
> @@ -15,6 +15,7 @@ struct xe_gt;
>  
>  int xe_gt_sriov_pf_policy_set_sched_if_idle(struct xe_gt *gt, bool enable);
>  bool xe_gt_sriov_pf_policy_get_sched_if_idle(struct xe_gt *gt);
> +bool xe_gt_sriov_pf_policy_get_sched_if_idle_locked(struct xe_gt *gt);
>  int xe_gt_sriov_pf_policy_set_reset_engine(struct xe_gt *gt, bool enable);
>  bool xe_gt_sriov_pf_policy_get_reset_engine(struct xe_gt *gt);
>  int xe_gt_sriov_pf_policy_set_sample_period(struct xe_gt *gt, u32 value);


LGTM:
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>

> -- 
> 2.47.1
> 

-- 

  reply	other threads:[~2026-04-02 13:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 20:40 [PATCH 00/13] drm/xe/pf: Improve EQ/PT provisioning Michal Wajdeczko
2026-03-30 20:40 ` [PATCH 01/13] drm/xe/guc: Update POLICY_SCHED_IF_IDLE documentation Michal Wajdeczko
2026-04-02  7:54   ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 02/13] drm/xe/pf: Fix pf_get_sched_priority() function signature Michal Wajdeczko
2026-04-02  7:55   ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 03/13] drm/xe/pf: Force new VFs prorities only once Michal Wajdeczko
2026-04-02 10:22   ` Piotr Piórkowski
2026-04-02 16:13     ` Michal Wajdeczko
2026-03-30 20:40 ` [PATCH 04/13] drm/xe/pf: Print applied policy KLVs Michal Wajdeczko
2026-04-02 10:56   ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 05/13] drm/xe/pf: Reprovision policy settings after GT reset Michal Wajdeczko
2026-04-02 11:23   ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 06/13] drm/xe/pf: Don't reprovision policies if already default Michal Wajdeczko
2026-04-02 11:23   ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 07/13] drm/xe/pf: Encode scheduling priority KLV if needed Michal Wajdeczko
2026-04-02 13:18   ` Piotr Piórkowski [this message]
2026-03-30 20:40 ` [PATCH 08/13] drm/xe/pf: Check EQ/PT/PRIO when testing VF config Michal Wajdeczko
2026-04-02 13:30   ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 09/13] drm/xe/pf: Allow to change sched_if_idle policy under lock Michal Wajdeczko
2026-04-02 13:33   ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 10/13] drm/xe/pf: Reprovision scheduling to default when no VFs Michal Wajdeczko
2026-04-02 15:22   ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 11/13] drm/xe/pf: Extract helper to show which VFs are provisioned Michal Wajdeczko
2026-04-02 15:40   ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 12/13] drm/xe/pf: Extract helpers for bulk EQ/PT provisioning Michal Wajdeczko
2026-04-02 15:57   ` Piotr Piórkowski
2026-03-30 20:40 ` [PATCH 13/13] drm/xe/pf: Perform fair scheduling auto-provisioning Michal Wajdeczko
2026-04-02 16:06   ` Piotr Piórkowski
2026-03-30 21:09 ` ✓ CI.KUnit: success for drm/xe/pf: Improve EQ/PT provisioning Patchwork
2026-03-30 21:41 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-31  0:28 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-02 16:20   ` Michal Wajdeczko

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=20260402131822.rkkqbkxtrt6bfw5f@intel.com \
    --to=piotr.piorkowski@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