Skip to contentSkip to conversation

E250 LED indicators

DISCUSSION Eric Brower 2 participants 5 messages Mar 31, 2004 – Apr 3, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I have a mostly written driver that support environmental monitoring and LEDs on the E250. It will handle temperature and fan monitoring, and can control all the LEDs (currently is only twiddles the activity LED).

The bigger issue that has been keeping this driver off the list to date is that the current PCF8584 (I2C bus controller) support must be rewritten to support multi-master operation and I've not mustered the enthusiasm to do it yet. Without such support, collisions result infrequently in misread or miswritten data that results in possibly bogus overheat conditions or LED states on the front status panel.

And since you asked, I'll poke a sore spot....

Another issue is the difference between the Solaris driver and existing Linux envctrl driver(s). When the power-off temperature threshold is met, Linux does a friendly shutdown. Solaris does a hard power-off, which I feel is appropriate if we implement notification at the warning threshold (bbc-envctrl and my envctrltwo do this, but envctrl does not).

However, due to the oft-lamented issue of sparc and sparc64 refusing to power-down a system completely if it is on a serial console, you gain little benefit from halting to OBP. DaveM-- I'll float you a sysctl patch for sparc64 and sparc if you'd consider it and find the current "protection" valuable, otherwise perhaps machine_power_off should actually power-off, machine_halt should halt and userspace commands should get smarter about whether they ask the system to halt or power-off. As I recall, the Red Hat patches to /sbin/shutdown do provide the distinction, though the userspace may not have "closed the loop" to do the right thing by default on serial console installs.

To make a long answer short-- I can send you the work-in-progress driver off-list, but I recommend running it in debug mode so that shutdowns are not actually performed, otherwise you may get false positives. Let me know.

E

Quoted 19 lines · Costas Magkos

Hi debian people,

I have a Sun Enterprise E250 running sarge. E250 has a front panel with LEDs used as health and fault indicators, which apparently work only when the system is running Solaris.

Does anyone know of a workaround for them to work under debian?

Thanx in advance.

~kmag

Costas Magkos
Internet Systematics Lab
NCSR "Demokritos"
Athens, Greece

#1 lore raw
Quoted 6 lines · On Wed, 31 Mar 2004 11:56:06 -0800 Eric Brower <[email protected]> wrote:

DaveM-- I'll float you a sysctl
patch for sparc64 and sparc if you'd consider it and find the current "protection" valuable, otherwise perhaps machine_power_off should actually power-off, machine_halt should halt and userspace commands should get smarter about whether they ask the system to halt or power-off.

Ok, I'll check it out.

#2 lore raw
In reply to Eric Brower
Quoted 8 lines · David S. Miller
Quoted 1 line · On Wed, 31 Mar 2004 11:56:06 -0800 Eric Brower <[email protected]> wrote:

DaveM-- I'll float you a sysctl patch for sparc64 and sparc if you'd consider it and find the current "protection" valuable, otherwise perhaps machine_power_off should actually power-off, machine_halt should halt and userspace commands should get smarter about whether they ask the system to halt or power-off.

Ok, I'll check it out.

Attached, but a bit dated and against 2.4.x; let me know what you think, concept-wise.

My preference would be for the kernel to always do as asked, and let the userspace tools provide the proper sys_reboot args (i.e. LINUX_REBOOT_CMD_HALT goes to OBP, LINUX_REBOOT_CMD_POWER_OFF goes to OBP). I may have missed some subtlety, but it seems better to handle this outside of machine_power_off, as a driver MIGHT wish to call that directly under thermal failure scenarios, etc.

E

===== arch/sparc/kernel/process.c 1.12 vs edited =====

arch/sparc/kernel/process.c +7 -1
@@ -54,6 +54,12 @@
  */
 void (*pm_power_off)(void);
 
+/*
+ * sysctl - toggle power-off restriction for serial console 
+ * systems in machine_power_off()
+ */
+int scons_pwroff = 1;
+
 extern void fpsave(unsigned long *, unsigned long *, void *, unsigned long *);
 
 struct task_struct *last_task_used_math = NULL;
@@ -189,7 +195,7 @@
 void machine_power_off(void)
 {
 #ifdef CONFIG_SUN_AUXIO
-	if (auxio_power_register && !serial_console)
+	if (auxio_power_register && (!serial_console || scons_pwroff))
 		*auxio_power_register |= AUXIO_POWER_OFF;
 #endif
 	machine_halt();

===== arch/sparc64/kernel/power.c 1.7 vs edited =====

arch/sparc64/kernel/power.c +7 -1
@@ -17,6 +17,12 @@
 #define __KERNEL_SYSCALLS__
 #include <linux/unistd.h>
 
+/*
+ * sysctl - toggle power-off restriction for serial console 
+ * systems in machine_power_off()
+ */
+int scons_pwroff = 1; 
+
 #ifdef CONFIG_PCI
 static unsigned long power_reg = 0UL;
 
@@ -40,7 +46,7 @@
 
 void machine_power_off(void)
 {
-	if (!serial_console) {
+	if (!serial_console || scons_pwroff) {
 #ifdef CONFIG_PCI
 		if (power_reg != 0UL) {
 			/* Both register bits seem to have the

===== include/linux/sysctl.h 1.24 vs edited =====

include/linux/sysctl.h +1 -0
@@ -125,6 +125,7 @@
 	KERN_TAINTED=53,	/* int: various kernel tainted flags */
 	KERN_CADPID=54,		/* int: PID of the process to notify on CAD */
  	KERN_CORE_PATTERN=56,	/* string: pattern for core-files */
+	KERN_SPARC_SCONS_PWROFF=57, /* int: serial console power-off halt */
 };
 
 

===== kernel/sysctl.c 1.19 vs edited =====

kernel/sysctl.c +3 -0
@@ -78,6 +78,7 @@
 #ifdef __sparc__
 extern char reboot_command [];
 extern int stop_a_enabled;
+extern int scons_pwroff;
 #endif
 
 #ifdef CONFIG_ARCH_S390
@@ -186,6 +187,8 @@
 	{KERN_SPARC_REBOOT, "reboot-cmd", reboot_command,
 	 256, 0644, NULL, &proc_dostring, &sysctl_string },
 	{KERN_SPARC_STOP_A, "stop-a", &stop_a_enabled, sizeof (int),
+	 0644, NULL, &proc_dointvec},
+	{KERN_SPARC_SCONS_PWROFF, "scons-poweroff", &scons_pwroff, sizeof (int),
 	 0644, NULL, &proc_dointvec},
 #endif
 #ifdef CONFIG_PPC32
#3 lore raw
In reply to Eric Brower

Eric Brower wrote:

[ ... ]

Quoted 4 lines

(i.e. LINUX_REBOOT_CMD_HALT goes to OBP, LINUX_REBOOT_CMD_POWER_OFF goes to OBP). I may have missed some subtlety, but it seems better to handle this outside of machine_power_off, as a driver MIGHT wish to call that directly under thermal failure scenarios, etc.

Of course, I meant LINUX_REBOOT_CMD_POWER_OFF powers-off.

E