Re: [Intel-gfx] [Intel-gfx 6/6] drm/i915/guc: Move guc_log_relay_chan debugfs path to uc

2022-12-05 Thread Teres Alexis, Alan Previn


On Mon, 2022-12-05 at 18:04 -0800, Alan Previn Teres Alexis wrote:
> On Wed, 2022-07-20 at 12:08 -0700, Dixit, Ashutosh wrote:
> > On Mon, 09 May 2022 14:01:51 -0700, Alan Previn wrote:
> > > 
> > > All other GuC Relay Logging debugfs handles including recent
> > > additions are under the 'i915/gt/uc/path' so let's also move
> > > 'guc_log_relay_chan' to its proper home
> Alan:[snip]
> 
> > > 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 793a06a16874..f6578565fed6 100644
> > > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > > @@ -419,8 +419,11 @@ static int guc_log_relay_create(struct intel_guc_log 
> > > *log)
> > >*/
> > >   n_subbufs = intel_guc_log_relay_subbuf_count(log);
> > > 
> > > + if (!guc->dbgfs_node)
> > > + return -ENOENT;
> > 
> > Once again, why is this check needed? The patch is otherwise fine.
> > 
> 
> Because on i915 upstream today, we do have a code path where that dbgfs_node 
> is not being populated and i assume that
> would be the case if config file disables debugfs? And without that we don't 
> support guc-relay-logging.
> 
Alan: Scratch that - its not needed.



Re: [Intel-gfx] [Intel-gfx 6/6] drm/i915/guc: Move guc_log_relay_chan debugfs path to uc

2022-12-05 Thread Teres Alexis, Alan Previn

On Wed, 2022-07-20 at 12:08 -0700, Dixit, Ashutosh wrote:
> On Mon, 09 May 2022 14:01:51 -0700, Alan Previn wrote:
> > 
> > All other GuC Relay Logging debugfs handles including recent
> > additions are under the 'i915/gt/uc/path' so let's also move
> > 'guc_log_relay_chan' to its proper home
Alan:[snip]

> > 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 793a06a16874..f6578565fed6 100644
> > --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> > @@ -419,8 +419,11 @@ static int guc_log_relay_create(struct intel_guc_log 
> > *log)
> >  */
> > n_subbufs = intel_guc_log_relay_subbuf_count(log);
> > 
> > +   if (!guc->dbgfs_node)
> > +   return -ENOENT;
> 
> Once again, why is this check needed? The patch is otherwise fine.
> 

Because on i915 upstream today, we do have a code path where that dbgfs_node is 
not being populated and i assume that
would be the case if config file disables debugfs? And without that we don't 
support guc-relay-logging.



Re: [Intel-gfx] [Intel-gfx 6/6] drm/i915/guc: Move guc_log_relay_chan debugfs path to uc

2022-07-20 Thread Dixit, Ashutosh
On Mon, 09 May 2022 14:01:51 -0700, Alan Previn wrote:
>
> All other GuC Relay Logging debugfs handles including recent
> additions are under the 'i915/gt/uc/path' so let's also move
> 'guc_log_relay_chan' to its proper home.
>
> Signed-off-by: Alan Previn 
> ---
>  drivers/gpu/drm/i915/gt/uc/intel_guc.h| 2 ++
>  drivers/gpu/drm/i915/gt/uc/intel_guc_log.c| 5 -
>  drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c | 2 ++
>  3 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h 
> b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> index 3f3373f68123..72deac11df8a 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
> @@ -41,6 +41,8 @@ struct intel_guc {
>   struct intel_guc_slpc slpc;
>   /** @capture: the error-state-capture module's data and objects */
>   struct intel_guc_state_capture *capture;
> + /** @dbgfs_node: the debugfs path for guc file handles */
> + struct dentry *dbgfs_node;
>
>   /** @sched_engine: Global engine used to submit requests to GuC */
>   struct i915_sched_engine *sched_engine;
> 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 793a06a16874..f6578565fed6 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
> @@ -419,8 +419,11 @@ static int guc_log_relay_create(struct intel_guc_log 
> *log)
>*/
>   n_subbufs = intel_guc_log_relay_subbuf_count(log);
>
> + if (!guc->dbgfs_node)
> + return -ENOENT;

Once again, why is this check needed? The patch is otherwise fine.

> +
>   guc_log_relay_chan = relay_open("guc_log_relay_chan",
> - dev_priv->drm.primary->debugfs_root,
> + guc->dbgfs_node,
>   subbuf_size, n_subbufs,
>   _callbacks, dev_priv);
>   if (!guc_log_relay_chan) {
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c 
> b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> index 284d6fbc2d08..2f93cc4e408a 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
> @@ -54,6 +54,8 @@ void intel_uc_debugfs_register(struct intel_uc *uc, struct 
> dentry *gt_root)
>   if (IS_ERR(root))
>   return;
>
> + uc->guc.dbgfs_node = root;
> +
>   intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);
>
>   intel_guc_debugfs_register(>guc, root);
> --
> 2.25.1
>


[Intel-gfx] [Intel-gfx 6/6] drm/i915/guc: Move guc_log_relay_chan debugfs path to uc

2022-05-09 Thread Alan Previn
All other GuC Relay Logging debugfs handles including recent
additions are under the 'i915/gt/uc/path' so let's also move
'guc_log_relay_chan' to its proper home.

Signed-off-by: Alan Previn 
---
 drivers/gpu/drm/i915/gt/uc/intel_guc.h| 2 ++
 drivers/gpu/drm/i915/gt/uc/intel_guc_log.c| 5 -
 drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h 
b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
index 3f3373f68123..72deac11df8a 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
@@ -41,6 +41,8 @@ struct intel_guc {
struct intel_guc_slpc slpc;
/** @capture: the error-state-capture module's data and objects */
struct intel_guc_state_capture *capture;
+   /** @dbgfs_node: the debugfs path for guc file handles */
+   struct dentry *dbgfs_node;
 
/** @sched_engine: Global engine used to submit requests to GuC */
struct i915_sched_engine *sched_engine;
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 793a06a16874..f6578565fed6 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c
@@ -419,8 +419,11 @@ static int guc_log_relay_create(struct intel_guc_log *log)
 */
n_subbufs = intel_guc_log_relay_subbuf_count(log);
 
+   if (!guc->dbgfs_node)
+   return -ENOENT;
+
guc_log_relay_chan = relay_open("guc_log_relay_chan",
-   dev_priv->drm.primary->debugfs_root,
+   guc->dbgfs_node,
subbuf_size, n_subbufs,
_callbacks, dev_priv);
if (!guc_log_relay_chan) {
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c 
b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
index 284d6fbc2d08..2f93cc4e408a 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c
@@ -54,6 +54,8 @@ void intel_uc_debugfs_register(struct intel_uc *uc, struct 
dentry *gt_root)
if (IS_ERR(root))
return;
 
+   uc->guc.dbgfs_node = root;
+
intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);
 
intel_guc_debugfs_register(>guc, root);
-- 
2.25.1