aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto/ap_bus.c
diff options
context:
space:
mode:
authorHarald Freudenberger <freude@linux.vnet.ibm.com>2016-11-24 06:45:21 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-12-14 16:33:39 +0100
commitcccd85bfb7bf6787302435c669ceec23b5a5301c (patch)
treec646f0474f1344372596c37adff268dbdb4f07c3 /drivers/s390/crypto/ap_bus.c
parentbf9f31190aa176c43c15cf58b60818d325e0f851 (diff)
s390/zcrypt: Rework debug feature invocations.
Rework the debug feature calls and initialization. There are now two debug feature entries used by the zcrypt code. The first is 'ap' with all the AP bus related stuff and the second is 'zcrypt' with all the zcrypt and devices and driver related entries. However, there isn't much traffic on both debug features. The ap bus code emits only some debug info and for zcrypt devices on appearance and disappearance there is an entry written. The new dbf invocations use the sprintf buffer layout, whereas the old implementation used the ascii dbf buffer. There are now 5*8=40 bytes used for each entry, resulting in 5 parameters per call. As the sprintf buffer needs a format string the first parameter provides this and so up to 4 more parameters can be used. Alltogehter the new layout should be much more human readable for customers and test. Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/ap_bus.c')
-rw-r--r--drivers/s390/crypto/ap_bus.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 78c99ae42b1f..6d75984a3d85 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -47,9 +47,11 @@
#include <asm/facility.h>
#include <linux/crypto.h>
#include <linux/mod_devicetable.h>
+#include <linux/debugfs.h>
#include "ap_bus.h"
#include "ap_asm.h"
+#include "ap_debug.h"
/*
* Module description.
@@ -82,6 +84,12 @@ static struct ap_config_info *ap_configuration;
static bool initialised;
/*
+ * AP bus related debug feature things.
+ */
+static struct dentry *ap_dbf_root;
+debug_info_t *ap_dbf_info;
+
+/*
* Workqueue timer for bus rescan.
*/
static struct timer_list ap_config_timer;
@@ -568,6 +576,8 @@ static int ap_dev_resume(struct device *dev)
static void ap_bus_suspend(void)
{
+ AP_DBF(DBF_DEBUG, "ap_bus_suspend running\n");
+
ap_suspend_flag = 1;
/*
* Disable scanning for devices, thus we do not want to scan
@@ -603,6 +613,8 @@ static void ap_bus_resume(void)
{
int rc;
+ AP_DBF(DBF_DEBUG, "ap_bus_resume running\n");
+
/* remove all queue devices */
bus_for_each_dev(&ap_bus_type, NULL, NULL,
__ap_queue_devices_unregister);
@@ -742,6 +754,9 @@ static ssize_t ap_domain_store(struct bus_type *bus,
spin_lock_bh(&ap_domain_lock);
ap_domain_index = domain;
spin_unlock_bh(&ap_domain_lock);
+
+ AP_DBF(DBF_DEBUG, "store new default domain=%d\n", domain);
+
return count;
}
@@ -964,6 +979,8 @@ static void ap_scan_bus(struct work_struct *unused)
unsigned int functions = 0;
int rc, id, dom, borked, domains;
+ AP_DBF(DBF_DEBUG, "ap_scan_bus running\n");
+
ap_query_configuration();
if (ap_select_domain() != 0)
goto out;
@@ -1129,6 +1146,23 @@ static struct reset_call ap_reset_call = {
.fn = ap_reset_all,
};
+int __init ap_debug_init(void)
+{
+ ap_dbf_root = debugfs_create_dir("ap", NULL);
+ ap_dbf_info = debug_register("ap", 1, 1,
+ DBF_MAX_SPRINTF_ARGS * sizeof(long));
+ debug_register_view(ap_dbf_info, &debug_sprintf_view);
+ debug_set_level(ap_dbf_info, DBF_ERR);
+
+ return 0;
+}
+
+void ap_debug_exit(void)
+{
+ debugfs_remove(ap_dbf_root);
+ debug_unregister(ap_dbf_info);
+}
+
/**
* ap_module_init(): The module initialization code.
*
@@ -1139,6 +1173,10 @@ int __init ap_module_init(void)
int max_domain_id;
int rc, i;
+ rc = ap_debug_init();
+ if (rc)
+ return rc;
+
if (ap_instructions_available() != 0) {
pr_warn("The hardware system does not support AP instructions\n");
return -ENODEV;
@@ -1266,6 +1304,8 @@ void ap_module_exit(void)
unregister_reset_call(&ap_reset_call);
if (ap_using_interrupts())
unregister_adapter_interrupt(&ap_airq);
+
+ ap_debug_exit();
}
module_init(ap_module_init);

Privacy Policy