Active Topics

 


Reply
Thread Tools
Posts: 74 | Thanked: 19 times | Joined on Oct 2008
#1
Hi all,

I broke some of the charging hardware on my n900 by plugging it in to a cheap car charger. The consequence is that now the n900 always thinks it's attached to a dumb-charger (so it's the charger-detect logic that's broken). Charging from a dumb charger doesn't work but I can plug it into a PC via USB and it charges properly, likely because the charging is negotiated in software. Anyway that's fine with me. Here's the annoying gotcha though...

I didn't notice this before, but apparently when charging the CPU only uses the C0 and C1 states, and avoids the deeper C2/C3/C4 sleep states (tested with powertop). This is a problem now because it thinks it's always charging so the CPU stays awake all the time. My battery life (on a brand new genuine Nokia battery) is about 6 hours of standby (no usage)! So, this should be easy to fix in software but I can't figure out how. Obviously the CPU has two sleep profiles -- one for when on AC power and the other for on battery. All I need to do is copy the settings from the battery profile over to the AC one, and it should be fixed. I just can't find these profiles! Anyone have any ideas?

Thanks for any help you can provide,

Jonathan
 
Posts: 74 | Thanked: 19 times | Joined on Oct 2008
#2
Before anyone asks, I forgot to mention that I've tried a reflash (incl MMC) so it's definitely a hardware problem.
 
Posts: 176 | Thanked: 190 times | Joined on Jun 2011 @ Italy
#3
Originally Posted by spock View Post
Before anyone asks, I forgot to mention that I've tried a reflash (incl MMC) so it's definitely a hardware problem.
I don't know how to fix CPU problem but for charging issue, because you can charge the phone only with a usb port, you could buy something like this:



and plug the usb cable directly in the adapter.
Be careful to check if Ampere and Volts are correct for your N900 (you can find a lot of adapter like this on the web, with different Ampere and Volt)

 

The Following User Says Thank You to blackjack4it For This Useful Post:
Posts: 74 | Thanked: 19 times | Joined on Oct 2008
#4
Hi Blackjack4it,

That's the sort of thing that broke my charging port in the first place (except it plugged into a car). It's also very likely a "dumb" charger (same as the Nokia one) and therefore won't be detected properly. It appears that only the USB protocol power management/negotiation works to enable charging.

I'd really like to address the CPU sleep states so I don't have to charge my phone 2x daily! (Plus, it gets pretty hot in my pocket!)

Thanks,

Jonathan
 
Posts: 176 | Thanked: 190 times | Joined on Jun 2011 @ Italy
#5
I'm really sorry that this was the cause..i'm thinking about a false contact in the USB port (our N900 is famous to break the USB port very soon ) Maybe yours is still in its place, but not perfectly, and the OS could have one of these issues:

1) It thinks that there is always a charger plugged (like you said)
2) It doesn't charge properly the battery

Sadly I'm not an expert,my advice is to try different solutions first, but your last chance could be to fix the USB port with this guide and cross your fingers:

http://talk.maemo.org/showthread.php...light=usb+port

Hope this can helps you
 

The Following User Says Thank You to blackjack4it For This Useful Post:
Posts: 701 | Thanked: 585 times | Joined on Sep 2010 @ London, England
#6
Battery charging is handled by BME, you could try (as root)
Code:
stop bme
to stop it. I'm not sure it will help since I don't think it comes out of charging mode when it stops, but it may be worth a try anyway. You can use
Code:
start bme
to start it up again when you want.

Alternatively you can move the file /etc/event.d/bme somewhere else so it doesn't start on boot, but be warned, I haven't tried it and it may caus your N900 to end up in a reboot loop (although you should be able to enable R&D mode and disable the lifeguard reset to get out of it).

And speaking of R&D mode, it has a "no-charging" flag you can set which may help, but it'll probably prevent charging when connected to a computer as well.
 

The Following User Says Thank You to retsaw For This Useful Post:
Posts: 74 | Thanked: 19 times | Joined on Oct 2008
#7
Hi guys,

Thanks again for your ideas. I've been using the start/stop bme commands to restart the charging daemon (necessary each time it becomes full). I have also developed a regimen of other workarounds to handle this problem. I'm pretty sure there's nothing wrong with the USB port because the USB data connection and USB (PC) charging work perfectly. The only remaining issue I don't have a workaround for is the CPU sleep profile because the N900 thinks it's permanently charging so it doesn't bother with any power saving modes, and it burns the battery down fast. I've tried kernel-power and disabling any frequency above 250MHz (either with "avoid" or "limits") and nothing will convince the OMAP to drop below 500MHz.

That gives me an idea. Can someone with a functional N900 do me a favour? Run powertop on an idle device once while on battery then again while plugged in to a charger (PC, or dumb charger, doesn't matter), and post both sets of results? I'd like to test my theory of why I'm stuck in C0/C1.

Thanks!
 
ammyt's Avatar
Posts: 1,918 | Thanked: 3,118 times | Joined on Oct 2010 @ My pants
#8
I can fix your problem, create a dbus-script that locks the CPU to 125MHz when locked, and back to your case when unlocked. I just want you to try this:
Code:
kernel-config lock 125
Does it make any changes?
 

The Following 2 Users Say Thank You to ammyt For This Useful Post:
Posts: 74 | Thanked: 19 times | Joined on Oct 2008
#9
Originally Posted by ammyt View Post
I can fix your problem, create a dbus-script that locks the CPU to 125MHz when locked, and back to your case when unlocked. I just want you to try this:
Code:
kernel-config lock 125
Does it make any changes?
Nope, here's what happens:

Code:
Nokia-N900:~# kernel-config show
current kernel configuration:
current frequency: 500
supported frequencies: 125 250 500 550 600 700 750 805 850 900 950 1000 1100 1150 
min. frequency: 125
max. frequency: 600
avoid frequencies: 125 
active frequencies: 0:30,90 250:38,180 500:48,360 550:54,400 600:60,430 700:60,430 750:60,430 805:60,430 850:60,500 900:60,500 950:60,500 1000:60,500 1100:72,520 1150:72,520 
SmartReflex VDD1=0, VDD2=0
governor ondemand: ignore nice load= 0, up threshold= 95, sampling rate= 300000, powersave bias= 0
Code:
Nokia-N900:~# kernel-config lock 125
locking frequency 125000
Code:
Nokia-N900:~# kernel-config show
current kernel configuration:
current frequency: 500
supported frequencies: 125 250 500 550 600 700 750 805 850 900 950 1000 1100 1150 
min. frequency: 125
max. frequency: 125
avoid frequencies: 
active frequencies: 0:30,90 125:30,90 250:38,180 500:48,360 550:54,400 600:60,430 700:60,430 750:60,430 805:60,430 850:60,500 900:60,500 950:60,500 1000:60,500 1100:72,520 1150:72,520 
SmartReflex VDD1=0, VDD2=0
governor ondemand: ignore nice load= 0, up threshold= 95, sampling rate= 300000, powersave bias= 0
It stays at 500MHz, despite the lock
 
Posts: 74 | Thanked: 19 times | Joined on Oct 2008
#10
OK I hacked it so it sleeps properly now by changing these lines in the kernel:

Code:
static void rx51_usb_set_pm_limits(struct device *dev, bool set)
 {
-	omap_pm_set_max_mpu_wakeup_lat(dev, set ? 10 : -1);
-	omap_pm_set_min_mpu_freq(dev, set ? 500000000 : 0);
+	omap_pm_set_max_mpu_wakeup_lat(dev, -1);
+	omap_pm_set_min_mpu_freq(dev, 0);
 }
For some reason, when USB is connected it limits the minimum frequency to 500MHz, which holds the CPU in C0 or C1 c-states and prevents deep sleeping. With this two-line change, my powertop now looks like this (and I'm really happy!):

Code:
Nokia-N900:~# powertop
Powertop 1.13.3
status: Unknown job: pmtrackerdaemon
Sleeping for 11 seconds before sampling
Collecting data for 30 seconds
Sample interval was 00m 30s 73822us

C#      | Ratio  | Avg/dura | Frequency | Ratio
--------+--------+----------+-----------+--------+
     C0 |   1.6% |          |   600 MHz |   1.0% |
     C1 |   0.1% |    0.8ms |   550 MHz |   0.0% |
     C2 |   2.3% |   13.8ms |   500 MHz |   3.5% |
     C3 |   8.1% |  101.3ms |   250 MHz |  95.4% |
     C4 |  88.0% | 1763.3ms |
However, I still need to restart the bme daemon every time I unplug the phone from the USB-host charger (remember, dumbchargers don't work at all anymore, and I'm OK with that). Also I'm concerned that I may have affected the USB connectivity by allowing the CPU to power down while actually connected to the USB (eg. mass-storage mode). Basically, there must have been some reason that the USB driver was holding the CPU speed high... Oh well, time will tell I guess.
 

The Following 2 Users Say Thank You to spock For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 08:40.