In your mt7623.dtsi there are two watchdog entries, remove one of them (use the one from your 4.14) and then retry
unfortunately the fixes not the crash
[ 111.412955] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 1021)
[ 111.412989] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
[ 111.413080] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
[ 111.413086] set current consys chipid (0x7623)
[ 111.413101] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
[ 111.413107] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, chipid:0x00007623
[ 111.419033] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[ 111.419047] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[ 111.419054] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[ 111.419569] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_init:Get mcu register base(0xe2749000)
[ 111.419585] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_init:Get topckgen register base(0xe274c000)
[ 111.419590] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_init:get consys start phy address(0xffe00000)
[ 111.419597] [WMT-CONSYS-HW][I]mtk_wcn_consys_hw_init:CONSYS_EMI_MAPPING dump(0x00001ffe)
[ 111.419612] [WMT-CONSYS-HW][I]mtk_wcn_consys_hw_init:EMI mapping OK(0xdc72ab8e)
[ 111.421429] [WMT-CONSYS-HW][E]mtk_wmt_probe(125):Wmt Cannot find pinctrl default!
[ 111.421469] [WMT-CONSYS-HW][D]mtk_wmt_probe:[CCF]clk_infra_conn_main=9935e532
[ 111.421691] [WMT-CONSYS-HW][E]mtk_wmt_probe(173):CanNot get consys reset. ret=-517
[ 111.422589] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[ 111.422596] [BT-MOD-INIT][I]do_bluetooth_drv_init:start to do bluetooth driver init
[ 111.424267] [MTK-BT] BT_init: mtk_stp_BT_chrdev driver(major 192) installed
[ 111.425132] [BT-MOD-INIT][I]do_bluetooth_drv_init:finish bluetooth driver init, i_ret:0
[ 111.425140] [GPS-MOD-INIT][I]do_gps_drv_init:CONFIG_MTK_COMBO_GPS is not defined
[ 111.425146] [WCN-MOD-INIT][E]do_connectivity_driver_init(62):do common driver init failed, ret:-1
[ 111.425150] [FM-MOD-INIT][I]do_fm_drv_init:start to do fm module init
[ 111.425153] [FM-MOD-INIT][I]do_fm_drv_init:finish fm module init
[ 111.425158] [WLAN-MOD-INIT][I]do_wlan_drv_init:start to do wlan module init 0x7623
[ 111.425657] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 155) installed.
[ 111.425666] [WLAN-MOD-INIT][I]do_wlan_drv_init:WMT-WIFI char dev init, ret:0
[ 111.426112] [WMT-CONSYS-HW][I]mtk_wcn_consys_hw_pwr_on:CONSYS-HW-PWR-ON, start
[ 111.426124] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_reg_ctrl:CONSYS-HW-REG-CTRL(0x00000001),start
[ 111.426129] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_reg_ctrl:++
[ 111.426133] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 237
[ 111.426200] Unable to handle kernel NULL pointer dereference at virtual address 00000040
[ 111.426211] pgd = 4194e7ca
[ 111.426216] [00000040] *pgd=00000000
[ 111.426229] Internal error: Oops: 17 [#1] SMP ARM
[ 111.426665] [WLAN-MOD-INIT][I]do_wlan_drv_init:WLAN-GEN2 driver init, ret:0
[ 111.430922] Modules linked in: mt7530 dsa_core bridge mtk_thermal thermal_sys pwm_mediatek spi_mt65xx mt6577_auxadc fuse ipv6
[ 111.437905] [WLAN-MOD-INIT][I]do_wlan_drv_init:finish wlan module init
[ 111.449217] CPU: 2 PID: 1026 Comm: mtk_wmtd Not tainted 4.16.7-bpi-r2-wlan #203
[ 111.449222] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 111.449239] PC is at mutex_lock+0x28/0x54
[ 111.449263] LR is at regulator_set_mode+0x2c/0xb4
[ 111.456263] xhci-mtk 1a240000.usb: fail to get vbus
[ 111.463100] pc : [<c0928a4c>] lr : [<c045d5c4>] psr: 600f0013
[ 111.469041] xhci-mtk 1a1c0000.usb: fail to get vbus
[ 111.472628] sp : db1d9d50 ip : db1d9d60 fp : db1d9d5c
[ 111.478074] mt7623consys 18070000.consys: Unbalanced pm_runtime_enable!
[ 111.482157] r10: 00000001 r9 : 00000000 r8 : 00000001
[ 111.488418] [WMT-CONSYS-HW][E]mtk_wmt_probe(125):Wmt Cannot find pinctrl default!
[ 111.493218] r7 : 00000000 r6 : c0f54b50 r5 : 00000040 r4 : 00000000
[ 111.498470] [WMT-CONSYS-HW][D]mtk_wmt_probe:[CCF]clk_infra_conn_main=a55ffa25
[ 111.504965] r3 : db21ed40 r2 : f97fbb29 r1 : 00000008 r0 : 00000040
[ 111.504974] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 111.511839] [WMT-CONSYS-HW][E]mtk_wmt_probe(173):CanNot get consys reset. ret=-517
[ 111.513156] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 1021)
[ 111.520344] Control: 10c5387d Table: 9c75c06a DAC: 00000051
[ 111.520358] Process mtk_wmtd (pid: 1026, stack limit = 0x7051c667)
[ 111.520363] Stack: (0xdb1d9d50 to 0xdb1da000)
[ 111.520371] 9d40: db1d9d84 db1d9d60 c045d5c4 c0928a30
[ 111.520381] 9d60: db1d9d58 00000008 db1d9dc4 c0f8fda0 c1036d10 c0f54b50 db1d9dc4 db1d9d88
[ 111.606835] 9d80: c04fbb88 c045d5a4 db1d9db4 df7cbbc0 dc7e6800 f14dc2b4 00000019 c0f54b50
[ 111.616314] 9da0: 00000000 db1d9eac c0bfbc58 00000000 00000000 00000001 db1d9ddc db1d9dc8
[ 111.625796] 9dc0: c04fc25c c04fba24 c0f54b3c c0f901a8 db1d9df4 db1d9de0 c04fe004 c04fc204
[ 111.635275] 9de0: c0f04c48 db1d9eb0 db1d9e04 db1d9df8 c04da030 c04fdf70 db1d9e14 db1d9e08
[ 111.644756] 9e00: c04da11c c04d9fd4 db1d9e9c db1d9e18 c04d64c0 c04da0e4 c0e9cb80 c014a71c
[ 111.654237] 9e20: ffffffff c014a71c 00000001 00000000 00000000 c0113370 db26e018 db21ed40
[ 111.663718] 9e40: 00000002 db21bf40 dc1448c0 dc7e6780 df7cbb80 db21ed40 dd834fc0 dc1448c0
[ 111.673198] 9e60: c1036ce0 db21f0a8 db1d9edc f97fbb29 c0925fb4 00000002 c0a3a400 c0ff2f64
[ 111.682679] 9e80: c0bfbc58 c0c10310 c0bfdbb0 c0ff3c18 db1d9ee4 db1d9ea0 c04d85c8 c04d6470
[ 111.692160] 9ea0: c0f04c48 c0bfbc9c db1d9ef4 00000000 00000000 f97fbb29 c0ff3514 c0ff2f64
[ 111.701640] 9ec0: 00000000 c0ff3514 c0ff3c18 c04dd454 c1036ce0 c0ff3530 db1d9f14 db1d9ee8
[ 111.711121] 9ee0: c04d87cc c04d8538 db1d9f34 db1d9ef8 c04edb7c c0ff3c18 c0ff34ec c0ff3514
[ 111.720602] 9f00: db1d8000 c04dd454 db1d9f24 db1d9f18 c04d63d8 c04d877c db1d9f34 db1d9f28
[ 111.730082] 9f20: c04d6424 c04d63b0 db1d9f74 db1d9f38 c04dfbb0 c04d6404 c0c01bd0 c0c01c3c
[ 111.739562] 9f40: c0c01bf8 00000000 dc68515c dc685140 deae7640 00000000 db1d8000 c0ff34ec
[ 111.749043] 9f60: dc68515c dc747d9c db1d9fac db1d9f78 c0148cf0 c04dfa1c 00000000 c04dfa10
[ 111.758523] 9f80: db1d9fac deae7640 c0148bb0 00000000 00000000 00000000 00000000 00000000
[ 111.768003] 9fa0: 00000000 db1d9fb0 c01010e8 c0148bbc 00000000 00000000 00000000 00000000
[ 111.777483] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 111.786964] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[ 111.796468] [<c0928a4c>] (mutex_lock) from [<c045d5c4>] (regulator_set_mode+0x2c/0xb4)
[ 111.805675] [<c045d5c4>] (regulator_set_mode) from [<c04fbb88>] (mtk_wcn_consys_hw_reg_ctrl+0x170/0x684)
[ 111.816444] [<c04fbb88>] (mtk_wcn_consys_hw_reg_ctrl) from [<c04fc25c>] (mtk_wcn_consys_hw_pwr_on+0x64/0xbc)
[ 111.827562] [<c04fc25c>] (mtk_wcn_consys_hw_pwr_on) from [<c04fe004>] (wmt_plat_pwr_ctrl+0xa0/0x124)
[ 111.837990] [<c04fe004>] (wmt_plat_pwr_ctrl) from [<c04da030>] (wmt_ctrl_hw_pwr_on+0x68/0x88)
[ 111.847812] [<c04da030>] (wmt_ctrl_hw_pwr_on) from [<c04da11c>] (wmt_ctrl+0x44/0xc0)
[ 111.856860] [<c04da11c>] (wmt_ctrl) from [<c04d64c0>] (wmt_core_ctrl+0x5c/0xe8)
[ 111.865479] [<c04d64c0>] (wmt_core_ctrl) from [<c04d85c8>] (opfunc_pwr_on+0x9c/0x244)
[ 111.874616] [<c04d85c8>] (opfunc_pwr_on) from [<c04d87cc>] (opfunc_func_on+0x5c/0x348)
[ 111.883838] [<c04d87cc>] (opfunc_func_on) from [<c04d63d8>] (wmt_core_opid_handler+0x34/0x54)
[ 111.893663] [<c04d63d8>] (wmt_core_opid_handler) from [<c04d6424>] (wmt_core_opid+0x2c/0x6c)
[ 111.903403] [<c04d6424>] (wmt_core_opid) from [<c04dfbb0>] (wmtd_thread+0x1a0/0x254)
[ 111.912455] [<c04dfbb0>] (wmtd_thread) from [<c0148cf0>] (kthread+0x140/0x170)
[ 111.920987] [<c0148cf0>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[ 111.929513] Exception stack(0xdb1d9fb0 to 0xdb1d9ff8)
[ 111.935889] 9fa0: 00000000 00000000 00000000 00000000
[ 111.945204] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 111.953328] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 111.959900] Code: e3c33d7f e3c3303f e593300c f590f000 (e1901f9f)
[ 111.966087] ---[ end trace 76dae90fe82fa4c5 ]---
[ 113.526315] [WMT-PLAT][W]wmt_plat_wake_lock_ctrl:WMT-PLAT: wakelock status(1), counter(2)
[ 118.523016] [MTK-WIFI] WIFI_open: WIFI_open: major 155 minor 0 (pid 1000)
[ 118.530463] [MTK-WIFI] WIFI_write: WIFI_write A
[ 118.536522] [WMT-PLAT][W]wmt_plat_wake_lock_ctrl:WMT-PLAT: wakelock status(1), counter(3)
[ 202.584249] [WMT-LIB][E]DISABLE_PSM_MONITOR(142):--->lock psm_lock failed, ret=-4
[ 202.591872] [WMT-EXP][E]mtk_wcn_wmt_func_ctrl(112):wake up failed,OPID(3) type(3) abort
[ 202.600954] [WMT-PLAT][W]wmt_plat_wake_lock_ctrl:WMT-PLAT: wakelock status(1), counter(2)
[ 202.601735] [WMT-LIB][E]DISABLE_PSM_MONITOR(142):--->lock psm_lock failed, ret=-4
[ 202.610472] [MTK-WIFI] WIFI_write: WMT turn on WIFI fail!
[ 202.618855] [WMT-EXP][E]mtk_wcn_wmt_func_ctrl(112):wake up failed,OPID(3) type(9) abort
[ 202.618866] [WMT-PLAT][W]wmt_plat_wake_lock_ctrl:WMT-PLAT: wakelock status(1), counter(1)
[ 202.624654] [MTK-WIFI] WIFI_close: WIFI_close: major 155 minor 0 (pid 1000)
the following error
[ 111.511839] [WMT-CONSYS-HW][E]mtk_wmt_probe(173):CanNot get consys reset. ret=-517
seems to mean that, right?
consys: consys@18070000 {
compatible = "mediatek,mt7623-consys";
reg = <0 0x18070000 0 0x0200>, /*CONN_MCU_CONFIG_BASE */
<0 0x10001000 0 0x1600>; /*TOPCKGEN_BASE */
clocks = <&infracfg CLK_INFRA_CONNMCU>;
clock-names = "consysbus";
power-domains = <&scpsys MT2701_POWER_DOMAIN_CONN>;
interrupts = <GIC_SPI 185 IRQ_TYPE_LEVEL_LOW>, /* BGF_EINT */
<GIC_SPI 163 IRQ_TYPE_LEVEL_LOW>; /* WDT_EINT */
resets = <&watchdog MT2701_TOPRGU_CONN_MCU_RST>; <<<<<<<<<<
reset-names = "connsys"; <<<<<<<<
status="disabled";
};
Yes, I supposed it was due to duplicated watchdog entry, mtk_wmt_probe is executed a second time after the error, however at the same time the device is freed (because the first execution is failed) so we have that crash.
I had removed the old watchdog-entry (see code on github),but kernel still crashes…i guess it will be freed,but not created before…
Your mt7623n-bananapi-bpi-r2.dts file is missing the following lines:
&watchdog {
status = "okay";
};
[15:24] root@bpi-r2:~# cat /sys/firmware/devicetree/base/watchdog@10007000/status
okay[15:24] root@bpi-r2:~#
still the same crash but it seems it is a later state (Passed mtk_wcn_consys_hw_reg_ctrl 253)
[ 80.714892] [WMT-CONSYS-HW][D]mtk_wmt_probe:[CCF]clk_infra_conn_main=3e7342fd
[ 80.715192] [WMT-CONSYS-HW][E]mtk_wmt_probe(173):CanNot get consys reset. ret=-517
[ 80.715601] [WLAN-MOD-INIT][I]do_wlan_drv_init:WLAN-GEN2 driver init, ret:0
[ 80.715608] [WLAN-MOD-INIT][I]do_wlan_drv_init:finish wlan module init
[ 80.716097] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 1013)
[ 80.718837] [WMT-CONSYS-HW][I]mtk_wcn_consys_hw_pwr_on:CONSYS-HW-PWR-ON, start
[ 80.718852] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_reg_ctrl:CONSYS-HW-REG-CTRL(0x00000001),start
[ 80.718861] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_reg_ctrl:++
[ 80.718871] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 237
[ 80.718890] vcn18: mode operation not allowed
[ 80.718899] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 241
[ 80.718907] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 244
[ 80.718918] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 246
[ 80.719307] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_reg_ctrl:enable VCN18 ok
[ 80.719471] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 253
[ 80.719494] Unable to handle kernel NULL pointer dereference at virtual address 00000074
[ 80.719506] pgd = 97e17f5d
...
[ 80.990176] [<c0928a4c>] (mutex_lock) from [<c045c3cc>] (regulator_lock_supply+0x24/0x40)
[ 80.998309] [<c045c3cc>] (regulator_lock_supply) from [<c045f654>] (regulator_set_voltage+0x28/0x68)
[ 81.007389] [<c045f654>] (regulator_set_voltage) from [<c04fbefc>] (mtk_wcn_consys_hw_reg_ctrl+0x4e4/0x684)
[ 81.017070] [<c04fbefc>] (mtk_wcn_consys_hw_reg_ctrl) from [<c04fc25c>] (mtk_wcn_consys_hw_pwr_on+0x64/0xbc)
[ 81.026836] [<c04fc25c>] (mtk_wcn_consys_hw_pwr_on) from [<c04fe004>] (wmt_plat_pwr_ctrl+0xa0/0x124)
[ 81.035913] [<c04fe004>] (wmt_plat_pwr_ctrl) from [<c04da030>] (wmt_ctrl_hw_pwr_on+0x68/0x88)
[ 81.044387] [<c04da030>] (wmt_ctrl_hw_pwr_on) from [<c04da11c>] (wmt_ctrl+0x44/0xc0)
[ 81.052081] [<c04da11c>] (wmt_ctrl) from [<c04d64c0>] (wmt_core_ctrl+0x5c/0xe8)
[ 81.059345] [<c04d64c0>] (wmt_core_ctrl) from [<c04d85c8>] (opfunc_pwr_on+0x9c/0x244)
[ 81.067127] [<c04d85c8>] (opfunc_pwr_on) from [<c04d87cc>] (opfunc_func_on+0x5c/0x348)
[ 81.074993] [<c04d87cc>] (opfunc_func_on) from [<c04d63d8>] (wmt_core_opid_handler+0x34/0x54)
[ 81.083465] [<c04d63d8>] (wmt_core_opid_handler) from [<c04d6424>] (wmt_core_opid+0x2c/0x6c)
[ 81.091851] [<c04d6424>] (wmt_core_opid) from [<c04dfbb0>] (wmtd_thread+0x1a0/0x254)
[ 81.099549] [<c04dfbb0>] (wmtd_thread) from [<c0148cf0>] (kthread+0x140/0x170)
[ 81.106731] [<c0148cf0>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
related lines from drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:
printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__); //246
if (regulator_enable(reg_VCN18))
WMT_PLAT_ERR_FUNC("enable VCN18 fail\n");
else
WMT_PLAT_DBG_FUNC("enable VCN18 ok\n");
}
udelay(150);
printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__); //253
if (co_clock_type) {
/*step0,clk buf ctrl */
WMT_PLAT_INFO_FUNC("co clock type(%d),turn on clk buf\n", co_clock_type);
#if CONSYS_CLOCK_BUF_CTRL
clk_buf_ctrl(CLK_BUF_CONN, 1);
#endif
/*if co-clock mode: */
/*2.set VCN28 to SW control mode (with PMIC_WRAP API) */
/*turn on VCN28 LDO only when FMSYS is activated" */
regmap_update_bits(pmic_regmap, 0x41C, 0x1 << 14, 0x0 << 14);/*V28*/
} else {
/*if NOT co-clock: */
/*2.1.switch VCN28 to HW control mode (with PMIC_WRAP API) */
regmap_update_bits(pmic_regmap, 0x41C, 0x1 << 14, 0x1 << 14);/*V28*/
/*2.2.turn on VCN28 LDO (with PMIC_WRAP API)" */
/*fix vcn28 not balance warning */
if (reg_VCN28) {
regulator_set_voltage(reg_VCN28, 2800000, 2800000);
if (regulator_enable(reg_VCN28))
WMT_PLAT_ERR_FUNC("enable VCN_2V8 fail!\n");
else
WMT_PLAT_DBG_FUNC("enable VCN_2V8 ok\n"); // ok-message is printed
}
}
/*3.assert CONNSYS CPU SW reset 0x10007018 "[12]=1'b1 [31:24]=8'h88 (key)" */
printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__); //280 not printed
No, it’s the same issue, please always attach the full dmesg, you removed important logs
dmesg-wifi-4.16.txt (30,9 KB)
sorry, i thought i extratced the important things, which part(s) do you need?
after the first crash there is a second:
dmesg-wifi-4.16-after.log (19,5 KB)
Now I’m sure the issue is caused by: [WMT-CONSYS-HW][E]mtk_wmt_probe(173):CanNot get consys reset. ret=-517
We have to understand why the following line is failing:
rstc = devm_reset_control_get(&pdev->dev, "connsys");
MT2701_TOPRGU_CONN_MCU_RST is defined in include/dt-bindings/reset/mt2701-resets.h which has same value as in 4.14 and this file is included by dtsi
the function devm_reset_control_get itself i have found in include/linux/reset.h
static inline struct reset_control *devm_reset_control_get(
struct device *dev, const char *id)
{
return devm_reset_control_get_exclusive(dev, id);
}
static inline struct reset_control *
__must_check devm_reset_control_get_exclusive(struct device *dev,
const char *id)
{
return __devm_reset_control_get(dev, id, 0, false, false);
}
static inline struct reset_control *__devm_reset_control_get(
struct device *dev, const char *id,
int index, bool shared, bool optional)
{
return optional ? NULL : ERR_PTR(-ENOTSUPP); //<<<<<< optional is always false here, right??
}
edit: include/linux/errno.h:26:#define ENOTSUPP 524 /* Operation is not supported */
=> not 517 (=#define EPROBE_DEFER 517), but found nothing with this constname or 517 in drivers/misc/mediatek
but the main thing is that the object should not be freed, if it’s not created…there should only be an error
It’s the main device object which is freed (in another thread) because the reset control was not found but this happens later in the process, you posted the last error but the first crash is the following one:
[ 53.852535] [WMT-CONSYS-HW][E]mtk_wmt_probe(125):Wmt Cannot find pinctrl default!
[ 53.852584] [WMT-CONSYS-HW][D]mtk_wmt_probe:[CCF]clk_infra_conn_main=21ea8e96
[ 53.852820] [WMT-CONSYS-HW][E]mtk_wmt_probe(173):CanNot get consys reset. ret=-517
[ 53.853184] [WLAN-MOD-INIT][I]do_wlan_drv_init:WLAN-GEN2 driver init, ret:0
[ 53.853190] [WLAN-MOD-INIT][I]do_wlan_drv_init:finish wlan module init
[ 53.853605] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 1020)
[ 53.853701] [WMT-CONSYS-HW][I]mtk_wcn_consys_hw_pwr_on:CONSYS-HW-PWR-ON, start
[ 53.853710] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_reg_ctrl:CONSYS-HW-REG-CTRL(0x00000001),start
[ 53.853715] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_reg_ctrl:++
[ 53.853719] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 237
[ 53.853735] vcn18: mode operation not allowed
[ 53.853739] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 241
[ 53.853743] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 244
[ 53.853751] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 246
[ 53.854185] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_reg_ctrl:enable VCN18 ok
[ 53.854357] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 253
[ 53.854731] [WMT-CONSYS-HW][D]mtk_wcn_consys_hw_reg_ctrl:enable VCN_2V8 ok
[ 53.854744] DEBUG: Passed mtk_wcn_consys_hw_reg_ctrl 280
[ 53.854748] ------------[ cut here ]------------
[ 53.854771] WARNING: CPU: 3 PID: 1025 at drivers/reset/core.c:230 reset_control_reset+0x120/0x14c
[ 53.854775] Modules linked in: mt7530 dsa_core bridge mtk_thermal thermal_sys spi_mt65xx mt6577_auxadc pwm_mediatek fuse ipv6
[ 53.854833] CPU: 3 PID: 1025 Comm: mtk_wmtd Not tainted 4.16.7-bpi-r2-wlan #203
[ 53.854841] Hardware name: Mediatek Cortex-A7 (Device Tree)
[ 53.854876] [<c0113d24>] (unwind_backtrace) from [<c010e4d8>] (show_stack+0x20/0x24)
[ 53.854894] [<c010e4d8>] (show_stack) from [<c090efdc>] (dump_stack+0x90/0xa4)
[ 53.854912] [<c090efdc>] (dump_stack) from [<c0126940>] (__warn+0x104/0x11c)
[ 53.854940] [<c0126940>] (__warn) from [<c0126a90>] (warn_slowpath_null+0x50/0x58)
[ 53.854959] [<c0126a90>] (warn_slowpath_null) from [<c0465aec>] (reset_control_reset+0x120/0x14c)
[ 53.854975] [<c0465aec>] (reset_control_reset) from [<c04fbc54>] (mtk_wcn_consys_hw_reg_ctrl+0x23c/0x684)
[ 53.854987] [<c04fbc54>] (mtk_wcn_consys_hw_reg_ctrl) from [<c04fc25c>] (mtk_wcn_consys_hw_pwr_on+0x64/0xbc)
[ 53.854998] [<c04fc25c>] (mtk_wcn_consys_hw_pwr_on) from [<c04fe004>] (wmt_plat_pwr_ctrl+0xa0/0x124)
[ 53.855011] [<c04fe004>] (wmt_plat_pwr_ctrl) from [<c04da030>] (wmt_ctrl_hw_pwr_on+0x68/0x88)
[ 53.855022] [<c04da030>] (wmt_ctrl_hw_pwr_on) from [<c04da11c>] (wmt_ctrl+0x44/0xc0)
[ 53.855031] [<c04da11c>] (wmt_ctrl) from [<c04d64c0>] (wmt_core_ctrl+0x5c/0xe8)
[ 53.855042] [<c04d64c0>] (wmt_core_ctrl) from [<c04d85c8>] (opfunc_pwr_on+0x9c/0x244)
[ 53.855052] [<c04d85c8>] (opfunc_pwr_on) from [<c04d87cc>] (opfunc_func_on+0x5c/0x348)
[ 53.855075] [<c04d87cc>] (opfunc_func_on) from [<c04d63d8>] (wmt_core_opid_handler+0x34/0x54)
[ 53.855092] [<c04d63d8>] (wmt_core_opid_handler) from [<c04d6424>] (wmt_core_opid+0x2c/0x6c)
[ 53.855105] [<c04d6424>] (wmt_core_opid) from [<c04dfbb0>] (wmtd_thread+0x1a0/0x254)
[ 53.855126] [<c04dfbb0>] (wmtd_thread) from [<c0148cf0>] (kthread+0x140/0x170)
[ 53.855152] [<c0148cf0>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[ 53.855161] Exception stack(0xdc7bbfb0 to 0xdc7bbff8)
[ 53.855169] bfa0: 00000000 00000000 00000000 00000000
[ 53.855178] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 53.855185] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 53.855191] ---[ end trace 566f5802d4157e18 ]---
i have uploaded 2 logs in that posting only the 2nd was downloaded (download-counter).
the devm_reset_control_get-chain looks a bit senseless for me…i found nothing which looks in dts/sysfs for the reset-value
i gues there is somewhere a function-override, but i’ve found no in drivers/misc/mediatek…somewhere the function must make anything…the reset.h seems to be only a fallback if it is not handled anywhere
links to dts (to fast find them):
https://github.com/frank-w/BPI-R2-4.14/blob/4.16-wlan/arch/arm/boot/dts/mt7623.dtsi? https://github.com/frank-w/BPI-R2-4.14/blob/4.16-wlan/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts?
position of crash: https://github.com/frank-w/BPI-R2-4.14/blob/b65262d300ab36cea72d5f6f527c29e42fda26a4/drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c#L281
is it a problem that the regulators are in 4.16 in separate file “arch/arm/boot/dts/mt6323.dtsi” and the path differs a bit:
arch/arm/boot/dts/mt6323.dtsi:
&pwrap {
pmic: mt6323 {
compatible = "mediatek,mt6323";
interrupt-parent = <&pio>;
interrupts = <150 IRQ_TYPE_LEVEL_HIGH>;
interrupt-controller;
#interrupt-cells = <2>;
mt6323regulator: mt6323regulator{
...
}
4.14:
&pwrap {
mt6323 {
...
mt6323regulator: mt6323regulator{
compatible = "mediatek,mt6323-regulator";
....
}
just for reference here my log in 4.14 without debug-option:
[17:45] frank@bpi-r2-e:~$ dmesg |grep WMT
[ 0.000000] [WMT-CONSYS-HW][W]reserve_memory_consys_fn: name: consys-reserve-memory, base: 0xffe00000, size: 0x100000
[ 0.338029] [WMT-DETECT][I]wmt_detect_driver_init:driver(major 154) installed success
[ 84.189964] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 2006)
[ 84.189989] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
[ 84.190046] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
[ 84.190058] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
[ 84.190063] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, chipid:0x00007623
[ 84.195081] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6620.defAnt'.
[ 84.195095] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6628.defAnt'.
[ 84.195102] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6630.defAnt'.
[ 84.198770] [WMT-CONSYS-HW][E]mtk_wmt_probe(122):Wmt Cannot find pinctrl default!
[ 84.199938] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[ 84.205259] [WLAN-MOD-INIT][I]do_wlan_drv_init:WMT-WIFI char dev init, ret:0
[ 84.206937] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(301):Read CONSYS chipId(0xfffff093)
[ 84.208322] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 2006)
[ 84.312027] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6620.defAnt'.
[ 84.312041] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6628.defAnt'.
[ 84.312047] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6630.defAnt'.
[ 84.312264] [WMT-CORE][E]wmt_core_stp_init(648):WMT-CORE: no hif info!
[ 84.312276] [WMT-CORE][E]opfunc_pwr_on(918):WMT-CORE: wmt_core_stp_init fail (-1)
[ 84.312290] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(1), value(0) iRet:(-1)
[ 84.312301] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(0), value(0) iRet:(-1)
[ 84.312315] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(3), type(0), value(0) iRet:(-2)
[ 84.314135] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(301):Read CONSYS chipId(0xfffff093)
[ 84.421899] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6620.defAnt'.
[ 84.421911] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6628.defAnt'.
[ 84.421918] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6630.defAnt'.
[ 84.422132] [WMT-CORE][E]wmt_core_stp_init(648):WMT-CORE: no hif info!
[ 84.422145] [WMT-CORE][E]opfunc_pwr_on(918):WMT-CORE: wmt_core_stp_init fail (-1)
[ 84.422158] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(1), value(0) iRet:(-1)
[ 84.422169] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(0), value(0) iRet:(-1)
[ 84.422183] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(3), type(0), value(0) iRet:(-2)
[ 84.423997] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(301):Read CONSYS chipId(0xfffff093)
[ 84.531911] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6620.defAnt'.
[ 84.531924] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6628.defAnt'.
[ 84.531931] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6630.defAnt'.
[ 84.532165] [WMT-CORE][E]wmt_core_stp_init(648):WMT-CORE: no hif info!
[ 84.532177] [WMT-CORE][E]opfunc_pwr_on(918):WMT-CORE: wmt_core_stp_init fail (-1)
[ 84.532192] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(1), value(0) iRet:(-1)
[ 84.532203] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(5), type(0), value(0) iRet:(-1)
[ 84.532216] [WMT-CORE][E]wmt_core_ctrl(500):WMT-CORE: wmt_core_ctrl failed: id(3), type(0), value(0) iRet:(-2)
[ 84.532436] [WMT-CORE][E]opfunc_func_on(1025):func(0) pwr_on fail(-2)
[ 87.226875] [WMT-CORE][E]opfunc_hif_conf(874):WMT-CORE: WMT HIF info added
[ 87.228676] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(301):Read CONSYS chipId(0xfffff093)
[ 87.331915] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6620.defAnt'.
[ 87.331928] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6628.defAnt'.
[ 87.331935] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field '#mt6630.defAnt'.
[ 93.562904] [MTK-WIFI] WIFI_write: WMT turn on WIFI success!
not clean, but wifi-ap is running for 27 days now without a restart…
@garywang @BitMaster @linkerosa have you an idea why this crash occours? how does devm_reset_control_get works here (code-positions)?
I don’t have a definitive answer for you but perhaps I can help you get in the right direction. I’m not sure what you already know, but i guess it doesn’t hurt.
For finding the kernel source you are looking for, there is a great tool called ‘Elixer Cross Referencer’. If you start following devm_reset_control_get it brings you to this method: __of_reset_control_get. I think it’s likely to fail here somewhere because this method seems to parse the dts node you are configuring. Try to theoretically understand the code, or add some debug statements to find out which check does not pass.
I’ve taken another (theoretical) look and most likely it fails on line 471 since there it returns an EPROBE_DEFER (defined as error 517), consistent with the error code you get back.
Then I would argue the register method either fails is not called at all, because the reset_controller_list is involved, or still some configuration errors in the dts.
Do you know where register-method is called? I have compared blocks between 4.14 and 4.16 many times (btw.copied from). If i do not miss a block these should be the same (except regulators which are already there in separate dtsi). I assume it is not halndled identically. Like reset-cells maybe needed in 4.16…in 4.14 this param is missing,but reqested in both core.c
You could try to change it, I see references to mt6323-regulator in mfd/mt6397-core.c which according to mt7623n_evb_fwu_defconfig is built (CONFIG_MFD_MT6397=y), I’m not sure it will change anything.
Maybe it’s better to debug the problem like bitmaster wrotes…Since the problem seems to be in consys-node/reset and not in regulator (both regulators give positive feedback)
I’ve added some debug statements. Could you please apply the attached patch, reproduce the crash and see what’s in the log?
In your linux folder:
patch -p1 <
reset_ctrl_debug.patch (2.4 KB)
Then we know if we are on the right track.
[ 53.667352] __of_reset_control_get: (drivers/reset/core.c:442) node=consys
[ 53.667360] __of_reset_control_get: (drivers/reset/core.c:450) index = 0
[ 53.667371] __of_reset_control_get: (drivers/reset/core.c:459) ret = (null)
[ 53.667379] __of_reset_control_get: (drivers/reset/core.c:468) 36a018ec == dcf41cbc
[ 53.667385] __of_reset_control_get: (drivers/reset/core.c:468) 36a018ec == f5e83680
[ 53.667390] __of_reset_control_get: (drivers/reset/core.c:468) 36a018ec == e79002de
[ 53.667396] __of_reset_control_get: (drivers/reset/core.c:468) 36a018ec == b839cf8c
[ 53.667401] __of_reset_control_get: (drivers/reset/core.c:478) !rcdev, returning -EPROBE_DEFER
wifi-debug.log (27,5 KB)
as far as i see the problem should be line 457 (above ret=NULL):
ret = of_parse_phandle_with_args(node, "resets", "#reset-cells",
index, &args);
printk(KERN_WARNING "%s: (%s:%i) ret = %p", __FUNCTION__, __FILE__, __LINE__, (void*)ret);
do we need the “#reset-cells” here and which value?? or is index 0 the problem?
if (id) {
index = of_property_match_string(node,
"reset-names", id);
printk(KERN_WARNING "%s: (%s:%i) index = %i", __FUNCTION__, __FILE__, __LINE__, index);
if (index == -EILSEQ)
return ERR_PTR(index);
if (index < 0)
return optional ? NULL : ERR_PTR(-ENOENT);
}