[Kernel][GPL] msm_hsic_host wakelock fix (Now with WiFi notification fix!)

Search This thread

thracemerin

Senior Member
Oct 19, 2011
5,458
5,764
Toronto
Hi Folks

I have been trying to solve the msm_hsic_host wake lock problem without introducing the data drop/lockup issues that have been introduced into other kernels by adding the patches from code aurora.

Disclaimer: The usual statements apply, I'm not responsible for your device being bricked, ebola outbreaks, nuclear war, etc... resulting from the use of this kernel, flashing this kernel should be done at your own risk, that being said I have been running various variations of this for the last few days without my phone having any issues.

All Versions now in post 2 below.

What's in this release?
4.2.1 versions: Simply the CM stock kernel pulled from their github here: https://github.com/CyanogenMod/lge-kernel-mako with patches from CAF that I cherry-picked in an attempt to fix the msm_hsic_host wake locks without causing 3G data problems.
4.2.2 versions: Stock AOSP pulled from the android-msm-mako-3.4-jb-mr1.1 repo at https://android.googlesource.com/kernel/msm/ with patches from CAF that I cherry-picked in an attempt to fix the msm_hsic_host wake locks without causing 3G data drops.

What do I do if I get a data drop?
Post here, be as detailed as possible, logs would be extremely helpful so I can see what's going on with your device, because these data drops seem to be somewhat random and don't affect everyone it's very difficult to actually reproduce them on another device on another network, as a result the more information you can give me the better.

My WiFi drops while the screen off resulting in delayed notifications!
To be clear, this is not the same issue, the issue with WiFi disconnecting while the screen off seems to be an Android 4.2.1 issue and exists on all kernels and even different devices running Android 4.2.1, this kernel doesn't do anything to address this issue, whether it fixes it or doesn't is entirely independent of the kernel. A potential fix for this is available from this thread: http://xdaforums.com/showthread.php?t=2072930 Note: It would appear that this hasn't been fixed in 4.2.2 despite Google claiming that it has been, the fixes outlined in that thread still work however. Possible Fix in Post 2

The wakelock is reduced but my battery life is the same or not significantly improved
Well, without these patches the wakelock keeps the phone awake, but if the screen is off and nothing else is going on the kernel is just waiting for the USB bus to suspend so the CPUs are either offline or at their lowest clock speed so they aren't likely using that much power. That being said there should be some improvement in battery life over a 100-0 drain cycle, how much will depend on factors that are mainly not kernel related (time on WiFi, 3G signal strength, apps syncing in the background, etc...).

Wasn't this fixed in 4.2.2? My msm_hsic_host wakelock is way down.
Yes and no, Google took 2 patches that were included in the set I was using on 4.2.1, these two fixes significantly reduced the msm_hsic_host wakelock while on WiFi but not really while on 3G. So, if you use WiFi primarily your msm_hsic_host wakelock will be reduced but if you use your phone primarily on 3G it will continue to be high, though probably lower than it was on the stock 4.2.1 kernel.

Thanks to:
LG - for making such an awesome device
Google - for providing us with the AOSP sources
CyanogenMod - I used their kernel as a base
Code Aurora Forums - for solving the issue
Harsh - for pointing me in the right direction on which CAF patches I was missing
franciscofranco - additional CAF patches that might help
molesarecoming - for the color calibration halfbreed v4 settings.
Koush - the original anykernel format
_motley - the zip file for the anykernel version for N4
jakejm79 - for testing various builds with various patches for me and giving me good feedback
veyka - for testing this build and confirming that he doesn't have data issues with it
socali - for his testing and research on the WiFi delayed notification issue.
 
Last edited:

thracemerin

Senior Member
Oct 19, 2011
5,458
5,764
Toronto
4.2.2 Version

Experimental WiFi Fix
Confused about all the fixes floating around? Maybe this will help: http://xdaforums.com/showpost.php?p=40432746&postcount=578
Date: April 15, 2013
Download: hsic_fix_nexus4_wlan_v6.zip
MD5: 8ba0f874efc894c8aaa2e115c5fe2438
See here: http://xdaforums.com/showpost.php?p=40340768&postcount=522

Revert Zip: wlan_revert.zip
MD5: 381013687035626bcb1cbaf609ea431
Note: Flash this if you have flashed any of the WiFi fix versions prior to switching to a different kernel.

Stable Version: (anykernel)
Date: March 04, 2013
Download (any kernel): hsic_fix_nexus4_4.2.2v1.zip
MD5: 17127c1ce03ce0489c49ed7377204a6c
Source: https://github.com/thracemerin/Mako (branch: jb-hsic-rel tag: release-v1)

4.2.1 Version (anykernel)
Date: Feb 04, 2013
Download (any kernel): https://hotfile.com/dl/192620778/4b1c43e/hsic_fix_nexus4_v2.zip.html
MD5: 22be4821f3c16087a04a8084cc0d5703
Source: https://github.com/thracemerin/lge-kernel-mako
 
Last edited:

veyka

Retired Forum Moderator
Oct 26, 2007
5,590
2,663
Norfolk
www.veyka.co.uk
With this test kernel I got 11min of hsic wakelock in 11h, which is very simular to what I get on harsh's kernel. (when I was trying it out last night)

I also had no data stuck issue, where as on previous attempts I was always able to reproduce the problem within a few min!

Just to be clear, these patches reduce the hsic wakelock by a lot, while preventing the issue where data would get "stuck", signal would show, but nothing would go in or out.

Edit: as well as fixing the hsic issue, these patches should also reduce power consumption while on mobile data, a general win/win.

Sods law states that the moment we truly have this under control, google will push 4.2.2 with all these fixes anyway ;)

Thanks a lot for bothering todo this!

Sent from my Nexus 4 using Tapatalk 2
 
Last edited:
  • Like
Reactions: renna1992

Bluewall

Senior Member
Apr 7, 2010
2,191
863
Sion
fr.miui.ch
Going to give it a try too, thanks for the work mate !

I'm wondering, does the CM team will merge these patches if all work properly ? I don't know the point of view of CM about CAF :)
 

thracemerin

Senior Member
Oct 19, 2011
5,458
5,764
Toronto
Going to give it a try too, thanks for the work mate !

I'm wondering, does the CM team will merge these patches if all work properly ? I don't know the point of view of CM about CAF :)

Well, a bunch of the fixes got pushed initially to the CM kernel, but were reverted because of the 3G data stalls, if this works out and 4.2.2 doesn't drop soon or doesn't fix the problem I'd consider resubmitting them to Gerrit, I would want some solid evidence that this works before I go through the trouble however.
 
  • Like
Reactions: Codrea and Bluewall

thracemerin

Senior Member
Oct 19, 2011
5,458
5,764
Toronto
Can you please post a flashable zip?

Sent from my Nexus 4 using xda app-developers app

I'll get on that later today.

In the mean time I had a few mins to repack it for stock, for the moment it's untested (my device is elsewhere atm), if you're brave feel free to try it, I'll post here later when I confirm it works unless someone beats me to it. Update: Confirmed Working
 
Last edited:

thracemerin

Senior Member
Oct 19, 2011
5,458
5,764
Toronto
I'll get on that later today.

In the mean time I had a few mins to repack it for stock, for the moment it's untested (my device is elsewhere atm), if you're brave feel free to try it, I'll post here later when I confirm it works unless someone beats me to it. Update: Confirmed Working

Any kernel version is now in post 2, I've confirmed that it works on CM, but I can't see why it wouldn't work on other ROMs. Big thanks to _motley for the zip file I used.
 
Last edited:
  • Like
Reactions: Codrea

jakejm79

Senior Member
Jan 29, 2010
1,053
152
What is the build date of the CM kernel, just so I can match it with the same date nightly
 

spncrmoo

Senior Member
Nov 12, 2010
116
68
Skipton
Re: [Kernel][GPL][anykernel][WIP] msm_hsic_host wakelock fix

On MinCo v6 + Franco kernel r34, the zip is giving me bootloops. Tried twice, once on a fresh install.


Sent from my Nexus 4 using xda app-developers app
 

thracemerin

Senior Member
Oct 19, 2011
5,458
5,764
Toronto
Re: [Kernel][GPL][anykernel][WIP] msm_hsic_host wakelock fix

On MinCo v6 + Franco kernel r34, the zip is giving me bootloops. Tried twice, once on a fresh install.


Sent from my Nexus 4 using xda app-developers app

Franco's kernel uses a non stock ramdisk which I gather from other threads is only compatible with his kernel, you will probably have to either flash the stockboot.img from here or use one of the reset kernels floating around the forums before flashing this.

Sent from my Nexus 7 using Tapatalk 2
 

Nebucatnetzer

Senior Member
Feb 4, 2011
5,820
6,598
Re: [Kernel][GPL][anykernel][WIP] msm_hsic_host wakelock fix

I haven't tested it fully yet but it really looks like I'm finally getting a normal deep sleep.
 

poofish

Senior Member
May 6, 2011
165
131
London
Sorry if this post is ignorant, but I just started using CyanogenMod for the first time having gotten a Nexus 4, and I'm not 100% familiar with it yet.

I've flashed your kernel and it is working great with no wakelocks, but will updating to the latest nightly flash the stock CyanogenMod kernel again? meaning I would to reflash yours? Not that it would be a problem given that I have the flashable zip, but just for future reference as to whether I need to reflash your kernel every time I update for nightlies.
 

Nebucatnetzer

Senior Member
Feb 4, 2011
5,820
6,598
Re: [Kernel][GPL][anykernel][WIP] msm_hsic_host wakelock fix

Yes you have to reflash everytime you flash a nightly.
 
  • Like
Reactions: poofish

Top Liked Posts

  • There are no posts matching your filters.
  • 66
    Hi Folks

    I have been trying to solve the msm_hsic_host wake lock problem without introducing the data drop/lockup issues that have been introduced into other kernels by adding the patches from code aurora.

    Disclaimer: The usual statements apply, I'm not responsible for your device being bricked, ebola outbreaks, nuclear war, etc... resulting from the use of this kernel, flashing this kernel should be done at your own risk, that being said I have been running various variations of this for the last few days without my phone having any issues.

    All Versions now in post 2 below.

    What's in this release?
    4.2.1 versions: Simply the CM stock kernel pulled from their github here: https://github.com/CyanogenMod/lge-kernel-mako with patches from CAF that I cherry-picked in an attempt to fix the msm_hsic_host wake locks without causing 3G data problems.
    4.2.2 versions: Stock AOSP pulled from the android-msm-mako-3.4-jb-mr1.1 repo at https://android.googlesource.com/kernel/msm/ with patches from CAF that I cherry-picked in an attempt to fix the msm_hsic_host wake locks without causing 3G data drops.

    What do I do if I get a data drop?
    Post here, be as detailed as possible, logs would be extremely helpful so I can see what's going on with your device, because these data drops seem to be somewhat random and don't affect everyone it's very difficult to actually reproduce them on another device on another network, as a result the more information you can give me the better.

    My WiFi drops while the screen off resulting in delayed notifications!
    To be clear, this is not the same issue, the issue with WiFi disconnecting while the screen off seems to be an Android 4.2.1 issue and exists on all kernels and even different devices running Android 4.2.1, this kernel doesn't do anything to address this issue, whether it fixes it or doesn't is entirely independent of the kernel. A potential fix for this is available from this thread: http://xdaforums.com/showthread.php?t=2072930 Note: It would appear that this hasn't been fixed in 4.2.2 despite Google claiming that it has been, the fixes outlined in that thread still work however. Possible Fix in Post 2

    The wakelock is reduced but my battery life is the same or not significantly improved
    Well, without these patches the wakelock keeps the phone awake, but if the screen is off and nothing else is going on the kernel is just waiting for the USB bus to suspend so the CPUs are either offline or at their lowest clock speed so they aren't likely using that much power. That being said there should be some improvement in battery life over a 100-0 drain cycle, how much will depend on factors that are mainly not kernel related (time on WiFi, 3G signal strength, apps syncing in the background, etc...).

    Wasn't this fixed in 4.2.2? My msm_hsic_host wakelock is way down.
    Yes and no, Google took 2 patches that were included in the set I was using on 4.2.1, these two fixes significantly reduced the msm_hsic_host wakelock while on WiFi but not really while on 3G. So, if you use WiFi primarily your msm_hsic_host wakelock will be reduced but if you use your phone primarily on 3G it will continue to be high, though probably lower than it was on the stock 4.2.1 kernel.

    Thanks to:
    LG - for making such an awesome device
    Google - for providing us with the AOSP sources
    CyanogenMod - I used their kernel as a base
    Code Aurora Forums - for solving the issue
    Harsh - for pointing me in the right direction on which CAF patches I was missing
    franciscofranco - additional CAF patches that might help
    molesarecoming - for the color calibration halfbreed v4 settings.
    Koush - the original anykernel format
    _motley - the zip file for the anykernel version for N4
    jakejm79 - for testing various builds with various patches for me and giving me good feedback
    veyka - for testing this build and confirming that he doesn't have data issues with it
    socali - for his testing and research on the WiFi delayed notification issue.
    24
    4.2.2 Version

    Experimental WiFi Fix
    Confused about all the fixes floating around? Maybe this will help: http://xdaforums.com/showpost.php?p=40432746&postcount=578
    Date: April 15, 2013
    Download: hsic_fix_nexus4_wlan_v6.zip
    MD5: 8ba0f874efc894c8aaa2e115c5fe2438
    See here: http://xdaforums.com/showpost.php?p=40340768&postcount=522

    Revert Zip: wlan_revert.zip
    MD5: 381013687035626bcb1cbaf609ea431
    Note: Flash this if you have flashed any of the WiFi fix versions prior to switching to a different kernel.

    Stable Version: (anykernel)
    Date: March 04, 2013
    Download (any kernel): hsic_fix_nexus4_4.2.2v1.zip
    MD5: 17127c1ce03ce0489c49ed7377204a6c
    Source: https://github.com/thracemerin/Mako (branch: jb-hsic-rel tag: release-v1)

    4.2.1 Version (anykernel)
    Date: Feb 04, 2013
    Download (any kernel): https://hotfile.com/dl/192620778/4b1c43e/hsic_fix_nexus4_v2.zip.html
    MD5: 22be4821f3c16087a04a8084cc0d5703
    Source: https://github.com/thracemerin/lge-kernel-mako
    13
    So can I understand something properly regarding the msm_hsic wakelock? The issue is taht we're seeing high kernel wakelocks but this is not being reflected in partial wakelocks correct?

    So for example over 1 hour of screen off, I'll have 10 minutes of awake time. Usually, checking WLD or BBS, I'll see partial wakelocks of 1-2 minutes total from Gmail, Whatsapp, etc. But it seems most of the 10 minutes comes from msm_hsic. Is this the problem we're all talking about?

    I haven't really been observing the deep sleep time on my phone until recently, but then what constitutes an actual fix? If the awake time finally equates to the total partial wakelock time? And that the kernel wakelock time isnt' excessive for msm_hsic?

    The Nexus 4 has a hardware flaw in that the SoC used is actually a tablet SoC and not a phone SoC, as a result the cellular modem is attached to a USB bus. The msm_hsic host wakelock is held when this bus is active which happens anytime the phone needs to use the cellular modem, on some of the original firmware (4.1.x & 4.2.x specifically) there was an issue where when the phone went into suspend the msm_hsic host controller wouldn't suspend resulting in an extremely long wakelock for no reason, this has been corrected for the most part in 4.3. Keep in mind that the cellular modem has to be active a lot even on WiFi to ensure that you get proper tower information from your provider so that when you receive a phone call your phone actually rings, the wakelock will be increased while on 3G since all the data transactions also have to happen over cellular radio, it will also be increased if you are travelling while on 3G since it has to handle tower handoffs, etc... these things are handled better by SoCs that have internal modems, but the current state of the N4 as it relates to this issue is about as good as you can expect given the hardware limitations, any attempt to make it better would likely result in data drops or connectivity issues.

    Sent from my Nexus 7 (flo) using Tapatalk 4
    11
    New Build :victory:

    Prima v3.2.3.92a because v3.2.3.93 wouldn't build because of changes they made for 802.11ac which isn't supported by our device, I'll have to squash the build errors for that later.

    Anyway, this one is anykernel again, so you don't have to figure out which version to flash, all the previous comments about highly experimental, make a backup, etc... still apply. If you used my previous stock versions and your ROM supported init.d you probably noticed it was disabled, reflash your ROM first to fix this, it shouldn't happen again now that we're back to anykernel.

    Date: April 1, 2013
    Download: hsic_fix_nexus4_wlan_v3.zip
    MD5: 8cfe92dc2ddb1e8e506d5017c4fe0a2b

    Note: If you were on v1, you probably didn't notice if you didn't go to my github, but it wasn't actually v3.2.2.2 so I removed the links earlier, I would strongly recommend either v2 or v3 if you are still on v1, sorry for the confusion about that.

    A super special thanks to all the folks over at Code Aurora Forums for all the superb work they do, without them there would be no fix available.

    Happy flashing!
    11
    Testing a new wifi fixed version with the very latest prima drivers (v3.2.3.90), assuming I can't find anything wrong I will post this version later today for comparison with the older version of the wifi fix.