Other than XDA (of Course), What’s Your Favorite Site That Covers Android?

There is a number of other great sites that cover … more

Introducing Voices of XDA: Have Your Ideas Heard

By far the greatest assets we have at XDA-Developers are you, the developers, the eager … more

Unofficial Xposed For Lollipop Touchwiz With Flashable Zip

XDA Recognized Developer arter97 has released an unofficial build … more

YotaPhone 2 Pre-Order, Xperia Z1 Price Cut – XDA TV

Android Wear 5.1.1 OTA downloads are now available. That and much more news is … more
Post Reply Subscribe to Thread Email Thread

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

23rd November 2011, 07:36 AM |#1  
toadlife's Avatar
OP Recognized Developer
Flag Lemoore, CA
Thanks Meter: 1,016
Donate to Me
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:

[ 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.

[   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...
[   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.


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
  • 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.
Last edited by toadlife; 8th December 2011 at 09:26 AM. Reason: updated link to new github
The Following 7 Users Say Thank You to toadlife For This Useful Post: [ View ]
23rd November 2011, 08:00 AM |#2  
thomasskull666's Avatar
Senior Member
Flag St. Louis
Thanks Meter: 415
Donate to Me
Interesting I'll have to try it out, thanks for this!

Sent from my SPH-D700 using XDA Premium App
23rd November 2011, 08:39 AM |#3  
AproSamurai's Avatar
Recognized Developer
Flag Van Nuys, CA
Thanks Meter: 1,189
Thanks for this. Just need an EI22 branch now hehe.

Sent from my Epic 4G
23rd November 2011, 09:15 AM |#4  
Senior Member
Flag Manitowoc
Thanks Meter: 46
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
Last edited by mjben; 23rd November 2011 at 09:30 AM.
23rd November 2011, 09:38 AM |#5  
toadlife's Avatar
OP Recognized Developer
Flag Lemoore, CA
Thanks Meter: 1,016
Donate to Me
I just got another reboot...same issue.

So much for that!!

This bug is defintely causing the reboots though.
23rd November 2011, 09:45 AM |#6  
toadlife's Avatar
OP Recognized Developer
Flag Lemoore, CA
Thanks Meter: 1,016
Donate to Me
Originally Posted by mjben

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 app just before my last two reboots so I might be onto a way of triggering the bug.
23rd November 2011, 07:35 PM |#7  
toadlife's Avatar
OP Recognized Developer
Flag Lemoore, CA
Thanks Meter: 1,016
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.
23rd November 2011, 08:53 PM |#8  
Senior Member
O 'Fallon, MO
Thanks Meter: 406
So how was this different then froyo? Or did the tab ever have reboots?

sent from my always aosp epic
23rd November 2011, 09:15 PM |#9  
darkierawr's Avatar
Senior Member
Thanks Meter: 910
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.
23rd November 2011, 09:22 PM |#10  
SenseiSimple's Avatar
Senior Member
Flag Austin, TX
Thanks Meter: 546
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)
Last edited by SenseiSimple; 23rd November 2011 at 09:26 PM.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes