Skip to contentSkip to conversation

PPC64 show -1 for physical_id of non-present cpus

PATCH New Paul Mackerras 1 participant 1 message Feb 4, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PPC64 show -1 for physical_id of non-present cpus

This patch is from Nathan Lynch <[email protected]>.

Make the physical_id cpu sysfs attribute on ppc64 show -1 instead of 65535 for non-present cpus.

arch/ppc64/kernel/sysfs.c renamed from arch/ppc64/kernel/sysfs.c~make-cpu-physical_id-signed +1 -1
diff -puN arch/ppc64/kernel/sysfs.c~make-cpu-physical_id-signed arch/ppc64/kernel/sysfs.c
@@ -387,7 +387,7 @@ static ssize_t show_physical_id(struct s
 {
 	struct cpu *cpu = container_of(dev, struct cpu, sysdev);
 
-	return sprintf(buf, "%u\n", get_hard_smp_processor_id(cpu->sysdev.id));
+	return sprintf(buf, "%d\n", get_hard_smp_processor_id(cpu->sysdev.id));
 }
 static SYSDEV_ATTR(physical_id, 0444, show_physical_id, NULL);
 
include/asm-ppc64/paca.h renamed from include/asm-ppc64/paca.h~make-cpu-physical_id-signed +1 -1
diff -puN include/asm-ppc64/paca.h~make-cpu-physical_id-signed include/asm-ppc64/paca.h
@@ -68,7 +68,7 @@ struct paca_struct {
 	u64 stab_real;			/* Absolute address of segment table */
 	u64 stab_addr;			/* Virtual address of segment table */
 	void *emergency_sp;		/* pointer to emergency stack */
-	u16 hw_cpu_id;			/* Physical processor number */
+	s16 hw_cpu_id;			/* Physical processor number */
 	u8 cpu_start;			/* At startup, processor spins until */
 					/* this becomes non-zero. */