[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <152055666941.63229.15022736780979941514.stgit@sosxen2.amd.com>
Date: Thu, 08 Mar 2018 18:51:09 -0600
From: Gary R Hook <gary.hook@....com>
To: iommu@...ts.linux-foundation.org
Cc: joro@...tes.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 3/5] iommu/amd - Add a README variable for the IOMMU
debugfs
Provide help text via a filesystem entry
Signed-off-by: Gary R Hook <gary.hook@....com>
---
drivers/iommu/amd_iommu_debugfs.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c
index 481f4d86f8f8..79945ce1199d 100644
--- a/drivers/iommu/amd_iommu_debugfs.c
+++ b/drivers/iommu/amd_iommu_debugfs.c
@@ -81,6 +81,31 @@ static const struct file_operations amd_iommu_debugfs_dtecount_ops = {
.write = NULL,
};
+static char readmetext[] =
+"count Count of active devices\n"
+"verbose Provide additional descriptive text\n"
+"\n";
+
+static ssize_t amd_iommu_debugfs_readme_read(struct file *filp,
+ char __user *ubuf,
+ size_t count, loff_t *offp)
+{
+ ssize_t ret;
+
+ ret = simple_read_from_buffer(ubuf, count, offp,
+ readmetext, strlen(readmetext));
+
+ return ret;
+}
+
+
+static const struct file_operations amd_iommu_debugfs_readme_ops = {
+ .owner = THIS_MODULE,
+ .open = simple_open,
+ .read = amd_iommu_debugfs_readme_read,
+ .write = NULL,
+};
+
void amd_iommu_debugfs_setup(struct amd_iommu *iommu)
{
char name[MAX_NAME_LEN + 1];
@@ -115,6 +140,12 @@ void amd_iommu_debugfs_setup(struct amd_iommu *iommu)
if (!d_dte)
goto err;
+ d_dte = debugfs_create_file("README", 0400,
+ iommu->debugfs_instance, iommu,
+ &amd_iommu_debugfs_readme_ops);
+ if (!d_dte)
+ goto err;
+
return;
err:
Powered by blists - more mailing lists