[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201125172907.240996-3-mike.travis@hpe.com>
Date: Wed, 25 Nov 2020 11:29:04 -0600
From: Mike Travis <mike.travis@....com>
To: Hans de Goede <hdegoede@...hat.com>,
Justin Ernst <justin.ernst@....com>,
Mark Gross <mgross@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, Steve Wahl <steve.wahl@....com>
Cc: Mike Travis <mike.travis@....com>,
Dimitri Sivanich <dimitri.sivanich@....com>,
Russ Anderson <russ.anderson@....com>,
"H. Peter Anvin" <hpa@...or.com>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Suzuki K Poulose <suzuki.poulose@....com>,
Ilya Dryomov <idryomov@...il.com>,
linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org
Subject: [PATCH 2/5] x86/platform/uv: Add sysfs leaves to replace those in procfs
Add uv_sysfs leaves to display the info.
Signed-off-by: Mike Travis <mike.travis@....com>
Reviewed-by: Steve Wahl <steve.wahl@....com>
---
drivers/platform/x86/uv_sysfs.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c
index 6de360370f0e..6729ea8b63d2 100644
--- a/drivers/platform/x86/uv_sysfs.c
+++ b/drivers/platform/x86/uv_sysfs.c
@@ -729,14 +729,32 @@ static ssize_t uv_type_show(struct kobject *kobj,
return scnprintf(buf, PAGE_SIZE, "%s\n", uv_type_string());
}
+static ssize_t uv_archtype_show(struct kobject *kobj,
+ struct kobj_attribute *attr, char *buf)
+{
+ return uv_get_archtype(buf, PAGE_SIZE);
+}
+
+static ssize_t uv_hub_type_show(struct kobject *kobj,
+ struct kobj_attribute *attr, char *buf)
+{
+ return scnprintf(buf, PAGE_SIZE, "0x%x\n", uv_hub_type());
+}
+
static struct kobj_attribute partition_id_attr =
__ATTR(partition_id, 0444, partition_id_show, NULL);
static struct kobj_attribute uv_type_attr =
__ATTR(uv_type, 0444, uv_type_show, NULL);
+static struct kobj_attribute uv_archtype_attr =
+ __ATTR(archtype, 0444, uv_archtype_show, NULL);
+static struct kobj_attribute uv_hub_type_attr =
+ __ATTR(hub_type, 0444, uv_hub_type_show, NULL);
static struct attribute *base_attrs[] = {
&partition_id_attr.attr,
&uv_type_attr.attr,
+ &uv_archtype_attr.attr,
+ &uv_hub_type_attr.attr,
NULL,
};
--
2.21.0
Powered by blists - more mailing lists