查找malloc_error_break错误根源方法

本文介绍了如何使用断点调试解决malloc_error_break错误的方法。通过设置断点并利用调试控制台查询特定地址上的对象信息,可以定位到导致错误的具体对象。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

malloc_error_break错误:
1、You'll find out what the object is when you break in the debugger. Just look up the call stack and you will find where you free it. That will tell you which object it is.

The easiest way to set the breakpoint is to:

  1. Goto Run -> Show -> Breakpoints (Alt-Command-B)
  2. Scroll to the bottom of the list and add the symbol malloc_error_break
2、Open up the debugger console by pressing Cmd+Shift+R. There, type
break malloc_error_break
to set a breakpoint at the beginning of the malloc_error_break function.
If you want to find out what object is located at address 0x1068310, you can type the following into the debugger console:
print-object 0x1068310
Of course, you have to do this while the object is still alive -- if the object has already been freed by the time you do this, then this will not work.
以上摘自http://hi.baidu.com/nnao/blog/item/84033e4f7b63663baec3ab6c.html
我重新整理了一下报错内容 #include <malloc.h> #include <time.h> #include <sched.h> #include <errno.h> #include <string.h> #include <pthread.h> #include “test.h” #define THREAD_MAX_N 8 #define SIZE_ALIGN (4 * sizeof(size_t)) #define MMAP_THRESHOLD 131052 #define FREE_CYCLE 16 #define THRESHOLD (MMAP_THRESHOLD / 16) #define ITER_TIME 80 #define NANOSEC_PER_SEC 1e9 #define MALLOC_TIME (ITER_TIME * (THRESHOLD / (SIZE_ALIGN + 1))) void free_all(void **ptr) { for (int j = 0; j < FREE_CYCLE; j++) { if(ptr[j]){ free(ptr[j]); ptr[j]=NULL; } } } void *func(void *arg) { int *val = (int *)arg; cpu_set_t mask; struct timespec ts[2]; int num = 0; void *ptr[FREE_CYCLE]; CPU_ZERO(&mask); CPU_SET(0, &mask); if (sched_setaffinity(0, sizeof(mask), &mask) < 0) { t_error("Set CPU affinity of thread %d failure, ERROR:%s\n", *val, strerror(errno)); return NULL; } for (int i = 0; i < ITER_TIME; ++i) { for (size_t size = 0; size < THRESHOLD; size += SIZE_ALIGN + 1) { if (num == FREE_CYCLE) { free_all(ptr); num = 0; } ptr[num] = malloc(size); if (!ptr[num]) { t_error("Thread %d malloc failed for size %u\n", *val, size); *val = errno; return NULL; } num++; } } *val = 0; return NULL; } int main(int argc, char *argv[]) { printf(“start\n”); struct timespec ts[2]; pthread_attr_t attr; pthread_t tids[THREAD_MAX_N]; int t_result[THREAD_MAX_N] = {0}; int flag = 0; int ret; int i; ret = pthread_attr_init(&attr); if (ret < 0) { t_error("Init pthread attribute failed: %s\n", strerror(errno)); return -1; } clock_gettime(CLOCK_REALTIME, ts); for (i = 0; i < THREAD_MAX_N; ++i) { t_result[i] = i; ret = pthread_create(&tids[i], &attr, func, &t_result[i]); if (ret < 0) { t_error("Create pthread %u failed: %s\n", i, strerror(errno)); flag = -1; break; } } for (i = 0; i < THREAD_MAX_N; ++i) { ret = pthread_join(tids[i], NULL); if (ret < 0) { t_error("Join thread %u failed: %s\n", i, strerror(errno)); } } clock_gettime(CLOCK_REALTIME, ts + 1); (void)pthread_attr_destroy(&attr); double cost = (ts[1].tv_sec - ts[0].tv_sec) * NANOSEC_PER_SEC + (ts[1].tv_nsec - ts[0].tv_nsec); if (!flag) { t_printf("Malloc and free %d threads %d times cost %lf s\n", THREAD_MAX_N, MALLOC_TIME, cost / NANOSEC_PER_SEC); t_status = 0; } return t_status; } 这是openharmony中的一个测试程序,产生了以下内核崩溃,openharmony4.1,linux内核版本5.15.74 第一个内核崩溃日志 [ 309.609779][T14@C0] BUG: KFENCE: use-after-free read in rcu_cblist_dequeue+0x28/0x48 [ 309.609779][T14@C0] [ 309.619642][T14@C0] Use-after-free read at 0x00000000da8dbea8 (in kfence-#60): [ 309.626824][T14@C0] rcu_cblist_dequeue+0x28/0x48 [ 309.631497][T14@C0] rcu_core+0x210/0x58c [ 309.635476][T14@C0] rcu_core_si+0x20/0x30 [ 309.639544][T14@C0] __do_softirq+0x170/0x5c8 [ 309.643867][T14@C0] run_ksoftirqd+0x50/0xac [ 309.648111][T14@C0] smpboot_thread_fn+0x2d4/0x3d8 [ 309.652868][T14@C0] kthread+0x170/0x1d4 [ 309.656761][T14@C0] ret_from_fork+0x10/0x20 [ 309.661001][T14@C0] [ 309.663166][T14@C0] kfence-#60: 0x00000000da8dbea8-0x0000000007d404e2, size=232, cache=vm_area_struct [ 309.663166][T14@C0] [ 309.674502][T14@C0] allocated by task 2266 on cpu 0 at 309.577745s: [ 309.680741][T14@C0] vm_area_dup+0x34/0x104 [ 309.684887][T14@C0] __split_vma+0x78/0x260 [ 309.689041][T14@C0] __do_munmap+0xf8/0x724 [ 309.693195][T14@C0] __vm_munmap.llvm.15742267499309760575+0x94/0x180 [ 309.699600][T14@C0] __arm64_sys_munmap+0x50/0x68 [ 309.704276][T14@C0] invoke_syscall+0x6c/0x15c [ 309.708688][T14@C0] el0_svc_common.llvm.9499517201915720397+0xd4/0x120 [ 309.715262][T14@C0] do_el0_svc+0x34/0xac [ 309.719242][T14@C0] el0_svc+0x2c/0x94 [ 309.722963][T14@C0] el0t_64_sync_handler+0x8c/0xf0 [ 309.727809][T14@C0] el0t_64_sync+0x1b4/0x1b8 [ 309.732137][T14@C0] [ 309.734300][T14@C0] freed by task 14 on cpu 0 at 309.594072s: [ 309.740017][T14@C0] __vm_area_free+0xa0/0xe0 [ 309.744343][T14@C0] rcu_do_batch+0x2ac/0x8f4 [ 309.748669][T14@C0] rcu_core+0x210/0x58c [ 309.752649][T14@C0] rcu_core_si+0x20/0x30 [ 309.756717][T14@C0] __do_softirq+0x170/0x5c8 [ 309.761043][T14@C0] run_ksoftirqd+0x50/0xac [ 309.765284][T14@C0] smpboot_thread_fn+0x2d4/0x3d8 [ 309.770041][T14@C0] kthread+0x170/0x1d4 [ 309.773938][T14@C0] ret_from_fork+0x10/0x20 [ 309.778176][T14@C0] [ 309.780345][T14@C0] CPU: 0 PID: 14 Comm: ksoftirqd/0 Tainted: G W O 5.15.74 #1 [ 309.788651][T14@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 309.794276][T14@C0] ================================================================== [ 309.802149][T14@C0] irqsoff_warn: C0 T:<14>ksoftirqd/0 D:200.198ms F:309.601950s E:199.878ms [ 309.810555][T14@C0] irqsoff_warn: C0 disabled IRQ at: [ 309.810555][T14@C0] trace_hardirqs_off+0x190/0x1bc [ 309.810555][T14@C0] _raw_spin_lock_irqsave+0x98/0xc8 [ 309.810555][T14@C0] kfence_handle_page_fault+0xc4/0x320 [ 309.810555][T14@C0] __do_kernel_fault+0x1a0/0x2f4 [ 309.810555][T14@C0] do_bad_area+0x40/0x100 [ 309.839200][T14@C0] irqsoff_warn: C0 enabled IRQ at: [ 309.839200][T14@C0] trace_hardirqs_on+0x19c/0x1c8 [ 309.839200][T14@C0] _raw_spin_unlock_irqrestore+0x38/0x70 [ 309.839200][T14@C0] kfence_handle_page_fault+0x2a8/0x320 [ 309.839200][T14@C0] __do_kernel_fault+0x1a0/0x2f4 [ 309.839200][T14@C0] do_bad_area+0x40/0x100 [ 314.997853][T2080@C0] p->addr = 0x0000000013c9adbe, pc = 0xffffffc0081de8f8, pstate = 0x20400005 [ 315.007246][T2080@C0] sprd_serror_debug: panic hook handler [ 315.007298][T2080@C0] Kernel panic - not syncing: CFI failure (target: 0x7fb3780000) [ 315.020480][T2080@C0] CPU: 0 PID: 2080 Comm: irq/128-dwc3 Tainted: G B W O 5.15.74 #1 [ 315.029220][T2080@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 315.035018][T2080@C0] Call trace: [ 315.038305][T2080@C0] dump_backtrace.cfi_jt+0x0/0x8 [ 315.043236][T2080@C0] show_stack+0x28/0x38 [ 315.047392][T2080@C0] dump_stack_lvl+0x84/0xcc [ 315.051892][T2080@C0] panic+0x180/0x444 [ 315.055787][T2080@C0] __cfi_slowpath_diag+0x1e4/0x230 [ 315.060894][T2080@C0] rcu_do_batch+0x36c/0x8f4 [ 315.065392][T2080@C0] rcu_core+0x210/0x58c [ 315.069547][T2080@C0] rcu_core_si+0x20/0x30 [ 315.073786][T2080@C0] __do_softirq+0x170/0x5c8 [ 315.078287][T2080@C0] do_softirq+0x78/0xf0 [ 315.082441][T2080@C0] __local_bh_enable_ip+0xec/0x138 [ 315.087544][T2080@C0] local_bh_enable+0x28/0x38 [ 315.092134][T2080@C0] dwc3_thread_interrupt+0x12bc/0x15d0 [ 315.097580][T2080@C0] irq_thread_fn+0x54/0xe4 [ 315.101999][T2080@C0] irq_thread+0x1c8/0x3b8 [ 315.106326][T2080@C0] kthread+0x170/0x1d4 [ 315.110392][T2080@C0] ret_from_fork+0x10/0x20 [ 315.114804][T2080@C0] SMP: stopping secondary CPUs [ 315.119802][ T0@C3] unisoc-dump-info: CPU3: stopping… [ 315.125327][ T0@C2] unisoc-dump-info: CPU2: stopping… [ 315.130842][ T0@C1] unisoc-dump-info: CPU1: stopping… [ 315.136368][ T0@C6] unisoc-dump-info: CPU6: stopping… [ 315.142057][ T0@C5] unisoc-dump-info: CPU5: stopping… [ 315.147740][ T0@C4] unisoc-dump-info: CPU4: stopping… [ 315.153429][ T0@C7] unisoc-dump-info: CPU7: stopping… [ 315.159266][T2080@C0] ddr_cur_freq: 3 [ 315.172415][T2080@C0] sysdump: (sysdump_panic_event) ------ in (0) [ 315.178677][T2080@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 315.185210][T2080@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 316.191817][T2080@C0] sysdump: [ 316.194858][T2080@C0] sysdump: ***************************************************** [ 316.202560][T2080@C0] sysdump: * * [ 316.210263][T2080@C0] sysdump: * Sysdump enter, preparing debug info to dump … * [ 316.217965][T2080@C0] sysdump: * * [ 316.225666][T2080@C0] sysdump: ***************************************************** [ 316.233367][T2080@C0] sysdump: [ 316.236505][T2080@C0] sysdump: reason: CFI failure (target: 0x7fb3780000), sprd_sysdump_info->crash_key: 0 [ 316.246187][T2080@C0] sysdump: [ 316.249230][T2080@C0] sysdump: ***************************************************** [ 316.256931][T2080@C0] sysdump: * * [ 316.264632][T2080@C0] sysdump: * Preparing debug info done … * [ 316.272335][T2080@C0] sysdump: * * [ 316.280036][T2080@C0] sysdump: ***************************************************** [ 316.287738][T2080@C0] sysdump: [ 317.291051][T2080@C0] Kernel Offset: 0x80000 from 0xffffffc008000000 [ 317.297312][T2080@C0] PHYS_OFFSET: 0x80000000 [ 317.301635][T2080@C0] CPU features: 0x2,00000b83,23300e42 [ 317.307000][T2080@C0] Memory Limit: none 第二个内核崩溃日志 [ 2060.258228][T3311@C0] ------------[ cut here ]------------ [ 2060.263654][T3311@C0] kernel BUG at mm/mmap.c:721! [ 2060.268431][T3311@C0] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 2060.274774][T3311@C0] —Die flow print cache!— [ 2060.279467][T3311@C0] [ 2060.281812][T3311@C0] C0 X0: 0xffffff809453cd18: [ 2060.286423][T3311@C0] C0 cd18 95fbf448 ffffff80 00000003 00000000 9453cd28 f fffff80 9453cd28 ffffff80 [ 2060.295724][T3311@C0] C0 cd38 00000000 00000000 0a526818 ffffffc0 00000001 0 0000000 94363a40 ffffff80 [ 2060.305022][T3311@C0] C0 cd58 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.314323][T3311@C0] C0 cd78 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.323624][T3311@C0] C0 cd98 8a6e0000 0000007f 8a6e8000 0000007f 95410740 f fffff80 93184f68 ffffff80 [ 2060.332925][T3311@C0] C0 cdb8 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.342225][T3311@C0] C0 cdd8 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.351530][T3311@C0] C0 cdf8 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4810 ffffff80 [ 2060.360828][T3311@C0] [ 2060.363172][T3311@C0] C0 X1: 0xffffff8092fcd278: [ 2060.367784][T3311@C0] C0 d278 00000001 00000002 92fcd230 ffffff80 989d47e0 f fffff80 989d47e0 ffffff80 [ 2060.377084][T3311@C0] C0 d298 747131fc 192c0676 92fcd2a0 ffffff80 00000001 0 0000000 93f90000 ffffff80 [ 2060.386385][T3311@C0] C0 d2b8 00000000 00000000 92fcd2c0 ffffff80 92fcd2c0 f fffff80 00000000 00000000 [ 2060.395684][T3311@C0] C0 d2d8 00000000 00000000 00000000 00000000 00000001 0 0000003 92fcd2a0 ffffff80 [ 2060.404987][T3311@C0] C0 d2f8 947d4860 ffffff80 947d4860 ffffff80 747131fc 8 92d0676 92fcd310 ffffff80 [ 2060.414286][T3311@C0] C0 d318 00000000 00000000 00000000 00000000 00000000 0 0000000 92fcd330 ffffff80 [ 2060.423588][T3311@C0] C0 d338 92fcd330 ffffff80 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.432887][T3311@C0] C0 d358 00000000 00000000 92fcd310 ffffff80 00000000 0 0000000 00000000 00000000 [ 2060.442188][T3311@C0] [ 2060.444532][T3311@C0] C0 X4: 0xffffff8091b9c320: [ 2060.449144][T3311@C0] C0 c320 00000000 00000000 0000000a 00000000 91b9c330 f fffff80 91b9c330 ffffff80 [ 2060.458443][T3311@C0] C0 c340 00000000 00000000 0a526818 ffffffc0 00000000 0 0000000 965d1540 ffffff80 [ 2060.467744][T3311@C0] C0 c360 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.477045][T3311@C0] C0 c380 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.486344][T3311@C0] C0 c3a0 00000000 00000000 8a6e0000 0000007f 00000000 0 0000000 00000000 00000000 [ 2060.495645][T3311@C0] C0 c3c0 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.504947][T3311@C0] C0 c3e0 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.514247][T3311@C0] C0 c400 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4850 ffffff80 [ 2060.523548][T3311@C0] [ 2060.525893][T3311@C0] C0 X21: 0xffffff808102ce20: [ 2060.530588][T3311@C0] C0 ce20 93a55150 ffffff80 0a526818 ffffffc0 00000023 0 0000000 89da97c0 ffffff80 [ 2060.539890][T3311@C0] C0 ce40 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.549190][T3311@C0] C0 ce60 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.558491][T3311@C0] C0 ce80 8a4c0000 0000007f 8a4ca000 0000007f 8102ded0 f fffff80 91b9dc18 ffffff80 [ 2060.567791][T3311@C0] C0 cea0 97c62cd0 ffffff80 91ebe678 ffffff80 95402020 f fffff80 008c56a8 ffffff01 [ 2060.577094][T3311@C0] C0 cec0 9885e400 ffffff80 00000fc3 00600000 00000071 0 0000000 966d6d08 ffffff80 [ 2060.586394][T3311@C0] C0 cee0 00000000 00000000 00000000 00000000 00000009 0 0000000 8102cef8 ffffff80 [ 2060.595694][T3311@C0] C0 cf00 8102cef8 ffffff80 00000000 00000000 0a526818 f fffffc0 00000000 00000000 [ 2060.604994][T3311@C0] [ 2060.607339][T3311@C0] C0 X23: 0xffffff8092fcd220: [ 2060.612036][T3311@C0] C0 d220 947d4ba0 ffffff80 7471301c a92c0676 92fcd230 f fffff80 00000000 00000000 [ 2060.621335][T3311@C0] C0 d240 00000000 00000000 00000000 00000000 92fcd250 f fffff80 92fcd250 ffffff80 [ 2060.630640][T3311@C0] C0 d260 00000000 00000000 00000000 00000000 00000000 0 0000000 00000001 00000002 [ 2060.639938][T3311@C0] C0 d280 92fcd230 ffffff80 989d47e0 ffffff80 989d47e0 f fffff80 747131fc 192c0676 [ 2060.649241][T3311@C0] C0 d2a0 92fcd2a0 ffffff80 00000001 00000000 93f90000 f fffff80 00000000 00000000 [ 2060.658542][T3311@C0] C0 d2c0 92fcd2c0 ffffff80 92fcd2c0 ffffff80 00000000 0 0000000 00000000 00000000 [ 2060.667839][T3311@C0] C0 d2e0 00000000 00000000 00000001 00000003 92fcd2a0 f fffff80 947d4860 ffffff80 [ 2060.677141][T3311@C0] C0 d300 947d4860 ffffff80 747131fc 892d0676 92fcd310 f fffff80 00000000 00000000 [ 2060.686439][T3311@C0] [ 2060.688786][T3311@C0] C0 X25: 0xffffff809453cd18: [ 2060.693483][T3311@C0] C0 cd18 95fbf448 ffffff80 00000003 00000000 9453cd28 f fffff80 9453cd28 ffffff80 [ 2060.702782][T3311@C0] C0 cd38 00000000 00000000 0a526818 ffffffc0 00000001 0 0000000 94363a40 ffffff80 [ 2060.712085][T3311@C0] C0 cd58 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.721387][T3311@C0] C0 cd78 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.730685][T3311@C0] C0 cd98 8a6e0000 0000007f 8a6e8000 0000007f 95410740 f fffff80 93184f68 ffffff80 [ 2060.739988][T3311@C0] C0 cdb8 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.749288][T3311@C0] C0 cdd8 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.758590][T3311@C0] C0 cdf8 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4810 ffffff80 [ 2060.767889][T3311@C0] [ 2060.770233][T3311@C0] C0 X26: 0xffffff80954106c0: [ 2060.774932][T3311@C0] C0 06c0 00000000 00000000 00000000 00000000 954106d0 f fffff80 954106d0 ffffff80 [ 2060.784230][T3311@C0] C0 06e0 00000000 00000000 00000000 00000000 07f835a5 0 0000000 00000000 00000000 [ 2060.793533][T3311@C0] C0 0700 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.802831][T3311@C0] C0 0720 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.812133][T3311@C0] C0 0740 8a6f0000 0000007f 8a6f2000 0000007f 954100e8 f fffff80 9453cd98 ffffff80 [ 2060.821433][T3311@C0] C0 0760 91ebe678 ffffff80 95402f88 ffffff80 931842d8 f fffff80 00008000 00000000 [ 2060.830735][T3311@C0] C0 0780 9885e400 ffffff80 00000f82 04600000 00100070 0 0000000 00000000 00000000 [ 2060.840035][T3311@C0] C0 07a0 00000000 00000000 00000000 00000000 00000000 0 0000000 954107b8 ffffff80 [ 2060.849335][T3311@C0] [ 2060.851680][T3311@C0] C0 X27: 0xffffff8091b9c320: [ 2060.856379][T3311@C0] C0 c320 00000000 00000000 0000000a 00000000 91b9c330 f fffff80 91b9c330 ffffff80 [ 2060.865677][T3311@C0] C0 c340 00000000 00000000 0a526818 ffffffc0 00000000 0 0000000 965d1540 ffffff80 [ 2060.874979][T3311@C0] C0 c360 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.884277][T3311@C0] C0 c380 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.893578][T3311@C0] C0 c3a0 00000000 00000000 8a6e0000 0000007f 00000000 0 0000000 00000000 00000000 [ 2060.902880][T3311@C0] C0 c3c0 93184db9 ffffff80 00000000 00000000 93184f88 f fffff80 00000000 00000000 [ 2060.912179][T3311@C0] C0 c3e0 9885e400 ffffff80 00000fc3 00600000 00100073 0 0000000 950c2900 ffffff80 [ 2060.921482][T3311@C0] C0 c400 00000000 00000000 00000000 00000000 00000000 0 0000000 947d4850 ffffff80 [ 2060.930780][T3311@C0] [ 2060.933127][T3311@C0] C0 X28: 0xffffff809453cd90: [ 2060.937822][T3311@C0] C0 cd90 00000000 00000000 8a6e0000 0000007f 8a6e8000 0 000007f 95410740 ffffff80 [ 2060.947123][T3311@C0] C0 cdb0 93184f68 ffffff80 93184db9 ffffff80 00000000 0 0000000 93184f88 ffffff80 [ 2060.956427][T3311@C0] C0 cdd0 00000000 00000000 9885e400 ffffff80 00000fc3 0 0600000 00100073 00000000 [ 2060.965726][T3311@C0] C0 cdf0 950c2900 ffffff80 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.975027][T3311@C0] C0 ce10 947d4810 ffffff80 947d4810 ffffff80 92fcd2a0 f fffff80 00000000 00000000 [ 2060.984326][T3311@C0] C0 ce30 0ff14dc6 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2060.993628][T3311@C0] C0 ce50 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 2061.002929][T3311@C0] C0 ce70 00000000 00000000 00000000 00000000 10680000 0 000007f 106a4000 0000007f [ 2061.012233][T3311@C0] sysdump: dump_die_cb save pregs_die_g ok . [ 2061.018225][T3311@C0] Modules linked in: npu_img_vha(O) sprd_vdsp(O) vpu(O) s prdbt_tty(O) mali_kbase(O) sprd_wlan_combo(O) flash_ic_aw3641(O) chsc5xxx(O) spr d_compr_2stage_dma sprd_dmaengine_pcm snd_soc_sprd_dai snd_soc_sprd_vbc_fe snd_s oc_sprd_vbc_v4 sprd_platform_pcm_routing snd_soc_sprd_tdm snd_soc_sprd_pdm_r2p0 snd_soc_sprd_dummy_codec snd_soc_unisoc_dp_codec snd_soc_sprd_codec_ump9620 snd_ soc_sprd_codec_ump9620_power_dev snd_soc_sprd_codec_ump9620_power snd_soc_sprd_c ard snd_soc_sprd_ocp96011 snd_soc_sprd_pa_aw87390 voice_trigger_irq sprd_cp_dvfs sprd_pmic_wdt sprd_audcp_boot sprd_audcp_dvfs mcdt_hw_r2p0 audio_pipe sprd_apip e sprd_audio_usb_offload audio_dsp_dump audio_sipc audio_mem agdsp_pd [ 2061.080043][T3311@C0] CPU: 0 PID: 3311 Comm: malloc-multi-th Tainted: G W O 5.15.74 #1 [ 2061.089077][T3311@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 2061.094901][T3311@C0] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS B TYPE=–) [ 2061.102723][T3311@C0] pc : __vma_adjust+0xc44/0xc78 [ 2061.107589][T3311@C0] lr : __vma_adjust+0x260/0xc78 [ 2061.112460][T3311@C0] sp : ffffffc0144d3c10 [ 2061.116630][T3311@C0] x29: ffffffc0144d3c70 x28: ffffff809453ce10 x27: ffffff 8091b9c3a0 [ 2061.124628][T3311@C0] x26: ffffff8095410740 x25: ffffff809453cd98 x24: 000000 0000000000 [ 2061.132625][T3311@C0] x23: ffffff8092fcd2a0 x22: 0000000000000000 x21: ffffff 808102cea0 [ 2061.140620][T3311@C0] x20: 0000000000000000 x19: ffffffc00ac5e000 x18: ffffff c0132f5050 [ 2061.148618][T3311@C0] x17: 0000000000000000 x16: 0000000000000000 x15: 000000 0000000008 [ 2061.156613][T3311@C0] x14: 0000000000000000 x13: 0000000000000004 x12: 000000 0c78d2bef3 [ 2061.164612][T3311@C0] x11: 0000007f8a4c0000 x10: 0000007f8a6e0000 x9 : 000000 0000000000 [ 2061.172611][T3311@C0] x8 : 0000000000000000 x7 : 0000000000000000 x6 : 000000 0000000000 [ 2061.180607][T3311@C0] x5 : 0000000000000000 x4 : ffffff8091b9c3a0 x3 : ffffff c0144d3aa0 [ 2061.188604][T3311@C0] x2 : 000000010006b6fe x1 : ffffff8092fcd2f8 x0 : ffffff 809453cd98 [ 2061.196599][T3311@C0] Call trace: [ 2061.199906][T3311@C0] __vma_adjust+0xc44/0xc78 [ 2061.204424][T3311@C0] __split_vma+0x14c/0x260 [ 2061.208855][T3311@C0] __do_munmap+0x168/0x724 [ 2061.213291][T3311@C0] __vm_munmap.llvm.15742267499309760575+0x94/0x180 [ 2061.219896][T3311@C0] __arm64_sys_munmap+0x50/0x68 [ 2061.224761][T3311@C0] invoke_syscall+0x6c/0x15c [ 2061.229369][T3311@C0] el0_svc_common.llvm.9499517201915720397+0xd4/0x120 [ 2061.236150][T3311@C0] do_el0_svc+0x34/0xac [ 2061.240324][T3311@C0] el0_svc+0x2c/0x94 [ 2061.244235][T3311@C0] el0t_64_sync_handler+0x8c/0xf0 [ 2061.249276][T3311@C0] el0t_64_sync+0x1b4/0x1b8 [ 2061.253801][T3311@C0] Code: 9400281d aa1303ea 35fffe40 17fffd49 (d4210000) [ 2061.260749][T3311@C0] —[ end trace 1949c3d540cc5187 ]— [ 2061.287887][T238@C7] [SPRD_PDBG] #---------PDBG LIGHT SLEEP START---------# [ 2061.288611][T3311@C0] p->addr = 0x00000000d7c1766e, pc = 0xffffffc008 1de8f8, pstate = 0x604003c5 [ 2061.294790][T238@C7] [SPRD_PDBG] [SLP_STATE] deep: 0xfffffffffffffecc, light: 0xffffffffffffff20 [ 2061.304250][T3311@C0] sprd_serror_debug: panic hook handler [ 2061.304258][T3311@C0] Kernel panic - not syncing: Oops - BUG: Fatal exception [ 2061.304261][T3311@C0] SMP: stopping secondary CPUs [ 2061.304461][T238@C7] unisoc-dump-info: CPU7: stopping… [ 2061.304900][ T0@C1] unisoc-dump-info: CPU1: stopping… [ 2061.305319][ T0@C6] unisoc-dump-info: CPU6: stopping… [ 2061.305892][ T0@C2] unisoc-dump-info: CPU2: stopping… [ 2061.306313][ T0@C3] unisoc-dump-info: CPU3: stopping… [ 2061.306732][ T0@C5] unisoc-dump-info: CPU5: stopping… [ 2061.307305][ T0@C4] unisoc-dump-info: CPU4: stopping… [ 2061.307871][T3311@C0] ddr_cur_freq: 1 [ 2061.318118][T3311@C0] sysdump: (sysdump_panic_event) ------ in (0) [ 2061.318303][T3311@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 2061.318315][T3311@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 2062.318360][T3311@C0] sysdump: [ 2062.318362][T3311@C0] sysdump: ********************************************** ******* [ 2062.318365][T3311@C0] sysdump: * * [ 2062.318367][T3311@C0] sysdump: * Sysdump enter, preparing debug info to dump … * [ 2062.318369][T3311@C0] sysdump: * * [ 2062.318372][T3311@C0] sysdump: ********************************************** ******* [ 2062.318373][T3311@C0] sysdump: [ 2062.318392][T3311@C0] sysdump: reason: Oops - BUG: Fatal exception, sprd_sysd ump_info->crash_key: 0 [ 2062.318523][T3311@C0] sysdump: [ 2062.318527][T3311@C0] sysdump: ********************************************** ******* [ 2062.318528][T3311@C0] sysdump: * * [ 2062.318530][T3311@C0] sysdump: * Preparing debug info done … * [ 2062.318532][T3311@C0] sysdump: * * [ 2062.318535][T3311@C0] sysdump: ********************************************** ******* [ 2062.318536][T3311@C0] sysdump: [ 2063.318737][T3311@C0] Kernel Offset: 0x80000 from 0xffffffc008000000 [ 2063.318747][T3311@C0] PHYS_OFFSET: 0x80000000 [ 2063.318749][T3311@C0] CPU features: 0x2,00000b83,23300e42 [ 2063.318756][T3311@C0] Memory Limit: none static void __insert_vm_struct(struct mm_struct *mm, struct vm_area_struct *vma) { struct vm_area_struct *prev; struct rb_node **rb_link, *rb_parent; if (find_vma_links(mm, vma->vm_start, vma->vm_end, &prev, &rb_link, &rb_parent)) BUG(); __vma_link(mm, vma, prev, rb_link, rb_parent); mm->map_count++; } mmap.c 721代码如上 BUG();,如何修复这个问题 第3个内核崩溃 [ 102.427572][T14@C0] refcount_t: underflow; use-after-free. [ 102.433062][T14@C0] WARNING: CPU: 0 PID: 14 at lib/refcount.c:28 refcount_war n_saturate+0x110/0x154 [ 102.442008][T14@C0] Modules linked in: npu_img_vha(O) sprd_vdsp(O) vpu(O) spr dbt_tty(O) mali_kbase(O) sprd_wlan_combo(O) flash_ic_aw3641(O) chsc5xxx(O) sprd_ compr_2stage_dma sprd_dmaengine_pcm snd_soc_sprd_dai snd_soc_sprd_vbc_fe snd_soc _sprd_vbc_v4 sprd_platform_pcm_routing snd_soc_sprd_tdm snd_soc_sprd_pdm_r2p0 sn d_soc_sprd_dummy_codec snd_soc_unisoc_dp_codec snd_soc_sprd_codec_ump9620 snd_so c_sprd_codec_ump9620_power_dev snd_soc_sprd_codec_ump9620_power snd_soc_sprd_car d snd_soc_sprd_ocp96011 snd_soc_sprd_pa_aw87390 voice_trigger_irq sprd_cp_dvfs s prd_pmic_wdt sprd_audcp_boot sprd_audcp_dvfs mcdt_hw_r2p0 audio_pipe sprd_apipe sprd_audio_usb_offload audio_dsp_dump audio_sipc audio_mem agdsp_pd [ 102.503378][T14@C0] CPU: 0 PID: 14 Comm: ksoftirqd/0 Tainted: G W O 5.15.74 #1 [ 102.511681][T14@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 102.517307][T14@C0] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTY PE=--) [ 102.524921][T14@C0] pc : refcount_warn_saturate+0x110/0x154 [ 102.530460][T14@C0] lr : refcount_warn_saturate+0x110/0x154 [ 102.535998][T14@C0] sp : ffffffc00b0bbc00 [ 102.539982][T14@C0] x29: ffffffc00b0bbc00 x28: ffffff8080352abc x27: 00000000 00000000 [ 102.547768][T14@C0] x26: ffffff8080352610 x25: ffffffc00ac37000 x24: ffffffc0 098541b0 [ 102.555557][T14@C0] x23: ffffff8080352600 x22: 0000000000000006 x21: 00000000 0000000a [ 102.563344][T14@C0] x20: ffffff817cf03dc0 x19: ffffff808bc0a658 x18: ffffffc0 0b08d048 [ 102.571132][T14@C0] x17: ffffffffffffffff x16: 0000000000000004 x15: 00000000 00000004 [ 102.578924][T14@C0] x14: 000000000000074a x13: ffffffc00abda7b0 x12: 00000000 00000003 [ 102.586709][T14@C0] x11: 000000010000574a x10: 0000000000000101 x9 : 0b06cdfe fb609000 [ 102.594498][T14@C0] x8 : 0b06cdfefb609000 x7 : 545b5d3237353732 x6 : 342e3230 3120205b [ 102.602290][T14@C0] x5 : ffffffc00aef35b4 x4 : ffffffc00b0bb9b7 x3 : 00000000 00000000 [ 102.610076][T14@C0] x2 : 0000000000000000 x1 : ffffffc00b0bb9a0 x0 : 00000000 00000026 [ 102.617865][T14@C0] Call trace: [ 102.620981][T14@C0] refcount_warn_saturate+0x110/0x154 [ 102.626174][T14@C0] __vm_area_free+0xbc/0xe0 [ 102.630498][T14@C0] rcu_do_batch+0x2ac/0x8f4 [ 102.634826][T14@C0] rcu_core+0x210/0x58c [ 102.638806][T14@C0] rcu_core_si+0x20/0x30 [ 102.642875][T14@C0] __do_softirq+0x170/0x5c8 [ 102.647203][T14@C0] run_ksoftirqd+0x50/0xac [ 102.651442][T14@C0] smpboot_thread_fn+0x2d4/0x3d8 [ 102.656202][T14@C0] kthread+0x170/0x1d4 [ 102.660096][T14@C0] ret_from_fork+0x10/0x20 [ 102.664338][T14@C0] ---[ end trace 4990effe52f21971 ]--- [ 102.669634][T14@C0] irqsoff_warn: C0 T:<14>ksoftirqd/0 D:236.601ms F:102.4330 31s E:236.193ms [ 102.678027][T14@C0] irqsoff_warn: C0 disabled IRQ at: [ 102.678027][T14@C0] trace_hardirqs_off_finish+0x22c/0x270 [ 102.678027][T14@C0] arm64_enter_el1_dbg+0x54/0x70 [ 102.678027][T14@C0] el1_dbg+0x2c/0x68 [ 102.678027][T14@C0] el1h_64_sync_handler+0x48/0xa4 [ 102.678027][T14@C0] el1h_64_sync+0x7c/0x80 [ 102.705538][T14@C0] irqsoff_warn: C0 enabled IRQ at: [ 102.705538][T14@C0] trace_hardirqs_on+0x19c/0x1c8 [ 102.705538][T14@C0] exit_to_kernel_mode+0x48/0x5c [ 102.705538][T14@C0] exit_el1_irq_or_nmi+0x18/0x28 [ 102.705538][T14@C0] el1_interrupt+0x54/0x68 [ 102.705538][T14@C0] el1h_64_irq_handler+0x20/0x30 [ 103.157689][T2335@C0] Unable to handle kernel paging request at virtual addre ss ff95d29bb82a9843 [ 103.166489][T2335@C0] Mem abort info: [ 103.170056][T2335@C0] ESR = 0x96000004 [ 103.174117][T2335@C0] EC = 0x25: DABT (current EL), IL = 32 bits [ 103.180298][T2335@C0] SET = 0, FnV = 0 [ 103.184276][T2335@C0] EA = 0, S1PTW = 0 [ 103.188287][T2335@C0] FSC = 0x04: level 0 translation fault [ 103.194013][T2335@C0] Data abort info: [ 103.197724][T2335@C0] ISV = 0, ISS = 0x00000004 [ 103.202388][T2335@C0] CM = 0, WnR = 0 [ 103.206187][T2335@C0] [ff95d29bb82a9843] address between user and kernel addr ess ranges [ 103.214172][T2335@C0] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 103.220514][T2335@C0] ---Die flow print cache!--- [ 103.225185][T2335@C0] [ 103.227520][T2335@C0] C0 X0: 0xffffff8080005c00: [ 103.232113][T2335@C0] C0 5c00 801e0d80 ffffff80 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.241368][T2335@C0] C0 5c20 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.250628][T2335@C0] C0 5c40 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.259888][T2335@C0] C0 5c60 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.269148][T2335@C0] C0 5c80 0ab6bac0 ffffffc0 44040000 00000000 00000005 0 0000000 000000e8 000000e8 [ 103.278407][T2335@C0] C0 5ca0 1a7b9612 00000701 00000070 0000001e 00010023 0 0010023 00000011 00040000 [ 103.287668][T2335@C0] C0 5cc0 00000001 00000000 00000000 00000000 000000e8 0 0000008 00000000 00000000 [ 103.296927][T2335@C0] C0 5ce0 0a41d0d1 ffffffc0 80005b68 ffffff80 80005e68 f fffff80 0a41d0d1 ffffffc0 [ 103.306184][T2335@C0] [ 103.308519][T2335@C0] C0 X10: 0xffffff808bfb9290: [ 103.313197][T2335@C0] C0 9290 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.322454][T2335@C0] C0 92b0 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.331716][T2335@C0] C0 92d0 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.340975][T2335@C0] C0 92f0 00000000 00000000 00000000 00000000 00000008 0 0000000 82917000 00000000 [ 103.350235][T2335@C0] C0 9310 00000001 00000001 1388d000 ffffffc0 1388d0d8 f fffffc0 00000000 00000000 [ 103.359494][T2335@C0] C0 9330 13be8000 ffffffc0 00000001 00400040 00000000 0 0000001 00000000 00000000 [ 103.368753][T2335@C0] C0 9350 00000030 00000000 00000000 00000009 ffff3fc7 0 0000000 94d62600 ffffff80 [ 103.378012][T2335@C0] C0 9370 00000001 00000000 00000001 00000078 00000078 0 0000078 00000000 00000000 [ 103.387272][T2335@C0] [ 103.389606][T2335@C0] C0 X20: 0xffffff8080005c00: [ 103.394283][T2335@C0] C0 5c00 801e0d80 ffffff80 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.403541][T2335@C0] C0 5c20 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.412800][T2335@C0] C0 5c40 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.422060][T2335@C0] C0 5c60 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.431323][T2335@C0] C0 5c80 0ab6bac0 ffffffc0 44040000 00000000 00000005 0 0000000 000000e8 000000e8 [ 103.440581][T2335@C0] C0 5ca0 1a7b9612 00000701 00000070 0000001e 00010023 0 0010023 00000011 00040000 [ 103.449839][T2335@C0] C0 5cc0 00000001 00000000 00000000 00000000 000000e8 0 0000008 00000000 00000000 [ 103.459099][T2335@C0] C0 5ce0 0a41d0d1 ffffffc0 80005b68 ffffff80 80005e68 f fffff80 0a41d0d1 ffffffc0 [ 103.468357][T2335@C0] [ 103.470692][T2335@C0] C0 X25: 0xffffff808829f0e8: [ 103.475370][T2335@C0] C0 f0e8 00000000 00000000 94a58dc0 ffffff80 00000000 0 0000000 00000000 00000000 [ 103.484628][T2335@C0] C0 f108 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.493887][T2335@C0] C0 f128 00000000 00000000 00000000 00000000 9e6f0000 0 000007f 9e700000 0000007f [ 103.503149][T2335@C0] C0 f148 923f81d0 ffffff80 8f6f6e80 ffffff80 8f6f6ea1 f fffff80 00000000 00000000 [ 103.512409][T2335@C0] C0 f168 00000000 00000000 0001f000 00000000 8a438000 f fffff80 00000fc3 00600000 [ 103.521669][T2335@C0] C0 f188 00100073 00000000 93c51f80 ffffff80 00000000 0 0000000 00000000 00000000 [ 103.530926][T2335@C0] C0 f1a8 00000000 00000000 93c6a5d0 ffffff80 93c6a5d0 f fffff80 978660e0 ffffff80 [ 103.540188][T2335@C0] C0 f1c8 00000000 00000000 07f9e6f0 00000000 00000000 0 0000000 00000000 00000000 [ 103.549444][T2335@C0] [ 103.551778][T2335@C0] C0 X26: 0xffffff808829f0d8: [ 103.556454][T2335@C0] C0 f0d8 00000000 00000000 0a526818 ffffffc0 00000000 0 0000000 94a58dc0 ffffff80 [ 103.565715][T2335@C0] C0 f0f8 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.574974][T2335@C0] C0 f118 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.584235][T2335@C0] C0 f138 9e6f0000 0000007f 9e700000 0000007f 923f81d0 f fffff80 8f6f6e80 ffffff80 [ 103.593492][T2335@C0] C0 f158 8f6f6ea1 ffffff80 00000000 00000000 00000000 0 0000000 0001f000 00000000 [ 103.602754][T2335@C0] C0 f178 8a438000 ffffff80 00000fc3 00600000 00100073 0 0000000 93c51f80 ffffff80 [ 103.612011][T2335@C0] C0 f198 00000000 00000000 00000000 00000000 00000000 0 0000000 93c6a5d0 ffffff80 [ 103.621271][T2335@C0] C0 f1b8 93c6a5d0 ffffff80 978660e0 ffffff80 00000000 0 0000000 07f9e6f0 00000000 [ 103.630531][T2335@C0] [ 103.632865][T2335@C0] C0 X28: 0xffffff808bfb9280: [ 103.637540][T2335@C0] C0 9280 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.646800][T2335@C0] C0 92a0 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.656061][T2335@C0] C0 92c0 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.665320][T2335@C0] C0 92e0 00000000 00000000 00000000 00000000 00000000 0 0000000 00000000 00000000 [ 103.674580][T2335@C0] C0 9300 00000008 00000000 82917000 00000000 00000001 0 0000001 1388d000 ffffffc0 [ 103.683840][T2335@C0] C0 9320 1388d0d8 ffffffc0 00000000 00000000 13be8000 f fffffc0 00000001 00400040 [ 103.693101][T2335@C0] C0 9340 00000000 00000001 00000000 00000000 00000030 0 0000000 00000000 00000009 [ 103.702359][T2335@C0] C0 9360 ffff3fc7 00000000 94d62600 ffffff80 00000001 0 0000000 00000001 00000078 [ 103.711621][T2335@C0] sysdump: dump_die_cb save pregs_die_g ok . [ 103.717589][T2335@C0] Modules linked in: npu_img_vha(O) sprd_vdsp(O) vpu(O) s prdbt_tty(O) mali_kbase(O) sprd_wlan_combo(O) flash_ic_aw3641(O) chsc5xxx(O) spr d_compr_2stage_dma sprd_dmaengine_pcm snd_soc_sprd_dai snd_soc_sprd_vbc_fe snd_s oc_sprd_vbc_v4 sprd_platform_pcm_routing snd_soc_sprd_tdm snd_soc_sprd_pdm_r2p0 snd_soc_sprd_dummy_codec snd_soc_unisoc_dp_codec snd_soc_sprd_codec_ump9620 snd_ soc_sprd_codec_ump9620_power_dev snd_soc_sprd_codec_ump9620_power snd_soc_sprd_c ard snd_soc_sprd_ocp96011 snd_soc_sprd_pa_aw87390 voice_trigger_irq sprd_cp_dvfs sprd_pmic_wdt sprd_audcp_boot sprd_audcp_dvfs mcdt_hw_r2p0 audio_pipe sprd_apip e sprd_audio_usb_offload audio_dsp_dump audio_sipc audio_mem agdsp_pd [ 103.779131][T2335@C0] CPU: 0 PID: 2335 Comm: malloc-multi-th Tainted: G W O 5.15.74 #1 [ 103.788124][T2335@C0] Hardware name: Unisoc UIS7885 Board (DT) [ 103.793924][T2335@C0] pstate: a0400005 (NzCv daif +PAN -UAO -TCO -DIT -SSBS B TYPE=--) [ 103.801712][T2335@C0] pc : kmem_cache_alloc+0x128/0x3dc [ 103.806904][T2335@C0] lr : vm_area_alloc+0x34/0xac [ 103.811664][T2335@C0] sp : ffffffc013bebb60 [ 103.815818][T2335@C0] x29: ffffffc013bebb70 x28: ffffff808bfb9300 x27: ffffff c00aec4000 [ 103.823780][T2335@C0] x26: ffffff808829f158 x25: ffffff808829f168 x24: ec95d2 9bb82a97d3 [ 103.831741][T2335@C0] x23: ffffffc0081d7e6c x22: 0000000000000000 x21: ffffff c0081d7e6c [ 103.839702][T2335@C0] x20: ffffff8080005c80 x19: 0000000000000cc0 x18: ffffff c01388d060 [ 103.847663][T2335@C0] x17: 0000000000000000 x16: ffffffc009828428 x15: ffffff c00a871000 [ 103.855629][T2335@C0] x14: 0000000000000001 x13: 0000000000000004 x12: ac2a12 1038d5682c [ 103.863587][T2335@C0] x11: 000000009fdd27de x10: ffffff808bfb9310 x9 : ff95d2 9bb82a9843 [ 103.871549][T2335@C0] x8 : 00000000006087c0 x7 : 0000000007f9e6e9 x6 : 000000 0000000000 [ 103.879511][T2335@C0] x5 : 0000000000000000 x4 : 0000000007f9e6f0 x3 : 000000 00006087e0 [ 103.887472][T2335@C0] x2 : 0000000000000000 x1 : 0000000000000cc0 x0 : ffffff 8080005c80 [ 103.895435][T2335@C0] Call trace: [ 103.898722][T2335@C0] kmem_cache_alloc+0x128/0x3dc [ 103.903569][T2335@C0] vm_area_alloc+0x34/0xac [ 103.907981][T2335@C0] mmap_region+0x268/0x728 [ 103.912394][T2335@C0] do_mmap+0x3d4/0x540 [ 103.916462][T2335@C0] vm_mmap_pgoff+0xd0/0x234 [ 103.920962][T2335@C0] ksys_mmap_pgoff+0xbc/0x108 [ 103.925634][T2335@C0] __arm64_sys_mmap+0x44/0x54 [ 103.930309][T2335@C0] invoke_syscall+0x6c/0x15c [ 103.934897][T2335@C0] el0_svc_common.llvm.9499517201915720397+0xd4/0x120 [ 103.941644][T2335@C0] do_el0_svc+0x34/0xac [ 103.945800][T2335@C0] el0_svc+0x2c/0x94 [ 103.949694][T2335@C0] el0t_64_sync_handler+0x8c/0xf0 [ 103.954712][T2335@C0] el0t_64_sync+0x1b4/0x1b8 [ 103.959217][T2335@C0] Code: f9406e8c 91008103 8b8a2129 9100438a (f940012b) [ 103.966137][T2335@C0] ---[ end trace 4990effe52f21972 ]--- [ 103.990260][T2335@C0] <panic> p->addr = 0x0000000094d0f85d, pc = 0xffffffc008 1de8f8, pstate = 0x604000c5 [ 103.999625][T2335@C0] sprd_serror_debug: panic hook handler [ 103.999632][T2335@C0] Kernel panic - not syncing: Oops: Fatal exception [ 104.011742][T2335@C0] SMP: stopping secondary CPUs [ 104.016964][ T0@C2] unisoc-dump-info: CPU2: stopping... [ 104.022517][ T0@C3] unisoc-dump-info: CPU3: stopping... [ 104.028067][ T0@C1] unisoc-dump-info: CPU1: stopping... [ 104.033611][ T0@C4] unisoc-dump-info: CPU4: stopping... [ 104.039306][ T0@C6] unisoc-dump-info: CPU6: stopping... [ 104.045004][ T0@C5] unisoc-dump-info: CPU5: stopping... [ 104.050702][ T0@C7] unisoc-dump-info: CPU7: stopping... [ 104.056541][T2335@C0] ddr_cur_freq: 1 [ 104.070830][T2335@C0] sysdump: (sysdump_panic_event) ------ in (0) [ 104.077102][T2335@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 104.083639][T2335@C0] unisoc-mailbox smsg_senddie mailbox send die smsg [ 105.090244][T2335@C0] sysdump: [ 105.093284][T2335@C0] sysdump: ********************************************** ******* [ 105.100987][T2335@C0] sysdump: * * [ 105.108689][T2335@C0] sysdump: * Sysdump enter, preparing debug info to dump ... * [ 105.116391][T2335@C0] sysdump: * * [ 105.124093][T2335@C0] sysdump: ********************************************** ******* [ 105.131794][T2335@C0] sysdump: [ 105.134925][T2335@C0] sysdump: reason: Oops: Fatal exception, sprd_sysdump_in fo->crash_key: 0 [ 105.143524][T2335@C0] sysdump: [ 105.146569][T2335@C0] sysdump: ********************************************** ******* [ 105.154270][T2335@C0] sysdump: * * [ 105.161972][T2335@C0] sysdump: * Preparing debug info done ... * [ 105.169672][T2335@C0] sysdump: * * [ 105.177374][T2335@C0] sysdump: ********************************************** ******* [ 105.185077][T2335@C0] sysdump: [ 106.188392][T2335@C0] Kernel Offset: 0x80000 from 0xffffffc008000000 [ 106.194662][T2335@C0] PHYS_OFFSET: 0x80000000 [ 106.198981][T2335@C0] CPU features: 0x2,00000b83,23300e42 [ 106.204349][T2335@C0] Memory Limit: none
07-04
#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/seq_file.h> // single_open #include <linux/slab.h> // kfree kzalloc #include <linux/proc_fs.h> // proc_creat #include <linux/uaccess.h> // copy_from_user #include <linux/version.h> #include "kdrv_pmbus_api.h" static int pmbus_test_show(struct seq_file *seq, void *arg) { return 0; } static int pmbus_test_open(struct inode *pnode, struct file *pfile) { return single_open(pfile, pmbus_test_show, NULL); } int test_kdrv_pmbus_write_block_data(u32 bus_id, u32 slave_addr, u32 cmd, u32 len) { u8 *buf = NULL; int i; u32 ret; buf = (u8 *)kzalloc(len, GFP_KERNEL); if (buf == NULL) { pr_err("kzalloc err!\r\n"); return -ENOMEM; } buf[0] = len - 1; for (i = 1; i < len; i++) { buf[i] = i; } ret = kdrv_pmbus_write_block_data(bus_id, slave_addr, cmd, buf, len); if (ret) { pr_err("kdrv_pmbus_write_block_data fail\r\n"); kfree(buf); return ret; } kfree(buf); return 0; } int test_kdrv_pmbus_read_block_data(u32 bus_id, u32 slave_addr, u32 cmd, u32 len) { int ret; int i; u8 *buf = NULL; buf = (u8 *)kzalloc(len, GFP_KERNEL); if (buf == NULL) { pr_err("kzalloc err!\r\n"); return -ENOMEM; } ret = kdrv_pmbus_read_block_data(bus_id, slave_addr, cmd, buf, len); if (ret) { pr_err("kdrv_pmbus_read_block_data fail bus_id:%#x, addr:%#x, cmd:%#x\n", bus_id, slave_addr, cmd); kfree(buf); return ret; } for (i = 0; i < len; i++) { pr_info("read: bus_id:%#x, addr:%#x, cmd:%#x, buf[%d]:[0x%02x], len:%u\n", bus_id, slave_addr, cmd, i, buf[i], len); } kfree(buf); return 0; } int test_kdrv_pmbus_read_byte(u32 bus_id, u32 slave_addr, u32 cmd) { int ret; u8 data; ret = kdrv_pmbus_read_byte(bus_id, slave_addr, cmd, &data); if (ret) { pr_err("kdrv_pmbus_read_byte fail bus_id:%u, addr:%#x, cmd:%#x\n", bus_id, slave_addr, cmd); return ret; } pr_info("read: bus_id:%#x, addr:%#x, cmd:%#x, data:%#x\n", bus_id, slave_addr, cmd, data); return 0; } int test_kdrv_pmbus_read_word(u32 bus_id, u32 slave_addr, u32 cmd) { int ret; u16 data; ret = kdrv_pmbus_read_word(bus_id, slave_addr, cmd, &data); if (ret) { pr_err("kdrv_pmbus_read_word fail bus_id:%u, addr:%#x, cmd:%#x\n", bus_id, slave_addr, cmd); return ret; } pr_info("read: bus_id:%#x, addr:%#x, cmd:%#x, data:%#x\n", bus_id, slave_addr, cmd, data); return 0; } int test_kdrv_pmbus_write_byte(u32 bus_id, u32 slave_addr, u32 cmd, u32 data) { int ret; ret = kdrv_pmbus_write_byte(bus_id, slave_addr, cmd, (u8)data); if (ret) { pr_err("kdrv_pmbus_write_byte fail bus_id:%u, addr:%#x, cmd:%#x\n", bus_id, slave_addr, cmd); return ret; } pr_info("write byte: bus_id:%#x, addr:%#x, cmd:%#x, data:%#x\n", bus_id, slave_addr, cmd, data); return 0; } int test_kdrv_pmbus_write_word(u32 bus_id, u32 slave_addr, u32 cmd, u32 data) { int ret; ret = kdrv_pmbus_write_word(bus_id, slave_addr, cmd, (u16)data); if (ret) { pr_err("kdrv_pmbus_write_word fail bus_id:%u, addr:%#x, cmd:%#x\n", bus_id, slave_addr, cmd); return ret; } pr_info("write word: bus_id:%#x, addr:%#x, cmd:%#x, data:%#x\n", bus_id, slave_addr, cmd, data); return 0; } int test_kdrv_pmbus_write_cmd(u32 bus_id, u32 slave_addr, u32 cmd) { int ret; ret = kdrv_pmbus_write_cmd(bus_id, slave_addr, cmd); if (ret) { pr_err("kdrv_pmbus_write_cmd fail bus_id:%u, addr:%#x, cmd:%#x\n", bus_id, slave_addr, cmd); return ret; } pr_info("write word: bus_id:%#x, addr:%#x, cmd:%#x\n", bus_id, slave_addr, cmd); return 0; } #define PMBUS_CMD_READ_BYTE 0 #define PMBUS_CMD_READ_WORD 1 #define PMBUS_CMD_WRITE_BYTE 2 #define PMBUS_CMD_WRITE_WORD 3 #define PMBUS_CMD_READ_BLOCK 4 #define PMBUS_CMD_WRITE_BLOCK 5 #define PMBUS_CMD_WRITE_CMD 6 #define PMBUS_CMD_RESET 7 #define PMBUS_CMD_INIT 8 #define CFG_LINE_SIZE 120 static ssize_t pmbus_test_write(struct file *file, const char __user *buf, size_t len, loff_t *ppos) { u32 cmd; u32 bus_id; u32 command; u32 data; u32 slave_addr; char *next = NULL; char line[CFG_LINE_SIZE] = {0}; if (len > (CFG_LINE_SIZE - 1)) { return -E2BIG; } if (copy_from_user(line, buf, len)) { return -EINVAL; } /* usage: echo <cmd> [bus_id][slave_addr] [cmd] > pmbus_test */ cmd = simple_strtoul(line, &next, 0); bus_id = simple_strtoul(next + 1, &next, 0); switch (cmd) { case PMBUS_CMD_READ_BYTE: slave_addr = simple_strtoul(next + 1, &next, 0); command = simple_strtoul(next + 1, &next, 0); (void)test_kdrv_pmbus_read_byte(bus_id, slave_addr, command); break; case PMBUS_CMD_READ_WORD: slave_addr = simple_strtoul(next + 1, &next, 0); command = simple_strtoul(next + 1, &next, 0); (void)test_kdrv_pmbus_read_word(bus_id, slave_addr, command); break; case PMBUS_CMD_WRITE_BYTE: slave_addr = simple_strtoul(next + 1, &next, 0); command = simple_strtoul(next + 1, &next, 0); data = simple_strtoul(next + 1, &next, 0); (void)test_kdrv_pmbus_write_byte(bus_id, slave_addr, command, (u8)data); break; case PMBUS_CMD_WRITE_WORD: slave_addr = simple_strtoul(next + 1, &next, 0); command = simple_strtoul(next + 1, &next, 0); data = simple_strtoul(next + 1, &next, 0); (void)test_kdrv_pmbus_write_word(bus_id, slave_addr, command, (u16)data); break; case PMBUS_CMD_READ_BLOCK: slave_addr = simple_strtoul(next + 1, &next, 0); command = simple_strtoul(next + 1, &next, 0); data = simple_strtoul(next + 1, &next, 0); (void)test_kdrv_pmbus_read_block_data(bus_id, slave_addr, command, data); break; case PMBUS_CMD_WRITE_BLOCK: slave_addr = simple_strtoul(next + 1, &next, 0); command = simple_strtoul(next + 1, &next, 0); data = simple_strtoul(next + 1, &next, 0); (void)test_kdrv_pmbus_write_block_data(bus_id, slave_addr, command, data); break; case PMBUS_CMD_WRITE_CMD: slave_addr = simple_strtoul(next + 1, &next, 0); command = simple_strtoul(next + 1, &next, 0); (void)test_kdrv_pmbus_write_cmd(bus_id, slave_addr, command); break; case PMBUS_CMD_RESET: (void)kdrv_pmbus_reset(bus_id); break; case PMBUS_CMD_INIT: data = simple_strtoul(next + 1, &next, 0); (void)kdrv_pmbus_init(bus_id, data); break; default: break; } return len; } #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) static const struct proc_ops g_pmbus_operations = { .proc_open = pmbus_test_open, .proc_read = seq_read, .proc_write = pmbus_test_write, .proc_lseek = seq_lseek, .proc_release = single_release, }; #else static const struct file_operations g_pmbus_operations = { .open = pmbus_test_open, .read = seq_read, .write = pmbus_test_write, .llseek = seq_lseek, .release = single_release, }; #endif int __init pmbus_test_mod_init(void) { (void)proc_create("pmbus_test", S_IRUSR, NULL, &g_pmbus_operations); printk("pmbus_test_mod_init\r\n"); return 0; } void __exit pmbus_test_mod_exit(void) { (void)remove_proc_entry("pmbus_test", NULL); printk("pmbus_test_mod_exit\r\n"); } module_init(pmbus_test_mod_init); module_exit(pmbus_test_mod_exit); MODULE_DESCRIPTION("udrv pmbus api test"); MODULE_LICENSE("GPL");" #include <linux/delay.h> #include <linux/vmalloc.h> #include <linux/slab.h> #include <linux/io.h> #include <linux/iopoll.h> #include <linux/types.h> #include <linux/bitfield.h> #include "hisi_pmbus.h" #define STANDARD_MODE 1 #define FAST_MODE 2 #define GPIO_LEVEL_LOW 0 #define GPIO_LEVEL_HIGH 1 #define SET_LOW_HIGH_TIMES 9 #define AVS_WR_OPEN_REG 0x0004 #define AVS_INT_STATUS_REG 0x0008 #define AVS_INT_CLEAR_REG 0x0020 #define TRIGGER_CFG_REG 0x00B8 #define PMBUS_DISABLE 0x00 #define PMBUS_ENABLE 0x01 /* PMBUSIF_REG_GEN Base address of Module's Register */ #define PMBUSIF_REG_GEN_BASE (0x800) #define I2C_CON_REG (PMBUSIF_REG_GEN_BASE + 0x0) /* I2C控制寄存器。 */ #define I2C_CON_MASTER_ENABLE BIT(0) #define I2C_CON_SPEED_MASK (0x6U) #define I2C_CON_RESTART_EN BIT(5) #define I2C_CON_SLAVE_DISABLE BIT(6) #define I2C_DATA_CMD_REG (PMBUSIF_REG_GEN_BASE + 0x10) /* I2C数据操作寄存器。 */ #define I2C_SS_SCL_HCNT_REG (PMBUSIF_REG_GEN_BASE + 0x14) /* I2C标准速度模式SCL高电平配置寄存器。 */ #define I2C_SS_SCL_LCNT_REG (PMBUSIF_REG_GEN_BASE + 0x18) /* I2C标准速度模式SCL低电平配置寄存器。 */ #define I2C_FS_SCL_HCNT_REG (PMBUSIF_REG_GEN_BASE + 0x1C) /* I2C快速模式SCL高电平配置寄存器。 */ #define I2C_FS_SCL_LCNT_REG (PMBUSIF_REG_GEN_BASE + 0x20) /* I2C快速模式SCL低电平配置寄存器。 */ #define I2C_INTR_STAT_REG (PMBUSIF_REG_GEN_BASE + 0x2C) /* I2C屏蔽后中断状态寄存器。 */ #define I2C_INTR_MASK_REG (PMBUSIF_REG_GEN_BASE + 0x30) /* I2C中断屏蔽寄存器。 */ #define I2C_INTR_RAW_REG (PMBUSIF_REG_GEN_BASE + 0x34) /* I2C原始中断状态寄存器。 */ #define I2C_INTR_RAW_TX_ABRT BIT(6) #define I2C_INTR_RAW_ALERT_DET BIT(12) #define I2C_INTR_RAW_SCL_LOW_TOUT BIT(15) #define I2C_INTR_RAW_PMBUS_CMD_FINISH BIT(17) #define I2C_ENABLE_REG (PMBUSIF_REG_GEN_BASE + 0x6C) /* I2C工作使能寄存器。 */ #define I2C_STATUS_REG (PMBUSIF_REG_GEN_BASE + 0x70) /* I2C状态寄存器。 */ #define I2C_RXFLR_REG (PMBUSIF_REG_GEN_BASE + 0x78) /* RX_FIFO有效数据指示寄存器。 */ #define I2C_SDA_HOLD_REG (PMBUSIF_REG_GEN_BASE + 0x7C) /* SDA保持时间配置寄存器。 */ #define I2C_ENABLE_STATUS_REG (PMBUSIF_REG_GEN_BASE + 0x9C) /* I2C状态寄存器。 */ #define I2C_SCL_SWITCH_REG (PMBUSIF_REG_GEN_BASE + 0xA0) /* I2C防挂死SCL使能寄存器。 */ #define I2C_SCL_SIM_REG (PMBUSIF_REG_GEN_BASE + 0xA4) /* I2C防挂死SCL模拟寄存器。 */ #define I2C_LOCK_REG (PMBUSIF_REG_GEN_BASE + 0xAC) /* I2C lock寄存器。 */ #define I2C_SDA_SWITCH_REG (PMBUSIF_REG_GEN_BASE + 0xB0) /* I2C防挂死SDA使能寄存器。 */ #define I2C_SDA_SIM_REG (PMBUSIF_REG_GEN_BASE + 0xB4) /* I2C防挂死SDA模拟寄存器。 */ #define I2C_PMBUS_CTRL_REG (PMBUSIF_REG_GEN_BASE + 0x104) /* PMBUS全局控制寄存器。 */ #define I2C_PMBUS_CTRL_PEC_EN BIT(2) #define I2C_PMBUS_CTRL_ALERT_EN BIT(1) #define I2C_LOW_TIMEOUT_REG (PMBUSIF_REG_GEN_BASE + 0x108) /* SCL低电平超时值配置寄存器。 */ #define I2C_PMBUS_SCL_DET_REG (PMBUSIF_REG_GEN_BASE + 0x12C) /* PMBUS SCL检测寄存器。 */ #define I2C_PMBUS_SCL_DET_IDLE_DET_EN BIT(0) #define I2C_PMBUS_SCL_DET_TIMEOUT_EN BIT(1) #define I2C_PMBUS_IDLECNT_REG (PMBUSIF_REG_GEN_BASE + 0x130) /* SCL高电平空闲值配置寄存器。 */ #define I2C_PMBUS_RST_REG (PMBUSIF_REG_GEN_BASE + 0x134) /* 软件复位配置寄存器。 */ /* PMBUS_PROC_REG_GEN Base address of Module's Register */ #define PMBUS_PROC_REG_GEN_BASE (0xA00) #define PMBUS_WR_OPEN_REG (PMBUS_PROC_REG_GEN_BASE + 0x4) /* PMBUS全局参数保护寄存器。 */ #define PMBUS_INT_CLR_REG (PMBUS_PROC_REG_GEN_BASE + 0x10) /* PMBUS中断清除寄存器 */ #define PMBUS_WAIT_CNT 30000 /* PMU CMD */ #define STOP_EN (1U << 10) #define ADDR_EN (1U << 9) #define CMD_READ (1U << 8) #define SDA_IN BIT(9) #define PMBUS_I2C_RECOVERY_CYCLE_CNT 10 static inline void pmbus_reg_write(struct io_region *reg_region, u32 reg, u32 val) { pr_debug("[iWare][Debug] %s reg=%#x val =%#x\r\n", __FUNCTION__, reg, val); iowrite32(val, reg_region->io_base + reg); } static inline u32 pmbus_reg_read(struct io_region *reg_region, u32 reg) { u32 val; val = ioread32(reg_region->io_base + reg); pr_debug("[iWare][Debug] %s reg=%#x val =%#x\r\n", __FUNCTION__, reg, val); return val; } /* try to recovery the bus if sda locked to low level */ static void pmbus_recovery_bus(struct io_region *reg_region) { int i; u32 status; status = pmbus_reg_read(reg_region, I2C_STATUS_REG); /* if SDA keep low, assume the bus hang up */ if ((status & SDA_IN) == 0) { /* disable pmbus */ pmbus_reg_write(reg_region, I2C_ENABLE_REG, 0x0); /* enable output software simulaition */ pmbus_reg_write(reg_region, I2C_SCL_SWITCH_REG, 0x1); pmbus_reg_write(reg_region, I2C_SDA_SWITCH_REG, 0x1); /* output at least 9 clocks to try to recover the bus */ for (i = 0; i < PMBUS_I2C_RECOVERY_CYCLE_CNT; i++) { pmbus_reg_write(reg_region, I2C_SCL_SIM_REG, 0x0); udelay(50); // 延时50us pmbus_reg_write(reg_region, I2C_SCL_SIM_REG, 0x1); udelay(50); // 延时50us } /* disable output software simulaition */ pmbus_reg_write(reg_region, I2C_SCL_SWITCH_REG, 0x0); pmbus_reg_write(reg_region, I2C_SDA_SWITCH_REG, 0x0); /* enable pmbus */ pmbus_reg_write(reg_region, I2C_ENABLE_REG, 0x1); pr_info("[iWare][Info] pmbus hang recovery done\n"); } } static int pmbus_wait_write_finish(struct io_region *reg_region) { int i; u32 status = 0; for (i = 0; i < PMBUS_WAIT_CNT; i++) { status = pmbus_reg_read(reg_region, I2C_INTR_RAW_REG); if (((status & I2C_INTR_RAW_SCL_LOW_TOUT) == 0) && ((status & I2C_INTR_RAW_TX_ABRT) == 0) && ((status & I2C_INTR_RAW_PMBUS_CMD_FINISH) != 0)) { // 清除所有中断 pmbus_reg_write(reg_region, I2C_INTR_RAW_REG, 0xffffffff); return 0; } udelay(1); } pr_err("[iWare][Error] pmbus_write timeout! raw_int_status:0x%x\n", status); // 清除所有中断 pmbus_reg_write(reg_region, I2C_INTR_RAW_REG, 0xffffffff); pmbus_recovery_bus(reg_region); return -EBUSY; } static int pmbus_send_byte_v200(struct io_region *reg_region, struct pmbus_msg *msg) { pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, ADDR_EN | msg->slave_addr); if ((msg->type & PMBUS_FLAG_EXT) != 0) { pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, STOP_EN | msg->command); pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, STOP_EN | msg->command_ext); } else { pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, STOP_EN | msg->command); } return pmbus_wait_write_finish(reg_region); } static int pmbus_write_bytes_v200(struct io_region *reg_region, struct pmbus_msg *msg) { unsigned int i; pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, ADDR_EN | msg->slave_addr); pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, msg->command); if ((msg->type & PMBUS_FLAG_EXT) != 0) { pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, msg->command_ext); } for (i = 0; i < msg->data_len - 1; i++) { pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, msg->data[i]); } pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, STOP_EN | msg->data[msg->data_len - 1]); return pmbus_wait_write_finish(reg_region); } #define PMBUS_READ_WAIT_TIMEOUT 1000000ULL #define PMUBS_READ_WAIT_DELAY_US 1UL static int pmbus_wait_read_finish(struct io_region *reg_region, u8 read_len) { int ret; u32 data_num; ret = readl_poll_timeout(reg_region->io_base + I2C_RXFLR_REG, data_num, (data_num >= read_len), PMUBS_READ_WAIT_DELAY_US, PMBUS_READ_WAIT_TIMEOUT); if (ret != 0) { pr_err("[iWare][Error] wait read_finish timeout!! read_len[%u] fifo num[%u], raw_int_status:0x%x\n", read_len, data_num, pmbus_reg_read(reg_region, I2C_INTR_RAW_REG)); // 清除所有中断 pmbus_reg_write(reg_region, I2C_INTR_RAW_REG, 0xffffffff); pmbus_recovery_bus(reg_region); return ret; } return 0; } static void pmbus_clear_rx_fifo(struct io_region *reg_region) { u8 rx_fifo_data_num; u8 i; u32 tmp; /* clean rx fifo */ rx_fifo_data_num = (u8)pmbus_reg_read(reg_region, I2C_RXFLR_REG); for (i = 0; i < rx_fifo_data_num; i++) { tmp = pmbus_reg_read(reg_region, I2C_DATA_CMD_REG); // 把fifo读清 } } static int pmbus_read_bytes_v200(struct io_region *reg_region, struct pmbus_msg *msg) { int ret; unsigned int i; u32 status; /* 先把rx fifo读清 */ pmbus_clear_rx_fifo(reg_region); pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, ADDR_EN | msg->slave_addr); pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, msg->command); if ((msg->type & PMBUS_FLAG_EXT) != 0) { // 扩展16bit 命令 pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, msg->command_ext); } pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, ADDR_EN | CMD_READ | msg->slave_addr); for (i = 0; i < msg->data_len - 1; i++) { pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, CMD_READ); } pmbus_reg_write(reg_region, I2C_DATA_CMD_REG, STOP_EN | CMD_READ); ret = pmbus_wait_read_finish(reg_region, msg->data_len); if (ret != 0) { pr_err("[iWare][Error] %s slave_addr(0x%x), cmd(0x%x), time out\n", __func__, msg->slave_addr, msg->command); pmbus_recovery_bus(reg_region); return -EAGAIN; } for (i = 0; i < msg->data_len; i++) { msg->data[i] = (u8)pmbus_reg_read(reg_region, I2C_DATA_CMD_REG); } /* for block read, first read code is data length */ if ((msg->type & PMBUS_FLAG_BLOCK) != 0) { if (msg->data[0] > msg->data_len) { pr_info("[iWare][Info] pmbus read slave[0x%02x] command[0x%02x] block data may lossed, toalLen[%u]\n", msg->slave_addr, msg->command, msg->data[0]); } } // 清中断 status = pmbus_reg_read(reg_region, I2C_INTR_RAW_REG); pmbus_reg_write(reg_region, I2C_INTR_RAW_REG, status); return 0; } static int pmbus_reset_v200(struct io_region *reg_region) { pmbus_reg_write(reg_region, I2C_PMBUS_RST_REG, 1); udelay(1); pmbus_reg_write(reg_region, I2C_PMBUS_RST_REG, 0); udelay(1); return 0; } /* 不同soc解锁码不同, chip dtsi里配置 309a 1260 avs_wr_unlock_key 0x5a5a5a5a 0x1ACCE551 pmbus_wr_unlock_key 0x5a5a5a5a 0x1ACCE551 i2c_unlock_key 0x5a5a5a5a 0x36313832 */ static void pmbus_unlock_reg(struct io_region *reg_region, struct pmbus_unlock_key *key) { /* unlock avs wr */ pmbus_reg_write(reg_region, AVS_WR_OPEN_REG, key->avs_wr_unlock_key); /* unlock pmbus wr */ pmbus_reg_write(reg_region, PMBUS_WR_OPEN_REG, key->pmbus_wr_unlock_key); /* unlock pmbus i2c wr */ pmbus_reg_write(reg_region, I2C_LOCK_REG, key->i2c_unlock_key); } static void pmbus_config_timing_cnt(struct io_region *reg_region, u8 speed_mode, struct pmbus_timings_cfg *pmbus_cfg) { if (speed_mode == STANDARD_MODE) { // 标准模式 pmbus_reg_write(reg_region, I2C_SS_SCL_LCNT_REG, pmbus_cfg->lcnt); pmbus_reg_write(reg_region, I2C_SS_SCL_HCNT_REG, pmbus_cfg->hcnt); } else { // 快速模式 pmbus_reg_write(reg_region, I2C_FS_SCL_LCNT_REG, pmbus_cfg->lcnt); pmbus_reg_write(reg_region, I2C_FS_SCL_HCNT_REG, pmbus_cfg->hcnt); } // 屏蔽所有中断 pmbus_reg_write(reg_region, I2C_INTR_MASK_REG, 0xFFFFFFFF); pmbus_reg_write(reg_region, I2C_SDA_HOLD_REG, pmbus_cfg->hold_cnt); // PMBus的SCL低电平超时值(PMBus协议规定为25~35ms) pmbus_reg_write(reg_region, I2C_LOW_TIMEOUT_REG, pmbus_cfg->timeout_cnt); // 默认30ms // PMBus的SCL高电平空闲值(PMBus协议规定为>50us) pmbus_reg_write(reg_region, I2C_PMBUS_IDLECNT_REG, pmbus_cfg->idle_cnt); // 默认100us } static int pmbus_init_v200(struct io_region *reg_region, u32 pec_en, u32 bus_freq_hz, struct pmbus_timings_cfg *cfg, struct pmbus_unlock_key *key) { u32 val = 0; u8 speed_mode; int ret; if (bus_freq_hz > PMBUS_MAX_FAST_MODE_FREQ) { pr_err("[iWare][Error] invalid para bus_freq_hz =%u\r\n", bus_freq_hz); return -EINVAL; } ret = pmbus_reset_v200(reg_region); if (ret != 0) { return ret; } /* unlock */ pmbus_unlock_reg(reg_region, key); /* stop triger */ pmbus_reg_write(reg_region, TRIGGER_CFG_REG, 0x0); /* disable pmbus */ pmbus_reg_write(reg_region, I2C_ENABLE_REG, PMBUS_DISABLE); speed_mode = (bus_freq_hz <= PMBUS_MAX_STANDARD_MODE_FREQ) ? STANDARD_MODE : FAST_MODE; val |= I2C_CON_MASTER_ENABLE | I2C_CON_SLAVE_DISABLE | I2C_CON_RESTART_EN; val |= (u32)FIELD_PREP(I2C_CON_SPEED_MASK, speed_mode); pmbus_reg_write(reg_region, I2C_CON_REG, val); pmbus_config_timing_cnt(reg_region, speed_mode, cfg); /* config scl detect */ pmbus_reg_write(reg_region, I2C_PMBUS_SCL_DET_REG, I2C_PMBUS_SCL_DET_IDLE_DET_EN | I2C_PMBUS_SCL_DET_TIMEOUT_EN); /* enable pec and alert */ val = I2C_PMBUS_CTRL_ALERT_EN; if (pec_en != 0) { pr_info("[iWare][Info] pmbus enable pec \r\n"); val |= I2C_PMBUS_CTRL_PEC_EN; } pmbus_reg_write(reg_region, I2C_PMBUS_CTRL_REG, val); /* enable pmbus */ pmbus_reg_write(reg_region, I2C_ENABLE_REG, PMBUS_ENABLE); // 清中断 pmbus_reg_write(reg_region, AVS_INT_CLEAR_REG, 0xFFFFFFFF); pmbus_reg_write(reg_region, PMBUS_INT_CLR_REG, 0xFFFFFFFF); pmbus_reg_write(reg_region, I2C_INTR_RAW_REG, 0xFFFFFFFF); return 0; } const struct hisi_pmbus_ops hisi_pmbus_v200_ops = { .init = pmbus_init_v200, .reset = pmbus_reset_v200, .send_byte = pmbus_send_byte_v200, .read_bytes = pmbus_read_bytes_v200, .write_bytes = pmbus_write_bytes_v200, }; const struct hisi_pmbus_ops *hisi_pmbus_get_ops(void) { return &hisi_pmbus_v200_ops; }" #include <linux/device.h> #include <linux/errno.h> #include "hisi_pmbus.h" #include "kdrv_pmbus_api.h" #define PMBUS_BLOCK_MAX 32 static void hisi_pmbus_fill_msg(struct pmbus_msg *msg, u8 type, u8 slave_addr, u16 command) { u8 cmd; cmd = (u8)(command >> 0x8); // 高8位为extended cmd 指示这是一条扩展命令 if ((cmd == PMBUS_MFR_SPECIFIC_COMMAND_EXT || cmd == PMBUS_COMMAND_EXT)) { msg->type = type | PMBUS_FLAG_EXT; msg->command = cmd; msg->command_ext = (u8)command; } else { msg->type = type; msg->command = (u8)command; } msg->slave_addr = slave_addr; } static int hisi_pmbus_xfer(struct hisi_pmbus_data *pmbus, struct pmbus_msg *msg) { int ret; if ((msg->data == NULL) && (msg->data_len > 0)) { dev_err(pmbus->dev, "[iWare][Error] msg->data = NULL, msg.data_len %zu\r\n", msg->data_len); return -EINVAL; } if ((msg->type & PMBUS_FLAG_NO_DATA) != 0) { ret = pmbus->ops->send_byte(&pmbus->reg_region, msg); } else if ((msg->type & PMBUS_FLAG_READ) != 0) { ret = pmbus->ops->read_bytes(&pmbus->reg_region, msg); } else { /* pmbus write */ ret = pmbus->ops->write_bytes(&pmbus->reg_region, msg); } return ret; } int kdrv_pmbus_reset(u32 bus_id) { struct hisi_pmbus_data *pmbus = NULL; pmbus = hisi_pmbus_data_get_by_id(bus_id); if (pmbus == NULL) { pr_err("[iWare][Error] get pmbus data fail: pmbus_id=%u,\n", bus_id); return -EPERM; } mutex_lock(&pmbus->lock); pmbus->ops->reset(&pmbus->reg_region); mutex_unlock(&pmbus->lock); return 0; } EXPORT_SYMBOL(kdrv_pmbus_reset); int kdrv_pmbus_init(u32 bus_id, u32 bus_freq_hz) { struct hisi_pmbus_data *pmbus = NULL; int ret; u32 total_cnt; pmbus = hisi_pmbus_data_get_by_id(bus_id); if (pmbus == NULL) { pr_err("[iWare][Error] get pmbus data fail: pmbus_id=%u,\n", bus_id); return -EPERM; } if (bus_freq_hz > PMBUS_MAX_FAST_MODE_FREQ || bus_freq_hz == 0) { pr_err("[iWare][Error] invalid para bus_freq_hz =%u \r\n", bus_freq_hz); return -EINVAL; } mutex_lock(&pmbus->lock); pmbus->timing.bus_freq_hz = bus_freq_hz; total_cnt = (u32)DIV_ROUND_UP_ULL(pmbus->timing.clk_freq_mhz * HZ_PER_MHZ, bus_freq_hz); pmbus->timing_cfg.hcnt = (pmbus->timing.scl_high_ratio * total_cnt) / 100; // 占空比放大了100倍 这里除以100 pmbus->timing_cfg.lcnt = total_cnt - pmbus->timing_cfg.hcnt; pr_info("[iWare][Info] %s bus_freq_hz %u, total_cnt %u, hcnt %u lcnt %u\n", __func__, bus_freq_hz, total_cnt, pmbus->timing_cfg.hcnt, pmbus->timing_cfg.lcnt); ret = pmbus->ops->init(&pmbus->reg_region, pmbus->pec_en, pmbus->timing.bus_freq_hz, &pmbus->timing_cfg, &pmbus->key); if (ret != 0) { mutex_unlock(&pmbus->lock); pr_err("[iWare][Error] kdrv_pmbus_init failed ret=%d\n", ret); return ret; } mutex_unlock(&pmbus->lock); return 0; } EXPORT_SYMBOL(kdrv_pmbus_init); int kdrv_pmbus_write_word(u32 bus_id, u8 slave_addr, u16 command, u16 data) { struct hisi_pmbus_data *pmbus = NULL; struct pmbus_msg msg = { 0 }; int ret; pmbus = hisi_pmbus_data_get_by_id(bus_id); if (pmbus == NULL) { pr_err("[iWare][Error] kdrv_pmbus_write_word,get pmbus data fail: pmbus_id=%u,\n", bus_id); return -EPERM; } mutex_lock(&pmbus->lock); msg.data = (u8 *)&data; msg.data_len = sizeof(u16); hisi_pmbus_fill_msg(&msg, PMBUS_WRITE_WORD, slave_addr, command); ret = hisi_pmbus_xfer(pmbus, &msg); if (ret != 0) { mutex_unlock(&pmbus->lock); return ret; } mutex_unlock(&pmbus->lock); return 0; } EXPORT_SYMBOL(kdrv_pmbus_write_word); int kdrv_pmbus_write_byte(u32 bus_id, u8 slave_addr, u16 command, u8 data) { struct hisi_pmbus_data *pmbus = NULL; struct pmbus_msg msg = { 0 }; int ret; pmbus = hisi_pmbus_data_get_by_id(bus_id); if (pmbus == NULL) { pr_err("[iWare][Error] kdrv_pmbus_write_byte, get pmbus data fail: pmbus_id=%u,\n", bus_id); return -EPERM; } mutex_lock(&pmbus->lock); msg.data = &data; msg.data_len = sizeof(u8); hisi_pmbus_fill_msg(&msg, PMBUS_WRITE_BYTE, slave_addr, command); ret = hisi_pmbus_xfer(pmbus, &msg); if (ret != 0) { mutex_unlock(&pmbus->lock); return ret; } mutex_unlock(&pmbus->lock); return 0; } EXPORT_SYMBOL(kdrv_pmbus_write_byte); int kdrv_pmbus_write_cmd(u32 bus_id, u8 slave_addr, u16 command) { struct hisi_pmbus_data *pmbus = NULL; struct pmbus_msg msg = { 0 }; int ret; pmbus = hisi_pmbus_data_get_by_id(bus_id); if (pmbus == NULL) { pr_err("[iWare][Error] kdrv_pmbus_write_cmd, get pmbus data fail: pmbus_id=%u,\n", bus_id); return -EPERM; } mutex_lock(&pmbus->lock); hisi_pmbus_fill_msg(&msg, PMBUS_SEND_BYTE, slave_addr, command); ret = hisi_pmbus_xfer(pmbus, &msg); if (ret != 0) { mutex_unlock(&pmbus->lock); return ret; } mutex_unlock(&pmbus->lock); return 0; } EXPORT_SYMBOL(kdrv_pmbus_write_cmd); int kdrv_pmbus_read_byte(u32 bus_id, u8 slave_addr, u16 command, u8 *data) { struct hisi_pmbus_data *pmbus = NULL; struct pmbus_msg msg = { 0 }; int ret; if (data == NULL) { pr_err("[iWare][Error] ivalid para, data is null point,\n"); return -EINVAL; } pmbus = hisi_pmbus_data_get_by_id(bus_id); if (pmbus == NULL) { pr_err("[iWare][Error] get pmbus data fail: pmbus_id=%u,\n", bus_id); return -EPERM; } mutex_lock(&pmbus->lock); msg.data = data; msg.data_len = sizeof(u8); hisi_pmbus_fill_msg(&msg, PMBUS_READ_BYTE, slave_addr, command); ret = hisi_pmbus_xfer(pmbus, &msg); if (ret != 0) { mutex_unlock(&pmbus->lock); return ret; } mutex_unlock(&pmbus->lock); return 0; } EXPORT_SYMBOL(kdrv_pmbus_read_byte); int kdrv_pmbus_read_word(u32 bus_id, u8 slave_addr, u16 command, u16 *data) { struct hisi_pmbus_data *pmbus = NULL; struct pmbus_msg msg = { 0 }; int ret; u8 tmp[2] = {0}; // 2个字节 if (data == NULL) { pr_err("[iWare][Error] ivalid para, data is null point,\n"); return -EINVAL; } pmbus = hisi_pmbus_data_get_by_id(bus_id); if (pmbus == NULL) { pr_err("[iWare][Error] get pmbus data fail: pmbus_id=%u,\n", bus_id); return -EPERM; } mutex_lock(&pmbus->lock); msg.data = tmp; msg.data_len = sizeof(u16); hisi_pmbus_fill_msg(&msg, PMBUS_READ_WORD, slave_addr, command); ret = hisi_pmbus_xfer(pmbus, &msg); if (ret != 0) { mutex_unlock(&pmbus->lock); return ret; } *data = (((u16)tmp[1]) << 8) + ((u16)tmp[0]); // 高8位 mutex_unlock(&pmbus->lock); return 0; } EXPORT_SYMBOL(kdrv_pmbus_read_word); int kdrv_pmbus_write_block_data(u32 bus_id, u8 slave_addr, u16 command, u8 *pbuf, u32 len) { struct hisi_pmbus_data *pmbus = NULL; struct pmbus_msg msg = { 0 }; int ret; if ((pbuf == NULL) || (len == 0)) { pr_err("[iWare][Error] para err: bus_id(%d),slave_addr(0x%x), len(%u)\n", bus_id, slave_addr, len); return -EINVAL; } if (len > PMBUS_BLOCK_MAX) { pr_err("[iWare][Error] para err: len(%u) exceed PMBUS_BLOCK_MAX(32)\n", len); return -EINVAL; } pmbus = hisi_pmbus_data_get_by_id(bus_id); if (pmbus == NULL) { pr_err("[iWare][Error] get pmbus data fail: pmbus_id=%u,\n", bus_id); return -EPERM; } mutex_lock(&pmbus->lock); msg.data = pbuf; msg.data_len = (u8)len; hisi_pmbus_fill_msg(&msg, PMBUS_WRITE_BLOCK, slave_addr, command); ret = hisi_pmbus_xfer(pmbus, &msg); if (ret != 0) { mutex_unlock(&pmbus->lock); return ret; } mutex_unlock(&pmbus->lock); return 0; } EXPORT_SYMBOL(kdrv_pmbus_write_block_data); int kdrv_pmbus_read_block_data(u32 bus_id, u8 slave_addr, u16 command, u8 *pbuf, u32 len) { struct hisi_pmbus_data *pmbus = NULL; struct pmbus_msg msg = { 0 }; int ret; if ((pbuf == NULL) || (len == 0)) { pr_err("[iWare][Error] para err: bus_id(%d),slave_addr(0x%x), len(%u)\n", bus_id, slave_addr, len); return -EINVAL; } if (len > PMBUS_BLOCK_MAX) { pr_err("[iWare][Error] para err: len(%u) exceed PMBUS_BLOCK_MAX(32)\n", len); return -EINVAL; } pmbus = hisi_pmbus_data_get_by_id(bus_id); if (pmbus == NULL) { pr_err("[iWare][Error] get pmbus data fail: pmbus_id=%u,\n", bus_id); return -EPERM; } mutex_lock(&pmbus->lock); msg.data = pbuf; msg.data_len = (u8)len; hisi_pmbus_fill_msg(&msg, PMBUS_READ_BLOCK, slave_addr, command); ret = hisi_pmbus_xfer(pmbus, &msg); if (ret != 0) { mutex_unlock(&pmbus->lock); return ret; } mutex_unlock(&pmbus->lock); return 0; } EXPORT_SYMBOL(kdrv_pmbus_read_block_data); " “测试步骤为 ”insmod /lib/udrivers/hi309a_pmbus_api_test.ko devmem 0xfa860204 w 0 devmem 0xfa860220 w 0 echo 3 1 0x70 0x21 0xf4 > /proc/pmbus_test (设置输出电压) “ 然后再设置输出电压之后报以下错误 [60585.219727] [iWare][Error] pmbus_write timeout! raw_int_status:0x10 [60585.227034] [iWare][Info] pmbus hang recovery done [60585.231848] kdrv_pmbus_write_word fail bus_id:1, addr:0x70, cmd:0x21 hi309a /lib/udrivers # cat /proc/interrupts | grep i2c 87: 0 0 0 0 0 0 0 0 GICv3 294 Level hisi-i2c 88: 0 0 0 0 0 0 0 0 GICv3 295 Level hisi-i2c 89: 0 0 0 0 0 0 0 0 GICv3 297 Level hisi-i2c 90: 0 0 0 0 0 0 0 0 GICv3 298 Level hisi-i2c 91: 0 0 0 0 0 0 0 0 GICv3 299 Level hisi-i2c 92: 0 0 0 0 0 0 0 0 GICv3 300 Level hisi-i2c 93: 0 0 0 0 0 0 0 0 GICv3 301 Level hisi-i2c 94: 0 0 0 0 0 0 0 0 GICv3 686 Level hisi-i2c 95: 0 0 0 0 0 0 0 0 GICv3 687 Level hisi-i2c hi309a /lib/udrivers # dmesg | grep -e "iWare" -e "PMBUS" [ 10.511319] [iWare][Info] IOMUX register size (4 bytes) [ 10.519453] hgpio fa540000.gpio: [iWare][Info] hisi_gpio_probe: start [ 10.526277] hgpio fa550000.gpio: [iWare][Info] hisi_gpio_probe: start [ 10.533075] hgpio fa560000.gpio: [iWare][Info] hisi_gpio_probe: start [ 10.539847] hgpio fa570000.gpio: [iWare][Info] hisi_gpio_probe: start [ 10.546656] hgpio fa580000.gpio: [iWare][Info] hisi_gpio_probe: start [ 10.553439] hgpio fa590000.gpio: [iWare][Info] hisi_gpio_probe: start [ 10.560210] hgpio fa5a0000.gpio: [iWare][Info] hisi_gpio_probe: start [ 10.567034] hgpio fa5b0000.gpio: [iWare][Info] hisi_gpio_probe: start [ 10.573814] hgpio faa90000.gpio: [iWare][Info] hisi_gpio_probe: start [ 10.580559] hgpio faaa0000.gpio: [iWare][Info] hisi_gpio_probe: start [ 10.590111] hisi_spi_drv fa400000.spi: [iWare] can't get clk-freq, use default value [ 10.597941] hisi_spi_drv fa400000.spi: [iWare][Info] [hisi spi_get_clk_rst_info] get rst clk success [ 10.607234] hisi_spi_drv fa400000.spi: [iWare][Info] spi reset success [ 10.614459] hisi_spi_drv fa410000.spi: [iWare] can't get clk-freq, use default value [ 10.622295] hisi_spi_drv fa410000.spi: [iWare][Info] [hisi spi_get_clk_rst_info] get rst clk success [ 10.631589] hisi_spi_drv fa410000.spi: [iWare][Info] spi reset success [ 10.638791] hisi_spi_drv fa420000.spi: [iWare] can't get clk-freq, use default value [ 10.646633] hisi_spi_drv fa420000.spi: [iWare][Info] [hisi spi_get_clk_rst_info] get rst clk success [ 10.655934] hisi_spi_drv fa420000.spi: [iWare][Info] spi reset success [ 10.663149] hisi_spi_drv fa430000.spi: [iWare] can't get clk-freq, use default value [ 10.670998] hisi_spi_drv fa430000.spi: [iWare][Info] [hisi spi_get_clk_rst_info] get rst clk success [ 10.680292] hisi_spi_drv fa430000.spi: [iWare][Info] spi reset success [ 10.690479] hisi-i2c fa380000.i2c: [iWare][Info] hisi_i2c_probe start [ 10.697006] hisi-i2c fa380000.i2c: [iWare][Info] i2c scl_high_ratio no cfg [ 10.703944] hisi-i2c fa380000.i2c: [iWare][Info] get rst and clk from dts [ 10.719963] [iWare][Info] hisi_i2c_calcu_cfg_cnt bus_freq_hz 100000, scl_fall_cnt 60 scl_rise_cnt 60 total_cnt 2000 scl_hcnt 920 scl_lcnt 1080 [ 10.732890] [iWare][Info] hisi_i2c_calcu_cfg_cnt sda_hold_cnt 80 spk_len 5 scl_hcnt 848 scl_lcnt 1019 [ 10.742442] hisi-i2c fa380000.i2c: [iWare][Info] hisi_i2c_probe end [ 10.749010] hisi-i2c fa390000.i2c: [iWare][Info] hisi_i2c_probe start [ 10.755526] hisi-i2c fa390000.i2c: [iWare][Info] i2c scl_high_ratio no cfg [ 10.762448] hisi-i2c fa390000.i2c: [iWare][Info] get rst and clk from dts [ 10.778437] [iWare][Info] hisi_i2c_calcu_cfg_cnt bus_freq_hz 100000, scl_fall_cnt 60 scl_rise_cnt 60 total_cnt 2000 scl_hcnt 920 scl_lcnt 1080 [ 10.791367] [iWare][Info] hisi_i2c_calcu_cfg_cnt sda_hold_cnt 80 spk_len 5 scl_hcnt 848 scl_lcnt 1019 [ 10.800891] hisi-i2c fa390000.i2c: [iWare][Info] hisi_i2c_probe end [ 10.807415] hisi-i2c fa3b0000.i2c: [iWare][Info] hisi_i2c_probe start [ 10.813923] hisi-i2c fa3b0000.i2c: [iWare][Info] i2c scl_high_ratio no cfg [ 10.820847] hisi-i2c fa3b0000.i2c: [iWare][Info] get rst and clk from dts [ 10.836836] [iWare][Info] hisi_i2c_calcu_cfg_cnt bus_freq_hz 100000, scl_fall_cnt 60 scl_rise_cnt 60 total_cnt 2000 scl_hcnt 920 scl_lcnt 1080 [ 10.849764] [iWare][Info] hisi_i2c_calcu_cfg_cnt sda_hold_cnt 80 spk_len 5 scl_hcnt 848 scl_lcnt 1019 [ 10.859275] hisi-i2c fa3b0000.i2c: [iWare][Info] hisi_i2c_probe end [ 10.865787] hisi-i2c fa3c0000.i2c: [iWare][Info] hisi_i2c_probe start [ 10.872298] hisi-i2c fa3c0000.i2c: [iWare][Info] i2c scl_high_ratio no cfg [ 10.879223] hisi-i2c fa3c0000.i2c: [iWare][Info] get rst and clk from dts [ 10.895207] [iWare][Info] hisi_i2c_calcu_cfg_cnt bus_freq_hz 100000, scl_fall_cnt 60 scl_rise_cnt 60 total_cnt 2000 scl_hcnt 920 scl_lcnt 1080 [ 10.908133] [iWare][Info] hisi_i2c_calcu_cfg_cnt sda_hold_cnt 80 spk_len 5 scl_hcnt 848 scl_lcnt 1019 [ 10.917641] hisi-i2c fa3c0000.i2c: [iWare][Info] hisi_i2c_probe end [ 10.924135] hisi-i2c fa3d0000.i2c: [iWare][Info] hisi_i2c_probe start [ 10.930644] hisi-i2c fa3d0000.i2c: [iWare][Info] i2c scl_high_ratio no cfg [ 10.937559] hisi-i2c fa3d0000.i2c: [iWare][Info] get rst and clk from dts [ 10.953538] [iWare][Info] hisi_i2c_calcu_cfg_cnt bus_freq_hz 100000, scl_fall_cnt 60 scl_rise_cnt 60 total_cnt 2000 scl_hcnt 920 scl_lcnt 1080 [ 10.966464] [iWare][Info] hisi_i2c_calcu_cfg_cnt sda_hold_cnt 80 spk_len 5 scl_hcnt 848 scl_lcnt 1019 [ 10.975986] hisi-i2c fa3d0000.i2c: [iWare][Info] hisi_i2c_probe end [ 10.982483] hisi-i2c fa3e0000.i2c: [iWare][Info] hisi_i2c_probe start [ 10.988993] hisi-i2c fa3e0000.i2c: [iWare][Info] i2c scl_high_ratio no cfg [ 10.995908] hisi-i2c fa3e0000.i2c: [iWare][Info] get rst and clk from dts [ 11.011896] [iWare][Info] hisi_i2c_calcu_cfg_cnt bus_freq_hz 100000, scl_fall_cnt 60 scl_rise_cnt 60 total_cnt 2000 scl_hcnt 920 scl_lcnt 1080 [ 11.024821] [iWare][Info] hisi_i2c_calcu_cfg_cnt sda_hold_cnt 80 spk_len 5 scl_hcnt 848 scl_lcnt 1019 [ 11.034336] hisi-i2c fa3e0000.i2c: [iWare][Info] hisi_i2c_probe end [ 11.040848] hisi-i2c fa3f0000.i2c: [iWare][Info] hisi_i2c_probe start [ 11.047359] hisi-i2c fa3f0000.i2c: [iWare][Info] i2c scl_high_ratio no cfg [ 11.054275] hisi-i2c fa3f0000.i2c: [iWare][Info] get rst and clk from dts [ 11.070263] [iWare][Info] hisi_i2c_calcu_cfg_cnt bus_freq_hz 100000, scl_fall_cnt 60 scl_rise_cnt 60 total_cnt 2000 scl_hcnt 920 scl_lcnt 1080 [ 11.083190] [iWare][Info] hisi_i2c_calcu_cfg_cnt sda_hold_cnt 80 spk_len 5 scl_hcnt 848 scl_lcnt 1019 [ 11.092704] hisi-i2c fa3f0000.i2c: [iWare][Info] hisi_i2c_probe end [ 11.099221] hisi-i2c faab0000.i2c: [iWare][Info] hisi_i2c_probe start [ 11.105733] hisi-i2c faab0000.i2c: [iWare][Info] i2c scl_high_ratio no cfg [ 11.112649] hisi-i2c faab0000.i2c: [iWare][Info] get rst and clk from dts [ 11.128636] [iWare][Info] hisi_i2c_calcu_cfg_cnt bus_freq_hz 100000, scl_fall_cnt 60 scl_rise_cnt 60 total_cnt 2000 scl_hcnt 920 scl_lcnt 1080 [ 11.141563] [iWare][Info] hisi_i2c_calcu_cfg_cnt sda_hold_cnt 80 spk_len 5 scl_hcnt 848 scl_lcnt 1019 [ 11.151068] hisi-i2c faab0000.i2c: [iWare][Info] hisi_i2c_probe end [ 11.157580] hisi-i2c faac0000.i2c: [iWare][Info] hisi_i2c_probe start [ 11.164093] hisi-i2c faac0000.i2c: [iWare][Info] i2c scl_high_ratio no cfg [ 11.171009] hisi-i2c faac0000.i2c: [iWare][Info] get rst and clk from dts [ 11.186998] [iWare][Info] hisi_i2c_calcu_cfg_cnt bus_freq_hz 100000, scl_fall_cnt 60 scl_rise_cnt 60 total_cnt 2000 scl_hcnt 920 scl_lcnt 1080 [ 11.199925] [iWare][Info] hisi_i2c_calcu_cfg_cnt sda_hold_cnt 80 spk_len 5 scl_hcnt 848 scl_lcnt 1019 [ 11.209444] hisi-i2c faac0000.i2c: [iWare][Info] hisi_i2c_probe end [ 11.218700] pmbus_drv fa870000.pmbus0: [iWare][Info] hisi_pmbus_probe:start [ 11.225815] pmbus_drv fa870000.pmbus0: [iWare][Info] clk_freq 200 bus_freq 100000 scl_high_ratio 50, timeout_ms 35 high_idle_us 100 hold_time_ns 625 [ 11.239267] pmbus_drv fa870000.pmbus0: [iWare][Info] avs_wr_unlock_key 0x5a5a5a5a pmbus_wr_unlock_key 0x5a5a5a5a i2c_unlock_key 0x5a5a5a5a [ 11.251844] [iWare][Info] total_cnt 2000, hcnt=1000, lcnt=1000 hold_cnt=125, timeout_cnt=7000000, idle_cnt=20000, [ 11.262158] pmbus_drv fa870000.pmbus0: [iWare][Info] hisi_pmbus_probe: end [ 11.269205] pmbus_drv fa880000.pmbus1: [iWare][Info] hisi_pmbus_probe:start [ 11.276309] pmbus_drv fa880000.pmbus1: [iWare][Info] clk_freq 200 bus_freq 100000 scl_high_ratio 50, timeout_ms 35 high_idle_us 100 hold_time_ns 625 [ 11.289760] pmbus_drv fa880000.pmbus1: [iWare][Info] avs_wr_unlock_key 0x5a5a5a5a pmbus_wr_unlock_key 0x5a5a5a5a i2c_unlock_key 0x5a5a5a5a [ 11.302337] [iWare][Info] total_cnt 2000, hcnt=1000, lcnt=1000 hold_cnt=125, timeout_cnt=7000000, idle_cnt=20000, [ 11.312651] pmbus_drv fa880000.pmbus1: [iWare][Info] hisi_pmbus_probe: end [ 11.319689] pmbus_drv fa890000.pmbus2: [iWare][Info] hisi_pmbus_probe:start [ 11.326788] pmbus_drv fa890000.pmbus2: [iWare][Info] clk_freq 200 bus_freq 100000 scl_high_ratio 50, timeout_ms 35 high_idle_us 100 hold_time_ns 625 [ 11.340247] pmbus_drv fa890000.pmbus2: [iWare][Info] avs_wr_unlock_key 0x5a5a5a5a pmbus_wr_unlock_key 0x5a5a5a5a i2c_unlock_key 0x5a5a5a5a [ 11.352823] [iWare][Info] total_cnt 2000, hcnt=1000, lcnt=1000 hold_cnt=125, timeout_cnt=7000000, idle_cnt=20000, [ 11.363138] pmbus_drv fa890000.pmbus2: [iWare][Info] hisi_pmbus_probe: end [ 11.370173] pmbus_drv fa8a0000.pmbus3: [iWare][Info] hisi_pmbus_probe:start [ 11.377269] pmbus_drv fa8a0000.pmbus3: [iWare][Info] clk_freq 200 bus_freq 100000 scl_high_ratio 50, timeout_ms 35 high_idle_us 100 hold_time_ns 625 [ 11.390720] pmbus_drv fa8a0000.pmbus3: [iWare][Info] avs_wr_unlock_key 0x5a5a5a5a pmbus_wr_unlock_key 0x5a5a5a5a i2c_unlock_key 0x5a5a5a5a [ 11.403295] [iWare][Info] total_cnt 2000, hcnt=1000, lcnt=1000 hold_cnt=125, timeout_cnt=7000000, idle_cnt=20000, [ 11.413609] pmbus_drv fa8a0000.pmbus3: [iWare][Info] hisi_pmbus_probe: end [ 11.423408] sfc_drv fa5c0000.sfc0: [iWare][Info]sfc skip_host_reset 0, 0, 0, 0 [ 11.430719] sfc_drv fa5c0000.sfc0: [iWare][Info]clk_div= 2, hsfc->dummy_cnt= 4! 0, 0 [ 11.438504] sfc_drv fa5c0000.sfc0: [iWare][Info]hisi_sfc_register_nor! 0, 0, 0, 0 [ 11.446026] sfc_drv fa5c0000.sfc0: [iWare][Info]sfc-rx-bus-width = 1, 0, 0, 0 [ 11.453193] sfc_drv fa5c0000.sfc0: [iWare][Info]sfc-tx-bus-width = 1, 0, 0, 0 [ 11.466267] sfc_drv fa5c0000.sfc0: [iWare][Info]after spi_nor_scan read_proto(0x10101),write_proto(0x10101)addr_width(0x4),erase_op(0x21) [ 11.478678] sfc_drv fa5c0000.sfc0: [iWare][Info]read_op(0x13), dummy(0x0),pp_op(0x12),erasesize 4096 [ 11.520738] sfc_drv fa5c0000.sfc0: [iWare][Info]hisi_sfc_register_nor! 0, 0, 0, 0 [ 11.528272] sfc_drv fa5c0000.sfc0: [iWare][Info]sfc-rx-bus-width = 1, 0, 0, 0 [ 11.535443] sfc_drv fa5c0000.sfc0: [iWare][Info]sfc-tx-bus-width = 1, 0, 0, 0 [ 11.550161] sfc_drv fa5c0000.sfc0: [iWare][Error]cs 1 spi_nor_scan fail! 0, 0, 0 [ 11.557594] sfc_drv fa5c0000.sfc0: [iWare][Error]hisi_sfc_register_nor fail! 0, 0, 0, 0 [ 11.565636] sfc_drv fa5c0000.sfc0: [iWare][Info]total_blk_num =16384, 0, 0, 0 [ 11.572806] [iWare][Info]hisi_sfc_dfx_count_init, use malloc mem! 0, 0, 0, 0 [ 11.579930] [iWare][Info]init_mem_area inited success! 0, 0, 0, 0 [ 11.586324] [iWare][Info]init_mem_area inited success! 0, 0, 0, 0 [ 11.600428] hilink serdes: [iWare][Info]clock_route_mode not config, use default mode 0, 0000 [ 11.609108] hilink serdes: [iWare][Info]lane 0 dfe_param not cfg! defalut dfe = <1 1> 000 [ 11.617414] hilink serdes: [iWare][Info]lane 1 dfe_param not cfg! defalut dfe = <1 1> 000 [ 11.625717] hilink serdes: [iWare][Info]lane 8 dfe_param not cfg! defalut dfe = <1 1> 000 [ 11.634020] hilink serdes: [iWare][Info]lane 9 dfe_param not cfg! defalut dfe = <1 1> 000 [ 11.649135] hilink serdes: [iWare][Info]hserdes->reset_mode 0, 000 [ 11.655377] [iWare][Info]chip0 sema_wr init ... pass! [ 11.655383] [iWare][Info]chip_serdes_hardware_init ok [ 11.665533] [iWare][Info]Serdes init from dts, lane_mask = 0x3ff pcie_gen4_link_mode=0 00 [ 11.673748] [iWare][Info]macro_id=2, pcie_cnt=2, sata_cnt=0, 0 [ 11.679699] [iWare][Info]macro_id=2 serdes_reinit, 000 [ 11.684948] [iWare][Info]serdes_reinit:macro_id=2 lane_id=0, mac_id 5 rate:11 pcie_mode 2, pcie_width 2 [ 11.694474] [iWare][Info]serdes_reinit:macro_id=2 lane_id=1, mac_id 5 rate:11 pcie_mode 2, pcie_width 2 [ 11.704009] [iWare][Info]hisds_cs_init_det match, sds_id 6 cs need init [ 11.710658] [iWare][Info]hisds_cs_init_det match, sds_id 7 cs need init [ 11.717325] [iWare][Info]chip30_serdes_par_init_process line 142 macro 2 powerup [ 11.766898] [iWare][Info][macro_fw_init_calibration]Macro calibration success [ 11.776892] [iWare][Info]Adapt Config success! [ 11.776897] [iWare][Info]serdes_macro_init, macro_id=2 single_lane_init_mask=0xc 00 [ 11.789225] [iWare][Info]macro_id:2, lane:2,serdes_single_lane_init 00 [ 11.795875] [iWare][Info]chip_serdes_lane_init phy_sds_id 8 cs need init [ 11.802699] [iWare][Info]csinfo: macro_id = 2, pll_id = 0, rate = 6, refclk = 156250, refclk_sel = 0, vco_freq = 15000000, hs_clk = 10000000, use_mode = 64 [ 11.821475] [iWare][Info]Clockslice calibration success! [ 11.827123] [iWare][Info]ds 2 firmware reset success! [ 11.840429] [iWare][Info]macro_id:2, lane:3,serdes_single_lane_init 00 [ 11.852146] [iWare][Info]chip_serdes_lane_init phy_sds_id 9 cs no need init [ 11.859238] [iWare][Info]ds 3 firmware reset success! [ 11.873344] [iWare][Info]macro_id=0, pcie_cnt=0, sata_cnt=0, 0 [ 11.884364] [iWare][Info]macro_id=0 serdes_reinit, 000 [ 11.889613] [iWare][Info]serdes_reinit:macro_id=0 lane_id=0, mac_id 4 rate:2 pcie_mode 0, pcie_width 0 [ 11.899048] [iWare][Info]serdes_reinit:macro_id=0 lane_id=1, mac_id 5 rate:2 pcie_mode 0, pcie_width 0 [ 11.908483] [iWare][Info]serdes_reinit:macro_id=0 lane_id=2, mac_id 0 rate:18 pcie_mode 0, pcie_width 0 [ 11.918006] [iWare][Info]serdes_reinit:macro_id=0 lane_id=3, mac_id 1 rate:18 pcie_mode 0, pcie_width 0 [ 11.927536] [iWare][Info]hisds_cs_init_det match, sds_id 0 cs need init [ 11.934183] [iWare][Info]hisds_cs_init_det match, sds_id 1 cs need init [ 11.940830] [iWare][Info]hisds_cs_init_det match, sds_id 2 cs need init [ 11.947476] [iWare][Info]hisds_cs_init_det match, sds_id 3 cs need init [ 11.954142] [iWare][Info]chip30_serdes_par_init_process line 142 macro 0 powerup [ 12.008900] [iWare][Info][macro_fw_init_calibration]Macro calibration success [ 12.018886] [iWare][Info]Adapt Config success! [ 12.018890] [iWare][Info]serdes_macro_init, macro_id=0 single_lane_init_mask=0x0 00 [ 12.031220] [iWare][Info]macro_id=1, pcie_cnt=1, sata_cnt=1, 0 [ 12.037168] [iWare][Info]macro_id=1 serdes_reinit, 000 [ 12.042417] [iWare][Info]serdes_reinit:macro_id=1 lane_id=1, mac_id 0 rate:13 pcie_mode 2, pcie_width 1 [ 12.051947] [iWare][Info]hisds_cs_init_det match, sds_id 5 cs need init [ 12.058614] [iWare][Info]chip30_serdes_par_init_process line 142 macro 1 powerup [ 12.109900] [iWare][Info][macro_fw_init_calibration]Macro calibration success [ 12.119886] [iWare][Info]Adapt Config success! [ 12.119890] [iWare][Info]serdes_macro_init, macro_id=1 single_lane_init_mask=0x1 00 [ 12.132220] [iWare][Info]macro_id:1, lane:0,serdes_single_lane_init 00 [ 12.138866] [iWare][Info]chip_serdes_lane_init phy_sds_id 4 cs need init [ 12.145690] [iWare][Info]csinfo: macro_id = 1, pll_id = 0, rate = 17, refclk = 100000, refclk_sel = 1, vco_freq = 12000000, hs_clk = 6000000, use_mode = 2 [ 12.164643] [iWare][Info]Clockslice calibration success! [ 12.170081] [iWare][Info]ds 0 firmware reset success! [ 12.181352] [iWare][Info]serdes_ds_dfe_init: macro(0) ds(0) dfe init 1 1 [ 12.193266] [iWare][Info]serdes_ds_dfe_init: macro(0) ds(1) dfe init 1 1 [ 12.200006] [iWare][Info]serdes_ds_dfe_init: macro(2) ds(2) dfe init 1 1 [ 12.206846] [iWare][Info]serdes_ds_dfe_init: macro(2) ds(3) dfe init 1 1 [ 12.217692] udrv-pcie b00000000.pcie: [iWare] no declare type support, default rp mode [ 12.240709] [iWare][Info] host_id: 0x0 [ 12.244913] [iWare][Info] host_support_type_mask: 0x2 [ 12.249989] [iWare][Info] core_version: 0x0 [ 12.254190] [iWare][Info] msi_irq: 0x45 [ 12.258479] [iWare][Info] clk_num: 0x2 [ 12.262681] [iWare][Info] rst_num: 0x1 [ 12.266884] [iWare][Info] port_id: 0x0 [ 12.271085] [iWare][Info] port_type: 0x1 [ 12.275286] [iWare][Info] lport_id: 0x0 [ 12.279487] [iWare][Info] idr: 0x0 [ 12.283689] [iWare][Info] core_id: 0x0 [ 12.287891] [iWare][Info] lane_num: 0x1 [ 12.292092] [iWare][Info] target_speed: 0x1 [ 12.296294] [iWare][Info] max_lanes: 0x1 [ 12.300495] [iWare][Info] max_speed: 0x3 [ 12.304697] [iWare][Info] is_probe: 0x1 [ 12.308898] [iWare][Info] size = 0x1f800000 atu_mode = 0x0 [ 12.424354] udrv-pcie b00000000.pcie: [iWare][Info] msi#0 address_hi 0x0 address_lo 0x700000 [ 12.432847] udrv-pcie b00000000.pcie: [iWare][Info] msi#1 address_hi 0x0 address_lo 0x700000 [ 12.441324] udrv-pcie b00000000.pcie: [iWare][Info] msi#2 address_hi 0x0 address_lo 0x700000 [ 12.449801] udrv-pcie b00000000.pcie: [iWare][Info] msi#3 address_hi 0x0 address_lo 0x700000 [ 12.458278] udrv-pcie b00000000.pcie: [iWare][Info] msi#4 address_hi 0x0 address_lo 0x700000 [ 12.466755] udrv-pcie b00000000.pcie: [iWare][Info] msi#5 address_hi 0x0 address_lo 0x700000 [ 12.475232] udrv-pcie b00000000.pcie: [iWare][Info] msi#6 address_hi 0x0 address_lo 0x700000 [ 12.483708] udrv-pcie b00000000.pcie: [iWare][Info] msi#7 address_hi 0x0 address_lo 0x700000 [ 12.492185] udrv-pcie b00000000.pcie: [iWare][Info] msi#8 address_hi 0x0 address_lo 0x700000 [ 12.500662] udrv-pcie b00000000.pcie: [iWare][Info] msi#9 address_hi 0x0 address_lo 0x700000 [ 12.509139] udrv-pcie b00000000.pcie: [iWare][Info] msi#10 address_hi 0x0 address_lo 0x700000 [ 12.517703] udrv-pcie b00000000.pcie: [iWare][Info] msi#11 address_hi 0x0 address_lo 0x700000 [ 12.526267] udrv-pcie b00000000.pcie: [iWare][Info] msi#12 address_hi 0x0 address_lo 0x700000 [ 12.534830] udrv-pcie b00000000.pcie: [iWare][Info] msi#13 address_hi 0x0 address_lo 0x700000 [ 12.543394] udrv-pcie b00000000.pcie: [iWare][Info] msi#14 address_hi 0x0 address_lo 0x700000 [ 12.551958] udrv-pcie b00000000.pcie: [iWare][Info] msi#15 address_hi 0x0 address_lo 0x700000 [ 12.560521] udrv-pcie b00000000.pcie: [iWare][Info] msi#16 address_hi 0x0 address_lo 0x700000 [ 12.569085] udrv-pcie b00000000.pcie: [iWare][Info] msi#17 address_hi 0x0 address_lo 0x700000 [ 12.577648] udrv-pcie b00000000.pcie: [iWare][Info] msi#18 address_hi 0x0 address_lo 0x700000 [ 12.586212] udrv-pcie b00000000.pcie: [iWare][Info] msi#19 address_hi 0x0 address_lo 0x700000 [ 12.594775] udrv-pcie b00000000.pcie: [iWare][Info] msi#20 address_hi 0x0 address_lo 0x700000 [ 12.603349] udrv-pcie b00000000.pcie: [iWare][Info] msi#21 address_hi 0x0 address_lo 0x700000 [ 12.611914] udrv-pcie b00000000.pcie: [iWare][Info] msi#22 address_hi 0x0 address_lo 0x700000 [ 12.620478] udrv-pcie b00000000.pcie: [iWare][Info] msi#23 address_hi 0x0 address_lo 0x700000 [ 12.629042] udrv-pcie b00000000.pcie: [iWare][Info] msi#24 address_hi 0x0 address_lo 0x700000 [ 12.637606] udrv-pcie b00000000.pcie: [iWare][Info] msi#25 address_hi 0x0 address_lo 0x700000 [ 12.646170] udrv-pcie b00000000.pcie: [iWare][Info] msi#26 address_hi 0x0 address_lo 0x700000 [ 12.654734] udrv-pcie b00000000.pcie: [iWare][Info] msi#27 address_hi 0x0 address_lo 0x700000 [ 12.663297] udrv-pcie b00000000.pcie: [iWare][Info] msi#28 address_hi 0x0 address_lo 0x700000 [ 12.671860] udrv-pcie b00000000.pcie: [iWare][Info] msi#29 address_hi 0x0 address_lo 0x700000 [ 12.680423] udrv-pcie b00000000.pcie: [iWare][Info] msi#30 address_hi 0x0 address_lo 0x700000 [ 12.688987] udrv-pcie b00000000.pcie: [iWare][Info] msi#31 address_hi 0x0 address_lo 0x700000 [ 12.698007] udrv-pcie b00000000.pcie: [iWare][Info] msi#0 address_hi 0x0 address_lo 0x700000 [ 12.732152] udrv-pcie b20000000.pcie: [iWare] no declare type support, default rp mode [ 12.755170] [iWare][Info] host_id: 0x1 [ 12.759376] [iWare][Info] host_support_type_mask: 0x2 [ 12.764450] [iWare][Info] core_version: 0x0 [ 12.768651] [iWare][Info] msi_irq: 0x46 [ 12.772941] [iWare][Info] clk_num: 0x2 [ 12.777142] [iWare][Info] rst_num: 0x1 [ 12.781345] [iWare][Info] port_id: 0x0 [ 12.785546] [iWare][Info] port_type: 0x1 [ 12.789749] [iWare][Info] lport_id: 0x1 [ 12.793951] [iWare][Info] idr: 0x1 [ 12.798153] [iWare][Info] core_id: 0x0 [ 12.802355] [iWare][Info] lane_num: 0x1 [ 12.806558] [iWare][Info] target_speed: 0x1 [ 12.810759] [iWare][Info] max_lanes: 0x1 [ 12.814962] [iWare][Info] max_speed: 0x3 [ 12.819163] [iWare][Info] is_probe: 0x0 [ 12.823366] [iWare][Info] size = 0x1f800000 atu_mode = 0x0 [ 12.861135] udrv-pcie b40000000.pcie: [iWare] no declare type support, default rp mode [ 12.884117] [iWare][Info] host_id: 0x2 [ 12.888323] [iWare][Info] host_support_type_mask: 0x2 [ 12.893399] [iWare][Info] core_version: 0x0 [ 12.897601] [iWare][Info] msi_irq: 0x47 [ 12.901891] [iWare][Info] clk_num: 0x2 [ 12.906092] [iWare][Info] rst_num: 0x1 [ 12.910295] [iWare][Info] port_id: 0x0 [ 12.914496] [iWare][Info] port_type: 0x1 [ 12.918699] [iWare][Info] lport_id: 0x2 [ 12.922901] [iWare][Info] idr: 0x2 [ 12.927103] [iWare][Info] core_id: 0x0 [ 12.931305] [iWare][Info] lane_num: 0x1 [ 12.935507] [iWare][Info] target_speed: 0x1 [ 12.939708] [iWare][Info] max_lanes: 0x1 [ 12.943911] [iWare][Info] max_speed: 0x3 [ 12.948114] [iWare][Info] is_probe: 0x0 [ 12.952317] [iWare][Info] size = 0x1f800000 atu_mode = 0x0 [ 12.990050] udrv-pcie b60000000.pcie: [iWare] no declare type support, default rp mode [ 13.013032] [iWare][Info] host_id: 0x3 [ 13.017238] [iWare][Info] host_support_type_mask: 0x2 [ 13.022313] [iWare][Info] core_version: 0x0 [ 13.026515] [iWare][Info] msi_irq: 0x48 [ 13.030804] [iWare][Info] clk_num: 0x2 [ 13.035006] [iWare][Info] rst_num: 0x1 [ 13.039209] [iWare][Info] port_id: 0x0 [ 13.043410] [iWare][Info] port_type: 0x1 [ 13.047611] [iWare][Info] lport_id: 0x3 [ 13.051813] [iWare][Info] idr: 0x3 [ 13.056015] [iWare][Info] core_id: 0x0 [ 13.060217] [iWare][Info] lane_num: 0x1 [ 13.064420] [iWare][Info] target_speed: 0x1 [ 13.068622] [iWare][Info] max_lanes: 0x1 [ 13.072825] [iWare][Info] max_speed: 0x3 [ 13.077027] [iWare][Info] is_probe: 0x0 [ 13.081230] [iWare][Info] size = 0x1f800000 atu_mode = 0x0 [ 13.118957] udrv-pcie b80000000.pcie: [iWare] no declare type support, default rp mode [ 13.141928] [iWare][Info] host_id: 0x4 [ 13.146133] [iWare][Info] host_support_type_mask: 0x2 [ 13.151208] [iWare][Info] core_version: 0x0 [ 13.155410] [iWare][Info] msi_irq: 0x49 [ 13.159700] [iWare][Info] clk_num: 0x2 [ 13.163903] [iWare][Info] rst_num: 0x1 [ 13.168105] [iWare][Info] port_id: 0x0 [ 13.172308] [iWare][Info] port_type: 0x1 [ 13.176511] [iWare][Info] lport_id: 0x4 [ 13.180713] [iWare][Info] idr: 0x4 [ 13.184915] [iWare][Info] core_id: 0x0 [ 13.189118] [iWare][Info] lane_num: 0x2 [ 13.193320] [iWare][Info] target_speed: 0x1 [ 13.197522] [iWare][Info] max_lanes: 0x1 [ 13.201724] [iWare][Info] max_speed: 0x3 [ 13.205927] [iWare][Info] is_probe: 0x0 [ 13.210130] [iWare][Info] size = 0x1f800000 atu_mode = 0x0 [ 13.247854] udrv-pcie ba0000000.pcie: [iWare] no declare type support, default rp mode [ 13.270833] [iWare][Info] host_id: 0x5 [ 13.275037] [iWare][Info] host_support_type_mask: 0x2 [ 13.280112] [iWare][Info] core_version: 0x0 [ 13.284315] [iWare][Info] msi_irq: 0x4a [ 13.288605] [iWare][Info] clk_num: 0x2 [ 13.292807] [iWare][Info] rst_num: 0x1 [ 13.297010] [iWare][Info] port_id: 0x0 [ 13.301213] [iWare][Info] port_type: 0x1 [ 13.305415] [iWare][Info] lport_id: 0x5 [ 13.309617] [iWare][Info] idr: 0x5 [ 13.313820] [iWare][Info] core_id: 0x0 [ 13.318021] [iWare][Info] lane_num: 0x2 [ 13.322224] [iWare][Info] target_speed: 0x3 [ 13.326426] [iWare][Info] max_lanes: 0x2 [ 13.330629] [iWare][Info] max_speed: 0x3 [ 13.334832] [iWare][Info] is_probe: 0x1 [ 13.339034] [iWare][Info] size = 0x1f800000 atu_mode = 0x0 [ 13.454261] udrv-pcie ba0000000.pcie: [iWare][Info] msi#0 address_hi 0x0 address_lo 0x700000 [ 13.462754] udrv-pcie ba0000000.pcie: [iWare][Info] msi#1 address_hi 0x0 address_lo 0x700000 [ 13.471233] udrv-pcie ba0000000.pcie: [iWare][Info] msi#2 address_hi 0x0 address_lo 0x700000 [ 13.479711] udrv-pcie ba0000000.pcie: [iWare][Info] msi#3 address_hi 0x0 address_lo 0x700000 [ 13.488189] udrv-pcie ba0000000.pcie: [iWare][Info] msi#4 address_hi 0x0 address_lo 0x700000 [ 13.496666] udrv-pcie ba0000000.pcie: [iWare][Info] msi#5 address_hi 0x0 address_lo 0x700000 [ 13.505144] udrv-pcie ba0000000.pcie: [iWare][Info] msi#6 address_hi 0x0 address_lo 0x700000 [ 13.513622] udrv-pcie ba0000000.pcie: [iWare][Info] msi#7 address_hi 0x0 address_lo 0x700000 [ 13.522099] udrv-pcie ba0000000.pcie: [iWare][Info] msi#8 address_hi 0x0 address_lo 0x700000 [ 13.530577] udrv-pcie ba0000000.pcie: [iWare][Info] msi#9 address_hi 0x0 address_lo 0x700000 [ 13.539054] udrv-pcie ba0000000.pcie: [iWare][Info] msi#10 address_hi 0x0 address_lo 0x700000 [ 13.547619] udrv-pcie ba0000000.pcie: [iWare][Info] msi#11 address_hi 0x0 address_lo 0x700000 [ 13.556183] udrv-pcie ba0000000.pcie: [iWare][Info] msi#12 address_hi 0x0 address_lo 0x700000 [ 13.564748] udrv-pcie ba0000000.pcie: [iWare][Info] msi#13 address_hi 0x0 address_lo 0x700000 [ 13.573312] udrv-pcie ba0000000.pcie: [iWare][Info] msi#14 address_hi 0x0 address_lo 0x700000 [ 13.581877] udrv-pcie ba0000000.pcie: [iWare][Info] msi#15 address_hi 0x0 address_lo 0x700000 [ 13.590446] udrv-pcie ba0000000.pcie: [iWare][Info] msi#16 address_hi 0x0 address_lo 0x700000 [ 13.599010] udrv-pcie ba0000000.pcie: [iWare][Info] msi#17 address_hi 0x0 address_lo 0x700000 [ 13.607575] udrv-pcie ba0000000.pcie: [iWare][Info] msi#18 address_hi 0x0 address_lo 0x700000 [ 13.616139] udrv-pcie ba0000000.pcie: [iWare][Info] msi#19 address_hi 0x0 address_lo 0x700000 [ 13.624703] udrv-pcie ba0000000.pcie: [iWare][Info] msi#20 address_hi 0x0 address_lo 0x700000 [ 13.633268] udrv-pcie ba0000000.pcie: [iWare][Info] msi#21 address_hi 0x0 address_lo 0x700000 [ 13.641832] udrv-pcie ba0000000.pcie: [iWare][Info] msi#22 address_hi 0x0 address_lo 0x700000 [ 13.650397] udrv-pcie ba0000000.pcie: [iWare][Info] msi#23 address_hi 0x0 address_lo 0x700000 [ 13.658961] udrv-pcie ba0000000.pcie: [iWare][Info] msi#24 address_hi 0x0 address_lo 0x700000 [ 13.667525] udrv-pcie ba0000000.pcie: [iWare][Info] msi#25 address_hi 0x0 address_lo 0x700000 [ 13.676090] udrv-pcie ba0000000.pcie: [iWare][Info] msi#26 address_hi 0x0 address_lo 0x700000 [ 13.684654] udrv-pcie ba0000000.pcie: [iWare][Info] msi#27 address_hi 0x0 address_lo 0x700000 [ 13.693219] udrv-pcie ba0000000.pcie: [iWare][Info] msi#28 address_hi 0x0 address_lo 0x700000 [ 13.701783] udrv-pcie ba0000000.pcie: [iWare][Info] msi#29 address_hi 0x0 address_lo 0x700000 [ 13.710348] udrv-pcie ba0000000.pcie: [iWare][Info] msi#30 address_hi 0x0 address_lo 0x700000 [ 13.718913] udrv-pcie ba0000000.pcie: [iWare][Info] msi#31 address_hi 0x0 address_lo 0x700000 [ 13.727925] udrv-pcie ba0000000.pcie: [iWare][Info] msi#0 address_hi 0x0 address_lo 0x700000 [ 13.762078] udrv-pcie bc0000000.pcie: [iWare] no declare type support, default rp mode [ 13.785069] [iWare][Info] host_id: 0x6 [ 13.789272] [iWare][Info] host_support_type_mask: 0x2 [ 13.794348] [iWare][Info] core_version: 0x0 [ 13.798549] [iWare][Info] msi_irq: 0x4b [ 13.802839] [iWare][Info] clk_num: 0x2 [ 13.807040] [iWare][Info] rst_num: 0x1 [ 13.811242] [iWare][Info] port_id: 0x0 [ 13.815443] [iWare][Info] port_type: 0x1 [ 13.819644] [iWare][Info] lport_id: 0x6 [ 13.823845] [iWare][Info] idr: 0x6 [ 13.828047] [iWare][Info] core_id: 0x0 [ 13.832248] [iWare][Info] lane_num: 0x1 [ 13.836450] [iWare][Info] target_speed: 0x1 [ 13.840651] [iWare][Info] max_lanes: 0x1 [ 13.844852] [iWare][Info] max_speed: 0x3 [ 13.849053] [iWare][Info] is_probe: 0x0 [ 13.853256] [iWare][Info] size = 0x1f800000 atu_mode = 0x0 [ 13.891008] udrv-pcie be0000000.pcie: [iWare] no declare type support, default rp mode [ 13.913979] [iWare][Info] host_id: 0x7 [ 13.918183] [iWare][Info] host_support_type_mask: 0x2 [ 13.923257] [iWare][Info] core_version: 0x0 [ 13.927458] [iWare][Info] msi_irq: 0x4c [ 13.931747] [iWare][Info] clk_num: 0x2 [ 13.935948] [iWare][Info] rst_num: 0x1 [ 13.940149] [iWare][Info] port_id: 0x0 [ 13.944350] [iWare][Info] port_type: 0x1 [ 13.948551] [iWare][Info] lport_id: 0x7 [ 13.952753] [iWare][Info] idr: 0x7 [ 13.956955] [iWare][Info] core_id: 0x0 [ 13.961156] [iWare][Info] lane_num: 0x1 [ 13.965357] [iWare][Info] target_speed: 0x1 [ 13.969558] [iWare][Info] max_lanes: 0x1 [ 13.973758] [iWare][Info] max_speed: 0x3 [ 13.977961] [iWare][Info] is_probe: 0x0 [ 13.982163] [iWare][Info] size = 0x1f800000 atu_mode = 0x0 [ 14.022852] sata_hisi d8500000.sata_dfx: [iWare][Info] get rst and clk from dts [ 14.030355] [iWare][Info]set tx_bitorder 0 , rx_bitorder 1 [ 14.038323] [iWare][Info] udrv log init ok [ 14.093780] usb_hisi usb_hisi_0: [iWare] no misc base [ 14.099241] usb_hisi usb_hisi_1: [iWare] no misc base [ 371.687427] [iWare][Error] pmbus_write timeout! raw_int_status:0x10 [ 371.694731] [iWare][Info] pmbus hang recovery done [ 2064.422683] [iWare][Error] pmbus_write timeout! raw_int_status:0x10 [ 2064.429992] [iWare][Info] pmbus hang recovery done [ 2069.219986] [iWare][Error] wait read_finish timeout!! read_len[2] fifo num[0], raw_int_status:0x10 [ 2069.229992] [iWare][Info] pmbus hang recovery done [ 2069.234807] [iWare][Error] pmbus_read_bytes_v200 slave_addr(0x70), cmd(0x8b), time out [ 2069.243769] [iWare][Info] pmbus hang recovery done [ 2085.989229] [iWare][Error] pmbus_write timeout! raw_int_status:0x10 [ 2085.996530] [iWare][Info] pmbus hang recovery done hi309a /lib/udrivers # timed out waiting for input: auto-logoutprocess '/sbin/getty 115200 ttyS0' (pid 670) exited. Scheduling for restart. starting pid 692, tty '/dev/ttyS0': '/sbin/getty 115200 ttyS0' openEuler Embedded(openEuler Embedded Reference Distro) 24.03-LTS hi309a /dev/ttyS0 ______ _ | ____| | | ___ ____ ___ _____| |__ _ _| | ___ _ __ / _ \| _ \ / _ \ _ | __|| | | | |/ _ \ '__| | (_) | |_) | __/ | | | |___| |_| | | __/ | \___/| __/ \___|_| |_|______\____|_|\___|_| | | _____ _ _ _ _ |_| | __|_____| |_ ___ _| |_| |___ _| | | __| | . | -_| . | . | -_| . | |_____|_|_|_|___|___|___|___|___|___| Authorized uses only. All activity may be monitored and reported. 监控总线状态打印如上 请根据以上几段代码,帮我分析我出现kdrv_pmbus_write_word fail bus_id:1, addr:0x70, cmd:0x21的原因可能是什么,并给出完整解决方案”
最新发布
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值