Skip to contentSkip to conversation

x86: Add sysfs entries for UV

PATCH In review Russ Anderson 3 participants 3 messages Sep 22, 2008 – Sep 23, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 x86: Add sysfs entries for UV

[PATCH 4/4] Add sysfs entries for UV

Create /sys/firmware/sgi_uv sysfs entries for partition_id and coherence_id.

---
 arch/x86/kernel/Makefile   |    2 -
 arch/x86/kernel/uv_sysfs.c |   61 +++++++++++++++++++++++++++++++++++++++++++++
 include/asm-x86/uv/bios.h  |    2 +
 3 files changed, 64 insertions(+), 1 deletion(-)
arch/x86/kernel/Makefile +1 -1
Index: linux/arch/x86/kernel/Makefile
===================================================================
@@ -107,7 +107,7 @@ obj-$(CONFIG_OLPC)		+= olpc.o
 # 64 bit specific files
 ifeq ($(CONFIG_X86_64),y)
         obj-y				+= genapic_64.o genapic_flat_64.o genx2apic_uv_x.o tlb_uv.o
-	obj-y				+= bios_uv.o
+	obj-y				+= bios_uv.o uv_sysfs.o
         obj-y				+= genx2apic_cluster.o
         obj-y				+= genx2apic_phys.o
         obj-$(CONFIG_X86_PM_TIMER)	+= pmtimer_64.o
arch/x86/kernel/uv_sysfs.c new file +61 -0

61 lines not on this page · raw message

include/asm-x86/uv/bios.h +2 -0
Index: linux/include/asm-x86/uv/bios.h
===================================================================
@@ -79,6 +79,8 @@ extern u8 uv_coherency_id;
 #define partition_coherence_id()	(uv_coherency_id)
 
 
+extern struct kobject *sgi_uv_kobj;	/* /sys/firmware/sgi_uv */
+
 #ifndef CONFIG_EFI
 extern u64 efi_call6(void *, u64, u64, u64, u64, u64, u64);
 #endif
Signature · 2 lines
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          [email protected]
#1 lore raw
Quoted 1 line · Russ Anderson

+struct kobject *sgi_uv_kobj;

should be static?

arch/x86/kernel/uv_sysfs.c line 56

Quoted 11 lines
arch/x86/kernel/uv_sysfs.c new file +11 -0
+static int __init sgi_uv_sysfs_init(void)
+{
+	if (!sgi_uv_kobj)
+		sgi_uv_kobj = kobject_create_and_add("sgi_uv", firmware_kobj);
+	if (!sgi_uv_kobj) {
+		printk(KERN_WARNING "kobject_create_and_add sgi_uv failed \n");
+		return -EINVAL;
+	}
+
+	sysfs_create_file(sgi_uv_kobj, &partition_id_attr.attr);
+	sysfs_create_file(sgi_uv_kobj, &coherence_id_attr.attr);

missing checks for failure?

Ingo

#2 lore raw
In reply to Russ Anderson
Quoted 3 lines · Russ Anderson

[PATCH 4/4] Add sysfs entries for UV

Create /sys/firmware/sgi_uv sysfs entries for partition_id and coherence_id.

Please add the proper entries to Documentation/ABI/ for when you add new sysfs files.

thanks,

greg k-h