yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Original Android Development] zeitferne:
I haven't read the whole code but from just glancing over this function, releasing the busfrequency lock but not the cpufrequency lock looks like an oversight. To see if the release function is called in case when the 500 MHz lock is "leaked", just insert a pr_info("mfc_release called") or some such. It looks like that should be handled correctly though, since it is registered as the close-function for the device, which is represented as a file. If not, the error would not be in the driver but in the userspace code that handles communication with the camera driver (no idea what that would be). Even then, a soft-reboot or killing the right process would fix that. So chances are that mfc_ctx->cpufreq_flag or dev->cpufreq_lock_cnt have wrong values (BTW the usage of atomic_dec and atomic_read in the release function is probably wrong, it should use a combined release-and-read function (assuming one exists), otherwise it's prone to race conditions).

Whoops! It's at https://drive.google.com/file/d/0BxqQUon5GyW6SU5EamozSVhoVUk/view?usp=sharing.
[Galaxy S II Original Android Development] Lysergic Acid:
I've not tested myself, but rumors said it works :silly:

1- Yes, you'll be able to update directly from CM 12.1 to 13 via OTA

2- Nothing to say because of 1° answer
[Galaxy S II Original Android Development] Lysergic Acid:
I doubt. There's also a JIRA bug assigned to me where Sammy's gralloc wrongly calculates pixel amount and transforms a square into a rectangle. I mean, that's also present in stock ROM, it sucks to fix Samsung problems.

I'm gonna test your patch when I have some free time for 5.1, it looks good of course ;)
[Galaxy S II Original Android Development] snow:
Nice job dude! I think you fixed this issue. Tested your kernel and everything works as expected! :D

Before this, I've noticed that whenever I was rebooting device, battery percentage went strange low. E.g., I had 80% battery, and after reboot it was 65% battery.

Very strange, but now it seems that this (battery) behavior no longer appears! :victory:
[Galaxy S II Original Android Development] kanyb:
[MENTION=5948587]zeitferne[/MENTION] Tested the freezefix 1 kernel since you posted it

It did not freeze, but had an auto reboot after 5-6 days (only saw sim pin prompt in the morning)

After that i used it for a few days, no freeze, no real slowing down noticed

Today I got a freeze, but I think it is another problem because I can reproduce this one almost everytime. I use a JVC car radio mostly via bluetooth - no problems with this setting. But the car radio supports android auto via usb, if i plug it in the s2 tries to start the jvc app, app crashes, if I try it a few times the s2 will (almost) always freeze and not autoreboot after ~1 minute.

Sorry I have no log files for you. When I find the time after christmas I will read more about how to get logs when it freezes, didn't find the time for this yet
[Galaxy S II Original Android Development] dave202:
[MENTION=5948587]zeitferne[/MENTION]: (playing catch-up a little here due to recent illness) while I can see that there is definitely an issue with this code, I'm wondering whether or not this is just a symptom of another bug?

Going with the POLA I don't think it's unreasonable to suggest that based upon simple state logic that cpu_onlining = (cpu_online() and !cpu_awake()) and my feeling would be that software stepping isn't tested as much if all the newer exynos CPUs do this in hardware. So while I think that this is a genuine bug, I wonder if assumptions such as above are broken in the software stepping driver and so this will become a "cat and mouse" game of find all the related state errors(!) in the software stepping driver logic.

Have you tried posting what you've found so far to the LKML? My hope would be that Samsung engineers would easily be able to look at what you've done and therefore if this is a symptom of a more global state bug, point you towards the real culprit :)
[Galaxy S II Original Android Development] zeitferne:
Sorry, I think didn't quite follow that.

cpu_onlining in my patch is a bit of a misnomer actually, a more descriptive name would be cpu_online_or_preparing_to_online. A cpu logically enters my "onlining" state at the CPU_UP_PREPARE notification and leaves it when CPU_UP_CANCELED or CPU_DEAD occurs. I do not need to distinguish between preparing to come up and actually being up in that case.

By CPU stepping do you mean only the frequency/speed regulation? Because then I don't know what assumptions should be broken by it. If you mean hotplugging (i.e. turning CPUs off and on), I don't think that this is done by the hardware on itself even on newer CPUs, as the kernel needs to do some cleanup (such as moving tasks to other CPUs) before taking a CPU offline.

But regarding a global state bug, I also thought it was strange that CPU1 marks itself as online without any synchronization with the CPU that started it. For me it would seem cleaner to wait for the CPU that caused the startup to acknowledge. This way you know that when you called local_irq_disable() and afterwards check for num_online_cpus() == 1, that nobody else is doing anything, which is not the case now but which the idle code assumed. But I have no idea how this is handled for other CPUs, e.g. x86.
[Galaxy S II Original Android Development] dave202:
Yeah that's the part that doesn't make sense - in some ways this is such an obvious bug related to lack of synchronisation that it would have been extremely evident during original development/testing. This then leads me to 3 potential scenarios:

1) The original code relied on a locking assumption in the kernel which has been loosened in more recent kernels, revealing the bug

2) There is some kind of implicit state related to CPU online/awake states that should guarantee this should never happen, but which has been accidentally broken in newer kernels

3) Earlier in the thread it was mentioned that separate driver code for various exynos CPUs had been combined in newer kernel releases - maybe a bug was accidentally introduced here?

I'd be very interested to eyeball the commits related to 3) as reorganisations like this are notorious for introducing these types of bug.
[Galaxy S II Original Android Development] zeitferne:
Should be u1: import from CyanogenMod/android_kernel_samsung_smdk4210 (on page 4 of the CM-12.1 commits). There is also the CONFIG_LEGACY_HOTPLUG_POLICY kernel option, but that should change only when, not how the CPU is disabled/enabled (don't know if non-legacy wasn't even enabled in original Samsung code).

EDIT: I just looked at the current upstream Linux kernel, and this part is still the same: https://github.com/torvalds/linux/blob/master/arch/arm/kernel/smp.c#L398-L399. You can see that it first sets the CPU online and only then waits for the starting CPU. So probably no global state bug here.

EDIT2: But the method with which one CPU waited for the other changed: before, it used busy waiting which should make it much less likely for the idle thread to kick in and thus run into the bug.
[Galaxy S II Original Android Development] gaikokujinkyofusho:
upgrading (as opposed to new install)?

Hi, I feel a bit ashamed asking this considering I have flashed ROMs before but its been awhile and I really prefer to be ashamed and ask than be unsure and balls things up.

I was reading the cyanogen site "To upgrade from stock/CM7/CM9/CM10.1.2/CM10.1.3 to CM10.2, you must first boot into recovery and wipe data, cache, and dalvik cache (factory reset)" which seemed straight forward enough but it was buried in alot of other stuff talking about heimdall (totally new to me?) etc.

Really, if possible, I just want to upgrade my phone (11-20141115-SNAPSHOT-M12-i9100, Android 4.4.4.) to cm-12.1-20151116-SNAPSHOT-YOG7DAO1JN-i9100.zip

I guess possible caveats are the apps I have running, that is they might not take kindly to the upgrade? If that is the case should I be able to just back them up with TiBackup and restore them?

Thoughts/advice would really be appreciated!
[Galaxy S II Original Android Development] dave202:
The cpu change is interesting as isn't the governor a userspace process? If so, a busy-wait in the kernel could prevent the governor from making changes until outside of the critical section at which point the cpu will be ready and all is well. Likewise as you suggest above if the new code allows the kernel to yield then the governor process could start processing the online event before the cpu is fully ready, leading to the problems seen here. How is easy it to put together a test kernel to validate this theory?
[Galaxy S II Original Android Development] chris_b0ss:
Hello.I have a small problem,I've received an u8 smartwatch,everything works fine,except the voice calls.If I call while being connected,there is no sound,but every other sound can be heard.Any idea why?
[Galaxy S II Original Android Development] BenjyTec:
All your apps will be deleted at the 'wipe data' step. To backup, I also used an app similar to Titanium called Appmonster 3, and the problem was that after I restored the apk files, I couldn't update them over play store anymore. So I used an app called Helium. This app only backups your data, so you install an app using play store and only restore the data.

This was my scenario with Appmonster. Just want to say that it might be different with Titanium.

BTW, I never had compatibility problems of apps with Android 5.0.2. I hope I got the question and this helps a little bit.

And don't forget to flash Gapps!
[Galaxy S II Original Android Development] chris_b0ss:
Edit:reverted to original 4.1.2,and everything is fine.Could you try and solve this?

Thank you!
[Galaxy S II Original Android Development] lukss12:
CM uses a different bluetooth stack than stock and some users have had problems with different bluetooth devices with audio sink capability. May be your logcats when answering a call connected to the watch could be useful.
[Galaxy S II Original Android Development] iistoryahi:
Clean Wipe

Someone can give me a link of script to perform a clean wipe all my phone before i flash this rom.

Thanks :D
[Galaxy S II Original Android Development] chris_b0ss:
I took a logcat,but I'm not sure if it's okay,because it's very long.can you give me some guidelines,or some tips to make it shorter,or to get the important things? Or should I post the whole logcat?

Thank you!
[Galaxy S II Original Android Development] the.gangster:
The complicated way: search for HawkerCore scripts, if you really need scripts. The simple way: load a Kitkat-compatible recovery like TWRP and wipe the partitions one by one or e.g. factory reset + sysytem + SD card
[Galaxy S II Original Android Development] lukss12:
Try to take it just after the test call, so the relevant stuff will be at the end
[Galaxy S II Original Android Development] chris_b0ss:
Thank you very much for answering ! And Merry Christmas!

Right now I can't,because I'm using 4.1.2.But here is the logcat taken(the long one)..hope it's usefull..

Sorry for the 7zip,but the text file was too big.
[Galaxy S II Original Android Development] kai_15:
Headsup notification is not working anyone who encounter this?
[Galaxy S II Original Android Development] wdevil12:
Dont spam the thread asking for the same thing over and over again. Headsup notification always worked and works and will work! if its not working for you, you might disabled it. Just stop asking this
[Galaxy S II Original Android Development] kai_15:
---> ok sorry because mine is only working when receives message but when updating apps head up notification is not working even if i turn this on.
[Galaxy S II Original Android Development] BenjyTec:
I think this is normal, isn't it? Same at me, headsup notification only at Whatsapp, Telegram or SMS.
[Galaxy S II Original Android Development] kai_15:
--->there is no pop during updating apps in playstore.
[Galaxy S II Original Android Development] xhoster:
Hey guys, hope your holidays went well :)

I couldn't really follow the progress (cpu wise) in the last days(weeks) and need some more days to get personal stuff done and to catch up.

I still tested your kernel [MENTION=5948587]zeitferne[/MENTION] and the phone worked better than before!

The first 130 hrs went without any big hiccups and that was the moment I realized I still had zram deactivated (set to 0mb) in Kernel Adiutor. Switched it back on and got slowdowns and even a reboot.

Tried to disable it again, but right now I can't get it to work properly and do get slowdowns and reboots with and without zram (250mb and 0mb).

I will just attach my last_kmsg from after the last reboot after a massive slowdown.

system_server invoked oom-killer:

kernel panic:

Right now I don't know if those happen, because of changing values in Kernel Adiutor or if those would happen nonetheless.
[Galaxy S II Original Android Development] Andrea900:
[MENTION=5948587]zeitferne[/MENTION] Finally I've got a bunch of logs with your freezefix kernel (not empty like in the past). I hope that they can be helpful for you! Happy holidays and thanks a lot for your GREAT effort.

P. S.: soooo much freezes as usual, at least for me.

https://www.dropbox.com/s/ljzlrugz4ya8mez/last_kmsg_logcat_dmesg.zip?dl=0
[Galaxy S II Original Android Development] zeitferne:
Thank you, this log *does* look interesting. You seem to run into the same issue as [MENTION=5703164]McB77[/MENTION], i.e. lots of "Lock missing policy" lines.

A question: Does your phone run hot if it freezes?

From the "[HOTPLUG IN] check_up 500000>=500000 && 251>100" messages I gather you are using the pegasusq CPU governor. Try changing back to ondemand and see if that helps.

EDIT: I bet this is pegasusq's fault. It tries to turn CPU0 off, thats where the freeze happens. I don't know why this was no problem before my patch however, but I remember [MENTION=591147]Entropy512[/MENTION] saying that it's a wonder that pegasusq even works at all on the S2 as it was designed for newer phones. A bit of googling reveals that its special feature compared to ondemand is that it turns off unneeded CPUs -- but this is not necessary (or, as your freeze shows, even harmful) on the S2 as its kernel already has that functionality in another place.
[Galaxy S II Original Android Development] biascoblix:
Went to sleep yesterday with the phone plugged in to the charger... Then at the middle of night woke up from something very very very hot on my bed turn out it was the phone...

Not sure what happened there.. But it was completely frozen.. And its temp was at least 60C....

I'm surprised that my phone is not dead yet...
[Galaxy S II Original Android Development] Andrea900:
No, the phone keeps cold all the time, and yes, I'm using the Pegasusq governor.

Fine, i'll reinstall your kernel and set the governor to ondemand. Let's see...
[Galaxy S II Original Android Development] cdrivex4:
Edited so it makes sense:

As of now On secondary mobile 130hrs+ uptime with freezefix kernel ondemand, on mine I had a reboot after a day, (I've been playing around with stuff, plus have exposed installed now,100hrs is too long for me not to play with something an need to reboot for changes to be applied on my phone). Anyone get higher?

[MENTION=5948587]zeitferne[/MENTION]

As per previous pm and link, added some new logs.

How long we give freezefix testing before approvall?

Have also noticed better battery life on sleep as others have also posted.

It's all good from where I stand.
[Galaxy S II Original Android Development] spanitzer:
Which kernel can i use for overclock CPU and GPU?

Gesendet von meinem ME173X mit Tapatalk
[Galaxy S II Original Android Development] -schumi-:
I'm at 201h now and it hums along just fine. No stutter, no ram issues, nothing :)

Quite amazing actually, considering it stopped working on a basically regular basis, especially when loading spotify
[Galaxy S II Original Android Development] Phenomzye:
Guys, is there any possible way to remove these annoying 3 dots? The overflow menu I think it's called, it's just unnecessary since we have a hardware button for that, I come from the stock 4.1.2 where the whatsapp didn't have this, now here it's taking a bunch of space as you can see in the pic, can't see a lot of names fully, and also can't see the last connection right away.. What setting or code line has the stock ROM that tells the apps like whatsapp to not display those 3 dots, that this ROM hasn't? Thanks in advance, I don't know if it's been discussed here before, I don't really know what to search for
[Galaxy S II Original Android Development] Saber:
Also agree with pegasusq statement.

However, it is actually an old governor nowadays and many kernel developers on newer devices never use it anymore (if they still include it, they will advise users not to use it). Probably due to incompatible hotplugging code and etc.

I remember the dorimanx days where Pegasusq was causing a lot of SODs on the s2. The only stable governor back then was HYPER, which was a modified ondemand. :)
[Galaxy S II Original Android Development] iistoryahi:
Sorry for this question , I tried the kernel from zeitferne no more freeze and smoother than stock but the wifi problem still on his kernel :( . When i use shareIt and receive after receive the phone need to reboot before i can turn on the wifi :(

Edit: I update the shareIt and the wifi issue are gone :) , thanks [MENTION=5948587]zeitferne[/MENTION] for this kernel fix (y)
[Galaxy S II Original Android Development] lukss12:
300 hs here :D, whatsapp, clash of clans, simcity, spotify, twitter and instagram are my heaviest apps.. Not chrome, not facebook. Sometimes a hang is common but nothing else. Stock governor, stock zram(is it enabled in this kernel?) As I didn't have problems with memory or usage I didn't look at it. Thanks again [MENTION=5948587]zeitferne[/MENTION]. Merry Christmas and a Happy new year for everyone here on XDA :sly::sly::sly::sly:
[Galaxy S II Original Android Development] Klaerchen:
Hi,

is there some config.xml overlay in the CM12.1 source that allows the landscape mode for the launcher? (saw it in CM13 and liked it :) )

Thanks!
[Galaxy S II Original Android Development] kudos1uk:
[MENTION=6159291]Lysergic Acid[/MENTION]

[MENTION=6159291]Lysergic Acid[/MENTION]

Can we add this patch, in my view it will finalise CM12.1, not only for nightlies but more importantly for a new snapshot, making the snapshot stable and putting a line under all your great work.

There is no doubt now this fixes the main freeze problem with the kernel.
[Galaxy S II Original Android Development] Stoku:
To enable landscape mode in Trebuchet on CM12.1, just add the line below in build.prop then reboot:

log.tag.launcher_force_rotate=VERBOSE

Note: you have to do it every time you flash the new rom or update ;)
[Galaxy S II Original Android Development] alienflorina:
Sorry to spam on the freezes. I haven't tested the fix kernels ,I'm on snapshot release. I have been able to reproduce the freezes in my phone. In my case the phone hangs (screen freezes, hardware buttons light up, you have to reboot it with the button) when I try to write a message in different apps. To get more specific when I uninstall-install a few apps from playstore google keyboard starts to give me random errors. During that time I have 2-3 freezes a day when trying to type a message. Reinstalling google keyboard seems to fix the problem since I'm running smoothly for mor than 4 days. (I have been able to reproduce this 2 times)

I don't know if its relavant, I just try to help.
[Galaxy S II Original Android Development] lukss12:
You need to reproduce a freeze using zeitferne's fixkernel to be sure we're facing a different freeze (like OOM problem).

---------- Post added at 04:22 PM ---------- Previous post was at 04:18 PM ----------

I think we need to find out how to solve Pegasusq problems before merging. Because it seems like fixkernel increased freezes using Pegasusq.
[Galaxy S II Original Android Development] Andrea900:
My Zeitfernes's freezefix kernel experience (moving to ondemand governor)

Great news [MENTION=5948587]zeitferne[/MENTION] !

I've just reached 30:48 hours of uptime simply moving to ondemand, and my device is still going on! You were right about Pegasusq, because i'm not experiencing any freeze or sluggishness, even after 5 or less minutes.

By the way, to reach that last goal, i had to set the maximum frequency from 500 to 800mhz, but the battery consumption is keeping good, after all.

You're my hero, both you and [MENTION=6159291]Lysergic Acid[/MENTION] ! :victory:

Maybe Lysergic can directly removes this governor from the list.
[Galaxy S II Original Android Development] good8life:
night 26.12

I'm install - full wipe , after use have 2 freeze .

I'm install Kernel_Dorimanx-V11.0b015- 17-14 - 22-12 -LP-SGII-GSSTUDIOS-NON-TRIM-signed - no freeze.

I have stock system and date.

Regard
[Galaxy S II Original Android Development] Saber:
That's because my latest kernel comes with freezefix.

freezefix is not included yet into the nightlies. If kernel is already installed, stay away from pegasusq until problems have been solved.

Regards, gsstudios
[Galaxy S II Original Android Development] Lysergic Acid:
Well, yeah, I just need to download the cm-12.1 branch of the kernel again to submit it to gerrit :p
[Galaxy S II Original Android Development] kudos1uk:
Yeah, I know, it's so easy for me to say "can you add the patch" when in fact that's a lot of work for you, none of us have any real appreciation what hours you put in helping the community...... sorry & Thank you :good:
[Galaxy S II Original Android Development] Mikros:
Just FYI using zeitferne freezefix kernel as mentioned above for more than 3 days and no freeze at all. Before that i had at least 1-2 freezes per day. You are awesome mate [MENTION=5948587]zeitferne[/MENTION] thanks!
[Galaxy S II Original Android Development] the.gangster:
Yes, reading all the reports here, it obviously does fix it. The only thing that irritates me is, that I did not see any freezes for weeks meanwhile. I cannot provide any uptime counters with hundreds of hours as I regularly moved to a new nightly, skipping just very few. But while I remember times, where I had several freezes a day, they seem to have vanished to irrelevance on my device. And they did that, although I often "forgot" to flash [MENTION=5948587]zeitferne[/MENTION]'s freezefix-kernel on top of a nightly, but also already before he published it (Nevertheless I did flash it here and then).

The only bigger change in the recent past was repitting once more (for CM13 tests) and restoring all partitions' content from backup to get back to CM12.1. And moving from mini to full GApps (with some few exclusions).

But from our current state of knowledge, none of that would influence the freeze probability, would it?

Regards
[Galaxy S II Original Android Development] chrisXL:
[MENTION=6159291]Lysergic Acid[/MENTION]

It's possible to have a TWRPed fixed kernel/recovery version? Thank you for your hard work.
[Galaxy S II Original Android Development] d_j_l:
and +trim:)
[Galaxy S II Original Android Development] the.gangster:
Ha ha ha [MENTION=6159291]Lysergic Acid[/MENTION] hasn't released stock kernel yet but already two people asking for goodies.

Where have you guys been, when [MENTION=4881398]PolishVodka[/MENTION] tried to develop a solution for kind of multi-recovery-support in here http://xdaforums.com/showthread.php?p=64291730 ?

As I know from several PMs, he never got any feedback except mine.
[Galaxy S II Original Android Development] aljowen:
Is anyone else finding that changing display scaling (DPI settings) breaks the video camera functionality?

Is it a known bug? I have tried google but couldn't find much.

The camera itself still works, just using it to take videos crashes, it also means that other apps that use the video camera may crash if they try and use it with different display scaling.
[Galaxy S II Original Android Development] wdevil12:
Some didnt know this post ever existed until you quoted it now. So how was the result?