Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Badal Nilawar <badal.nilawar@intel.com>
Subject: Re: [PATCH 2/2] drm/xe: Fix xe_force_wake_assert_held for enum XE_FORCEWAKE_ALL
Date: Fri, 31 May 2024 11:26:54 -0400	[thread overview]
Message-ID: <ZlnsPgvMTx_iiPqc@intel.com> (raw)
In-Reply-To: <41051b48-6217-46d2-afca-ba3d11c61daa@intel.com>

On Fri, May 31, 2024 at 07:26:33PM +0530, Ghimiray, Himal Prasad wrote:
>    On 31-05-2024 18:49, Rodrigo Vivi wrote:                                     
>                                                                                 
>    On Fri, May 31, 2024 at 12:18:45PM +0530, Himal Prasad Ghimiray wrote:       
>                                                                                 
>    >Make sure that the assertion condition covers the wakefulness of all        
>    >supported domains for XE_FORCEWAKE_ALL.                                     
>                                                                                 
>    The most important part is missing here: why? what issue are we trying to solve?
>                                                                                 
>    Hi Rodrigo,                                                                  
>                                                                                 

Please avoid Outlook...

>    AFAIU,  xe_force_wake_assert_held is designed to trigger an assertion if     
>    the provided domain is not awake, which works correctly for individual       
>    domains. However, the assertion condition becomes incorrect for              
>    XE_FORCEWAKE_ALL.                                                            
>                                                                                 
>    For instance, if we assume all domains are in sleep mode, invoking           
>    xe_force_wake_get(fw, XE_FORCEWAKE_GT) will only awaken the "gt" domain.     
>    Subsequently, another function needs that all domains are awake and          
>    utilizes xe_force_wake_assert_held(fw, XE_FORCEWAKE_ALL).                    
>                                                                                 
>    In this scenario, the condition will inaccurately return success because     
>    fw->awake_domains (0x1) & XE_FORCEWAKE_ALL (0xFF) will still be 0x1 and      
>    Ideally it should have asserted.                                             

It makes total sense. Could you please ensure that the commit message include
this important reasoning?!

Then, the other commit also needs to explain why a simple
(XE_FORCEWAKE_ALL & fw->awake_domains) == XE_FORCEWAKE_ALL doesn't work so
the supported/initialized domains needed to be created.

Btw, perhaps initialized_domains is better then supported?

>                                                                                 
>                                                                                 
>                                                                                 
>    >Cc: Rodrigo Vivi [1]<rodrigo.vivi@intel.com>                                
>    >Cc: Badal Nilawar [2]<badal.nilawar@intel.com>                              
>    >Signed-off-by: Himal Prasad Ghimiray [3]<himal.prasad.ghimiray@intel.com>   
>    >---                                                                         
>    > drivers/gpu/drm/xe/xe_force_wake.h | 7 ++++++-                             
>    > 1 file changed, 6 insertions(+), 1 deletion(-)                             
>                                                                                 
>    >diff --git a/drivers/gpu/drm/xe/xe_force_wake.h b/drivers/gpu/drm/xe/xe_force_wake.h
>    >index 83cb157da7cc..4c986d72cba7 100644                                     
>    >--- a/drivers/gpu/drm/xe/xe_force_wake.h                                    
>    >+++ b/drivers/gpu/drm/xe/xe_force_wake.h                                    
>    >@@ -32,7 +32,12 @@ static inline void                                       
>    > xe_force_wake_assert_held(struct xe_force_wake *fw,                        
>    >                          enum xe_force_wake_domains domain)                
>    > {                                                                          
>    >-       xe_gt_assert(fw->gt, fw->awake_domains & domain);                   
>    >+       enum xe_force_wake_domains is_awake;                                
>    >+                                                                           
>    >+       is_awake = (domain == XE_FORCEWAKE_ALL) ?                           
>    >+                   fw->supported_domains : domain;                         
>    >+                                                                           
>    >+       xe_gt_assert(fw->gt, (fw->awake_domains & is_awake) == is_awake);   
>    > }                                                                          
>    >                                                                            
>    > #endif                                                                     
>    >--                                                                          
>    >2.25.1                                                                      
> 
> References
> 
>    Visible links
>    1. mailto:rodrigo.vivi@intel.com
>    2. mailto:badal.nilawar@intel.com
>    3. mailto:himal.prasad.ghimiray@intel.com

  reply	other threads:[~2024-05-31 15:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31  6:48 [PATCH 1/2] drm/xe: Add member supported_domains to xe_force_wake Himal Prasad Ghimiray
2024-05-31  6:39 ` ✓ CI.Patch_applied: success for series starting with [1/2] " Patchwork
2024-05-31  6:40 ` ✓ CI.checkpatch: " Patchwork
2024-05-31  6:41 ` ✓ CI.KUnit: " Patchwork
2024-05-31  6:48 ` [PATCH 2/2] drm/xe: Fix xe_force_wake_assert_held for enum XE_FORCEWAKE_ALL Himal Prasad Ghimiray
2024-05-31 13:19   ` Rodrigo Vivi
2024-05-31 13:56     ` Ghimiray, Himal Prasad
2024-05-31 15:26       ` Rodrigo Vivi [this message]
2024-06-03  3:53         ` Ghimiray, Himal Prasad
2024-05-31  6:52 ` ✓ CI.Build: success for series starting with [1/2] drm/xe: Add member supported_domains to xe_force_wake Patchwork
2024-05-31  6:53 ` ✗ CI.Hooks: failure " Patchwork
2024-05-31  6:54 ` ✓ CI.checksparse: success " Patchwork
2024-05-31  7:22 ` ✓ CI.BAT: " Patchwork
2024-05-31  8:31 ` ✗ CI.FULL: failure " Patchwork
2024-05-31 15:27 ` [PATCH 1/2] " Rodrigo Vivi
2024-06-03  3:56   ` Ghimiray, Himal Prasad

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=ZlnsPgvMTx_iiPqc@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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