yashsingh1/xdaforums huggingface dataset:
[Nexus 4 Original Android Development] franciscofranco:
I was just thinking, maybe we don't even need this part:

int cpu;

for_each_possible_cpu(cpu)
{
cpufreq_get_policy(policy, cpu);

if (policy->cur < TOUCH_BOOST_FREQ)
{
__cpufreq_driver_target(policy, TOUCH_BOOST_FREQ,
CPUFREQ_RELATION_H);
}

if (cpu >= TOUCHBOOST_CORES)
break;
}

Just setting is_touching as true will make the code go through

if (is_touching && pcpu->policy->cpu == X)

And with this check

if (new_freq < input_boost_freq)
new_freq = input_boost_freq;

improve to yours

if (new_freq < input_boost_freq || pcpu->policy->cur < input_boost_freq)
new_freq = input_boost_freq;

The governor will undoubtedly increase both cores to input_boost_freq as fast without adding more complexity to the touch work.

Opinions?
[Nexus 4 Original Android Development] Arstoien:
I agree that 60 is too low. When I've got it on 60 four cores come online when typing and other times when they're not really needed. 70 is perfect.

Send me a pm, I'll help you out. You can do that with Tasker alone via shell commands.

Sent from my Nexus 4
[Nexus 4 Original Android Development] aventu:
maybe it tries "cpufreq_get_policy(policy, cpu);" with an offline core. The kernel panic happens only without charging and screen off.

Yes this works also, I just thought that implementing touchboost in lge_touch_core.c is faster. Do you think it doesn't matter? On the other hand the current implementation needs stuff form governors and maybe mako_hotplug. It would be tidier separately.
[Nexus 4 Original Android Development] franciscofranco:
It seems like that touch_work is called somehow after the screen goes off, so yeah it seems to lose context of the policy.

I don't mind having it tied to the governors, I'm only supporting interactive, ondemand and conservative, all others are stupid and not needed. Before going into changing it this way we try some things first. We can add a if (policy == null) return, that way it won't **** up. If that doesn't fix it we can add a simple hook on the early_suspend/late_resume and a bool is_screen_on and if !is_screen_on return early. I'll try if (policy == null) return now. Try it as well and let me know.

I love when there is real Kernel development discussion :D
[Nexus 4 Original Android Development] xatou:
Another link to download r156 please?

Στάλθηκε από το Nexus 4 μου χρησιμοποιώντας Tapatalk 2
[Nexus 4 Original Android Development] franciscofranco:
Oh comon, theres a bloody link in the OP.
[Nexus 4 Original Android Development] xatou:
I know but the download do not start!

Στάλθηκε από το Nexus 4 μου χρησιμοποιώντας Tapatalk 2
[Nexus 4 Original Android Development] aventu:
Yea something rare in these forums. I tried to avoid it with "if (cpu_online(cpu)) " and added a "cpufreq_get_policy(policy, 0);" in "touch_probe()", but my poor phone still get nightmares. I think "protecting" this logic with your last suggestion would work.
[Nexus 4 Original Android Development] franciscofranco:
We'll find it eventually. I even found a stupid bug on the original code, it was only breaking from the for iteration after it already checked for a policy for a offlined cpu. This is what I have atm, but still kernel panics on screen off:

diff --git a/drivers/input/touchscreen/lge_touch_core.c b/drivers/input/touchscreen/lge_touch_core.c
index b2d8ab5..7767913 100644
--- a/drivers/input/touchscreen/lge_touch_core.c
+++ b/drivers/input/touchscreen/lge_touch_core.c
@@ -797,8 +797,8 @@ static void touch_input_report(struct lge_touch_data *ts)
input_sync(ts->input_dev);
}

-#define TOUCH_BOOST_FREQ get_input_boost_freq()
static struct cpufreq_policy *policy;
+#define TOUCH_BOOST_FREQ get_input_boost_freq()

/*
* Touch work function
@@ -814,10 +814,25 @@ static void touch_work_func(struct work_struct *work)
//static unsigned int y = 0;
//static bool xy_lock = false;

-	if (policy->cur < TOUCH_BOOST_FREQ)
+	int cpu;
+
+	for_each_possible_cpu(cpu)
{
-	__cpufreq_driver_target(policy, TOUCH_BOOST_FREQ,
-	CPUFREQ_RELATION_H);
+	if (cpu >= 2)
+	break;
+
+	ret = cpufreq_get_policy(policy, cpu);
+	if (ret)
+	{
+	pr_info(KERN_WARNING "CPU%d - val%d", cpu, ret);
+	break;
+	}
+
+	if (policy->cur < TOUCH_BOOST_FREQ)
+	{
+	__cpufreq_driver_target(policy, TOUCH_BOOST_FREQ,
+	CPUFREQ_RELATION_H);
+	}
}

is_touching = true;

I have a few clues why this is happening, will keep posted.
[Nexus 4 Original Android Development] Shano56:
Is this the bug you guys are taking about Franco?
[Nexus 4 Original Android Development] franciscofranco:
Nope. My device stays on my min frequency just fine, thats weird.
[Nexus 4 Original Android Development] manulemaboul:
So do I, because in those cases I read code with its context and actually understand it and what it does :).

I learn more than just trying to understand raw code in sources (even if yours is well commented) :).

Envoyé depuis mon Nexus 4
[Nexus 4 Original Android Development] Shano56:
Odd. Any logs would be useful?

Edit: weird working now after fku wipe and update to 156. Strange.
[Nexus 4 Original Android Development] aventu:
+	ret = cpufreq_get_policy(policy, cpu);
+	if (ret)
+	{
+	pr_info(KERN_WARNING "CPU%d - val%d", cpu, ret);
+	break;
+	}

Is ret not always true? Even if it gets null.
[Nexus 4 Original Android Development] franciscofranco:
[MENTION=3970977]reborn90[/MENTION]

[ 559.018676] timer 0: cpufreq_frequency_table_target error

Hmmm could it be interactive derping? Its not my code thats for sure.
[Nexus 4 Original Android Development] franciscofranco:
Thats just checking if ret is == 0. Its a strange way but thats how Kernel code goes. if cpufreq_get_policy(policy, cpu); is successfull it will return 0, so if (ret) (which means if ret is != 0) the function was a success. If cpufreq_get_policy(policy, cpu); fails, it will return something else than 0, so it will return.
[Nexus 4 Original Android Development] Net.silb:
He's got 4 online all the time with min freq set to 1512MHz... The device is bound to get really hot and when it does, it throttles - which is causing all the cpu freq to be 1026MHz.
[Nexus 4 Original Android Development] pnut22r:
Your new kernel has been very good to me, thank you.

r156 matched with trailblazer linaro CM build has given a good balance of performance and battery. 3+ hrs of SOT with 41% left.

What do you suppose would be worse on battery, raising GPU or raising the highspeed_freq?
[Nexus 4 Original Android Development] Shano56:
I totally forgot about throttling, that may have been it
[Nexus 4 Original Android Development] franciscofranco:
Sharp eye! I didn't think of it. Could be yes!
[Nexus 4 Original Android Development] dapsANDpoundz:
Anndd after a day with r156 battery life looks the same if not better. Welp, I'm fully content. Just waiting for the new app update and that M3 and I can move on with life ?
[Nexus 4 Original Android Development] Shano56:
Christians monitor only has battery temp right? the battery barely hit 45 but I guess the CPU could have got close to 60. When's he adding CPU temp xD
[Nexus 4 Original Android Development] Net.silb:
You can get CPU temp in FKU.
[Nexus 4 Original Android Development] aventu:
If I got it right, the policies have to be updated manually via fuctions with new values, maybe we interfere the usual updates? Or the policy struc is somehow incorrectly set after the touchboost logic.. I haven't that much experience with debugging kernel code.

Of course, they often return 0,1,-1. I forgot that.^^

Do you think that "touch_work_func" is somehow called while screen off? If yes, the is_touching variable should be protected with an screen on check.
[Nexus 4 Original Android Development] Shano56:
I know, but system monitor has temp history
[Nexus 4 Original Android Development] franciscofranco:
I'm not sure about that. I already tried a bunch of crap but with no success. Strangely this panic is not producing a stacktrace log, making it harder to debug. I'll try some more ****s. If it doesn't work I'll try the first method I posted 2 pages ago.
[Nexus 4 Original Android Development] dsmpampis:
Sorry for the question....!

But what the difference between 154, 155 and 156?

I think (in my opinion) the r154 was better....

Thanks in advance..!

Tapatalked with my Nexus⁴ powered by ParanoidAndroid 3+
[Nexus 4 Original Android Development] aventu:
Do you know a simple check for "is screen on"? I want to check if the "touch_work_func" function is called while screen off.

edit: found boolean is_screen_locked

Check the changelog, r156 is really good and very close to M3
[Nexus 4 Original Android Development] Net.silb:
Check the OP:
[Nexus 4 Original Android Development] franciscofranco:
touch_work isn't called on screen off/on. I can't figure out the panic, already tried a ton of ****, even setting the policy as NULL on screen off. Something weird but I can't figure out. I'll try the first method.

EDIT: What a moron that I am. [MENTION=3970977]reborn90[/MENTION] delete policy = bla bla from the probe() and it doesnt crash anymore.
[Nexus 4 Original Android Development] Net.silb:
I agree Franco, you're a complete moron that managed to make the best kernel for Mako! ;)

EDIT: And I've reached 1000 posts... Maybe a little to much XDA for me? Ah well time for bed... Keep up the good work Franco! :)
[Nexus 4 Original Android Development] aventu:
I also tried that, but made obviously something else wrong. xD
[Nexus 4 Original Android Development] mitchdickson:
The fact that your exact same question was ignored last night probably indicates a "no"

Sent from my iPad 4
[Nexus 4 Original Android Development] franciscofranco:
Not Kernel related as far as I know.

I will diff you after dinner ;)
[Nexus 4 Original Android Development] aventu:
Thanks, I wonder how much faster the lge_touch_core implementation is in contrast to the governor touchboost. I'll use the governor only variant tomorrow.
[Nexus 4 Original Android Development] pnut22r:
r156 + linaro CM

Normal usage. Browsing, Twitter, Super Stickman Golf. I didn't baby it, that's real usage.

WiFi only. But still better than I've had.

Thank you
[Nexus 4 Original Android Development] franciscofranco:
It shouldnt be noticeable, the timer thread on interactive runs every timer_rate which by default is 30ms I believe. 30ms is really fast, its 0,03s.
[Nexus 4 Original Android Development] vv91xv:
After install r156, my N4 is very hot in surfing and playing music, my battery up to 43c, this is normal?
[Nexus 4 Original Android Development] ciprianruse88:
Here looks fine but I also feel the device a little hotter with 156 but maybe it's just placebo

Sent from Inferno
[Nexus 4 Original Android Development] vv91xv:
Hmm, my cpu 1.5ghz, no clock and no UV. My rom PA 3.60, this is best combination?
[Nexus 4 Original Android Development] ciprianruse88:
I have 1.3ghz max frequenci set and -100 UV. Slim rom 6.5 weekly and r156 .also there are 25-26C° here. from your settings it is normal to get hotter.:)

Sent from Inferno
[Nexus 4 Original Android Development] franciscofranco:
That temperature is just coincidence, there is nothing that can be increasing the temperature more than it normally was on r155, quite the contrary it should be even cooler.
[Nexus 4 Original Android Development] vv91xv:
Hmm, ok. I download Slim rom now, try you settings and report after 2 day, tnx bro.
[Nexus 4 Original Android Development] ciprianruse88:
Be careful with UV...I don't know if your device can handle -100 UV but you can try with -25 then -50 ; -75 and then -100. Also you can check what kind of chip you have to make and ideea on how much UV your device can handle --> http://xdaforums.com/showthread.php?t=2052496

Sent from Inferno
[Nexus 4 Original Android Development] franciscofranco:
[MENTION=3970977]reborn90[/MENTION] Check my git ;)
[Nexus 4 Original Android Development] vv91xv:
Tnx, bro. My CPU is NOMINAL, UV is -50, -75, ok?
[Nexus 4 Original Android Development] ciprianruse88:
Don't know. You need to test. Knowing your chip type is just for making an ideea.there are nominal chips out there that can UV more than faster ones :)

Sent from Inferno
[Nexus 4 Original Android Development] bvx89:
My phone has been rebooting at random lately, and I don't know why. It seems to become slower and slower until it happens. I checked and found out that I had over 1GB of RAM available a minute before it happened the last time.

Haven't seen anyone here having the same issue, so I'm not sure if it's related to the kernel. I'll post a dmesg here if anyone could be bothered to look into it anyways:

http://db.tt/tCN0xqcj
[Nexus 4 Original Android Development] franciscofranco:
**** your device is kinda fúcked. Its been thermal throttled to death and it shows some problems with voltages:

<3>[42224.237395] msm_spm_drv_set_vdd: failed, remaining timeout 50us, vlevel 0xa2

<3>[42224.237578] saw_set_voltage: 8821_s0: msm_spm_set_vdd failed -5

<3>[42224.237639] acpuclk-8064 acpuclk-8064: vdd_core (cpu2) decrease failed (-5)

<3>[42224.239714] msm_spm_drv_set_vdd: failed, remaining timeout 50us, vlevel 0xa2

<3>[42224.239775] saw_set_voltage: 8821_s1: msm_spm_set_vdd failed -5

<3>[42224.239897] acpuclk-8064 acpuclk-8064: vdd_core (cpu3) decrease failed (-5)

What are you doing? Did you undervolt? If your ram is growing like crazy it looks like your rom is fúcked and something is leaking like crazy. Word of advice, wipe everything and start fresh.
[Nexus 4 Original Android Development] Krunk83:
Deleted

Sent from my Nexus 4
[Nexus 4 Original Android Development] garth719:
This things effin smooth. Running eos 6-3, r156 and touch control 1.7.4 works great. I'm excited to see the battery results

Edit

Buying the app now
[Nexus 4 Original Android Development] digitallysick:
My franco app still can't fetch the latest nightly, what could be wrong?
[Nexus 4 Original Android Development] resynx:
Good battery life for me in r156, and it's smoother than r155 :)
[Nexus 4 Original Android Development] franciscofranco:
Dunno, mine fetches just fine, I check it more than 100 times a day lol
[Nexus 4 Original Android Development] Albert62:
Super Smooth! Good Battery Life! Temperature stays good! In love with r156! Going to buy the app now!
[Nexus 4 Original Android Development] PetritH:
I know you check to see if there's any nightly available :p
[Nexus 4 Original Android Development] Cuzz1369:
But shouldn't you know when there is a new release??? :D

Carbonized and francofied N4
[Nexus 4 Original Android Development] franciscofranco:
Yes, but I'm also testing a gazillion things everyday, need to make sure its working properly!
[Nexus 4 Original Android Development] garth719:
Delete
[Nexus 4 Original Android Development] PetritH:
btw im also feeling it hotter than before, may be the weather its actually 32°C, the phone is reaching 55-60°C by just surfing the web and writing via Viber, im also uv -125. other than that smooooooooth.
[Nexus 4 Original Android Development] franciscofranco:
The weather is probably helping, 55ºC CPU temp is quite alright if the weather outside is really hot.
[Nexus 4 Original Android Development] Cuzz1369:
Wow slow night. This has to be the longest without a post on this thread...awkward silence or the perfect kernel????

Carbonized and francofied N4
[Nexus 4 Original Android Development] freddysam:
With everything else being equal, CPU temp minus ambient air temp = a constant. So if the weather is 3°C hotter, your average CPU temp will be 3°C hotter too.
[Nexus 4 Original Android Development] DooshPastesh:
Mine is 'slow' and I can UV to 150 without any issiues :cool:

Wysyłane z mojego Nexus 4 za pomocą Tapatalk 2
[Nexus 4 Original Android Development] kCelsius:
Dang you're lucky. I have a 'fast' and I can only UV to 125.
[Nexus 4 Original Android Development] TG2708:
this whole undervolting thing, does it hurt the cpu in the long run or is it only an issue with overclocking? I'm always under the impression that anything not set by the manufacturer has some ill effects.
[Nexus 4 Original Android Development] kCelsius:
With my basic understanding of electronics and circuits, undervolting just provides less power to the device, which is why in some high strain tasks, your phone will shut down (I think). Overclocking has nothing to do with voltage, it just turns the speed of the processor up, which can in turn make your phone heat up, which could damage it but I haven't heard anything like that before.
[Nexus 4 Original Android Development] Arstoien:
Overclocking could damage your chip. Undervolting is safe. If you overdo it, you'll get a reboot and in the worst case corruption of some files. If you're wondering, the reason why manufacturers set the voltages higher is that the chips dont come out exactly equal and some can work on lower voltages than others. So the manufacturers set a voltage that can supply enough juice for all, since they wouldn't test each chip separately, or more importantly – they wouldn't want to send out two devices that heat up with different rates.
[Nexus 4 Original Android Development] drawde40599:
Been using 100% stock Phone, locked bootloader, unrooted , for the last week for comparison since i forgot what it felt like, and anyone that says there isnt a major difference in franco kernel compaired to stock (battery, speed, smoothness.... ) needs to call google and get your phone warranty cause its broken. Franco kernel outperformed in every area!

Thanks for your time Franco!
[Nexus 4 Original Android Development] cgollner:
For those using my System Monitor app:

I just released a beta version. If you're interested, go to the community page for more details: https://plus.google.com/communities/109894479480888141123
[Nexus 4 Original Android Development] bvx89:
I'm not doing anything special, besides a lot of switching between apps. No, no UV or OC either. I have already whiped the ROM and started fresh about a week ago, and that didn't cure the problem. Could it be that it's HW-related?
[Nexus 4 Original Android Development] Cuzz1369:
And for all the people who can't read it will still be a little while before download is available from the store. Please don't pollute this thread with questions on how to do this. Just follow the links.

Here is the xda thread for the app:

http://xdaforums.com/showthread.php?t=2195684

[MENTION=4446775]cgollner[/MENTION] let me know if you don't want posts there. I will remove at your request.

Carbonized and francofied N4
[Nexus 4 Original Android Development] PelegK:
r156 seems great !
[Nexus 4 Original Android Development] noobiekins:
That's not true, silicon uses more energy to function in hotter environments than cooler environments. Since heat = energy in - energy out. Since energy out is fixed (heat dissipation) and energy in is proportional to the temperature, you cannot simply compare apples to apples when ambients aren't within reasonable ranges (1-2 C)
[Nexus 4 Original Android Development] :
I used stock for about a two days and had to switch to Franco, some people claim stock kernel is faster then r155/156 but its just not possible, I notice major stuttering in Chrome beta, Tumblr, Tapatalk on stock kernel whereas latest franco kernels its completely smooth in Chrome beta and barely stutters on Tumblr and Tapatalk(stock settings)

I've attached a stock kernel with UV, gamma and sound patches (not made by me), you can test and see for yourself, r156 is also even better than previous ones which is surprising, didn't think performance could improve at this point
[Nexus 4 Original Android Development] freddysam:
Energy in = energy out when your CPU is at a steady temperature. Energy out is proportional to the difference in temperature across your cooling system (for the most part). That means Qcpu ~ Tcpu-Tambient. If the Qcpu is the same between two situations, that means the difference in temperature is the same, no matter what Tambient is. That in turn requires Tcpu to adjust itself until the difference in temperatures is the same between the two situations.
[Nexus 4 Original Android Development] drawde40599:
Huh? I think u read my post wrong, I agree with u, stock kernel sucks :P (i edited my post i can see how....)
[Nexus 4 Original Android Development] torresfelipe:
Guys,

What is the safest undervolt settings with Franco's kernel?
[Nexus 4 Original Android Development] borito24:
100
[Nexus 4 Original Android Development] torresfelipe:
By 100 you mean decrease every voltage by 100 mV?
[Nexus 4 Original Android Development] bakedcricket:
My phone has been moving up to 50°c at conservative and without running any apps. Its a little too hot? I can feel the heat through my pants. Is this normal?

Sent from my Nexus 4
[Nexus 4 Original Android Development] Burlito:
The safest setting is not to undervolt at all.
[Nexus 4 Original Android Development] alanwyl:
Safest is -0mv.
[Nexus 4 Original Android Development] nachordez:
UV is NEVER safe. And each phone manages it differently, you cannot use other one's settings, you have to try and see

Nexus4 / Stock / Franco / V4A
[Nexus 4 Original Android Development] :
I know what you meant and I agree, but since its a public forum, I attached it for other people to test and come to their own conclusions
[Nexus 4 Original Android Development] Beerad875:
So does the kernel have to break in or whatever to work at full potential or whatever they say it does?
[Nexus 4 Original Android Development] ROFLkopter:
I'm currently running at -75mV. I tried going to -100mV but my phone hung, so had to reboot it. Tried it at -75mV and that works for me so that's how mines set.

<(:0)OOO> A wild Weedle appears!

Sent from a Paranoid Nexus 4 with XDA Premium
[Nexus 4 Original Android Development] borito24:
Correct
[Nexus 4 Original Android Development] Sukhi:
+1 Conservative and onDemand dont seem to be working well since the last few releases. I had to revert back to Interactive since i felt the heat in my pocket and since then the temps have been b/w 40-43°c

---------- Post added at 08:31 AM ---------- Previous post was at 08:27 AM ----------

Agree

---------- Post added at 08:32 AM ---------- Previous post was at 08:31 AM ----------

Agree
[Nexus 4 Original Android Development] Fobz:
I think its because only interactive is supported.

Sent from my Nexus 4
[Nexus 4 Original Android Development] gravitysandwich:
Actually, YOU are the lucky one. Slow/slower binned CPU's have 950mV for there first step as default, nominal have 900mV and you sir have 850mV since fast/faster binned CPU's have that as default. So when he says he can undervolt -150mV he's technically at 800mV at the first step (384MHz)while you have 725mV at the first CPU clock step (384MHz). I can undervolt -150mV to each step since I have a fast binned but a slower binned would need to undervolt by -250mV to reach the same voltage for each step.

Correct if I'm wrong please but I'm 99.9999% sure I'm right.
[Nexus 4 Original Android Development] hozjacz:
Hi,

I found out this:

When I flashed nightly version of Franco kernel (v156), CPU-Z shows to me, that I have in my Nexus4 cpu Snapdragon S600, when I flash milestone kernel, cpu-z shows to me, that I have cpu S4Pro.

Why?

Odesláno z mého Nexus 4 pomocí Tapatalk 2
[Nexus 4 Original Android Development] :
Shouldn't you contact the CPU-Z developer or something, its not like Franco is the one who made it???
[Nexus 4 Original Android Development] jmartino5920:
Because the 600 is an S4 Pro in disguise at a higher clock speed?

Sent from my LTE Mako
[Nexus 4 Original Android Development] vv91xv:
Ok. CPU work with 1.2Ghz, UV - 50, my phone no hotter and no slowdown. It's ok, I waiting M3. . .
[Nexus 4 Original Android Development] Net.silb:
I'm pretty sure you're wrong because all Nexus 4 devices have the same voltages no matter the cpu binning.
[Nexus 4 Original Android Development] trailblazerz11:
There's some other minor changes to 600 Anandtech gives more details. The clock speed is what made it think it was 600 though.
[Nexus 4 Original Android Development] LaboDJ:
Nope... He's right.

There are 4 different voltage table for each CPU bin in franco.

In stock 3, fast and faster have the same table
[Nexus 4 Original Android Development] BakaPhoenix:
Where i can find if my cpu is nominal, fast or faster?