[KERNEL][AOSP/TW][27 Dec] War Kernel r3 // colder than ever

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
0

forest1971

Senior Member
Apr 3, 2012
1,694
2,133
0
i dont know what you mean. i didn't count the files affected by each fix/commit either. please point to the patches you think need to be applied in CM11's exynos 4210/4412 kernel that aren't. IMHO this kernel already has all fixes needed to safely trim as detailed here:
http://forum.xda-developers.com/and...ug-aftermath-recovering-t2823051/post54295205
I guess so too. Still in "drivers/mmc/core/core.c 100644 → 100755" the changes were only partially made. I guess the redundant part is skipped. maybe u can check and confirm that. tks.
 

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
0
the commit you are linking in the first link is TRIM bug patch. as you can see, it's committed to CM11:
https://github.com/CyanogenMod/android_kernel_samsung_smdk4412/search?q=mmc_can_discard

I checked CM11 kernel source and found that 4 out of 6 patches have been applied. I guess that is sufficient. I still applied the other two which maybe redundant!
you were talking about CM11, and so was i. the second link points to omni. i don't know the state of omni's kernel.

i insist that CM11 has all the required fixes. if you think it's missing commits, please point to them.
 
  • Like
Reactions: forest1971

forest1971

Senior Member
Apr 3, 2012
1,694
2,133
0
the commit you are linking in the first link is TRIM bug patch. as you can see, it's committed to CM11:
https://github.com/CyanogenMod/android_kernel_samsung_smdk4412/search?q=mmc_can_discard



you were talking about CM11, and so was i. the second link points to omni. i don't know the state of omni's kernel.

i insist that CM11 has all the required fixes. if you think it's missing commits, please point to them.
Sorry @Lanchon for the mistake. I opened two github at the same time so mixed up.

I could not find the code below applied in the core.c
https://github.com/CyanogenMod/android_kernel_samsung_smdk4412/blob/cm-11.0/drivers/mmc/core/core.c


Code:
@@ -1482,7 +1482,10 @@ static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card,
 {
 	unsigned int erase_timeout;
 
-	if (card->ext_csd.erase_group_def & 1) {
+	if (arg == MMC_DISCARD_ARG ||
+		(arg == MMC_TRIM_ARG && card->ext_csd.rev >= 6)) {
+		erase_timeout = card->ext_csd.trim_timeout;
+	} else if (card->ext_csd.erase_group_def & 1) {
 		/* High Capacity Erase Group Size uses HC timeouts */
 		if (arg == MMC_TRIM_ARG)
 			erase_timeout = card->ext_csd.trim_timeout;
 

abdullahchoudhary97

Senior Member
Nov 25, 2014
116
5
0
Islamabad
Hi all,

I'm happy to present you my new kernel, Raw Kernel, based on the official OmniROM 4.4 kernel.
Here you go, @XxPixX :highfive:

Changes over stock :
  • Use the right GPU voltage table for 1400MHz devices (merged to mainline)
  • Mali r3p2 and s3cfb driver updates (merged to mainline)
  • Restore stock GPU steps/voltage/thresholds
  • Linaro 4.7-13.11 compiled (feels snappier!)
  • Defaults to ROW/pegasusq instead of CFQ/ondemand
  • Safe undervolt for better battery life and less heat (CPU + GPU)
  • 59hz panel overclock for lower input lag
  • FPBug patchset merged
  • TRIM support (read this)
That's all. These tiny changes are trully noticeable. ;)

Download :

old: r4/TW, r8, r7, r3/TW, r6, r2/TW, r1/TW, r5/KK4.4, r4/JB4.3, r3, r2/JB4.3, r2/JB4.2, r1

Dear developers
Build scripts are shamelessly kanged from NX-Kernel (thanks neo!), toolchain is included, and the source code is available here.
Based off c.o.h's HelloWorld kernel for Touchwiz, source code here.

Dear adventurers
TRIM test build for Touchwiz here
OLED panel overclock from 57 to 62 Hz explained here.

Have fun.
one question...
is it working for @bauner'z beta 5...???
and how to use trimm function...???
and when to TRIMM before flashing the kernel or after flashing kernel...???
 
Last edited:

Lanchon

Senior Member
Jun 19, 2011
2,703
4,455
0
Sorry @Lanchon for the mistake. I opened two github at the same time so mixed up.

I could not find the code below applied in the core.c
https://github.com/CyanogenMod/android_kernel_samsung_smdk4412/blob/cm-11.0/drivers/mmc/core/core.c


Code:
@@ -1482,7 +1482,10 @@ static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card,
 {
 	unsigned int erase_timeout;
 
-	if (card->ext_csd.erase_group_def & 1) {
+	if (arg == MMC_DISCARD_ARG ||
+		(arg == MMC_TRIM_ARG && card->ext_csd.rev >= 6)) {
+		erase_timeout = card->ext_csd.trim_timeout;
+	} else if (card->ext_csd.erase_group_def & 1) {
 		/* High Capacity Erase Group Size uses HC timeouts */
 		if (arg == MMC_TRIM_ARG)
 			erase_timeout = card->ext_csd.trim_timeout;
oh ok! well that only affects the timeout waiting for the emmc to finish a command. it wont brick or anything. the worst thing that can happen is driver giving up on command because emmc takes long. AFAIK we don't see that happening so no problem. whoever merged that seemed to understand the emmc standards and chose that implementation. since it works, i wont second guess that.

the important part of the fix is here:
https://github.com/CyanogenMod/andr...12/blob/cm-11.0/drivers/mmc/card/block.c#L963
where it issues discard commands instead of trim commands.
 

ShonkUK

Senior Member
Feb 26, 2011
375
332
83
United Kingdom
I stopped using my N7000 around a year ago as it was just so stuttery
anyway i turned it on about an hour ago for the first time in about 10 months
and it was painful compared to my S3 LTE stuttering all ver the place (TW XXLTD Debloated)

Flashed the zImage with mobile odin
Black screen realised it needed new mali drivers
flashed them
trimmed the filesystem

geez it feels as fast as my S3 LTE in the menu's now
It really did need a trim no stuttering at all now
I just thaught it was getting old

Successful TRIM is successful! Thanks to @Lanchon, I have reenabled MMC_CAP_ERASE on Raw TW and fstrim works properly. This kernel already includes the official Samsung fix for brickbug, so all I had to do was to remove two comments.

If you feel adventurous, flash this zImage (only for Touchwiz) using ODIN/heimdall and test it for yourself. This is the kernel I'm running right now on my main phone. I don't take any responsability if your device breaks, but that shouldn't happen. :D

Edit: basic howto
- flash the kernel, reboot
- install the LagFix app from here
- trim /system, /data and /cache, then reboot.
- for better results use 'adb shell' and launch 'fstrim -v /system; fstrim -v /data; fstrim -v /cache; fstrim -v /preload' as well.

Edit: commit introducing the change here. it's small because Samsung's MMC_QUIRK_MOVINAND_SECURE fix is already included in the stock JB kernel.
 
Last edited:

ShonkUK

Senior Member
Feb 26, 2011
375
332
83
United Kingdom
Noticed r5 a few mins later..
any chance of the source for r5 so i can set it up so i dont have to use tegrak (hate it)

or if your bored you could do it :eek:

Been running these speeds ever since i owned it its stable at them
CPU Max Speed 1.6 ghz @ 1300mv
GPU 400 @ 1000mv
not sure what your lower speeds are
I use 160mhz @ 900mv with tegrak (only allows 2 steps)
 
  • Like
Reactions: cheaterdawaq

sanioclement

Senior Member
Jan 15, 2013
482
294
0
bangalore
Announcing Raw Kernel r9

#JeSuisCharlie edition

Changes over r8 :
* MMC_CAP_ERASE is disabled, so we can TRIM our device for better I/O performance. The official brickbug patch is merged since at least two years, it's safe.
* -50mV GPU undervolting for group B+ devices
* Compatible with CM12 beta 4
* Added a CM11 variant (a long last!)

Download :
* raw_kernel_r9_omni.zip for Omni 4.4
* raw_kernel_r9_cm12.zip for CM12 beta 4
* raw_kernel_r9_cm11.zip for CM11

Let's talk a bit about TRIM. You should do it once on /system after flashing a ROM, /data and /cache will be trimmed by Android itself. /preload is an unused partition on AOSP, you should wipe it and trim it once and for all. To make the process a lot easier, I created this flashable zip run_fstrim.zip that will trim /system, /cache, /data and /preload from the recovery. I recommend using it just after flashing a ROM (and a TRIM-enabled kernel, of course...), or right now if you have never trimmed before. :)
Thanks for TRIM script, I am not sure what is trim but I know i can feel the speed of the rom while using it. my question is here how many times i have to trim each time i flash the rom? thanks