ViperOne + ElementalX dofstrim wakelock issue - solved

Search This thread

Shkoder

Member
Feb 16, 2005
6
0
Lutsk
www.elutsk.com
I am using unlocked and activated HTC One M7 sprint edition in GSM network, rooted. ViperOne appeared to be the best ROM for my device, along with brilliant ElementalX kernel. but as some other people I've suffered from dotfstrim kernel wakelock that usually came at nights when phone was charged and sleeping on the table.

I've found that trim file system service could be made manually using fstrim tool and starting from 4.3 trim events processed at the volume daemon (vold) triggered by idle maintenance event. that event is interesting thing, triggered only when battery charge is > 80% and phone was not active for more than 73 minutes, but not more than once per day. now I was almost sure that dofstrim orphaned wakelock was left by that event processing.

instead of waiting for next event, I did more research and found that event can be fired anytime by shell command:

am idle-maintenance

voila! wakelock was there. knowing that idle maintenance running vold internal procedure for trim, I've checked daemon sources and found the following:

fstrim.c //
......
#define FSTRIM_WAKELOCK "dofstrim"
......
SLOGI("Finished fstrim work.\n");
release_wake_lock(FSTRIM_WAKELOCK);
......
acquire_wake_lock(PARTIAL_WAKE_LOCK, FSTRIM_WAKELOCK);
......
//

so wakelock was set before trim process but never released. logfile shown me following:

E/Vold (32356): failed to open /fstab.m7
E/Vold (32356): Error reading configuration (No such file or directory)... continuing anyways
......
I/fstrim (32356): Starting fstrim work...

...and then.. boom!

F/libc (31832): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 32353 (vold)
I/DEBUG ( 248): Build fingerprint: 'htc/sprint_wwe/m7wls:4.4.2/KOT49H/325784.5:user/release-keys'
I/DEBUG ( 248): AM write failure (32 / Broken pipe)
I/DEBUG ( 248): Write to AM fail, close AM fd
I/DEBUG ( 248): Revision: '4'
I/DEBUG ( 248): pid: 31832, tid: 32353, name: vold >>> /system/bin/vold <<<
I/DEBUG ( 248): debuggerd: checkTellHTCSettings
I/DEBUG ( 248): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
I/DEBUG ( 248): r0 2a01abd5 r1 fffffff0 r2 00000003 r3 00000000
I/DEBUG ( 248): r4 2a02017c r5 2a025290 r6 00000000 r7 b6b28d08
I/DEBUG ( 248): r8 00000000 r9 2a018bf6 sl b6c282d4 fp b6fac2f4
I/DEBUG ( 248): ip 00000003 sp b6b28ce8 lr b6fd1de1 pc 2a00f6ca cpsr 200b0030

so vold crashed but orphaned wakelock remained and prevents phone from sleeping ((

in theory problem caused by additional protected partition that exists on sprint model only but I had no time for vold recompiling so I've created a quite straightforward hex patch that simply removes trim process. so wakelock released and everyone's happy. just a note. vold will not run trim anymore so it must be done manually from shell by fstrim tool or from UI by LagFix app like once per week.

attached archive contains new (patched) and old (original) vold files that you have to upload to device using adb or any other method:

adb push vold /system/bin/vold

make sure you have fixed vold permissions from terminal like

chmod 755 /system/bin/vold

or you risk to stop on boot screen.


ps. this night my phone spent only 2% of battery for 7 hours. radio + wifi was on. so it was sleeping well ))
 

Attachments

  • vold_fix.zip
    141.2 KB · Views: 101

aewald73

New member
Nov 27, 2013
1
0
Verizon M7 solution?

I have the same issue with the dofstrim kernel wakelock preventing my phone from going into deep sleep after a charging cycle. Will your solution also work for the Verizon M7? I am rooted with the NuSenseSIX rom and ElementalX kernel.
 

StormyNight

Senior Member
Dec 31, 2013
619
177
Hyderabad
I have the same issue with the dofstrim kernel wakelock preventing my phone from going into deep sleep after a charging cycle. Will your solution also work for the Verizon M7? I am rooted with the NuSenseSIX rom and ElementalX kernel.

I'd say probably not.. it's best not to flash zip files which are for different variants (they have different partition maps). Try posting here.
 

Snagg57

New member
Aug 14, 2013
1
1
Any chance you can post sort of a noob guide on this fix? I'm a little confused with the steps you already posted, and then the additional steps needed for the weekly fix. Thanks.

While I cannot guarantee it will work for you, heres what I did:

1.) Extract the vold file from the .zip to the adb directory

2.) Have adb installed

3.) Do this:
Code:
adb devices
adb root
adb remount
adb push vold /system/bin/vold
adb shell
su
chmod 755 /system/bin/vold

CTRL-C

adb remount

Reboot and it should work.
 
  • Like
Reactions: coal686

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Any chance you can post sort of a noob guide on this fix? I'm a little confused with the steps you already posted, and then the additional steps needed for the weekly fix. Thanks.

    While I cannot guarantee it will work for you, heres what I did:

    1.) Extract the vold file from the .zip to the adb directory

    2.) Have adb installed

    3.) Do this:
    Code:
    adb devices
    adb root
    adb remount
    adb push vold /system/bin/vold
    adb shell
    su
    chmod 755 /system/bin/vold
    
    CTRL-C
    
    adb remount

    Reboot and it should work.