yashsingh1/xdaforums huggingface dataset:
[Defy Android Development] :
Quarx.. Im not impressed.. you are always stoping the previous version of android and starting the new one which gives you tons of problems more to solve

LISTEN ME! Quarx won't stop untill he develops Roms faster than google, he will give us Android OS 5 in our Defy before Google even launches it..

Im in many devices around xda, and I think this is the most talented Dev all around xda (without knowing them all, considering what he gives to our device + difficulties it has with it.. since being a Dev for a Nexus won't give as much as problems ^^)

IM A PROUD USER OF MY DEFY PHONE ONLY THANKS TO YOU QUARX!
[Defy Android Development] mikrom.cz:
Re: [JB+][3.0.8 kernel] CM10.1 Android 4.2.2 for the Defy(+)

Sorry, but I have no luck with your kernels :) every time I have no wifi/phone signal or black screen.

I just try 3.x and black screen with red led.

Never mind, I believe that one day I will have luck :)
[Defy Android Development] maury1234:
I'm sorry to say friend, this problems are stated already in the first post :p there are bugs to be solved still :)

Anyways, Thank you Quarx! For all your hard work at porting this relatively new kernel to the Moto Defy!!!
[Defy Android Development] Kayant:
Re: [JB+][3.0.8 kernel] CM10.1 Android 4.2.2 for the Defy(+)

I don't think he has much of a choice when he does it..... We have to remember he is always working with outdated libs and drivers and kernel since after GB.... But now with the 3.0 kernel and Quarx being able to use more open source stuff

I think this time we might have the most complete device tree meaning to the most complete experience to date just look at the things that are current already working ;)

Personally what we have right now I will consider complete (4.1.2 that is) as it does everything I want it to do and more :)

Let's Go ^_^
[Defy Android Development] YaPeL:
That's a joke right? don't play with our hearts quarx
[Defy Android Development] Alchedin:
Nah, just take a look at his activity. I have a Milestone 2 and even I am checking his GIT 5 times a day. :fingers-crossed:

Love the dude's work, so I even donated for his work and out of respect :good:

Specified commit regarding FM support (correct me if i'm wrong)
[Defy Android Development] YaPeL:
Google "FM-TX" to see what I mean.
[Defy Android Development] TJKV:
Re: [JB+][3.0.8 kernel] CM10.1 Android 4.2.2 for the Defy(+)

Top result:

http://en.wikipedia.org/wiki/Flower_Mound,_Texas

:P

But seriously... How in the world is that possible?
[Defy Android Development] YaPeL:
Re: [JB+][3.0.8 kernel] CM10.1 Android 4.2.2 for the Defy(+)

Well, the omap can do it, but our defy lacked the necessary hardware, probably a joke by quarx :p
[Defy Android Development] drunk_ryder24:
made some experiments with kernel 3.1 and i got rid of asm errors but encountered another one(like i am playing minesweeper with this project),here's the console raw data:

1.

cata894@cata894-VirtualBox:~$ cd test-3.1

2.

cata894@cata894-VirtualBox:~/test-3.1$ export ARCH=arm

3.

cata894@cata894-VirtualBox:~/test-3.1$ export SUBARCH=arm

4.

cata894@cata894-VirtualBox:~/test-3.1$ export CROSS_COMPILE=/home/cata894/android-ndk-r8d/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-

5.

cata894@cata894-VirtualBox:~/test-3.1$ make mapphone_defconfig

6.

#

7.

# configuration written to .config

8.

#

9.

cata894@cata894-VirtualBox:~/test-3.1$ make menuconfig

10.

scripts/kconfig/mconf Kconfig

11.

#

12.

# configuration written to .config

13.

#

14.

15.

16.

*** End of the configuration.

17.

*** Execute 'make' to start the build or try 'make help'.

18.

19.

cata894@cata894-VirtualBox:~/test-3.1$ make -j2

20.

scripts/kconfig/conf --silentoldconfig Kconfig

21.

CHK include/linux/version.h

22.

CC scripts/mod/empty.o

23.

MKELF scripts/mod/elfconfig.h

24.

HOSTCC scripts/mod/file2alias.o

25.

HOSTCC scripts/mod/modpost.o

26.

HOSTCC scripts/mod/sumversion.o

27.

HOSTLD scripts/mod/modpost

28.

CHK include/generated/utsrelease.h

29.

make[1]: `include/generated/mach-types.h' is up to date.

30.

CC kernel/bounds.s

31.

GEN include/generated/bounds.h

32.

CC arch/arm/kernel/asm-offsets.s

33.

GEN include/generated/asm-offsets.h

34.

CALL scripts/checksyscalls.sh

35.

GEN usr/initramfs_data.cpio

36.

AS usr/initramfs_data.o

37.

LD usr/built-in.o

38.

CC init/main.o

39.

CC arch/arm/vfp/vfpmodule.o

40.

AS arch/arm/vfp/entry.o

41.

AS arch/arm/vfp/vfphw.o

42.

init/main.c: In function 'do_basic_setup':

43.

init/main.c:729: error: implicit declaration of function 'shmem_init'

44.

make[1]: *** [init/main.o] Error 1

45.

make: *** [init] Error 2

46.

make: *** Waiting for unfinished jobs....

47.

CC arch/arm/vfp/vfpsingle.o

48.

CC arch/arm/vfp/vfpdouble.o

49.

LD arch/arm/vfp/vfp.o

50.

LD arch/arm/vfp/built-in.o

51.

cata894@cata894-VirtualBox:~/test-3.1$

any help would be useful
[Defy Android Development] Blechd0se:
Hello guys,

i wanted to share some information here about trim. Many of you encountered problems with my new kernel, however i have seen no

useful log (its not your fault, i just had to point out how to give logs properly).

I spend a lot of time debugging it and figuring out why it works for some and for some not.

Here is my kernel log, in case you want to see/learn something about that.

My investigation is, that trim only crashes on startup. In the first ~2 minutes the system load is around 100%, if the discard option

is enabled or if trim gets executed in this window its likely that the kernel crashes (see log how exactly).

I went through all upstream patches and merged them in, however this couldn't fix the problem.

So i am assuming there must be some deadlock/race condition in those 2 minutes where trim tries to access /data while

another process tries exactly the same.

So i decided to write my own patch for this; patch on github

Now the funny things; trim works now on bootup for me, no crashes / no kernel panic,

however while its trimming you shouldn't interact with the device itself to be sure.

Actually this might be a huge deal, have a look at the current mainline kernel here .

It doesn't seem that its fixed there. This either means my patch won't work or they fixed it otherwise or (and thats the point)

it isn't fixed on upstream. If its the last case this could be my first contribution to upstream.

I just wanted to share this (since its a development thread after all) and want to hear some thoughts about this (developers are welcome!).

I don't know if this fixes everything, i have tested it only on 4.2 with the method mentioned above.

Maybe someone might have some ideas about that. Any feedback is highly appreciated! :)
[Defy Android Development] niksy+:
Blechd0se, I can only confirm what you said... I've experienced reboots when trying to use the phone right after booting (while it's still loading widgets in the launcher, for example), but I failed to acquire the last_kmsg log :/ I'm on 4.3 (CM10.2, the 31st of August build by carlo)

Other than that, the fstrim command in Terminal worked fine for me, so I guess trim is working fine (on my phone) except that problem with the possible deadlock.

Could you create a .txt file with the list of the logs (along with a short how-to on getting them) that we can (and should) provide and put it up on your site?
[Defy Android Development] Blechd0se:
Yes i can do some sort of how to debug on the defy, at least the very basic steps :)

Will do this tomorrow. I can also release another kernel to test my changes, if desired.

This will also include some performance updates on ext4 driver and trim :)
[Defy Android Development] niksy+:
Both the guide and the new kernel nightly are very welcome :o But take your time, of course :)
[Defy Android Development] atulclassic:
toggling airplane mode helped me resolving deep sleep issue..thanks buddy!!!

---------- Post added at 10:52 AM ---------- Previous post was at 10:25 AM ----------
[Defy Android Development] ccav2000:
Slight OT, [MENTION=513620]Quarx[/MENTION] just stated in Facebook that he will resume development soon, as soon as he has access to his development PC again.

---------- Post added at 08:47 AM ---------- Previous post was at 08:34 AM ----------

Yep, I did notice on your GitHub. On a personal note, I will soon move again to CM10.1 (maybe even today), since the DEFY will become my secondary device (ordered a new device already). So I will be able to test things more freely, having the DEFY as primary restricts me a lot to how far I can go, since I absolutely need it to work. Waiting for a test kernel now!
[Defy Android Development] overclockthesun:
[MENTION=4855459]Blechd0se[/MENTION] I agree. as you may have seen from my screenshots, trim works now.

But I tried various combinations to get back my error and this is what I found.

TRIM will not work for me "if" and if only I flash to JB 4.2 directly from Froyo (SEA in my case).

But if I first flash CM7.2 and then flash JB over it ...perfect :) It does work perfectly. Oh and even I noticed that if the cpu is under load the system crashes and reboots abruptly. Ditto for doing any other work while TRIM is running. Just opening file manager caused a crash for me.

I can provide logcats but unfortunately all my previous logs are lost. For some strange reason my sdcard got corrupted 3 times in last 3 days. Thats maybe because I am trying to get the Swap partition working.

One question Blech, does TRIM invoke itself automatically by some parameters or do we have to always run it manually in terminal.
[Defy Android Development] Anton111111:
Oh! my data was corrupted today after reboot. Can i recover data or data is corrupted at all ?

P.s. i don't use swap
[Defy Android Development] cyrusct82:
Has anyone thinked that those data losses are from ext4 format. I'm on ext3 and never got a data loss.

Every time I formatted to ext 4 I've got boot loops and problems like apps FC.
[Defy Android Development] Anton111111:
I don't format to ext4
[Defy Android Development] hotdog125:
I got data corruption at uptime approx. 24-32 hours atleast 3-4 times with 31.08 kernel. No such problem on 25.08 kernel.
[Defy Android Development] Anton111111:
My data was corrupted on 25.08 kernel.
[Defy Android Development] hotdog125:
This data corruption has not been fixed i guess. Blechd0se and Quarx are trying hard to fix it while bringing new features.:)

I take a backup every 2-3 days (only data) to avoid losing out on data.
[Defy Android Development] Anton111111:
I've made small research and i found soft for recovering data:

http://www.r-studio.com/

It's still working but i see that many of data is recovered successfuly ;)
[Defy Android Development] overclockthesun:
Just use File recovery from Seagate. It has saved my behind many times Perfect recovery software ...right upto directory structures.
[Defy Android Development] Anton111111:
i recover all data and copy to PC. Then format sd and copy files to sd back. But now defy don't boot with sd. If i remove sd it boot successfully.

With SD i only see red M and i can't start boot menu :(
[Defy Android Development] trurl3:
Try to reformat SD and boot your Defy with empty SD card. I'm affraid recovered data are not suitable...
[Defy Android Development] hotdog125:
I tried decompiling SystemUI.apk to mod it. I got errors decompiling only on CM10 and CM10.1 quarx build. Unofficial builds and other ROMs based on CM could decompile with no problem. What could be wrong?

The log-
[Defy Android Development] thekguy:
Copy framework-res.apk from build to the directory, and before decoding run the command "apktool if framework-res.apk"

Try in a new directory as well, copying only apktool and necessary files to it.

What exactly are you modding?
[Defy Android Development] hotdog125:
That's the first thing I tried after I got the error. Still didn't work. I wanted to mod the clock in the status bar to show seconds.

What's weird is that it decompiles fine on sunnyqeen's and carlo93's builds and other ROMs based on CM.
[Defy Android Development] thekguy:
Following the exact steps, I have modded transparency for the latest cm10.1 build without this issue. You have tried in a new directory right? And try cross checking the apk itself. If it doesn't work send me the modification and both framework and systemui, I'll compile it(have some free time tomorrow)
[Defy Android Development] Blechd0se:
Shipping out a new kernel release. This contains many patches for trim in general and the one i was talking about recently.

I did many tests and couldn't crash the kernel anymore, hope you'll see an improvement!

Don't forget to don't interact with the device while its trimming.

Since it's only some sort of bugfix update i am only uploading the cm10.1 release. I put a small guide on my server with the topic

on how to make better bug reports (i will extend this in the future).

Let's just hope no new bugs will raise up and welcome Quarx back with a slightly smarter kernel ;)
[Defy Android Development] measel:
[MENTION=4855459]Blechd0se[/MENTION] Do you think its possible to include the usb host mode patch by slugzero in future versions? It probably needs much more testing but it would be an awsome addition and might give the defy a second life for people who already moved on but need a display for their mobile drive.... (not me unfortunately,yet)
[Defy Android Development] justjr:
Can you please release it for CM10.2?

We cant use your last kernel cause we are crashing and loosing data... I would really like to update to that new kernel and help with testing.

Thank you!
[Defy Android Development] Blechd0se:
You can simply replace the zImage in this release with the last one and flash it. Should work.

Kernel is the same for CM10.1 and CM10.2, the ramdisk is different.

[MENTION=3490474]measel[/MENTION] I am not sure, i can't test it. If he makes a pull request i can merge it. :)
[Defy Android Development] darkvier:
@Blechd0se the lastest kernel works well for me with the fstrim - v /data

Should i make a swap partition?
[Defy Android Development] slimshady76:
I'm getting a "file damaged" warning when I try to open the last kernel's zip file to replace the zImage with WinRAR. Downloaded the file several times, on two computers and my Defy with the same results. Any chance the zip file is damaged?
[Defy Android Development] justjr:
Worked fine at first here.
[Defy Android Development] Antiga Prime:
It's most likely your internet connection, not necessarily the computer used for the download. Also, I'd replace the file with 7zip; WinRar sometimes screws these things up and the file can't be flashed.
[Defy Android Development] slimshady76:
Yup, ended up with an infinite bootloop after flashing the new kernel with 8/31's CM10.2 ramdisk...

I'll try with 7Zip next.
[Defy Android Development] Anton111111:
How about cm10 version ?
[Defy Android Development] fairxda:
Hi Blechdose!

You mentioned "trimming".

So I thougt I could do it manually too with "fstrim -v /data".

But maybe I am wrong, because the "answer" is: "applet not found".

Now the defy+ runs the new kernel since one hour without directly rebooting as before; (only once directly after installing the kernel).
[Defy Android Development] Blechd0se:
Not going to happen, have no time for this at the moment and i need feedback if trim

is fixed or not, sorry :)

Hello :)

This is the output from terminal? Which busybox version are you using?

No freezes/random reboots? No kernel panics?

Send from my Nexus 4
[Defy Android Development] fairxda:
BusyboxPro is 1.21.1 and yes: until now no freezes, no random reboots (only as I said directly after the first boot after installing the kernel one soft-reboot) and no kernel panics.

And smooth and fast ...

Edit: Oh, ups, I forgot to mention that I am running on 4.3 with the zip slimshady made from your kernel. Maybe there is the fault.

Pardonnez moi ...

fstrim was found unter /system/xbin ..., but running with full path the same answer as before.
[Defy Android Development] ccav2000:
Sorry to spoil the party but the new kernel causes random hard reboot a little after the device enters deep sleep. As I am in CM10.1 now I can use the fstrim command successfully, but when I use it I see some error in dmesg, says "BUG: ext4_fstrim scheduling while atomic". My guess is that the system tries to turn off the screen and suspend while the trim is still ongoing and this error is triggered. But at least this is not causing a crash.

So currently I still cannot the discard option, but at least I can do a manual trim.
[Defy Android Development] cyrusct82:
One question for TRIM to work perfectly we have to format the data and cache to EXT4 from boot menu or do we have to use only the wipe option (I use the fast wipe zip EXT3).
[Defy Android Development] ccav2000:
Whenever I need to format /data I just do it from the bootmenu in ext4. Only a few times when I was testing [MENTION=4855459]Blechd0se[/MENTION]'s previous kernel my /data partition became so corrupt that I had to format it first in the Stock recovery and then to ext4 in bootmenu.
[Defy Android Development] Blechd0se:
Did you interact with it while it was still trimming?

Furthermore can you provide me a log with this error and the steps so i can reproduce it?

Do you have discard disabled?

As i said, just run trim and don't let the device do anything. After its completed you don't have to rerun it (only after a reboot)

Doesn't really matter. I have added to ability to load ext3/4 with the ext4 driver for

some additional performance.

Send from my Nexus 4
[Defy Android Development] ccav2000:
[MENTION=4855459]Blechd0se[/MENTION] no, I have discard disabled because it leads to guaranteed hard reboot. To reproduce, just make sure you have the screen timeout set to 30 seconds, and just trim. That's all I did, I didn't touch it while it was working, and it was already idle with all networks off for more than 10 minutes. I'll try to get a log later when I'm at home and have some time.
[Defy Android Development] Blechd0se:
Hmm thats to much. With no interaction i mean really no interaction. Not even display off during that time. :cyclops:

Maybe log isn't even needed anymore, but feel free to post it on pastie.org anyway.

The problem is; to fix the kernel crash i locked the trim process. If the device wants to sleep in that very moment the scheduler

gets confused and produces the error you did get. I may have to work again on this patch and add some sort of check if its

sleeping. I guess it gets only triggered if you manually fire the trim command.

Can you get me a log about this discard thing (look at my server for how to grap it)?

Otherwise i won't be able to fix it :)
[Defy Android Development] ccav2000:
Ok, I'll try to log the issue with discard if there's a way to capture the log even though it hard reboots. I'll look on your guide for help.

---------- Post added at 02:32 PM ---------- Previous post was at 02:26 PM ----------

I just read your guide, it's very easy actually. You'll have a log by tonight, assuming the kernel sends anything to kmsg before causing the reboot.
[Defy Android Development] fairxda:
Strange. Manually rebooting I got a black/blank screen for minutes. Pulling battery and restarting all was allright again!

Tried to reproduce, but again a clean reboot then.

So I only can give you a little logacat because unfortunately the adb shell got a connection not before my defy+ was already booted.

Manually running fstrim get no reaction in ksmg looking with cat /proc/ksmg.

The logcat running fstrim manually i attached.
[Defy Android Development] Blechd0se:
Many errors caused by SELinux, kind of normal on a 4.3 ROM, but very strange behaviour.

Btw little logcat = good logcat (easier to read)!

I guess i have to fix a lot of stuff with selinux, although i don't like it. I just want to get rid of those messages.

No reaction in kmsg means no errors, which is good :)

About "applet not found" i spent 1 minutes researching; link
[Defy Android Development] fairxda:
But I got again "applet not found" ... as I run fstrim manually ...

I told this because of that there were no reaction in kmsg ...
[Defy Android Development] ccav2000:
[MENTION=4855459]Blechd0se[/MENTION] haven't been able to reproduce the hard reboot as long as USB is connected in order to use ADB, the only abnormal things I noticed I logged here. Something is fishy with mmcblk1, but I do not understand what is it, since it does not appear to be mounted anywhere.

Anyway, as I suspect the hard reboot issue happens only when the device enters true deep sleep, and having anything connected in USB prevents deep sleep. Now what?

EDIT: Found how to connect ADB over TCP/IP (using the WiFi ). Let's see if that will help things.

EDIT2: It did help, device froze while sleeping, here's what I managed to get http://pastebin.com/Hv58jEUA I will try now with more buffer in my console as soon I revive the DEFY, after this it doesn't boot, probably /data was destroyed again :(

The most interesting thing I saw is this:

<0>[ 1585.630035] Kernel panic - not syncing: Fatal exception
<0>[ 1585.630035] Phone id:a0200051606f03
<3>[ 1585.630218] sched: BUG: scheduling while atomic: mmcqd/684/0x40000004
[Defy Android Development] Blechd0se:
Thanks, unfortunately i think both logs show everything after the main exception. Aren't there any entries before those logs?

If you take a look at my example here there are similiar

entries, however, the only interesting line(s) is/are;

<2>[ 226.059265] EXT4-fs error (device mmcblk1p25): Error in loading buddy information for %u:
...
<4>[ 226.061553] [<c013cd1c>] (ext4_trim_fs+0x188/0x27c) from [<c0128348>] (ext4_ioctl+0x7f8/0x89c)

If you scroll even further you see nearly the same as provided in your logs. Because of that the parts before this error

are crucial :)

In theory its not only if the hole device is sleeping, but rather if only a single process that is involved in those operations tries to sleep.

I always debug with USB, therefore i can understand that discard/trim always worked for me and for you too (if plugged in).

Thank you anywas, this is more precisely than most bug reports ;)

And to be sure; this only happens if trim/discard gets executed without USB at boot as long as the CPU is under heavy pressure or even after a couple minutes uptime with USB connected?
[Defy Android Development] ccav2000:
I am about to try with my terminal set for 999 lines of buffer instead of the default 50 that it was before (I'm doing this in windows...). So I will have a longer log for you in the next 30 minutes.

As to when this happens: the device was connected via USB for like 30mins, so the CPU had no pressure at all. Then I enabled the WiFi, found how to connect ADB via WiFi, and when I was ready I just unplugged USB. It took about 2 minutes after that for the panic to happen. I did not execute a manual trim, this happened because of the "discard" option in RAMDISK, I have this problem in every kernel with trim support if discard is enabled.

EDIT: To be clear: the only thing USB affects is Deep SLeep. If it us unconnected, the panic happens soon after boot. It has no other effect, if you keep it connected it just delays (or even avoids) what will happen anyway the moment you allows the device to enter it's usual Deep Sleep mode.

---------- Post added at 05:49 PM ---------- Previous post was at 05:14 PM ----------

[MENTION=4855459]Blechd0se[/MENTION] I believe I managed to get the exception this time: have a look at the beginning of this: http://pastebin.com/pycjzpa2

A rather nasty NULL pointer dereference, I also don't like the I/O errors. In any case, this doesn't happen if I use the ramdisk without discard, so it is directly connected to it.
[Defy Android Development] fairxda:
I could reproduce the black/blank screen after a manually reboot.

This time the connection to adb was at early bootphase.

kmsg attached ... this time with more than 81.000 signs/characters ;)

BTW: "applet not found" and busybox is after searching around still a mysterious thing for me.
[Defy Android Development] measel:
wrong thread... sorry!