Icenowy / xradio

Port Allwinner xradio driver to mainline Linux.
GNU General Public License v2.0
20 stars 73 forks source link

Firmware crash #1

Closed fifteenhex closed 7 years ago

fifteenhex commented 7 years ago

I saw somewhere else that you were seeing the firmware crash after loading. This seems to be because of not properly resetting the chip before the mmc subsystem tries to init the sdio card.

The driver built from your source starts up correctly with my device tree (https://github.com/fifteenhex/linux/blob/bde4b4a1ea3a8d6b7c757143e0724be9dddd0b36/arch/arm/boot/dts/sun8i-h2-orangepi-zero.dts) and crashes a bit later on:

[ 1285.967060] xradio_wlan: loading out-of-tree module taints kernel. [ 1285.989342] [XRADIO] Driver Label:L34M.01.08.0002 [ 1285.994355] [XRADIO] Allocated hw_priv @ cdcb8ce0 [ 1285.999830] [XRADIO_ERR] Access_file failed, path:/data/xr_wifi.conf! [ 1286.008504] [SBUS] XRadio Device:sdio clk=50000000 [ 1286.016616] [XRADIO] XRADIO_HW_REV 1.0 detected. [ 1286.158275] [XRADIO] Bootloader complete [ 1286.234596] [XRADIO] Firmware completed. [ 1286.249148] [WSM] Firmware Label:XR_C01.08.0043 Jun 6 2016 20:41:04 [ 1286.255540] [XRADIO] Firmware Startup Done. [ 1286.259839] ------------[ cut here ]------------ [ 1286.264684] WARNING: CPU: 0 PID: 368 at /home/daniel/coding/pizero/xradio/bh.c:749 xradio_bh+0x5e2/0xc54 [xradio_wlan] [ 1286.275421] Modules linked in: xradio_wlan(O+) [ 1286.279968] CPU: 0 PID: 368 Comm: xradio_bh Tainted: G O 4.9.0-rc5+ #15 [ 1286.287712] Hardware name: Allwinner sun8i Family [ 1286.292451] [] (unwind_backtrace) from [] (show_stack+0xb/0xc) [ 1286.300037] [] (show_stack) from [] (dump_stack+0x5b/0x70) [ 1286.307275] [] (dump_stack) from [] (warn+0x8b/0xa8) [ 1286.314164] [] (warn) from [] (warn_slowpath_null+0x11/0x16) [ 1286.321888] [] (warn_slowpath_null) from [] (xradio_bh+0x5e2/0xc54 [xradio_wlan]) [ 1286.331265] [] (xradio_bh [xradio_wlan]) from [] (kthread+0x89/0x98) [ 1286.339388] [] (kthread) from [] (ret_from_fork+0x11/0x20) [ 1286.346684] ---[ end trace 6d64e7e1f2176ae8 ]--- [ 1286.351336] [BH_ERR] wsm_seq=0. [ 1286.354501] [BH_ERR] Fatal error, exitting code=751. [ 1286.359515] [WSM_ERR] wsm_upper_restart [ 1288.338586] [WSM_ERR] ***CMD timeout!>>> 0x0006 (12), buf_use=0, bh_state=751 [ 1288.345945] ------------[ cut here ]------------

Icenowy commented 7 years ago

2016年11月16日 20:57于 Daniel Palmer notifications@github.com写道:

I saw somewhere else that you were seeing the firmware crash after loading. This seems to be because of not properly resetting the chip before the mmc subsystem tries to init the sdio card.

To be honest, I am stll working on the same problem. :-(

The driver built from your source starts up correctly with my device tree (https://github.com/fifteenhex/linux/blob/bde4b4a1ea3a8d6b7c757143e0724be9dddd0b36/arch/arm/boot/dts/sun8i-h2-orangepi-zero.dts) and crashes a bit later on:

[ 1285.967060] xradio_wlan: loading out-of-tree module taints kernel. [ 1285.989342] [XRADIO] Driver Label:L34M.01.08.0002 [ 1285.994355] [XRADIO] Allocated hw_priv @ cdcb8ce0 [ 1285.999830] [XRADIO_ERR] Access_file failed, path:/data/xr_wifi.conf! [ 1286.008504] [SBUS] XRadio Device:sdio clk=50000000 [ 1286.016616] [XRADIO] XRADIO_HW_REV 1.0 detected. [ 1286.158275] [XRADIO] Bootloader complete [ 1286.234596] [XRADIO] Firmware completed. [ 1286.249148] [WSM] Firmware Label:XR_C01.08.0043 Jun 6 2016 20:41:04 [ 1286.255540] [XRADIO] Firmware Startup Done. [ 1286.259839] ------------[ cut here ]------------ [ 1286.264684] WARNING: CPU: 0 PID: 368 at /home/daniel/coding/pizero/xradio/bh.c:749 xradio_bh+0x5e2/0xc54 [xradio_wlan] [ 1286.275421] Modules linked in: xradio_wlan(O+) [ 1286.279968] CPU: 0 PID: 368 Comm: xradio_bh Tainted: G O 4.9.0-rc5+ #15 [ 1286.287712] Hardware name: Allwinner sun8i Family [ 1286.292451] from [ 1286.300037] from [ 1286.307275] from [ 1286.314164] from [ 1286.321888] from [](xradio_bh+0x5e2/0xc54 [xradio_wlan]) [ 1286.331265] [](xradio_bh [xradio_wlan]) from [ 1286.339388] from [ 1286.346684] ---[ end trace 6d64e7e1f2176ae8 ]--- [ 1286.351336] [BH_ERR] wsm_seq=0. [ 1286.354501] [BH_ERR] Fatal error, exitting code=751. [ 1286.359515] [WSM_ERR] wsm_upper_restart [ 1288.338586] [WSM_ERR] ***CMD timeout!>>> 0x0006 (12), buf_use=0, bh_state=751 [ 1288.345945] ------------[ cut here ]------------

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

fifteenhex commented 7 years ago

I'm able to have the firmware load every time now. There is a bunch of stuff coming out from the driver about commands timing out which I think is to do with the interrupt not being setup.

fifteenhex commented 7 years ago

I have the driver working now (wireless scan works at least..) . Adding this to the make file seems to be the main thing: ccflags-y += -DCONFIG_XRADIO_NON_POWER_OF_TWO_BLOCKSIZES

It seems like if that isn't that the firmware upload is corrupted or incomplete and that's why it crashes soon after booting.