Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: Badal Nilawar <badal.nilawar@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	"Nirmoy Das" <nirmoy.das@intel.com>
Subject: Re: [PATCH v5 23/23] drm/xe: Change return type to void for xe_force_wake_put
Date: Wed, 25 Sep 2024 22:16:17 +0530	[thread overview]
Message-ID: <4449e498-d298-44a7-b6b3-db3a450f5351@intel.com> (raw)
In-Reply-To: <c63e6af4-1e71-43dc-b0c3-9179da40a657@intel.com>



On 25-09-2024 19:37, Michal Wajdeczko wrote:
> 
> 
> On 24.09.2024 14:16, 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()
>>
>> 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>
>> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
>> ---
>>   drivers/gpu/drm/xe/xe_force_wake.c | 20 ++++++++++++++++----
>>   drivers/gpu/drm/xe/xe_force_wake.h |  4 ++--
>>   2 files changed, 18 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_force_wake.c b/drivers/gpu/drm/xe/xe_force_wake.c
>> index d2eb367da7c1..c2c55d3de36f 100644
>> --- a/drivers/gpu/drm/xe/xe_force_wake.c
>> +++ b/drivers/gpu/drm/xe/xe_force_wake.c
>> @@ -11,6 +11,7 @@
>>   #include "regs/xe_reg_defs.h"
>>   #include "xe_gt.h"
>>   #include "xe_gt_printk.h"
>> +#include "xe_macros.h"
> 
> this include is likely not needed

will recheck. Probably a leftover from XE_WARN_ON. Thanks for pointing 
this out.

> 
>>   #include "xe_mmio.h"
>>   #include "xe_sriov.h"
>>   
>> @@ -196,8 +197,20 @@ unsigned int __must_check xe_force_wake_get(struct xe_force_wake *fw,
>>   	return ret;
>>   }
>>   
>> -int xe_force_wake_put(struct xe_force_wake *fw,
>> -		      unsigned int domains_mask)
>> +/**
>> + * xe_force_wake_put - Decrement the refcount and put domain to sleep if refcount becomes 0
>> + * @fw: Pointer to the force wake structure
>> + * @domains_mask: forcewake domain mask to put reference
>> + *
>> + * This function reduces the reference counts for specified domain mask. 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 specified timeout.
> 
> nit: if this timeout is hardcoded maybe mention or refer it?

Sure.

> 
>> + * Ensure this function is always called with return of xe_force_wake_get() as
>> + * @domains_mask.
>> + * Warns in case of timeout of ack from domain.
>> + */
>> +void xe_force_wake_put(struct xe_force_wake *fw,
>> +		       unsigned int domains_mask)
> 
> nit: no need to wrap, your kernel-doc is much wider

Sure.

> 
>>   {
>>   	struct xe_gt *gt = fw->gt;
>>   	struct xe_force_wake_domain *domain;
>> @@ -210,7 +223,7 @@ int xe_force_wake_put(struct xe_force_wake *fw,
>>   	 * in error path of individual domains.
>>   	 */
>>   	if (!domains_mask)
>> -		return 0;
>> +		return;
>>   
>>   	spin_lock_irqsave(&fw->lock, flags);
>>   	for_each_fw_domain_masked(domain, domains_mask, fw, tmp) {
>> @@ -229,5 +242,4 @@ int xe_force_wake_put(struct xe_force_wake *fw,
>>   
>>   	xe_gt_WARN(gt, ret, "domain%s %#x failed to acknowledgment sleep\n",
>>   		   str_plural(hweight_long(ret)), ret);
>> -	return ret;
>>   }
>> diff --git a/drivers/gpu/drm/xe/xe_force_wake.h b/drivers/gpu/drm/xe/xe_force_wake.h
>> index 0b676462c97b..a79c98ed6d2f 100644
>> --- a/drivers/gpu/drm/xe/xe_force_wake.h
>> +++ b/drivers/gpu/drm/xe/xe_force_wake.h
>> @@ -17,8 +17,8 @@ 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 domains_mask);
>> +void xe_force_wake_put(struct xe_force_wake *fw,
>> +		       unsigned int domains_mask);
> 
> no need to wrap the line

Sure

> 
>>   
>>   static inline int
>>   xe_force_wake_ref(struct xe_force_wake *fw,
> 


  reply	other threads:[~2024-09-25 16:46 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-24 12:16 [PATCH v5 00/23] Fix xe_force_wake_get() failure handling Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 01/23] drm/xe: Error handling in xe_force_wake_get() Himal Prasad Ghimiray
2024-09-24 17:27   ` Nilawar, Badal
2024-09-25  6:21     ` Ghimiray, Himal Prasad
2024-09-25 12:01   ` Michal Wajdeczko
2024-09-25 16:36     ` Ghimiray, Himal Prasad
2024-09-25 17:20       ` Michal Wajdeczko
2024-09-25 18:14         ` Ghimiray, Himal Prasad
2024-09-26 11:03           ` Michal Wajdeczko
2024-09-26 11:43             ` Ghimiray, Himal Prasad
2024-09-24 12:16 ` [PATCH v5 02/23] drm/xe: Modify xe_force_wake_put to handle _get returned mask Himal Prasad Ghimiray
2024-09-25 10:27   ` Nilawar, Badal
2024-09-25 14:03   ` Michal Wajdeczko
2024-09-25 16:44     ` Ghimiray, Himal Prasad
2024-09-24 12:16 ` [PATCH v5 03/23] drm/xe/device: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 04/23] drm/xe/hdcp: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 05/23] drm/xe/gsc: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 06/23] drm/xe/gt: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 07/23] drm/xe/xe_gt_idle: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 08/23] drm/xe/devcoredump: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 09/23] drm/xe/tests/mocs: Update xe_force_wake_get() return handling Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 10/23] drm/xe/mocs: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 11/23] drm/xe/xe_drm_client: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 12/23] drm/xe/xe_gt_debugfs: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 13/23] drm/xe/guc: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 14/23] drm/xe/huc: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 15/23] drm/xe/oa: Handle force_wake_get failure in xe_oa_stream_init() Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 16/23] drm/xe/pat: Update handling of xe_force_wake_get return Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 17/23] drm/xe/gt_tlb_invalidation_ggtt: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 18/23] drm/xe/xe_reg_sr: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 19/23] drm/xe/query: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 20/23] drm/xe/vram: " Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 21/23] drm/xe: forcewake debugfs open fails on xe_forcewake_get failure Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 22/23] drm/xe: Ensure __must_check for xe_force_wake_get() return Himal Prasad Ghimiray
2024-09-24 12:16 ` [PATCH v5 23/23] drm/xe: Change return type to void for xe_force_wake_put Himal Prasad Ghimiray
2024-09-25 10:30   ` Nilawar, Badal
2024-09-25 14:07   ` Michal Wajdeczko
2024-09-25 16:46     ` Ghimiray, Himal Prasad [this message]
2024-09-26  1:04 ` ✓ CI.Patch_applied: success for Fix xe_force_wake_get() failure handling (rev5) Patchwork
2024-09-26  1:04 ` ✓ CI.checkpatch: " Patchwork
2024-09-26  1:05 ` ✓ CI.KUnit: " Patchwork
2024-09-26  1:17 ` ✓ CI.Build: " Patchwork
2024-09-26  1:19 ` ✓ CI.Hooks: " Patchwork
2024-09-26  1:20 ` ✓ CI.checksparse: " Patchwork
2024-09-26  1:42 ` ✓ CI.BAT: " Patchwork
2024-09-26  8:17 ` ✗ CI.FULL: failure " 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=4449e498-d298-44a7-b6b3-db3a450f5351@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=badal.nilawar@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