[Touch CDMA Android Development] kallt_kaffe:
My gps_nmea_thread now looks like this:

static int gps_nmea_thread (void *data)
{
struct file *filp;
mm_segment_t oldfs;
int count;
static char buf[256];
struct nmea_state nmea;

filp = filp_open("/dev/smd7", O_RDONLY, 0);
if (!filp || IS_ERR(filp)) {
printk("Unable to open NMEA device %d\n", (int) PTR_ERR(filp));
return -1;
}
if (!filp->f_op->read)
return -2;

nmea_init(&nmea, handle_fix_info, handle_pos_data, handle_sat_data,
handle_bearing_speed, handle_date);
while (!kthread_should_stop()) {
if (state->state == GPS_STATE_ON)
gps_tickle();
do {
/* now read len bytes from offset 0 */
filp->f_pos = 0; /* start offset */
oldfs = get_fs();
set_fs(KERNEL_DS);
count = filp->f_op->read(filp, buf, sizeof(buf), &filp->f_pos);
set_fs(oldfs);
} while (!count);
nmea_parse(&nmea, buf, count);
}
filp_close(filp, NULL);

return 0;
}

I've also done some changes to nmea_parse to make it check NMEA sentence length and also use the NMEA checksum to make sure it discards any corrupt data.

Anyway, I left it running with GPS Test and plugged in to the charger last night and went to bed. This morning it was still running fine after more than 7 hours. Best result ever so far.

So I pressed the home button to try launch Google Maps instead but as I pressed the home button it instantly froze with this:

[11541.242190] date=24042010
[11541.242273] fix=-2136735708
[11541.242315] speed=0 bearing=0
[11541.302188] date=24042010
[11541.302268] fix=-2136735708
[11541.302307] speed=0 bearing=0
[11541.392237] date=24042010
[11541.392318] fix=-2136735708
[11541.392357] speed=0 bearing=0
[11541.452185] date=24042010
[11541.452260] fix=-2136735708
[11541.452300] speed=0 bearing=0
[11541.512237] time=44432 hlat=1 llat=xx39952109 hlng=0 llng=xx72721453
[11541.512324] date=24042010
[11541.512377] fix=-2136734684
[11541.512412] speed=0 bearing=0
[11542.512279] date=24042010
[11542.512362] fix=-2145124316
[11542.512400] speed=0 bearing=0
[11543.255264] Unable to handle kernel NULL pointer dereference at virtual address 00000374
[11543.255339] pgd = c5fb8000
[11543.255362] [00000374] *pgd=15fbc031, *pte=00000000, *ppte=00000000
[11543.255419] Internal error: Oops: 817 [#1] PREEMPT
[11543.255445] Modules linked in:
[11543.255484] CPU: 0 Not tainted (2.6.25-01041-g7bb61a4-dirty #43)
[11543.255565] PC is at android_unlock_suspend+0x7c/0x17c
[11543.255607] LR is at android_unlock_suspend+0x2c/0x17c
[11543.255644] pc : [<c014c02c>] lr : [<c014bfdc>] psr: 40000093
[11543.255660] sp : c6361aa8 ip : c6361aa8 fp : c6361ae4
[11543.255695] r10: 42c37d70 r9 : c6360000 r8 : c0319234
[11543.255727] r7 : 20000013 r6 : c03b13d8 r5 : c0319230 r4 : c03766e8
[11543.255760] r3 : c0319244 r2 : c0415b50 r1 : 00000370 r0 : c642dd48
[11543.255794] Flags: nZcv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
[11543.255832] Control: 00c5387f Table: 15fb8000 DAC: 00000015
[11543.255862] Process Binder Thread # (pid: 1547, stack limit = 0xc6360260)
[11543.255895] Stack: (0xc6361aa8 to 0xc6362000)
[11543.255919] 1aa0: a97021a8 00004701 c0026b64 42c37d70 c6361ae4 000005dc
[11543.256000] 1ac0: c00442f4 a97021a8 00004701 c0026b64 c6360000 42c37d70 c6361f2c c6361ae8
[11543.256085] 1ae0: c00449c0 c014bfbc 000005dc c002f4cc 0cfd0000 00000000 02000000 04000030
[11543.256170] 1b00: 00000000 02000000 00000000 00000000 00000000 00000000 a30d0000 00000000
[11543.256250] 1b20: ffffffff 00000000 ffff03f1 00000000 ffffffff c6361b40 c0053254 c00528c8
[11543.256334] 1b40: c50cc800 00000001 80000093 00000000 00000001 00000000 c6361b7c c6361b68
[11543.256415] 1b60: c5204800 00000001 c6361b94 c6361b78 c0052be8 c00517a0 c50cc800 00000001
[11543.256502] 1b80: c02e8388 c0378360 c6361bac c6361b98 c002f4d8 c002f464 c02e8478 c0378360
[11543.256587] 1ba0: c6361bec c6361bb0 c002f2a4 c002f4cc c6361bcc c6361bc0 c02e8388 00000a75
[11543.256672] 1bc0: c6361be4 c6361bd0 c002f4d8 c002f464 c02e8478 00000a75 c6361c24 c6361be8
[11543.256755] 1be0: c002f2a4 c002f4cc c0051de8 c013e3c4 c02e8388 0012f8c5 00000000 c0378360
[11543.256840] 1c00: 00000a75 2cd28dcd 000018ab c0378360 c0378360 00000a75 c6361c74 c6361c28
[11543.256925] 1c20: c0051de8 c013e3c4 000069f3 00002d93 00000000 00002d93 c5204800 0000000f
[11543.257009] 1c40: c5204800 c0378360 c02e8388 c039abc0 c6361c74 c6361c60 c002f4d8 c002f464
[11543.257094] 1c60: c6361cd0 c039abc0 c6361cac c6361c78 c0075d6c c002f4cc ca01247e 00000003
[11543.257180] 1c80: 07ffffff 00000000 405c3a20 c02e8478 c02e8388 c039abc0 c6361cbc c6361ca8
[11543.257265] 1ca0: c002f4d8 c002f464 c6361d18 c039abc0 c6361cf4 c6361cc0 c0075d6c c002f4cc
[11543.257352] 1cc0: cce6b83e 00000003 07ffffff 00000000 c6361d18 c039abf0 c039abc0 0069d9ca
[11543.257435] 1ce0: 00000000 c6360000 c6361d14 c6361cf8 c00738f0 c005e45c c6361d38 3b9aca00
[11543.257522] 1d00: 0017791e 00000000 c6361d2c c6361d18 c6361d44 c6361d20 c0088c68 c0052700
[11543.257607] 1d20: c5fa1440 c007aa68 c03194e0 60000013 c6361d84 c6361d40 c024fd30 c007aa20
[11543.257694] 1d40: 00000000 60000013 00000000 c03194d0 00000001 00000001 001362d8 00000024
[11543.257777] 1d60: c6361d9c c6361d70 c00541c4 c0052700 00000000 0000000f 0000000f c03194b0
[11543.257860] 1d80: 0000000f 0000000f 00000018 c6360000 c6361e04 c6361da0 c014e834 c005417c
[11543.257945] 1da0: d9b73e3c 00000000 00001510 c6361ee4 c03194e0 00000000 c00529a0 c5fa0024
[11543.258029] 1dc0: 000005c5 0000060b 4bd27731 161233d3 c5fa1440 42303000 c6361e44 c6361de8
[11543.258114] 1de0: c00982d0 c0052700 c6361ee4 00000000 00000000 c014e49c c6361ed4 c6361e08
[11543.258199] 1e00: c00ae0a4 0000040c c5fb9088 c5fb8000 c6361e34 c6361e20 c0139c94 c0052700
[11543.258285] 1e20: c5204800 42303316 c6361e44 c6361e38 c0073df4 c0139bf0 c6361f04 c6361e48
[11543.258370] 1e40: c002be18 c0073df0 00000000 00000000 00000000 0000001f c006facc c6361e5c
[11543.258454] 1e60: c6361e5c c002f464 00000000 00000000 c0319404 60000013 00000024 c6361e88
[11543.258539] 1e80: 00000024 c007a754 48a20b68 c6361ee4 c6360000 48a20b30 00000000 c6361ee4
[11543.258625] 1ea0: 00000000 00000000 00000003 00000024 00000002 c5dde600 00000003 c6095a98
[11543.258707] 1ec0: 00000000 c6361f70 c6361f4c c6361ed8 c00ae8e4 c00dd4a4 00000000 0000001f
[11543.258792] 1ee0: c02e80f0 42303316 c6361fb0 ad00f3c0 00000004 00000003 c6361fac c6361f08
[11543.258877] 1f00: c0026230 c002bca4 c50e56a0 c014d334 48a20b68 40086134 c5ddf8a0 c00442f4
[11543.258964] 1f20: c6361f4c c6361f30 c00bb808 c0044300 c5ddf8a0 a97021a8 c5d5c920 00000027
[11543.259049] 1f40: c6361f7c c6361f50 c00bbb28 c00bb7e0 c6361f7c c6361f60 c00af550 c0052700
[11543.259135] 1f60: 00000004 c5ddf8a0 a97021a8 00004701 c6361fa4 c6361f80 c00bbb90 c00bb874
[11543.259224] 1f80: c6361fac 00000001 00000004 a97020d0 a97021ac 00000036 00000000 c6361fa8
[11543.259307] 1fa0: c00269e0 c00bbb5c 00000004 a97020d0 00000027 00004701 a97021a8 48a20b6c
[11543.259394] 1fc0: 00000004 a97020d0 a97021ac 00000036 48a20b90 42c37d88 42c37d70 00344060
[11543.259479] 1fe0: a97020dc 48a20b50 afe1f659 afe0cccc 00000010 00000027 da694812 ff809fb1
[11543.259567] Backtrace:
[11543.259597] [<c014bfb0>] (android_unlock_suspend+0x0/0x17c) from [<c00449c0>] (vogue_gps_ioctl+0x6cc/0x7a0)
[11543.259685] [<c00442f4>] (vogue_gps_ioctl+0x0/0x7a0) from [<c00bb808>] (vfs_ioctl+0x34/0x94)
[11543.259772] r5:c00442f4 r4:c5ddf8a0
[11543.259805] [<c00bb7d4>] (vfs_ioctl+0x0/0x94) from [<c00bbb28>] (do_vfs_ioctl+0x2c0/0x2e8)
[11543.259877] r7:00000027 r6:c5d5c920 r5:a97021a8 r4:c5ddf8a0
[11543.259932] [<c00bb868>] (do_vfs_ioctl+0x0/0x2e8) from [<c00bbb90>] (sys_ioctl+0x40/0x64)
[11543.260002] r6:00004701 r5:a97021a8 r4:c5ddf8a0
[11543.260045] [<c00bbb50>] (sys_ioctl+0x0/0x64) from [<c00269e0>] (ret_fast_syscall+0x0/0x2c)
[11543.260130] r7:00000036 r6:a97021ac r5:a97020d0 r4:00000004
[11543.260182] Code: e5801000 e5842000 e5b32014 e59f60ec (e5810004)
[11543.260257] Kernel panic - not syncing: Fatal exception
[11543.260294] Rebooting in 3 seconds..Charge update
[11900.629032] Kaiser charge 0

Continued in next post...