Bug 7633 - (int-120620) Enable SmartReflex on N900 by default
(int-120620)
: Enable SmartReflex on N900 by default
Status: RESOLVED WONTFIX
Product: Core
general
: 5.0:(10.2010.19-1)
: N900 Maemo
: Medium normal with 37 votes (vote)
: 5.0/(20.2010.36-2)
Assigned To: unassigned
: core-general-bugs
: http://focus.ti.com/pdfs/wtbu/smartre...
: use-time
:
:
  Show dependency tree
 
Reported: 2010-01-04 14:53 UTC by Stephan Jaensch
Modified: 2010-10-25 18:40 UTC (History)
28 users (show)

See Also:


Attachments
/dev/mtd2 bzip2 compressed. (45 bytes, application/x-bzip2)
2010-03-24 18:32 UTC, zimon
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description Stephan Jaensch (reporter) 2010-01-04 14:53:56 UTC
This is spun off from bug 6615. Quoting comment #70 there:

===
The SmartReflex power saving feature of the OMAP processor is disabled by
default on the n900.  To enable it:

echo 1 > /sys/power/sr_vdd1_autocomp
echo 1 > /sys/power/sr_vdd2_autocomp

You can also enable it by editing /etc/pmconfig and changing the appropriate
values to 1, and rebooting.
===

Further comments indicate that enabling the feature decreases battery usage
significantly, but might cause reboots or other instabilities. This bug is
intended for discussion about what needs to be done to enable SmartReflex
safely by default on the N900.
Comment 1 Andrei Dancau 2010-01-04 15:12:50 UTC
I can confirm enabling it in /etc/pmconfig and getting at least double the
battery life I had before with my normal daily use patterns (about 1 hour of
calls, 30 minutes of SIP calls, browsing, 1 hour listening to music, some 1
hour playing). Battery is half empty after 7 hours. With this usage by this
time it used to be in the red.
Have not noticed any instabilities or downsides, apart from two suspect
disconnections from wlan (did not happen before, though it could be just a
coincidence, as they occured at a couple of minutes from each other and have
not happened again).
Comment 2 Miloš Mandarić 2010-01-04 15:12:56 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Andre Klapper maemo.org 2010-01-04 15:13:30 UTC
Thanks for reporting this. Confirming.
Comment 4 PeteC 2010-01-04 15:45:16 UTC
since enabling I have seen (within 20 mins usage):
- one wd32_to reboot in email client (with a few apps open in background)
- one wd32_to reboot while previewing alarm ringtones (audio 'machinegun' ->
reboot)
- graphical corruption in desktop background (a small horizontal black bar).

If the graphical corruptiom is any indication of what's going on in the RAM in
general (big assumption I know) then I'm not surprised at the reboots!

Currently testing to see if I can get away with enabling SR for vdd1 or vdd2
individually.

Too early to comment on battery life.
Comment 5 bugs.maemo.org@falkensweb.com 2010-01-04 16:01:17 UTC
I can't reproduce those crashes on my N900, latest public firmware, shop bought
unit.
I've had SmartReflex on for a day now with no issues.
Comment 6 Neil MacLeod maemo.org 2010-01-04 16:45:03 UTC
Also stable here for the past 36 hours with 2.2009.51-1 firmware, however I'm
not seeing any obvious improvement in battery lifetime over that which already
comes with 2.2009.51-1.

From a full charge at 9am this morning the N900 with SmartReflex enabled
currently has a battery icon that appears to be about 75% full, although
"lshal|grep battery.*.percentage" returns a value of 50 (0x32).
Comment 7 Neil MacLeod maemo.org 2010-01-04 16:49:30 UTC
Forgot to mention it's now 14:45 here in the UK, ie. about 6 hours elapsed of
light usage for the battery to now show ~75% remaining, much as it did before
SmartReflex was enabled.
Comment 8 Marko 2010-01-05 09:05:38 UTC
I enabled SmartReflex yesterday and charged the battery overnight.

So far I can't comment on the power saving feature, but I did encounter a
mismatched desktop and reboot shortly after unplugging the charger in the
morning. This is my 1st crash ever since taking the device into use (2 weeks
ago), and it seems that the SmartReflex is at fault.
Comment 9 Neil MacLeod maemo.org 2010-01-06 12:18:11 UTC
Running 2.2009.51-1, and so far I don't think SmartReflex has improved battery
lifetime in fact based on the last 2 days I actually think it has reduced
lifetime by about 1 hour.

On Monday night by 10pm (from a 9am full charge) the battery was flat with
minimal usage, yet prior to SmartReflex I've had the battery go beyond midnight
with greater use. Same last night.

No new apps installed during the last week, the only change is to enable
SmartReflex. Oh and my desktop crashed last night as well - it's never done
that before.
Comment 10 matikjn 2010-01-06 12:43:45 UTC
I'm still on original firmware (42-11?), and while battery life is definately
improved I also have had the desktop freeze on me once in the 3 days since
turning SmartReflex on. Also WLAN seems to disconnect more frequently, although
still rare overall. I haven't noticed any issues with 3g connectivity.

I have had no random reboots - perhaps slight differences in hardware may cause
mre instability for some, which would explain why it was initially turned off.

Googling arm smartreflex came across this mailing list post - not sure if it is
relevant to why smartreflex was off.

http://www.mail-archive.com/linux-omap@vger.kernel.org/msg17815.html
Comment 11 Andrea Borgia 2010-01-06 16:46:44 UTC
Using the original firmware (1.2009.42-11), I enabled pmconfig: over a couple
of days, I noticed no significant improvements in battery life but I just had
my first reboot ever.

I had calendar and browser open, load was a bit high because browser was
rendering a new page.
Comment 12 bugs.maemo.org@falkensweb.com 2010-01-07 17:34:12 UTC
I have what looks like a fairly consistent crasher with smartreflex on. Hard
for anyone else to reproduce, but details below.

Install MediaBox and start playing UPNP-provided music (WPA2-PSK 11g wireless).
Without fail (for me), after around 20 minutes, I get a reboot
(/proc/bootreason says 'sw_rst').

If I don't set SmartReflex on, works fine.

If I play for an hour or so, then turn on SmartReflex, I get the crash around
20 mins later.

Could crashes be network related, as I'm not normally stressing the wireless as
much as MediaBox does.
Comment 13 Andre Klapper maemo.org 2010-01-07 18:12:20 UTC
Enabling SmartReflex is being considered for the second update release.
Comment 14 matikjn 2010-01-07 18:36:37 UTC
(In reply to comment #13)
> Enabling SmartReflex is being considered for the second update release.
> 

Thanks for the update.

In the meantime, to have smartreflex enabled at boot, I entered this in
/etc/events.d/smartreflex:

start on USER
stop on starting shutdown

console none

script

# Enable SmartReflex
echo -n 1 > /sys/power/sr_vdd1_autocomp
echo -n 1 > /sys/power/sr_vdd2_autocomp

end script

Not sure if this is the right way to do it, but it seems to work
Comment 15 Andrei Dancau 2010-01-08 00:29:11 UTC
@matikjn: It's easier to change to 1 the corresponding values in /etc/pmconfig.
The change is permanent until you change them back to 0 (survives reboot), no
need for additional scripts.
Comment 16 Rodrigo Linfati 2010-01-11 01:28:56 UTC
reboot on 42-11 :(
Comment 17 bugs.maemo.org@falkensweb.com 2010-01-11 09:31:18 UTC
What did /proc/bootreason say after the reboot ? What were you doing at the
time ?

Turns out the reboot I thought I could ge by enabling SmartRefel after starting
mediabox wasn't as consistant, and also a lot of the time it turned out (after
looking in the 'recent' playlist with a text editor) that it was playing local
media, not over the network.
Comment 18 Eero Tamminen nokia 2010-01-11 12:44:24 UTC
(In reply to comment #6)
> Also stable here for the past 36 hours with 2.2009.51-1 firmware, however I'm
> not seeing any obvious improvement in battery lifetime over that which already
> comes with 2.2009.51-1.

Did you reboot after changing pmconfig?
Comment 19 Neil MacLeod maemo.org 2010-01-11 13:59:49 UTC
(In reply to comment #18)
> (In reply to comment #6)
> > Also stable here for the past 36 hours with 2.2009.51-1 firmware, however I'm
> > not seeing any obvious improvement in battery lifetime over that which already
> > comes with 2.2009.51-1.
> 
> Did you reboot after changing pmconfig?
> 

No, I just performed the following and didn't make any permanent changes:

     echo -n 1 > /sys/power/sr_vdd1_autocomp
     echo -n 1 > /sys/power/sr_vdd2_autocomp

Would you expect to see an improvement after editing pmconfig in 2.2009.51-1?
Comment 20 Eero Tamminen nokia 2010-01-11 19:31:53 UTC
(In reply to comment #19)
>> Did you reboot after changing pmconfig?
> 
> No, I just performed the following and didn't make any permanent changes:
> 
>      echo -n 1 > /sys/power/sr_vdd1_autocomp
>      echo -n 1 > /sys/power/sr_vdd2_autocomp

Changing power management values isn't guaranteed to work properly after
bootup.  It's better to do this at bootup through pmconfig.


> Would you expect to see an improvement after editing pmconfig in 2.2009.51-1?

AFAIK it's orthogonal to change that have gone to 51-1.

SmartReflex means using individual HW specific settings (calibrated at factory)
for certain power management things (people in general treat all HW the same,
but in reality they have small differences), so the effect can differ a bit
from device to device. I would assume differences in user's device usage
patterns, surrounding phone network quality etc to have more much larger effect
than SmartReflex.  If somebody thinks it to "double" the use-time, it's likely
the difference is caused by something else.
Comment 21 Neil MacLeod maemo.org 2010-01-12 02:00:32 UTC
Firmware 2.2009.51-1

Not good news.

I set both sr_vdd1_autocomp and sr_vdd2_autocomp to 1 in /etc/pmconfig,
rebooted and I subsequently experienced three unexplained reboots within a 2
hour period. Each time the bootreason has been 32wd_to.

The last reboot occurred when I had been listening to an MP3 album via the
media player widget on my journey home. Once I had got home I hit pause on the
desktop widget to stop playback then unplugged my headphones, and about 30
seconds later the device rebooted.

I also had an unexplained reboot when I echo'd 1 to
/sys/power/sr_vddX_autocomp, can't recall what I was doing at the time but
clearly changing these settings can have some effect (if only to reduce
stability!)

When these settings have been set to zero my device has been rock solid since I
received it on 09 Dec. It has only ever crashed while SmartReflex has been
enabled.

On this basis I wouldn't recommend enabling SmartReflex as a default just yet,
not unless a firmware later than 51-1 has fixes that improve stability when
SmartReflex is enabled.
Comment 22 Eero Tamminen nokia 2010-01-14 11:48:07 UTC
If you want to know more about SmartReflex, see the section "SmartReflex
Adaptive Voltage Control" (sections close it explain also DVFS) e.g. in this
document:
  http://www-s.ti.com/sc/techlit/spruf98

(It's not the TRM for N900 Omap3, but close enough, didn't find the right one
with quick googling.)
Comment 23 egoshin 2010-01-15 08:37:54 UTC
(In reply to comment #22)
> If you want to know more about SmartReflex, see the section "SmartReflex
> Adaptive Voltage Control" (sections close it explain also DVFS) e.g. in this
> document:
>   http://www-s.ti.com/sc/techlit/spruf98
> 
> (It's not the TRM for N900 Omap3, but close enough, didn't find the right one
> with quick googling.)
> 
If you find, please drop a note - it would be interesting from bug hunting
point of view. Or just some document which states a diff.
Comment 24 bugs.maemo.org@falkensweb.com 2010-01-28 17:46:46 UTC
Although my 55-1 firmware device was stable setting smart reflex on after boot,
once I set this in /etc/pmconfig I started getting reboots every day or so. 
Reverting the change in pmconfig fixed these. As such, I'm with drawing my
vote.

Since 55-1 I seem to get much better battery life anyway.
Comment 25 Tero Avellan 2010-01-28 18:35:45 UTC
(In reply to comment #24)
> Although my 55-1 firmware device was stable setting smart reflex on after boot,
> once I set this in /etc/pmconfig I started getting reboots every day or so. 
> Reverting the change in pmconfig fixed these. As such, I'm with drawing my
> vote.
> 

Interesting. It seems to work for some people with firmware 51-1 or even with
earlier versions. Couple questions to specify this. Did you upgrade on the fly
or did you re-flashed the device? What did the bootreason say ("cat
/proc/bootreason") after those reboots? Was it 32wd_to, sw_rst or pwr_key? And
what's your pmconfig like?
Comment 26 bugs.maemo.org@falkensweb.com 2010-01-28 20:54:55 UTC
> Did you upgrade on the fly or did you re-flashed the device?

OTA. For the purposes of this bug, I don't see the value of doing a reflash to
see if it makes a difference - almost all users will only update OTA.

> What did the bootreason say ("cat /proc/bootreason") after those reboots? 

32wd or sw_rst.

> what's your pmconfig like?

Unchanged from the defaults apart from the change to '1' (or '0' !) on the
Smart Reflex related lines.
Comment 27 egoshin 2010-02-16 22:52:57 UTC
Couple of days ago I enabled again SmartFlex, this time on PR1.1. Past time I
did it on PR1.0 and had a crash (see
https://bugs.maemo.org/show_bug.cgi?id=6334#c320).

Now - couple of days passed, some usage and no problem at all. Battery life
seems to be 30% improvement.

Need to report today because I plan to go to PR1.1.1
Comment 28 Timur Kristóf 2010-03-22 22:56:27 UTC
I also enabled SmartReflex by editing /etc/pmconfig, and then I rebooted the
device. (This was a few days ago.) I have PR 1.1.1, and it seems that it
doesn't cause any instability at all.

It is hard to judge the power consumption, but it really seems to improve the
battery life.

To Stephan Jaensch: Thank you for writing this down.
Comment 29 zimon 2010-03-24 18:02:21 UTC
I just tried that SmartReflex hack yesteday. It worked fine, until today (just
one hour ago) N900 crashed and booted.

Code:

$ cat /proc/bootreason 
32wd_to

What else (logs) would be helpfull to know if the reason for system crash was
SmartReflex or something else?
Comment 30 Filip Hofer 2010-03-24 18:05:01 UTC
There seems to be an issue with prolonged/infinite charging time with
SmartReflex enabled, cf.
http://talk.maemo.org/showthread.php?p=580479#post580479
Comment 31 zimon 2010-03-24 18:32:11 UTC
Created an attachment (id=2523) [details]
/dev/mtd2 bzip2 compressed. 

(In reply to comment #29)
> until today (just one hour ago) N900 crashed and booted.
> $ cat /proc/bootreason 
> 32wd_to

$ uname -a
Linux Nokia-N900-42-11 2.6.28-omap1 #1 PREEMPT Thu Dec 17 09:40:52 EET 2009
armv7l unknown

# cat /var/log/syslog   
Mar 13 12:32:08 Nokia-N900-42-11 cellmo-watch[2316]: Link DOWN
Mar 13 12:33:13 Nokia-N900-42-11 cellmo-watch[841]: Link UP: MCU-SW Ver: V
ICPR82_09w47, 20-11-09, RX-51, (c) Nokia 
Mar 22 16:54:10 Nokia-N900-42-11 cellmo-watch[852]: Link UP: MCU-SW Ver: V
ICPR82_09w47, 20-11-09, RX-51, (c) Nokia 

I had N900 charging, and FM-radio application running out of loudspeakers,
headphones were attached as for FM-antenna.

The attached dev_mtd2.2010-03-24_17-47-55.img.bz2 is a bzip2'ed image file
retrieved on N900 with dd-program after the crash. (Don't know what it is, but
someone asked on the other thread to provide it for someone else.)
Comment 32 Rene 2010-04-01 10:08:45 UTC
Software Version: 3.2010.02-8

Even on this Version the crashes arent fixed, when SmartReflex power saving is
enabled.

Random Reboots, System Laggs and freezes, works extremly slow.

Nothing fixed on this version whith settings:

Enable_off_mode  0
sr_vdd1_autocomp 1
sr_vdd2_autocomp 1

When will SmartReflex power saving mode run stable? I hope with PR 1.2 it is
fixed.
Comment 33 Timur Kristóf 2010-04-01 12:31:36 UTC
It runs stable for me... has been for at least 2 weeks.

BTW, no need to set Enable_off_mode to 0 anymore, that was another bug and is
now fixed.
Comment 34 tamas2001 2010-04-05 22:28:29 UTC
(In reply to comment #33)
> It runs stable for me... has been for at least 2 weeks.
> 
> BTW, no need to set Enable_off_mode to 0 anymore, that was another bug and is
> now fixed.
> 

This (sr) is not stable here (PR1.1.1,  Enable_off_mode=1). reboot (2x) with
sygic navi after 15 mins then right after sygic started again
an other reboot with bluetooth car kit (parrot). It doesn't matter set via echo
1 > /sys.... or via /etc/pmconfig+reboot.

bootreason is 32wd_to or sw_rst
So would be great to fix it somehow.. Hope it will happen soon.
thanks for the effort in advance
Comment 35 Eero Tamminen nokia 2010-04-09 19:32:23 UTC
(In reply to comment #13)
> Enabling SmartReflex is being considered for the second update release.

Not anymore.  Let's see if it can be enabled on Harmattan devices.


Btw. Does anybody know any device using the same Omap revision that would have
SmartReflex enabled by default?
Comment 36 egoshin 2010-04-09 21:15:57 UTC
Is it possible for Nokia to put table of minimum voltage per each frequency for
each device into some permanent flash area basing on device QA test results
individually? Plus SmartReflex availability for this chip.

I am thinking about fine tune of V-per-Freq in each device individually because
it looks like TI yield doesn't allow a good averaging of it (some CPU can't
handle low V, some can do and some can-or-can't do SmartReflex)

See http://talk.maemo.org/showpost.php?p=601814&postcount=1833 and around for
ongoing development.
Comment 37 Eero Tamminen nokia 2010-04-12 12:03:05 UTC
(In reply to comment #36)
> Is it possible for Nokia to put table of minimum voltage per each frequency
> for each device into some permanent flash area basing on device QA test
> results individually?

No.  That's the point of SmartReflex.
Comment 38 bugs.maemo.org@falkensweb.com 2010-04-12 17:08:35 UTC
"No.  That's the point of SmartReflex."
Unfortunately, and I didn't want this to be true, not all N900 CPUs are stable
with this feature enabled. 
As such, this bug should be closed WONTFIX.
Comment 39 tom hensel 2010-04-12 21:22:12 UTC
(In reply to comment #38)
> "No.  That's the point of SmartReflex."
> Unfortunately, and I didn't want this to be true, not all N900 CPUs are stable
> with this feature enabled. 
> As such, this bug should be closed WONTFIX.

sad but true, my device for instance is not stable with SmartReflex enabled.
but can we really be sure that this is a WONTFIX due to hardware constraints?
might there be a possible workaround in software?
Comment 40 Timur Kristóf 2010-06-11 00:01:07 UTC
Okay, I was using SmartReflex for more than a month (since I've purchased my
device), and now I've been using it without SmartReflex for some time to see
the difference.

I also had a few crashes: with SmartReflex on, the N900 seems to freeze when
the CPU is under high load. After freezing, it reboots. (Boot reason was always
sw_rst, and on one occasion, 32wd_to.)
It neved crashed when the CPU load was not max. (As I saw in the cpumem
applet.)

I also noticed that SmartReflex saves power most noticably when the device is
either in standby mode or on low usage.

So, my proposed solution is this: let's enable SmartReflex by default, and if
the CPU usage is above 50%, simply disable it. Then, if CPU usage drops below
that level, reenable it again.

Is this a viable option?
Comment 41 Michael Cronenworth 2010-06-11 00:50:03 UTC
(In reply to comment #40)
> 
> Is this a viable option?
> 

The problem, AFAIK, is that VDD2 SR is broken (especially in PR1.2). Only
enable SR for VDD1. I have not seen any random rebooting since running SR on
VDD1 only for the past few weeks, even undervolted.
Comment 42 Timur Kristóf 2010-06-11 00:51:47 UTC
(In reply to comment #41)
> 
> The problem, AFAIK, is that VDD2 SR is broken (especially in PR1.2). Only
> enable SR for VDD1. I have not seen any random rebooting since running SR on
> VDD1 only for the past few weeks, even undervolted.
> 

Very interesting.
However, I couldn't find any info about what VDD1 and VDD2 do, and what's the
difference between them. Could you tell me?
Comment 43 Andre Klapper maemo.org 2010-06-11 11:03:46 UTC
(Please don't turn this a forum but stay on-topic. Thanks.)
Comment 44 PeteC 2010-06-11 13:00:03 UTC
(In reply to comment #41)
> The problem, AFAIK, is that VDD2 SR is broken (especially in PR1.2). Only
> enable SR for VDD1. I have not seen any random rebooting since running SR on
> VDD1 only for the past few weeks, even undervolted.

For the record, I've experienced 32wd_to resets when enabling both VDD1 and
VDD2 independently of the other.

If you can get away with running SR on VDD1 only - good for you. I can't. The
point is that each device is different.
Comment 45 bugs.maemo.org@falkensweb.com 2010-06-11 17:34:16 UTC
"let's enable SmartReflex by default, and if
the CPU usage is above 50%, simply disable it"

For me, when I enabled it, I got crashes regardless of load.
Sorry, still can't support this plan.
Comment 46 Andre Klapper maemo.org 2010-07-08 12:30:20 UTC
Forwarding internal comment:
"Nokia decided that SR will be kept disabled. In the next public update it will
be made possible to advanced users to enable it if wanted."