yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Original Android Development] Entropy512:
Correct. The main power management chip in our device is the MAX8997. Its predecessor in the I9100 (and all other Hummingbird-based devices) was the MAX8998.

On those devices, the 8998 was used to control charging. It could go up to 800 mA charge current.

On our device, the 8997 has battery charger features just like its predecessor which allow 50 mA steps up to 950 mA based on reading the kernel source, but that function isn't used at all. Charging is handled instead by a separate chip, the MAX8922, which supports 90, 400, and an "adjustable" current limit which is set by a resistor. (e.g. the board designer can adjust it but software can't - so if you want to go above 650 you need a soldering iron.)

FYI, a datasheet is present for the 8922 on maxim-ic.com for those that want to read it.

Correct. There's a reason I mentioned shorting D+ and D- in conjunction with signaling a "dumb charger" presence - the whole point is that a PC is not present when shorting D+/D-!

And I have a branded Gateway monitor that had the whole USB hub blown by a misbehaving device.

Edit: On a somewhat unrelated note, I ran a wakelock drain test in two scenarios:

Last evening - 6% drop (from 100 to 94) in 1h52 min, approx. 3%/hour, when the hotplugging lock was activated and second CPU was online. (e.g., locking the second core in) - I forgot to disable the lock before heading out, and my battery life wasn't so hot then either

Overnight test with CPU1 disabled (hotplug lock activated when it was off) - 6% drop in 6h49m - less than 1%/hour even when wakelocked!

I would expect the delta to be less on Gingerbread kernels with original cpuidle, due to the fact that target_residency for AFTR and LPA is 40 ms instead of 10 ms as it is in ICS.
[Galaxy S II Original Android Development] rlorange:
Oh ok. Sorry to spread disinformation I just saw the karnels values changed to 950 correctly and assumed it was actually worked! Lol! I even thought I noticed it charging faster... placebo effect in effect! :o
[Galaxy S II Original Android Development] mannyvzla:
BLN

Flashed LP3 and Siyah and BLN complains about liblights (sorry if misspelled) version not supporting BLN
[Galaxy S II Original Android Development] tolis626:
Happy to report that b7(and most probably older ones too) works absolutely fine with CM9 from 29/03,which is Android 4.0.4.Since no one reported anything,I took the liberty of reporting it myself. :)

Also,I had some strange lockups today while playing Temple Run.I undid some undervolting settings and tried with stock clocks,but it still happened.What bothers me is that in my last_kmsg there are lines mentioning the bootloader,but I don't know what they actually mean.If you are interested Gok,I can upload it for you.
[Galaxy S II Original Android Development] lokhor:
What its the best configuration for battery life if i don't want to mess with voltage or clock speeds? I'm talking io scheduler etc
[Galaxy S II Original Android Development] gokhanmoral:
that is probably because of the same cpu scaling problem that we are working on.

cpu frequency (armclk) doesn't change on high load and if your device gets warm and tries to throttle itself to 800MHz while on load, it may cause lockup.

normally, we have cpufreq_adjust notification, set clock then cpufreq_postchange

in normal conditions, the freq change happen without any problem

but when the cpu is on load, it just doesn't happen, then cpufreq becomes out of sync, local variable and timing core thinks that the cpu has different frequencies.

I just don't know why...

there is nothing left to debug in new kernel..

I am now porting some parts of the old kernel to see if old code helps..
[Galaxy S II Original Android Development] bajee11:
For best battery, it's always better to uv cpu and gpu, well thats my opinion, but if you want best setting for governor and scheduler it would be Ondemand+Noop(Works best for me) :D My last cycle is attached below.
[Galaxy S II Original Android Development] kondronaute:
please can someone help me with this or tell me how i can limit freq 200 to 800 with a scrit and where put it ? coz i want use only extweak and not VC or setcpu

thank u
[Galaxy S II Original Android Development] tolis626:
Well,I did figure out that it was related,but now its behavior makes more sense.It would allow me to continue playing for a lot less time when the device was hot.Seems logical.

Anyway,I've been reading all the comments between you,Entropy512 and franciscofranco(sorry if I spelled that wrong) and I'm curious to see what it is.I've been snooping around git and stuff,because I once faced problems with CPU scaling on my Ubuntu laptop(Damn experimental kernel stuff almost made my CPU burn out),but I can't see many similarities to what I learned during that period.

I think that disabling all security stuff(thermal thresholds etc) would give you a more complete picture of the problem.If you can't figure it out by looking at it as a whole,start taking bits and pieces of it off it.Other than that,I know a guy who might have some ideas.If he has anything to say about it,I'll make sure to post it here.
[Galaxy S II Original Android Development] simone201:
The worst part is that (at least for me) during these lockups the dmesg shows nothing....

Happens sometimes when charging, or when changing gov or when scaling in general

Inviato dal mio GT-I9100 usando Tapatalk
[Galaxy S II Original Android Development] tolis626:
Yep,that's the most strange thing.It's like nothing happens.I try to read more than I post,but seeing all the stuff you guys posted got me all curious.

@Gokhan

Giving it a closer look,you might want to take a look at my last_kmsg.It's like a ****fest in there.Towards the end,it's like the kernel goes all BOOM.I hope it helps.
[Galaxy S II Original Android Development] Entropy512:
You don't, unless you want your device to hang... Have you bothered to read the discussion of the past few pages?

UNTIL WE FIX IT, UNDERCLOCKING IS LIKELY TO CRASH YOU ON ALL ICS KERNELS.

I instrumented the code with printk()s at entry/exit from exynos_target and exynos4120_set_frequency (may have gotten the last name slightly wrong, doing this from memory), and it looks like the crash happens shortly after exynos_target exits

One thing is - It seems like Samsung moved the busfreq code into a separate file - possible race condition between busfreq and cpufreq code?

Going to instrument it more tonight.
[Galaxy S II Original Android Development] gokhanmoral:
I guess it is the same problem.

if I change the throttling freq from 800 to 1000, we can see the sync problem in the log because crash doesn't happen with 1 step change in frequency.

I start with 800, run stability test and I can move upto 1400 (1600 is not stable on my phone anyway).. but when I go back to 1000 from 1400, BAM!

it also happens in recovery..

it happens on stock kernel, and every other ics kernel that I know of...

honestly, I never tested this on GB but if it had the same problem we would notice it on setcpu profiles..

unfortunately I have deleted my GB nandroid.

maybe I should ask people to test it on my old thread...
[Galaxy S II Original Android Development] gokhanmoral:
yes they moved the busfreq code to another file but they do not use dynamic bus freq scaling now (not in the default config anyway). and I liked the new method more.. there is a better seperation now.

the bus frequency is modified on cpufreq_postchange notification.

I tried to use old method anyway but it didn't help.

armclk just doesn't change and setcpu uses cpuinfo_cur_freq whereas voltagecontrol app uses scaling_cur_freq.. they loose sync.

we need to "relax" something to get it working but I cannot see what it is...
[Galaxy S II Original Android Development] Entropy512:
I am absolutely positive nothing like this ever happened on GB - I routinely used a 500 MHz screen-off limit SetCPU profile in GB.
[Galaxy S II Original Android Development] gokhanmoral:
Simone had a similar problem with his gb kernel and i asked in his thread if they can reproduce this on gb. he had some patches from3.0 kernel in his gingerbread kernel and i suspect one of those patches, maybe in arm kernel or mm dirs cause that problem.

i just checked calling exynos4_target and checked the freq using a hacked ondemand code and it doesnt set armclk on load.
[Galaxy S II Original Android Development] shanume:
hi Gokhan, I love yours work but in b7 I got weird wifi problem :(

when I turn on my wifi and turn off again from notification toggle icon my phone freeze up :( but when I flash back to b5 everything is fine there and I didnt have any problem..

I hope this can be fix in yours new version :)
[Galaxy S II Original Android Development] apeiron6:
+ 1
[Galaxy S II Original Android Development] suchevent:
i'm not having this issue. everything is working as they should. perhaps a rom issue?

thanks gokhanmoral for your work.
[Galaxy S II Original Android Development] :
Mate sent you a PM! If you can answer it ;) hugs and thz
[Galaxy S II Original Android Development] franciscofranco:
Yep I have never heard of that lock simply because I disabled hotplugging entirely, I still think its a bull**** implementation and it hurts more than it helps.
[Galaxy S II Original Android Development] navodwickra:
I thought there's no SOD either on latest CM9 but I was wrong. It takes time :D leave it under deep sleep for good 15 mins then wake the device up and then let it sleep again and that's it :p
[Galaxy S II Original Android Development] gokhanmoral:
http://www.gokhanmoral.com/

I moved the old kernels into another directory.

sorry, I forgot to update the links

you can always use cfroot to go back to a safe kernel.

since kernel sources are out, alpha versions are removed.

I think I have found the exact reason of the SOD problem (guess what, it was a typo :) my mistake, of course, as usual.).

I didn't have any SOD for 3 hours and normally I was having it in 10 mins.

I will make some other tiny changes and release it as beta3.
[Galaxy S II Original Android Development] navodwickra:
Thanks mate. Yeah 10 to 15 mins and that's it :p
[Galaxy S II Original Android Development] maverickzero:
I was wondering, is de kernel already available for download in that site? I can't seem to find the link...
[Galaxy S II Original Android Development] rauschkugl:
The sources are out for one day. Can't you just wait a while and give him some time. If you think it's that easy try it on your own. Just wait and let him work, everything will come when it's ready.
[Galaxy S II Original Android Development] ashok:
done exactly as you said, no problems till now
[Galaxy S II Original Android Development] ndnesh:
Eagerly waiting for beta 3! When I slept yesterday, you hadn't even released beta1. Wow! You work fast! Bring on the awesomeness! This is going to be legen......

Wait for it! :-)
[Galaxy S II Original Android Development] jim-bo:
He took it out because it wasn't in a usable state anyway. As stated in the OP, and in the thread, it also need a liblights to be built to work with it, which noone has done yet, so even if he puts it back in, it still won't actually do anything.

Please just be patient. He's already said that BLN is very high up the list of priorities, so it'll happen soon.
[Galaxy S II Original Android Development] ndnesh:
Beta 3 will be available sometime today. For now GM has removed the kernels as many were complaining about SOD (sleep of death) issues
[Galaxy S II Original Android Development] navodwickra:
are you on CM9?
[Galaxy S II Original Android Development] yabadabadooo:
Ive an aokp Port on my sgs2 could it be that the Kernel dont work for that?

Flashed the Kernel rebooted into cwm the touch recovery works like a charm. But then i restarted the phone the sclashscreen came up than black screen all the time. The phone was very hot. After about 3h ive pulled the battery and booted into cwm and then bam 20% battery left :D

Dont work or im just to stupid xD

Restored my Backup.

Any sugestions how i become the Kernel to work?

Cheers
[Galaxy S II Original Android Development] jim-bo:
It only works on ROMs that can work with the stock kernel from LPQ/LP7, so the latest CM9 nightlies (3/19 and on), or stock ICS based samsung ROMs, or anything based on latest-cm9 or LPQ should be good. Anything older is likely going to need the ROM developers to catch up with the current state of kernels for compatability - as far as I understand it, there is now a newer version of the API for the graphics chips, so the ROM needs to be using the new version or you get black and nothing else.
[Galaxy S II Original Android Development] skymera:
It doesn't work..
[Galaxy S II Original Android Development] t2k269:
Try wipe Cache and Dalvik Cache after flashing the kernel
[Galaxy S II Original Android Development] paryav:
May be help this info.

I'v got some SOD.

Get Extweaks and set CPU Idle mode to Idle+LPA.

For two hour no any more SOD.
[Galaxy S II Original Android Development] Vaedryn:
Let him time, good thing needs time and i am sure the result would be very good :)

SGS II Cyanogen Mod
[Galaxy S II Original Android Development] ashok:
No i am using Wanamlite 9.6
[Galaxy S II Original Android Development] navodwickra:
that might be the reason but anyway I'll wait for the next version
[Galaxy S II Original Android Development] gokhanmoral:
I forgot to add them back in beta2. they will be in beta3.
[Galaxy S II Original Android Development] rav4kar:
hi gokhanmoral,

hope you will release one for at&t sg2 very soon.... thanks!
[Galaxy S II Original Android Development] Entropy512:
Since you're running the original Gingerbread cpuidle code, this wouldn't surprise me. It's awful - AFTR disabled, target_residency of 40ms for both LPA AND IDLE state - it means the CPU spends most of its idle time fully on with the clock running, you're not likely to even hit IDLE state much.

The biggest penalty for having CPU1 online is disabling AFTR and LPA - in your case AFTR is already disabled and LPA is really hard to hit anyway.

Compare:

https://github.com/franciscofranco/Galaxy_Note/blob/master/arch/arm/mach-s5pv310/cpuidle.c

to:

https://github.com/Entropy512/linux_kernel_sgh-i777/blob/master/arch/arm/mach-s5pv310/cpuidle.c (Tab 7 Plus HC sources backported to GB)

which has IDLE target_residency reduced to 4 ms, AFTR enabled with a target_residency of 10 ms, and LPA is still 40 ms

to:

https://github.com/Entropy512/kernel_galaxys2_ics/blob/master/arch/arm/mach-exynos/cpuidle-exynos4.c (I9100 ICS source drop)

IDLE, AFTR, and LPA all have a target_residency of 10ms (4ms for IDLE may have been the reason for some stability problems.)
[Galaxy S II Original Android Development] Karpfenhai:
@ ghokan & entropy, could you guys repeat your test if freq_min is set to 300000 and smooth target to 3?

It feels like less problems then, thx for your efforts!

Swyped from my GT-I9100 using XDA App.
[Galaxy S II Original Android Development] Toxic17:
- There can only be one!
[Galaxy S II Original Android Development] eladios:
Hello I try to install a universal theme and having this kernel will not let me post. I get this error:

there's not enough ram to work.

I spend so much in the rom as Turkbey Criskelo.

What should I do about it?

Thanks.
[Galaxy S II Original Android Development] franciscofranco:
Hmm I'll take a look. Have you already tested hotplug off?
[Galaxy S II Original Android Development] unnamedname:
I'm running Lite'ning ROM + Siyah b7

in Voltage Control set 200Mhz (900mV) - 800Mhz (975mV)

and no problem, running few days

But if I set 200 - 500 Mhz the phone runs smooth, but get deep sleep when leaved.

If I play more with frequency I get very slow performance... Like going to 200-500 and then 200 - 800 Mhz... the phone feels like 200Mhz and benchmarks are way off.

But in every boot I set 200 - 800 Mhz in Voltage Control and everything runs FINE, phone doesnt get that wormer like 200 - 1200 (default) in games :)
[Galaxy S II Original Android Development] pietpapier:
Delete Please..
[Galaxy S II Original Android Development] Entropy512:
I'm running a nearly stock source tree - not messing with new frequencies and such until this stability issue is resolved.

I'm going to test with it completely disabled tonight to see if it makes a difference - but the locking effectively disables it.

I'm fairly certain gokhan is on to something with the fact that scaling_cur_freq and cpuinfo_cur_freq get out of sync - I think what happens is that exynos_target gets entered when the CPU is at 1000 but something thinks it is at 1200, and it makes the wrong choices for how to do the step in exynos4210_set_frequency.

If you manually set a limit before putting the device under load, you'll be OK OTHER than risking a crash when the limit is first set if there is high load.

If you use SetCPU's profile functions (which often coincide with high load as the system processes an event), you'll likely go boom soon.

last_kmsg with a run with debugging for cpufreq.o as described here, in addition to a few printk()s in the exynos cpufreq code for function tracing - I need to switch from sec_log to regular ramconsole. sec_log is neat due to having bootloader messages, but it also lacks the error detection and correction that ramconsole has, which is why there are so many corrupt characters.
[Galaxy S II Original Android Development] :
Guys will a otg cable work with cm9 + latest syiah or is it a no-go? Would really like to buy one and use it :)

Cheers

Sent from my SGS2 - Powered by CM9
[Galaxy S II Original Android Development] kem1337:
Same here.

wanam v10.1 siyah v3b7 ttalk
[Galaxy S II Original Android Development] Schindler33:
flash b5 then the theme and then b7 again.
[Galaxy S II Original Android Development] Blindi1985:
I've some Problems mit SetCPU-Profiles > When i charge my S2 with activated SetCPU-Profiles > FREEZE

I flash CM9-Stock-Kernel, its no problem to charging

Other Problems with CWM.

When i try to flash actual CM9, then i always get the build.prop error, so i must flash old Siyah-Kernel 2.6.9 or LA4-Kernel and then its possible to flash somethng without problems

greetings
[Galaxy S II Original Android Development] Entropy512:
argh yet another person posts without bothering to read, posting about a bug that has been the main subject of discussion for the past 5-10 pages somehow thinking we might be unaware of it.
[Galaxy S II Original Android Development] tolis626:
Nah nah nah,you are strange and cannot comprehend the importance of the repetition of the same bull**** all over again.I can't understand you developers sometimes.Why don't you accept hearing what everyone has to say?God... :rolleyes:

Just joking pal,but get over it,some people will just post because they want to post.And they post about the most irrelevant or much-discussed issues.Always.Anyway,patience is a virtue young Padawan,so they are doing it for your own good. :p

(Serious functionality enabled from here on)

Anyway,regarding the well-known issue with CPU scaling stuff,something rather strange happens today.In the morning,I played some Temple Run and after a few runs it froze and then it would freeze far too soon for the game to be enjoyable.The phone was rather warm at the time(battery temperature ranged from 33 to 38 degrees Celsius),as was normal.

Some 2 hours ago,I played for about 45 minutes connected to the charger.The phone was hotter than before,ranging from 39 all the way to 45 degrees Celsius.Strangely enough the phone didn't crash at all.I'll test further,but I thought it was worth mentioning. :)

Maybe charging disables something...

EDIT:Started playing without the charger connected.10 mins and boom went the dynamite.
[Galaxy S II Original Android Development] gokhanmoral:
#!/bin/sh

it happens :)

I won't add any new features until we fix cpu scaling issue because the kernel is not stable with this problem. there may be some workarounds to prevent the problem but the fun part is to fix it, not to ignore it...

I am sure that this problem will be reported repeatedly if I make a release or people will complain about not being able to use setcpu profiles.

how about auto-instrumenting the code with a shell script? and have thousands or printk's with the content of the previous line..?

I used a commercial tool to do that in the past which uses the debug info to analyze the code coverage...

do you know if there is any free alternative of such a tool?

I have reserved my sunday to this problem.

and I still have no clue why it happens. I have started to think that it is not related with cpu driver or hotplugging but with other arm related parts. all I know is that I call exynos4_target and the frequency cannot be set to a lower freq but it can be set to a higher freq when there is load.
[Galaxy S II Original Android Development] eladios:
Thank you very much for answering do not know what to do. thanks again:D:D

solved
[Galaxy S II Original Android Development] Entropy512:
There's no problem switching between any frequencies you want when you use the userspace governor.

Putting printk()s on every line will probably flood the buffer. The pr_debug() stuff in cpufreq is pretty good as is.

I think this is what happens:

cpuinfo_cur_freq and cpuinfo_max_freq get out of sync when the max frequency is dropped below the current frequency.

Most likely, the CPU is running at 1 GHz but something thinks it's still at 1.2.

Then exynos_target is called with freqs.cur = 1.2 GHz, when it is really 1 GHz

As a result, the checks for p/m/s settings in exynos4210_set_frequency are operating with wrong data.

Need to instrument more... tomorrow maybe. Tonight is dinner then nap then going out.
[Galaxy S II Original Android Development] myfluxi:
Funny thing is: when the device seems locked, you can still adb into it and execute commands - even stuff that is heavy on the cpu.
[Galaxy S II Original Android Development] simone201:
Noticed that too, i can even sometimes feel the vibration of touchkeys but system is completely hanged....

Maybe we should add a kinda check to let the driver read from both scaling_cur_freq and cpu version of that file and see if they are the same?

Or better, read directly the frequency without passing from those values, so reading the regulator (is it right?)

Inviato dal mio GT-I9100 usando Tapatalk
[Galaxy S II Original Android Development] Orka82:
never mind. Worked now.. :)
[Galaxy S II Original Android Development] shanume:
hi Gokhan,

I have found my wifi turn off and phone freeze bug in siyah3.0b7 :)

this is when I use Tegrak overclock ultimate app.. give this phone freeze

problem without doing any setting or OC/UV..

when I uninstall this tegrak apps everything is fine again... I hope this can be fix in the new version.
[Galaxy S II Original Android Development] Entropy512:
That hasn't been the case for me - the PC thinks it's still connected, but ADB doesn't work.
[Galaxy S II Original Android Development] MistahBungle:
USB sticks/flash drives work OK with USB OTG CM9/SiyahV3, not sure about mice/keyboards/other devices tho.
[Galaxy S II Original Android Development] allgsmnetwork:
Very compliments gokhanmoral for this kernel b7 better at 1400 ondemand uv 100 and power settings in setcpu always cold i used firmware stock ICS O2,battery it's OK !!!

quadrant : 4500/4900 point

antutu : 7000 point

good work

Regards

---------- Post added at 07:34 AM ---------- Previous post was at 07:23 AM ----------

@ gokhanmoral

One question the best settings in extwaks for oc GPU? I confused...:confused: it's possible exceed 60 fps in 3d ???

Thanks,

Regards
[Galaxy S II Original Android Development] skualone:
just posting to suscribe, btw this kernel is awesome
[Galaxy S II Original Android Development] Prasad:
Thanks for the great kernel Gokhan!! Beta7 working flawlessly on latest CM9 builds... :) Eagerly awaiting RC builds! :D
[Galaxy S II Original Android Development] :
It's impolite to quote myself :) someone already tied this and can share with us his experience?

Ty

Sent from my SGS2 - Powered by CM9
[Galaxy S II Original Android Development] Pfeffernuss:
It's even more impolite to ask the same question again without reading anything.