You are here

Milestone overclocking - patch: CPUfreq statistics fix for the overclock module

link: milestone-overclock

UPDATE: Hmm, it looks like the the stats are still broken in Tiago's version. I will look at the his sources and try to find what's wrong. Till that time, better use the module version that is attached here.
UPDATE 27 August, 2010: the patch has been incorporated in the new 1.4 version of the milestone-overclock module by tiagosousa, therefore this modified version is no longer needed.

This patch fixes two issues of the original overclock module (v1.2):
1. broken CPUfreq statistics
2. freq_table_addr and mpu_opps_addr not set by echo to /proc/overclock/omap2_clk_init_cpufreq_table_addr (Issue 30)

1. CPUfreq statistics:
The frequencies in the cpufreq stats table are not updated by the original overclock.ko module.
Therefore when the cpu_freq table is changed, e.g. cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state does not provide any useful information anymore - it still contains the original frequencies.

The patch adds /proc/overclock/cpufreq_stats_update_addr entry that can be used to autodetect the correct cpufreq stats address.
You can use busybox grep cpufreq_stats_update /proc/kallsyms to find the cpufreq_stats_update address.
Then use echo 0xc029d9d4 > /proc/overclock/cpufreq_stats_update_addr (replace 0xc029d9d4 with the found value).

The default cpufreq stats address used by the patched module comes from the kernel from the 2.1 Canadian Telus firmware. If you are using another kernel, you have to set the cpufreq_stats_update_addr as described above.

2. Handling of writes to /proc/overclock/omap2_clk_init_cpufreq_table_addr:
Fixed missing assignments to freq_table_addr and mpu_opps_addr after autodetection of addresses when handling writes to /proc/overclock/omap2_clk_init_cpufreq_table_addr (Issue 30 of the original overclock module).

E.g. for 2.34.3/2.36.0 firmware you can now use:
echo 0xc0295704 > /proc/overclock/cpufreq_stats_update_addr
echo 0xc004e4b0 > /proc/overclock/omap2_clk_init_cpufreq_table_addr

It will correctly set all three needed addresses (stats_addr, freq_table_addr and mpu_opps_addr).

The correct values for any kernel can be found by:
busybox grep cpufreq_stats_update /proc/kallsyms
and
busybox grep omap2_clk_init_cpufreq_table /proc/kallsyms

An example of the output of cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state for a 1000000/750000/500000/250000 freq table:
Unpatched overclock.ko
550000 5108
500000 10287
250000 100373
125000 0

overclock_stats.ko
1000000 12092
750000 3435
500000 11563
250000 101553

AttachmentSize
overclock.patch6,27 KB
overclock_stats.ko13.15 KB

Comments

sorry,
the numbers right to the frequencies are the number of ticks
thatthe processor was clocked at that frequency, or am I totally confused?
thank's for our great work!

It's the time that the processor was clocked at that frequency (in 10ms units).

Great blog you have here but I was wanting to know if you knew of any community forums that cover the same
topics talked about in this article? I'd really love
to be a part of online community where I
can get comments from other knowledgeable individuals that share the same interest.
If you have any recommendations, please let me know. Cheers!

hi,
when i triyng your patched module in my 02.34.3 milestone
the phone stucks at Motorola "M" logo,
even if i not initialize the cpufreq_stats_update_addr.

i have searched for the stats addr using the grep command and obtained

>>> c0295704 t cpufreq_stats_update

i have updated the module at /system/lib/modules/ and the
mot_boot_mode with the code bellow:

insmod /system/lib/modules/cpufreq_overclock.ko

# Set the CPU frequencies tables addresses

echo 0xc04f7b68 > /proc/overclock/freq_table_addr
echo 0xc04f8888 > /proc/overclock/mpu_opps_addr
echo 0xc0295704 > /proc/overclock/cpufreq_stats_update_addr

...

with the overclock12.ko (original) all works fine
(initializating the freq_table and mpu_opps addresses with their
correct values)

please help !

You definitely must set the /proc/overclock/cpufreq_stats_update_addr when running the kernel from 2.34.3 or the module will use a wrong address.
I'll flash the 2.34.3 on my phone and try to find out what's wrong.

i agree to you very mutch!!
for your info, i send the freqs table and mpu_oops table addresses:

echo 0xc04f7b68 > /proc/overclock/freq_table_addr
echo 0xc04f8888 > /proc/overclock/mpu_opps_addr

T H A N K ' S !

I've identified the problem and I'll upload a new version soon.
Until then, you can use this parameter when loading the module (instead of echo 0xc0295704 > /proc/overclock/cpufreq_stats_update_addr), it works perfectly:
insmod /system/lib/modules/overclock_stats.ko cpufreq_stats_update_addr=0xc0295704

no problem.
i wait for a new version :)
thank's

Fixed version uploaded. You can re-download the overclock_stats.ko.

thank you!!

Superb blog you have here but I was wanting to know if you knew of
any discussion boards that cover the same topics discussed here?
I'd really like to be a part of online community where I can get opinions from other experienced people that share the same interest.
If you have any suggestions, please let me know.

Thanks a lot!

Attractive section of content. I just stumbled upon your site and in accession capital to assert that I get in fact enjoyed account
your blog posts. Any way I'll be subscribing to your feeds and even I achievement you access consistently quickly.

A person essentially lend a hand to make critically posts
I might state. This is the first time I frequented your website page and to
this point? I surprised with the research you made to make
this particular submit incredible. Excellent task!

Hello There. I found your weblog the usage of msn. That is a really
smartly written article. I will make sure to bookmark it and come back to read more of your useful information. Thank you for the post.
I will definitely comeback.

what's the signification of the single number that appears at the last line of the stats update table?
thx

sorry.
soled, is the number of transitions
.

Attractive section of content. I just stumbled upon your site and in accession capital to assert that I get actually enjoyed account your blog posts.
Anyway I will be subscribing to your augment and even I achievement you access consistently rapidly.

I do believe all of the ideas you've offered to your post.
They're very convincing and will certainly work. Nonetheless, the posts
are very short for beginners. May you please lengthen them a bit from next time?
Thanks for the post.

Hi

Are you aware of this bug? http://code.google.com/p/android/issues/detail?id=7520
Probably it has something to do with "dynamic overclocking on demand" on 2.1 Droid/Milestone and can be fixed with just tweaking of some kernel structures without waiting for 2.2 where it's probably fixed (can't tell for sure until the official 2.2 goes OTA - see the link above)

In current state, 2.1 Droid/Milestone can only render 2D graphics no faster than a lousy 30FPS - that's very frustrating for game developers and users who want to play games.

great issues altogether, you simply gained a brand new reader.
What might you suggest in regards to your publish that
you simply made some days ago? Any certain?

Sorry, I am noob and literally took hours to install the regular overclock + conservative preset.

how do I install this?

At the moment when I do "cat /proc/overclock/mpu_opps" in a terminal it gives me wrong frequencies, I guess this patch will fix this?

Hi nadlabak,
Any chance you can provide the patched binary (compiled) file? i.e. ready to use
I'm not into programming, but would like to use your fix.
Thanks in advance and keep up your excellent work!

It's the attached file overclock_stats.ko. That's the compiled patched overclock module, ready to be used.

embarrassed... (not to say stupid).
Sorry about that and thanks!

I used to be able to find good information from your content.

I have been browsing online more than 3 hours today, yet I never found any interesting article like yours.
It's pretty worth enough for me. In my view, if all web owners and bloggers made
good content as you did, the internet will be a lot more useful than ever before.

Hey nadlabak!

It's payce from Android-Hilfe.de. It seems as the patch Tiago incooperated does not work quite yet. See this issue I opened up: https://code.google.com/p/milestone-overclock/issues/detail?id=41

Did he perhaps use an old version of the patch? (echo xyz_adress > cpufreq_stats_update_addr does not work)

BR!

Magnificent beat ! I would like to apprentice whilst you amend your website, how can i subscribe for
a blog site? The account aided me a appropriate deal. I were a little bit familiar of this your broadcast provided vibrant transparent concept

as payce said.
I use insmod overclock.ko in mot_boot.

By echo cpufreq_stats_update_addr after insmod, overclock.ko 1.4 works 'better' as time_in_state shows:
800000 xxx
500000 xxx
250000 xxx
125000 xxx

instead of 'pure' stock freq,

while using your patched version the output is:
800000 xxx
600000 xxx
500000 xxx
250000 xxx

adderall dosage men - side effects adderall 40mg

What's Going down i'm new to this, I stumbled upon this
I've found It positively helpful and it has aided me out
loads. I hope to give a contribution & assist other customers like
its aided me. Good job.

adderall dosage men - side effects adderall 40mg

Hi! I've been following your weblog for a while now and finally got the courage
to go ahead and give you a shout out from Atascocita Texas!
Just wanted to say keep up the great job!

Today, I went to the beach with my kids. I found a sea shell and gave it
to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She put the shell to her ear
and screamed. There was a hermit crab inside and it pinched her ear.
She never wants to go back! LoL I know this is entirely off topic but I had to
tell someone!

adderall dosage men - side effects adderall 40mg

I've been browsing online more than three hours today, yet I never found any interesting article like
yours. It's pretty worth enough for me. In my view, if
all web owners and bloggers made good content as you did, the net
will be a lot more useful than ever before.

adderall dosage men - side effects adderall 40mg

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.