History log of /linux-master/drivers/platform/x86/uv_sysfs.c
Revision Date Author Comments
# ad76d9b8 07-Feb-2023 Thomas Weißschuh <linux@weissschuh.net>

x86/platform/uv: Make kobj_type structure constant

Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
the driver core allows the usage of const struct kobj_type.

Take advantage of this to constify the structure definition to prevent
modification at runtime.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Justin Ernst <justin.ernst@hpe.com>
Link: https://lore.kernel.org/r/20230207-kobj_type-pdx86-v1-3-8e2c4fb83105@weissschuh.net
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>


# d240849c 02-Dec-2022 ye xingchen <ye.xingchen@zte.com.cn>

platform/x86: uv_sysfs: Use sysfs_emit() instead of scnprintf()

Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Reviewed-by: Justin Ernst <justin.ernst@hpe.com>
Link: https://lore.kernel.org/r/202212021705128095546@zte.com.cn
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>


# afca4cbe 29-Dec-2021 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

x86/platform/uv: use default_groups in kobj_type

There are currently 2 ways to create a set of sysfs files for a
kobj_type, through the default_attrs field, and the default_groups
field. Move the uv sysfs code to use default_groups field which has
been the preferred way since aa30f47cf666 ("kobject: Add support for
default attribute groups to kobj_type") so that we can soon get rid of
the obsolete default_attrs field.

Cc: Justin Ernst <justin.ernst@hpe.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Gross <markgross@kernel.org>
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20211229141332.2552428-1-gregkh@linuxfoundation.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>


# 77d06ec6 05-Jun-2021 Rikard Falkeborn <rikard.falkeborn@gmail.com>

x86/platform/uv: Constify static attribute_group struct

The only use of base_attr_group and hubless_base_attr_group is to pass
their addresses to sysfs_create_group() and sysfs_remove_group(), both
which takes pointers to const attribute_group structs. Make them const
to allow the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Justin Ernst <justin.ernst@hpe.com>
Link: https://lore.kernel.org/r/20210605203807.60547-5-rikard.falkeborn@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>


# 433e817a 27-Nov-2020 Mike Travis <mike.travis@hpe.com>

x86/platform/uv: Add sysfs hubless leaves

Add uv_sysfs hubless leaves for UV hubless systems.

Signed-off-by: Mike Travis <mike.travis@hpe.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lkml.kernel.org/r/20201128034227.120869-4-mike.travis@hpe.com


# 612a0063 27-Nov-2020 Mike Travis <mike.travis@hpe.com>

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@hpe.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lkml.kernel.org/r/20201128034227.120869-3-mike.travis@hpe.com


# 0c683e9d 30-Nov-2020 Zou Wei <zou_wei@huawei.com>

x86/platform/uv: Make uv_pcibus_kset and uv_hubs_kset static

Fix the following sparse warnings:

drivers/platform/x86/uv_sysfs.c:22:13: warning: symbol \
'uv_pcibus_kset' was not declared. Should it be static?
drivers/platform/x86/uv_sysfs.c:23:13: warning: symbol \
'uv_hubs_kset' was not declared. Should it be static?

Signed-off-by: Zou Wei <zou_wei@huawei.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lkml.kernel.org/r/1606734713-43919-1-git-send-email-zou_wei@huawei.com


# 18d047bd 02-Dec-2020 Dan Carpenter <dan.carpenter@oracle.com>

x86/platform/uv: Fix an error code in uv_hubs_init()

Return -ENOMEM on allocation failure instead of returning random stack
memory contents.

Fixes: 4fc2cf1f2daf ("x86/platform/uv: Add new uv_sysfs platform driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Justin Ernst <justin.ernst@hpe.com>
Link: https://lkml.kernel.org/r/X8eoN/jMAJb3H3iv@mwanda


# 4fc2cf1f 25-Nov-2020 Justin Ernst <justin.ernst@hpe.com>

x86/platform/uv: Add new uv_sysfs platform driver

Add the uv_sysfs driver to construct a read-only sysfs interface at
/sys/firmware/sgi_uv/ to expose information gathered from UV BIOS. This
information includes:

* UV Hub descriptions, including physical location
* Cabling layout between hubs on the fabric
* PCI topology, including physical location of PCI cards

Together, the information provides a robust physical description of a UV
system, useful for correlating to performance data or performing remote
support.

Signed-off-by: Justin Ernst <justin.ernst@hpe.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Steve Wahl <steve.wahl@hpe.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lkml.kernel.org/r/20201125175444.279074-4-justin.ernst@hpe.com