Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,782,554 Members 36,094 Now Online
XDA Developers Android and Mobile Development Forum

[PATCH] [Kernel] The spontaneous reboot (solution?) thread

Tip us?
 
toadlife
Old
(Last edited by toadlife; 8th December 2011 at 09:26 AM.) Reason: updated link to new github
#1  
toadlife's Avatar
Recognized Developer - OP
Thanks Meter 1,015
Posts: 1,202
Join Date: Aug 2008
Location: Lemoore, CA

 
DONATE TO ME
Default [PATCH] [Kernel] The spontaneous reboot (solution?) thread

I've been getting occasional random reboots EI22, and I've seen reports in the general forum of the same.

There seem to be two main causes of reboots:


WIFI Related (bcm4329 DHD Bus Module TX Queue overflow)

The reboots always happen when WIFI is on. The system will freeze up hard for about 10-15 seconds and then just reset. The LAST_KMSG file shows 60KB of nothing but the following:

Code:
[ 5315.816399] dhd_bus_txdata: out of bus->txq !!!
[ 5315.820979] dhd_bus_txdata: out of bus->txq !!!
[ 5315.825411] dhd_bus_txdata: out of bus->txq !!!
[ 5315.829922] dhd_bus_txdata: out of bus->txq !!!
[ 5315.834499] dhd_bus_txdata: out of bus->txq !!!
[ 5315.838929] dhd_bus_txdata: out of bus->txq !!!
[ 5315.843505] dhd_bus_txdata: out of bus->txq !!!

OneDram driver related reboots


After patching the WIFI related bugs I started to get these more often. Here is an example of the log leading up to the reboot.

Code:
[   13.319028] [OneDRAM](dpram_write) Failed to get a Semaphore. sem:0, PHONE_ACTIVE:HIGH, fail_cnt:1
[   13.339579] [OneDram] dpram_drop_data, head: 319, tail: 319
[   13.351715] [OneDRAM](dpram_write) Failed to get a Semaphore. sem:0, PHONE_ACTIVE:HIGH, fail_cnt:1
[   13.366965] [OneDram] dpram_drop_data, head: 319, tail: 319
[   13.379178] [OneDRAM](dpram_write) Failed to get a Semaphore. sem:0, PHONE_ACTIVE:HIGH, fail_cnt:1
Another log sample from a reboot, right before it restarts...
Code:
[   11.585629]
[   11.585665] dpram_shutdown !!!!!!!!!!!!!!!!!!!!!
[   11.590957]
[   11.590986] dpram_shutdown ret : 0
[   11.598695] Restarting system.
[   11.600629] KERNEL:magic_number=0 CLEAR_UPLOAD_MAGIC_NUMBER
[   11.608974] arch_reset: attempting watchdog reset
For the WIFI issue, I searched and found a set of patches on the linux driver project mailing list that address this issue.

See: http://driverdev.linuxdriverproject....ch/012948.html

After applying the patch verbatim I still got the WIFI related reboots, so I slowly pushed the TXQLEN values up until the reboots stopped. Here is the commit from my github that contains the patch that seems to have done the trick.

As for the OneDRAM related reboots, I think I may have found the solution to these too. The problem seems to have gone away when I switched the specific ARM toolchain that is mentioned in the Samsung kernel source README. Previously I was using the 4.4.x toolchain from Googles repo. Thanks to Earthbound for working with me on this one. Aside from Earthbound (he uses the recommended Codesourcery one), I don't know what toolchains others use, but I do know that I have not had one reboot in the four days since switching to the CodeSourcery toolchain.

Here is a kernel (source) with the WIFI fix that was compiled with the 2009-q3-68 toolchain. Aside from the WIFI fix, the kernel contains the following features:


  • root/su/busybox
  • init.d script support
  • bootanimation.zip support
  • overclock to 1.4/voltage control
  • keyboard delay fix
  • ext4/rfs support
  • CWM5/ROM Manager support (reboot bml8 recovery)

If you are having WIFI or dpram/onedram related reboots, you might want to give this kernel a try and report back.

NOTE: If you overclock or over/under volt please stop doing so if you want to test this kernel and post logs.
Verizon Samsung Galaxy S4 (SCH-I545)

My ROM for the TP2, and for the Wing
The Following 7 Users Say Thank You to toadlife For This Useful Post: [ Click to Expand ]
 
thomasskull666
Old
#2  
thomasskull666's Avatar
Senior Member
Thanks Meter 415
Posts: 1,552
Join Date: Sep 2010
Location: St. Louis

 
DONATE TO ME
Interesting I'll have to try it out, thanks for this!

Sent from my SPH-D700 using XDA Premium App
*_Epic 4G_*
*_Sprint Galaxy Nexus_*
 
AproSamurai
Old
#3  
AproSamurai's Avatar
Recognized Developer
Thanks Meter 1,186
Posts: 1,662
Join Date: Jul 2010
Location: Van Nuys, CA
Thanks for this. Just need an EI22 branch now hehe.

Sent from my Epic 4G
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Devices Owned: Sprint Samsung Moment, Epic 4G, Galaxy S3, HTC One m8
[My GitHub] [My Twitter]
 
mjben
Old
(Last edited by mjben; 23rd November 2011 at 09:30 AM.)
#4  
Senior Member
Thanks Meter 46
Posts: 425
Join Date: Nov 2010
Location: Manitowoc
I've experienced a few ramdom freezes and reboots lately even when overclocked to previously stable frequencies- ever since I successful ran with 1.5ghz enabled for two minutes.

I gave this a go, and overclocked to 1.4 and my phone went into a reboot loop- the rom booted up, but would freeze and reboot shortly afterwards.

I'm stable again now after running the VC cwm zip to restore settings to 1ghz.

Is there any useful feedback I could provide? Some sort of log or something?

Sent from my secret underground bunker
 
toadlife
Old
#5  
toadlife's Avatar
Recognized Developer - OP
Thanks Meter 1,015
Posts: 1,202
Join Date: Aug 2008
Location: Lemoore, CA

 
DONATE TO ME
I just got another reboot...same issue.

So much for that!!

This bug is defintely causing the reboots though.
Verizon Samsung Galaxy S4 (SCH-I545)

My ROM for the TP2, and for the Wing
 
toadlife
Old
#6  
toadlife's Avatar
Recognized Developer - OP
Thanks Meter 1,015
Posts: 1,202
Join Date: Aug 2008
Location: Lemoore, CA

 
DONATE TO ME
Quote:
Originally Posted by mjben View Post

Is there any useful feedback I could provide? Some sort of log or something?
The system keeps logs in /data/system/dropbox

After a reboot the file with a name like " SYSTEM_LAST_KMSG@xxxxxxxxxxxxxx.txt.gz" will contain a copy of the last system log buffer before your phone restarted.


But like I said I just got another reboot. I ran a speedtest over wifi using the speedtest.net app just before my last two reboots so I might be onto a way of triggering the bug.
Verizon Samsung Galaxy S4 (SCH-I545)

My ROM for the TP2, and for the Wing
 
toadlife
Old
#7  
toadlife's Avatar
Recognized Developer - OP
Thanks Meter 1,015
Posts: 1,202
Join Date: Aug 2008
Location: Lemoore, CA

 
DONATE TO ME
I'm going to continue working on this. I'm experimenting with larger and smaller TXQLEN values.

Right now running with a TXQLEN of 4096 instead of 2048. It may be that larger is not better; that I needed to go smaller.

I'll keep my github updated.
Verizon Samsung Galaxy S4 (SCH-I545)

My ROM for the TP2, and for the Wing
 
ugothakd
Old
#8  
Senior Member
Thanks Meter 406
Posts: 1,485
Join Date: Jun 2011
Location: O 'Fallon, MO
So how was this different then froyo? Or did the tab ever have reboots?

sent from my always aosp epic
 
darkierawr
Old
#9  
darkierawr's Avatar
Senior Member
Thanks Meter 910
Posts: 1,514
Join Date: Feb 2011
Excellent work!

I'd jump all over this but I stopped getting them after IAP 1.0.5+.

If they start up again I will report back.
 
SenseiSimple
Old
(Last edited by SenseiSimple; 23rd November 2011 at 09:26 PM.)
#10  
SenseiSimple's Avatar
Senior Member
Thanks Meter 546
Posts: 340
Join Date: Jun 2008
Location: Austin, TX

 
DONATE TO ME
the only time i have experienced this particular reboot concerning wifi, was having wifi + 4g enabled at home after a dalvik cache wipe (where the phone starts up, 4g starts first, then wifi simultaneously gets on LAN - both icons are showing, locks up - then reboot) once it restarts, it's all ok, wifi starts first, and doesn't happen again.

(running IAP samurai 1.0.4)


Epic 4G SleeperROM FC09 - Stock Looks All Performance feat. ShadowKernel

Bash 4.1 Default Shell Environment

Contribute to a Mt. Dew! $1 at a time

OR maybe boost my ego, why not, and hit the thanks button if i helped you!
Either = warm fuzzy!


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes