yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Original Android Development] bixi:
Thank you, the problem was that i'didn't install it again. Now it work
[Galaxy S II Original Android Development] DevisG79:
Does anyone have FCs with latest nightly from 04.12.?
[Galaxy S II Original Android Development] lurker316:
This morning driving to work all of a sudden the GPS locked! So whatever it was has worked. Dunno if it was the gps.conf or just plain old GPS working. In anycase my issue of GPS never locking on in CM12.1 Snapshot (5.1.1) has been resolved. Just thought I'd let you guys know.
[Galaxy S II Original Android Development] rINanDO:
I took a deep dive into the kernel and saw this suspicious line of code..... See

https://github.com/CyanogenMod/andr.../mali/platform/pegasus-m400/exynos4_pmm.c#L90

The max frequency is 266mhz with 1.05v in which was 1.0v in cm-10.1. But if I understand correctly this line sets the frequency to 266mhz with 0.9v when the gpu resumes?! I think this should be 1.0v for our device.
[Galaxy S II Original Android Development] zeitferne:
I had noticed that too (https://gist.github.com/Oberon00/ae...mali-fix-suspicious-code-in-pmm-patch-L19-L24; this was linked in the post you quoted :) ). That line seems to be meant only for Exynos 4412 (SGS3 I think). Still, changing it seem to not have fixed the freeze issue. Currently I'm planning to investigate the hypothesis of a multi threading issue / race condition in https://github.com/CyanogenMod/andr...2/blob/cm-12.1/arch/arm/mach-exynos/cpufreq.c . But I don't have too much time at hand currently.

Actually, I have compiled a kernel that adds logging when changing the CPU frequency and attempts to abort (i.e. hard reboot) if setting the frequency fails (patch). Since I am already testing that now there is probably not much use in uploading it, but I will report what happens with my next "freeze".

EDIT: I just got a freeze (yes, a freeze and not a reboot) and this is the last_kmsg I captured: https://gist.githubusercontent.com/...9d850cc3b08fc5916/last_kmsg-extra-logging.log Unfortunately I did a reboot first, so you will notice some bogus characters as AFAIK the log is recovered from RAM after reboot.

What you can see from it is that the last time a frequency change is made is at 77706.586893 to the upper limit of 1200 MHz.

We can assume that for some reason from an unknown place, the frequency then gets set to 150 MHz (although I have not confirmed this in this instance as I was unable to connect to adb or not patient enough as I did not want the important information be overwritten by useless "binder: transaction failed" messages). Now I can imagine the behavior: The last thing the CPU governor knows is that it has switched to 1200 Mhz, so it obviously assumes that the CPU is still there. As utilization at 150 MHz will hardly fall below 90%, it has no reason to ever issue another frequency change command and hence the freeze.

The question why the CPU frequency is changed to 150 MHz remains open. But given the above, a hotfix might be possible by letting the CPU governor periodically compare the actual CPU frequency to the expected one.

The question is of course how this change of frequency occurs
[Galaxy S II Original Android Development] rINanDO:
Yes i see, you're right. I currently running a build with restored gpu frequencies, but nevertheless I got a freeze just now. Is will take a look to your logs.
[Galaxy S II Original Android Development] omyg:
How to setup call recording ?
[Galaxy S II Original Android Development] rINanDO:
Hi lukss12,

How did you confirm the CPU is running on 150 Mhz? I tested a kernel build with the patches of Zeitferne which shows the current CPU speed after setting it. But Zeitferne's check of faulty current CPU speed was never triggered. In my attachment my kmsg which I could download after 30 minutes of freeze (adb shell dmesg suddenly works). The crash occured at 18:52 but as you can see the kernel is still running and still updates the CPU speeds....

Edit: I got a second freeze during running logcat at 20:41:43.874. See logcat_freeze.log. Just before the freeze I see these warning-lines.

12-07 20:41:44.544 6048 6048 W InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.

12-07 20:41:44.553 2896 3749 W InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@e7b9c01 attribute=null, token = android.os.BinderProxy@48f057d

Maybe it is not a kernel issue? I was scrolling in the android browser when the freeze happened.
[Galaxy S II Original Android Development] zeitferne:
Crap. I also just had another freeze with exynos4_set_frequency still being called. Originally, I verified the CPU speed by doing 'cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq' (see screenshot in this post). I think this ultimately also calls the exynos_getspeed function I used, but I will have to look this up again.
[Galaxy S II Original Android Development] lukss12:
When you have a new freeze connect phone to PC, wait about 3 minutes and start shell with adb. You can do "cat" over "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq" to see actual CPU0 (first core) speed. I got 150Mhz. And you can do "cat" over "/sys/devices/system/cpu/cpu*/online" to see if core is active = 1 or idle = 0. I got 0 for CPU1. Change the "*" per core.

---------- Post added at 08:24 PM ---------- Previous post was at 08:16 PM ----------

I had this warnings on logcats. I don't think they have relation with freezes. :confused:

[MENTION=5948587]zeitferne[/MENTION] can you explain me why the phone is soft rebooting itself?

I have to mention something interesting too... while reading last_kmsg recovered after a freeze I can see this line "[ 1168.600287] c0 charger: [1168600] rebooting" as I mentioned in this post. After trying to figure out who was sending that line to the kernel log I found in the source that responsable is healthd_mode_charger.cpp. I was wondering if this file was mented to be used only when charging offline? Why is it executing with android booted? (May be I'm wrong here) What do you think?

Edit: maybe last_kmsg was not replaced and I had booted from charger last time before freeze, can't remember :(
[Galaxy S II Original Android Development] rINanDO:
Thanx mate, i think the warnings are symtoms of the freeze. Lets find out why the CPU is doing 150mhz and softboots.
[Galaxy S II Original Android Development] lukss12:
I'm currently very busy with study, so I don't have the time to set an enviroment and try to compile a kernel to test but I'm sure we could pay attention to [MENTION=5948587]zeitferne[/MENTION] thoughts and give him support here. :good: :highfive:
[Galaxy S II Original Android Development] lukss12:
CM Settings module for Xposed is the way I activated it.
[Galaxy S II Original Android Development] Syaani:
I know there are more serious issues right now. I was just only wondering if new Unicode 8.0 from 6.0.1 is possible to get ported for 5.x.x
[Galaxy S II Original Android Development] j1gga84:
Is the latest build based on r30 ?

https://android.googlesource.com/platform/cts/+/android-5.1.1_r30

regards
[Galaxy S II Original Android Development] iistoryahi:
Is the screen record already fix ? and the UMS bug ?

Thank You :)
[Galaxy S II Original Android Development] ran000:
Could not get Celsius at weather widget. Trying to set metric did not help. Please, any help.
[Galaxy S II Original Android Development] kai_15:
is there network traffic in this rom and capable to put screenshot in the notification panel?
[Galaxy S II Original Android Development] ringen00:
- Is it correct that the kernels from OP (CM/TWRP) don't have trim support?

- So since Android 4.3 the OS starts trimming the eMMC from time to time but only if the kernel supports this?

- Isn't trimming becoming indispensable after some time of usage?

- Which kernels are recommended for trimming/what would be a comfortable scenario to automate the process?

Trimmer/Tasker?
[Galaxy S II Original Android Development] :
1. Stock CM doesn't support trim function

2. You can only trim with an enabled kernel

3. Trimming is a very good idea. It can speed up your device by potentially speeding up write speeds, but more importantly can prolong the emmc's life. Make sure you use only kernels that have correct patches applied to trim safely

4. You can use Lanchons CM12.1 kernel from his trim kernel thread, or Dorimanx from gsstudios. To automate the process use trimmer
[Galaxy S II Original Android Development] ran000:
Thank. I have not network traffic enabled for location discovery really.
[Galaxy S II Original Android Development] the.gangster:
[MENTION=349465]ringen00[/MENTION]

And you can trim your /preload once by terminal or ADB commandline.
[Galaxy S II Original Android Development] kai_15:
---> do you mean sir there is no network traffic in this rom and no screenshot that can put in notification panel?
[Galaxy S II Original Android Development] ringen00:
[MENTION=6560258]the.gangster[/MENTION]

Please tell me how : -) (terminal)

Just asked in Lanchon's Q&A thread how I can be sure that my /preload partition hadn't been shrinked when I repartitioned using a pit file ...

Can you confirm that?
[Galaxy S II Original Android Development] ringen00:
[MENTION=6418283]noppy22[/MENTION] [MENTION=6560258]the.gangster[/MENTION]

Can you tell that my preload isn't shrinked?
[Galaxy S II Original Android Development] ammcom:
Hi

I have installed the nightly version of 4th of Dec, but now I WIFI not working, It can't find networks even it is stuck on "turning wifi on" when I try to turn it on, any suggestions?
[Galaxy S II Original Android Development] the.gangster:
It's all descibed perfectly in Lanchon's Thread.

what do you mean by 'shrinked'?

You obviously have stock sized Preload partition.

Which PIT did you use? Trimming will not change partition sizes!
[Galaxy S II Original Android Development] ringen00:
[MENTION=6560258]the.gangster[/MENTION]

Lanchon mentions as a requirement:

"* you have not repartitioned your device and shrank the /preload partition to enlarge other partitions."

Don't remember what pit it was exactly...

(could look for it)

Maybe 1GB system and 6 GB data...

Thanks, I'll read Lanchon's thread now :)
[Galaxy S II Original Android Development] the.gangster:
OK.

In that context he was referring to people like me who used a Pit with an 8MB preload partition. That there is little sense in trimming these tiny ones but to trim the enlarged system partition then.
[Galaxy S II Original Android Development] amit007us:
Which build is good for battery, currently I am on 20151118 build. Got new official samsung battery but getting 5 hrs of battery life.
[Galaxy S II Original Android Development] ringen00:
[MENTION=6560258]the.gangster[/MENTION]

Just to get a deeper understanding.

My old SGS Plus (9001) is running an unofficial CM 11.

Would it be possible to use one of Lanchon's trim kernels here too?
[Galaxy S II Original Android Development] Dr AM:
Of course NO , I9100 kernels doesn't work on S2 plus

Sent from GT-I9100 - 5.1.1
[Galaxy S II Original Android Development] ringen00:
[MENTION=4686918]Dr AM[/MENTION]

So no chance of trimming here?
[Galaxy S II Original Android Development] x3dnd3x:
Anyone's Whatsapp keep crashing after installing the latest build? :confused:
[Galaxy S II Original Android Development] xhoster:
Freezes and reboots

I dug through some logs and noticed one line in lukss12's last_kmsg

<6>[ 6355.290573] c0 notifier_call_chain : NOTIFY BAD cpufreq_stat_notifier_policy

after looking it up and searching through some cpu files of our kernel, I found some interesting stuff:

http://comments.gmane.org/gmane.linux.kernel/1568154

especially:

Right now I don't have the time to see if this problem is present in our kernel (memory leak).

Another important thing I found in one of the s2 kernel threads:

http://xdaforums.com/showpost.php?p=24293772&postcount=1641

quick look at exynos4210-cpufreq.c

Finding these values:

static unsigned int exynos4210_apll_pms_table[CPUFREQ_LEVEL_END] = {
/* APLL FOUT L0: [B]1200MHz[/B] */
(([B]150[/B] << 16) | (3 << 8) | 1),

/* APLL FOUT L1: 1000MHz */
((250 << 16) | (6 << 8) | 1),

/* APLL FOUT L2: 800MHz */
((200 << 16) | (6 << 8) | 1),

/* APLL FOUT L3: 500MHz */
((250 << 16) | (6 << 8) | 2),

/* APLL FOUT L4: [B]200MHz[/B] */
(([B]200[/B] << 16) | (6 << 8) | 3),
};

I don't know enough about this and don't have the time to read into it.

Could be the same problem (the 150mhz) like mentioned in the siyah thread earlier (old_index being the wrong value and not changing pms values accordingly). Which could also cause the reboots, since 150mhz is outside of the frequency range.

The jump from 1200mhz to "200mhz" would fit.

static int exynos_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
unsigned int index, old_index = UINT_MAX;
unsigned int arm_volt, safe_arm_volt = 0;
int ret = 0, i;
struct cpufreq_frequency_table *freq_table = exynos_info->freq_table;
unsigned int *volt_table = exynos_info->volt_table;

mutex_lock(&set_freq_lock);

if (exynos_cpufreq_disable)
goto out;

freqs.old = policy->cur;

[B]/*
* cpufreq_frequency_table_target() cannot be used for freqs.old
* because policy->min/max may have been changed. If changed, the
* resulting old_index may be inconsistent with freqs.old, which
* will lead to inconsistent voltage/frequency configurations later.
*/[/B]
for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
if (freq_table[i].frequency == freqs.old)
old_index = freq_table[i].index;
}
if (old_index == UINT_MAX) {
ret = -EINVAL;
goto out;
}

if (cpufreq_frequency_table_target(policy, freq_table,
target_freq, relation, &index)) {
ret = -EINVAL;
goto out;
}

found in here:

https://github.com/CyanogenMod/andr...672d1bf1d35d8c/arch/arm/mach-exynos/cpufreq.c

about APLL clock rate setting (PATCH):

http://www.gossamer-threads.com/lists/linux/kernel/1796703?search_string=apll exynos;#1796703
[Galaxy S II Original Android Development] zeitferne:
Great detective work! This thread discusses our exact problem and seems to have a workaround (and more information on the reason)! See e.g. http://xdaforums.com/galaxy-s2/orig...nel-v6-0b5-t1555259/post24248888#post24248888.
[Galaxy S II Original Android Development] ammcom:
Hi

Anyone has a wifi problem? I have installed the nightly of 4 dec then installed the 11 dec one and still the same problem, can't turn on WIFI can't detect any network
[Galaxy S II Original Android Development] zeitferne:
Sounds like a hardware problem I have heard of: http://xdaforums.com/galaxy-s2/help/q-sgs2-wifi-problem-t1935338/post33037000#post33037000
[Galaxy S II Original Android Development] daniu:
Hi

Have you tried removing the battery 4 a while?

Sometimes it also helps to put the phone in airplane mode, shut it down, remove the battery for a while (not just seconds, rather 10min or more) put it in again and reboot.

Regards

---------- Post added at 09:25 AM ---------- Previous post was at 09:23 AM ----------

Hi

Don't want to stop the enthusiasm but afaik my phone gets quite warm when it hangs. I'd be surprised if it'd get that warm at 200Mhz ...

Regards
[Galaxy S II Original Android Development] lukss12:
Mine doesn't, indeed it could be hot as hell before the freeze and starts cooling down if I let it "freezed".
[Galaxy S II Original Android Development] zeitferne:
Another test kernel

Strange, this was not the case with my hangs.

Anyway, based on the information in this thread, the problem seems to be that the old CPU frequency saved in freqs.old in arch/arm/mach-exynos/cpufreq.c gets out of sync with the actual frequency. Because the frequency changing code is optimized to not change the hardware settings it believes to already have the right value based on the old frequency, this can lead to a bogus state. I have done two things:

Simplified the mutex-locking in cpufreq.c (I believe the current code might lead to state corruption in some cases when multiple threads called exynos_cpufreq_lock at the same time). That might be the reason for the out-of-sync.

Added a few checks to see if freqs.old indeed gets out of sync with the true frequency; if so it crashes the kernel, leading to a hard reboot and hopefully saved last_kmsg.

If the checks in 2. cause a reboot, we know that 1. was not sufficient/there is a different cause. However, a workaround would be quite easy then: Simply force the frequency changing code to apply all settings if that happens.

Patchset: https://gist.github.com/Oberon00/6394d5e646bae7d66258

The flashable kernel ZIP is attached. As before, if you have a TWRP recovery I am sorry that this will overwrite it with the CM one.

Please report if you still have freezes, or if you have reboots instead. Especially in the latter case, the /proc/last_kmsg file would be extremely interesting.
[Galaxy S II Original Android Development] lukss12:
I'm happy those logs being usefull :D :D :D. As zeitferne said nice detective job:cowboy::cowboy: It feels like we're close to get it fixed.

---------- Post added at 12:28 PM ---------- Previous post was at 11:44 AM ----------

As Samsung sources used as base are from 2012 and that patch is from 2013 and gerrit doesn't show any related merge in

cpufreq.c I think it could be possible we have that bug. I'm a bit confused with cpufreq terms maybe someone more skilled could confirm this. By now I'm reading cpufreq documentation :D
[Galaxy S II Original Android Development] chrisXL:
Thank you for your work. I had a freeze and reboot (in the same event) with your test kernel, while typing in browser. You need last_kmsg file (I can't attach it?)?
[Galaxy S II Original Android Development] zeitferne:
Yes that would be helpful. I think you need to rename it to e.g. last_kmsg.txt to attach it at XDA (it wont accept filenames without extensions). Was the reboot immediatelly after the freeze? Or did you see the CyanogenMod boot logo before the actual reboot?
[Galaxy S II Original Android Development] chrisXL:
Yes, reboot was immediatelly after freeze. But I can't see any attach button (only camera button). Can you PM'me your email?
[Galaxy S II Original Android Development] PolishVodka:
Welcome.
[MENTION=1174534]lysergic[/MENTION]-Acid I have a something for you. Probably you know that, but its idea to have any recovery even on official CM builds which coming with CM Recovery, and most of users hate this because all the time when user want to flash something, he cannot and finally he must change a kernel to unofficial's one.

My idea is to save original, inbuilt CM Recovery (maybe someone like or doesn't need to flash unofficial stuff, etc.) but add to kernel sources possibility to load Recovery cpio (any recovery) from other place, like /preload partition which is mounted anyway and not used by AOSP Roms.

For all this thanks to [MENTION=5695278]ChronoMonochrome[/MENTION] and his method to load ramdisk from other partition than kernel's one http://xdaforums.com/galaxy-ace/ace-2-develop/dev-universal-kernel-t2930035 .

So, how to start..

From what I see here: https://github.com/warrior1208/andr...s2-common/blob/cm-12.1/rootdir/fstab.smdk4210

PRELOAD partition is EXT4 /dev/block/mmcblk0p12 . We must mount it before kernel loads image cpio from initramfs, what's we see here: https://github.com/warrior1208/andr...lob/cm-12.1/usr/galaxys2_initramfs_files/init .

This script after editing should looks something like:

And little editing here: https://github.com/warrior1208/andr...4412/blob/cm-12.1/usr/galaxys2_initramfs.list

Will be mounted /preload and if custom recovery exists (in custom_recovery dir, recovery.cpio) then kernel will load it except stock, inbuilted recovery. But when recovery.cpio will be deleted or moved somewhere, then kernel will load stock's one (CM Recovery).

Of course your custom recovery will be always loaded, even after CM update, so this will give you always official's kernel experience.

You need only unpack any boot.img/zImage where is your favorite recovery, got it in recovery.cpio format and move to /preload/custom_recovery. I'm sure on first post you can provide some flashable recoveries for users.
[Galaxy S II Original Android Development] lukss12:
Great :D that means the problem is indeed in freqs.old, doesn't it?
[Galaxy S II Original Android Development] zeitferne:
I got your mail, thank you very much! I hope you don't mind me uploading the file, so that other interested developers may take a look: https://gist.githubusercontent.com/...96d1e9dc37c73074176537a2/lat_kmsg-chrisXL.log

Indeed, one of my checks got triggered as you can see at 1997.262726:

<0>[ 1997.262726] c0 Kernel panic - not syncing: exynos_target: CPU 0: policy->cur is 1200000, but actual speed is 150000; freqs.old is 800000

This means that a request was made to change the CPU frequency and the requester claims that currently the frequency is 1.2 GHz while in fact it is 150 MHz (the frequency before the current one was 800 MHz). Even though I had hoped that the check would trigger even before that 150 MHz value creeps in, this is at least a small step forward. I guess one should add the logging from this patch and maybe some more, to gather additional information. But I am also very busy now, so I shouldn't spend even more time on that. ;)

EDIT: Hmm, probably one should also move the check before the "if (exynos_cpufreq_disable)".

Also I think it might be interesting to see how the 150 MHz is composed; IIRC, the value should be calculated here: https://github.com/CyanogenMod/andr...12.1/arch/arm/plat-samsung/clock-clksrc.c#L38. And if we get stuck maybe it might be interesting adding the patch from this CPU-local timer bug (deemed irrelevant then) I stumbled upon when looking for the FPBug to see if there is any correlation.
[Galaxy S II Original Android Development] IonutGherman:
Why my phone is charging everytime even my charger isnot connected? It is possible to be my battery?
[Galaxy S II Original Android Development] xhoster:
Maybe this could be of value in our cpufreq.c

clean your usb port, if this doesn't work, it could be possible that your usb flex cable/usb port is broken.

Replacing it is pretty easy: replacing-usb-charger
[Galaxy S II Original Android Development] lukss12:
Is it correct to retry with same indexes taking in count that first try had changed S value or all of them?
[Galaxy S II Original Android Development] daniu:
that answer doesn't really make sense. He says his phone IS charging even without being connected.

Usually that means that the battery statistics is off and thinks that judging by the voltage the battery is flatter than it is. After some time the phone realizes that it is wrong and corrects the battery level=it looks like the phone is charging without being connected.

BTW: exchanging the USB connector is easy indeed. The problem is that there are lots of connectors sold that are DOA (dead on arrival) so rather get it from someone who will change the broken one without complaining ...

Regards
[Galaxy S II Original Android Development] IonutGherman:
So, what you suggest to do? Cuz I don't understand so much from what you say here.
[Galaxy S II Original Android Development] lukss12:
Hey dude before saying something about someone's answer you need to think twice... there are better ways to say you disagree with something. I've seen lot of times phones with charger circuit dirty or broken and the controller thinks it is connected, his answer is as valid as your's.

[MENTION=6250062]IonutGherman[/MENTION] as [MENTION=5397920]xhoster[/MENTION] said try cleaning your usb connector, [MENTION=1601710]daniu[/MENTION] said maybe your phone detects a wrong voltage on the battery... but I'm not sure if it is your problem. Does it stop "charging" anytime? you need to be a little more specific on your phone's behavior to get a more accurate answer. Regards.