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: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	"Nirmoy Das" <nirmoy.das@intel.com>
Subject: Re: [PATCH v8 26/26] drm/xe: Change return type to void for xe_force_wake_put
Date: Tue, 8 Oct 2024 22:52:05 +0530	[thread overview]
Message-ID: <1da253b3-31c3-4627-a9db-3a9071cd86ea@intel.com> (raw)
In-Reply-To: <20241008071115.1862704-27-himal.prasad.ghimiray@intel.com>



On 08-10-2024 12:41, Himal Prasad Ghimiray wrote:
> There is no need to return an error from xe_force_wake_put(), as a
> failure implicitly indicates that the domain failed to sleep.
> 
> v3
> - Move kernel-doc to this patch (Badal)
> 
> v5
> - change parameter to unsigned int in xe_force_wake_put()
> 
> v6
> - Remove unneccsary wrapping (Michal)
> - Remove non required header (Michal)
> - Mention timeout(Michal)
> 
> v8
> - Fix kernel-doc
> 
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Badal Nilawar <badal.nilawar@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Nirmoy Das <nirmoy.das@intel.com>
> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>(#rev5)
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_force_wake.c | 16 ++++++++++++----
>   drivers/gpu/drm/xe/xe_force_wake.h |  3 +--
>   2 files changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_force_wake.c b/drivers/gpu/drm/xe/xe_force_wake.c
> index 5d749bad9496..1d8f52d79f47 100644
> --- a/drivers/gpu/drm/xe/xe_force_wake.c
> +++ b/drivers/gpu/drm/xe/xe_force_wake.c
> @@ -212,8 +212,17 @@ unsigned int __must_check xe_force_wake_get(struct xe_force_wake *fw,
>   	return (ref_incr == fw->initialized_domains) ? ref_incr | XE_FORCEWAKE_ALL : ref_incr;
>   }
>   
> -int xe_force_wake_put(struct xe_force_wake *fw,
> -		      unsigned int fw_ref)
> +/**
> + * xe_force_wake_put - Decrement the refcount and put domain to sleep if refcount becomes 0
> + * @fw: Pointer to the force wake structure
> + * @fw_ref: return of xe_force_wake_get()
> + *
> + * This function reduces the reference counts for domains in fw_ref. If
> + * refcount for any of the specified domain reaches 0, it puts the domain to sleep
> + * and waits for acknowledgment for domain to sleep within 50 milisec timeout.
> + * Warns in case of timeout of ack from domain.
> + */

Looks good. Please retain my RB.

Regards,
Badal

> +void xe_force_wake_put(struct xe_force_wake *fw, unsigned int fw_ref)
>   {
>   	struct xe_gt *gt = fw->gt;
>   	struct xe_force_wake_domain *domain;
> @@ -226,7 +235,7 @@ int xe_force_wake_put(struct xe_force_wake *fw,
>   	 * in error path of individual domains.
>   	 */
>   	if (!fw_ref)
> -		return 0;
> +		return;
>   
>   	if (fw_ref == XE_FORCEWAKE_ALL)
>   		fw_ref = fw->initialized_domains;
> @@ -248,5 +257,4 @@ int xe_force_wake_put(struct xe_force_wake *fw,
>   
>   	xe_gt_WARN(gt, ack_fail, "Forcewake domain%s %#x failed to acknowledge sleep request\n",
>   		   str_plural(hweight_long(ack_fail)), ack_fail);
> -	return ack_fail;
>   }
> diff --git a/drivers/gpu/drm/xe/xe_force_wake.h b/drivers/gpu/drm/xe/xe_force_wake.h
> index 70faec9ae2d9..0e3e84bfa51c 100644
> --- a/drivers/gpu/drm/xe/xe_force_wake.h
> +++ b/drivers/gpu/drm/xe/xe_force_wake.h
> @@ -17,8 +17,7 @@ void xe_force_wake_init_engines(struct xe_gt *gt,
>   				struct xe_force_wake *fw);
>   unsigned int __must_check xe_force_wake_get(struct xe_force_wake *fw,
>   					    enum xe_force_wake_domains domains);
> -int xe_force_wake_put(struct xe_force_wake *fw,
> -		      unsigned int fw_ref);
> +void xe_force_wake_put(struct xe_force_wake *fw, unsigned int fw_ref);
>   
>   static inline int
>   xe_force_wake_ref(struct xe_force_wake *fw,


  reply	other threads:[~2024-10-08 17:22 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  7:10 [PATCH v8 00/26] Fix xe_force_wake_get() failure handling Himal Prasad Ghimiray
2024-10-08  6:58 ` ✓ CI.Patch_applied: success for Fix xe_force_wake_get() failure handling (rev9) Patchwork
2024-10-08  6:59 ` ✓ CI.checkpatch: " Patchwork
2024-10-08  7:00 ` ✓ CI.KUnit: " Patchwork
2024-10-08  7:10 ` [PATCH v8 01/26] drm/xe: Add member initialized_domains to xe_force_wake() Himal Prasad Ghimiray
2024-10-08 14:55   ` Nilawar, Badal
2024-10-08 17:03   ` Michal Wajdeczko
2024-10-08  7:10 ` [PATCH v8 02/26] drm/xe/forcewake: Change awake_domain datatype Himal Prasad Ghimiray
2024-10-08 14:56   ` Nilawar, Badal
2024-10-08 17:04   ` Michal Wajdeczko
2024-10-08  7:10 ` [PATCH v8 03/26] drm/xe/forcewake: Add a helper xe_force_wake_ref_has_domain() Himal Prasad Ghimiray
2024-10-08 14:58   ` Nilawar, Badal
2024-10-08 17:07   ` Michal Wajdeczko
2024-10-08  7:10 ` [PATCH v8 04/26] drm/xe: Error handling in xe_force_wake_get() Himal Prasad Ghimiray
2024-10-08 15:13   ` Nilawar, Badal
2024-10-08 18:05   ` Michal Wajdeczko
2024-10-08  7:10 ` [PATCH v8 05/26] drm/xe: Modify xe_force_wake_put to handle _get returned mask Himal Prasad Ghimiray
2024-10-08 18:18   ` Michal Wajdeczko
2024-10-08  7:10 ` [PATCH v8 06/26] drm/xe/device: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-10-09 11:30   ` Jani Nikula
2024-10-08  7:10 ` [PATCH v8 07/26] drm/xe/hdcp: " Himal Prasad Ghimiray
2024-10-08  7:10 ` [PATCH v8 08/26] drm/xe/gsc: " Himal Prasad Ghimiray
2024-10-09 12:42   ` Nilawar, Badal
2024-10-08  7:10 ` [PATCH v8 09/26] drm/xe/gt: " Himal Prasad Ghimiray
2024-10-09 12:46   ` Nilawar, Badal
2024-10-08  7:10 ` [PATCH v8 10/26] drm/xe/xe_gt_idle: " Himal Prasad Ghimiray
2024-10-09 12:49   ` Nilawar, Badal
2024-10-08  7:11 ` [PATCH v8 11/26] drm/xe/devcoredump: " Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 12/26] drm/xe/tests/mocs: Update xe_force_wake_get() return handling Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 13/26] drm/xe/mocs: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 14/26] drm/xe/xe_drm_client: " Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 15/26] drm/xe/xe_gt_debugfs: " Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 16/26] drm/xe/guc: " Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 17/26] drm/xe/huc: " Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 18/26] drm/xe/oa: Handle force_wake_get failure in xe_oa_stream_init() Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 19/26] drm/xe/pat: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 20/26] drm/xe/gt_tlb_invalidation_ggtt: " Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 21/26] drm/xe/xe_reg_sr: " Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 22/26] drm/xe/query: " Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 23/26] drm/xe/vram: " Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 24/26] drm/xe: forcewake debugfs open fails on xe_forcewake_get failure Himal Prasad Ghimiray
2024-10-08  7:11 ` [PATCH v8 25/26] drm/xe: Ensure __must_check for xe_force_wake_get() return Himal Prasad Ghimiray
2024-10-08 17:17   ` Nilawar, Badal
2024-10-08  7:11 ` [PATCH v8 26/26] drm/xe: Change return type to void for xe_force_wake_put Himal Prasad Ghimiray
2024-10-08 17:22   ` Nilawar, Badal [this message]
2024-10-08 18:24   ` Michal Wajdeczko
2024-10-08  7:30 ` ✓ CI.Hooks: success for Fix xe_force_wake_get() failure handling (rev9) Patchwork
2024-10-08  7:32 ` ✓ CI.checksparse: " Patchwork
2024-10-08  8:12 ` ✗ CI.BAT: failure " Patchwork
2024-10-08 10:44 ` ✗ 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=1da253b3-31c3-4627-a9db-3a9071cd86ea@intel.com \
    --to=badal.nilawar@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=nirmoy.das@intel.com \
    --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