From 8217becc1b416e348d1bc8fcb54c09967e0f4987 Mon Sep 17 00:00:00 2001 From: Tim Sell Date: Thu, 3 Nov 2016 11:44:16 -0400 Subject: staging: unisys: visorbus: convert client_bus_info sysfs to debugfs Previously, the sysfs entry (assuming traditional sysfs mountpoint): /sys/bus/visorbus/devices/visorbus/client_bus_info violated kernel conventions by printing more than one item. This along with the fact that the data emitted was diagnostic data (intended to shadow the client driver info provided via s-Par livedumps) made it a logical candidate for debugfs. So this patch moves this sysfs entry to debugfs as (assuming traditional debugfs mountpoint): /sys/kernel/debug/visorbus/visorbus/client_bus_info Data for this debugfs is emitted using the preferred seq_file interface, which allowed a vastly-simplified version of vbuschannel_print_devinfo() to format the individual output components. Functionality was verified as follows: [root@sparguest visorbus]# mount | grep debug debugfs on /sys/kernel/debug type debugfs (rw) [root@sparguest visorbus]# pwd /sys/kernel/debug/visorbus [root@sparguest visorbus]# l visorbus1/ total 0 drwxr-xr-x 2 root root 0 Sep 28 16:36 . drwxr-xr-x 4 root root 0 Sep 28 16:36 .. -r--r----- 1 root root 0 Sep 28 16:36 client_bus_info [root@sparguest visorbus]# l visorbus2 total 0 drwxr-xr-x 2 root root 0 Sep 28 16:36 . drwxr-xr-x 4 root root 0 Sep 28 16:36 .. -r--r----- 1 root root 0 Sep 28 16:36 client_bus_info [root@sparguest visorbus]# cat visorbus1/client_bus_info Client device / client driver info for s-Par Console partition (vbus #1): chipset visorchipset kernel ver. 4.8.0-rc6-ARCH+ clientbus visorbus kernel ver. 4.8.0-rc6-ARCH+ [2]keyboard visorinput kernel ver. 4.8.0-rc6-ARCH+ [3]mouse visorinput kernel ver. 4.8.0-rc6-ARCH+ [root@sparguest visorbus]# cat visorbus2/client_bus_info Client device / client driver info for s-Par IOVM partition (vbus #2): chipset visorchipset kernel ver. 4.8.0-rc6-ARCH+ clientbus visorbus kernel ver. 4.8.0-rc6-ARCH+ [0]ultravnic visornic kernel ver. 4.8.0-rc6-ARCH+ [1]ultravnic visornic kernel ver. 4.8.0-rc6-ARCH+ [2]sparvhba visorhba kernel ver. 4.8.0-rc6-ARCH+ Signed-off-by: Tim Sell Reported-by: Greg Kroah-Hartman Signed-off-by: David Kershner Signed-off-by: Greg Kroah-Hartman --- drivers/staging/unisys/include/visorbus.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/staging/unisys/include/visorbus.h') diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h index 677627c..03d56f8 100644 --- a/drivers/staging/unisys/include/visorbus.h +++ b/drivers/staging/unisys/include/visorbus.h @@ -166,6 +166,8 @@ struct visor_device { struct controlvm_message_header *pending_msg_hdr; void *vbus_hdr_info; uuid_le partition_uuid; + struct dentry *debugfs_dir; + struct dentry *debugfs_client_bus_info; }; #define to_visor_device(x) container_of(x, struct visor_device, device) -- cgit v1.1