Active Topics

 


Reply
Thread Tools
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#141
Originally Posted by Mentalist Traceur View Post
Alternatively it's also included in busybox-power.
Mentalist,
thanks for reminding again of really almost not ending super power of bb-enhanced (almost second important package after rootsh, besides KP, backupmenu and and and).

But I tried to use bb-watchdog to enable shell usage of multiboot and was unsuccessful. With pali's watchdogs everything was fine.
Do you have syntax of usage (tried with watchdog /dev/watchdog)?

@pali
Now I know (again) why my FN keys were working:
I already detected that bb also delivers version of loadkmap and I used that one, not your version.
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 2,153 | Thanked: 8,462 times | Joined on May 2010
#142
Note that my version of watchdogs check if watchdogs are disabled via R&D mode and then watchdogs are not touched. bb version has no checking and it (can) enable them in R&D mode with disable watchdogs flag.
 

The Following 3 Users Say Thank You to pali For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#143
Originally Posted by peterleinchen View Post
Mentalist,
thanks for reminding again of really almost not ending super power of bb-enhanced (almost second important package after rootsh, besides KP, backupmenu and and and).

But I tried to use bb-watchdog to enable shell usage of multiboot and was unsuccessful. With pali's watchdogs everything was fine.
Do you have syntax of usage (tried with watchdog /dev/watchdog)?
Sure (this is what I have in my /sbin/preinit code - I haven't kept up with this recovery console thing - perhaps it supports everything I have done, and more, by now, but if you're lacking a 5 second press-any-key-to-get-shell countdown to get a shell at the earliest possible moment of boot, with the keyboard LEDs backlit when you're in said shell in case you have to use it in the dark, the instructions for what I did should be earlier in this thread).

Anyway, this is the useage:
Code:
watchdog -t 20 /dev/watchdog
watchdog -t 20 /dev/twl4030_wdt
Remember, there are two watchdogs on the N900 (maybe more, idk, but these are the ones that make the device reboot if they're not given a good punt every ~30 seconds or so [EDIT: but I'm fairly confident it's only those 2]).

The '-t #' flag tells the watchdog command how often to prod the specified watchdog (in seconds). Last I checked (half a year ago or so) Pali's watchdogs binary used a 10 second interval, but I personally think there's no need for it to be that frequent, so I use 20 in my /sbin/preinit and never had a spontaneous reboot. I would assume, you could probably safely set the interval to 1 second less than the watchdogs' how-long-before-reboot timer, but I never felt the desire to push the limits.

Either way the CPU/battery difference between doing a 10 sec interval and a 20 sec interval, is virtually nothing, so just a matter of how much time you feel is appropriate for completely-safe-ness.

The real number of completely-safe-from-watchdog-reboot seconds is likely to be far closer to the actual 'reboot-if-not-kicked-at-this-time', given speed of computers, than seems intuitive to the human brain anyway.

Originally Posted by pali View Post
Note that my version of watchdogs check if watchdogs are disabled via R&D mode and then watchdogs are not touched. bb version has no checking and it (can) enable them in R&D mode with disable watchdogs flag.
Shouldn't make a difference? I currently have 2 N900's, one of which has R&D mode on and the watchdogs disabled, and the other of which has R&D Mode off.

I use my /sbin/preinit mod on both with the above commands, and haven't had a watchdog problem with either? To the best of my knowledge, the one with watchdogs disabled does not end up with those watchdogs started on occasions when I use my at-boot shell during boot. (I don't know of any commands/tools to check, but will be happy to do said checking if told how.)

EDIT: Sorry, made a typo: That's "twl4030_wdt", not "tw14030_wdt".

Last edited by Mentalist Traceur; 2012-07-19 at 00:25. Reason: typo in twl4030_wdt | also comment on # of watchdogs
 

The Following 5 Users Say Thank You to Mentalist Traceur For This Useful Post:
Posts: 2,153 | Thanked: 8,462 times | Joined on May 2010
#144
Originally Posted by Mentalist Traceur View Post
Shouldn't make a difference? I currently have 2 N900's, one of which has R&D mode on and the watchdogs disabled, and the other of which has R&D Mode off.
twl4030 watchdog can be controlled via i2c bus. You can send to watchdog one 5 bit number (0-31):

0 - disable watchdog (prevent reboot)
1-31 - enable watchdog and set reset timer to that number seconds

You cannot direclly send this number from userspace (it doing kernel driver). Also kernel driver has disabled sending "0", so when you enable watchdog you cannot disable it (without patching kernel).

If you set R&D flag disable omap watchdog, then NOLO will send "0" to watchdog and dsme (Maemo daemon which reseting watchdog timer) will do not touch watchdog.

So if watchdog is disabled there is no need to enable it and every N seconds reseting timer. Better is to not touch it too (it will be disabled).

And my watchdogs program is doing it. It check for R&D flag and exit if disable omap watchdog is set.
 

The Following 5 Users Say Thank You to pali For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#145
Originally Posted by pali View Post
twl4030 watchdog can be controlled via i2c bus. You can send to watchdog one 5 bit number (0-31):

0 - disable watchdog (prevent reboot)
1-31 - enable watchdog and set reset timer to that number seconds

You cannot direclly send this number from userspace (it doing kernel driver). Also kernel driver has disabled sending "0", so when you enable watchdog you cannot disable it (without patching kernel).
Is there a good reason this isn't already patched to allow sending 0 in power kernel and cssu kernel? I.e. is there something horribly_dangerous™ about sending 0 to that watchdog? I'll probably go ask the current power kernel maintainer to do it eventually, if there isn't, just because less user choice ultimately = worse.

Originally Posted by pali
And my watchdogs program is doing it. It check for R&D flag and exit if disable omap watchdog is set.
Fair enough: I'll look into this in detail a little while later, and see if I can adapt said checks from your watchdogs binary source into my preinit mod, but personally at the moment I find installing bootmenu or manually fetching the binar to be less convenient than using busybox-power (since I already always install that), for my purposes, even knowing this issue you've pointed out, and I imagine this is true for some other people as well.
 

The Following 2 Users Say Thank You to Mentalist Traceur For This Useful Post:
Posts: 2,153 | Thanked: 8,462 times | Joined on May 2010
#146
now I see that sending "0" (in userspace <--> kernel language it is "disable watchdog") is possible. You need to unload twl4030_wdt module and load it argument nowayout=0. But you can do it only when no application is reseting watchdog (my watchdogs, busybox watchdog, dsme) and you must do it until phone is rebooted
 

The Following 5 Users Say Thank You to pali For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#147
Oh, feeling so dumb now!

Could have come across that from multiboots preinit code
[code]
case "$DEV" in
watchdog) minor=130 ;;
twl4030_wdt) minor=142 ;;
twl4030-adc) minor=58 ;;
*) minor="" ;;
esac
[code]
myself. But maybe was too afraid to mess it up...

Thank you two.
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 2,153 | Thanked: 8,462 times | Joined on May 2010
#148
Vote for new version which is in extras-testing! See first post.
 
Posts: 181 | Thanked: 82 times | Joined on Jan 2010
#149
Originally Posted by reinob View Post
UPDATE!

I booted to the recovery console. 'date' shows incorrect date/time, but 'hwclock -r' shows correct time

Did 'hwclock -s' and then exit (poweroff). Booted to Maemo and voilà! date and time are OK!

[EDIT] I've added 'hwclock -s' in recovery.sh, right after loadkmap.

Next in line: keyboard mapping. But I need to do this at home (loadkeys -b and all).
Good job, reinob!! I was having a similar problem with Recovery Console. I'll edit my recovery.sh to avoid setting the date/time at boot time. Why this command is not part of the official package?


Originally Posted by reinob View Post
If you think you need Recovery Console then you know enough not to have any need for Backupmenu, as Backupmenu is just running commands that you can easily type on the recovery console, with the added benefit of having full control over the parameters as well as proper "error spotting".

No idea about multiboot (never used it, never will). The combination of bootmenu and recovery console (or even without bootmenu if you know what you're doing, hint: /sbin/preinit) gives you all the power you need
I am thinking on installing backupmenu also to get the rootfs backup feature. However, if you think I can do it with re recovery console, please, tell me the commands to backup rootfs and ext3 partitions to files in the microSD card. I've been trying to use the "dd" command "dd if=/dev/mmcblk0p1 of=/media/mmc1/ext3.bin" but I cannot mount the microSD and mmcblk0 is not known by the recovery console. I'm not a Linux expert, so I need help for this.

Thanks a lot.

Edit: The command 'hwclock -s' in recovery.sh also works for me!!! Thanks again!! Please, make this the default in the official package if possible.

Last edited by ikerrg; 2012-09-15 at 16:05.
 

The Following 2 Users Say Thank You to ikerrg For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#150
Originally Posted by pali View Post
now I see that sending "0" (in userspace <--> kernel language it is "disable watchdog") is possible. You need to unload twl4030_wdt module and load it argument nowayout=0. But you can do it only when no application is reseting watchdog (my watchdogs, busybox watchdog, dsme) and you must do it until phone is rebooted
Pali,

I just remembered that I had one question when I first read this:

Would it be possible to build a kernel without the twl4030_wdt module? (neither built-in nor as a module).

Would this mean that the HW watchdog would just do nothing, or would it still reboot the machine because nobody's talking to it?

For safety reasons I now run my N900s always with R&D mode enabled, so this is not really a problem, but it would be nice if the kernel would disable (or "not enable") the watchdog in any case.

(Obviously I'm not requesting this be implemented in kernel-power, because there will be people who for some reason want the watchdog enabled, but I just want to know if you know what happens when you remove -- completely --the module from the kernel).
 

The Following User Says Thank You to reinob For This Useful Post:
Reply

Tags
console, console-mode, framebuffer, recovery, recovery-mode


 
Forum Jump


All times are GMT. The time now is 11:17.