lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20221103195225.1028864-13-cristian.marussi@arm.com>
Date:   Thu,  3 Nov 2022 19:52:23 +0000
From:   Cristian Marussi <cristian.marussi@....com>
To:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Cc:     sudeep.holla@....com, james.quinlan@...adcom.com,
        Jonathan.Cameron@...wei.com, f.fainelli@...il.com,
        etienne.carriere@...aro.org, vincent.guittot@...aro.org,
        souvik.chakravarty@....com, wleavitt@...vell.com,
        peter.hilber@...nsynergy.com, nicola.mazzucato@....com,
        tarek.el-sherbiny@....com, quic_kshivnan@...cinc.com,
        cristian.marussi@....com
Subject: [PATCH v5 12/14] firmware: arm_scmi: Create Raw debugfs root dentry

Create common root debugfs dentry at driver initialization time.

Signed-off-by: Cristian Marussi <cristian.marussi@....com>
---
 drivers/firmware/arm_scmi/driver.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index c5bc67a9c103..bbb43b65cbfd 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -14,8 +14,11 @@
  * Copyright (C) 2018-2021 ARM Ltd.
  */
 
+#define pr_fmt(fmt) "SCMI - " fmt
+
 #include <linux/bitmap.h>
 #include <linux/device.h>
+#include <linux/debugfs.h>
 #include <linux/export.h>
 #include <linux/idr.h>
 #include <linux/io.h>
@@ -154,6 +157,8 @@ struct scmi_info {
 	int users;
 };
 
+static struct dentry *scmi_raw_top_dentry;
+
 #define handle_to_scmi_info(h)	container_of(h, struct scmi_info, handle)
 
 void scmi_notification_instance_data_set(const struct scmi_handle *handle,
@@ -2839,6 +2844,14 @@ static int __init scmi_driver_init(void)
 	if (WARN_ON(!IS_ENABLED(CONFIG_ARM_SCMI_HAVE_TRANSPORT)))
 		return -EINVAL;
 
+	if (IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT)) {
+		scmi_raw_top_dentry = debugfs_create_dir("scmi_raw", NULL);
+		if (IS_ERR(scmi_raw_top_dentry)) {
+			pr_err("Could NOT create RAW top dentry.\n");
+			scmi_raw_top_dentry = NULL;
+		}
+	}
+
 	scmi_bus_init();
 
 	/* Initialize any compiled-in transport which provided an init/exit */
@@ -2863,6 +2876,9 @@ subsys_initcall(scmi_driver_init);
 
 static void __exit scmi_driver_exit(void)
 {
+	if (IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT))
+		debugfs_remove_recursive(scmi_raw_top_dentry);
+
 	scmi_base_unregister();
 
 	scmi_clock_unregister();
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ