On Thu, Jun 21, 2012 at 02:37:35PM +1000, Sridhar Dhanapalan wrote: > On 16 June 2012 17:08, James Cameron <qu...@laptop.org> wrote: > > That means the hang should not exceed 15 seconds. ?Is this what you > > find? ?If not, then this casts doubt on your solution. > > I'm going to propose something extremely hackish: [...]
Just to remind you that I'm still interested to know if the hang you observe exceeds 15 seconds or not. I've not had the time to reproduce this hang yet. Building a mental model of the problem is important to me, because I can sometimes resolve a problem if I have a good model. The reason that 15 seconds threshold is important, is that the /etc/init.d/functions is designed to finish the unmounting by then. If it is not finishing, then this hang is at root a kernel problem. > [...] can we have the XO perform a hard power-off if the software > shutdown sequence does not complete within 30 seconds? Yes. However, the time would likely be better spent by a developer in understanding what is happening. Without that, there's a strong risk that the hack may be ineffective, because whatever is stopping the shutdown might also stop the hack. It isn't about elegance, it's about effectiveness. Hack type 1: in /etc/init.d/halt fork a process that sleeps for 30 seconds and then forces a power down: (sleep 30 ; /sbin/halt -f -d -p) & Hack type 2: in /etc/init.d/halt fork a process that sleeps for 30 seconds and then sends a power down command to the embedded controller: (sleep 30 ; echo 55:0 > /sys/power/ec) & But both these approaches don't work for me. I presume it is because the forked process is killed by /etc/init.d/halt One might add code to /etc/init.d/halt to check for elapsed time and force a power off, but this would be blocked if a command hangs. The XO-1.5 embedded controller firmware might also be modified, to provide a watchdog, but my guess is that will take a lot of engineering effort. Again, that effort, if it is to be spent, would be better spent in diagnosis and debugging. > Ideally this would be managed by some kind of hardware watchdog, but > maybe there's a cheap-and-nasty version we can implement in > software. The XO-1.75 CPU has a hardware watchdog that could be used for this, but you aren't likely to ever have a heat problem with XO-1.75. I don't know if the XO-1.5 CPU has a hardware watchdog. -- James Cameron http://quozl.linux.org.au/ _______________________________________________ Devel mailing list Devel@lists.laptop.org http://lists.laptop.org/listinfo/devel