Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N900 and Droid 4 power management #317

Closed
MerlijnWajer opened this issue Feb 9, 2020 · 16 comments
Closed

N900 and Droid 4 power management #317

MerlijnWajer opened this issue Feb 9, 2020 · 16 comments

Comments

@MerlijnWajer
Copy link
Member

The Motorola Droid 4 and the Nokia N900 have OMAP SoCs in there with sophisticated power management.

We should try to get that working well on the devices.

Tony wrote this OpenRC init script for the Droid 4: https://github.com/tmlind/droid4-pm/

With minor changes it can mostly work on the Nokia N900 too.

We probably want to mount debugfs via /etc/fstab for now (cc @parazyd )

I tried some of this on the N900, and on 5.5 with minimal config and almost no modules loaded, it works well. But certain modules make the device not go into power saving.

The droid4-pm lists a few of those modules. On the N900, the touchscreen module (at least on mainline) also prevents any entering of deeper sleep states. Perhaps the PowerVR changes that we have do something like that as well. I am slowly going to add modules and userspace to see if I can come up with a list of all things that block idle.

I will provide some instructions for the N900 later here on this ticket.

@freemangordon - any preferences for how we set up kernel-level pm? Stuff like timeout in ms, control to auto, that kind of stuff. It feels to me like a init script could do the trick, but maybe we want it in userspace instead?

@spinal84
Copy link

spinal84 commented Feb 13, 2020

On Maemo Fremantle it was /etc/pmconfig with settings for kernel power management.
This file was read by /sbin/preinit, which seemed to initialize device PM, R&D and ACT_DEAD modes. /etc/pmconfig was analyzed using /sbin/read_cfg.awk. And this awk scipt does the actual PM settings to the kernel.

@spinal84
Copy link

spinal84 commented Feb 13, 2020

However, I don't see what tool launches /sbin/preinit
/sbin/preinit is run by kernel command like parameter: init=/sbin/preinit
So it's the first thing run by the kernel. Interesting :-)

@MerlijnWajer
Copy link
Member Author

I don't think we need to worry too much about what Fremantle does. The init script just needs to configure autosuspend via /sys and /sys/kernel/debug. No parameters should be required, it should all just work once the drivers and userspace behave.

@MerlijnWajer
Copy link
Member Author

What Tony made seems to do the job, and it's already a neat and simple init script.

@spinal84
Copy link

spinal84 commented Feb 13, 2020

I'm just analyzing how it was done on Fremantle. Thought, you will be curious too.

@MerlijnWajer
Copy link
Member Author

Sure, more info is always good.

@MerlijnWajer
Copy link
Member Author

If it's a problem for systemd-as-init, we could also create the script in /usr/sbin and have the init scripts just call the script.

@Suppresed
Copy link

I have issues running droid4-pm. I don't seem to have /sys/kernel/debug/pm_debug. So it fails at line 108

@spinal84
Copy link

I have issues running droid4-pm. I don't seem to have /sys/kernel/debug/pm_debug. So it fails at line 108

From IRC logs:
<tmlind> Wizzup: care to add mounting debugfs by default to /etc/inittab? Something like: none /sys/kernel/debug debugfs defaults 0 0

@MerlijnWajer
Copy link
Member Author

On my Droid 4 I am currently seeing about 80-140mW with droid4-pm enabled, and latest ascii-devel kernel. Can still be better, but that is without removing touchscreen module, and SGX working.

@MerlijnWajer
Copy link
Member Author

# sleep 20 && /etc/init.d/droid4-pm status
 * SoC idle RET:62144, power consumption 146 mW

@pavelmachek
Copy link

I tried power management on Droid4, 20200323 version. And battery lasted more than 9 hours, but less than 17. That was without modem and without any tweaks. If 146mW power consumption is right, I should be getting 49 hours of battery life or something.

(IIRC battery is 1.8Ah, at 4V and assuming 146mW consuption:)

1800*4 / 146
49

@MerlijnWajer
Copy link
Member Author

So what I did was two things:

  • disable or remove touchscreen (currently rmmod atmel_mxt_ts, but we are one more MCE pull request away from doing it properly)
  • rmmod phy_cpcap_usb

@MerlijnWajer
Copy link
Member Author

and of course, you need the MCE patches that also enable DPMS on the X11 screen -- will try to get that all pushed and built tonight.

@MerlijnWajer
Copy link
Member Author

MerlijnWajer commented Mar 29, 2020

So I did three things, really (with DPMS as well). I did keep wifi on.

@MerlijnWajer
Copy link
Member Author

I can get the device to idle with modem on at about 65mW now. This should be the same for all Maemo Leste users. Let's close this ticket and open ones for specific power management problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants