T113 ledc 驱动bug 长时间运行以后出错
-
那个ledc驱动在长时间跑大量数据之后出错啦
报错是这个超时的故障
sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation!
为啥会超时呢,一开始运行的都好好的
但是时间一长比如说,让这个ledc驱动器工作个1-2小时以后
这玩意就概率性的挂掉
报错看上去是超时
现象是有一半左右的灯组就不亮了,而且重启程序那部分不亮的灯也再也不会亮了会不会是芯片过热或者被其他什么东西干扰了,我开机几个小时后那个芯片还是有点点热的
而且这个出错是概率性的,关机一段时间再启动又不会出错啦
下面是那个驱动报错那部分的代码
static irqreturn_t sunxi_ledc_irq_handler(int irq, void *dev_id) { unsigned long flags; long delta_time_ns; u32 irq_status, max_ns; struct sunxi_led *led = sunxi_led_global; struct timespec64 current_time; spin_lock_irqsave(&led->lock, flags); irq_status = sunxi_get_reg(LEDC_INT_STS_REG_OFFSET); sunxi_ledc_clear_all_irq(); if (irq_status & LEDC_TRANS_FINISH_INT) { sunxi_ledc_reset(led); led->length = 0; led->result = RESULT_COMPLETE; wake_up(&led->wait); goto out; } if (irq_status & LEDC_WAITDATA_TIMEOUT_INT) { ktime_get_coarse_real_ts64(¤t_time); delta_time_ns = current_time.tv_sec - led->start_time.tv_sec; delta_time_ns *= 1000 * 1000 * 1000; delta_time_ns += current_time.tv_nsec - led->start_time.tv_nsec; max_ns = led->wait_data_time_ns; if (delta_time_ns <= max_ns) { spin_unlock_irqrestore(&led->lock, flags); return IRQ_HANDLED; } sunxi_ledc_reset(led); if (delta_time_ns <= max_ns * 2) { sunxi_ledc_dma_terminate(led); sunxi_ledc_trans_data(led); } else { LED_ERR("wait time is more than %d ns," "going to reset ledc and drop this operation!\n", max_ns); led->result = RESULT_ERR; wake_up(&led->wait); led->length = 0; } goto out; } if (irq_status & LEDC_FIFO_OVERFLOW_INT) { LED_ERR("there exists fifo overflow issue, irq_status=0x%x!\n", irq_status); sunxi_ledc_reset(led); led->result = RESULT_ERR; wake_up(&led->wait); led->length = 0; goto out; } out: spin_unlock_irqrestore(&led->lock, flags); return IRQ_HANDLED; }
-
“sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation!”
看代码,此打印的意思是ledc传输数据后超过600ms才进入中断处理,看上去是被别的高优先级中断抢占
-
@leomini5 而且再补充一点是,我在这个驱动器上挂了80个灯
然后一直不停的往里面写数据,大概60fps的速度往里面写数据控制灯的颜色才出现上面这个错误的而且我把驱动里面那个fifo深度改成0了,也就是默认DMA方式发送数据,一次发送80个
数据的来源是直接往led->data 里面写了80个灯的数据
而且这个情况很诡异,超时以后只能重启才能正常
所以想请教下各位大佬那个ledc的驱动为啥会超时呢?
写那段超时处理的代码的意义是什么啊? -
@awwwwa 这个中断的优先级可以调高嘛?调高了以后会有影响吗?如何查看系统中的中断情况啊,也就是看看这个中断被谁给抢了
-
贴一下完整的log看看
-
@awwwwa log 被我关掉啦,啥也没
我那个报错是出现错误了以后通过dmesg看到的
这个故障等我回去有机会再长时间测试的时候接上个串口debug弄出来再看吧暂时只有那一段出错的输出
之前也停过
但是那会能确定是ssh的锅
这个程序如果是后台运行的就没问题
然后这个之前开了输出的情况下,ssh时间久了以后也会爆掉,然后网络服务就全部都停掉了
只要是后台运行,或者是换到开机自动运行就没啥问题,干个几个小时也没事 -
@awwwwa. 这个又随机出现了一次,这次好了,刚启动就卡了
[ 9.846865] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096 [ 9.854673] ubi0: good PEBs: 492, bad PEBs: 0, corrupted PEBs: 0 [ 9.861417] ubi0: user volume: 9, internal volumes: 1, max. volumes count: 128 [ 9.869527] ubi0: max/mean erase counter: 6/2, WL threshold: 4096, image sequence number: 0 [ 9.878910] ubi0: available PEBs: 0, total reserved PEBs: 492, PEBs reserved for bad PEB handling: 20 [ 9.889275] ubi0: background thread "ubi_bgt0d" started, PID 1123 [ 9.897344] block ubiblock0_5: created from ubi0:5(rootfs) [ 9.903517] initcall ubi_init+0x0/0x230 returned 0 after 404120 usecs [ 9.910787] calling init_sunxi_hci_class+0x0/0x40 @ 1 [ 9.916628] initcall init_sunxi_hci_class+0x0/0x40 returned 0 after 60 usecs [ 9.924540] calling usb_manager_init+0x0/0x10 @ 1 [ 9.930782] probe of soc@3000000:usbc0@0 returned 1 after 650 usecs [ 9.937986] initcall usb_manager_init+0x0/0x10 returned 0 after 7861 usecs [ 9.945705] calling of_fdt_raw_init+0x0/0x80 @ 1 [ 9.952628] initcall of_fdt_raw_init+0x0/0x80 returned 0 after 1586 usecs [ 9.960266] calling tcp_congestion_default+0x0/0x14 @ 1 [ 9.966229] initcall tcp_congestion_default+0x0/0x14 returned 0 after 3 usecs [ 9.974245] calling regulatory_init_db+0x0/0x90 @ 1 [ 9.979947] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2 [ 9.986496] initcall regulatory_init_db+0x0/0x90 returned 0 after 11 usecs [ 9.989659] cfg80211: failed to load regulatory.db [ 9.997336] calling clk_disable_unused+0x0/0xd8 @ 1 [ 10.008337] clk: Not disabling unused clocks [ 10.013131] initcall clk_disable_unused+0x0/0xd8 returned 0 after 4676 usecs [ 10.021067] calling regulator_init_complete+0x0/0x4c @ 1 [ 10.027140] initcall regulator_init_complete+0x0/0x4c returned 0 after 2 usecs [ 10.035242] calling of_platform_sync_state_init+0x0/0x10 @ 1 [ 10.041720] initcall of_platform_sync_state_init+0x0/0x10 returned 0 after 2 usecs [ 10.050226] calling alsa_sound_last_init+0x0/0x78 @ 1 [ 10.055991] ALSA device list: [ 10.059333] #0: audiocodec [ 10.062566] initcall alsa_sound_last_init+0x0/0x78 returned 0 after 6415 usecs [ 10.070682] alloc_fd: slot 0 not NULL! [ 10.077875] VFS: Mounted root (squashfs filesystem) readonly on device 254:0. [ 10.087696] devtmpfs: mounted [ 10.092960] Freeing unused kernel memory: 1024K [ 10.106639] Run /pseudo_init as init process [ 10.338332] UBIFS (ubi0:7): Mounting in unauthenticated mode [ 10.344830] UBIFS (ubi0:7): background thread "ubifs_bgt0_7" started, PID 1160 [ 10.416213] UBIFS (ubi0:7): recovery needed [ 10.595230] UBIFS (ubi0:7): recovery completed [ 10.600446] UBIFS (ubi0:7): UBIFS: mounted UBI device 0, volume 7, name "rootfs_data" [ 10.609269] UBIFS (ubi0:7): LEB size: 258048 bytes (252 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes [ 10.620423] UBIFS (ubi0:7): FS size: 43352064 bytes (41 MiB, 168 LEBs), journal size 2064385 bytes (1 MiB, 8 LEBs) [ 10.632059] UBIFS (ubi0:7): reserved for root: 2047624 bytes (1999 KiB) [ 10.639502] UBIFS (ubi0:7): media format: w5/r0 (latest is w5/r0), UUID DE81D6D0-9195-433E-8407-0A0643D8B249, small LPT model [ 10.776081] UBIFS (ubi0:8): Mounting in unauthenticated mode [ 10.782660] UBIFS (ubi0:8): background thread "ubifs_bgt0_8" started, PID 1189 [ 10.853232] UBIFS (ubi0:8): recovery needed [ 10.905789] UBIFS (ubi0:8): recovery completed [ 10.910922] UBIFS (ubi0:8): UBIFS: mounted UBI device 0, volume 8, name "UDISK" [ 10.919146] UBIFS (ubi0:8): LEB size: 258048 bytes (252 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes [ 10.930293] UBIFS (ubi0:8): FS size: 6451200 bytes (6 MiB, 25 LEBs), journal size 2064385 bytes (1 MiB, 6 LEBs) [ 10.941623] UBIFS (ubi0:8): reserved for root: 304706 bytes (297 KiB) [ 10.948859] UBIFS (ubi0:8): media format: w5/r0 (latest is w5/r0), UUID 8DD93196-4954-4BBB-BAAA-6A26D5F11D42, small LPT model [ 11.090716] calling init_module+0x0/0x1000 [usb_storage] @ 1192 [ 11.097644] usbcore: registered new interface driver usb-storage [ 11.104418] initcall init_module+0x0/0x1000 [usb_storage] returned 0 after 6720 usecs [ 11.133041] calling init_module+0x0/0x1000 [sunxi_gpadc] @ 1195 [ 11.140948] sunxi_gpadc_init,2151, success [ 11.145919] initcall init_module+0x0/0x1000 [sunxi_gpadc] returned 0 after 4897 usecs [ 11.384656] calling init_module+0x0/0x1000 [8821cs] @ 1199 [ 11.520716] probe of mmc1:0001:1 returned 1 after 129665 usecs [ 11.531869] initcall init_module+0x0/0x1000 [8821cs] returned 0 after 136826 usecs [ 12.671358] start_addr=(0x8000), end_addr=(0x10000), buffer_size=(0x8000), smp_number_max=(4096) [ 12.934865] file system registered [ 12.959776] configfs-gadget 4100000.udc-controller: failed to start g1: -19 [ 12.993136] read descriptors [ 12.996396] read strings [ 13.143867] Mass Storage Function, version: 2009/09/11 [ 13.151051] LUN: removable file: (no medium) [ 13.171584] ffs_data_put(): freeing [ 13.466759] sunxi_usb_udc 4100000.udc-controller: 4100000.udc-controller supply udc not found, using dummy regulator [ 17.316670] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 40.386516] usb1-vbus: disabling [ 73.449941] sunxi-ohci 4200400.ohci1-controller: ohci_irq: fullspeed or lowspeed device disconnect [ 73.460075] sunxi-ehci 4200000.ehci1-controller: ehci_irq: highspeed device connect [ 73.468701] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.496491] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.526478] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.556476] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.586476] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.616476] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.646478] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.676481] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.689137] sunxi-ehci 4200000.ehci1-controller: ehci_irq: highspeed device disconnect [ 73.698074] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.710304] sunxi-ohci 4200400.ohci1-controller: ohci_irq: fullspeed or lowspeed device connect [ 73.720095] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.746480] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.776481] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.806482] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.836477] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.866474] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.896477] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.926474] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.956476] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 73.986474] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.016476] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.046475] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.076473] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.106477] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.136475] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.166475] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.196474] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.226475] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.238724] usb 2-1: new low-speed USB device number 6 using sunxi-ohci [ 74.256473] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.268714] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.280944] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.293195] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.305446] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.317710] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.329974] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.342204] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.354501] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.366733] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.416499] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.446494] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.476487] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.506479] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.536475] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.566484] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.596480] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.626477] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.638736] usb 2-1: device descriptor read/64, error -62 [ 74.656474] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.668724] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.680952] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.696464] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.708702] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.720947] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.733180] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.745403] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.757631] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.769866] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.782084] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.794292] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.806515] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.818737] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.830943] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.843160] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.855376] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.867595] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.879839] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.892065] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.904287] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.916516] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.928765] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.940996] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.953220] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.965472] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.977710] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 74.989919] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.002136] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.014349] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.026586] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.038795] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.051020] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.063238] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.075444] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.096466] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.108682] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.120910] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.133142] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.145366] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.157627] sunxi_ledc_irq_handler()1313 - wait time is more than 600000 ns,going to reset ledc and drop this operation! [ 75.496515] usb 2-1: device descriptor read/64, error -62 [ 75.836505] usb 2-1: new low-speed USB device number 7 using sunxi-ohci [ 76.056508] usb 2-1: device descriptor read/64, error -62 [ 76.406499] usb 2-1: device descriptor read/64, error -62 [ 76.526556] usb usb2-port1: attempt power cycle [ 77.076511] usb 2-1: new low-speed USB device number 8 using sunxi-ohci [ 77.526498] usb 2-1: device not accepting address 8, error -62 [ 77.746515] usb 2-1: new low-speed USB device number 9 using sunxi-ohci [ 78.186522] usb 2-1: device not accepting address 9, error -62 [ 78.193154] usb usb2-port1: unable to enumerate USB device
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号