intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT
@ 2020-03-12  1:16 Daniele Ceraolo Spurio
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 1/6] drm/i915/gt: allow setting generic data pointer Daniele Ceraolo Spurio
                   ` (10 more replies)
  0 siblings, 11 replies; 25+ messages in thread
From: Daniele Ceraolo Spurio @ 2020-03-12  1:16 UTC (permalink / raw)
  To: intel-gfx

Rebased on top of Andi's patch. Note that some discussion is still
ongoing on that patch.

Also dropped the patch that caused a const->non-const conversion and
fixed a couple of bugs:
- keep printing HUC_STATUS register
- correcly set permissions for writable debugfs files

Cc: Andi Shyti <andi.shyti@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Matthew Brost <matthew.brost@intel.com> 

Andi Shyti (1):
  drm/i915/gt: allow setting generic data pointer

Daniele Ceraolo Spurio (5):
  drm/i915/guc: drop stage_pool debugfs
  drm/i915/huc: make "support huc" reflect HW capabilities
  drm/i915/debugfs: move uC printers and update debugfs file names
  drm/i915/uc: Move uC debugfs to its own folder under GT
  drm/i915/uc: do not free err log on uc_fini

 drivers/gpu/drm/i915/Makefile                |   7 +-
 drivers/gpu/drm/i915/gt/debugfs_engines.c    |   2 +-
 drivers/gpu/drm/i915/gt/debugfs_gt.c         |  15 +-
 drivers/gpu/drm/i915/gt/debugfs_gt.h         |   9 +-
 drivers/gpu/drm/i915/gt/debugfs_gt_pm.c      |  14 +-
 drivers/gpu/drm/i915/gt/intel_gt.c           |   3 +-
 drivers/gpu/drm/i915/gt/uc/debugfs_guc.c     |  42 +++
 drivers/gpu/drm/i915/gt/uc/debugfs_guc.h     |  14 +
 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c | 124 ++++++++
 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h |  15 +
 drivers/gpu/drm/i915/gt/uc/debugfs_huc.c     |  36 +++
 drivers/gpu/drm/i915/gt/uc/debugfs_huc.h     |  14 +
 drivers/gpu/drm/i915/gt/uc/debugfs_uc.c      |  31 ++
 drivers/gpu/drm/i915/gt/uc/debugfs_uc.h      |  14 +
 drivers/gpu/drm/i915/gt/uc/intel_guc.c       |  46 ++-
 drivers/gpu/drm/i915/gt/uc/intel_guc.h       |   7 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c    |  14 -
 drivers/gpu/drm/i915/gt/uc/intel_guc_fw.h    |   1 -
 drivers/gpu/drm/i915/gt/uc/intel_guc_log.c   |  97 ++++++-
 drivers/gpu/drm/i915/gt/uc/intel_guc_log.h   |   4 +
 drivers/gpu/drm/i915/gt/uc/intel_huc.c       |  31 +-
 drivers/gpu/drm/i915/gt/uc/intel_huc.h       |   2 +
 drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c    |  17 --
 drivers/gpu/drm/i915/gt/uc/intel_huc_fw.h    |   1 -
 drivers/gpu/drm/i915/gt/uc/intel_uc.c        |   9 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc.h        |   1 +
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c     |  25 +-
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h     |   3 +-
 drivers/gpu/drm/i915/i915_debugfs.c          | 289 -------------------
 29 files changed, 526 insertions(+), 361 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc.c
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc.h
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_huc.c
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_huc.h
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_uc.c
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_uc.h

-- 
2.24.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Intel-gfx] [PATCH v2 1/6] drm/i915/gt: allow setting generic data pointer
  2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
@ 2020-03-12  1:16 ` Daniele Ceraolo Spurio
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 2/6] drm/i915/guc: drop stage_pool debugfs Daniele Ceraolo Spurio
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 25+ messages in thread
From: Daniele Ceraolo Spurio @ 2020-03-12  1:16 UTC (permalink / raw)
  To: intel-gfx

From: Andi Shyti <andi.shyti@intel.com>

When registering debugfs files the intel gt debugfs library
forces a 'struct *gt' private data on the caller.

To be open to different usages make the new
"intel_gt_debugfs_register_files()"[*] function more generic by
converting the 'struct *gt' pointer to a 'void *' type.

I take the chance to rename the functions by using "intel_gt_" as
prefix instead of "debugfs_", so that "debugfs_gt_register_files()"
becomes "intel_gt_debugfs_register_files()".

Signed-off-by: Andi Shyti <andi.shyti@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
 drivers/gpu/drm/i915/gt/debugfs_engines.c |  2 +-
 drivers/gpu/drm/i915/gt/debugfs_gt.c      | 11 +++++------
 drivers/gpu/drm/i915/gt/debugfs_gt.h      |  9 ++++-----
 drivers/gpu/drm/i915/gt/debugfs_gt_pm.c   | 14 +++++++++-----
 4 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/debugfs_engines.c b/drivers/gpu/drm/i915/gt/debugfs_engines.c
index 6a5e9ab20b94..5e3725e62241 100644
--- a/drivers/gpu/drm/i915/gt/debugfs_engines.c
+++ b/drivers/gpu/drm/i915/gt/debugfs_engines.c
@@ -32,5 +32,5 @@ void debugfs_engines_register(struct intel_gt *gt, struct dentry *root)
 		{ "engines", &engines_fops },
 	};
 
-	debugfs_gt_register_files(gt, root, files, ARRAY_SIZE(files));
+	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), gt);
 }
diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt.c b/drivers/gpu/drm/i915/gt/debugfs_gt.c
index 75255aaacaed..de73b63d6ba7 100644
--- a/drivers/gpu/drm/i915/gt/debugfs_gt.c
+++ b/drivers/gpu/drm/i915/gt/debugfs_gt.c
@@ -26,15 +26,14 @@ void debugfs_gt_register(struct intel_gt *gt)
 	debugfs_gt_pm_register(gt, root);
 }
 
-void debugfs_gt_register_files(struct intel_gt *gt,
-			       struct dentry *root,
-			       const struct debugfs_gt_file *files,
-			       unsigned long count)
+void intel_gt_debugfs_register_files(struct dentry *root,
+				     const struct debugfs_gt_file *files,
+				     unsigned long count, void *data)
 {
 	while (count--) {
-		if (!files->eval || files->eval(gt))
+		if (!files->eval || files->eval(data))
 			debugfs_create_file(files->name,
-					    0444, root, gt,
+					    0444, root, data,
 					    files->fops);
 
 		files++;
diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt.h b/drivers/gpu/drm/i915/gt/debugfs_gt.h
index 4ea0f06cda8f..f77540f727e9 100644
--- a/drivers/gpu/drm/i915/gt/debugfs_gt.h
+++ b/drivers/gpu/drm/i915/gt/debugfs_gt.h
@@ -28,12 +28,11 @@ void debugfs_gt_register(struct intel_gt *gt);
 struct debugfs_gt_file {
 	const char *name;
 	const struct file_operations *fops;
-	bool (*eval)(const struct intel_gt *gt);
+	bool (*eval)(void *data);
 };
 
-void debugfs_gt_register_files(struct intel_gt *gt,
-			       struct dentry *root,
-			       const struct debugfs_gt_file *files,
-			       unsigned long count);
+void intel_gt_debugfs_register_files(struct dentry *root,
+				     const struct debugfs_gt_file *files,
+				     unsigned long count, void *data);
 
 #endif /* DEBUGFS_GT_H */
diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.c b/drivers/gpu/drm/i915/gt/debugfs_gt_pm.c
index 059c9e5c002e..dc024944873a 100644
--- a/drivers/gpu/drm/i915/gt/debugfs_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/debugfs_gt_pm.c
@@ -506,9 +506,11 @@ static int llc_show(struct seq_file *m, void *data)
 	return 0;
 }
 
-static bool llc_eval(const struct intel_gt *gt)
+static bool llc_eval(void *data)
 {
-	return HAS_LLC(gt->i915);
+	struct intel_gt *gt = data;
+
+	return gt && HAS_LLC(gt->i915);
 }
 
 DEFINE_GT_DEBUGFS_ATTRIBUTE(llc);
@@ -580,9 +582,11 @@ static int rps_boost_show(struct seq_file *m, void *data)
 	return 0;
 }
 
-static bool rps_eval(const struct intel_gt *gt)
+static bool rps_eval(void *data)
 {
-	return HAS_RPS(gt->i915);
+	struct intel_gt *gt = data;
+
+	return gt && HAS_RPS(gt->i915);
 }
 
 DEFINE_GT_DEBUGFS_ATTRIBUTE(rps_boost);
@@ -597,5 +601,5 @@ void debugfs_gt_pm_register(struct intel_gt *gt, struct dentry *root)
 		{ "rps_boost", &rps_boost_fops, rps_eval },
 	};
 
-	debugfs_gt_register_files(gt, root, files, ARRAY_SIZE(files));
+	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), gt);
 }
-- 
2.24.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Intel-gfx] [PATCH v2 2/6] drm/i915/guc: drop stage_pool debugfs
  2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 1/6] drm/i915/gt: allow setting generic data pointer Daniele Ceraolo Spurio
@ 2020-03-12  1:16 ` Daniele Ceraolo Spurio
  2020-03-13 11:37   ` Andi Shyti
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 3/6] drm/i915/huc: make "support huc" reflect HW capabilities Daniele Ceraolo Spurio
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Daniele Ceraolo Spurio @ 2020-03-12  1:16 UTC (permalink / raw)
  To: intel-gfx

The pool will be private to GuC in the new submission scheme, so we
won't be able to print it and we can just drop the current legacy code.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 53 -----------------------------
 1 file changed, 53 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 6ca797128aa1..de94fcd2032b 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1356,58 +1356,6 @@ static int i915_guc_info(struct seq_file *m, void *data)
 	return 0;
 }
 
-static int i915_guc_stage_pool(struct seq_file *m, void *data)
-{
-	struct drm_i915_private *dev_priv = node_to_i915(m->private);
-	struct intel_uc *uc = &dev_priv->gt.uc;
-	struct guc_stage_desc *desc = uc->guc.stage_desc_pool_vaddr;
-	int index;
-
-	if (!intel_uc_uses_guc_submission(uc))
-		return -ENODEV;
-
-	for (index = 0; index < GUC_MAX_STAGE_DESCRIPTORS; index++, desc++) {
-		struct intel_engine_cs *engine;
-
-		if (!(desc->attribute & GUC_STAGE_DESC_ATTR_ACTIVE))
-			continue;
-
-		seq_printf(m, "GuC stage descriptor %u:\n", index);
-		seq_printf(m, "\tIndex: %u\n", desc->stage_id);
-		seq_printf(m, "\tAttribute: 0x%x\n", desc->attribute);
-		seq_printf(m, "\tPriority: %d\n", desc->priority);
-		seq_printf(m, "\tDoorbell id: %d\n", desc->db_id);
-		seq_printf(m, "\tEngines used: 0x%x\n",
-			   desc->engines_used);
-		seq_printf(m, "\tDoorbell trigger phy: 0x%llx, cpu: 0x%llx, uK: 0x%x\n",
-			   desc->db_trigger_phy,
-			   desc->db_trigger_cpu,
-			   desc->db_trigger_uk);
-		seq_printf(m, "\tProcess descriptor: 0x%x\n",
-			   desc->process_desc);
-		seq_printf(m, "\tWorkqueue address: 0x%x, size: 0x%x\n",
-			   desc->wq_addr, desc->wq_size);
-		seq_putc(m, '\n');
-
-		for_each_uabi_engine(engine, dev_priv) {
-			u32 guc_engine_id = engine->guc_id;
-			struct guc_execlist_context *lrc =
-						&desc->lrc[guc_engine_id];
-
-			seq_printf(m, "\t%s LRC:\n", engine->name);
-			seq_printf(m, "\t\tContext desc: 0x%x\n",
-				   lrc->context_desc);
-			seq_printf(m, "\t\tContext id: 0x%x\n", lrc->context_id);
-			seq_printf(m, "\t\tLRCA: 0x%x\n", lrc->ring_lrca);
-			seq_printf(m, "\t\tRing begin: 0x%x\n", lrc->ring_begin);
-			seq_printf(m, "\t\tRing end: 0x%x\n", lrc->ring_end);
-			seq_putc(m, '\n');
-		}
-	}
-
-	return 0;
-}
-
 static int i915_guc_log_dump(struct seq_file *m, void *data)
 {
 	struct drm_info_node *node = m->private;
@@ -2143,7 +2091,6 @@ static const struct drm_info_list i915_debugfs_list[] = {
 	{"i915_guc_load_status", i915_guc_load_status_info, 0},
 	{"i915_guc_log_dump", i915_guc_log_dump, 0},
 	{"i915_guc_load_err_log_dump", i915_guc_log_dump, 0, (void *)1},
-	{"i915_guc_stage_pool", i915_guc_stage_pool, 0},
 	{"i915_huc_load_status", i915_huc_load_status_info, 0},
 	{"i915_frequency_info", i915_frequency_info, 0},
 	{"i915_ring_freq_table", i915_ring_freq_table, 0},
-- 
2.24.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Intel-gfx] [PATCH v2 3/6] drm/i915/huc: make "support huc" reflect HW capabilities
  2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 1/6] drm/i915/gt: allow setting generic data pointer Daniele Ceraolo Spurio
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 2/6] drm/i915/guc: drop stage_pool debugfs Daniele Ceraolo Spurio
@ 2020-03-12  1:16 ` Daniele Ceraolo Spurio
  2020-03-13 14:55   ` Andi Shyti
  2020-03-25 16:49   ` John Harrison
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 4/6] drm/i915/debugfs: move uC printers and update debugfs file names Daniele Ceraolo Spurio
                   ` (7 subsequent siblings)
  10 siblings, 2 replies; 25+ messages in thread
From: Daniele Ceraolo Spurio @ 2020-03-12  1:16 UTC (permalink / raw)
  To: intel-gfx

We currently initialize HuC support based on GuC being enabled in
modparam; this means that huc_is_supported() can return false on HW that
does have a HuC when enable_guc=0. The rationale for this behavior is
that HuC requires GuC for authentication and therefore is not supported
by itself. However, we do not allow defining HuC fw wthout GuC fw and
selecting HuC in modparam implicitly selects GuC as well, so we can't
actually hit a scenario where HuC is selected alone. Therefore, we can
flip the support check to reflect the HW capabilities and fw
availability, which is more intuitive and will make it cleaner to log
HuC the difference between not supported in HW and not selected.

Removing the difference between GuC and HuC also allows us to simplify
the init_early, since we don't need to differentiate the support based
on the type of uC.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc.c    |  2 +-
 drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c | 14 -------------
 drivers/gpu/drm/i915/gt/uc/intel_guc_fw.h |  1 -
 drivers/gpu/drm/i915/gt/uc/intel_huc.c    |  2 +-
 drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c | 17 ---------------
 drivers/gpu/drm/i915/gt/uc/intel_huc_fw.h |  1 -
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c  | 25 +++++++++++++++--------
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h  |  3 +--
 8 files changed, 20 insertions(+), 45 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
index 819f09ef51fc..827d75073879 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
@@ -169,7 +169,7 @@ void intel_guc_init_early(struct intel_guc *guc)
 {
 	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
 
-	intel_guc_fw_init_early(guc);
+	intel_uc_fw_init_early(&guc->fw, INTEL_UC_FW_TYPE_GUC);
 	intel_guc_ct_init_early(&guc->ct);
 	intel_guc_log_init_early(&guc->log);
 	intel_guc_submission_init_early(guc);
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c
index 3a1c47d600ea..d4a87f4c9421 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c
@@ -13,20 +13,6 @@
 #include "intel_guc_fw.h"
 #include "i915_drv.h"
 
-/**
- * intel_guc_fw_init_early() - initializes GuC firmware struct
- * @guc: intel_guc struct
- *
- * On platforms with GuC selects firmware for uploading
- */
-void intel_guc_fw_init_early(struct intel_guc *guc)
-{
-	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
-
-	intel_uc_fw_init_early(&guc->fw, INTEL_UC_FW_TYPE_GUC, HAS_GT_UC(i915),
-			       INTEL_INFO(i915)->platform, INTEL_REVID(i915));
-}
-
 static void guc_prepare_xfer(struct intel_uncore *uncore)
 {
 	u32 shim_flags = GUC_DISABLE_SRAM_INIT_TO_ZEROES |
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.h
index b5ab639d7259..0b4d2a9c9435 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.h
@@ -8,7 +8,6 @@
 
 struct intel_guc;
 
-void intel_guc_fw_init_early(struct intel_guc *guc);
 int intel_guc_fw_upload(struct intel_guc *guc);
 
 #endif
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.c b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
index a74b65694512..d73dc21686e7 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_huc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
@@ -41,7 +41,7 @@ void intel_huc_init_early(struct intel_huc *huc)
 {
 	struct drm_i915_private *i915 = huc_to_gt(huc)->i915;
 
-	intel_huc_fw_init_early(huc);
+	intel_uc_fw_init_early(&huc->fw, INTEL_UC_FW_TYPE_HUC);
 
 	if (INTEL_GEN(i915) >= 11) {
 		huc->status.reg = GEN11_HUC_KERNEL_LOAD_INFO;
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
index 9cdf4cbe691c..e5ef509c70e8 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
@@ -7,23 +7,6 @@
 #include "intel_huc_fw.h"
 #include "i915_drv.h"
 
-/**
- * intel_huc_fw_init_early() - initializes HuC firmware struct
- * @huc: intel_huc struct
- *
- * On platforms with HuC selects firmware for uploading
- */
-void intel_huc_fw_init_early(struct intel_huc *huc)
-{
-	struct intel_gt *gt = huc_to_gt(huc);
-	struct intel_uc *uc = &gt->uc;
-	struct drm_i915_private *i915 = gt->i915;
-
-	intel_uc_fw_init_early(&huc->fw, INTEL_UC_FW_TYPE_HUC,
-			       intel_uc_wants_guc(uc),
-			       INTEL_INFO(i915)->platform, INTEL_REVID(i915));
-}
-
 /**
  * intel_huc_fw_upload() - load HuC uCode to device
  * @huc: intel_huc structure
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.h b/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.h
index b791269ce923..12f264ee3e0b 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.h
@@ -8,7 +8,6 @@
 
 struct intel_huc;
 
-void intel_huc_fw_init_early(struct intel_huc *huc);
 int intel_huc_fw_upload(struct intel_huc *huc);
 
 #endif
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
index 18c755203688..fa893dd1823c 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
@@ -11,16 +11,22 @@
 #include "intel_uc_fw_abi.h"
 #include "i915_drv.h"
 
-static inline struct intel_gt *__uc_fw_to_gt(struct intel_uc_fw *uc_fw)
+static inline struct intel_gt *
+____uc_fw_to_gt(struct intel_uc_fw *uc_fw, enum intel_uc_fw_type type)
 {
-	GEM_BUG_ON(uc_fw->status == INTEL_UC_FIRMWARE_UNINITIALIZED);
-	if (uc_fw->type == INTEL_UC_FW_TYPE_GUC)
+	if (type == INTEL_UC_FW_TYPE_GUC)
 		return container_of(uc_fw, struct intel_gt, uc.guc.fw);
 
-	GEM_BUG_ON(uc_fw->type != INTEL_UC_FW_TYPE_HUC);
+	GEM_BUG_ON(type != INTEL_UC_FW_TYPE_HUC);
 	return container_of(uc_fw, struct intel_gt, uc.huc.fw);
 }
 
+static inline struct intel_gt *__uc_fw_to_gt(struct intel_uc_fw *uc_fw)
+{
+	GEM_BUG_ON(uc_fw->status == INTEL_UC_FIRMWARE_UNINITIALIZED);
+	return ____uc_fw_to_gt(uc_fw, uc_fw->type);
+}
+
 #ifdef CONFIG_DRM_I915_DEBUG_GUC
 void intel_uc_fw_change_status(struct intel_uc_fw *uc_fw,
 			       enum intel_uc_fw_status status)
@@ -195,9 +201,10 @@ static void __uc_fw_user_override(struct intel_uc_fw *uc_fw)
  * firmware to fetch and load.
  */
 void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
-			    enum intel_uc_fw_type type, bool supported,
-			    enum intel_platform platform, u8 rev)
+			    enum intel_uc_fw_type type)
 {
+	struct drm_i915_private *i915 = ____uc_fw_to_gt(uc_fw, type)->i915;
+
 	/*
 	 * we use FIRMWARE_UNINITIALIZED to detect checks against uc_fw->status
 	 * before we're looked at the HW caps to see if we have uc support
@@ -208,8 +215,10 @@ void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
 
 	uc_fw->type = type;
 
-	if (supported) {
-		__uc_fw_auto_select(uc_fw, platform, rev);
+	if (HAS_GT_UC(i915)) {
+		__uc_fw_auto_select(uc_fw,
+				    INTEL_INFO(i915)->platform,
+				    INTEL_REVID(i915));
 		__uc_fw_user_override(uc_fw);
 	}
 
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h
index 888ff0de0244..23d3a423ac0f 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h
@@ -239,8 +239,7 @@ static inline u32 intel_uc_fw_get_upload_size(struct intel_uc_fw *uc_fw)
 }
 
 void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
-			    enum intel_uc_fw_type type, bool supported,
-			    enum intel_platform platform, u8 rev);
+			    enum intel_uc_fw_type type);
 int intel_uc_fw_fetch(struct intel_uc_fw *uc_fw);
 void intel_uc_fw_cleanup_fetch(struct intel_uc_fw *uc_fw);
 int intel_uc_fw_upload(struct intel_uc_fw *uc_fw, u32 offset, u32 dma_flags);
-- 
2.24.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Intel-gfx] [PATCH v2 4/6] drm/i915/debugfs: move uC printers and update debugfs file names
  2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
                   ` (2 preceding siblings ...)
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 3/6] drm/i915/huc: make "support huc" reflect HW capabilities Daniele Ceraolo Spurio
@ 2020-03-12  1:16 ` Daniele Ceraolo Spurio
  2020-03-25 17:05   ` John Harrison
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT Daniele Ceraolo Spurio
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Daniele Ceraolo Spurio @ 2020-03-12  1:16 UTC (permalink / raw)
  To: intel-gfx

Move the printers to the respective files for clarity. The
guc_load_status debugfs has been squashed in the guc_info one, has
having separate ones wasn't very useful. The HuC debugfs has been
renamed huc_info to match.

v2: keep printing HUC_STATUS2 (Tony), avoid const->non-const
    container_of (Jani)

Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Tony Ye <tony.ye@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc.c     |  44 +++++++
 drivers/gpu/drm/i915/gt/uc/intel_guc.h     |   2 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_log.c |  92 +++++++++++++++
 drivers/gpu/drm/i915/gt/uc/intel_guc_log.h |   4 +
 drivers/gpu/drm/i915/gt/uc/intel_huc.c     |  29 +++++
 drivers/gpu/drm/i915/gt/uc/intel_huc.h     |   2 +
 drivers/gpu/drm/i915/i915_debugfs.c        | 131 +++------------------
 7 files changed, 189 insertions(+), 115 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
index 827d75073879..861657897c0f 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
@@ -723,3 +723,47 @@ int intel_guc_allocate_and_map_vma(struct intel_guc *guc, u32 size,
 
 	return 0;
 }
+
+/**
+ * intel_guc_load_status - dump information about GuC load status
+ * @guc: the GuC
+ * @p: the &drm_printer
+ *
+ * Pretty printer for GuC load status.
+ */
+void intel_guc_load_status(struct intel_guc *guc, struct drm_printer *p)
+{
+	struct intel_gt *gt = guc_to_gt(guc);
+	struct intel_uncore *uncore = gt->uncore;
+	intel_wakeref_t wakeref;
+
+	if (!intel_guc_is_supported(guc)) {
+		drm_printf(p, "GuC not supported\n");
+		return;
+	}
+
+	if (!intel_guc_is_wanted(guc)) {
+		drm_printf(p, "GuC disabled\n");
+		return;
+	}
+
+	intel_uc_fw_dump(&guc->fw, p);
+
+	with_intel_runtime_pm(uncore->rpm, wakeref) {
+		u32 status = intel_uncore_read(uncore, GUC_STATUS);
+		u32 i;
+
+		drm_printf(p, "\nGuC status 0x%08x:\n", status);
+		drm_printf(p, "\tBootrom status = 0x%x\n",
+			   (status & GS_BOOTROM_MASK) >> GS_BOOTROM_SHIFT);
+		drm_printf(p, "\tuKernel status = 0x%x\n",
+			   (status & GS_UKERNEL_MASK) >> GS_UKERNEL_SHIFT);
+		drm_printf(p, "\tMIA Core status = 0x%x\n",
+			   (status & GS_MIA_MASK) >> GS_MIA_SHIFT);
+		drm_puts(p, "\nScratch registers:\n");
+		for (i = 0; i < 16; i++) {
+			drm_printf(p, "\t%2d: \t0x%x\n",
+				   i, intel_uncore_read(uncore, SOFT_SCRATCH(i)));
+		}
+	}
+}
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
index 4594ccbeaa34..a5d7a86be4cf 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
@@ -190,4 +190,6 @@ static inline void intel_guc_disable_msg(struct intel_guc *guc, u32 mask)
 int intel_guc_reset_engine(struct intel_guc *guc,
 			   struct intel_engine_cs *engine);
 
+void intel_guc_load_status(struct intel_guc *guc, struct drm_printer *p);
+
 #endif
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
index caed0d57e704..8cdd6dc3df58 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
@@ -672,3 +672,95 @@ void intel_guc_log_handle_flush_event(struct intel_guc_log *log)
 {
 	queue_work(system_highpri_wq, &log->relay.flush_work);
 }
+
+static const char *
+stringify_guc_log_type(enum guc_log_buffer_type type)
+{
+	switch (type) {
+	case GUC_ISR_LOG_BUFFER:
+		return "ISR";
+	case GUC_DPC_LOG_BUFFER:
+		return "DPC";
+	case GUC_CRASH_DUMP_LOG_BUFFER:
+		return "CRASH";
+	default:
+		MISSING_CASE(type);
+	}
+
+	return "";
+}
+
+/**
+ * intel_guc_log_info - dump information about GuC log relay
+ * @guc: the GuC
+ * @p: the &drm_printer
+ *
+ * Pretty printer for GuC log info
+ */
+void intel_guc_log_info(struct intel_guc_log *log, struct drm_printer *p)
+{
+	enum guc_log_buffer_type type;
+
+	if (!intel_guc_log_relay_created(log)) {
+		drm_puts(p, "GuC log relay not created\n");
+		return;
+	}
+
+	drm_puts(p, "GuC logging stats:\n");
+
+	drm_printf(p, "\tRelay full count: %u\n", log->relay.full_count);
+
+	for (type = GUC_ISR_LOG_BUFFER; type < GUC_MAX_LOG_BUFFER; type++) {
+		drm_printf(p, "\t%s:\tflush count %10u, overflow count %10u\n",
+			   stringify_guc_log_type(type),
+			   log->stats[type].flush,
+			   log->stats[type].sampled_overflow);
+	}
+}
+
+/**
+ * intel_guc_log_dump - dump the contents of the GuC log
+ * @log: the GuC log
+ * @p: the &drm_printer
+ * @dump_load_err: dump the log saved on GuC load error
+ *
+ * Pretty printer for the GuC log
+ */
+int intel_guc_log_dump(struct intel_guc_log *log, struct drm_printer *p,
+		       bool dump_load_err)
+{
+	struct intel_guc *guc = log_to_guc(log);
+	struct intel_uc *uc = container_of(guc, struct intel_uc, guc);
+	struct drm_i915_gem_object *obj = NULL;
+	u32 *map;
+	int i = 0;
+
+	if (!intel_guc_is_supported(guc))
+		return -ENODEV;
+
+	if (dump_load_err)
+		obj = uc->load_err_log;
+	else if (guc->log.vma)
+		obj = guc->log.vma->obj;
+
+	if (!obj)
+		return 0;
+
+	map = i915_gem_object_pin_map(obj, I915_MAP_WC);
+	if (IS_ERR(map)) {
+		DRM_DEBUG("Failed to pin object\n");
+		drm_puts(p, "(log data unaccessible)\n");
+		return PTR_ERR(map);
+	}
+
+	for (i = 0; i < obj->base.size / sizeof(u32); i += 4)
+		drm_printf(p, "0x%08x 0x%08x 0x%08x 0x%08x\n",
+			   *(map + i), *(map + i + 1),
+			   *(map + i + 2), *(map + i + 3));
+
+	drm_puts(p, "\n");
+
+	i915_gem_object_unpin_map(obj);
+
+	return 0;
+}
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
index c252c022c5fc..11fccd0b2294 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
@@ -79,4 +79,8 @@ static inline u32 intel_guc_log_get_level(struct intel_guc_log *log)
 	return log->level;
 }
 
+void intel_guc_log_info(struct intel_guc_log *log, struct drm_printer *p);
+int intel_guc_log_dump(struct intel_guc_log *log, struct drm_printer *p,
+		       bool dump_load_err);
+
 #endif
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.c b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
index d73dc21686e7..d6097b46600c 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_huc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
@@ -218,3 +218,32 @@ int intel_huc_check_status(struct intel_huc *huc)
 
 	return (status & huc->status.mask) == huc->status.value;
 }
+
+/**
+ * intel_huc_load_status - dump information about HuC load status
+ * @huc: the HuC
+ * @p: the &drm_printer
+ *
+ * Pretty printer for HuC load status.
+ */
+void intel_huc_load_status(struct intel_huc *huc, struct drm_printer *p)
+{
+	struct intel_gt *gt = huc_to_gt(huc);
+	intel_wakeref_t wakeref;
+
+	if (!intel_huc_is_supported(huc)) {
+		drm_printf(p, "HuC not supported\n");
+		return;
+	}
+
+	if (!intel_huc_is_wanted(huc)) {
+		drm_printf(p, "HuC disabled\n");
+		return;
+	}
+
+	intel_uc_fw_dump(&huc->fw, p);
+
+	with_intel_runtime_pm(gt->uncore->rpm, wakeref)
+		drm_printf(p, "\nHuC status 0x%08x:\n",
+			   intel_uncore_read(gt->uncore, HUC_STATUS2));
+}
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.h b/drivers/gpu/drm/i915/gt/uc/intel_huc.h
index a40b9cfc6c22..daee43b661d4 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_huc.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.h
@@ -57,4 +57,6 @@ static inline bool intel_huc_is_authenticated(struct intel_huc *huc)
 	return intel_uc_fw_is_running(&huc->fw);
 }
 
+void intel_huc_load_status(struct intel_huc *huc, struct drm_printer *p);
+
 #endif
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index de94fcd2032b..56504be2a6ec 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1251,105 +1251,32 @@ static int i915_llc(struct seq_file *m, void *data)
 	return 0;
 }
 
-static int i915_huc_load_status_info(struct seq_file *m, void *data)
+static int i915_huc_info(struct seq_file *m, void *data)
 {
 	struct drm_i915_private *dev_priv = node_to_i915(m->private);
-	intel_wakeref_t wakeref;
-	struct drm_printer p;
-
-	if (!HAS_GT_UC(dev_priv))
-		return -ENODEV;
-
-	p = drm_seq_file_printer(m);
-	intel_uc_fw_dump(&dev_priv->gt.uc.huc.fw, &p);
-
-	with_intel_runtime_pm(&dev_priv->runtime_pm, wakeref)
-		seq_printf(m, "\nHuC status 0x%08x:\n", I915_READ(HUC_STATUS2));
-
-	return 0;
-}
-
-static int i915_guc_load_status_info(struct seq_file *m, void *data)
-{
-	struct drm_i915_private *dev_priv = node_to_i915(m->private);
-	intel_wakeref_t wakeref;
-	struct drm_printer p;
+	struct intel_huc *huc = &dev_priv->gt.uc.huc;
+	struct drm_printer p = drm_seq_file_printer(m);
 
-	if (!HAS_GT_UC(dev_priv))
+	if (!intel_huc_is_supported(huc))
 		return -ENODEV;
 
-	p = drm_seq_file_printer(m);
-	intel_uc_fw_dump(&dev_priv->gt.uc.guc.fw, &p);
-
-	with_intel_runtime_pm(&dev_priv->runtime_pm, wakeref) {
-		u32 tmp = I915_READ(GUC_STATUS);
-		u32 i;
-
-		seq_printf(m, "\nGuC status 0x%08x:\n", tmp);
-		seq_printf(m, "\tBootrom status = 0x%x\n",
-			   (tmp & GS_BOOTROM_MASK) >> GS_BOOTROM_SHIFT);
-		seq_printf(m, "\tuKernel status = 0x%x\n",
-			   (tmp & GS_UKERNEL_MASK) >> GS_UKERNEL_SHIFT);
-		seq_printf(m, "\tMIA Core status = 0x%x\n",
-			   (tmp & GS_MIA_MASK) >> GS_MIA_SHIFT);
-		seq_puts(m, "\nScratch registers:\n");
-		for (i = 0; i < 16; i++) {
-			seq_printf(m, "\t%2d: \t0x%x\n",
-				   i, I915_READ(SOFT_SCRATCH(i)));
-		}
-	}
+	intel_huc_load_status(huc, &p);
 
 	return 0;
 }
 
-static const char *
-stringify_guc_log_type(enum guc_log_buffer_type type)
-{
-	switch (type) {
-	case GUC_ISR_LOG_BUFFER:
-		return "ISR";
-	case GUC_DPC_LOG_BUFFER:
-		return "DPC";
-	case GUC_CRASH_DUMP_LOG_BUFFER:
-		return "CRASH";
-	default:
-		MISSING_CASE(type);
-	}
-
-	return "";
-}
-
-static void i915_guc_log_info(struct seq_file *m, struct intel_guc_log *log)
-{
-	enum guc_log_buffer_type type;
-
-	if (!intel_guc_log_relay_created(log)) {
-		seq_puts(m, "GuC log relay not created\n");
-		return;
-	}
-
-	seq_puts(m, "GuC logging stats:\n");
-
-	seq_printf(m, "\tRelay full count: %u\n",
-		   log->relay.full_count);
-
-	for (type = GUC_ISR_LOG_BUFFER; type < GUC_MAX_LOG_BUFFER; type++) {
-		seq_printf(m, "\t%s:\tflush count %10u, overflow count %10u\n",
-			   stringify_guc_log_type(type),
-			   log->stats[type].flush,
-			   log->stats[type].sampled_overflow);
-	}
-}
-
 static int i915_guc_info(struct seq_file *m, void *data)
 {
 	struct drm_i915_private *dev_priv = node_to_i915(m->private);
-	struct intel_uc *uc = &dev_priv->gt.uc;
+	struct intel_guc *guc = &dev_priv->gt.uc.guc;
+	struct drm_printer p = drm_seq_file_printer(m);
 
-	if (!intel_uc_uses_guc(uc))
+	if (!intel_guc_is_supported(guc))
 		return -ENODEV;
 
-	i915_guc_log_info(m, &uc->guc.log);
+	intel_guc_load_status(guc, &p);
+	drm_puts(&p, "\n");
+	intel_guc_log_info(&guc->log, &p);
 
 	/* Add more as required ... */
 
@@ -1360,39 +1287,14 @@ static int i915_guc_log_dump(struct seq_file *m, void *data)
 {
 	struct drm_info_node *node = m->private;
 	struct drm_i915_private *dev_priv = node_to_i915(node);
+	struct intel_guc *guc = &dev_priv->gt.uc.guc;
 	bool dump_load_err = !!node->info_ent->data;
-	struct drm_i915_gem_object *obj = NULL;
-	u32 *log;
-	int i = 0;
+	struct drm_printer p = drm_seq_file_printer(m);
 
-	if (!HAS_GT_UC(dev_priv))
+	if (!intel_guc_is_supported(guc))
 		return -ENODEV;
 
-	if (dump_load_err)
-		obj = dev_priv->gt.uc.load_err_log;
-	else if (dev_priv->gt.uc.guc.log.vma)
-		obj = dev_priv->gt.uc.guc.log.vma->obj;
-
-	if (!obj)
-		return 0;
-
-	log = i915_gem_object_pin_map(obj, I915_MAP_WC);
-	if (IS_ERR(log)) {
-		DRM_DEBUG("Failed to pin object\n");
-		seq_puts(m, "(log data unaccessible)\n");
-		return PTR_ERR(log);
-	}
-
-	for (i = 0; i < obj->base.size / sizeof(u32); i += 4)
-		seq_printf(m, "0x%08x 0x%08x 0x%08x 0x%08x\n",
-			   *(log + i), *(log + i + 1),
-			   *(log + i + 2), *(log + i + 3));
-
-	seq_putc(m, '\n');
-
-	i915_gem_object_unpin_map(obj);
-
-	return 0;
+	return intel_guc_log_dump(&guc->log, &p, dump_load_err);
 }
 
 static int i915_guc_log_level_get(void *data, u64 *val)
@@ -2088,10 +1990,9 @@ static const struct drm_info_list i915_debugfs_list[] = {
 	{"i915_gem_fence_regs", i915_gem_fence_regs_info, 0},
 	{"i915_gem_interrupt", i915_interrupt_info, 0},
 	{"i915_guc_info", i915_guc_info, 0},
-	{"i915_guc_load_status", i915_guc_load_status_info, 0},
 	{"i915_guc_log_dump", i915_guc_log_dump, 0},
 	{"i915_guc_load_err_log_dump", i915_guc_log_dump, 0, (void *)1},
-	{"i915_huc_load_status", i915_huc_load_status_info, 0},
+	{"i915_huc_info", i915_huc_info, 0},
 	{"i915_frequency_info", i915_frequency_info, 0},
 	{"i915_ring_freq_table", i915_ring_freq_table, 0},
 	{"i915_context_status", i915_context_status, 0},
-- 
2.24.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Intel-gfx] [PATCH v2 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT
  2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
                   ` (3 preceding siblings ...)
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 4/6] drm/i915/debugfs: move uC printers and update debugfs file names Daniele Ceraolo Spurio
@ 2020-03-12  1:16 ` Daniele Ceraolo Spurio
  2020-03-12  9:10   ` Jani Nikula
                     ` (2 more replies)
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 6/6] drm/i915/uc: do not free err log on uc_fini Daniele Ceraolo Spurio
                   ` (5 subsequent siblings)
  10 siblings, 3 replies; 25+ messages in thread
From: Daniele Ceraolo Spurio @ 2020-03-12  1:16 UTC (permalink / raw)
  To: intel-gfx

uC is a component of the GT, so it makes sense for the uC debugfs files
to be in the GT folder. A subfolder has been used to keep the same
structure we have for the code.

v2: use intel_* prefix (Jani), rebase on new gt_debugfs_register_files,
    fix permissions for writable debugfs files.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Andi Shyti <andi.shyti@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Tony Ye <tony.ye@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
---
 drivers/gpu/drm/i915/Makefile                |   7 +-
 drivers/gpu/drm/i915/gt/debugfs_gt.c         |   6 +-
 drivers/gpu/drm/i915/gt/uc/debugfs_guc.c     |  42 ++++++
 drivers/gpu/drm/i915/gt/uc/debugfs_guc.h     |  14 ++
 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c | 124 +++++++++++++++++
 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h |  15 ++
 drivers/gpu/drm/i915/gt/uc/debugfs_huc.c     |  36 +++++
 drivers/gpu/drm/i915/gt/uc/debugfs_huc.h     |  14 ++
 drivers/gpu/drm/i915/gt/uc/debugfs_uc.c      |  31 +++++
 drivers/gpu/drm/i915/gt/uc/debugfs_uc.h      |  14 ++
 drivers/gpu/drm/i915/gt/uc/intel_guc.h       |   5 +
 drivers/gpu/drm/i915/gt/uc/intel_guc_log.c   |   5 -
 drivers/gpu/drm/i915/i915_debugfs.c          | 137 -------------------
 13 files changed, 306 insertions(+), 144 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc.c
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc.h
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_huc.c
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_huc.h
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_uc.c
 create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_uc.h

diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index 9f887a86e555..f862ac6615d8 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -166,7 +166,12 @@ i915-y += \
 	  intel_wopcm.o
 
 # general-purpose microcontroller (GuC) support
-i915-y += gt/uc/intel_uc.o \
+i915-y += \
+	  gt/uc/debugfs_guc.o \
+	  gt/uc/debugfs_guc_log.o \
+	  gt/uc/debugfs_huc.o \
+	  gt/uc/debugfs_uc.o \
+	  gt/uc/intel_uc.o \
 	  gt/uc/intel_uc_fw.o \
 	  gt/uc/intel_guc.o \
 	  gt/uc/intel_guc_ads.o \
diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt.c b/drivers/gpu/drm/i915/gt/debugfs_gt.c
index de73b63d6ba7..fcbc57e226c3 100644
--- a/drivers/gpu/drm/i915/gt/debugfs_gt.c
+++ b/drivers/gpu/drm/i915/gt/debugfs_gt.c
@@ -9,6 +9,7 @@
 #include "debugfs_engines.h"
 #include "debugfs_gt.h"
 #include "debugfs_gt_pm.h"
+#include "uc/debugfs_uc.h"
 #include "i915_drv.h"
 
 void debugfs_gt_register(struct intel_gt *gt)
@@ -24,6 +25,8 @@ void debugfs_gt_register(struct intel_gt *gt)
 
 	debugfs_engines_register(gt, root);
 	debugfs_gt_pm_register(gt, root);
+
+	intel_uc_debugfs_register(&gt->uc, root);
 }
 
 void intel_gt_debugfs_register_files(struct dentry *root,
@@ -31,9 +34,10 @@ void intel_gt_debugfs_register_files(struct dentry *root,
 				     unsigned long count, void *data)
 {
 	while (count--) {
+		umode_t mode = files->fops->write ? 0644 : 0444;
 		if (!files->eval || files->eval(data))
 			debugfs_create_file(files->name,
-					    0444, root, data,
+					    mode, root, data,
 					    files->fops);
 
 		files++;
diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc.c b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.c
new file mode 100644
index 000000000000..4506b52a61f2
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.c
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: MIT
+
+/*
+ * Copyright © 2020 Intel Corporation
+ */
+
+#include <drm/drm_print.h>
+
+#include "gt/debugfs_gt.h"
+#include "debugfs_guc_log.h"
+#include "intel_guc.h"
+
+static int guc_info_show(struct seq_file *m, void *data)
+{
+	struct intel_guc *guc = m->private;
+	struct drm_printer p = drm_seq_file_printer(m);
+
+	if (!intel_guc_is_supported(guc))
+		return -ENODEV;
+
+	intel_guc_load_status(guc, &p);
+	drm_puts(&p, "\n");
+	intel_guc_log_info(&guc->log, &p);
+
+	/* Add more as required ... */
+
+	return 0;
+}
+DEFINE_GT_DEBUGFS_ATTRIBUTE(guc_info);
+
+void intel_guc_debugfs_register(struct intel_guc *guc, struct dentry *root)
+{
+	static const struct debugfs_gt_file files[] = {
+		{ "guc_info", &guc_info_fops, NULL },
+	};
+
+	if (!intel_guc_is_supported(guc))
+		return;
+
+	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), guc);
+	intel_guc_log_debugfs_register(&guc->log, root);
+}
diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc.h b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.h
new file mode 100644
index 000000000000..424c26665cf1
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2020 Intel Corporation
+ */
+
+#ifndef DEBUGFS_GUC_H
+#define DEBUGFS_GUC_H
+
+struct intel_guc;
+struct dentry;
+
+void intel_guc_debugfs_register(struct intel_guc *guc, struct dentry *root);
+
+#endif /* DEBUGFS_GUC_H */
diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c
new file mode 100644
index 000000000000..8bc2922915f4
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c
@@ -0,0 +1,124 @@
+// SPDX-License-Identifier: MIT
+
+/*
+ * Copyright © 2020 Intel Corporation
+ */
+
+#include <linux/fs.h>
+#include <drm/drm_print.h>
+
+#include "gt/debugfs_gt.h"
+#include "intel_guc.h"
+#include "intel_guc_log.h"
+
+static int guc_log_dump_show(struct seq_file *m, void *data)
+{
+	struct drm_printer p = drm_seq_file_printer(m);
+
+	return intel_guc_log_dump(m->private, &p, false);
+}
+DEFINE_GT_DEBUGFS_ATTRIBUTE(guc_log_dump);
+
+static int guc_load_err_log_dump_show(struct seq_file *m, void *data)
+{
+	struct drm_printer p = drm_seq_file_printer(m);
+
+	return intel_guc_log_dump(m->private, &p, true);
+}
+DEFINE_GT_DEBUGFS_ATTRIBUTE(guc_load_err_log_dump);
+
+static int guc_log_level_get(void *data, u64 *val)
+{
+	struct intel_guc_log *log = data;
+
+	if (!intel_guc_is_used(log_to_guc(log)))
+		return -ENODEV;
+
+	*val = intel_guc_log_get_level(log);
+
+	return 0;
+}
+
+static int guc_log_level_set(void *data, u64 val)
+{
+	struct intel_guc_log *log = data;
+
+	if (!intel_guc_is_used(log_to_guc(log)))
+		return -ENODEV;
+
+	return intel_guc_log_set_level(log, val);
+}
+
+DEFINE_SIMPLE_ATTRIBUTE(guc_log_level_fops,
+			guc_log_level_get, guc_log_level_set,
+			"%lld\n");
+
+static int guc_log_relay_open(struct inode *inode, struct file *file)
+{
+	struct intel_guc_log *log = inode->i_private;
+
+	if (!intel_guc_is_ready(log_to_guc(log)))
+		return -ENODEV;
+
+	file->private_data = log;
+
+	return intel_guc_log_relay_open(log);
+}
+
+static ssize_t
+guc_log_relay_write(struct file *filp,
+		    const char __user *ubuf,
+		    size_t cnt,
+		    loff_t *ppos)
+{
+	struct intel_guc_log *log = filp->private_data;
+	int val;
+	int ret;
+
+	ret = kstrtoint_from_user(ubuf, cnt, 0, &val);
+	if (ret < 0)
+		return ret;
+
+	/*
+	 * Enable and start the guc log relay on value of 1.
+	 * Flush log relay for any other value.
+	 */
+	if (val == 1)
+		ret = intel_guc_log_relay_start(log);
+	else
+		intel_guc_log_relay_flush(log);
+
+	return ret ?: cnt;
+}
+
+static int guc_log_relay_release(struct inode *inode, struct file *file)
+{
+	struct intel_guc_log *log = inode->i_private;
+
+	intel_guc_log_relay_close(log);
+	return 0;
+}
+
+static const struct file_operations guc_log_relay_fops = {
+	.owner = THIS_MODULE,
+	.open = guc_log_relay_open,
+	.write = guc_log_relay_write,
+	.release = guc_log_relay_release,
+};
+
+void intel_guc_log_debugfs_register(struct intel_guc_log *log,
+				    struct dentry *root)
+{
+	static const struct debugfs_gt_file files[] = {
+		{ "guc_log_dump", &guc_log_dump_fops, NULL },
+		{ "guc_load_err_log_dump", &guc_load_err_log_dump_fops, NULL },
+		{ "guc_log_level", &guc_log_level_fops, NULL },
+		{ "guc_log_relay", &guc_log_relay_fops, NULL },
+	};
+
+	if (!intel_guc_is_supported(log_to_guc(log)))
+		return;
+
+	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), log);
+}
+
diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h
new file mode 100644
index 000000000000..e8900e3d74ea
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2020 Intel Corporation
+ */
+
+#ifndef DEBUGFS_GUC_LOG_H
+#define DEBUGFS_GUC_LOG_H
+
+struct intel_guc_log;
+struct dentry;
+
+void intel_guc_log_debugfs_register(struct intel_guc_log *log,
+				    struct dentry *root);
+
+#endif /* DEBUGFS_GUC_LOG_H */
diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_huc.c b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.c
new file mode 100644
index 000000000000..497e4c693f83
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.c
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: MIT
+
+/*
+ * Copyright © 2020 Intel Corporation
+ */
+
+#include <drm/drm_print.h>
+
+#include "gt/debugfs_gt.h"
+#include "intel_huc.h"
+
+static int huc_info_show(struct seq_file *m, void *data)
+{
+	struct intel_huc *huc = m->private;
+	struct drm_printer p = drm_seq_file_printer(m);
+
+	if (!intel_huc_is_supported(huc))
+		return -ENODEV;
+
+	intel_huc_load_status(huc, &p);
+
+	return 0;
+}
+DEFINE_GT_DEBUGFS_ATTRIBUTE(huc_info);
+
+void intel_huc_debugfs_register(struct intel_huc *huc, struct dentry *root)
+{
+	static const struct debugfs_gt_file files[] = {
+		{ "huc_info", &huc_info_fops, NULL },
+	};
+
+	if (!intel_huc_is_supported(huc))
+		return;
+
+	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), huc);
+}
diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_huc.h b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.h
new file mode 100644
index 000000000000..be79e992f976
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2020 Intel Corporation
+ */
+
+#ifndef DEBUGFS_HUC_H
+#define DEBUGFS_HUC_H
+
+struct intel_huc;
+struct dentry;
+
+void intel_huc_debugfs_register(struct intel_huc *huc, struct dentry *root);
+
+#endif /* DEBUGFS_HUC_H */
diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_uc.c b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.c
new file mode 100644
index 000000000000..fd18347f8d1c
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.c
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: MIT
+
+/*
+ * Copyright © 2020 Intel Corporation
+ */
+
+#include <linux/debugfs.h>
+
+#include "debugfs_guc.h"
+#include "debugfs_huc.h"
+#include "debugfs_uc.h"
+#include "intel_uc.h"
+
+void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root)
+{
+	struct dentry *root;
+
+	if (!gt_root)
+		return;
+
+	/* GuC and HuC go always in pair, no need to check both */
+	if (!intel_uc_supports_guc(uc))
+		return;
+
+	root = debugfs_create_dir("uc", gt_root);
+	if (IS_ERR(root))
+		return;
+
+	intel_guc_debugfs_register(&uc->guc, root);
+	intel_huc_debugfs_register(&uc->huc, root);
+}
diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_uc.h b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.h
new file mode 100644
index 000000000000..010ce250d223
--- /dev/null
+++ b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2020 Intel Corporation
+ */
+
+#ifndef DEBUGFS_UC_H
+#define DEBUGFS_UC_H
+
+struct intel_uc;
+struct dentry;
+
+void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root);
+
+#endif /* DEBUGFS_UC_H */
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
index a5d7a86be4cf..e84ab67b317d 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
@@ -74,6 +74,11 @@ struct intel_guc {
 	struct mutex send_mutex;
 };
 
+static inline struct intel_guc *log_to_guc(struct intel_guc_log *log)
+{
+	return container_of(log, struct intel_guc, log);
+}
+
 static
 inline int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len)
 {
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
index 8cdd6dc3df58..5b11a6d8e27f 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
@@ -55,11 +55,6 @@ static int guc_action_control_log(struct intel_guc *guc, bool enable,
 	return intel_guc_send(guc, action, ARRAY_SIZE(action));
 }
 
-static inline struct intel_guc *log_to_guc(struct intel_guc_log *log)
-{
-	return container_of(log, struct intel_guc, log);
-}
-
 static void guc_log_enable_flush_events(struct intel_guc_log *log)
 {
 	intel_guc_enable_msg(log_to_guc(log),
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 56504be2a6ec..e60a5750ea44 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -37,7 +37,6 @@
 #include "gt/intel_reset.h"
 #include "gt/intel_rc6.h"
 #include "gt/intel_rps.h"
-#include "gt/uc/intel_guc_submission.h"
 
 #include "i915_debugfs.h"
 #include "i915_debugfs_params.h"
@@ -1251,136 +1250,6 @@ static int i915_llc(struct seq_file *m, void *data)
 	return 0;
 }
 
-static int i915_huc_info(struct seq_file *m, void *data)
-{
-	struct drm_i915_private *dev_priv = node_to_i915(m->private);
-	struct intel_huc *huc = &dev_priv->gt.uc.huc;
-	struct drm_printer p = drm_seq_file_printer(m);
-
-	if (!intel_huc_is_supported(huc))
-		return -ENODEV;
-
-	intel_huc_load_status(huc, &p);
-
-	return 0;
-}
-
-static int i915_guc_info(struct seq_file *m, void *data)
-{
-	struct drm_i915_private *dev_priv = node_to_i915(m->private);
-	struct intel_guc *guc = &dev_priv->gt.uc.guc;
-	struct drm_printer p = drm_seq_file_printer(m);
-
-	if (!intel_guc_is_supported(guc))
-		return -ENODEV;
-
-	intel_guc_load_status(guc, &p);
-	drm_puts(&p, "\n");
-	intel_guc_log_info(&guc->log, &p);
-
-	/* Add more as required ... */
-
-	return 0;
-}
-
-static int i915_guc_log_dump(struct seq_file *m, void *data)
-{
-	struct drm_info_node *node = m->private;
-	struct drm_i915_private *dev_priv = node_to_i915(node);
-	struct intel_guc *guc = &dev_priv->gt.uc.guc;
-	bool dump_load_err = !!node->info_ent->data;
-	struct drm_printer p = drm_seq_file_printer(m);
-
-	if (!intel_guc_is_supported(guc))
-		return -ENODEV;
-
-	return intel_guc_log_dump(&guc->log, &p, dump_load_err);
-}
-
-static int i915_guc_log_level_get(void *data, u64 *val)
-{
-	struct drm_i915_private *dev_priv = data;
-	struct intel_uc *uc = &dev_priv->gt.uc;
-
-	if (!intel_uc_uses_guc(uc))
-		return -ENODEV;
-
-	*val = intel_guc_log_get_level(&uc->guc.log);
-
-	return 0;
-}
-
-static int i915_guc_log_level_set(void *data, u64 val)
-{
-	struct drm_i915_private *dev_priv = data;
-	struct intel_uc *uc = &dev_priv->gt.uc;
-
-	if (!intel_uc_uses_guc(uc))
-		return -ENODEV;
-
-	return intel_guc_log_set_level(&uc->guc.log, val);
-}
-
-DEFINE_SIMPLE_ATTRIBUTE(i915_guc_log_level_fops,
-			i915_guc_log_level_get, i915_guc_log_level_set,
-			"%lld\n");
-
-static int i915_guc_log_relay_open(struct inode *inode, struct file *file)
-{
-	struct drm_i915_private *i915 = inode->i_private;
-	struct intel_guc *guc = &i915->gt.uc.guc;
-	struct intel_guc_log *log = &guc->log;
-
-	if (!intel_guc_is_ready(guc))
-		return -ENODEV;
-
-	file->private_data = log;
-
-	return intel_guc_log_relay_open(log);
-}
-
-static ssize_t
-i915_guc_log_relay_write(struct file *filp,
-			 const char __user *ubuf,
-			 size_t cnt,
-			 loff_t *ppos)
-{
-	struct intel_guc_log *log = filp->private_data;
-	int val;
-	int ret;
-
-	ret = kstrtoint_from_user(ubuf, cnt, 0, &val);
-	if (ret < 0)
-		return ret;
-
-	/*
-	 * Enable and start the guc log relay on value of 1.
-	 * Flush log relay for any other value.
-	 */
-	if (val == 1)
-		ret = intel_guc_log_relay_start(log);
-	else
-		intel_guc_log_relay_flush(log);
-
-	return ret ?: cnt;
-}
-
-static int i915_guc_log_relay_release(struct inode *inode, struct file *file)
-{
-	struct drm_i915_private *i915 = inode->i_private;
-	struct intel_guc *guc = &i915->gt.uc.guc;
-
-	intel_guc_log_relay_close(&guc->log);
-	return 0;
-}
-
-static const struct file_operations i915_guc_log_relay_fops = {
-	.owner = THIS_MODULE,
-	.open = i915_guc_log_relay_open,
-	.write = i915_guc_log_relay_write,
-	.release = i915_guc_log_relay_release,
-};
-
 static int i915_runtime_pm_status(struct seq_file *m, void *unused)
 {
 	struct drm_i915_private *dev_priv = node_to_i915(m->private);
@@ -1989,10 +1858,6 @@ static const struct drm_info_list i915_debugfs_list[] = {
 	{"i915_gem_objects", i915_gem_object_info, 0},
 	{"i915_gem_fence_regs", i915_gem_fence_regs_info, 0},
 	{"i915_gem_interrupt", i915_interrupt_info, 0},
-	{"i915_guc_info", i915_guc_info, 0},
-	{"i915_guc_log_dump", i915_guc_log_dump, 0},
-	{"i915_guc_load_err_log_dump", i915_guc_log_dump, 0, (void *)1},
-	{"i915_huc_info", i915_huc_info, 0},
 	{"i915_frequency_info", i915_frequency_info, 0},
 	{"i915_ring_freq_table", i915_ring_freq_table, 0},
 	{"i915_context_status", i915_context_status, 0},
@@ -2020,8 +1885,6 @@ static const struct i915_debugfs_files {
 	{"i915_error_state", &i915_error_state_fops},
 	{"i915_gpu_info", &i915_gpu_info_fops},
 #endif
-	{"i915_guc_log_level", &i915_guc_log_level_fops},
-	{"i915_guc_log_relay", &i915_guc_log_relay_fops},
 };
 
 int i915_debugfs_register(struct drm_i915_private *dev_priv)
-- 
2.24.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Intel-gfx] [PATCH v2 6/6] drm/i915/uc: do not free err log on uc_fini
  2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
                   ` (4 preceding siblings ...)
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT Daniele Ceraolo Spurio
@ 2020-03-12  1:16 ` Daniele Ceraolo Spurio
  2020-03-25 17:58   ` John Harrison
  2020-03-12  4:10 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Re-org uC debugfs files and move them under GT (rev2) Patchwork
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Daniele Ceraolo Spurio @ 2020-03-12  1:16 UTC (permalink / raw)
  To: intel-gfx

we do call uc_fini if there is an issue while loading the GuC, so we
can't delete in there the logs we need to debug the load failure.
Moving the log free to driver remove ensures the logs stick around ong
enough for us to dump them.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt.c    | 3 +--
 drivers/gpu/drm/i915/gt/uc/intel_uc.c | 9 +++++++--
 drivers/gpu/drm/i915/gt/uc/intel_uc.h | 1 +
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
index 3dea8881e915..eda66b0d44bd 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt.c
@@ -635,8 +635,7 @@ void intel_gt_driver_remove(struct intel_gt *gt)
 {
 	__intel_gt_disable(gt);
 
-	intel_uc_fini_hw(&gt->uc);
-	intel_uc_fini(&gt->uc);
+	intel_uc_driver_remove(&gt->uc);
 
 	intel_engines_release(gt);
 }
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
index a4cbe06e06bd..b11e564ef22e 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
@@ -131,6 +131,13 @@ static void __uc_free_load_err_log(struct intel_uc *uc)
 		i915_gem_object_put(log);
 }
 
+void intel_uc_driver_remove(struct intel_uc *uc)
+{
+	intel_uc_fini_hw(uc);
+	intel_uc_fini(uc);
+	__uc_free_load_err_log(uc);
+}
+
 static inline bool guc_communication_enabled(struct intel_guc *guc)
 {
 	return intel_guc_ct_enabled(&guc->ct);
@@ -311,8 +318,6 @@ static void __uc_fini(struct intel_uc *uc)
 {
 	intel_huc_fini(&uc->huc);
 	intel_guc_fini(&uc->guc);
-
-	__uc_free_load_err_log(uc);
 }
 
 static int __uc_sanitize(struct intel_uc *uc)
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.h b/drivers/gpu/drm/i915/gt/uc/intel_uc.h
index 5ae7b50b7dc1..9c954c589edf 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.h
@@ -34,6 +34,7 @@ struct intel_uc {
 
 void intel_uc_init_early(struct intel_uc *uc);
 void intel_uc_driver_late_release(struct intel_uc *uc);
+void intel_uc_driver_remove(struct intel_uc *uc);
 void intel_uc_init_mmio(struct intel_uc *uc);
 void intel_uc_reset_prepare(struct intel_uc *uc);
 void intel_uc_suspend(struct intel_uc *uc);
-- 
2.24.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Re-org uC debugfs files and move them under GT (rev2)
  2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
                   ` (5 preceding siblings ...)
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 6/6] drm/i915/uc: do not free err log on uc_fini Daniele Ceraolo Spurio
@ 2020-03-12  4:10 ` Patchwork
  2020-03-12  4:14 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2020-03-12  4:10 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio; +Cc: intel-gfx

== Series Details ==

Series: Re-org uC debugfs files and move them under GT (rev2)
URL   : https://patchwork.freedesktop.org/series/74051/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
aafc4bae71e6 drm/i915/gt: allow setting generic data pointer
c507de64233a drm/i915/guc: drop stage_pool debugfs
e2f026753f0c drm/i915/huc: make "support huc" reflect HW capabilities
eb62f33d1e3e drm/i915/debugfs: move uC printers and update debugfs file names
80d6283445a8 drm/i915/uc: Move uC debugfs to its own folder under GT
-:73: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#73: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 512 lines checked
740eb468d044 drm/i915/uc: do not free err log on uc_fini

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for Re-org uC debugfs files and move them under GT (rev2)
  2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
                   ` (6 preceding siblings ...)
  2020-03-12  4:10 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Re-org uC debugfs files and move them under GT (rev2) Patchwork
@ 2020-03-12  4:14 ` Patchwork
  2020-03-12  4:34 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2020-03-12  4:14 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio; +Cc: intel-gfx

== Series Details ==

Series: Re-org uC debugfs files and move them under GT (rev2)
URL   : https://patchwork.freedesktop.org/series/74051/
State : warning

== Summary ==

$ dim sparse origin/drm-tip
Sparse version: v0.6.0
Commit: drm/i915/gt: allow setting generic data pointer
Okay!

Commit: drm/i915/guc: drop stage_pool debugfs
Okay!

Commit: drm/i915/huc: make "support huc" reflect HW capabilities
Okay!

Commit: drm/i915/debugfs: move uC printers and update debugfs file names
Okay!

Commit: drm/i915/uc: Move uC debugfs to its own folder under GT
+drivers/gpu/drm/i915/gt/uc/debugfs_guc.c:31:6: warning: symbol 'intel_guc_debugfs_register' was not declared. Should it be static?
+drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c:109:6: warning: symbol 'intel_guc_log_debugfs_register' was not declared. Should it be static?
+drivers/gpu/drm/i915/gt/uc/debugfs_huc.c:26:6: warning: symbol 'intel_huc_debugfs_register' was not declared. Should it be static?

Commit: drm/i915/uc: do not free err log on uc_fini
Okay!

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Intel-gfx] ✓ Fi.CI.BAT: success for Re-org uC debugfs files and move them under GT (rev2)
  2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
                   ` (7 preceding siblings ...)
  2020-03-12  4:14 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
@ 2020-03-12  4:34 ` Patchwork
  2020-03-12 22:43 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
  2020-03-25  1:47 ` [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Andi Shyti
  10 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2020-03-12  4:34 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio; +Cc: intel-gfx

== Series Details ==

Series: Re-org uC debugfs files and move them under GT (rev2)
URL   : https://patchwork.freedesktop.org/series/74051/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8125 -> Patchwork_16944
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/index.html

Known issues
------------

  Here are the changes found in Patchwork_16944 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@blt:
    - fi-bsw-n3050:       [PASS][1] -> [INCOMPLETE][2] ([i915#392])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/fi-bsw-n3050/igt@i915_selftest@live@blt.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/fi-bsw-n3050/igt@i915_selftest@live@blt.html

  * igt@i915_selftest@live@execlists:
    - fi-bxt-dsi:         [PASS][3] -> [INCOMPLETE][4] ([fdo#103927])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/fi-bxt-dsi/igt@i915_selftest@live@execlists.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/fi-bxt-dsi/igt@i915_selftest@live@execlists.html

  * igt@i915_selftest@live@gem_contexts:
    - fi-cfl-8700k:       [PASS][5] -> [DMESG-FAIL][6] ([i915#730])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/fi-cfl-8700k/igt@i915_selftest@live@gem_contexts.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/fi-cfl-8700k/igt@i915_selftest@live@gem_contexts.html

  
#### Possible fixes ####

  * igt@i915_selftest@live@execlists:
    - fi-apl-guc:         [INCOMPLETE][7] ([fdo#103927]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/fi-apl-guc/igt@i915_selftest@live@execlists.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/fi-apl-guc/igt@i915_selftest@live@execlists.html

  * igt@i915_selftest@live@hangcheck:
    - fi-apl-guc:         [DMESG-WARN][9] ([i915#1430]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/fi-apl-guc/igt@i915_selftest@live@hangcheck.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/fi-apl-guc/igt@i915_selftest@live@hangcheck.html

  
#### Warnings ####

  * igt@gem_exec_suspend@basic-s4-devices:
    - fi-tgl-y:           [FAIL][11] ([CI#94]) -> [INCOMPLETE][12] ([CI#94] / [i915#460])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/fi-tgl-y/igt@gem_exec_suspend@basic-s4-devices.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/fi-tgl-y/igt@gem_exec_suspend@basic-s4-devices.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [FAIL][13] ([fdo#111407]) -> [FAIL][14] ([i915#323])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
  [CI#94]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/94
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
  [i915#1430]: https://gitlab.freedesktop.org/drm/intel/issues/1430
  [i915#323]: https://gitlab.freedesktop.org/drm/intel/issues/323
  [i915#392]: https://gitlab.freedesktop.org/drm/intel/issues/392
  [i915#460]: https://gitlab.freedesktop.org/drm/intel/issues/460
  [i915#730]: https://gitlab.freedesktop.org/drm/intel/issues/730


Participating hosts (46 -> 41)
------------------------------

  Additional (1): fi-skl-6770hq 
  Missing    (6): fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-bsw-kefka fi-byt-clapper 


Build changes
-------------

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_8125 -> Patchwork_16944

  CI-20190529: 20190529
  CI_DRM_8125: 8fc697c3de927ae930efead8fd43032c6e5f5094 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5505: 8973d811f3fdfb4ace4aabab2095ce0309881648 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_16944: 740eb468d0446ff06077ca885ea2ef570b737ba8 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

740eb468d044 drm/i915/uc: do not free err log on uc_fini
80d6283445a8 drm/i915/uc: Move uC debugfs to its own folder under GT
eb62f33d1e3e drm/i915/debugfs: move uC printers and update debugfs file names
e2f026753f0c drm/i915/huc: make "support huc" reflect HW capabilities
c507de64233a drm/i915/guc: drop stage_pool debugfs
aafc4bae71e6 drm/i915/gt: allow setting generic data pointer

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT Daniele Ceraolo Spurio
@ 2020-03-12  9:10   ` Jani Nikula
  2020-03-13 15:38   ` Andi Shyti
  2020-03-25 21:03   ` Daniele Ceraolo Spurio
  2 siblings, 0 replies; 25+ messages in thread
From: Jani Nikula @ 2020-03-12  9:10 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio, intel-gfx

On Wed, 11 Mar 2020, Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> wrote:
> uC is a component of the GT, so it makes sense for the uC debugfs files
> to be in the GT folder. A subfolder has been used to keep the same
> structure we have for the code.
>
> v2: use intel_* prefix (Jani), rebase on new gt_debugfs_register_files,
>     fix permissions for writable debugfs files.
>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Andi Shyti <andi.shyti@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Tony Ye <tony.ye@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/Makefile                |   7 +-
>  drivers/gpu/drm/i915/gt/debugfs_gt.c         |   6 +-
>  drivers/gpu/drm/i915/gt/uc/debugfs_guc.c     |  42 ++++++
>  drivers/gpu/drm/i915/gt/uc/debugfs_guc.h     |  14 ++
>  drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c | 124 +++++++++++++++++
>  drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h |  15 ++
>  drivers/gpu/drm/i915/gt/uc/debugfs_huc.c     |  36 +++++
>  drivers/gpu/drm/i915/gt/uc/debugfs_huc.h     |  14 ++
>  drivers/gpu/drm/i915/gt/uc/debugfs_uc.c      |  31 +++++
>  drivers/gpu/drm/i915/gt/uc/debugfs_uc.h      |  14 ++
>  drivers/gpu/drm/i915/gt/uc/intel_guc.h       |   5 +
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c   |   5 -
>  drivers/gpu/drm/i915/i915_debugfs.c          | 137 -------------------
>  13 files changed, 306 insertions(+), 144 deletions(-)
>  create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc.c
>  create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc.h
>  create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c
>  create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h
>  create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_huc.c
>  create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_huc.h
>  create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_uc.c
>  create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_uc.h
>
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index 9f887a86e555..f862ac6615d8 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -166,7 +166,12 @@ i915-y += \
>  	  intel_wopcm.o
>  
>  # general-purpose microcontroller (GuC) support
> -i915-y += gt/uc/intel_uc.o \
> +i915-y += \
> +	  gt/uc/debugfs_guc.o \
> +	  gt/uc/debugfs_guc_log.o \
> +	  gt/uc/debugfs_huc.o \
> +	  gt/uc/debugfs_uc.o \
> +	  gt/uc/intel_uc.o \
>  	  gt/uc/intel_uc_fw.o \
>  	  gt/uc/intel_guc.o \
>  	  gt/uc/intel_guc_ads.o \
> diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt.c b/drivers/gpu/drm/i915/gt/debugfs_gt.c
> index de73b63d6ba7..fcbc57e226c3 100644
> --- a/drivers/gpu/drm/i915/gt/debugfs_gt.c
> +++ b/drivers/gpu/drm/i915/gt/debugfs_gt.c
> @@ -9,6 +9,7 @@
>  #include "debugfs_engines.h"
>  #include "debugfs_gt.h"
>  #include "debugfs_gt_pm.h"
> +#include "uc/debugfs_uc.h"
>  #include "i915_drv.h"
>  
>  void debugfs_gt_register(struct intel_gt *gt)
> @@ -24,6 +25,8 @@ void debugfs_gt_register(struct intel_gt *gt)
>  
>  	debugfs_engines_register(gt, root);
>  	debugfs_gt_pm_register(gt, root);
> +
> +	intel_uc_debugfs_register(&gt->uc, root);
>  }
>  
>  void intel_gt_debugfs_register_files(struct dentry *root,
> @@ -31,9 +34,10 @@ void intel_gt_debugfs_register_files(struct dentry *root,
>  				     unsigned long count, void *data)
>  {
>  	while (count--) {
> +		umode_t mode = files->fops->write ? 0644 : 0444;
>  		if (!files->eval || files->eval(data))
>  			debugfs_create_file(files->name,
> -					    0444, root, data,
> +					    mode, root, data,
>  					    files->fops);
>  
>  		files++;
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc.c b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.c
> new file mode 100644
> index 000000000000..4506b52a61f2
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.c
> @@ -0,0 +1,42 @@
> +// SPDX-License-Identifier: MIT
> +

Unnecessary blank line, ditto for other .c files.

> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#include <drm/drm_print.h>
> +
> +#include "gt/debugfs_gt.h"
> +#include "debugfs_guc_log.h"
> +#include "intel_guc.h"
> +
> +static int guc_info_show(struct seq_file *m, void *data)
> +{
> +	struct intel_guc *guc = m->private;
> +	struct drm_printer p = drm_seq_file_printer(m);
> +
> +	if (!intel_guc_is_supported(guc))
> +		return -ENODEV;
> +
> +	intel_guc_load_status(guc, &p);
> +	drm_puts(&p, "\n");
> +	intel_guc_log_info(&guc->log, &p);
> +
> +	/* Add more as required ... */
> +
> +	return 0;
> +}
> +DEFINE_GT_DEBUGFS_ATTRIBUTE(guc_info);
> +
> +void intel_guc_debugfs_register(struct intel_guc *guc, struct dentry *root)
> +{
> +	static const struct debugfs_gt_file files[] = {
> +		{ "guc_info", &guc_info_fops, NULL },
> +	};
> +
> +	if (!intel_guc_is_supported(guc))
> +		return;
> +
> +	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), guc);
> +	intel_guc_log_debugfs_register(&guc->log, root);
> +}
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc.h b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.h
> new file mode 100644
> index 000000000000..424c26665cf1
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.h
> @@ -0,0 +1,14 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#ifndef DEBUGFS_GUC_H
> +#define DEBUGFS_GUC_H
> +
> +struct intel_guc;
> +struct dentry;
> +
> +void intel_guc_debugfs_register(struct intel_guc *guc, struct dentry *root);
> +
> +#endif /* DEBUGFS_GUC_H */
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c
> new file mode 100644
> index 000000000000..8bc2922915f4
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c
> @@ -0,0 +1,124 @@
> +// SPDX-License-Identifier: MIT
> +
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#include <linux/fs.h>
> +#include <drm/drm_print.h>
> +
> +#include "gt/debugfs_gt.h"
> +#include "intel_guc.h"
> +#include "intel_guc_log.h"
> +
> +static int guc_log_dump_show(struct seq_file *m, void *data)
> +{
> +	struct drm_printer p = drm_seq_file_printer(m);
> +
> +	return intel_guc_log_dump(m->private, &p, false);
> +}
> +DEFINE_GT_DEBUGFS_ATTRIBUTE(guc_log_dump);
> +
> +static int guc_load_err_log_dump_show(struct seq_file *m, void *data)
> +{
> +	struct drm_printer p = drm_seq_file_printer(m);
> +
> +	return intel_guc_log_dump(m->private, &p, true);
> +}
> +DEFINE_GT_DEBUGFS_ATTRIBUTE(guc_load_err_log_dump);
> +
> +static int guc_log_level_get(void *data, u64 *val)
> +{
> +	struct intel_guc_log *log = data;
> +
> +	if (!intel_guc_is_used(log_to_guc(log)))
> +		return -ENODEV;
> +
> +	*val = intel_guc_log_get_level(log);
> +
> +	return 0;
> +}
> +
> +static int guc_log_level_set(void *data, u64 val)
> +{
> +	struct intel_guc_log *log = data;
> +
> +	if (!intel_guc_is_used(log_to_guc(log)))
> +		return -ENODEV;
> +
> +	return intel_guc_log_set_level(log, val);
> +}
> +
> +DEFINE_SIMPLE_ATTRIBUTE(guc_log_level_fops,
> +			guc_log_level_get, guc_log_level_set,
> +			"%lld\n");
> +
> +static int guc_log_relay_open(struct inode *inode, struct file *file)
> +{
> +	struct intel_guc_log *log = inode->i_private;
> +
> +	if (!intel_guc_is_ready(log_to_guc(log)))
> +		return -ENODEV;
> +
> +	file->private_data = log;
> +
> +	return intel_guc_log_relay_open(log);
> +}
> +
> +static ssize_t
> +guc_log_relay_write(struct file *filp,
> +		    const char __user *ubuf,
> +		    size_t cnt,
> +		    loff_t *ppos)
> +{
> +	struct intel_guc_log *log = filp->private_data;
> +	int val;
> +	int ret;
> +
> +	ret = kstrtoint_from_user(ubuf, cnt, 0, &val);
> +	if (ret < 0)
> +		return ret;
> +
> +	/*
> +	 * Enable and start the guc log relay on value of 1.
> +	 * Flush log relay for any other value.
> +	 */
> +	if (val == 1)
> +		ret = intel_guc_log_relay_start(log);
> +	else
> +		intel_guc_log_relay_flush(log);
> +
> +	return ret ?: cnt;
> +}
> +
> +static int guc_log_relay_release(struct inode *inode, struct file *file)
> +{
> +	struct intel_guc_log *log = inode->i_private;
> +
> +	intel_guc_log_relay_close(log);
> +	return 0;
> +}
> +
> +static const struct file_operations guc_log_relay_fops = {
> +	.owner = THIS_MODULE,
> +	.open = guc_log_relay_open,
> +	.write = guc_log_relay_write,
> +	.release = guc_log_relay_release,
> +};
> +
> +void intel_guc_log_debugfs_register(struct intel_guc_log *log,
> +				    struct dentry *root)
> +{
> +	static const struct debugfs_gt_file files[] = {
> +		{ "guc_log_dump", &guc_log_dump_fops, NULL },
> +		{ "guc_load_err_log_dump", &guc_load_err_log_dump_fops, NULL },
> +		{ "guc_log_level", &guc_log_level_fops, NULL },
> +		{ "guc_log_relay", &guc_log_relay_fops, NULL },
> +	};
> +
> +	if (!intel_guc_is_supported(log_to_guc(log)))
> +		return;
> +
> +	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), log);
> +}
> +
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h
> new file mode 100644
> index 000000000000..e8900e3d74ea
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h
> @@ -0,0 +1,15 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#ifndef DEBUGFS_GUC_LOG_H
> +#define DEBUGFS_GUC_LOG_H
> +
> +struct intel_guc_log;
> +struct dentry;
> +
> +void intel_guc_log_debugfs_register(struct intel_guc_log *log,
> +				    struct dentry *root);
> +
> +#endif /* DEBUGFS_GUC_LOG_H */
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_huc.c b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.c
> new file mode 100644
> index 000000000000..497e4c693f83
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.c
> @@ -0,0 +1,36 @@
> +// SPDX-License-Identifier: MIT
> +
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#include <drm/drm_print.h>
> +
> +#include "gt/debugfs_gt.h"
> +#include "intel_huc.h"
> +
> +static int huc_info_show(struct seq_file *m, void *data)
> +{
> +	struct intel_huc *huc = m->private;
> +	struct drm_printer p = drm_seq_file_printer(m);
> +
> +	if (!intel_huc_is_supported(huc))
> +		return -ENODEV;
> +
> +	intel_huc_load_status(huc, &p);
> +
> +	return 0;
> +}
> +DEFINE_GT_DEBUGFS_ATTRIBUTE(huc_info);
> +
> +void intel_huc_debugfs_register(struct intel_huc *huc, struct dentry *root)
> +{
> +	static const struct debugfs_gt_file files[] = {
> +		{ "huc_info", &huc_info_fops, NULL },
> +	};
> +
> +	if (!intel_huc_is_supported(huc))
> +		return;
> +
> +	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), huc);
> +}
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_huc.h b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.h
> new file mode 100644
> index 000000000000..be79e992f976
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.h
> @@ -0,0 +1,14 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#ifndef DEBUGFS_HUC_H
> +#define DEBUGFS_HUC_H
> +
> +struct intel_huc;
> +struct dentry;
> +
> +void intel_huc_debugfs_register(struct intel_huc *huc, struct dentry *root);
> +
> +#endif /* DEBUGFS_HUC_H */
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_uc.c b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.c
> new file mode 100644
> index 000000000000..fd18347f8d1c
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.c
> @@ -0,0 +1,31 @@
> +// SPDX-License-Identifier: MIT
> +
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#include <linux/debugfs.h>
> +
> +#include "debugfs_guc.h"
> +#include "debugfs_huc.h"
> +#include "debugfs_uc.h"
> +#include "intel_uc.h"
> +
> +void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root)
> +{
> +	struct dentry *root;
> +
> +	if (!gt_root)
> +		return;
> +
> +	/* GuC and HuC go always in pair, no need to check both */
> +	if (!intel_uc_supports_guc(uc))
> +		return;
> +
> +	root = debugfs_create_dir("uc", gt_root);
> +	if (IS_ERR(root))
> +		return;
> +
> +	intel_guc_debugfs_register(&uc->guc, root);
> +	intel_huc_debugfs_register(&uc->huc, root);
> +}
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_uc.h b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.h
> new file mode 100644
> index 000000000000..010ce250d223
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.h
> @@ -0,0 +1,14 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#ifndef DEBUGFS_UC_H
> +#define DEBUGFS_UC_H
> +
> +struct intel_uc;
> +struct dentry;
> +
> +void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root);
> +
> +#endif /* DEBUGFS_UC_H */
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> index a5d7a86be4cf..e84ab67b317d 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> @@ -74,6 +74,11 @@ struct intel_guc {
>  	struct mutex send_mutex;
>  };
>  
> +static inline struct intel_guc *log_to_guc(struct intel_guc_log *log)
> +{
> +	return container_of(log, struct intel_guc, log);
> +}
> +
>  static
>  inline int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len)
>  {
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> index 8cdd6dc3df58..5b11a6d8e27f 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> @@ -55,11 +55,6 @@ static int guc_action_control_log(struct intel_guc *guc, bool enable,
>  	return intel_guc_send(guc, action, ARRAY_SIZE(action));
>  }
>  
> -static inline struct intel_guc *log_to_guc(struct intel_guc_log *log)
> -{
> -	return container_of(log, struct intel_guc, log);
> -}
> -
>  static void guc_log_enable_flush_events(struct intel_guc_log *log)
>  {
>  	intel_guc_enable_msg(log_to_guc(log),
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 56504be2a6ec..e60a5750ea44 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -37,7 +37,6 @@
>  #include "gt/intel_reset.h"
>  #include "gt/intel_rc6.h"
>  #include "gt/intel_rps.h"
> -#include "gt/uc/intel_guc_submission.h"
>  
>  #include "i915_debugfs.h"
>  #include "i915_debugfs_params.h"
> @@ -1251,136 +1250,6 @@ static int i915_llc(struct seq_file *m, void *data)
>  	return 0;
>  }
>  
> -static int i915_huc_info(struct seq_file *m, void *data)
> -{
> -	struct drm_i915_private *dev_priv = node_to_i915(m->private);
> -	struct intel_huc *huc = &dev_priv->gt.uc.huc;
> -	struct drm_printer p = drm_seq_file_printer(m);
> -
> -	if (!intel_huc_is_supported(huc))
> -		return -ENODEV;
> -
> -	intel_huc_load_status(huc, &p);
> -
> -	return 0;
> -}
> -
> -static int i915_guc_info(struct seq_file *m, void *data)
> -{
> -	struct drm_i915_private *dev_priv = node_to_i915(m->private);
> -	struct intel_guc *guc = &dev_priv->gt.uc.guc;
> -	struct drm_printer p = drm_seq_file_printer(m);
> -
> -	if (!intel_guc_is_supported(guc))
> -		return -ENODEV;
> -
> -	intel_guc_load_status(guc, &p);
> -	drm_puts(&p, "\n");
> -	intel_guc_log_info(&guc->log, &p);
> -
> -	/* Add more as required ... */
> -
> -	return 0;
> -}
> -
> -static int i915_guc_log_dump(struct seq_file *m, void *data)
> -{
> -	struct drm_info_node *node = m->private;
> -	struct drm_i915_private *dev_priv = node_to_i915(node);
> -	struct intel_guc *guc = &dev_priv->gt.uc.guc;
> -	bool dump_load_err = !!node->info_ent->data;
> -	struct drm_printer p = drm_seq_file_printer(m);
> -
> -	if (!intel_guc_is_supported(guc))
> -		return -ENODEV;
> -
> -	return intel_guc_log_dump(&guc->log, &p, dump_load_err);
> -}
> -
> -static int i915_guc_log_level_get(void *data, u64 *val)
> -{
> -	struct drm_i915_private *dev_priv = data;
> -	struct intel_uc *uc = &dev_priv->gt.uc;
> -
> -	if (!intel_uc_uses_guc(uc))
> -		return -ENODEV;
> -
> -	*val = intel_guc_log_get_level(&uc->guc.log);
> -
> -	return 0;
> -}
> -
> -static int i915_guc_log_level_set(void *data, u64 val)
> -{
> -	struct drm_i915_private *dev_priv = data;
> -	struct intel_uc *uc = &dev_priv->gt.uc;
> -
> -	if (!intel_uc_uses_guc(uc))
> -		return -ENODEV;
> -
> -	return intel_guc_log_set_level(&uc->guc.log, val);
> -}
> -
> -DEFINE_SIMPLE_ATTRIBUTE(i915_guc_log_level_fops,
> -			i915_guc_log_level_get, i915_guc_log_level_set,
> -			"%lld\n");
> -
> -static int i915_guc_log_relay_open(struct inode *inode, struct file *file)
> -{
> -	struct drm_i915_private *i915 = inode->i_private;
> -	struct intel_guc *guc = &i915->gt.uc.guc;
> -	struct intel_guc_log *log = &guc->log;
> -
> -	if (!intel_guc_is_ready(guc))
> -		return -ENODEV;
> -
> -	file->private_data = log;
> -
> -	return intel_guc_log_relay_open(log);
> -}
> -
> -static ssize_t
> -i915_guc_log_relay_write(struct file *filp,
> -			 const char __user *ubuf,
> -			 size_t cnt,
> -			 loff_t *ppos)
> -{
> -	struct intel_guc_log *log = filp->private_data;
> -	int val;
> -	int ret;
> -
> -	ret = kstrtoint_from_user(ubuf, cnt, 0, &val);
> -	if (ret < 0)
> -		return ret;
> -
> -	/*
> -	 * Enable and start the guc log relay on value of 1.
> -	 * Flush log relay for any other value.
> -	 */
> -	if (val == 1)
> -		ret = intel_guc_log_relay_start(log);
> -	else
> -		intel_guc_log_relay_flush(log);
> -
> -	return ret ?: cnt;
> -}
> -
> -static int i915_guc_log_relay_release(struct inode *inode, struct file *file)
> -{
> -	struct drm_i915_private *i915 = inode->i_private;
> -	struct intel_guc *guc = &i915->gt.uc.guc;
> -
> -	intel_guc_log_relay_close(&guc->log);
> -	return 0;
> -}
> -
> -static const struct file_operations i915_guc_log_relay_fops = {
> -	.owner = THIS_MODULE,
> -	.open = i915_guc_log_relay_open,
> -	.write = i915_guc_log_relay_write,
> -	.release = i915_guc_log_relay_release,
> -};
> -
>  static int i915_runtime_pm_status(struct seq_file *m, void *unused)
>  {
>  	struct drm_i915_private *dev_priv = node_to_i915(m->private);
> @@ -1989,10 +1858,6 @@ static const struct drm_info_list i915_debugfs_list[] = {
>  	{"i915_gem_objects", i915_gem_object_info, 0},
>  	{"i915_gem_fence_regs", i915_gem_fence_regs_info, 0},
>  	{"i915_gem_interrupt", i915_interrupt_info, 0},
> -	{"i915_guc_info", i915_guc_info, 0},
> -	{"i915_guc_log_dump", i915_guc_log_dump, 0},
> -	{"i915_guc_load_err_log_dump", i915_guc_log_dump, 0, (void *)1},
> -	{"i915_huc_info", i915_huc_info, 0},
>  	{"i915_frequency_info", i915_frequency_info, 0},
>  	{"i915_ring_freq_table", i915_ring_freq_table, 0},
>  	{"i915_context_status", i915_context_status, 0},
> @@ -2020,8 +1885,6 @@ static const struct i915_debugfs_files {
>  	{"i915_error_state", &i915_error_state_fops},
>  	{"i915_gpu_info", &i915_gpu_info_fops},
>  #endif
> -	{"i915_guc_log_level", &i915_guc_log_level_fops},
> -	{"i915_guc_log_relay", &i915_guc_log_relay_fops},
>  };
>  
>  int i915_debugfs_register(struct drm_i915_private *dev_priv)

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [Intel-gfx] ✓ Fi.CI.IGT: success for Re-org uC debugfs files and move them under GT (rev2)
  2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
                   ` (8 preceding siblings ...)
  2020-03-12  4:34 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
@ 2020-03-12 22:43 ` Patchwork
  2020-03-25  1:47 ` [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Andi Shyti
  10 siblings, 0 replies; 25+ messages in thread
From: Patchwork @ 2020-03-12 22:43 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio; +Cc: intel-gfx

== Series Details ==

Series: Re-org uC debugfs files and move them under GT (rev2)
URL   : https://patchwork.freedesktop.org/series/74051/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8125_full -> Patchwork_16944_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Known issues
------------

  Here are the changes found in Patchwork_16944_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_isolation@bcs0-s3:
    - shard-kbl:          [PASS][1] -> [DMESG-WARN][2] ([i915#180]) +3 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-kbl3/igt@gem_ctx_isolation@bcs0-s3.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-kbl2/igt@gem_ctx_isolation@bcs0-s3.html

  * igt@gem_ctx_persistence@close-replace-race:
    - shard-iclb:         [PASS][3] -> [INCOMPLETE][4] ([i915#1402])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb1/igt@gem_ctx_persistence@close-replace-race.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb3/igt@gem_ctx_persistence@close-replace-race.html

  * igt@gem_ctx_shared@exec-single-timeline-bsd:
    - shard-iclb:         [PASS][5] -> [SKIP][6] ([fdo#110841])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb5/igt@gem_ctx_shared@exec-single-timeline-bsd.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb2/igt@gem_ctx_shared@exec-single-timeline-bsd.html

  * igt@gem_exec_schedule@implicit-read-write-bsd1:
    - shard-iclb:         [PASS][7] -> [SKIP][8] ([fdo#109276] / [i915#677]) +3 similar issues
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb4/igt@gem_exec_schedule@implicit-read-write-bsd1.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb5/igt@gem_exec_schedule@implicit-read-write-bsd1.html

  * igt@gem_exec_schedule@out-order-bsd2:
    - shard-iclb:         [PASS][9] -> [SKIP][10] ([fdo#109276]) +16 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb2/igt@gem_exec_schedule@out-order-bsd2.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb8/igt@gem_exec_schedule@out-order-bsd2.html

  * igt@gem_exec_schedule@pi-distinct-iova-bsd:
    - shard-iclb:         [PASS][11] -> [SKIP][12] ([i915#677]) +2 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb6/igt@gem_exec_schedule@pi-distinct-iova-bsd.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb2/igt@gem_exec_schedule@pi-distinct-iova-bsd.html

  * igt@gem_exec_schedule@preemptive-hang-bsd:
    - shard-iclb:         [PASS][13] -> [SKIP][14] ([fdo#112146]) +7 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb6/igt@gem_exec_schedule@preemptive-hang-bsd.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb2/igt@gem_exec_schedule@preemptive-hang-bsd.html

  * igt@gem_exec_whisper@basic-contexts-forked-all:
    - shard-snb:          [PASS][15] -> [INCOMPLETE][16] ([i915#82])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-snb5/igt@gem_exec_whisper@basic-contexts-forked-all.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-snb5/igt@gem_exec_whisper@basic-contexts-forked-all.html

  * igt@gem_exec_whisper@basic-fds-forked:
    - shard-tglb:         [PASS][17] -> [TIMEOUT][18] ([i915#1408])
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-tglb6/igt@gem_exec_whisper@basic-fds-forked.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-tglb3/igt@gem_exec_whisper@basic-fds-forked.html

  * igt@gem_softpin@noreloc-s3:
    - shard-skl:          [PASS][19] -> [INCOMPLETE][20] ([i915#69])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl2/igt@gem_softpin@noreloc-s3.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl3/igt@gem_softpin@noreloc-s3.html

  * igt@gem_workarounds@suspend-resume-context:
    - shard-apl:          [PASS][21] -> [DMESG-WARN][22] ([i915#180])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-apl8/igt@gem_workarounds@suspend-resume-context.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-apl6/igt@gem_workarounds@suspend-resume-context.html

  * igt@i915_pm_rps@waitboost:
    - shard-tglb:         [PASS][23] -> [FAIL][24] ([i915#413])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-tglb1/igt@i915_pm_rps@waitboost.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-tglb2/igt@i915_pm_rps@waitboost.html
    - shard-iclb:         [PASS][25] -> [FAIL][26] ([i915#413])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb5/igt@i915_pm_rps@waitboost.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb2/igt@i915_pm_rps@waitboost.html

  * igt@i915_selftest@live@execlists:
    - shard-apl:          [PASS][27] -> [INCOMPLETE][28] ([fdo#103927] / [i915#656])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-apl6/igt@i915_selftest@live@execlists.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-apl4/igt@i915_selftest@live@execlists.html

  * igt@kms_cursor_crc@pipe-c-cursor-256x256-random:
    - shard-skl:          [PASS][29] -> [FAIL][30] ([i915#54])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl4/igt@kms_cursor_crc@pipe-c-cursor-256x256-random.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl10/igt@kms_cursor_crc@pipe-c-cursor-256x256-random.html

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
    - shard-glk:          [PASS][31] -> [FAIL][32] ([i915#72])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-glk3/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-glk2/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html

  * igt@kms_cursor_legacy@flip-vs-cursor-toggle:
    - shard-hsw:          [PASS][33] -> [FAIL][34] ([IGT#5])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-hsw7/igt@kms_cursor_legacy@flip-vs-cursor-toggle.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-hsw5/igt@kms_cursor_legacy@flip-vs-cursor-toggle.html

  * igt@kms_flip@flip-vs-dpms-off-vs-modeset:
    - shard-hsw:          [PASS][35] -> [INCOMPLETE][36] ([i915#61])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-hsw4/igt@kms_flip@flip-vs-dpms-off-vs-modeset.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-hsw7/igt@kms_flip@flip-vs-dpms-off-vs-modeset.html

  * igt@kms_flip@plain-flip-ts-check-interruptible:
    - shard-skl:          [PASS][37] -> [FAIL][38] ([i915#34])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl7/igt@kms_flip@plain-flip-ts-check-interruptible.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl9/igt@kms_flip@plain-flip-ts-check-interruptible.html

  * igt@kms_flip_tiling@flip-x-tiled:
    - shard-skl:          [PASS][39] -> [FAIL][40] ([fdo#108145] / [i915#699])
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl4/igt@kms_flip_tiling@flip-x-tiled.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl10/igt@kms_flip_tiling@flip-x-tiled.html

  * igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-mmap-gtt:
    - shard-skl:          [PASS][41] -> [FAIL][42] ([i915#49])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl9/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-mmap-gtt.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl4/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-mmap-gtt.html

  * igt@kms_hdr@bpc-switch:
    - shard-skl:          [PASS][43] -> [FAIL][44] ([i915#1188])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl10/igt@kms_hdr@bpc-switch.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl5/igt@kms_hdr@bpc-switch.html

  * igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
    - shard-skl:          [PASS][45] -> [FAIL][46] ([fdo#108145]) +1 similar issue
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl4/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl10/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html

  * igt@kms_psr@psr2_cursor_mmap_cpu:
    - shard-iclb:         [PASS][47] -> [SKIP][48] ([fdo#109441]) +2 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb2/igt@kms_psr@psr2_cursor_mmap_cpu.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb5/igt@kms_psr@psr2_cursor_mmap_cpu.html

  * igt@perf_pmu@busy-accuracy-98-vcs1:
    - shard-iclb:         [PASS][49] -> [SKIP][50] ([fdo#112080]) +16 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb1/igt@perf_pmu@busy-accuracy-98-vcs1.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb7/igt@perf_pmu@busy-accuracy-98-vcs1.html

  
#### Possible fixes ####

  * igt@gem_ctx_isolation@vcs0-s3:
    - shard-skl:          [INCOMPLETE][51] ([i915#146] / [i915#69]) -> [PASS][52]
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl5/igt@gem_ctx_isolation@vcs0-s3.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl6/igt@gem_ctx_isolation@vcs0-s3.html

  * igt@gem_ctx_persistence@close-replace-race:
    - shard-tglb:         [INCOMPLETE][53] ([i915#1402]) -> [PASS][54]
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-tglb5/igt@gem_ctx_persistence@close-replace-race.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-tglb2/igt@gem_ctx_persistence@close-replace-race.html
    - shard-kbl:          [INCOMPLETE][55] ([i915#1402]) -> [PASS][56]
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-kbl4/igt@gem_ctx_persistence@close-replace-race.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-kbl4/igt@gem_ctx_persistence@close-replace-race.html
    - shard-apl:          [INCOMPLETE][57] ([fdo#103927] / [i915#1402]) -> [PASS][58]
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-apl3/igt@gem_ctx_persistence@close-replace-race.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-apl1/igt@gem_ctx_persistence@close-replace-race.html

  * igt@gem_exec_parallel@vcs1-fds:
    - shard-iclb:         [SKIP][59] ([fdo#112080]) -> [PASS][60] +15 similar issues
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb6/igt@gem_exec_parallel@vcs1-fds.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb2/igt@gem_exec_parallel@vcs1-fds.html

  * igt@gem_exec_schedule@implicit-read-write-bsd2:
    - shard-iclb:         [SKIP][61] ([fdo#109276] / [i915#677]) -> [PASS][62]
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb8/igt@gem_exec_schedule@implicit-read-write-bsd2.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb4/igt@gem_exec_schedule@implicit-read-write-bsd2.html

  * igt@gem_exec_schedule@preempt-other-chain-bsd:
    - shard-iclb:         [SKIP][63] ([fdo#112146]) -> [PASS][64] +4 similar issues
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb4/igt@gem_exec_schedule@preempt-other-chain-bsd.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb6/igt@gem_exec_schedule@preempt-other-chain-bsd.html

  * igt@gem_exec_suspend@basic-s3:
    - shard-kbl:          [DMESG-WARN][65] ([i915#180]) -> [PASS][66] +1 similar issue
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-kbl6/igt@gem_exec_suspend@basic-s3.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-kbl3/igt@gem_exec_suspend@basic-s3.html

  * igt@gem_ppgtt@flink-and-close-vma-leak:
    - shard-glk:          [FAIL][67] ([i915#644]) -> [PASS][68]
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-glk4/igt@gem_ppgtt@flink-and-close-vma-leak.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-glk8/igt@gem_ppgtt@flink-and-close-vma-leak.html

  * igt@i915_pm_dc@dc5-dpms:
    - shard-iclb:         [FAIL][69] ([i915#447]) -> [PASS][70]
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb3/igt@i915_pm_dc@dc5-dpms.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb6/igt@i915_pm_dc@dc5-dpms.html

  * igt@i915_selftest@live@execlists:
    - shard-skl:          [INCOMPLETE][71] ([i915#1430] / [i915#656]) -> [PASS][72]
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl5/igt@i915_selftest@live@execlists.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl2/igt@i915_selftest@live@execlists.html

  * igt@i915_suspend@fence-restore-tiled2untiled:
    - shard-apl:          [DMESG-WARN][73] ([i915#180]) -> [PASS][74] +5 similar issues
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-apl6/igt@i915_suspend@fence-restore-tiled2untiled.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-apl2/igt@i915_suspend@fence-restore-tiled2untiled.html

  * igt@kms_cursor_crc@pipe-a-cursor-suspend:
    - shard-skl:          [INCOMPLETE][75] ([i915#300]) -> [PASS][76]
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl4/igt@kms_cursor_crc@pipe-a-cursor-suspend.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl6/igt@kms_cursor_crc@pipe-a-cursor-suspend.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-hsw:          [INCOMPLETE][77] ([i915#61]) -> [PASS][78]
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-hsw2/igt@kms_flip@flip-vs-suspend-interruptible.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-hsw1/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_hdr@bpc-switch-dpms:
    - shard-skl:          [FAIL][79] ([i915#1188]) -> [PASS][80]
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl2/igt@kms_hdr@bpc-switch-dpms.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl3/igt@kms_hdr@bpc-switch-dpms.html

  * igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
    - shard-skl:          [FAIL][81] ([fdo#108145] / [i915#265]) -> [PASS][82]
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl9/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl4/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html

  * igt@kms_plane_lowres@pipe-a-tiling-x:
    - shard-glk:          [FAIL][83] ([i915#899]) -> [PASS][84] +1 similar issue
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-glk5/igt@kms_plane_lowres@pipe-a-tiling-x.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-glk9/igt@kms_plane_lowres@pipe-a-tiling-x.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [SKIP][85] ([fdo#109441]) -> [PASS][86] +2 similar issues
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb5/igt@kms_psr@psr2_primary_mmap_cpu.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@perf@gen8-unprivileged-single-ctx-counters:
    - shard-skl:          [TIMEOUT][87] ([fdo#111732]) -> [PASS][88]
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-skl6/igt@perf@gen8-unprivileged-single-ctx-counters.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-skl7/igt@perf@gen8-unprivileged-single-ctx-counters.html

  * igt@prime_busy@hang-bsd2:
    - shard-iclb:         [SKIP][89] ([fdo#109276]) -> [PASS][90] +29 similar issues
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-iclb8/igt@prime_busy@hang-bsd2.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-iclb4/igt@prime_busy@hang-bsd2.html

  
#### Warnings ####

  * igt@gem_linear_blits@normal:
    - shard-apl:          [TIMEOUT][91] ([fdo#111732] / [i915#1322]) -> [TIMEOUT][92] ([i915#1322])
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-apl4/igt@gem_linear_blits@normal.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-apl3/igt@gem_linear_blits@normal.html

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-glk:          [FAIL][93] ([i915#46]) -> [FAIL][94] ([i915#79])
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-glk9/igt@kms_flip@flip-vs-expired-vblank.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-glk7/igt@kms_flip@flip-vs-expired-vblank.html

  * igt@runner@aborted:
    - shard-kbl:          ([FAIL][95], [FAIL][96]) ([i915#1389] / [i915#1402] / [i915#92]) -> [FAIL][97] ([i915#92])
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-kbl4/igt@runner@aborted.html
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-kbl4/igt@runner@aborted.html
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-kbl6/igt@runner@aborted.html
    - shard-apl:          ([FAIL][98], [FAIL][99]) ([fdo#103927] / [i915#1402]) -> ([FAIL][100], [FAIL][101]) ([fdo#103927] / [i915#529])
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-apl8/igt@runner@aborted.html
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8125/shard-apl3/igt@runner@aborted.html
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-apl8/igt@runner@aborted.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/shard-apl4/igt@runner@aborted.html

  
  [IGT#5]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/5
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#110841]: https://bugs.freedesktop.org/show_bug.cgi?id=110841
  [fdo#111732]: https://bugs.freedesktop.org/show_bug.cgi?id=111732
  [fdo#112080]: https://bugs.freedesktop.org/show_bug.cgi?id=112080
  [fdo#112146]: https://bugs.freedesktop.org/show_bug.cgi?id=112146
  [i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
  [i915#1322]: https://gitlab.freedesktop.org/drm/intel/issues/1322
  [i915#1389]: https://gitlab.freedesktop.org/drm/intel/issues/1389
  [i915#1402]: https://gitlab.freedesktop.org/drm/intel/issues/1402
  [i915#1408]: https://gitlab.freedesktop.org/drm/intel/issues/1408
  [i915#1430]: https://gitlab.freedesktop.org/drm/intel/issues/1430
  [i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
  [i915#300]: https://gitlab.freedesktop.org/drm/intel/issues/300
  [i915#34]: https://gitlab.freedesktop.org/drm/intel/issues/34
  [i915#413]: https://gitlab.freedesktop.org/drm/intel/issues/413
  [i915#447]: https://gitlab.freedesktop.org/drm/intel/issues/447
  [i915#46]: https://gitlab.freedesktop.org/drm/intel/issues/46
  [i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
  [i915#529]: https://gitlab.freedesktop.org/drm/intel/issues/529
  [i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
  [i915#61]: https://gitlab.freedesktop.org/drm/intel/issues/61
  [i915#644]: https://gitlab.freedesktop.org/drm/intel/issues/644
  [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656
  [i915#677]: https://gitlab.freedesktop.org/drm/intel/issues/677
  [i915#69]: https://gitlab.freedesktop.org/drm/intel/issues/69
  [i915#699]: https://gitlab.freedesktop.org/drm/intel/issues/699
  [i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
  [i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
  [i915#899]: https://gitlab.freedesktop.org/drm/intel/issues/899
  [i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92


Participating hosts (10 -> 10)
------------------------------

  No changes in participating hosts


Build changes
-------------

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_8125 -> Patchwork_16944

  CI-20190529: 20190529
  CI_DRM_8125: 8fc697c3de927ae930efead8fd43032c6e5f5094 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5505: 8973d811f3fdfb4ace4aabab2095ce0309881648 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_16944: 740eb468d0446ff06077ca885ea2ef570b737ba8 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16944/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 2/6] drm/i915/guc: drop stage_pool debugfs
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 2/6] drm/i915/guc: drop stage_pool debugfs Daniele Ceraolo Spurio
@ 2020-03-13 11:37   ` Andi Shyti
  0 siblings, 0 replies; 25+ messages in thread
From: Andi Shyti @ 2020-03-13 11:37 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio; +Cc: intel-gfx

Hi Daniele,

On Wed, Mar 11, 2020 at 06:16:27PM -0700, Daniele Ceraolo Spurio wrote:
> The pool will be private to GuC in the new submission scheme, so we
> won't be able to print it and we can just drop the current legacy code.
> 
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>

Reviewed-by: Andi Shyti <andi.shyti@intel.com>

Andi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 3/6] drm/i915/huc: make "support huc" reflect HW capabilities
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 3/6] drm/i915/huc: make "support huc" reflect HW capabilities Daniele Ceraolo Spurio
@ 2020-03-13 14:55   ` Andi Shyti
  2020-03-25 16:49   ` John Harrison
  1 sibling, 0 replies; 25+ messages in thread
From: Andi Shyti @ 2020-03-13 14:55 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio; +Cc: intel-gfx

Hi Daniele,

On Wed, Mar 11, 2020 at 06:16:28PM -0700, Daniele Ceraolo Spurio wrote:
> We currently initialize HuC support based on GuC being enabled in
> modparam; this means that huc_is_supported() can return false on HW that
> does have a HuC when enable_guc=0. The rationale for this behavior is
> that HuC requires GuC for authentication and therefore is not supported
> by itself. However, we do not allow defining HuC fw wthout GuC fw and
> selecting HuC in modparam implicitly selects GuC as well, so we can't
> actually hit a scenario where HuC is selected alone. Therefore, we can
> flip the support check to reflect the HW capabilities and fw
> availability, which is more intuitive and will make it cleaner to log
> HuC the difference between not supported in HW and not selected.
> 
> Removing the difference between GuC and HuC also allows us to simplify
> the init_early, since we don't need to differentiate the support based
> on the type of uC.
> 
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>

Looks good to me,

Reviewed-by: Andi Shyti <andi.shyti@intel.com>

Andi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT Daniele Ceraolo Spurio
  2020-03-12  9:10   ` Jani Nikula
@ 2020-03-13 15:38   ` Andi Shyti
  2020-03-25 21:03   ` Daniele Ceraolo Spurio
  2 siblings, 0 replies; 25+ messages in thread
From: Andi Shyti @ 2020-03-13 15:38 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio; +Cc: intel-gfx

Hi Daniele,

>  void debugfs_gt_register(struct intel_gt *gt)
> @@ -24,6 +25,8 @@ void debugfs_gt_register(struct intel_gt *gt)
>  
>  	debugfs_engines_register(gt, root);
>  	debugfs_gt_pm_register(gt, root);
> +
> +	intel_uc_debugfs_register(&gt->uc, root);
>  }
>  
>  void intel_gt_debugfs_register_files(struct dentry *root,
> @@ -31,9 +34,10 @@ void intel_gt_debugfs_register_files(struct dentry *root,
>  				     unsigned long count, void *data)
>  {
>  	while (count--) {
> +		umode_t mode = files->fops->write ? 0644 : 0444;
>  		if (!files->eval || files->eval(data))
>  			debugfs_create_file(files->name,
> -					    0444, root, data,
> +					    mode, root, data,
>  					    files->fops);

perhaps at some point we could send this to the debugfs framework
as multifile creation.

in any case,

Reviewed-by: Andi Shyti <andi.shyti@intel.com>

Andi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT
  2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
                   ` (9 preceding siblings ...)
  2020-03-12 22:43 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
@ 2020-03-25  1:47 ` Andi Shyti
  2020-03-25 16:25   ` Daniele Ceraolo Spurio
  10 siblings, 1 reply; 25+ messages in thread
From: Andi Shyti @ 2020-03-25  1:47 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio; +Cc: intel-gfx

Hi Daniele,

On Wed, Mar 11, 2020 at 06:16:25PM -0700, Daniele Ceraolo Spurio wrote:
> Rebased on top of Andi's patch. Note that some discussion is still
> ongoing on that patch.
> 
> Also dropped the patch that caused a const->non-const conversion and
> fixed a couple of bugs:
> - keep printing HUC_STATUS register
> - correcly set permissions for writable debugfs files
> 
> Cc: Andi Shyti <andi.shyti@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com> 
> 
> Andi Shyti (1):
>   drm/i915/gt: allow setting generic data pointer
> 
> Daniele Ceraolo Spurio (5):
>   drm/i915/guc: drop stage_pool debugfs
>   drm/i915/huc: make "support huc" reflect HW capabilities
>   drm/i915/debugfs: move uC printers and update debugfs file names
>   drm/i915/uc: Move uC debugfs to its own folder under GT
>   drm/i915/uc: do not free err log on uc_fini

is this series getting in at some point or shall I take this
series over?

Andi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT
  2020-03-25  1:47 ` [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Andi Shyti
@ 2020-03-25 16:25   ` Daniele Ceraolo Spurio
  0 siblings, 0 replies; 25+ messages in thread
From: Daniele Ceraolo Spurio @ 2020-03-25 16:25 UTC (permalink / raw)
  To: Andi Shyti; +Cc: intel-gfx



On 3/24/20 6:47 PM, Andi Shyti wrote:
> Hi Daniele,
> 
> On Wed, Mar 11, 2020 at 06:16:25PM -0700, Daniele Ceraolo Spurio wrote:
>> Rebased on top of Andi's patch. Note that some discussion is still
>> ongoing on that patch.
>>
>> Also dropped the patch that caused a const->non-const conversion and
>> fixed a couple of bugs:
>> - keep printing HUC_STATUS register
>> - correcly set permissions for writable debugfs files
>>
>> Cc: Andi Shyti <andi.shyti@intel.com>
>> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: John Harrison <John.C.Harrison@Intel.com>
>> Cc: Matthew Brost <matthew.brost@intel.com>
>>
>> Andi Shyti (1):
>>    drm/i915/gt: allow setting generic data pointer
>>
>> Daniele Ceraolo Spurio (5):
>>    drm/i915/guc: drop stage_pool debugfs
>>    drm/i915/huc: make "support huc" reflect HW capabilities
>>    drm/i915/debugfs: move uC printers and update debugfs file names
>>    drm/i915/uc: Move uC debugfs to its own folder under GT
>>    drm/i915/uc: do not free err log on uc_fini
> 
> is this series getting in at some point or shall I take this
> series over?
> 

I've been waiting for a review of the changes on the GuC side (and I've 
already sent a ping twice). I'm ok if you want to take over and 
integrate these in your series in the meantime, just keep in mind that I 
might have to update them if there are negative comments.

Daniele

> Andi
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 3/6] drm/i915/huc: make "support huc" reflect HW capabilities
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 3/6] drm/i915/huc: make "support huc" reflect HW capabilities Daniele Ceraolo Spurio
  2020-03-13 14:55   ` Andi Shyti
@ 2020-03-25 16:49   ` John Harrison
  1 sibling, 0 replies; 25+ messages in thread
From: John Harrison @ 2020-03-25 16:49 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio, intel-gfx

On 3/11/2020 18:16, Daniele Ceraolo Spurio wrote:
> We currently initialize HuC support based on GuC being enabled in
> modparam; this means that huc_is_supported() can return false on HW that
> does have a HuC when enable_guc=0. The rationale for this behavior is
> that HuC requires GuC for authentication and therefore is not supported
> by itself. However, we do not allow defining HuC fw wthout GuC fw and
> selecting HuC in modparam implicitly selects GuC as well, so we can't
> actually hit a scenario where HuC is selected alone. Therefore, we can
> flip the support check to reflect the HW capabilities and fw
> availability, which is more intuitive and will make it cleaner to log
> HuC the difference between not supported in HW and not selected.
>
> Removing the difference between GuC and HuC also allows us to simplify
> the init_early, since we don't need to differentiate the support based
> on the type of uC.
>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>

Looks plausible to me.
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>

> ---
>   drivers/gpu/drm/i915/gt/uc/intel_guc.c    |  2 +-
>   drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c | 14 -------------
>   drivers/gpu/drm/i915/gt/uc/intel_guc_fw.h |  1 -
>   drivers/gpu/drm/i915/gt/uc/intel_huc.c    |  2 +-
>   drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c | 17 ---------------
>   drivers/gpu/drm/i915/gt/uc/intel_huc_fw.h |  1 -
>   drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c  | 25 +++++++++++++++--------
>   drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h  |  3 +--
>   8 files changed, 20 insertions(+), 45 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> index 819f09ef51fc..827d75073879 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> @@ -169,7 +169,7 @@ void intel_guc_init_early(struct intel_guc *guc)
>   {
>   	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
>   
> -	intel_guc_fw_init_early(guc);
> +	intel_uc_fw_init_early(&guc->fw, INTEL_UC_FW_TYPE_GUC);
>   	intel_guc_ct_init_early(&guc->ct);
>   	intel_guc_log_init_early(&guc->log);
>   	intel_guc_submission_init_early(guc);
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c
> index 3a1c47d600ea..d4a87f4c9421 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c
> @@ -13,20 +13,6 @@
>   #include "intel_guc_fw.h"
>   #include "i915_drv.h"
>   
> -/**
> - * intel_guc_fw_init_early() - initializes GuC firmware struct
> - * @guc: intel_guc struct
> - *
> - * On platforms with GuC selects firmware for uploading
> - */
> -void intel_guc_fw_init_early(struct intel_guc *guc)
> -{
> -	struct drm_i915_private *i915 = guc_to_gt(guc)->i915;
> -
> -	intel_uc_fw_init_early(&guc->fw, INTEL_UC_FW_TYPE_GUC, HAS_GT_UC(i915),
> -			       INTEL_INFO(i915)->platform, INTEL_REVID(i915));
> -}
> -
>   static void guc_prepare_xfer(struct intel_uncore *uncore)
>   {
>   	u32 shim_flags = GUC_DISABLE_SRAM_INIT_TO_ZEROES |
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.h
> index b5ab639d7259..0b4d2a9c9435 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_fw.h
> @@ -8,7 +8,6 @@
>   
>   struct intel_guc;
>   
> -void intel_guc_fw_init_early(struct intel_guc *guc);
>   int intel_guc_fw_upload(struct intel_guc *guc);
>   
>   #endif
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.c b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> index a74b65694512..d73dc21686e7 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> @@ -41,7 +41,7 @@ void intel_huc_init_early(struct intel_huc *huc)
>   {
>   	struct drm_i915_private *i915 = huc_to_gt(huc)->i915;
>   
> -	intel_huc_fw_init_early(huc);
> +	intel_uc_fw_init_early(&huc->fw, INTEL_UC_FW_TYPE_HUC);
>   
>   	if (INTEL_GEN(i915) >= 11) {
>   		huc->status.reg = GEN11_HUC_KERNEL_LOAD_INFO;
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
> index 9cdf4cbe691c..e5ef509c70e8 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
> @@ -7,23 +7,6 @@
>   #include "intel_huc_fw.h"
>   #include "i915_drv.h"
>   
> -/**
> - * intel_huc_fw_init_early() - initializes HuC firmware struct
> - * @huc: intel_huc struct
> - *
> - * On platforms with HuC selects firmware for uploading
> - */
> -void intel_huc_fw_init_early(struct intel_huc *huc)
> -{
> -	struct intel_gt *gt = huc_to_gt(huc);
> -	struct intel_uc *uc = &gt->uc;
> -	struct drm_i915_private *i915 = gt->i915;
> -
> -	intel_uc_fw_init_early(&huc->fw, INTEL_UC_FW_TYPE_HUC,
> -			       intel_uc_wants_guc(uc),
> -			       INTEL_INFO(i915)->platform, INTEL_REVID(i915));
> -}
> -
>   /**
>    * intel_huc_fw_upload() - load HuC uCode to device
>    * @huc: intel_huc structure
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.h b/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.h
> index b791269ce923..12f264ee3e0b 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_huc_fw.h
> @@ -8,7 +8,6 @@
>   
>   struct intel_huc;
>   
> -void intel_huc_fw_init_early(struct intel_huc *huc);
>   int intel_huc_fw_upload(struct intel_huc *huc);
>   
>   #endif
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
> index 18c755203688..fa893dd1823c 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
> @@ -11,16 +11,22 @@
>   #include "intel_uc_fw_abi.h"
>   #include "i915_drv.h"
>   
> -static inline struct intel_gt *__uc_fw_to_gt(struct intel_uc_fw *uc_fw)
> +static inline struct intel_gt *
> +____uc_fw_to_gt(struct intel_uc_fw *uc_fw, enum intel_uc_fw_type type)
>   {
> -	GEM_BUG_ON(uc_fw->status == INTEL_UC_FIRMWARE_UNINITIALIZED);
> -	if (uc_fw->type == INTEL_UC_FW_TYPE_GUC)
> +	if (type == INTEL_UC_FW_TYPE_GUC)
>   		return container_of(uc_fw, struct intel_gt, uc.guc.fw);
>   
> -	GEM_BUG_ON(uc_fw->type != INTEL_UC_FW_TYPE_HUC);
> +	GEM_BUG_ON(type != INTEL_UC_FW_TYPE_HUC);
>   	return container_of(uc_fw, struct intel_gt, uc.huc.fw);
>   }
>   
> +static inline struct intel_gt *__uc_fw_to_gt(struct intel_uc_fw *uc_fw)
> +{
> +	GEM_BUG_ON(uc_fw->status == INTEL_UC_FIRMWARE_UNINITIALIZED);
> +	return ____uc_fw_to_gt(uc_fw, uc_fw->type);
> +}
> +
>   #ifdef CONFIG_DRM_I915_DEBUG_GUC
>   void intel_uc_fw_change_status(struct intel_uc_fw *uc_fw,
>   			       enum intel_uc_fw_status status)
> @@ -195,9 +201,10 @@ static void __uc_fw_user_override(struct intel_uc_fw *uc_fw)
>    * firmware to fetch and load.
>    */
>   void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
> -			    enum intel_uc_fw_type type, bool supported,
> -			    enum intel_platform platform, u8 rev)
> +			    enum intel_uc_fw_type type)
>   {
> +	struct drm_i915_private *i915 = ____uc_fw_to_gt(uc_fw, type)->i915;
> +
>   	/*
>   	 * we use FIRMWARE_UNINITIALIZED to detect checks against uc_fw->status
>   	 * before we're looked at the HW caps to see if we have uc support
> @@ -208,8 +215,10 @@ void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
>   
>   	uc_fw->type = type;
>   
> -	if (supported) {
> -		__uc_fw_auto_select(uc_fw, platform, rev);
> +	if (HAS_GT_UC(i915)) {
> +		__uc_fw_auto_select(uc_fw,
> +				    INTEL_INFO(i915)->platform,
> +				    INTEL_REVID(i915));
>   		__uc_fw_user_override(uc_fw);
>   	}
>   
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h
> index 888ff0de0244..23d3a423ac0f 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h
> @@ -239,8 +239,7 @@ static inline u32 intel_uc_fw_get_upload_size(struct intel_uc_fw *uc_fw)
>   }
>   
>   void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
> -			    enum intel_uc_fw_type type, bool supported,
> -			    enum intel_platform platform, u8 rev);
> +			    enum intel_uc_fw_type type);
>   int intel_uc_fw_fetch(struct intel_uc_fw *uc_fw);
>   void intel_uc_fw_cleanup_fetch(struct intel_uc_fw *uc_fw);
>   int intel_uc_fw_upload(struct intel_uc_fw *uc_fw, u32 offset, u32 dma_flags);

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 4/6] drm/i915/debugfs: move uC printers and update debugfs file names
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 4/6] drm/i915/debugfs: move uC printers and update debugfs file names Daniele Ceraolo Spurio
@ 2020-03-25 17:05   ` John Harrison
  2020-03-25 17:14     ` Daniele Ceraolo Spurio
  0 siblings, 1 reply; 25+ messages in thread
From: John Harrison @ 2020-03-25 17:05 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio, intel-gfx

On 3/11/2020 18:16, Daniele Ceraolo Spurio wrote:
> Move the printers to the respective files for clarity. The
> guc_load_status debugfs has been squashed in the guc_info one, has
> having separate ones wasn't very useful. The HuC debugfs has been
> renamed huc_info to match.
>
> v2: keep printing HUC_STATUS2 (Tony), avoid const->non-const
>      container_of (Jani)
>
> Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Tony Ye <tony.ye@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/gt/uc/intel_guc.c     |  44 +++++++
>   drivers/gpu/drm/i915/gt/uc/intel_guc.h     |   2 +
>   drivers/gpu/drm/i915/gt/uc/intel_guc_log.c |  92 +++++++++++++++
>   drivers/gpu/drm/i915/gt/uc/intel_guc_log.h |   4 +
>   drivers/gpu/drm/i915/gt/uc/intel_huc.c     |  29 +++++
>   drivers/gpu/drm/i915/gt/uc/intel_huc.h     |   2 +
>   drivers/gpu/drm/i915/i915_debugfs.c        | 131 +++------------------
>   7 files changed, 189 insertions(+), 115 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> index 827d75073879..861657897c0f 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
> @@ -723,3 +723,47 @@ int intel_guc_allocate_and_map_vma(struct intel_guc *guc, u32 size,
>   
>   	return 0;
>   }
> +
> +/**
> + * intel_guc_load_status - dump information about GuC load status
> + * @guc: the GuC
> + * @p: the &drm_printer
> + *
> + * Pretty printer for GuC load status.
> + */
> +void intel_guc_load_status(struct intel_guc *guc, struct drm_printer *p)
> +{
> +	struct intel_gt *gt = guc_to_gt(guc);
> +	struct intel_uncore *uncore = gt->uncore;
> +	intel_wakeref_t wakeref;
> +
> +	if (!intel_guc_is_supported(guc)) {
> +		drm_printf(p, "GuC not supported\n");
> +		return;
> +	}
> +
> +	if (!intel_guc_is_wanted(guc)) {
> +		drm_printf(p, "GuC disabled\n");
> +		return;
> +	}
> +
> +	intel_uc_fw_dump(&guc->fw, p);
> +
> +	with_intel_runtime_pm(uncore->rpm, wakeref) {
> +		u32 status = intel_uncore_read(uncore, GUC_STATUS);
> +		u32 i;
> +
> +		drm_printf(p, "\nGuC status 0x%08x:\n", status);
> +		drm_printf(p, "\tBootrom status = 0x%x\n",
> +			   (status & GS_BOOTROM_MASK) >> GS_BOOTROM_SHIFT);
> +		drm_printf(p, "\tuKernel status = 0x%x\n",
> +			   (status & GS_UKERNEL_MASK) >> GS_UKERNEL_SHIFT);
> +		drm_printf(p, "\tMIA Core status = 0x%x\n",
> +			   (status & GS_MIA_MASK) >> GS_MIA_SHIFT);
> +		drm_puts(p, "\nScratch registers:\n");
> +		for (i = 0; i < 16; i++) {
> +			drm_printf(p, "\t%2d: \t0x%x\n",
> +				   i, intel_uncore_read(uncore, SOFT_SCRATCH(i)));
> +		}
> +	}
> +}
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> index 4594ccbeaa34..a5d7a86be4cf 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> @@ -190,4 +190,6 @@ static inline void intel_guc_disable_msg(struct intel_guc *guc, u32 mask)
>   int intel_guc_reset_engine(struct intel_guc *guc,
>   			   struct intel_engine_cs *engine);
>   
> +void intel_guc_load_status(struct intel_guc *guc, struct drm_printer *p);
> +
>   #endif
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> index caed0d57e704..8cdd6dc3df58 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> @@ -672,3 +672,95 @@ void intel_guc_log_handle_flush_event(struct intel_guc_log *log)
>   {
>   	queue_work(system_highpri_wq, &log->relay.flush_work);
>   }
> +
> +static const char *
> +stringify_guc_log_type(enum guc_log_buffer_type type)
> +{
> +	switch (type) {
> +	case GUC_ISR_LOG_BUFFER:
> +		return "ISR";
> +	case GUC_DPC_LOG_BUFFER:
> +		return "DPC";
> +	case GUC_CRASH_DUMP_LOG_BUFFER:
> +		return "CRASH";
> +	default:
> +		MISSING_CASE(type);
> +	}
> +
> +	return "";
> +}
> +
> +/**
> + * intel_guc_log_info - dump information about GuC log relay
> + * @guc: the GuC
> + * @p: the &drm_printer
> + *
> + * Pretty printer for GuC log info
> + */
> +void intel_guc_log_info(struct intel_guc_log *log, struct drm_printer *p)
> +{
> +	enum guc_log_buffer_type type;
> +
> +	if (!intel_guc_log_relay_created(log)) {
> +		drm_puts(p, "GuC log relay not created\n");
> +		return;
> +	}
> +
> +	drm_puts(p, "GuC logging stats:\n");
> +
> +	drm_printf(p, "\tRelay full count: %u\n", log->relay.full_count);
> +
> +	for (type = GUC_ISR_LOG_BUFFER; type < GUC_MAX_LOG_BUFFER; type++) {
> +		drm_printf(p, "\t%s:\tflush count %10u, overflow count %10u\n",
> +			   stringify_guc_log_type(type),
> +			   log->stats[type].flush,
> +			   log->stats[type].sampled_overflow);
> +	}
> +}
> +
> +/**
> + * intel_guc_log_dump - dump the contents of the GuC log
> + * @log: the GuC log
> + * @p: the &drm_printer
> + * @dump_load_err: dump the log saved on GuC load error
> + *
> + * Pretty printer for the GuC log
> + */
> +int intel_guc_log_dump(struct intel_guc_log *log, struct drm_printer *p,
> +		       bool dump_load_err)
> +{
> +	struct intel_guc *guc = log_to_guc(log);
> +	struct intel_uc *uc = container_of(guc, struct intel_uc, guc);
> +	struct drm_i915_gem_object *obj = NULL;
> +	u32 *map;
> +	int i = 0;
> +
> +	if (!intel_guc_is_supported(guc))
> +		return -ENODEV;
> +
> +	if (dump_load_err)
> +		obj = uc->load_err_log;
> +	else if (guc->log.vma)
> +		obj = guc->log.vma->obj;
> +
> +	if (!obj)
> +		return 0;
> +
> +	map = i915_gem_object_pin_map(obj, I915_MAP_WC);
> +	if (IS_ERR(map)) {
> +		DRM_DEBUG("Failed to pin object\n");
> +		drm_puts(p, "(log data unaccessible)\n");
> +		return PTR_ERR(map);
> +	}
> +
> +	for (i = 0; i < obj->base.size / sizeof(u32); i += 4)
> +		drm_printf(p, "0x%08x 0x%08x 0x%08x 0x%08x\n",
> +			   *(map + i), *(map + i + 1),
> +			   *(map + i + 2), *(map + i + 3));
> +
> +	drm_puts(p, "\n");
> +
> +	i915_gem_object_unpin_map(obj);
> +
> +	return 0;
> +}
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
> index c252c022c5fc..11fccd0b2294 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
> @@ -79,4 +79,8 @@ static inline u32 intel_guc_log_get_level(struct intel_guc_log *log)
>   	return log->level;
>   }
>   
> +void intel_guc_log_info(struct intel_guc_log *log, struct drm_printer *p);
> +int intel_guc_log_dump(struct intel_guc_log *log, struct drm_printer *p,
> +		       bool dump_load_err);
> +
>   #endif
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.c b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> index d73dc21686e7..d6097b46600c 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
> @@ -218,3 +218,32 @@ int intel_huc_check_status(struct intel_huc *huc)
>   
>   	return (status & huc->status.mask) == huc->status.value;
>   }
> +
> +/**
> + * intel_huc_load_status - dump information about HuC load status
> + * @huc: the HuC
> + * @p: the &drm_printer
> + *
> + * Pretty printer for HuC load status.
> + */
> +void intel_huc_load_status(struct intel_huc *huc, struct drm_printer *p)
> +{
> +	struct intel_gt *gt = huc_to_gt(huc);
> +	intel_wakeref_t wakeref;
> +
> +	if (!intel_huc_is_supported(huc)) {
> +		drm_printf(p, "HuC not supported\n");
> +		return;
> +	}
> +
> +	if (!intel_huc_is_wanted(huc)) {
> +		drm_printf(p, "HuC disabled\n");
> +		return;
> +	}
> +
> +	intel_uc_fw_dump(&huc->fw, p);
> +
> +	with_intel_runtime_pm(gt->uncore->rpm, wakeref)
> +		drm_printf(p, "\nHuC status 0x%08x:\n",
> +			   intel_uncore_read(gt->uncore, HUC_STATUS2));
> +}
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.h b/drivers/gpu/drm/i915/gt/uc/intel_huc.h
> index a40b9cfc6c22..daee43b661d4 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_huc.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.h
> @@ -57,4 +57,6 @@ static inline bool intel_huc_is_authenticated(struct intel_huc *huc)
>   	return intel_uc_fw_is_running(&huc->fw);
>   }
>   
> +void intel_huc_load_status(struct intel_huc *huc, struct drm_printer *p);
> +
>   #endif
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index de94fcd2032b..56504be2a6ec 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1251,105 +1251,32 @@ static int i915_llc(struct seq_file *m, void *data)
>   	return 0;
>   }
>   
> -static int i915_huc_load_status_info(struct seq_file *m, void *data)
> +static int i915_huc_info(struct seq_file *m, void *data)
>   {
>   	struct drm_i915_private *dev_priv = node_to_i915(m->private);
> -	intel_wakeref_t wakeref;
> -	struct drm_printer p;
> -
> -	if (!HAS_GT_UC(dev_priv))
> -		return -ENODEV;
> -
> -	p = drm_seq_file_printer(m);
> -	intel_uc_fw_dump(&dev_priv->gt.uc.huc.fw, &p);
> -
> -	with_intel_runtime_pm(&dev_priv->runtime_pm, wakeref)
> -		seq_printf(m, "\nHuC status 0x%08x:\n", I915_READ(HUC_STATUS2));
> -
> -	return 0;
> -}
> -
> -static int i915_guc_load_status_info(struct seq_file *m, void *data)
> -{
> -	struct drm_i915_private *dev_priv = node_to_i915(m->private);
> -	intel_wakeref_t wakeref;
> -	struct drm_printer p;
> +	struct intel_huc *huc = &dev_priv->gt.uc.huc;
> +	struct drm_printer p = drm_seq_file_printer(m);
>   
> -	if (!HAS_GT_UC(dev_priv))
> +	if (!intel_huc_is_supported(huc))
>   		return -ENODEV;
Isn't this test duplicated inside intel_huc_load_status() with a print 
of 'HuC not supported'? So no need to fail the call here?

>   
> -	p = drm_seq_file_printer(m);
> -	intel_uc_fw_dump(&dev_priv->gt.uc.guc.fw, &p);
> -
> -	with_intel_runtime_pm(&dev_priv->runtime_pm, wakeref) {
> -		u32 tmp = I915_READ(GUC_STATUS);
> -		u32 i;
> -
> -		seq_printf(m, "\nGuC status 0x%08x:\n", tmp);
> -		seq_printf(m, "\tBootrom status = 0x%x\n",
> -			   (tmp & GS_BOOTROM_MASK) >> GS_BOOTROM_SHIFT);
> -		seq_printf(m, "\tuKernel status = 0x%x\n",
> -			   (tmp & GS_UKERNEL_MASK) >> GS_UKERNEL_SHIFT);
> -		seq_printf(m, "\tMIA Core status = 0x%x\n",
> -			   (tmp & GS_MIA_MASK) >> GS_MIA_SHIFT);
> -		seq_puts(m, "\nScratch registers:\n");
> -		for (i = 0; i < 16; i++) {
> -			seq_printf(m, "\t%2d: \t0x%x\n",
> -				   i, I915_READ(SOFT_SCRATCH(i)));
> -		}
> -	}
> +	intel_huc_load_status(huc, &p);
>   
>   	return 0;
>   }
>   
> -static const char *
> -stringify_guc_log_type(enum guc_log_buffer_type type)
> -{
> -	switch (type) {
> -	case GUC_ISR_LOG_BUFFER:
> -		return "ISR";
> -	case GUC_DPC_LOG_BUFFER:
> -		return "DPC";
> -	case GUC_CRASH_DUMP_LOG_BUFFER:
> -		return "CRASH";
> -	default:
> -		MISSING_CASE(type);
> -	}
> -
> -	return "";
> -}
> -
> -static void i915_guc_log_info(struct seq_file *m, struct intel_guc_log *log)
> -{
> -	enum guc_log_buffer_type type;
> -
> -	if (!intel_guc_log_relay_created(log)) {
> -		seq_puts(m, "GuC log relay not created\n");
> -		return;
> -	}
> -
> -	seq_puts(m, "GuC logging stats:\n");
> -
> -	seq_printf(m, "\tRelay full count: %u\n",
> -		   log->relay.full_count);
> -
> -	for (type = GUC_ISR_LOG_BUFFER; type < GUC_MAX_LOG_BUFFER; type++) {
> -		seq_printf(m, "\t%s:\tflush count %10u, overflow count %10u\n",
> -			   stringify_guc_log_type(type),
> -			   log->stats[type].flush,
> -			   log->stats[type].sampled_overflow);
> -	}
> -}
> -
>   static int i915_guc_info(struct seq_file *m, void *data)
>   {
>   	struct drm_i915_private *dev_priv = node_to_i915(m->private);
> -	struct intel_uc *uc = &dev_priv->gt.uc;
> +	struct intel_guc *guc = &dev_priv->gt.uc.guc;
> +	struct drm_printer p = drm_seq_file_printer(m);
>   
> -	if (!intel_uc_uses_guc(uc))
> +	if (!intel_guc_is_supported(guc))
>   		return -ENODEV;
>   
As above. No need to bail if the dump call below is trying to return a 
useful message in the not supported case.

John.

> -	i915_guc_log_info(m, &uc->guc.log);
> +	intel_guc_load_status(guc, &p);
> +	drm_puts(&p, "\n");
> +	intel_guc_log_info(&guc->log, &p);
>   
>   	/* Add more as required ... */
>   
> @@ -1360,39 +1287,14 @@ static int i915_guc_log_dump(struct seq_file *m, void *data)
>   {
>   	struct drm_info_node *node = m->private;
>   	struct drm_i915_private *dev_priv = node_to_i915(node);
> +	struct intel_guc *guc = &dev_priv->gt.uc.guc;
>   	bool dump_load_err = !!node->info_ent->data;
> -	struct drm_i915_gem_object *obj = NULL;
> -	u32 *log;
> -	int i = 0;
> +	struct drm_printer p = drm_seq_file_printer(m);
>   
> -	if (!HAS_GT_UC(dev_priv))
> +	if (!intel_guc_is_supported(guc))
>   		return -ENODEV;
>   
> -	if (dump_load_err)
> -		obj = dev_priv->gt.uc.load_err_log;
> -	else if (dev_priv->gt.uc.guc.log.vma)
> -		obj = dev_priv->gt.uc.guc.log.vma->obj;
> -
> -	if (!obj)
> -		return 0;
> -
> -	log = i915_gem_object_pin_map(obj, I915_MAP_WC);
> -	if (IS_ERR(log)) {
> -		DRM_DEBUG("Failed to pin object\n");
> -		seq_puts(m, "(log data unaccessible)\n");
> -		return PTR_ERR(log);
> -	}
> -
> -	for (i = 0; i < obj->base.size / sizeof(u32); i += 4)
> -		seq_printf(m, "0x%08x 0x%08x 0x%08x 0x%08x\n",
> -			   *(log + i), *(log + i + 1),
> -			   *(log + i + 2), *(log + i + 3));
> -
> -	seq_putc(m, '\n');
> -
> -	i915_gem_object_unpin_map(obj);
> -
> -	return 0;
> +	return intel_guc_log_dump(&guc->log, &p, dump_load_err);
>   }
>   
>   static int i915_guc_log_level_get(void *data, u64 *val)
> @@ -2088,10 +1990,9 @@ static const struct drm_info_list i915_debugfs_list[] = {
>   	{"i915_gem_fence_regs", i915_gem_fence_regs_info, 0},
>   	{"i915_gem_interrupt", i915_interrupt_info, 0},
>   	{"i915_guc_info", i915_guc_info, 0},
> -	{"i915_guc_load_status", i915_guc_load_status_info, 0},
>   	{"i915_guc_log_dump", i915_guc_log_dump, 0},
>   	{"i915_guc_load_err_log_dump", i915_guc_log_dump, 0, (void *)1},
> -	{"i915_huc_load_status", i915_huc_load_status_info, 0},
> +	{"i915_huc_info", i915_huc_info, 0},
>   	{"i915_frequency_info", i915_frequency_info, 0},
>   	{"i915_ring_freq_table", i915_ring_freq_table, 0},
>   	{"i915_context_status", i915_context_status, 0},

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 4/6] drm/i915/debugfs: move uC printers and update debugfs file names
  2020-03-25 17:05   ` John Harrison
@ 2020-03-25 17:14     ` Daniele Ceraolo Spurio
  2020-03-25 17:35       ` John Harrison
  0 siblings, 1 reply; 25+ messages in thread
From: Daniele Ceraolo Spurio @ 2020-03-25 17:14 UTC (permalink / raw)
  To: John Harrison, intel-gfx



On 3/25/20 10:05 AM, John Harrison wrote:
> On 3/11/2020 18:16, Daniele Ceraolo Spurio wrote:
>> Move the printers to the respective files for clarity. The
>> guc_load_status debugfs has been squashed in the guc_info one, has
>> having separate ones wasn't very useful. The HuC debugfs has been
>> renamed huc_info to match.
>>
>> v2: keep printing HUC_STATUS2 (Tony), avoid const->non-const
>>      container_of (Jani)
>>
>> Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: John Harrison <John.C.Harrison@Intel.com>
>> Cc: Matthew Brost <matthew.brost@intel.com>
>> Cc: Tony Ye <tony.ye@intel.com>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> ---
>>   drivers/gpu/drm/i915/gt/uc/intel_guc.c     |  44 +++++++
>>   drivers/gpu/drm/i915/gt/uc/intel_guc.h     |   2 +
>>   drivers/gpu/drm/i915/gt/uc/intel_guc_log.c |  92 +++++++++++++++
>>   drivers/gpu/drm/i915/gt/uc/intel_guc_log.h |   4 +
>>   drivers/gpu/drm/i915/gt/uc/intel_huc.c     |  29 +++++
>>   drivers/gpu/drm/i915/gt/uc/intel_huc.h     |   2 +
>>   drivers/gpu/drm/i915/i915_debugfs.c        | 131 +++------------------
>>   7 files changed, 189 insertions(+), 115 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.c 
>> b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
>> index 827d75073879..861657897c0f 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.c
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.c
>> @@ -723,3 +723,47 @@ int intel_guc_allocate_and_map_vma(struct 
>> intel_guc *guc, u32 size,
>>       return 0;
>>   }
>> +
>> +/**
>> + * intel_guc_load_status - dump information about GuC load status
>> + * @guc: the GuC
>> + * @p: the &drm_printer
>> + *
>> + * Pretty printer for GuC load status.
>> + */
>> +void intel_guc_load_status(struct intel_guc *guc, struct drm_printer *p)
>> +{
>> +    struct intel_gt *gt = guc_to_gt(guc);
>> +    struct intel_uncore *uncore = gt->uncore;
>> +    intel_wakeref_t wakeref;
>> +
>> +    if (!intel_guc_is_supported(guc)) {
>> +        drm_printf(p, "GuC not supported\n");
>> +        return;
>> +    }
>> +
>> +    if (!intel_guc_is_wanted(guc)) {
>> +        drm_printf(p, "GuC disabled\n");
>> +        return;
>> +    }
>> +
>> +    intel_uc_fw_dump(&guc->fw, p);
>> +
>> +    with_intel_runtime_pm(uncore->rpm, wakeref) {
>> +        u32 status = intel_uncore_read(uncore, GUC_STATUS);
>> +        u32 i;
>> +
>> +        drm_printf(p, "\nGuC status 0x%08x:\n", status);
>> +        drm_printf(p, "\tBootrom status = 0x%x\n",
>> +               (status & GS_BOOTROM_MASK) >> GS_BOOTROM_SHIFT);
>> +        drm_printf(p, "\tuKernel status = 0x%x\n",
>> +               (status & GS_UKERNEL_MASK) >> GS_UKERNEL_SHIFT);
>> +        drm_printf(p, "\tMIA Core status = 0x%x\n",
>> +               (status & GS_MIA_MASK) >> GS_MIA_SHIFT);
>> +        drm_puts(p, "\nScratch registers:\n");
>> +        for (i = 0; i < 16; i++) {
>> +            drm_printf(p, "\t%2d: \t0x%x\n",
>> +                   i, intel_uncore_read(uncore, SOFT_SCRATCH(i)));
>> +        }
>> +    }
>> +}
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h 
>> b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
>> index 4594ccbeaa34..a5d7a86be4cf 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
>> @@ -190,4 +190,6 @@ static inline void intel_guc_disable_msg(struct 
>> intel_guc *guc, u32 mask)
>>   int intel_guc_reset_engine(struct intel_guc *guc,
>>                  struct intel_engine_cs *engine);
>> +void intel_guc_load_status(struct intel_guc *guc, struct drm_printer 
>> *p);
>> +
>>   #endif
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c 
>> b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
>> index caed0d57e704..8cdd6dc3df58 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
>> @@ -672,3 +672,95 @@ void intel_guc_log_handle_flush_event(struct 
>> intel_guc_log *log)
>>   {
>>       queue_work(system_highpri_wq, &log->relay.flush_work);
>>   }
>> +
>> +static const char *
>> +stringify_guc_log_type(enum guc_log_buffer_type type)
>> +{
>> +    switch (type) {
>> +    case GUC_ISR_LOG_BUFFER:
>> +        return "ISR";
>> +    case GUC_DPC_LOG_BUFFER:
>> +        return "DPC";
>> +    case GUC_CRASH_DUMP_LOG_BUFFER:
>> +        return "CRASH";
>> +    default:
>> +        MISSING_CASE(type);
>> +    }
>> +
>> +    return "";
>> +}
>> +
>> +/**
>> + * intel_guc_log_info - dump information about GuC log relay
>> + * @guc: the GuC
>> + * @p: the &drm_printer
>> + *
>> + * Pretty printer for GuC log info
>> + */
>> +void intel_guc_log_info(struct intel_guc_log *log, struct drm_printer 
>> *p)
>> +{
>> +    enum guc_log_buffer_type type;
>> +
>> +    if (!intel_guc_log_relay_created(log)) {
>> +        drm_puts(p, "GuC log relay not created\n");
>> +        return;
>> +    }
>> +
>> +    drm_puts(p, "GuC logging stats:\n");
>> +
>> +    drm_printf(p, "\tRelay full count: %u\n", log->relay.full_count);
>> +
>> +    for (type = GUC_ISR_LOG_BUFFER; type < GUC_MAX_LOG_BUFFER; type++) {
>> +        drm_printf(p, "\t%s:\tflush count %10u, overflow count %10u\n",
>> +               stringify_guc_log_type(type),
>> +               log->stats[type].flush,
>> +               log->stats[type].sampled_overflow);
>> +    }
>> +}
>> +
>> +/**
>> + * intel_guc_log_dump - dump the contents of the GuC log
>> + * @log: the GuC log
>> + * @p: the &drm_printer
>> + * @dump_load_err: dump the log saved on GuC load error
>> + *
>> + * Pretty printer for the GuC log
>> + */
>> +int intel_guc_log_dump(struct intel_guc_log *log, struct drm_printer *p,
>> +               bool dump_load_err)
>> +{
>> +    struct intel_guc *guc = log_to_guc(log);
>> +    struct intel_uc *uc = container_of(guc, struct intel_uc, guc);
>> +    struct drm_i915_gem_object *obj = NULL;
>> +    u32 *map;
>> +    int i = 0;
>> +
>> +    if (!intel_guc_is_supported(guc))
>> +        return -ENODEV;
>> +
>> +    if (dump_load_err)
>> +        obj = uc->load_err_log;
>> +    else if (guc->log.vma)
>> +        obj = guc->log.vma->obj;
>> +
>> +    if (!obj)
>> +        return 0;
>> +
>> +    map = i915_gem_object_pin_map(obj, I915_MAP_WC);
>> +    if (IS_ERR(map)) {
>> +        DRM_DEBUG("Failed to pin object\n");
>> +        drm_puts(p, "(log data unaccessible)\n");
>> +        return PTR_ERR(map);
>> +    }
>> +
>> +    for (i = 0; i < obj->base.size / sizeof(u32); i += 4)
>> +        drm_printf(p, "0x%08x 0x%08x 0x%08x 0x%08x\n",
>> +               *(map + i), *(map + i + 1),
>> +               *(map + i + 2), *(map + i + 3));
>> +
>> +    drm_puts(p, "\n");
>> +
>> +    i915_gem_object_unpin_map(obj);
>> +
>> +    return 0;
>> +}
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h 
>> b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
>> index c252c022c5fc..11fccd0b2294 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h
>> @@ -79,4 +79,8 @@ static inline u32 intel_guc_log_get_level(struct 
>> intel_guc_log *log)
>>       return log->level;
>>   }
>> +void intel_guc_log_info(struct intel_guc_log *log, struct drm_printer 
>> *p);
>> +int intel_guc_log_dump(struct intel_guc_log *log, struct drm_printer *p,
>> +               bool dump_load_err);
>> +
>>   #endif
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.c 
>> b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
>> index d73dc21686e7..d6097b46600c 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_huc.c
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
>> @@ -218,3 +218,32 @@ int intel_huc_check_status(struct intel_huc *huc)
>>       return (status & huc->status.mask) == huc->status.value;
>>   }
>> +
>> +/**
>> + * intel_huc_load_status - dump information about HuC load status
>> + * @huc: the HuC
>> + * @p: the &drm_printer
>> + *
>> + * Pretty printer for HuC load status.
>> + */
>> +void intel_huc_load_status(struct intel_huc *huc, struct drm_printer *p)
>> +{
>> +    struct intel_gt *gt = huc_to_gt(huc);
>> +    intel_wakeref_t wakeref;
>> +
>> +    if (!intel_huc_is_supported(huc)) {
>> +        drm_printf(p, "HuC not supported\n");
>> +        return;
>> +    }
>> +
>> +    if (!intel_huc_is_wanted(huc)) {
>> +        drm_printf(p, "HuC disabled\n");
>> +        return;
>> +    }
>> +
>> +    intel_uc_fw_dump(&huc->fw, p);
>> +
>> +    with_intel_runtime_pm(gt->uncore->rpm, wakeref)
>> +        drm_printf(p, "\nHuC status 0x%08x:\n",
>> +               intel_uncore_read(gt->uncore, HUC_STATUS2));
>> +}
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.h 
>> b/drivers/gpu/drm/i915/gt/uc/intel_huc.h
>> index a40b9cfc6c22..daee43b661d4 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_huc.h
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.h
>> @@ -57,4 +57,6 @@ static inline bool intel_huc_is_authenticated(struct 
>> intel_huc *huc)
>>       return intel_uc_fw_is_running(&huc->fw);
>>   }
>> +void intel_huc_load_status(struct intel_huc *huc, struct drm_printer 
>> *p);
>> +
>>   #endif
>> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c 
>> b/drivers/gpu/drm/i915/i915_debugfs.c
>> index de94fcd2032b..56504be2a6ec 100644
>> --- a/drivers/gpu/drm/i915/i915_debugfs.c
>> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
>> @@ -1251,105 +1251,32 @@ static int i915_llc(struct seq_file *m, void 
>> *data)
>>       return 0;
>>   }
>> -static int i915_huc_load_status_info(struct seq_file *m, void *data)
>> +static int i915_huc_info(struct seq_file *m, void *data)
>>   {
>>       struct drm_i915_private *dev_priv = node_to_i915(m->private);
>> -    intel_wakeref_t wakeref;
>> -    struct drm_printer p;
>> -
>> -    if (!HAS_GT_UC(dev_priv))
>> -        return -ENODEV;
>> -
>> -    p = drm_seq_file_printer(m);
>> -    intel_uc_fw_dump(&dev_priv->gt.uc.huc.fw, &p);
>> -
>> -    with_intel_runtime_pm(&dev_priv->runtime_pm, wakeref)
>> -        seq_printf(m, "\nHuC status 0x%08x:\n", I915_READ(HUC_STATUS2));
>> -
>> -    return 0;
>> -}
>> -
>> -static int i915_guc_load_status_info(struct seq_file *m, void *data)
>> -{
>> -    struct drm_i915_private *dev_priv = node_to_i915(m->private);
>> -    intel_wakeref_t wakeref;
>> -    struct drm_printer p;
>> +    struct intel_huc *huc = &dev_priv->gt.uc.huc;
>> +    struct drm_printer p = drm_seq_file_printer(m);
>> -    if (!HAS_GT_UC(dev_priv))
>> +    if (!intel_huc_is_supported(huc))
>>           return -ENODEV;
> Isn't this test duplicated inside intel_huc_load_status() with a print 
> of 'HuC not supported'? So no need to fail the call here?
> 

intel_huc_load_status is now a generic printer which can be called from 
other places, so it needs to print useful messages in all cases. From 
the debugfs POV, I didn't want to change the legacy behavior of 
returning -ENODEV on platforms that don't support the blob, which IMO is 
a clear eough indication of the lack of support. Note that in the next 
patch the code is changed so that the debgufs files are not even created 
if there is no uC support on the platforms (this is in line with what we 
do for other GT features).

Daniele

>> -    p = drm_seq_file_printer(m);
>> -    intel_uc_fw_dump(&dev_priv->gt.uc.guc.fw, &p);
>> -
>> -    with_intel_runtime_pm(&dev_priv->runtime_pm, wakeref) {
>> -        u32 tmp = I915_READ(GUC_STATUS);
>> -        u32 i;
>> -
>> -        seq_printf(m, "\nGuC status 0x%08x:\n", tmp);
>> -        seq_printf(m, "\tBootrom status = 0x%x\n",
>> -               (tmp & GS_BOOTROM_MASK) >> GS_BOOTROM_SHIFT);
>> -        seq_printf(m, "\tuKernel status = 0x%x\n",
>> -               (tmp & GS_UKERNEL_MASK) >> GS_UKERNEL_SHIFT);
>> -        seq_printf(m, "\tMIA Core status = 0x%x\n",
>> -               (tmp & GS_MIA_MASK) >> GS_MIA_SHIFT);
>> -        seq_puts(m, "\nScratch registers:\n");
>> -        for (i = 0; i < 16; i++) {
>> -            seq_printf(m, "\t%2d: \t0x%x\n",
>> -                   i, I915_READ(SOFT_SCRATCH(i)));
>> -        }
>> -    }
>> +    intel_huc_load_status(huc, &p);
>>       return 0;
>>   }
>> -static const char *
>> -stringify_guc_log_type(enum guc_log_buffer_type type)
>> -{
>> -    switch (type) {
>> -    case GUC_ISR_LOG_BUFFER:
>> -        return "ISR";
>> -    case GUC_DPC_LOG_BUFFER:
>> -        return "DPC";
>> -    case GUC_CRASH_DUMP_LOG_BUFFER:
>> -        return "CRASH";
>> -    default:
>> -        MISSING_CASE(type);
>> -    }
>> -
>> -    return "";
>> -}
>> -
>> -static void i915_guc_log_info(struct seq_file *m, struct 
>> intel_guc_log *log)
>> -{
>> -    enum guc_log_buffer_type type;
>> -
>> -    if (!intel_guc_log_relay_created(log)) {
>> -        seq_puts(m, "GuC log relay not created\n");
>> -        return;
>> -    }
>> -
>> -    seq_puts(m, "GuC logging stats:\n");
>> -
>> -    seq_printf(m, "\tRelay full count: %u\n",
>> -           log->relay.full_count);
>> -
>> -    for (type = GUC_ISR_LOG_BUFFER; type < GUC_MAX_LOG_BUFFER; type++) {
>> -        seq_printf(m, "\t%s:\tflush count %10u, overflow count %10u\n",
>> -               stringify_guc_log_type(type),
>> -               log->stats[type].flush,
>> -               log->stats[type].sampled_overflow);
>> -    }
>> -}
>> -
>>   static int i915_guc_info(struct seq_file *m, void *data)
>>   {
>>       struct drm_i915_private *dev_priv = node_to_i915(m->private);
>> -    struct intel_uc *uc = &dev_priv->gt.uc;
>> +    struct intel_guc *guc = &dev_priv->gt.uc.guc;
>> +    struct drm_printer p = drm_seq_file_printer(m);
>> -    if (!intel_uc_uses_guc(uc))
>> +    if (!intel_guc_is_supported(guc))
>>           return -ENODEV;
> As above. No need to bail if the dump call below is trying to return a 
> useful message in the not supported case.
> 
> John.
> 
>> -    i915_guc_log_info(m, &uc->guc.log);
>> +    intel_guc_load_status(guc, &p);
>> +    drm_puts(&p, "\n");
>> +    intel_guc_log_info(&guc->log, &p);
>>       /* Add more as required ... */
>> @@ -1360,39 +1287,14 @@ static int i915_guc_log_dump(struct seq_file 
>> *m, void *data)
>>   {
>>       struct drm_info_node *node = m->private;
>>       struct drm_i915_private *dev_priv = node_to_i915(node);
>> +    struct intel_guc *guc = &dev_priv->gt.uc.guc;
>>       bool dump_load_err = !!node->info_ent->data;
>> -    struct drm_i915_gem_object *obj = NULL;
>> -    u32 *log;
>> -    int i = 0;
>> +    struct drm_printer p = drm_seq_file_printer(m);
>> -    if (!HAS_GT_UC(dev_priv))
>> +    if (!intel_guc_is_supported(guc))
>>           return -ENODEV;
>> -    if (dump_load_err)
>> -        obj = dev_priv->gt.uc.load_err_log;
>> -    else if (dev_priv->gt.uc.guc.log.vma)
>> -        obj = dev_priv->gt.uc.guc.log.vma->obj;
>> -
>> -    if (!obj)
>> -        return 0;
>> -
>> -    log = i915_gem_object_pin_map(obj, I915_MAP_WC);
>> -    if (IS_ERR(log)) {
>> -        DRM_DEBUG("Failed to pin object\n");
>> -        seq_puts(m, "(log data unaccessible)\n");
>> -        return PTR_ERR(log);
>> -    }
>> -
>> -    for (i = 0; i < obj->base.size / sizeof(u32); i += 4)
>> -        seq_printf(m, "0x%08x 0x%08x 0x%08x 0x%08x\n",
>> -               *(log + i), *(log + i + 1),
>> -               *(log + i + 2), *(log + i + 3));
>> -
>> -    seq_putc(m, '\n');
>> -
>> -    i915_gem_object_unpin_map(obj);
>> -
>> -    return 0;
>> +    return intel_guc_log_dump(&guc->log, &p, dump_load_err);
>>   }
>>   static int i915_guc_log_level_get(void *data, u64 *val)
>> @@ -2088,10 +1990,9 @@ static const struct drm_info_list 
>> i915_debugfs_list[] = {
>>       {"i915_gem_fence_regs", i915_gem_fence_regs_info, 0},
>>       {"i915_gem_interrupt", i915_interrupt_info, 0},
>>       {"i915_guc_info", i915_guc_info, 0},
>> -    {"i915_guc_load_status", i915_guc_load_status_info, 0},
>>       {"i915_guc_log_dump", i915_guc_log_dump, 0},
>>       {"i915_guc_load_err_log_dump", i915_guc_log_dump, 0, (void *)1},
>> -    {"i915_huc_load_status", i915_huc_load_status_info, 0},
>> +    {"i915_huc_info", i915_huc_info, 0},
>>       {"i915_frequency_info", i915_frequency_info, 0},
>>       {"i915_ring_freq_table", i915_ring_freq_table, 0},
>>       {"i915_context_status", i915_context_status, 0},
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 4/6] drm/i915/debugfs: move uC printers and update debugfs file names
  2020-03-25 17:14     ` Daniele Ceraolo Spurio
@ 2020-03-25 17:35       ` John Harrison
  0 siblings, 0 replies; 25+ messages in thread
From: John Harrison @ 2020-03-25 17:35 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio, intel-gfx

On 3/25/2020 10:14, Daniele Ceraolo Spurio wrote:
> On 3/25/20 10:05 AM, John Harrison wrote:
>> On 3/11/2020 18:16, Daniele Ceraolo Spurio wrote:
>>> Move the printers to the respective files for clarity. The
>>> guc_load_status debugfs has been squashed in the guc_info one, has
>>> having separate ones wasn't very useful. The HuC debugfs has been
>>> renamed huc_info to match.
>>>
>>> v2: keep printing HUC_STATUS2 (Tony), avoid const->non-const
>>>      container_of (Jani)
>>>
>>> Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>>> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>>> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
>>> Cc: John Harrison <John.C.Harrison@Intel.com>
>>> Cc: Matthew Brost <matthew.brost@intel.com>
>>> Cc: Tony Ye <tony.ye@intel.com>
>>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>>> ---
>>> <snip>
>>>
>>> +static int i915_huc_info(struct seq_file *m, void *data)
>>>   {
>>>       struct drm_i915_private *dev_priv = node_to_i915(m->private);
>>> -    intel_wakeref_t wakeref;
>>> -    struct drm_printer p;
>>> -
>>> -    if (!HAS_GT_UC(dev_priv))
>>> -        return -ENODEV;
>>> -
>>> -    p = drm_seq_file_printer(m);
>>> -    intel_uc_fw_dump(&dev_priv->gt.uc.huc.fw, &p);
>>> -
>>> -    with_intel_runtime_pm(&dev_priv->runtime_pm, wakeref)
>>> -        seq_printf(m, "\nHuC status 0x%08x:\n", 
>>> I915_READ(HUC_STATUS2));
>>> -
>>> -    return 0;
>>> -}
>>> -
>>> -static int i915_guc_load_status_info(struct seq_file *m, void *data)
>>> -{
>>> -    struct drm_i915_private *dev_priv = node_to_i915(m->private);
>>> -    intel_wakeref_t wakeref;
>>> -    struct drm_printer p;
>>> +    struct intel_huc *huc = &dev_priv->gt.uc.huc;
>>> +    struct drm_printer p = drm_seq_file_printer(m);
>>> -    if (!HAS_GT_UC(dev_priv))
>>> +    if (!intel_huc_is_supported(huc))
>>>           return -ENODEV;
>> Isn't this test duplicated inside intel_huc_load_status() with a 
>> print of 'HuC not supported'? So no need to fail the call here?
>>
>
> intel_huc_load_status is now a generic printer which can be called 
> from other places, so it needs to print useful messages in all cases. 
> From the debugfs POV, I didn't want to change the legacy behavior of 
> returning -ENODEV on platforms that don't support the blob, which IMO 
> is a clear eough indication of the lack of support. Note that in the 
> next patch the code is changed so that the debgufs files are not even 
> created if there is no uC support on the platforms (this is in line 
> with what we do for other GT features).
>
> Daniele
>
Okay. That makes sense.

Reviewed-by: John Harrison <John.C.Harrison@Intel.com>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 6/6] drm/i915/uc: do not free err log on uc_fini
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 6/6] drm/i915/uc: do not free err log on uc_fini Daniele Ceraolo Spurio
@ 2020-03-25 17:58   ` John Harrison
  2020-03-25 18:03     ` Daniele Ceraolo Spurio
  0 siblings, 1 reply; 25+ messages in thread
From: John Harrison @ 2020-03-25 17:58 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio, intel-gfx

On 3/11/2020 18:16, Daniele Ceraolo Spurio wrote:
> we do call uc_fini if there is an issue while loading the GuC, so we
> can't delete in there the logs we need to debug the load failure.
> Moving the log free to driver remove ensures the logs stick around ong
> enough for us to dump them.
I think this could be worded better and has a couple of typos.

Otherwise it looks plausible.
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>

> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
>   drivers/gpu/drm/i915/gt/intel_gt.c    | 3 +--
>   drivers/gpu/drm/i915/gt/uc/intel_uc.c | 9 +++++++--
>   drivers/gpu/drm/i915/gt/uc/intel_uc.h | 1 +
>   3 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c
> index 3dea8881e915..eda66b0d44bd 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
> @@ -635,8 +635,7 @@ void intel_gt_driver_remove(struct intel_gt *gt)
>   {
>   	__intel_gt_disable(gt);
>   
> -	intel_uc_fini_hw(&gt->uc);
> -	intel_uc_fini(&gt->uc);
> +	intel_uc_driver_remove(&gt->uc);
>   
>   	intel_engines_release(gt);
>   }
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> index a4cbe06e06bd..b11e564ef22e 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> @@ -131,6 +131,13 @@ static void __uc_free_load_err_log(struct intel_uc *uc)
>   		i915_gem_object_put(log);
>   }
>   
> +void intel_uc_driver_remove(struct intel_uc *uc)
> +{
> +	intel_uc_fini_hw(uc);
> +	intel_uc_fini(uc);
> +	__uc_free_load_err_log(uc);
> +}
> +
>   static inline bool guc_communication_enabled(struct intel_guc *guc)
>   {
>   	return intel_guc_ct_enabled(&guc->ct);
> @@ -311,8 +318,6 @@ static void __uc_fini(struct intel_uc *uc)
>   {
>   	intel_huc_fini(&uc->huc);
>   	intel_guc_fini(&uc->guc);
> -
> -	__uc_free_load_err_log(uc);
>   }
>   
>   static int __uc_sanitize(struct intel_uc *uc)
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.h b/drivers/gpu/drm/i915/gt/uc/intel_uc.h
> index 5ae7b50b7dc1..9c954c589edf 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.h
> @@ -34,6 +34,7 @@ struct intel_uc {
>   
>   void intel_uc_init_early(struct intel_uc *uc);
>   void intel_uc_driver_late_release(struct intel_uc *uc);
> +void intel_uc_driver_remove(struct intel_uc *uc);
>   void intel_uc_init_mmio(struct intel_uc *uc);
>   void intel_uc_reset_prepare(struct intel_uc *uc);
>   void intel_uc_suspend(struct intel_uc *uc);

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 6/6] drm/i915/uc: do not free err log on uc_fini
  2020-03-25 17:58   ` John Harrison
@ 2020-03-25 18:03     ` Daniele Ceraolo Spurio
  2020-03-25 18:05       ` John Harrison
  0 siblings, 1 reply; 25+ messages in thread
From: Daniele Ceraolo Spurio @ 2020-03-25 18:03 UTC (permalink / raw)
  To: John Harrison, intel-gfx



On 3/25/20 10:58 AM, John Harrison wrote:
> On 3/11/2020 18:16, Daniele Ceraolo Spurio wrote:
>> we do call uc_fini if there is an issue while loading the GuC, so we
>> can't delete in there the logs we need to debug the load failure.
>> Moving the log free to driver remove ensures the logs stick around ong
>> enough for us to dump them.
> I think this could be worded better and has a couple of typos.
> 

How about:

"We need to keep the GuC error logs around to debug the load failure, so 
we can't clean them in the error unwind, which includes uc_fini(). 
Moving the cleanup to driver remove ensures that the logs stick around 
long enough for us to dump them."

?

Daniele

> Otherwise it looks plausible.
> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
> 
>> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> ---
>>   drivers/gpu/drm/i915/gt/intel_gt.c    | 3 +--
>>   drivers/gpu/drm/i915/gt/uc/intel_uc.c | 9 +++++++--
>>   drivers/gpu/drm/i915/gt/uc/intel_uc.h | 1 +
>>   3 files changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c 
>> b/drivers/gpu/drm/i915/gt/intel_gt.c
>> index 3dea8881e915..eda66b0d44bd 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_gt.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_gt.c
>> @@ -635,8 +635,7 @@ void intel_gt_driver_remove(struct intel_gt *gt)
>>   {
>>       __intel_gt_disable(gt);
>> -    intel_uc_fini_hw(&gt->uc);
>> -    intel_uc_fini(&gt->uc);
>> +    intel_uc_driver_remove(&gt->uc);
>>       intel_engines_release(gt);
>>   }
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c 
>> b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
>> index a4cbe06e06bd..b11e564ef22e 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
>> @@ -131,6 +131,13 @@ static void __uc_free_load_err_log(struct 
>> intel_uc *uc)
>>           i915_gem_object_put(log);
>>   }
>> +void intel_uc_driver_remove(struct intel_uc *uc)
>> +{
>> +    intel_uc_fini_hw(uc);
>> +    intel_uc_fini(uc);
>> +    __uc_free_load_err_log(uc);
>> +}
>> +
>>   static inline bool guc_communication_enabled(struct intel_guc *guc)
>>   {
>>       return intel_guc_ct_enabled(&guc->ct);
>> @@ -311,8 +318,6 @@ static void __uc_fini(struct intel_uc *uc)
>>   {
>>       intel_huc_fini(&uc->huc);
>>       intel_guc_fini(&uc->guc);
>> -
>> -    __uc_free_load_err_log(uc);
>>   }
>>   static int __uc_sanitize(struct intel_uc *uc)
>> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.h 
>> b/drivers/gpu/drm/i915/gt/uc/intel_uc.h
>> index 5ae7b50b7dc1..9c954c589edf 100644
>> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc.h
>> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.h
>> @@ -34,6 +34,7 @@ struct intel_uc {
>>   void intel_uc_init_early(struct intel_uc *uc);
>>   void intel_uc_driver_late_release(struct intel_uc *uc);
>> +void intel_uc_driver_remove(struct intel_uc *uc);
>>   void intel_uc_init_mmio(struct intel_uc *uc);
>>   void intel_uc_reset_prepare(struct intel_uc *uc);
>>   void intel_uc_suspend(struct intel_uc *uc);
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 6/6] drm/i915/uc: do not free err log on uc_fini
  2020-03-25 18:03     ` Daniele Ceraolo Spurio
@ 2020-03-25 18:05       ` John Harrison
  0 siblings, 0 replies; 25+ messages in thread
From: John Harrison @ 2020-03-25 18:05 UTC (permalink / raw)
  To: Daniele Ceraolo Spurio, intel-gfx

On 3/25/2020 11:03, Daniele Ceraolo Spurio wrote:
> On 3/25/20 10:58 AM, John Harrison wrote:
>> On 3/11/2020 18:16, Daniele Ceraolo Spurio wrote:
>>> we do call uc_fini if there is an issue while loading the GuC, so we
>>> can't delete in there the logs we need to debug the load failure.
>>> Moving the log free to driver remove ensures the logs stick around ong
>>> enough for us to dump them.
>> I think this could be worded better and has a couple of typos.
>>
>
> How about:
>
> "We need to keep the GuC error logs around to debug the load failure, 
> so we can't clean them in the error unwind, which includes uc_fini(). 
> Moving the cleanup to driver remove ensures that the logs stick around 
> long enough for us to dump them."
>
> ?
>
> Daniele
>
Sounds good to me :).

Reviewed-by: John Harrison <John.C.Harrison@Intel.com>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Intel-gfx] [PATCH v2 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT
  2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT Daniele Ceraolo Spurio
  2020-03-12  9:10   ` Jani Nikula
  2020-03-13 15:38   ` Andi Shyti
@ 2020-03-25 21:03   ` Daniele Ceraolo Spurio
  2 siblings, 0 replies; 25+ messages in thread
From: Daniele Ceraolo Spurio @ 2020-03-25 21:03 UTC (permalink / raw)
  To: intel-gfx



On 3/11/20 6:16 PM, Daniele Ceraolo Spurio wrote:
> uC is a component of the GT, so it makes sense for the uC debugfs files
> to be in the GT folder. A subfolder has been used to keep the same
> structure we have for the code.
> 
> v2: use intel_* prefix (Jani), rebase on new gt_debugfs_register_files,
>      fix permissions for writable debugfs files.
> 
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Andi Shyti <andi.shyti@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Tony Ye <tony.ye@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/Makefile                |   7 +-
>   drivers/gpu/drm/i915/gt/debugfs_gt.c         |   6 +-
>   drivers/gpu/drm/i915/gt/uc/debugfs_guc.c     |  42 ++++++
>   drivers/gpu/drm/i915/gt/uc/debugfs_guc.h     |  14 ++
>   drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c | 124 +++++++++++++++++
>   drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h |  15 ++
>   drivers/gpu/drm/i915/gt/uc/debugfs_huc.c     |  36 +++++
>   drivers/gpu/drm/i915/gt/uc/debugfs_huc.h     |  14 ++
>   drivers/gpu/drm/i915/gt/uc/debugfs_uc.c      |  31 +++++
>   drivers/gpu/drm/i915/gt/uc/debugfs_uc.h      |  14 ++
>   drivers/gpu/drm/i915/gt/uc/intel_guc.h       |   5 +
>   drivers/gpu/drm/i915/gt/uc/intel_guc_log.c   |   5 -
>   drivers/gpu/drm/i915/i915_debugfs.c          | 137 -------------------
>   13 files changed, 306 insertions(+), 144 deletions(-)
>   create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc.c
>   create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc.h
>   create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c
>   create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h
>   create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_huc.c
>   create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_huc.h
>   create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_uc.c
>   create mode 100644 drivers/gpu/drm/i915/gt/uc/debugfs_uc.h
> 
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index 9f887a86e555..f862ac6615d8 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -166,7 +166,12 @@ i915-y += \
>   	  intel_wopcm.o
>   
>   # general-purpose microcontroller (GuC) support
> -i915-y += gt/uc/intel_uc.o \
> +i915-y += \
> +	  gt/uc/debugfs_guc.o \
> +	  gt/uc/debugfs_guc_log.o \
> +	  gt/uc/debugfs_huc.o \
> +	  gt/uc/debugfs_uc.o \

In an IM discussion Michal suggested to rename those files to 
intel_uc_debugfs, intel_guc_debugfs etc. This would be different from 
the files under gt/. Before I do it, does anyone have a problem with the 
renaming?

Daniele

> +	  gt/uc/intel_uc.o \
>   	  gt/uc/intel_uc_fw.o \
>   	  gt/uc/intel_guc.o \
>   	  gt/uc/intel_guc_ads.o \
> diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt.c b/drivers/gpu/drm/i915/gt/debugfs_gt.c
> index de73b63d6ba7..fcbc57e226c3 100644
> --- a/drivers/gpu/drm/i915/gt/debugfs_gt.c
> +++ b/drivers/gpu/drm/i915/gt/debugfs_gt.c
> @@ -9,6 +9,7 @@
>   #include "debugfs_engines.h"
>   #include "debugfs_gt.h"
>   #include "debugfs_gt_pm.h"
> +#include "uc/debugfs_uc.h"
>   #include "i915_drv.h"
>   
>   void debugfs_gt_register(struct intel_gt *gt)
> @@ -24,6 +25,8 @@ void debugfs_gt_register(struct intel_gt *gt)
>   
>   	debugfs_engines_register(gt, root);
>   	debugfs_gt_pm_register(gt, root);
> +
> +	intel_uc_debugfs_register(&gt->uc, root);
>   }
>   
>   void intel_gt_debugfs_register_files(struct dentry *root,
> @@ -31,9 +34,10 @@ void intel_gt_debugfs_register_files(struct dentry *root,
>   				     unsigned long count, void *data)
>   {
>   	while (count--) {
> +		umode_t mode = files->fops->write ? 0644 : 0444;
>   		if (!files->eval || files->eval(data))
>   			debugfs_create_file(files->name,
> -					    0444, root, data,
> +					    mode, root, data,
>   					    files->fops);
>   
>   		files++;
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc.c b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.c
> new file mode 100644
> index 000000000000..4506b52a61f2
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.c
> @@ -0,0 +1,42 @@
> +// SPDX-License-Identifier: MIT
> +
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#include <drm/drm_print.h>
> +
> +#include "gt/debugfs_gt.h"
> +#include "debugfs_guc_log.h"
> +#include "intel_guc.h"
> +
> +static int guc_info_show(struct seq_file *m, void *data)
> +{
> +	struct intel_guc *guc = m->private;
> +	struct drm_printer p = drm_seq_file_printer(m);
> +
> +	if (!intel_guc_is_supported(guc))
> +		return -ENODEV;
> +
> +	intel_guc_load_status(guc, &p);
> +	drm_puts(&p, "\n");
> +	intel_guc_log_info(&guc->log, &p);
> +
> +	/* Add more as required ... */
> +
> +	return 0;
> +}
> +DEFINE_GT_DEBUGFS_ATTRIBUTE(guc_info);
> +
> +void intel_guc_debugfs_register(struct intel_guc *guc, struct dentry *root)
> +{
> +	static const struct debugfs_gt_file files[] = {
> +		{ "guc_info", &guc_info_fops, NULL },
> +	};
> +
> +	if (!intel_guc_is_supported(guc))
> +		return;
> +
> +	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), guc);
> +	intel_guc_log_debugfs_register(&guc->log, root);
> +}
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc.h b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.h
> new file mode 100644
> index 000000000000..424c26665cf1
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc.h
> @@ -0,0 +1,14 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#ifndef DEBUGFS_GUC_H
> +#define DEBUGFS_GUC_H
> +
> +struct intel_guc;
> +struct dentry;
> +
> +void intel_guc_debugfs_register(struct intel_guc *guc, struct dentry *root);
> +
> +#endif /* DEBUGFS_GUC_H */
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c
> new file mode 100644
> index 000000000000..8bc2922915f4
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.c
> @@ -0,0 +1,124 @@
> +// SPDX-License-Identifier: MIT
> +
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#include <linux/fs.h>
> +#include <drm/drm_print.h>
> +
> +#include "gt/debugfs_gt.h"
> +#include "intel_guc.h"
> +#include "intel_guc_log.h"
> +
> +static int guc_log_dump_show(struct seq_file *m, void *data)
> +{
> +	struct drm_printer p = drm_seq_file_printer(m);
> +
> +	return intel_guc_log_dump(m->private, &p, false);
> +}
> +DEFINE_GT_DEBUGFS_ATTRIBUTE(guc_log_dump);
> +
> +static int guc_load_err_log_dump_show(struct seq_file *m, void *data)
> +{
> +	struct drm_printer p = drm_seq_file_printer(m);
> +
> +	return intel_guc_log_dump(m->private, &p, true);
> +}
> +DEFINE_GT_DEBUGFS_ATTRIBUTE(guc_load_err_log_dump);
> +
> +static int guc_log_level_get(void *data, u64 *val)
> +{
> +	struct intel_guc_log *log = data;
> +
> +	if (!intel_guc_is_used(log_to_guc(log)))
> +		return -ENODEV;
> +
> +	*val = intel_guc_log_get_level(log);
> +
> +	return 0;
> +}
> +
> +static int guc_log_level_set(void *data, u64 val)
> +{
> +	struct intel_guc_log *log = data;
> +
> +	if (!intel_guc_is_used(log_to_guc(log)))
> +		return -ENODEV;
> +
> +	return intel_guc_log_set_level(log, val);
> +}
> +
> +DEFINE_SIMPLE_ATTRIBUTE(guc_log_level_fops,
> +			guc_log_level_get, guc_log_level_set,
> +			"%lld\n");
> +
> +static int guc_log_relay_open(struct inode *inode, struct file *file)
> +{
> +	struct intel_guc_log *log = inode->i_private;
> +
> +	if (!intel_guc_is_ready(log_to_guc(log)))
> +		return -ENODEV;
> +
> +	file->private_data = log;
> +
> +	return intel_guc_log_relay_open(log);
> +}
> +
> +static ssize_t
> +guc_log_relay_write(struct file *filp,
> +		    const char __user *ubuf,
> +		    size_t cnt,
> +		    loff_t *ppos)
> +{
> +	struct intel_guc_log *log = filp->private_data;
> +	int val;
> +	int ret;
> +
> +	ret = kstrtoint_from_user(ubuf, cnt, 0, &val);
> +	if (ret < 0)
> +		return ret;
> +
> +	/*
> +	 * Enable and start the guc log relay on value of 1.
> +	 * Flush log relay for any other value.
> +	 */
> +	if (val == 1)
> +		ret = intel_guc_log_relay_start(log);
> +	else
> +		intel_guc_log_relay_flush(log);
> +
> +	return ret ?: cnt;
> +}
> +
> +static int guc_log_relay_release(struct inode *inode, struct file *file)
> +{
> +	struct intel_guc_log *log = inode->i_private;
> +
> +	intel_guc_log_relay_close(log);
> +	return 0;
> +}
> +
> +static const struct file_operations guc_log_relay_fops = {
> +	.owner = THIS_MODULE,
> +	.open = guc_log_relay_open,
> +	.write = guc_log_relay_write,
> +	.release = guc_log_relay_release,
> +};
> +
> +void intel_guc_log_debugfs_register(struct intel_guc_log *log,
> +				    struct dentry *root)
> +{
> +	static const struct debugfs_gt_file files[] = {
> +		{ "guc_log_dump", &guc_log_dump_fops, NULL },
> +		{ "guc_load_err_log_dump", &guc_load_err_log_dump_fops, NULL },
> +		{ "guc_log_level", &guc_log_level_fops, NULL },
> +		{ "guc_log_relay", &guc_log_relay_fops, NULL },
> +	};
> +
> +	if (!intel_guc_is_supported(log_to_guc(log)))
> +		return;
> +
> +	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), log);
> +}
> +
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h
> new file mode 100644
> index 000000000000..e8900e3d74ea
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_guc_log.h
> @@ -0,0 +1,15 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#ifndef DEBUGFS_GUC_LOG_H
> +#define DEBUGFS_GUC_LOG_H
> +
> +struct intel_guc_log;
> +struct dentry;
> +
> +void intel_guc_log_debugfs_register(struct intel_guc_log *log,
> +				    struct dentry *root);
> +
> +#endif /* DEBUGFS_GUC_LOG_H */
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_huc.c b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.c
> new file mode 100644
> index 000000000000..497e4c693f83
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.c
> @@ -0,0 +1,36 @@
> +// SPDX-License-Identifier: MIT
> +
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#include <drm/drm_print.h>
> +
> +#include "gt/debugfs_gt.h"
> +#include "intel_huc.h"
> +
> +static int huc_info_show(struct seq_file *m, void *data)
> +{
> +	struct intel_huc *huc = m->private;
> +	struct drm_printer p = drm_seq_file_printer(m);
> +
> +	if (!intel_huc_is_supported(huc))
> +		return -ENODEV;
> +
> +	intel_huc_load_status(huc, &p);
> +
> +	return 0;
> +}
> +DEFINE_GT_DEBUGFS_ATTRIBUTE(huc_info);
> +
> +void intel_huc_debugfs_register(struct intel_huc *huc, struct dentry *root)
> +{
> +	static const struct debugfs_gt_file files[] = {
> +		{ "huc_info", &huc_info_fops, NULL },
> +	};
> +
> +	if (!intel_huc_is_supported(huc))
> +		return;
> +
> +	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), huc);
> +}
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_huc.h b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.h
> new file mode 100644
> index 000000000000..be79e992f976
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_huc.h
> @@ -0,0 +1,14 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#ifndef DEBUGFS_HUC_H
> +#define DEBUGFS_HUC_H
> +
> +struct intel_huc;
> +struct dentry;
> +
> +void intel_huc_debugfs_register(struct intel_huc *huc, struct dentry *root);
> +
> +#endif /* DEBUGFS_HUC_H */
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_uc.c b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.c
> new file mode 100644
> index 000000000000..fd18347f8d1c
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.c
> @@ -0,0 +1,31 @@
> +// SPDX-License-Identifier: MIT
> +
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#include <linux/debugfs.h>
> +
> +#include "debugfs_guc.h"
> +#include "debugfs_huc.h"
> +#include "debugfs_uc.h"
> +#include "intel_uc.h"
> +
> +void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root)
> +{
> +	struct dentry *root;
> +
> +	if (!gt_root)
> +		return;
> +
> +	/* GuC and HuC go always in pair, no need to check both */
> +	if (!intel_uc_supports_guc(uc))
> +		return;
> +
> +	root = debugfs_create_dir("uc", gt_root);
> +	if (IS_ERR(root))
> +		return;
> +
> +	intel_guc_debugfs_register(&uc->guc, root);
> +	intel_huc_debugfs_register(&uc->huc, root);
> +}
> diff --git a/drivers/gpu/drm/i915/gt/uc/debugfs_uc.h b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.h
> new file mode 100644
> index 000000000000..010ce250d223
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/gt/uc/debugfs_uc.h
> @@ -0,0 +1,14 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2020 Intel Corporation
> + */
> +
> +#ifndef DEBUGFS_UC_H
> +#define DEBUGFS_UC_H
> +
> +struct intel_uc;
> +struct dentry;
> +
> +void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root);
> +
> +#endif /* DEBUGFS_UC_H */
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> index a5d7a86be4cf..e84ab67b317d 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> @@ -74,6 +74,11 @@ struct intel_guc {
>   	struct mutex send_mutex;
>   };
>   
> +static inline struct intel_guc *log_to_guc(struct intel_guc_log *log)
> +{
> +	return container_of(log, struct intel_guc, log);
> +}
> +
>   static
>   inline int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len)
>   {
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> index 8cdd6dc3df58..5b11a6d8e27f 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> @@ -55,11 +55,6 @@ static int guc_action_control_log(struct intel_guc *guc, bool enable,
>   	return intel_guc_send(guc, action, ARRAY_SIZE(action));
>   }
>   
> -static inline struct intel_guc *log_to_guc(struct intel_guc_log *log)
> -{
> -	return container_of(log, struct intel_guc, log);
> -}
> -
>   static void guc_log_enable_flush_events(struct intel_guc_log *log)
>   {
>   	intel_guc_enable_msg(log_to_guc(log),
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 56504be2a6ec..e60a5750ea44 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -37,7 +37,6 @@
>   #include "gt/intel_reset.h"
>   #include "gt/intel_rc6.h"
>   #include "gt/intel_rps.h"
> -#include "gt/uc/intel_guc_submission.h"
>   
>   #include "i915_debugfs.h"
>   #include "i915_debugfs_params.h"
> @@ -1251,136 +1250,6 @@ static int i915_llc(struct seq_file *m, void *data)
>   	return 0;
>   }
>   
> -static int i915_huc_info(struct seq_file *m, void *data)
> -{
> -	struct drm_i915_private *dev_priv = node_to_i915(m->private);
> -	struct intel_huc *huc = &dev_priv->gt.uc.huc;
> -	struct drm_printer p = drm_seq_file_printer(m);
> -
> -	if (!intel_huc_is_supported(huc))
> -		return -ENODEV;
> -
> -	intel_huc_load_status(huc, &p);
> -
> -	return 0;
> -}
> -
> -static int i915_guc_info(struct seq_file *m, void *data)
> -{
> -	struct drm_i915_private *dev_priv = node_to_i915(m->private);
> -	struct intel_guc *guc = &dev_priv->gt.uc.guc;
> -	struct drm_printer p = drm_seq_file_printer(m);
> -
> -	if (!intel_guc_is_supported(guc))
> -		return -ENODEV;
> -
> -	intel_guc_load_status(guc, &p);
> -	drm_puts(&p, "\n");
> -	intel_guc_log_info(&guc->log, &p);
> -
> -	/* Add more as required ... */
> -
> -	return 0;
> -}
> -
> -static int i915_guc_log_dump(struct seq_file *m, void *data)
> -{
> -	struct drm_info_node *node = m->private;
> -	struct drm_i915_private *dev_priv = node_to_i915(node);
> -	struct intel_guc *guc = &dev_priv->gt.uc.guc;
> -	bool dump_load_err = !!node->info_ent->data;
> -	struct drm_printer p = drm_seq_file_printer(m);
> -
> -	if (!intel_guc_is_supported(guc))
> -		return -ENODEV;
> -
> -	return intel_guc_log_dump(&guc->log, &p, dump_load_err);
> -}
> -
> -static int i915_guc_log_level_get(void *data, u64 *val)
> -{
> -	struct drm_i915_private *dev_priv = data;
> -	struct intel_uc *uc = &dev_priv->gt.uc;
> -
> -	if (!intel_uc_uses_guc(uc))
> -		return -ENODEV;
> -
> -	*val = intel_guc_log_get_level(&uc->guc.log);
> -
> -	return 0;
> -}
> -
> -static int i915_guc_log_level_set(void *data, u64 val)
> -{
> -	struct drm_i915_private *dev_priv = data;
> -	struct intel_uc *uc = &dev_priv->gt.uc;
> -
> -	if (!intel_uc_uses_guc(uc))
> -		return -ENODEV;
> -
> -	return intel_guc_log_set_level(&uc->guc.log, val);
> -}
> -
> -DEFINE_SIMPLE_ATTRIBUTE(i915_guc_log_level_fops,
> -			i915_guc_log_level_get, i915_guc_log_level_set,
> -			"%lld\n");
> -
> -static int i915_guc_log_relay_open(struct inode *inode, struct file *file)
> -{
> -	struct drm_i915_private *i915 = inode->i_private;
> -	struct intel_guc *guc = &i915->gt.uc.guc;
> -	struct intel_guc_log *log = &guc->log;
> -
> -	if (!intel_guc_is_ready(guc))
> -		return -ENODEV;
> -
> -	file->private_data = log;
> -
> -	return intel_guc_log_relay_open(log);
> -}
> -
> -static ssize_t
> -i915_guc_log_relay_write(struct file *filp,
> -			 const char __user *ubuf,
> -			 size_t cnt,
> -			 loff_t *ppos)
> -{
> -	struct intel_guc_log *log = filp->private_data;
> -	int val;
> -	int ret;
> -
> -	ret = kstrtoint_from_user(ubuf, cnt, 0, &val);
> -	if (ret < 0)
> -		return ret;
> -
> -	/*
> -	 * Enable and start the guc log relay on value of 1.
> -	 * Flush log relay for any other value.
> -	 */
> -	if (val == 1)
> -		ret = intel_guc_log_relay_start(log);
> -	else
> -		intel_guc_log_relay_flush(log);
> -
> -	return ret ?: cnt;
> -}
> -
> -static int i915_guc_log_relay_release(struct inode *inode, struct file *file)
> -{
> -	struct drm_i915_private *i915 = inode->i_private;
> -	struct intel_guc *guc = &i915->gt.uc.guc;
> -
> -	intel_guc_log_relay_close(&guc->log);
> -	return 0;
> -}
> -
> -static const struct file_operations i915_guc_log_relay_fops = {
> -	.owner = THIS_MODULE,
> -	.open = i915_guc_log_relay_open,
> -	.write = i915_guc_log_relay_write,
> -	.release = i915_guc_log_relay_release,
> -};
> -
>   static int i915_runtime_pm_status(struct seq_file *m, void *unused)
>   {
>   	struct drm_i915_private *dev_priv = node_to_i915(m->private);
> @@ -1989,10 +1858,6 @@ static const struct drm_info_list i915_debugfs_list[] = {
>   	{"i915_gem_objects", i915_gem_object_info, 0},
>   	{"i915_gem_fence_regs", i915_gem_fence_regs_info, 0},
>   	{"i915_gem_interrupt", i915_interrupt_info, 0},
> -	{"i915_guc_info", i915_guc_info, 0},
> -	{"i915_guc_log_dump", i915_guc_log_dump, 0},
> -	{"i915_guc_load_err_log_dump", i915_guc_log_dump, 0, (void *)1},
> -	{"i915_huc_info", i915_huc_info, 0},
>   	{"i915_frequency_info", i915_frequency_info, 0},
>   	{"i915_ring_freq_table", i915_ring_freq_table, 0},
>   	{"i915_context_status", i915_context_status, 0},
> @@ -2020,8 +1885,6 @@ static const struct i915_debugfs_files {
>   	{"i915_error_state", &i915_error_state_fops},
>   	{"i915_gpu_info", &i915_gpu_info_fops},
>   #endif
> -	{"i915_guc_log_level", &i915_guc_log_level_fops},
> -	{"i915_guc_log_relay", &i915_guc_log_relay_fops},
>   };
>   
>   int i915_debugfs_register(struct drm_i915_private *dev_priv)
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2020-03-25 21:04 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12  1:16 [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Daniele Ceraolo Spurio
2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 1/6] drm/i915/gt: allow setting generic data pointer Daniele Ceraolo Spurio
2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 2/6] drm/i915/guc: drop stage_pool debugfs Daniele Ceraolo Spurio
2020-03-13 11:37   ` Andi Shyti
2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 3/6] drm/i915/huc: make "support huc" reflect HW capabilities Daniele Ceraolo Spurio
2020-03-13 14:55   ` Andi Shyti
2020-03-25 16:49   ` John Harrison
2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 4/6] drm/i915/debugfs: move uC printers and update debugfs file names Daniele Ceraolo Spurio
2020-03-25 17:05   ` John Harrison
2020-03-25 17:14     ` Daniele Ceraolo Spurio
2020-03-25 17:35       ` John Harrison
2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 5/6] drm/i915/uc: Move uC debugfs to its own folder under GT Daniele Ceraolo Spurio
2020-03-12  9:10   ` Jani Nikula
2020-03-13 15:38   ` Andi Shyti
2020-03-25 21:03   ` Daniele Ceraolo Spurio
2020-03-12  1:16 ` [Intel-gfx] [PATCH v2 6/6] drm/i915/uc: do not free err log on uc_fini Daniele Ceraolo Spurio
2020-03-25 17:58   ` John Harrison
2020-03-25 18:03     ` Daniele Ceraolo Spurio
2020-03-25 18:05       ` John Harrison
2020-03-12  4:10 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Re-org uC debugfs files and move them under GT (rev2) Patchwork
2020-03-12  4:14 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-03-12  4:34 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-03-12 22:43 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-03-25  1:47 ` [Intel-gfx] [PATCH v2 0/6] Re-org uC debugfs files and move them under GT Andi Shyti
2020-03-25 16:25   ` Daniele Ceraolo Spurio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).