<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div>On Tue, 2024-02-13 at 17:57 +0100, Danilo Krummrich wrote:</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<pre>+    struct debugfs_blob_wrapper blob_init;</pre>
<pre>+    struct debugfs_blob_wrapper blob_intr;</pre>
<pre>+    struct debugfs_blob_wrapper blob_rm;</pre>
<pre>+    struct debugfs_blob_wrapper blob_pmu;</pre>
<pre>+    struct dentry *debugfs_logging_dir;</pre>
</blockquote>
<pre><br></pre>
<pre>I think we should not create those from within the nvkm layer, but rather pass</pre>
<pre>them down through nvkm_device_pci_new().</pre>
</blockquote>
<div><br>
</div>
<div>Should they be created in nvkm_device_pci_new() also, even though we have no idea whether GSP is involved at that point?</div>
<div><br>
</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<pre><br></pre>
<pre>Lifecycle wise I think we should ensure that removing the Nouveau kernel module</pre>
<pre>also cleans up those buffers. Even though keep-gsp-logging is considered unsafe,</pre>
<pre>we shouldn't leak memory.</pre>
</blockquote>
<div><br>
</div>
<div>I agree, but then there needs to be some way to keep these debugfs entries until the driver unloads.  I don't know how to do that without creating some ugly global variables.</div>
<div><br>
</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<pre><br></pre>
<pre>For instance, can we allocate corresponding buffers in the driver layer, copy</pre>
<pre>things over and keep those buffers until nouveau_drm_exit()? This would also</pre>
<pre>avoid exposing those DMA buffers via debugfs.</pre>
</blockquote>
<div><br>
</div>
<div>The whole point behind this patch is to expose the buffers via debugfs.  How else should they be exposed?</div>
<div><br>
</div>
<div><span></span></div>
</body>
</html>