[Tilt, TyTN II, MDA Vario III Android Development] rishie:
I am able to get wifi running but when I turn off the wifi in settings, I see a dump trace in the dmesg output, and wifi module gets unloaded. I found a quickest way to restart the wifi using the following commands:

# modprobe wlan
# /etc/wifi/loadit

and after this, wifi turns on normally in the settings.

any idea how to fix the module crash while turning off?

below is the output in the dmesg:

...
[ 299.231603] wlan: version magic '2.6.25-00885-g76caa57-dirty preempt mod_unload ARMv6 ' should be '2.6.25-00956-g304b
9be preempt mod_unload ARMv6 '
[ 299.267374] TIWLAN: Driver loading
[ 299.468401] trout_wifi_power: 1
[ 299.468436] trout_wifi_reset: 0
[ 299.518569] trout_wifi_set_carddetect: 1
[ 299.518601] mmc0: card_present 1
[ 299.518631] mmc0: Slot status change detected (0 -> 1)
[ 299.632540] clk_set_rate 19:144000
[ 299.634600] set sd clock - 0 1
[ 299.742021] mmc0: Command timeout
[ 299.747981] mmc0: card claims to support voltages below the defined range. These will be ignored.
[ 299.748035] mmc0: SDIO card claims to support the incompletely defined 'low voltage range'. This will be ignored.
[ 299.750365] clk_set_rate 19:20000000

....

[ 319.999650] clk_set_rate 19:20000000
[ 320.001238] tiwlan_sdio_irq:
[ 320.001932] set sd clock - 0 1
[ 320.010488] tiwlan_sdio_irq:
[ 320.020483] tiwlan_sdio_irq:
[ 320.030475] tiwlan_sdio_irq:
[ 320.040453] tiwlan_sdio_irq:
[ 320.050473] tiwlan_sdio_irq:
[ 320.060470] tiwlan_sdio_irq:
[ 320.070473] tiwlan_sdio_irq:
[ 320.080472] tiwlan_sdio_irq:
[ 320.090470] tiwlan_sdio_irq:
[ 320.100473] tiwlan_sdio_irq:
[ 320.103678] ------------[ cut here ]------------
[ 320.103715] WARNING: at drivers/mmc/core/core.c:220 mmc_wait_for_cmd+0x34/0x7c()
[ 320.103745] Modules linked in: wlan(-) [last unloaded: wlan]
[ 320.103793] [<c02b15e8>] (dump_stack+0x0/0x14) from [<c005310c>] (warn_on_slowpath+0x4c/0x60)
[ 320.103910] [<c00530c0>] (warn_on_slowpath+0x0/0x60) from [<c019ea84>] (mmc_wait_for_cmd+0x34/0x7c)
[ 320.103997] r6:c5d7c000 r5:c1e97d84 r4:c1e97d84
[ 320.104040] [<c019ea50>] (mmc_wait_for_cmd+0x0/0x7c) from [<c01a2250>] (mmc_io_rw_direct+0xb0/0x118)
[ 320.104127] r7:00000007 r6:00000000 r5:00000001 r4:c1e97d84
[ 320.104180] [<c01a21a0>] (mmc_io_rw_direct+0x0/0x118) from [<c01a17ac>] (sdio_enable_wide+0x5c/0xb4)
[ 320.104262] [<c01a1750>] (sdio_enable_wide+0x0/0xb4) from [<c01a190c>] (sdio_reset_comm+0x108/0x144)
[ 320.104342] r5:c5d7c000 r4:00000000
[ 320.104373] [<c01a1804>] (sdio_reset_comm+0x0/0x144) from [<bf059638>] (SDIO_Reset+0x2c/0x3c [wlan])
[ 320.105157] r7:bf083cc0 r6:00000001 r5:00000000 r4:c63e0800
[ 320.105213] [<bf05960c>] (SDIO_Reset+0x0/0x3c [wlan]) from [<bf059664>] (SDIO_Stop+0x1c/0x24 [wlan])
[ 320.106573] r5:00000000 r4:c5e8d9d4
[ 320.106610] [<bf059648>] (SDIO_Stop+0x0/0x24 [wlan]) from [<bf03aea4>] (whal_hwAccess_Destroy+0x20/0x54 [wlan])
[ 320.107937] [<bf03ae84>] (whal_hwAccess_Destroy+0x0/0x54 [wlan]) from [<bf039b0c>] (TNETWIF_Destroy+0x20/0x40 [wlan])

[ 320.109258] r5:00000000 r4:c5e8dd94
[ 320.109297] [<bf039aec>] (TNETWIF_Destroy+0x0/0x40 [wlan]) from [<bf0403ac>] tiwlan_sdio_irq:
[ 320.110807] (whalBus_Destroy+0x24/0x3c [wlan])
[ 320.110842] r5:00000000 r4:c0755c14
[ 320.110882] [<bf040388>] (whalBus_Destroy+0x0/0x3c [wlan]) from [<bf043b64>] (whal_hwCtrl_Destroy+0x34/0x4c [wlan])
[ 320.112242] r5:00000000 r4:c62a8a94
[ 320.112280] [<bf043b30>] (whal_hwCtrl_Destroy+0x0/0x4c [wlan]) from [<bf03c6c4>] (whalCtrl_Destroy+0x50/0x78 [wlan])
[ 320.113613] r5:00000000 r4:c0f60614
[ 320.113650] [<bf03c674>] (whalCtrl_Destroy+0x0/0x78 [wlan]) from [<bf0355c8>] (TnetwDrv_Destroy+0x24/0x184 [wlan])
[ 320.114952] r5:00000000 r4:c43fdc94
[ 320.114988] [<bf0355a4>] (TnetwDrv_Destroy+0x0/0x184 [wlan]) from [<bf00dbbc>] (configMgr_DriverShutdownStatus+0x78/0
x20c [wlan])
[ 320.116250] r5:00000000 r4:c1acc214
[ 320.116287] [<bf00db5c>] (configMgr_DriverShutdownStatus+0x18/0x20c [wlan]) from [<bf00dd6c>] (configMgr_UnloadModule
s+0x1c/0x24 [wlan])
[ 320.117473] r5:00000000 r4:c4246000
[ 320.117510] [<bf00dd50>] (configMgr_UnloadModules+0x0/0x24 [wlan]) from [<bf05b494>] (cleanup_module+0x150/0x254 [wla
n])
[ 320.118750] [<bf05b344>] (cleanup_module+0x0/0x254 [wlan]) from [<c0079ffc>] (sys_delete_module+0x1b8/0x204)
[ 320.119483] r7:00000880 r6:c1e96000 r5:00000000 r4:bf083d20
[ 320.119540] [<c0079e44>] (sys_delete_module+0x0/0x204) from [<c0022a80>] (ret_fast_syscall+0x0/0x2c)
[ 320.119618] r7:00000081 r6:00000009 r5:ffffffff r4:a9c07668
[ 320.119678] ---[ end trace de59b8d045339961 ]---
[ 320.119737] ------------[ cut here ]------------
[ 320.119767] WARNING: at drivers/mmc/core/core.c:149 mmc_wait_for_req+0x54/0x134()
[ 320.119795] Modules linked in: wlan(-) [last unloaded: wlan]
[ 320.119840] [<c02b15e8>] (dump_stack+0x0/0x14) from [<c005310c>] (warn_on_slowpath+0x4c/0x60)
[ 320.119948] [<c00530c0>] (warn_on_slowpath+0x0/0x60) from [<c019e970>] (mmc_wait_for_req+0x54/0x134)
[ 320.120032] r6:c5d7c000 r5:c5d7c000 r4:c1e97d4c
[ 320.120077] [<c019e91c>] (mmc_wait_for_req+0x0/0x134) from [<c019eabc>] (mmc_wait_for_cmd+0x6c/0x7c)
[ 320.120155] r5:c1e97d84 r4:c1e97d4c
[ 320.120188] [<c019ea50>] (mmc_wait_for_cmd+0x0/0x7c) from [<c01a2250>] (mmc_io_rw_direct+0xb0/0x118)
[ 320.120275] r7:00000007 r6:00000000 r5:00000001 r4:c1e97d84
[ 320.120493] tiwlan_sdio_irq:
[ 320.120558] [<c01a21a0>] (mmc_io_rw_direct+0x0/0x118) from [<c01a17ac>] (sdio_enable_wide+0x5c/0xb4)
[ 320.120658] [<c01a1750>] (sdio_enable_wide+0x0/0xb4) from [<c01a190c>] (sdio_reset_comm+0x108/0x144)
[ 320.120743] r5:c5d7c000 r4:00000000
[ 320.120777] [<c01a1804>] (sdio_reset_comm+0x0/0x144) from [<bf059638>] (SDIO_Reset+0x2c/0x3c [wlan])
[ 320.121557] r7:bf083cc0 r6:00000001 r5:00000000 r4:c63e0800
[ 320.121615] [<bf05960c>] (SDIO_Reset+0x0/0x3c [wlan]) from [<bf059664>] (SDIO_Stop+0x1c/0x24 [wlan])
[ 320.122967] r5:00000000 r4:c5e8d9d4
[ 320.123005] [<bf059648>] (SDIO_Stop+0x0/0x24 [wlan]) from [<bf03aea4>] (whal_hwAccess_Destroy+0x20/0x54 [wlan])
[ 320.124328] [<bf03ae84>] (whal_hwAccess_Destroy+0x0/0x54 [wlan]) from [<bf039b0c>] (TNETWIF_Destroy+0x20/0x40 [wlan])

[ 320.125632] r5:00000000 r4:c5e8dd94
[ 320.125670] [<bf039aec>] (TNETWIF_Destroy+0x0/0x40 [wlan]) from [<bf0403ac>] (whalBus_Destroy+0x24/0x3c [wlan])
[ 320.126953] r5:00000000 r4:c0755c14
[ 320.126992] [<bf040388>] (whalBus_Destroy+0x0/0x3c [wlan]) from [<bf043b64>] (whal_hwCtrl_Destroy+0x34/0x4c [wlan])
[ 320.128342] r5:00000000 r4:c62a8a94
[ 320.128380] [<bf043b30>] (whal_hwCtrl_Destroy+0x0/0x4c [wlan]) from [<bf03c6c4>] (whalCtrl_Destroy+0x50/0x78 [wlan])
[ 320.129707] r5:00000000 r4:c0f60614
[ 320.129747] [<bf03c674>] tiwlan_sdio_irq:
[ 320.130605] (whalCtrl_Destroy+0x0/0x78 [wlan]) from [<bf0355c8>] (TnetwDrv_Destroy+0x24/0x184 [wlan])
[ 320.131313] r5:00000000 r4:c43fdc94
[ 320.131355] [<bf0355a4>] (TnetwDrv_Destroy+0x0/0x184 [wlan]) from [<bf00dbbc>] (configMgr_DriverShutdownStatus+0x78/0
x20c [wlan])
[ 320.132597] r5:00000000 r4:c1acc214
[ 320.132633] [<bf00db5c>] (configMgr_DriverShutdownStatus+0x18/0x20c [wlan]) from [<bf00dd6c>] (configMgr_UnloadModule
s+0x1c/0x24 [wlan])
[ 320.133807] r5:00000000 r4:c4246000
[ 320.133843] [<bf00dd50>] (configMgr_UnloadModules+0x0/0x24 [wlan]) from [<bf05b494>] (cleanup_module+0x150/0x254 [wla
n])
[ 320.135083] [<bf05b344>] (cleanup_module+0x0/0x254 [wlan]) from [<c0079ffc>] (sys_delete_module+0x1b8/0x204)
[ 320.135810] r7:00000880 r6:c1e96000 r5:00000000 r4:bf083d20
[ 320.135868] [<c0079e44>] (sys_delete_module+0x0/0x204) from [<c0022a80>] (ret_fast_syscall+0x0/0x2c)
[ 320.135948] r7:00000081 r6:00000009 r5:ffffffff r4:a9c07668
[ 320.136007] ---[ end trace de59b8d045339961 ]---
[ 320.136128] ------------[ cut here ]------------
[ 320.136160] WARNING: at drivers/mmc/core/core.c:220 mmc_wait_for_cmd+0x34/0x7c()
[ 320.136192] Modules linked in: wlan(-) [last unloaded: wlan]
[ 320.136237] [<c02b15e8>] (dump_stack+0x0/0x14) from [<c005310c>] (warn_on_slowpath+0x4c/0x60)
[ 320.136345] [<c00530c0>] (warn_on_slowpath+0x0/0x60) from [<c019ea84>] (mmc_wait_for_cmd+0x34/0x7c)
[ 320.136432] r6:c5d7c000 r5:c1e97d84 r4:c1e97d84
[ 320.136475] [<c019ea50>] (mmc_wait_for_cmd+0x0/0x7c) from [<c01a2250>] (mmc_io_rw_direct+0xb0/0x118)
[ 320.136562] r7:00000007 r6:00000001 r5:00000000 r4:c1e97d84
[ 320.136615] [<c01a21a0>] (mmc_io_rw_direct+0x0/0x118) from [<c01a17dc>] (sdio_enable_wide+0x8c/0xb4)
[ 320.136697] [<c01a1750>] (sdio_enable_wide+0x0/0xb4) from [<c01a190c>] (sdio_reset_comm+0x108/0x144)
[ 320.136778] r5:c5d7c000 r4:00000000
[ 320.136812] [<c01a1804>] (sdio_reset_comm+0x0/0x144) from [<bf059638>] (SDIO_Reset+0x2c/0x3c [wlan])
[ 320.137580] r7:bf083cc0 r6:00000001 r5:00000000 r4:c63e0800
[ 320.137637] [<bf05960c>] (SDIO_Reset+0x0/0x3c [wlan]) from [<bf059664>] (SDIO_Stop+0x1c/0x24 [wlan])
[ 320.138997] r5:00000000 r4:c5e8d9d4
[ 320.139033] [<bf059648>] (SDIO_Stop+0x0/0x24 [wlan]) from [<bf03aea4>] tiwlan_sdio_irq:
[ 320.140555] (whal_hwAccess_Destroy+0x20/0x54 [wlan])
[ 320.140593] [<bf03ae84>] (whal_hwAccess_Destroy+0x0/0x54 [wlan]) from [<bf039b0c>] (TNETWIF_Destroy+0x20/0x40 [wlan])

[ 320.141935] r5:00000000 r4:c5e8dd94
[ 320.141973] [<bf039aec>] (TNETWIF_Destroy+0x0/0x40 [wlan]) from [<bf0403ac>] (whalBus_Destroy+0x24/0x3c [wlan])
[ 320.143278] r5:00000000 r4:c0755c14
[ 320.143315] [<bf040388>] (whalBus_Destroy+0x0/0x3c [wlan]) from [<bf043b64>] (whal_hwCtrl_Destroy+0x34/0x4c [wlan])
[ 320.144708] r5:00000000 r4:c62a8a94
[ 320.144747] [<bf043b30>] (whal_hwCtrl_Destroy+0x0/0x4c [wlan]) from [<bf03c6c4>] (whalCtrl_Destroy+0x50/0x78 [wlan])
[ 320.146077] r5:00000000 r4:c0f60614
[ 320.146113] [<bf03c674>] (whalCtrl_Destroy+0x0/0x78 [wlan]) from [<bf0355c8>] (TnetwDrv_Destroy+0x24/0x184 [wlan])
[ 320.147393] r5:00000000 r4:c43fdc94
[ 320.147432] [<bf0355a4>] (TnetwDrv_Destroy+0x0/0x184 [wlan]) from [<bf00dbbc>] (configMgr_DriverShutdownStatus+0x78/0
x20c [wlan])
[ 320.148667] r5:00000000 r4:c1acc214
[ 320.148703] [<bf00db5c>] (configMgr_DriverShutdownStatus+0x18/0x20c [wlan]) from [<bf00dd6c>] (configMgr_UnloadModule
s+0x1c/0x24 [wlan])
[ 320.149887] r5:00000000 r4:c4246000
[ 320.149925] [<bf00dd50>] tiwlan_sdio_irq:
[ 320.150697] (configMgr_UnloadModules+0x0/0x24 [wlan]) from [<bf05b494>] (cleanup_module+0x150/0x254 [wlan])
[ 320.151423] [<bf05b344>] (cleanup_module+0x0/0x254 [wlan]) from [<c0079ffc>] (sys_delete_module+0x1b8/0x204)
[ 320.152152] r7:00000880 r6:c1e96000 r5:00000000 r4:bf083d20
[ 320.152210] [<c0079e44>] (sys_delete_module+0x0/0x204) from [<c0022a80>] (ret_fast_syscall+0x0/0x2c)
[ 320.152290] r7:00000081 r6:00000009 r5:ffffffff r4:a9c07668
[ 320.152350] ---[ end trace de59b8d045339961 ]---
[ 320.152408] ------------[ cut here ]------------
[ 320.152438] WARNING: at drivers/mmc/core/core.c:149 mmc_wait_for_req+0x54/0x134()
[ 320.152468] Modules linked in: wlan(-) [last unloaded: wlan]
[ 320.152513] [<c02b15e8>] (dump_stack+0x0/0x14) from [<c005310c>] (warn_on_slowpath+0x4c/0x60)
[ 320.152622] [<c00530c0>] (warn_on_slowpath+0x0/0x60) from [<c019e970>] (mmc_wait_for_req+0x54/0x134)
[ 320.152707] r6:c5d7c000 r5:c5d7c000 r4:c1e97d4c
[ 320.152752] [<c019e91c>] (mmc_wait_for_req+0x0/0x134) from [<c019eabc>] (mmc_wait_for_cmd+0x6c/0x7c)
[ 320.152832] r5:c1e97d84 r4:c1e97d4c
[ 320.152865] [<c019ea50>] (mmc_wait_for_cmd+0x0/0x7c) from [<c01a2250>] (mmc_io_rw_direct+0xb0/0x118)
[ 320.152952] r7:00000007 r6:00000001 r5:00000000 r4:c1e97d84
[ 320.153005] [<c01a21a0>] (mmc_io_rw_direct+0x0/0x118) from [<c01a17dc>] (sdio_enable_wide+0x8c/0xb4)
[ 320.153085] [<c01a1750>] (sdio_enable_wide+0x0/0xb4) from [<c01a190c>] (sdio_reset_comm+0x108/0x144)
[ 320.153165] r5:c5d7c000 r4:00000000
[ 320.153198] [<c01a1804>] (sdio_reset_comm+0x0/0x144) from [<bf059638>] (SDIO_Reset+0x2c/0x3c [wlan])
[ 320.153943] r7:bf083cc0 r6:00000001 r5:00000000 r4:c63e0800
[ 320.154000] [<bf05960c>] (SDIO_Reset+0x0/0x3c [wlan]) from [<bf059664>] (SDIO_Stop+0x1c/0x24 [wlan])
[ 320.155377] r5:00000000 r4:c5e8d9d4
[ 320.155413] [<bf059648>] (SDIO_Stop+0x0/0x24 [wlan]) from [<bf03aea4>] (whal_hwAccess_Destroy+0x20/0x54 [wlan])
[ 320.156715] [<bf03ae84>] (whal_hwAccess_Destroy+0x0/0x54 [wlan]) from [<bf039b0c>] (TNETWIF_Destroy+0x20/0x40 [wlan])

[ 320.158022] r5:00000000 r4:c5e8dd94
[ 320.158062] [<bf039aec>] (TNETWIF_Destroy+0x0/0x40 [wlan]) from [<bf0403ac>] (whalBus_Destroy+0x24/0x3c [wlan])
[ 320.159362] r5:00000000 r4:c0755c14
[ 320.159400] [<bf040388>] (whalBus_Destroy+0x0/0x3c [wlan]) from [<bf043b64>] tiwlan_sdio_irq:
[ 320.160943] (whal_hwCtrl_Destroy+0x34/0x4c [wlan])
[ 320.160985] r5:00000000 r4:c62a8a94
[ 320.161025] [<bf043b30>] (whal_hwCtrl_Destroy+0x0/0x4c [wlan]) from [<bf03c6c4>] (whalCtrl_Destroy+0x50/0x78 [wlan])
[ 320.162382] r5:00000000 r4:c0f60614
[ 320.162420] [<bf03c674>] (whalCtrl_Destroy+0x0/0x78 [wlan]) from [<bf0355c8>] (TnetwDrv_Destroy+0x24/0x184 [wlan])
[ 320.163710] r5:00000000 r4:c43fdc94
[ 320.163747] [<bf0355a4>] (TnetwDrv_Destroy+0x0/0x184 [wlan]) from [<bf00dbbc>] (configMgr_DriverShutdownStatus+0x78/0
x20c [wlan])
[ 320.164977] r5:00000000 r4:c1acc214
[ 320.165013] [<bf00db5c>] (configMgr_DriverShutdownStatus+0x18/0x20c [wlan]) from [<bf00dd6c>] (configMgr_UnloadModule
s+0x1c/0x24 [wlan])
[ 320.166150] r5:00000000 r4:c4246000
[ 320.166187] [<bf00dd50>] (configMgr_UnloadModules+0x0/0x24 [wlan]) from [<bf05b494>] (cleanup_module+0x150/0x254 [wla
n])
[ 320.167450] [<bf05b344>] (cleanup_module+0x0/0x254 [wlan]) from [<c0079ffc>] (sys_delete_module+0x1b8/0x204)
[ 320.168180] r7:00000880 r6:c1e96000 r5:00000000 r4:bf083d20
[ 320.168237] [<c0079e44>] (sys_delete_module+0x0/0x204) from [<c0022a80>] (ret_fast_syscall+0x0/0x2c)
[ 320.168318] r7:00000081 r6:00000009 r5:ffffffff r4:a9c07668
[ 320.168375] ---[ end trace de59b8d045339961 ]---
[ 320.220617] TIWLAN: Releasing SDIO resources
[ 320.221077] TIWLAN: SDIO resources released
[ 320.223325] trout_wifi_set_carddetect: 0
[ 320.223383] mmc0: card_present 0
[ 320.223415] mmc0: Slot status change detected (1 -> 0)
[ 320.224312] mmc0: card 0002 removed
[ 320.230247] trout_wifi_reset: 1
[ 320.405870] ds2746: 4074mV 53mA charge: 97/100 (4213 units)
[ 320.405895] aux0: 221 (1198) aux1: 17 (80)
[ 320.546998] trout_wifi_power: 0
[ 320.547060] TIWLAN: Driver unloaded
# lsmod
lsmod
#