Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nilawar, Badal" <badal.nilawar@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v6 05/25] drm/xe/device: Update handling of xe_force_wake_get return
Date: Fri, 4 Oct 2024 12:48:18 +0530	[thread overview]
Message-ID: <ed935723-8128-42ff-a01e-52f22fa2cbbe@intel.com> (raw)
In-Reply-To: <20240930053149.1246339-6-himal.prasad.ghimiray@intel.com>



On 30-09-2024 11:01, Himal Prasad Ghimiray wrote:
> With xe_force_wake_get() now returning the refcount-incremented domain
> mask, the return value will be 0 for single domains (excluding
> XE_FORCEWAKE_ALL) in the event of a failure. Modify the return handling
> of xe_force_wake_get() accordingly and pass the return value as input to
> xe_force_wake_put().

Now with changes in patch 3, return value 0 indicates failure for 
XE_FORCEWAKE_ALL, i.e. no domains awake, as well. Please rephrase the 
commit message accordingly.

Regards,
Badal

> 
> v3
> - return xe_wakeref_t instead of int in xe_force_wake_get()
> - xe_force_wake_put() error doesn't need to be escalated/considered as
> probing error. It internally WARNS on domain ack failure.
> 
> v5
> - return unsigned int xe_force_wake_get()
> 
> Cc: Badal Nilawar <badal.nilawar@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_device.c | 25 ++++++++++++++-----------
>   1 file changed, 14 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index 8e9b551c7033..e885edacf39f 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -600,8 +600,8 @@ int xe_device_probe_early(struct xe_device *xe)
>   static int probe_has_flat_ccs(struct xe_device *xe)
>   {
>   	struct xe_gt *gt;
> +	unsigned int fw_ref;
>   	u32 reg;
> -	int err;
>   
>   	/* Always enabled/disabled, no runtime check to do */
>   	if (GRAPHICS_VER(xe) < 20 || !xe->info.has_flat_ccs)
> @@ -609,9 +609,9 @@ static int probe_has_flat_ccs(struct xe_device *xe)
>   
>   	gt = xe_root_mmio_gt(xe);
>   
> -	err = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> -	if (err)
> -		return err;
> +	fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> +	if (!fw_ref)
> +		return -ETIMEDOUT;
>   
>   	reg = xe_gt_mcr_unicast_read_any(gt, XE2_FLAT_CCS_BASE_RANGE_LOWER);
>   	xe->info.has_flat_ccs = (reg & XE2_FLAT_CCS_ENABLE);
> @@ -620,7 +620,8 @@ static int probe_has_flat_ccs(struct xe_device *xe)
>   		drm_dbg(&xe->drm,
>   			"Flat CCS has been disabled in bios, May lead to performance impact");
>   
> -	return xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
> +	xe_force_wake_put(gt_to_fw(gt), fw_ref);
> +	return 0;
>   }
>   
>   int xe_device_probe(struct xe_device *xe)
> @@ -871,6 +872,7 @@ void xe_device_wmb(struct xe_device *xe)
>   void xe_device_td_flush(struct xe_device *xe)
>   {
>   	struct xe_gt *gt;
> +	unsigned int fw_ref;
>   	u8 id;
>   
>   	if (!IS_DGFX(xe) || GRAPHICS_VER(xe) < 20)
> @@ -885,7 +887,8 @@ void xe_device_td_flush(struct xe_device *xe)
>   		if (xe_gt_is_media_type(gt))
>   			continue;
>   
> -		if (xe_force_wake_get(gt_to_fw(gt), XE_FW_GT))
> +		fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> +		if (!fw_ref)
>   			return;
>   
>   		xe_mmio_write32(&gt->mmio, XE2_TDF_CTRL, TRANSIENT_FLUSH_REQUEST);
> @@ -900,22 +903,22 @@ void xe_device_td_flush(struct xe_device *xe)
>   				   150, NULL, false))
>   			xe_gt_err_once(gt, "TD flush timeout\n");
>   
> -		xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
> +		xe_force_wake_put(gt_to_fw(gt), fw_ref);
>   	}
>   }
>   
>   void xe_device_l2_flush(struct xe_device *xe)
>   {
>   	struct xe_gt *gt;
> -	int err;
> +	uint fw_ref;
>   
>   	gt = xe_root_mmio_gt(xe);
>   
>   	if (!XE_WA(gt, 16023588340))
>   		return;
>   
> -	err = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> -	if (err)
> +	fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> +	if (!fw_ref)
>   		return;
>   
>   	spin_lock(&gt->global_invl_lock);
> @@ -925,7 +928,7 @@ void xe_device_l2_flush(struct xe_device *xe)
>   		xe_gt_err_once(gt, "Global invalidation timeout\n");
>   	spin_unlock(&gt->global_invl_lock);
>   
> -	xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
> +	xe_force_wake_put(gt_to_fw(gt), fw_ref);
>   }
>   
>   u32 xe_device_ccs_bytes(struct xe_device *xe, u64 size)


  reply	other threads:[~2024-10-04  7:18 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30  5:31 [PATCH v6 00/25] Fix xe_force_wake_get() failure handling Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 01/25] drm/xe: Add member initialized_domains to xe_force_wake() Himal Prasad Ghimiray
2024-09-30 19:51   ` Michal Wajdeczko
2024-10-01  5:03     ` Ghimiray, Himal Prasad
2024-09-30  5:31 ` [PATCH v6 02/25] drm/xe/forcewake: Add a helper xe_force_wake_ref_has_domain() Himal Prasad Ghimiray
2024-09-30 20:04   ` Michal Wajdeczko
2024-10-01  5:06     ` Ghimiray, Himal Prasad
2024-09-30  5:31 ` [PATCH v6 03/25] drm/xe: Error handling in xe_force_wake_get() Himal Prasad Ghimiray
2024-10-03 12:23   ` Nilawar, Badal
2024-10-03 16:10     ` Ghimiray, Himal Prasad
2024-10-04  7:40       ` Nilawar, Badal
2024-10-07  3:14         ` Ghimiray, Himal Prasad
2024-09-30  5:31 ` [PATCH v6 04/25] drm/xe: Modify xe_force_wake_put to handle _get returned mask Himal Prasad Ghimiray
2024-09-30 20:13   ` Michal Wajdeczko
2024-09-30 20:15     ` Michal Wajdeczko
2024-10-01  5:11       ` Ghimiray, Himal Prasad
2024-10-04  3:21         ` Nilawar, Badal
2024-09-30 22:13   ` Matt Roper
2024-10-01  5:31     ` Ghimiray, Himal Prasad
2024-09-30  5:31 ` [PATCH v6 05/25] drm/xe/device: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-10-04  7:18   ` Nilawar, Badal [this message]
2024-10-07  3:40     ` Ghimiray, Himal Prasad
2024-09-30  5:31 ` [PATCH v6 06/25] drm/xe/hdcp: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 07/25] drm/xe/gsc: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 08/25] drm/xe/gt: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 09/25] drm/xe/xe_gt_idle: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 10/25] drm/xe/devcoredump: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 11/25] drm/xe/tests/mocs: Update xe_force_wake_get() return handling Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 12/25] drm/xe/mocs: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 13/25] drm/xe/xe_drm_client: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 14/25] drm/xe/xe_gt_debugfs: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 15/25] drm/xe/guc: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 16/25] drm/xe/huc: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 17/25] drm/xe/oa: Handle force_wake_get failure in xe_oa_stream_init() Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 18/25] drm/xe/pat: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 19/25] drm/xe/gt_tlb_invalidation_ggtt: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 20/25] drm/xe/xe_reg_sr: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 21/25] drm/xe/query: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 22/25] drm/xe/vram: " Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 23/25] drm/xe: forcewake debugfs open fails on xe_forcewake_get failure Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 24/25] drm/xe: Ensure __must_check for xe_force_wake_get() return Himal Prasad Ghimiray
2024-09-30  5:31 ` [PATCH v6 25/25] drm/xe: Change return type to void for xe_force_wake_put Himal Prasad Ghimiray
2024-09-30  6:02 ` ✓ CI.Patch_applied: success for Fix xe_force_wake_get() failure handling (rev6) Patchwork
2024-09-30  6:03 ` ✓ CI.checkpatch: " Patchwork
2024-09-30  6:03 ` ✗ CI.KUnit: failure " Patchwork
2024-09-30  7:35   ` Ghimiray, Himal Prasad
2024-09-30 20:55 ` ✓ CI.Patch_applied: success for Fix xe_force_wake_get() failure handling (rev7) Patchwork
2024-09-30 20:55 ` ✓ CI.checkpatch: " Patchwork
2024-09-30 20:57 ` ✓ CI.KUnit: " Patchwork
2024-09-30 21:08 ` ✓ CI.Build: " Patchwork
2024-09-30 21:10 ` ✗ CI.Hooks: failure " Patchwork
2024-09-30 21:12 ` ✓ CI.checksparse: success " Patchwork
2024-09-30 21:39 ` ✗ CI.BAT: failure " Patchwork
2024-10-01  6:20 ` ✗ 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=ed935723-8128-42ff-a01e-52f22fa2cbbe@intel.com \
    --to=badal.nilawar@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=rodrigo.vivi@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