summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/uv_sysfs.c
AgeCommit message (Collapse)AuthorFilesLines
2023-02-10x86/platform/uv: Make kobj_type structure constantThomas Weißschuh1-3/+3
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>
2022-12-08platform/x86: uv_sysfs: Use sysfs_emit() instead of scnprintf()ye xingchen1-8/+8
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>
2021-12-30x86/platform/uv: use default_groups in kobj_typeGreg Kroah-Hartman1-2/+4
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>
2021-06-16x86/platform/uv: Constify static attribute_group structRikard Falkeborn1-2/+2
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>
2020-12-07x86/platform/uv: Add sysfs hubless leavesMike Travis1-2/+50
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
2020-12-07x86/platform/uv: Add sysfs leaves to replace those in procfsMike Travis1-0/+18
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
2020-12-03x86/platform/uv: Make uv_pcibus_kset and uv_hubs_kset staticZou Wei1-2/+2
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
2020-12-03x86/platform/uv: Fix an error code in uv_hubs_init()Dan Carpenter1-0/+1
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
2020-11-26x86/platform/uv: Add new uv_sysfs platform driverJustin Ernst1-0/+862
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