All of lore.kernel.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 3/3] drm/xe/pf: Add _locked variant of the fair sched config function
Date: Mon, 14 Sep 2026 10:40:44 +0200	[thread overview]
Message-ID: <20260914084044.c4mwuzixmffdkkis@intel.com> (raw)
In-Reply-To: <20260911183257.14999-4-michal.wajdeczko@intel.com>

Michal Wajdeczko <michal.wajdeczko@intel.com> wrote on pią [2026-wrz-11 20:32:57 +0200]:
> We will soon want to auto provision all VFs in a single step, while
> already holding the master mutex. Split existing function into two.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 23 +++++++++++++++++++---
>  drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h |  1 +
>  2 files changed, 21 insertions(+), 3 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 146981aedf5f..6947aeed458e 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
> @@ -2784,15 +2784,16 @@ static bool pf_needs_provision_sched(struct xe_gt *gt, unsigned int num_vfs)
>  #define XE_ADMIN_PF_SCHED_PRIORITY	GUC_SCHED_PRIORITY_HIGH
>  
>  /**
> - * xe_gt_sriov_pf_config_set_fair_sched() - Provision PF and VFs with fair scheduling.
> + * xe_gt_sriov_pf_config_set_fair_sched_locked() - Provision PF and VFs with fair scheduling.
>   * @gt: the &xe_gt
>   * @num_vfs: number of VFs to provision (can't be 0)
>   *
> + * The caller must hold the master PF mutex.
>   * This function can only be called on PF.
>   *
>   * Return: 0 on success or a negative error code on failure.
>   */
> -int xe_gt_sriov_pf_config_set_fair_sched(struct xe_gt *gt, unsigned int num_vfs)
> +int xe_gt_sriov_pf_config_set_fair_sched_locked(struct xe_gt *gt, unsigned int num_vfs)
>  {
>  	int result = 0;
>  	int err;
> @@ -2801,7 +2802,7 @@ int xe_gt_sriov_pf_config_set_fair_sched(struct xe_gt *gt, unsigned int num_vfs)
>  	xe_gt_assert(gt, XE_FAIR_EXEC_QUANTUM_MS);
>  	xe_gt_assert(gt, XE_FAIR_PREEMPT_TIMEOUT_US);
>  
> -	guard(mutex)(xe_gt_sriov_pf_master_mutex(gt));
> +	lockdep_assert_held(xe_gt_sriov_pf_master_mutex(gt));
>  
>  	if (!pf_needs_provision_sched(gt, num_vfs))
>  		return 0;
> @@ -2822,6 +2823,22 @@ int xe_gt_sriov_pf_config_set_fair_sched(struct xe_gt *gt, unsigned int num_vfs)
>  	return result;
>  }
>  
> +/**
> + * xe_gt_sriov_pf_config_set_fair_sched() - Provision PF and VFs with fair scheduling.
> + * @gt: the &xe_gt
> + * @num_vfs: number of VFs to provision (can't be 0)
> + *
> + * This function can only be called on PF.
> + *
> + * Return: 0 on success or a negative error code on failure.
> + */
> +int xe_gt_sriov_pf_config_set_fair_sched(struct xe_gt *gt, unsigned int num_vfs)
> +{
> +	guard(mutex)(xe_gt_sriov_pf_master_mutex(gt));
> +
> +	return xe_gt_sriov_pf_config_set_fair_sched_locked(gt, num_vfs);
> +}
> +
>  static int pf_provision_threshold(struct xe_gt *gt, unsigned int vfid,
>  				  enum xe_guc_klv_threshold_index index, u32 value)
>  {
> diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
> index d43da8599977..3e10697d2174 100644
> --- a/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
> +++ b/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.h
> @@ -87,6 +87,7 @@ int xe_gt_sriov_pf_config_set_threshold(struct xe_gt *gt, unsigned int vfid,
>  					enum xe_guc_klv_threshold_index index, u32 value);
>  
>  int xe_gt_sriov_pf_config_set_fair_sched(struct xe_gt *gt, unsigned int num_vfs);
> +int xe_gt_sriov_pf_config_set_fair_sched_locked(struct xe_gt *gt, unsigned int num_vfs);
>  int xe_gt_sriov_pf_config_set_fair(struct xe_gt *gt, unsigned int vfid, unsigned int num_vfs);
>  int xe_gt_sriov_pf_config_sanitize(struct xe_gt *gt, unsigned int vfid, long timeout);
>  int xe_gt_sriov_pf_config_release(struct xe_gt *gt, unsigned int vfid, bool force);
> -- 
> 2.47.1
> 

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


-- 

  reply	other threads:[~2026-09-14  8:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 18:32 [PATCH 0/3] drm/xe/pf: Add _locked variant of config functions Michal Wajdeczko
2026-09-11 18:32 ` [PATCH 1/3] drm/xe/pf: Add _locked variant of the priority config function Michal Wajdeczko
2026-09-14  8:28   ` Piotr Piórkowski
2026-09-11 18:32 ` [PATCH 2/3] drm/xe/pf: Add _locked variant of the release " Michal Wajdeczko
2026-09-14  8:36   ` Piotr Piórkowski
2026-09-11 18:32 ` [PATCH 3/3] drm/xe/pf: Add _locked variant of the fair sched " Michal Wajdeczko
2026-09-14  8:40   ` Piotr Piórkowski [this message]
2026-09-11 19:11 ` ✓ CI.KUnit: success for drm/xe/pf: Add _locked variant of config functions Patchwork
2026-09-11 19:50 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-12  4:19 ` ✓ Xe.CI.FULL: " 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=20260914084044.c4mwuzixmffdkkis@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 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.