Skip to content

Commit f9116f6

Browse files
committed
drm/xe: Add outer runtime_pm protection to xe_live_ktest@xe_dma_buf
Any kunit doing any memory access should get their own runtime_pm 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 <[email protected]> Cc: Francois Dugast <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent e1feade commit f9116f6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/xe/tests/xe_dma_buf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "tests/xe_pci_test.h"
1313

1414
#include "xe_pci.h"
15+
#include "xe_pm.h"
1516

1617
static bool p2p_enabled(struct dma_buf_test_params *params)
1718
{
@@ -259,13 +260,15 @@ static int dma_buf_run_device(struct xe_device *xe)
259260
const struct dma_buf_test_params *params;
260261
struct kunit *test = xe_cur_kunit();
261262

263+
xe_pm_runtime_get(xe);
262264
for (params = test_params; params->mem_mask; ++params) {
263265
struct dma_buf_test_params p = *params;
264266

265267
p.base.id = XE_TEST_LIVE_DMA_BUF;
266268
test->priv = &p;
267269
xe_test_dmabuf_import_same_driver(xe);
268270
}
271+
xe_pm_runtime_put(xe);
269272

270273
/* A non-zero return would halt iteration over driver devices */
271274
return 0;

0 commit comments

Comments
 (0)