All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Matthew Brost <matthew.brost@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	Matthew Auld <matthew.auld@intel.com>,
	Francois Dugast <francois.dugast@intel.com>
Subject: Re: [PATCH] drm/xe: Add outer runtime_pm protection to xe_live_ktest@xe_dma_buf
Date: Wed, 17 Apr 2024 16:12:22 -0400	[thread overview]
Message-ID: <ZiAtJgbbg4qkBg2c@intel.com> (raw)
In-Reply-To: <ZiAsmERgUb0x5KlW@DUT025-TGLU.fm.intel.com>

On Wed, Apr 17, 2024 at 08:10:00PM +0000, Matthew Brost wrote:
> On Wed, Apr 17, 2024 at 03:34:11PM -0400, Rodrigo Vivi wrote:
> > Any kunit doing any memory access should get their own runtime_pm
> 
> So maybe we grab a ref for any live kunit tests in a generic way?

Yeap, I wished to have something like that so we don't risk end up
with missing cases like this, but I couldn't find a generic way.
Right now every other kunit is protected. This is the only one left
behind. Perhaps we should move with this series as is and then
have a follow up with a generic entry for all kunit tests on
top?

> 
> Matt
> 
> > outer references since they don't use the standard driver API
> > entries. In special this dma_buf from the same driver.
> > 
> > Found by pre-merge CI on adding WARN calls for unprotected
> > inner callers:
> > 
> > <6> [318.639739]     # xe_dma_buf_kunit: running xe_test_dmabuf_import_same_driver
> > <4> [318.639957] ------------[ cut here ]------------
> > <4> [318.639967] xe 0000:4d:00.0: Missing outer runtime PM protection
> > <4> [318.640049] WARNING: CPU: 117 PID: 3832 at drivers/gpu/drm/xe/xe_pm.c:533 xe_pm_runtime_get_noresume+0x48/0x60 [xe]
> > 
> > Cc: Matthew Auld <matthew.auld@intel.com>
> > Cc: Francois Dugast <francois.dugast@intel.com>
> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > ---
> >  drivers/gpu/drm/xe/tests/xe_dma_buf.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/xe/tests/xe_dma_buf.c b/drivers/gpu/drm/xe/tests/xe_dma_buf.c
> > index d54dd5b43007..e7f9b531c465 100644
> > --- a/drivers/gpu/drm/xe/tests/xe_dma_buf.c
> > +++ b/drivers/gpu/drm/xe/tests/xe_dma_buf.c
> > @@ -12,6 +12,7 @@
> >  #include "tests/xe_pci_test.h"
> >  
> >  #include "xe_pci.h"
> > +#include "xe_pm.h"
> >  
> >  static bool p2p_enabled(struct dma_buf_test_params *params)
> >  {
> > @@ -259,6 +260,7 @@ static int dma_buf_run_device(struct xe_device *xe)
> >  	const struct dma_buf_test_params *params;
> >  	struct kunit *test = xe_cur_kunit();
> >  
> > +	xe_pm_runtime_get(xe);
> >  	for (params = test_params; params->mem_mask; ++params) {
> >  		struct dma_buf_test_params p = *params;
> >  
> > @@ -266,6 +268,7 @@ static int dma_buf_run_device(struct xe_device *xe)
> >  		test->priv = &p;
> >  		xe_test_dmabuf_import_same_driver(xe);
> >  	}
> > +	xe_pm_runtime_put(xe);
> >  
> >  	/* A non-zero return would halt iteration over driver devices */
> >  	return 0;
> > -- 
> > 2.44.0
> > 

  reply	other threads:[~2024-04-17 20:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10  1:58 [PATCH 1/9] drm/xe: Introduce xe_pm_runtime_get_noresume for inner callers Rodrigo Vivi
2024-04-10  1:58 ` [PATCH 2/9] drm/xe: Introduce intel_runtime_pm_get_noresume at compat-i915-headers for display Rodrigo Vivi
2024-04-10  1:58 ` [PATCH 3/9] drm/i915/display: convert inner wakeref get towards get_if_in_use Rodrigo Vivi
2024-04-10  1:58 ` [PATCH 4/9] drm/xe: Move lockdep protection from mem_access to xe_pm_runtime Rodrigo Vivi
2024-04-10  1:58 ` [PATCH 5/9] drm/xe: Remove useless mem_access during probe Rodrigo Vivi
2024-04-10  1:58 ` [PATCH 6/9] drm/xe: Convert xe_gem_fault to use direct xe_pm_runtime calls Rodrigo Vivi
2024-04-10  1:58 ` [PATCH 7/9] drm/xe: Removing extra mem_access protection from runtime pm Rodrigo Vivi
2024-04-10  1:58 ` [PATCH 8/9] drm/xe: Convert mem_access_if_ongoing to direct xe_pm_runtime_get_if_active Rodrigo Vivi
2024-04-10  1:58 ` [PATCH 9/9] drm/xe: Ensure all the inner access are using the _noresume variant Rodrigo Vivi
2024-04-10  2:03 ` ✓ CI.Patch_applied: success for series starting with [1/9] drm/xe: Introduce xe_pm_runtime_get_noresume for inner callers Patchwork
2024-04-10  2:04 ` ✓ CI.checkpatch: " Patchwork
2024-04-10  2:05 ` ✓ CI.KUnit: " Patchwork
2024-04-10  2:16 ` ✓ CI.Build: " Patchwork
2024-04-10  2:19 ` ✓ CI.Hooks: " Patchwork
2024-04-10  2:20 ` ✗ CI.checksparse: warning " Patchwork
2024-04-10  2:47 ` ✗ CI.BAT: failure " Patchwork
2024-04-17 19:34   ` [PATCH] drm/xe: Add outer runtime_pm protection to xe_live_ktest@xe_dma_buf Rodrigo Vivi
2024-04-17 20:10     ` Matthew Brost
2024-04-17 20:12       ` Rodrigo Vivi [this message]
2024-04-17 20:32         ` Matthew Brost
2024-04-17 20:47   ` ✓ CI.Patch_applied: success for " Patchwork
2024-04-17 20:48   ` ✗ CI.checkpatch: warning " Patchwork
2024-04-17 20:49   ` ✓ CI.KUnit: success " Patchwork
2024-04-17 21:05   ` ✓ CI.Build: " Patchwork
2024-04-17 21:08   ` ✓ CI.Hooks: " Patchwork
2024-04-17 21:10   ` ✓ CI.checksparse: " Patchwork
2024-04-17 21:45   ` ✗ CI.BAT: failure " Patchwork
2024-04-19 13:45   ` ✗ CI.FULL: " Patchwork
2024-04-10  3:58 ` ✓ CI.FULL: success for series starting with [1/9] drm/xe: Introduce xe_pm_runtime_get_noresume for inner callers Patchwork
2024-04-10  8:20 ` [PATCH 1/9] " Matthew Auld

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=ZiAtJgbbg4qkBg2c@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=francois.dugast@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@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.